NoQ wrote:I guess it could be something like "number of unique ip addresses who obtained the list of games in last few minutes".
Usually, when the list of games is sent, people join one of those games in the list, so, they are no longer waiting, and wouldn't be counted, but, I still don't see the point of this information.
What usually happens is they click like mad on the refresh button, nothing appears, and they do something else.
When a host decides to host, they stay on the server, until the game fills up, or they quit because of not enough people.
Right now, we tell people how long it has been since the last game that was hosted was.
Lobby is the wrong terminology for what is going on, the only time people are actually in a lobby is when they join a game.
MIH-XTC wrote:I think the problem is that checking for unique players is done at the OS level on the lobby hosting server since WZ is p2p and then somehow that information needs to get patched into WZ the application which implies a dependency between WZ’s code and the OS of the lobby server. You can setup a cron job on the lobby server to run netstat and keep track of the unique connections on port 2100 and output to .txt, then have WZ read from that file but if the lobby server OS were to ever get reinstalled, then WZ’s code is dependent upon a batch job that no longer exists. It’s not a big deal to recreate the job but it’s just unsettling to think the applications code is dependent upon the OS in that manner. Not sure if that’s considered a bad practice or not.
Is there another way of doing this?
EDIT: Does the lobby server run a special instance of WZ to act as the lobby?
In a nutshell, all the server does is, when a host connects, it sends the needed info for that game, and holds onto that info until the host quits/starts a game.
When a player connects to said server, all they get is a list of games currently waiting for players (which has everything needed to connect to said host(s)).
When a player clicks on one of those games, they connect directly to the host, the server isn't touched again by the clients.
The host does notify the server that there is 1 more player, so it will update the stats the next time a game list is requested.
All this is done via python using a modified version of
https://github.com/Warzone2100/wzlobbyserver-ng It really is quite trivial.