NOTE: These features are not yet enabled on the server! They will be enabled by Monday, October 16. ==================[ Server protocol ]================== The server new offers three additional APIs. 1. Retrieving the cat list: GET catlist.pl?name=&password=&mode=easy for the easy mode, and catlist.pl?name=&password=&mode=hard for the hard mode. In the hard mode, you have to be closer to the cat, and the location returned in the cat list is treated as approximate; the actual location will be close but different; watch the error messages when trying to pet a cat in the hard mode. When the mode parameter is missing, it is considered to be "easy" E.g., catlist.pl?name=sergey&password=1234 returns a JSON Array of cats: [ { "catId": "1", "name": "Fluffy", "picUrl": "http://cs65.cs.dartmouth.edu/kitty/<..>", "lat": 79.172653871, "lng": 76.127368, "petted": "false" }, ... ] or catlist.pl?name=sergey&password=1234&mode=hard for the hard mode. The list and the mode will remain in force until you reset your cat list (see #3 below). 2. Petting a cat: GET pat.pl?name=&password=&catid=&lat=&lng= E.g.: pat.pl?name=sergey&password=1234&catid=1&lat=74.2523&lng=74.2134 Returns the status of the operation: {"catId": "1", "status":"OK"} or { "status":"ERROR", "code": "TOO_FAR", "reason": "Too far from the cat" } { "status":"ERROR", "code": "MISSING_ID", "reason": "Cat ID missing from request" } { "status":"ERROR", "code": "NO_ID", "reason": "No cat by that ID" } { "status":"ERROR", "code": "MISSING_LAT", "reason": "Latitude missing from request" } { "status":"ERROR", "code": "MISSING_LNG", "reason": "Longitude missing from request" } The error codes are fixed. The code field in a response is expected to precisely match one these fixed values. In the hard mode, sometimes the approximate location will work, sometimes you will need to walk as far as 10--15 meters in the right direction to succeed. 3. Reset the cat list for the player: resetlist.pl?name=&password= Returns status of the operation: {"status":"OK"} or {"status":"ERROR", "code":"NO_NAME", "error":"No record for name" } {"status":"ERROR", "code":"AUTH_FAIL", "error":"Password doesn't match stored password"} etc. 4. Change the user's password: changepass.pl?name=&password=&newpass= Returns: {"status":"OK"} or {"status":"ERROR", "code":"NEWPASS_EMPTY", "error":"Request must contain a non-empty 'newpass' parameter"} {"status":"ERROR", "code":"NO_NAME", "error":"No record for name" } {"status":"ERROR", "code":"AUTH_FAIL", "error":"Password doesn't match stored password"} etc.