Incidentally you can't simply keep a counter of connections and disconnections 
to get this number.  I found this out the hard way when a client "reconnect" 
caused 2 disconnections in a row, followed by a connection.  I've been unable 
to reproduce a "reconnect".  If you do the "retry" command, you re-connect 
quickly, but that's not the same thing.

Oh well, I hacked around it with a std::set of connected edict pointers.  I'd 
post a patch, but all the code went in my custom mod class, and it's trivial 
anyway.

At 2006/03/26 01:38 PM, Physical Mayhem Bug wrote:
>Background: there's a bug or missing feature that doesn't allow a mod to tell 
>how many player slots are really in use by clients.  The mod can only tell how 
>many slots have clients that have spawned into the server.  So I think I have 
>a hack in place involving counting connections and disconnections.
>
>This would be a lot easier if I made a FL_EDICT_IS_CONNECTED flag for 
>m_fStateFlags but that's shared by the engine, so doing so seems questionable. 
> Anyone know if adding new edict flags is allowed by the API?
>
>_______________________________________________
>To unsubscribe, edit your list preferences, or view the list archives, please 
>visit:
>http://list.valvesoftware.com/mailman/listinfo/hlcoders

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to