Raised This Month: $29 Target: $400
 7% 

Replays and Reserved Slots


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mister_Magotchi
SourceMod Donor
Join Date: Dec 2006
Location: Nampa, Idaho
Old 05-13-2011 , 03:53   Replays and Reserved Slots
Reply With Quote #1

Currently there is a bug where the replay bot takes up a player slot. It also counts toward the player count that the SourceMod reserved slots plugin uses in its logic.

In my 26-slot server, I have 1 reserved slot, and I have sm_hide_slots set to 1, so sv_visiblemaxplayers is then set to 25.

This means that in the Steam server browser, the player count with 23 actual players present shows as 24/25. The in-game server browser shows the player count as 23/24, because in the in-game browser bots don't count toward the number of players shown as in your server, and a slot in the max slots number is subtracted (from the sv_visiblemaxplayers) for every bot present (which includes the replay bot).

When a non-reserved player tries to join at this point through either server browser they are kicked due to the reserved slot, because the replay bot is taking up a normal player slot as far as the reserved slots plugin is concerned.

I made an extremely simple (and not very proper) change to the default reserved slots plugin which fixes this problem. On about line 25 (in the latest dev. snapshot), it grabs the number of current clients from GetClientCount(false). I just subtracted 1 from it. In this way 23 humans + the 1 replay bot counts as 23 players for the sake of reserved slots, so my server actually can fill up now (without requiring reserved slot holders).

This only will be useful to servers with replays enabled (obviously) and will need to be removed when/if Valve fixes the problem (as they've indicated they will).

A more ideal fix would have been to iterate through the players on the server and not count bots, but I'm expecting a fix with a few days, so I just did it this way for me. Take it or leave it.
Attached Files
File Type: sp Get Plugin or Get Source (reservedslots.sp - 457 views - 7.7 KB)
Mister_Magotchi is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-13-2011 , 10:05   Re: Replays and Reserved Slots
Reply With Quote #2

Personally, I worked around this fix by setting
Code:
sv_visiblemaxplayers 24
, but that causes issues with the player count in the TF2 server browser being too low.

I may try this plugin after I leave work later today.

Also, does this address the same problem with the SourceTV bot? There are weird slot count issues if you have both bots enabled (Steam shows 0/25 even with both, rather than 0/26 like you'd expect).
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Mister_Magotchi
SourceMod Donor
Join Date: Dec 2006
Location: Nampa, Idaho
Old 05-13-2011 , 14:00   Re: Replays and Reserved Slots
Reply With Quote #3

This only reduces the player count that the reserved slots official plugin uses internally.

Although I've never used SourceTV and SourceMod together (only used it on match servers), if it behaves the same way (counted with the GetClientCount function), then this would fix it, but if you're using both SourceTV and replays at the same time, you would want to change the number subtracted (on line 25) to 2 instead of 1.

I can confirm again from more playing last night, though, that my fix works great when running just replays. With 24 humans and the replay bot (with sv_visiblemaxplayers 25), it shows as 25/25 in the Steam server browser and 24/24 in the in-game server browser and allows 24 people without reserved slots to play in the game without being kicked for reservation.
Mister_Magotchi is offline
Mister_Magotchi
SourceMod Donor
Join Date: Dec 2006
Location: Nampa, Idaho
Old 05-14-2011 , 18:47   Re: Replays and Reserved Slots
Reply With Quote #4

This seems to no longer be necessary (or I was insane and it was never necessary). Maybe yesterday's minor update or a Steam update changed it. I don't know. There's still weird stuff going on, though.

With the default reserved slots plugin (irrelevant), replays on, 2 humans present and the replay bot, sm_reserved_slots 1, and sm_hide_slots 1 (sv_visiblemaxplayers 25 therefore) on a 26-slot server:
The in-game server browser shows 1/24 players.
"View server info" in the in-game browser shows 2/25 players.
The Steam browser shows 2/25 players.
"View server info" in the Steam browser shows 2/25 players.

This means that auto-retry likely will work correctly with this configuration, the 1 reserved slot will work, and the server will be able to fill to 24 players (without reserved slot holders).
The only issue is that when the in-game server browser shows 23/24 players, while their client will let them attempt to join on double-click of the server, players will be kicked due to a reserved slot. They will have to do "View server info" to be able to auto-retry.

Last edited by Mister_Magotchi; 05-14-2011 at 18:51.
Mister_Magotchi is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:37.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode