Coder Social home page Coder Social logo

cs2-reservedslots's Issues

A question and a suggestion

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 .

[Request] For DiscordUtilities version, a 4th method (kick before connect).

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.

Error invoking callback

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

server showing full but in game one slot is missing

  • i want the server to let all players join 22/22 slot then if an admin want to join it will kick the players with worst ping
    right now method 3 using and on my 22 slot server always 21 can join and that one slot is gone to waste .
    10 ct 10 t 1 spec = 21 not 22 , but the steam game server is showing 22/22
  • and i have suggestion , players are asking me why were kicked ! the message showing when they get kicked is just "kicked by server" maybe it should be "server is full" .

thank you !

[Enhancement] Don't kick a player if someone with a certain flag joins

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?

[REQ] Kick player only when player chooses a team

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.

[REQ] Kick messages

We could have some kick messages, announcements, etc.

  • "announcement.slot.full" - Server is full - Slot Reserved For Vips Only
    • It would show when the teams are full and not allow another player to enter until someone leaves or is kicked out of the reserved VIP slot.
  • "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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.