First of all, I want to thank all Sea Men who don't have big names. Because in the end you carried us to victory.
Next I come to individuals who were mainly active during the Europe period.
Gloin the little beast from my faction for his great achievement. XAsukaX for the "night shifts" and the daily greeting of the European players. WhackadillyWoo, who gave me the confidence to do the countdown myself as a temporary cum captain. Natty_Boh, as the leader of our bounty train who successfully took our low levels out of the game. Tipsy, as our "night shift" strategist who accompanied us until Stretch woke up again. Stretch that everyone knows and appreciates.
And finally Ishtar who promised kisses to everyone if Total Bankers had survived until she was awake. Unfortunately, she fell asleep again and Totaler Bankers were eliminated.
If possible, get some mySql Admin/Expert to analyse this situation in the DBMS Logs. My experience with execution spikes were always configuration problems of the DBMS. For example a to small Undo-Log or the Optimizer/Statistics Analyzer is running in a bad time or gets too few memory.
Probally it is not a problem with a inperformant DML or bad Index. Because in this case you would get slowly increasing execution times or always long execution times.
Wish you the best luck and a really good sql admin.
For a while now, I've been bothered by the way the API reports errors. So I thought about how a general mapping function could look like to encapsulate the design flaw. I think in other dynamic languages the mapping can be used almost the same way.
If they ever change the API to the http standard, the function is robust and will not break.
I had to remove the source, because the forum does not preserve the spaces. Here is the working fiddle.
Just replace the 2 value in the env-vars with your api-key.
First of all, I want to thank all Sea Men who don't have big names. Because in the end you carried us to victory.
Next I come to individuals who were mainly active during the Europe period.
Gloin the little beast from my faction for his great achievement. XAsukaX for the "night shifts" and the daily greeting of the European players. WhackadillyWoo, who gave me the confidence to do the countdown myself as a temporary cum captain. Natty_Boh, as the leader of our bounty train who successfully took our low levels out of the game. Tipsy, as our "night shift" strategist who accompanied us until Stretch woke up again. Stretch that everyone knows and appreciates.
And finally Ishtar who promised kisses to everyone if Total Bankers had survived until she was awake. Unfortunately, she fell asleep again and Totaler Bankers were eliminated.
response.raise_for_status() throws/raises an HTTPError. This is the nice thing in this example. You don't have to care if it is a clouflare error or a torn error. :)
For a while now, I've been bothered by the way the API reports errors. So I thought about how a general mapping function could look like to encapsulate the design flaw. I think in other dynamic languages the mapping can be used almost the same way.
If they ever change the API to the http standard, the function is robust and will not break.
I had to remove the source, because the forum does not preserve the spaces. Here is the working fiddle.
Just replace the 2 value in the env-vars with your api-key.
The documentation is not complete. In addition, there are no examples or structure descriptions for the responses. As I said, I will maintain this in the next few days.
It's still a work in progress. But I have already published it now, so that you can get a first impression and to get helpers on board. My previous attempts to use the description language as a possible documentation base have failed due to subsequent tool discussions in the Discord API channel.
I have noticed that very few people know the term OpenAPI. So here is the description of what OpenAPI is.
The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. An OpenAPI definition can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
In the next days I will maintain examples of the API's responses and record the structure of the responses. If someone wants to join in, I can move the project to github.
Overloading a column with a valid value (999 days in the future) to mark it as permanent is... interesting (code smell) This design decision is a potential root cause for a hard to find bug.
Two Design possiblities for this case:
- add a state "Federal Permanent" - use a negative value (e.g. -1) in the until column
If you just want to use the api, go for a quick example of a HTTP GET Request in the language you want to use plus a well known json parser in your language. Don't try to parse the response by yourself.
If you want to go further, than following URL is a great resource for everything about Web Technology. https://developer.mozilla.org/
If possible, get some mySql Admin/Expert to analyse this situation in the DBMS Logs. My experience with execution spikes were always configuration problems of the DBMS. For example a to small Undo-Log or the Optimizer/Statistics Analyzer is running in a bad time or gets too few memory.
Probally it is not a problem with a inperformant DML or bad Index. Because in this case you would get slowly increasing execution times or always long execution times.
Wish you the best luck and a really good sql admin.
I can only say that it is not good practice to return a 404 status code to a human. Not everyone deals extensively with the things you should do and things you can do. Look at the big frameworks. Usually the undefined errors are caught by middleware and converted to an HTTP 200.
You must distinguish between human users and machines. Humans can do little with technical errors that are incomprehensible to them. That is why there are usually only 2xx or 3xx status codes.
For an API that is developed for machines, the HTTP status code is just the right thing. Because the HTTP Status Code is internationally standardized and machines love structured and standardized data. In addition, the semantics of the status codes are already described. This reduces the effort for Torn developers, because everything has already been described by the IETF. They would only have to use it. See https://tools.ietf.org/html/rfc7231#section-6.1
No need for custom HTTP Headers. HTTP Status Code is the thing they should use.
HTTP 500 => 0 => 'Unknown error' : Unhandled error, should not occur. HTTP 400 => 1 => 'Key is empty' : Private key is empty in current request. HTTP 400 => 2 => 'Incorrect Key' : Private key is wrong/incorrect format. HTTP 400 => 3 => 'Wrong type' : Requesting an incorrect basic type. HTTP 400 => 4 => 'Wrong fields' : Requesting incorrect selection fields. HTTP 429 => 5 => 'Too many requests' : Current private key is banned for a small period of time because of too many requests (max 100 per minute). HTTP 400 => 6 => 'Incorrect ID' : Wrong ID value. HTTP 403 => 7 => 'Incorrect ID-entity relation' : A requested selection is private (For example, personal data of another user / faction). HTTP 403 => 8 => 'IP block' : Current IP is banned for a small period of time because of abuse. HTTP 503 =>9 => 'API disabled' : Api system is currently disabled. HTTP 403 => 10 => 'Key owner is in federal jail' : Current key can't be used because owner is in federal jail. HTTP 403 => 11 => 'Key change error: You can only change your API key once every 60 seconds'. HTTP 500 => 12 => 'Key read error: Error reading key from Database'.