Quote:
Originally Posted by botmeister
MESSAGE_REFUSE_CLIENTCONNECT does not get displayed in the refusal popup window, and the player is left thinking that there's something wrong with your server.
|
Yes, but it does at least get displayed and you can see it for a few seconds on the screen right after you are disconnected. So this is better then nothing.
Quote:
Originally Posted by botmeister
Change your code so it checks how many humans are in the game during the connection attempt and refuse the connection if the count will be exceeded.
|
I actually do this. The code I posted was simplified. I call a function that counts the number of bots and humans on the server right before I do the check.
The problem is still as described.
In ClientConnect() If more then 1 human tries to connect within a few seconds of each other, they can exceed the allowed maxhumans, because the code that counts the players doesn't take into consideration players who are in the process of connecting but not actually in the game yet.
I guess I could start to kludge it by keeping track of who is connecting over the last several seconds and then watch who actually gets put into the server and track and check all this every few seconds, exactly what I didn't want to do.
As far as the time on the server, HL must keep it somewhere for each player since it is shown for each player in the server tool HLSW (time on for each player is returned by the server "Infostring" command)