Why must max clients be set during startup and restart and not while a game is in progress? I would like to change this value realtime but am having trouble doing this. Can someone please help??
I don't know where the code is exactly since I haven't opened the source in about a year now but...
I suppose you could always allocate enough memory for exactly 64 clients and have a bool flag saying whether that slot is usable or not.
You could then start a game with 4 max players and then change it to 10 and the next 6 slots in the array would be flagged as open while the other 54 remain flagged as closed.
Not the most memory efficient way of doing things but it should be easier on the cpu since you won't be doing unnecessary callocs and mallocs. The less you have to mess with memory the better imo.
misantropia probably has a more eloquent idea though.
Maybe more eloquent but probably not more elegant. I'd force sv_maxclients to 64 so there is room for the max # of clients and have a shadow cvar that determines how many clients may actually be active. Be sure to patch SVC_Info() in server/sv_main.c so server browsers report the actual client limit. Keep in mind you have to do something smart when the admin sets the client limit to something below the number of players currently playing.