Difference between revisions of "Changing Maximum Player Count"

From Valve Developer Community
Jump to: navigation, search
m
m (deleted a permanently dead link to a forum post (http://forums.steampowered.com/forums/showthread.php?t=1431604))
 
Line 10: Line 10:
 
You'll see an integer called "maxplayers", which has a default value of '16'. Change the '16' to whatever you'd like, but going higher than 32 is not recommended, and obviously don't go below whatever is defined for "minplayers". You can also change "defaultMaxPlayers" here if you'd like.
 
You'll see an integer called "maxplayers", which has a default value of '16'. Change the '16' to whatever you'd like, but going higher than 32 is not recommended, and obviously don't go below whatever is defined for "minplayers". You can also change "defaultMaxPlayers" here if you'd like.
  
=== Alien Swarm ===
+
 
[http://forums.steampowered.com/forums/showthread.php?t=1431604 Click here to be redirected to a topic about this on the Steam forums.]
 
  
 
[[Category:Programming]]
 
[[Category:Programming]]
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]

Latest revision as of 05:17, 2 October 2018

By default, Source modifications have a hard-coded maximum player count per server. This can often be overcome using certain server plugins, but if you want to change things the proper way for your modification, you'll need to manipulate your mod's source code a bit.

Source 2007 (HL2MP)

  • Open hl2mp_gameinterface.cpp and find the implementation of the following function:


void CServerGameClients::GetPlayerLimits( int& minplayers, int& maxplayers, int &defaultMaxPlayers )


You'll see an integer called "maxplayers", which has a default value of '16'. Change the '16' to whatever you'd like, but going higher than 32 is not recommended, and obviously don't go below whatever is defined for "minplayers". You can also change "defaultMaxPlayers" here if you'd like.