RPGWO Forums

General => RPGWO Chat => Topic started by: rogue on August 20, 2021, 04:46:30 pm

Title: RPGWO 2 Server API
Post by: rogue on August 20, 2021, 04:46:30 pm
exe: https://rpgwoforums.net/index.php?action=downloads;sa=view;id=58
source: attached this post, C# Win32. I'm not used to win32 (mostly write in .net core and linux), so it may be a bit non-idiomatic.

Routes

Current version provides this routes:
GET /api/whos-online
POST /api/world-reload
POST /api/world-save

Next version will have ability for a lagging/timed out client to request their own client be kicked with a delay (so they can't use it to cheating PK). So they do not have to wait for the winsock timeout.

I use this for automatically triggering world reloads when new inis are updated, and for pulling player counts and online users into a time series database by polling the endpoint.

Instruction
Run AFTER starting the rpgwo server, or it will tell you it can't find the server window and exit.
Optionally, run in ip and port as arguments ("Caretaker.exe 127.0.0.1 6000" to bind webserver in localhost port 6000).

Example
(https://i.imgur.com/NCctBrA.gif)
Title: Re: RPGWO 2 Server API
Post by: Jon The Great on August 20, 2021, 06:26:36 pm
Very nice! Thanks for including the source code as well!