nockycz / cs2-reservedslots Goto Github PK
View Code? Open in Web Editor NEWCS2 plugin for Reservation slots
CS2 plugin for Reservation slots
Hello @NockyCZ ,
In reserve slot method 3 , does it mean that if we have 10 slots for players and max players is set to 10 and an admin joins , then the server can have 11 players while we set max players as 10 ?
Also a kick type where the last player to have joined the server is kicked would be a good idea . If we kick by highest ping or random , we might kick the first fragger of the server and unbalance the game .
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.
v1.0.7, css v233
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ArgumentException: An item with the same key has already been added. Key: CounterStrikeSharp.API.Core.CCSPlayerController
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at ReservedSlots.ReservedSlots.PerformKick(CCSPlayerController player, KickReason reason) in C:\Users\Mates-PC\Desktop\SourceFactory\Projects\CSharp\ReservedSlots\ReservedSlots.cs:line 237
at ReservedSlots.ReservedSlots.OnPlayerConnect(EventPlayerConnectFull event, GameEventInfo info) in C:\Users\Mates-PC\Desktop\SourceFactory\Projects\CSharp\ReservedSlots\ReservedSlots.cs:line 218
at InvokeStub_GameEventHandler`1.Invoke(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at CounterStrikeSharp.API.Core.FunctionReference.<CreateWrappedCallback>b__18_0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 100
thank you !
Grant the ability to add a flag that allows an admin to join even if the server's full, but not kick a player (fill up the +1 slot). This allows admins to join and spectate players when dealing with reports without potentially kicking the player that has been reported. Sort of like a stealth mode I guess?
Would it be possible to have a method of kicking a player only when the player with privileges chooses to join a team?
It would add a new Kick type
which would be to kick a player only if the VIP chooses a team to join, then it would kick the last player who joined the team.
This new kick option could only work with the Reserved slots method - 3
.
We could have some kick messages, announcements, etc.
"announcement.slot.full"
- Server is full - Slot Reserved For Vips Only
"announcement.kick.player.joined"
- {NAMEVIP} kicked {TARGETPLAYER} due to reserved slot."announcement.kick"
- {TARGETPLAYER} kicked due to reserved slot.In other words, a kick message for the player who was kicked due to the reserved slot. Message would show both on the server for all players to view and for the player as a reason. (I understand that CS2 currently does not allow changing the reason for the kick, but I believe it can be shown in the console of the player who was kicked)
Message from full teams, with no vacancies on the teams, that you must be a VIP to kick someone and take the player's place.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.