Page 1 of 1

Display number of players in the lobby

Posted: 09 May 2017, 10:19
by erik_l
I often find myself waiting for players and/or games in the lobby, wondering if it's really as empty as it looks, or if there are other players watching the same empty screen as I am. Also when hosting a game, it would be nice to know if there are any players waiting in the lobby that are able to join.

My suggestion is that the number of players currently in the lobby (not in already started games) is shown, both on the lobby screen and on the host game screen. Preferrebly the number of players that actually are able to join, ie. on the same version as I am.

Re: Display number of players in the lobby

Posted: 11 May 2017, 00:20
by ZotaNexus
JUST DO IT, please :P

Re: Display number of players in the lobby

Posted: 13 May 2017, 21:47
by vexed
Do what?

There is no lobby per se.
It is all P2P, so, there isn't once centralized place where everyone joins waiting for games, so what is asked of, is impossible.

The best you can do is join #warzone2100-games (on IRC), and meet up there and plan games that way.

Re: Display number of players in the lobby

Posted: 14 May 2017, 15:35
by NoQ
I guess it could be something like "number of unique ip addresses who obtained the list of games in last few minutes".

Re: Display number of players in the lobby

Posted: 14 May 2017, 17:01
by MIH-XTC
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?

Re: Display number of players in the lobby

Posted: 14 May 2017, 23:04
by Terminator
Kaff ... Kaff :ninja:
:arrow: click here

Re: Display number of players in the lobby

Posted: 15 May 2017, 04:26
by vexed
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.

Re: Display number of players in the lobby

Posted: 23 May 2017, 11:01
by erik_l
vexed wrote:
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.
The point is that it would give me an idea of the amount of activity in the lobby. Also, if I'm hosting, the information would also tell me if there are people obtaining the game list, and still not joining my game, perhaps I should change some setting in my game to attract players. Given how things work according to the above posts, I think NoQ's idea seems like a good one. It would answer the question "Are there players who could join my game but don't, or are there simply no players here".
.