Specification.txt 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. RakNet is using a PHP page to hold listings of running games. For example, I might run a server whose name is "MyServer" with the game mode "Deathmatch" and I want people to know that this server is running. Other people would connect to this webpage to download the list of running servers, in which case you would return those two fields to them.
  2. General requirements:
  3. 1. Page must not assume any kind of database or special configuration, other than the ability to run PHP
  4. 2. Operations must work 100% of the time.
  5. Operations:
  6. 1. Admin: When the PHP is run, if no password file exists, prompt to set two passwords: Upload and download. The user must set both passwords before the system will do any other functionality. When the passwords are set, create the password file. The password file must not be readable by the general public. The passwords must be checked for syntax such that they can be used in subsequent operations and passed in the URL. There are otherwise no restrictions on what can be used for passwords. Once the two passwords are set, the only way to change them is to delete the file that holds the passwords. After doing so, the page will once again prompt to set the two passwords.
  7. If in any operation the password is required and missing or incorrect, simply ignore the operation.
  8. 2. Upload:
  9. A. User executes DirectoryServer.php?query=upload&uploadPassword=yyy
  10. B. Body of the message contains data to store. Every odd indexed field is the column name. Every even indexed field is the value. Fields are separated by ASCII value 1.
  11. C. Column names will always contain at a minimum __GAME_PORT and __GAME_NAME
  12. D. A column name __System_Address with corresponding value is automatically added to the input, based on the IP address of the system doing the upload. If the body of the message also contains __System_Address as a column name, use that instead of the automatically generated column.
  13. E. A column name __SEC_AFTER_EPOCH_SINCE_LAST_ <div class="ii gt" id=":xy"><wbr></wbr>UPDATE with a corresponding value is automatically added to the input, based on the current time of the update.
  14. F. If the __System_Address, __GAME_PORT, and __GAME_NAME fields all match an existing entry, overwrite that row
  15. Input example:
  16. __GAME_PORT?1235?__GAME_NAME?
  17. My game?MapType?Deathmatch?Number of players?5
  18. Stored example:
  19. __GAME_PORT=1235
  20. __GAME_NAME=My game
  21. MapType=Deathmatch
  22. NumberOfPlayers=5
  23. __System_Address="1.2.4.5"
  24. __SEC_AFTER_EPOCH_SINCE_LAST_UPDATE=1234567
  25. 3. Download
  26. A. User executes DirectoryServer.php?query=download&downloadPassword=xxx
  27. B. Return all rows stored that are less than 60 seconds old
  28. C. Output format is same as input, except that ASCII value 2 is used to separate rows
  29. Output example, with two rows returned
  30. __GAME_PORT?1235?__GAME_NAME?
  31. My game?__System_Address?1.2.4.5?__SEC_AFTER_EPOCH_SINCE_LAST_UPDATE?1234567?MapType?Deathmatch?Number of players?5?__GAME_PORT?1236?__GAME_NAME?My game 2?__System_Address?1.2.4.5?__SEC_AFTER_EPOCH_SINCE_LAST_UPDATE?188888?MapType?Deathmatch?Number of players?3
  32. Not all entries necessarily have the same number or types of columns
  33. 4. Upload and download
  34. A. User executes DirectoryServer.php?query=upDown&downloadPassword=xxx&uploadPassword=yyy
  35. B. Prepare query result, same as if the user had executed DirectoryServer.php?query=download
  36. C. Add to table data, same as if the user had executed DirectoryServer.php?query=upload
  37. D. Uploaded data from step C is not returned in query
  38. 5. Expire rows
  39. If a row is more than 60 seconds old, remove it from the records
  40. 6. Viewing
  41. Viewing the webpage with no commands should display the uploaded entries. No password is required for viewing the webpage
  42. Testing:
  43. You will be provided with two Windows applications to test with that should follow the specified data protocol. One is a console application that will repeatedly update and query over time. Another is a game that will upload and download at the same time when the game is started. The PHP page must work consistently with both applications to be considered acceptable. In order to run the test applications you must have Windows installed.
  44. The PHP file must work correctly on both your own internal test server, and on jenkinssoftware.com.
  45. All inputs must be accepted and processed correctly, including 0, or empty strings. A 0 is treated as a string, the same as any other string. Empty strings generate a column with no entry in that field.
粤ICP备19079148号