Thread: limiting humans
View Single Post
Re: limiting humans
Old
  (#7)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: limiting humans - 04-01-2004

There is no non-kludgy way of limiting human connections. The method using ClientConnect is messy because you cannot give the connecting player a reason why their connection failed. The 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.

Quote:
So for example, if maxhumans is set to 5 and there are 4 humans on the server and nhumans is 4 and 2 humans try to connect within a few seconds of each other BOTH will be allowed on.


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 see you may not be doing this, and instead periodically updating a global count (nhumans) which is not in sync with the connection attempts. If you replace nhumans to a function call that counts humans on the fly, your code should work fine.



Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote