Xonotic Forums
determine whether there are human players - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Server Administration (https://forums.xonotic.org/forumdisplay.php?fid=16)
+--- Thread: determine whether there are human players (/showthread.php?tid=5742)

determine whether there are human players - BuddyFriendGuy - 08-10-2015

I'm trying to minimize the log file size (and possibly server load) by doing the following:

minplayers 2

so when there are no human players, bots will quit, too, and thus logs don't grow. Then when somebody does come to the server, there will be one bot to play against.

This works.

However, the server still keeps rotating maps, creating meaningless logs, so I do the following:

g_warmup 1
g_warmup_limit -1

so there will be unlimit warmup time. If there are no human players to end the warmup, the map won't rotate.

This works for pickup servers, in which most players are experienced. However, for a regular server, many beginners don't know about ALL READY, so they are stuck in warmup, which timer goes up instead of counting down, and the game never ends.

Is there a way to determine whether there are any human players on a server? Perhaps some hooks for me to adjust g_timelimit or g_warmup, or to call a vote, etc.? Or if there's a variable to get the number of human players, then I can write an ongoing timer to periodically check that variable.

Or are there other ways to remind players that they are in the warm up mode and they need to press F4 to start the real game?

RE: determine whether there are human players - Mario - 08-11-2015

There is currently no function to not change maps while empty. It would be a nice feature, but I think it would have to be done right (i.e. not an infinite timer, but rather ending the match & staying on the map vote until someone joins).

RE: determine whether there are human players - BuddyFriendGuy - 08-11-2015

@Mario, are there hooks for a human player connecting and disconnecting?