squarepear / RoverBot

A bot specially designed for AC:CF Wiimmfi Server
https://discord.gg/yB8qyQh
MIT License
3 stars 2 forks source link

Wiimmfi API sorta... #19

Open angeloanan opened 6 years ago

angeloanan commented 6 years ago

Error codes

Base url: https://wiimmfi.de/error?e=<5digits of error code>&&m=json With error 86420, returned with this:

[{"error":86420,"found":1,"infolist":[{"type":"Class","name":"8xxxx","info":"Server error during matchmaking."},{"type":"Section","name":"86xxx","info":"<a href=\"https:\/\/wiimmfi.de\/development#natneg\">NATNEG<\/a> errors."},{"type":"Error","name":"86420","info":"General error during <a href=\"https:\/\/wiimmfi.de\/development#natneg\">NATNEG<\/a> (connection to other players)."},{"type":"Solution","name":"86420","info":"Enable DMZ, or port forward UDP 1024-65535 for your Wii (router settings)."}]}]

Games

Base ACCF URL: https://wiimmfi.de/game/acrossingwii Add /text to it and it will return with cool stuff

Example output:

!id4!pid!fc!host!gid!ls_stat!ol_stat!status!suspend!n!name1!name2!
|RUUJ|600293419|3399-0270-9803|2|700658039|680069|o|6|0|1|||
|RUUJ|600294027|1036-7950-9131|2|708172487|760000|o|6|0|1|||
|RUUJ|600293378|4558-6682-6754|1|0|6C0061|og|2|0|1|||
|RUUJ|600293596|0607-2983-5740|1|0|6B0069|og|2|0|1|||

Accessed by me at some time. If it updates, it will go and updates.

IDEA: Every 5 min or so, check for FC changes. If there is new, set town online. If remove, set town offline. Use node-schedule for timing

5 min because RATELIMITED

angeloanan commented 6 years ago

IDEA: Every x minutes, HTTP/GET baseURL/text. Split every newline(\n), Start from line no 1, split |, get column 2 for FC, Store it on JSON DB

Every update, checks for diffs