Jump to content

MaxPlayers problem


Recommended Posts

I think I have a problem with my game, it seems like the the MaxPlayer limit which is set in scripts/server/prefs.cs as $Pref::Server::MaxPlayers does not work, this means unlimited amount of players can join servers, even if set to 1 or 0 you can still join the server.

Maybe it has to do with a change I did where I put the prefs into the users home directory, you can view it here: https://github.com/Duion/Uebergame/commit/aaf79d7d772f48e9fbc48db3fe018061b17b6ac6

Update: I made a test where I hosted a server with 1 player max, so nobody should be able to join, the first few people got blocked from joining, but after a while some people were able to join the server anyways, so I wonder where this comes from.

If someone wants he can install my game and try it out.

Link to comment
Share on other sites

Note it maybe defined at different locations:

\core\prefs.cs(8):   $Pref::Server::MaxPlayers = 64;
\scripts\client\prefs.cs(47):   $Pref::Server::MaxPlayers = 64;
\scripts\server\prefs.cs(8):   $Pref::Server::MaxPlayers = 64;


Do a search like Dwarf King said and make sure they all have the same value.

IMO only in \scripts\server\prefs.cs should be enough :?

Link to comment
Share on other sites

Yes I already made a bunch of searches and there is a bunch of locations where they get saved and loaded and it is not that it is set different elsewhere, since the set number gets displayed on the server list, it just gets ignored sometimes.

I made a few more tests and I could save the server from overpopulating most of the time, by creating a buffer zone, by reducing the maxplayers a bit more, so it is not that bad if a few more join than planned.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...