-
Notifications
You must be signed in to change notification settings - Fork 5
Description
In CSGO, players used to be able to connect through console to a server even when it is full.
The sourcemod reserved slots plugin took advantage of this, to allow a player to connect through console even when the server is at max capacity, and if they have reserved slot, it would kick someone else.
This functionality was very nice, because it correctly showed when a server is full, but also still allowed reserved players to join and kicking someone out. It feels bad for players to join a server that shows as not full, and then be kicked because the remaining available slots are reserved-only.
I understand that players can no longer join a server through console when it is full, so that functionality is no longer possible.
However, with the DiscordUtilities version of this plugin, it is possible to have a button on discord that a player with the reserved flag can press.
On button press, the plugin checks if the server is full.
If it is not full, it will simply connect the player to the server.
If it is full, then verify that the discord user who pressed the button has linked their discord to their steamid (through the ManageRolesAndPermissions module).
Also verify that the player has any role which has reserved slot permission.
If the player is a reserved player, generate a random password. Set the sv_password to be that random password.
Kick someone from the server.
Open the link that causes the player to connect to the server. This link now must also include the generated password (idk how you do this for your redirect link, but in console all I have to do is connect <ip>;password <password>.
After the player connects, set the server password to be empty string "". This is how you remove the password from the server in CS2 (I tested this with empty string. Apparently in CSGO it used to be sv_password 0 but when I tested this, it literally set the password to be "0").
If the reserved player does not connect to the server after a certain amount of time, automatically set the sv_password to be empty string "".
I believe this is a foolproof way to implement "kick before connect" that disallows anyone else but the person who presses the discord connect button from joining the server.