Giter Club home page Giter Club logo

cs2-rockthevote's Introduction

CS2 Rock The Vote

Downloads Last commit Open issues Closed issues Size

image

General purpose map voting plugin, started as a simple RTV and now has more features

Enjoying the plugin?

Please drop a ⭐ star in the repository image

Feeling like paying me a ☕? Go ahead and donate:

Requirements

Latest release of Counter Strike Sharp

Instalation

Features

  • Reads from a custom maplist
  • RTV Command
  • Timeleft command
  • Nominate command
  • Votemap command
  • Supports workshop maps
  • Nextmap command
  • Fully configurable
  • Translated by the community

Translations

Language Contributor
Brazilian Portuguese abnerfs
English abnerfs
Ukrainian panikajo
Turkish brkvlr
Russian Auttend
Latvian rcon420
Hungarian Chickender, lovasatt
Polish D3X
French o3LL
Chinese (zh-Hans) himenekocn

Configs

  • A config file will be created in addons/counterstrikesharp/configs/plugins/RockTheVote the first time you load the plugin.
  • Changes in the config file will require you to reload the plugin or restart the server (change the map won't work).
  • Maps that will be used in RTV/nominate/votemap/end of map vote are located in addons/counterstrikesharp/configs/plugins/RockTheVote/maplist.txt

General config

Config Description Default Value Min Max
MapsInCoolDown Number of maps that can't be used in vote because they have been played recently 3 0

RockTheVote

Players can type rtv to request the map to be changed, once a number of votes is reached (by default 60% of players in the server) a vote will start for the next map, this vote lasts up to 30 seconds (hardcoded for now), in the end server changes to the winner map.

Config Description Default Value Min Max
Enabled Enable/Disable RTV functionality true false true
EnabledInWarmup Enable/Disable RTV during warmup false false true
NominationEnabled Enable/Disable nomination true false true
MinPlayers Minimum amount of players to enable RTV/Nominate 0 0
MinRounds Minimum rounds to enable RTV/Nominate 0 0
ChangeMapImmediatly Whether to change the map immediatly when vote ends or not true false true
HudMenu Whether to use HudMenu or just the chat one, when false the hud only shows which map is winning instead of actual menu true false true
HideHudAfterVote Whether to hide vote status hud after vote or not, only matters when HudMenu is true false false true
MapsToShow Amount of maps to show in vote, 6 1 6 with HudMenu, unlimited without it
VoteDuration Seconds the RTV should can last 30 1
VotePercentage Percentage of players that should type RTV in order to start a vote 60 0 100

End of map vote

Based on mp_timelimit and mp_maxrounds cvar before the map ends a RTV like vote will start to define the next map, it can be configured to change immediatly or only when the map actually ends

Config Description Default Value Min Max
Enabled Enable/Disable end of map vote functionality true false true
ChangeMapImmediatly Whether to change the map immediatly when vote ends or not true false true
HideHudAfterVote Whether to hide vote status hud after vote or not, only matters when HudMenu is true false false true
MapsToShow Amount of maps to show in vote, 6 1 6 with HudMenu, unlimited without it
VoteDuration Seconds the RTV should can last 30 1
HudMenu Whether to use HudMenu or just the chat one, when false the hud only shows which map is winning instead of actual menu true false true
TriggerSecondsBeforeEnd Amount of seconds before end of the map that should trigger the vote, only used when mp_timelimit is greater than 0 120 1
TriggerRoundsBeforEnd Amount of rounds before end of map that should trigger the vote, only used when mp_maxrounds is set 2 1
DelayToChangeInTheEnd Delay in seconds that plugin will take to change the map after the win panel is shown to the players 6 3

Votemap

Players can vote to change to an specific map by using the votemap command

Config Description Default Value Min Max
Enabled Enable/disable votemap funtionality true false tru
VotePercentage Percentage of players that should vote in a map in order to change to it 60 1 100
ChangeMapImmediatly Whether to change the map immediatly when vote ends or not true false true
EnabledInWarmup Enable/Disable votemap during warmup true false true
MinRounds Minimum rounds to enable votemap 0
MinPlayers Minimum amount of players to enable votemap

Timeleft

Players can type timeleft to see how much time is left in the current map

Config Description Default Value Min Max
ShowToAll Whether to show command response to everyone or just the player that executed it false false true

Nextmap

Players can type nextmap to see which map is going to be played next

Config Description Default Value Min Max
ShowToAll Whether to show command response to everyone or just the player that executed it false false true

Adding workshop maps

  • If you are not hosting a collection in order to add workshop maps you need to know it's id and add as following in the maplist.txt file: <mapname>:<workshop-id>.
  • If you are already hosting a collection and can change to workshop maps using the command ds_workshop_changelevel <map-name> you don't need the id, just put the actual map name and it will work.
de_thera:3121217565
de_dust2

Limitations

  • Plugins is still under development and a lot of functionality is still going to be added in the future.
  • I usually test the new versions in an empty server with bots so it is hard to tell if everything is actually working, feel free to post any issues here or in the discord thread so I can fix them https://discord.com/channels/1160907911501991946/1176224458751627514

cs2-rockthevote's People

Contributors

abnerfs avatar brkvlr avatar exd02 avatar himenekocn avatar o3ll avatar panikajo avatar rcon420 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cs2-rockthevote's Issues

[Question] Maps from the workshop

How do I put the maps from the workshop?
Do I just have to enter the ID? ► Server crash

Is it really necessary to download a map to the server, and then put it in the list by the name of the card? ► I tried, but the server crashed

workshop_map

hi,
i try to edit the maplist.txt for workshop map.
they are no exemple
can you give an exemple plz

de_vertigo
cs_italy
de_inferno
cs_office
de_mirage
de_ancient
de_nuke
de_anubis
de_overpass
de_dust2

but for the workshop map ? number map name ?

fr.json traduction

{
"rtv.prefix": "{red}[RockTheVote]{default}",
"votemap.prefix": "{red}[Votemap]{default}",
"timeleft.prefix": "{red}[Timeleft]{default}",
"timeleft.remaining-rounds": "{0} Manches restantes",
"timeleft.remaining-time-hour": "Temps restant {0}:{1}:{2}",
"timeleft.remaining-time-minute": "Temps restant {0} minute(s) et {1} seconde(s)",
"timeleft.remaining-time-second": "Temps restant {0} seconde(s)",
"timeleft.no-time-limit": "Il n'y a pas de limite de temps",
"timeleft.last-round": "Ceci est la dernière manche",
"timeleft.time-over": "Plus de temps, ceci est la dernière manche",
"votemap.player-voted": "Le joueur {green}{0}{default} vote pour {green}{1}{default}",
"votemap.already-voted": "Tu as déjà voté {green}{0}{default}",
"votemap.in-the-map": "pour la carte {0}",
"votemap.changing-map": "Changement de carte pour {green}{0}",
"votemap.changing-map-next-round": "La carte sera changé {green}{0}{default} à la prochaine manche...",
"general.votes-needed": "({0} voté, {1} nécessaire)",
"general.invalid-map": "carte invalide",
"nominate.nominated": "Le joueur {green}{0}{default} à nommé {green}{1}{default}, maintenant il y a {2} vote(s)",
"nominate.already-nominated": "Tu as déjà nommé la carte {green}{0}{default}, elle a {1} vote(s)",
"general.validation.current-map": "Tu ne peux pas choisir la carte actuelle",
"general.validation.minimum-rounds": "Le nombre minimum de manche pour utiliser la commande est {0}",
"general.validation.warmup": "Commande désactivée pendant l'échauffement.",
"general.validation.minimum-players": "Le minimum de joueur requis pour utiliser la commande est {0}",
"general.validation.disabled": "Commande désactivée pour l'instant",
"rtv.rocked-the-vote": "Le joueur {green}{0}{default} veux un Rock the vote",
"rtv.already-rocked-the-vote": "Tu as déjà lancé un Roke the vote",
"rtv.votes-reached": "Nombre de vote requis, démarrage du vote...",
"rtv.disabled": "Rtv est désactivé",
"emv.you-voted": "Tu as voté pour {0}",
"emv.vote-ended": "Vote terminé la prochaine carte sera {green}{0}{default} ({1:N2}% of {2} vote(s))",
"emv.vote-ended-no-votes": "pas de vote, la prochaine carte sera {green}{0}",
"general.changing-map": "Changement de carte pour {green}{0}",
"general.changing-map-next-round": "La carte va être changé pour {green}{0}{default} au prochain tour...",
"emv.hud.menu-title": "Voter pour la prochaine carte:",
"emv.hud.hud-timer": "Voter pour la prochaine carte: {0}s",
"emv.hud.finished": "Vote terminé, prochaine carte: {0}",
"nextmap": "La prochaine carte sera {green}{0}",
"nextmap.decided-by-vote": "La nouvelle carte sera décidé par vote"
}

MapsInCoolDown not disabling?

I have put 0, but its not disabling. I want to let the same map to show in vote (not to extend, but to change for the same map).

Expected outcome: Dust2 being played, the endmap vote begins, and there's Dust2 in the vote to replay the map.

Current outcome: Dust2 being played, but it's not appearing in the map voting selection; instead, Dust2 only appears in the vote after a different map is played again.

!votemap isn't working all of a sudden?

Hello!
!votemap was working fine, I enable RTV just for fun and then once I disabled RTV now !votemap doesn't work.

Any help would be appreciated.

// This configuration was automatically generated by CounterStrikeSharp for plugin 'RockTheVote', at 2024/04/22 11:17:03 { "Version": 9, "Rtv": { "Enabled": false, "EnabledInWarmup": false, "NominationEnabled": false, "MinPlayers": 0, "MinRounds": 0, "ChangeMapImmediatly": true, "HideHudAfterVote": false, "MapsToShow": 24, "VoteDuration": 30, "VotePercentage": 60, "HudMenu": true }, "Votemap": { "Enabled": true, "VotePercentage": 60, "ChangeMapImmediatly": true, "EnabledInWarmup": true, "MinPlayers": 0, "MinRounds": 0, "HudMenu": true }, "EndOfMapVote": { "Enabled": true, "MapsToShow": 6, "HudMenu": true, "ChangeMapImmediatly": false, "VoteDuration": 30, "HideHudAfterVote": false, "TriggerSecondsBeforeEnd": 120, "TriggerRoundsBeforEnd": 2, "DelayToChangeInTheEnd": 6 }, "Timeleft": { "ShowToAll": false }, "Nextmap": { "ShowToAll": false }, "MapsInCoolDown": 0 }

All I changed was RTV to TRUE, and then I set it back to false and rebooted the server. I dont know why !votemap wouldn't be working.

high probability for certin maps

Can you add a way to fix some maps in the end maps vote like i want mirage and dd2 to always be available or the chances of this maps to be higher then others.

Help maps

How do I place workshop maps to !rtv? Try to: workshop/3071818846/de_rats_kitchoon ---
host_workshop_map 3097973183 but nothing works, it doesn't change the map after the vote.

[Request] Support workshop maps

Support for workshop maps or collections
Currently, we have a default map pool to use, which works well, however, I didn't seem to notice how we could use workshop maps.

[REQ] `HudMenu` option in `!votemap` command

public class VotemapConfig : ICommandConfig, IVoteConfig
{
public bool Enabled { get; set; } = true;
public int VotePercentage { get; set; } = 60;
public bool ChangeMapImmediatly { get; set; } = true;
public bool EnabledInWarmup { get; set; } = true;
public int MinPlayers { get; set; } = 0;
public int MinRounds { get; set; } = 0;
}

I believe the option to activate voting via HudMenu in the !votemap command would be interesting.

"TriggerRoundsBeforEnd" dont work

I have in config file "TriggerRoundsBeforEnd": 10 in "EndOfMapVote". but the voting still takes two rounds to complete the map. I have maxrounds 46. I using plugin on retake server.

// This configuration was automatically generated by CounterStrikeSharp for plugin 'RockTheVote', at 2024/02/21 08:19:19
{
  "Version": 9,
  "Rtv": {
    "Enabled": true,
    "EnabledInWarmup": true,
    "NominationEnabled": true,
    "MinPlayers": 3,
    "MinRounds": 0,
    "ChangeMapImmediatly": true,
    "HideHudAfterVote": true,
    "MapsToShow": 6,
    "VoteDuration": 20,
    "VotePercentage": 60,
    "HudMenu": true
  },
  "Votemap": {
    "Enabled": false,
    "VotePercentage": 60,
    "ChangeMapImmediatly": true,
    "EnabledInWarmup": true,
    "MinPlayers": 0,
    "MinRounds": 0
  },
  "EndOfMapVote": {
    "Enabled": true,
    "MapsToShow": 6,
    "HudMenu": true,
    "ChangeMapImmediatly": false,
    "VoteDuration": 20,
    "HideHudAfterVote": true,
    "TriggerSecondsBeforeEnd": 250,
    "TriggerRoundsBeforEnd": 10
  },
  "Timeleft": {
    "ShowToAll": true
  },
  "Nextmap": {
    "ShowToAll": true
  }
}```

[Request] Support multiple map pools

Supporting multiple map pools with the ability to switch map pool by command but also set a default.

Also, I wondered if it was worth switching to a json format instead of a txt which may help in supporting multiples?

I'm happy to help out here if you'd be happy to accept contributions?

Error invoking callback when typing timeleft from server console

timeleft
00:29:21 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at cs2_rockthevote.TimeLeftCommand.CommandHandler(CCSPlayerController player) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/TimeLeftCommand.cs:line 86
at cs2_rockthevote.Plugin.OnTimeLeft(CCSPlayerController player, CommandInfo command) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/TimeLeftCommand.cs:line 15
at CounterStrikeSharp.API.Core.Commands.CommandManager.HandleCommandInternal(Int32 playerSlot, IntPtr commandInfo) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Commands/CommandManager.cs:line 162
at InvokeStub_Action`2.Invoke(Object, Object, IntPtr*)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
--- End of inner exception stack trace ---
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass7_0.<.ctor>b__0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 106
Time Remaining: 0:33

Automatic vote at map end

Hello, there would be another function if match point were to automatically vote and then the map would be changed when a winning team was determined. E.g. if you could set, if 10 rounds the CT team or T team wins, then there will be an automatic vote. When a team has won the 11th round, the selected map comes.

That would be great if it worked for my community server.

Kind regards, Mario

Map change time after mach

Could you add a time to "EndOfMapVote" in the config so that the map is not changed immediately when the mach is finished, but e.g. after 20 seconds. That you can still examine your statistics.

Greetings Mario

rtv Error

When type rtv

06:22:02 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.InvalidOperationException: Cannot transcode invalid UTF-8 JSON text to UTF-16 string.
---> System.Text.DecoderFallbackException: Unable to translate bytes [D3] at index 6 from specified code page to Unicode.
at System.Text.DecoderExceptionFallbackBuffer.Throw(Byte[] bytesUnknown, Int32 index)
at System.Text.DecoderExceptionFallbackBuffer.Fallback(Byte[] bytesUnknown, Int32 index)
at System.Text.Encoding.GetCharCountWithFallback(ReadOnlySpan1 bytes, Int32 originalBytesLength, DecoderNLS decoder) at System.Text.Encoding.GetCharCountWithFallback(Byte* pBytesOriginal, Int32 originalByteCount, Int32 bytesConsumedSoFar) at System.Text.UTF8Encoding.GetCharCount(Byte* bytes, Int32 count) at System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding) at System.Text.Encoding.GetString(ReadOnlySpan1 bytes)
at System.Text.Json.JsonReaderHelper.TranscodeHelper(ReadOnlySpan1 utf8Unescaped) --- End of inner exception stack trace --- at System.Text.Json.JsonReaderHelper.TranscodeHelper(ReadOnlySpan1 utf8Unescaped)
at System.Text.Json.JsonDocument.GetString(Int32 index, JsonTokenType expectedType)
at CounterStrikeSharp.API.Core.Translations.JsonResourceManager.<>c.b__13_1(JsonProperty e) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/JsonResourceManager.cs:line 147
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func`2 elementSelector)
at CounterStrikeSharp.API.Core.Translations.JsonResourceManager.LoadJsonResources(String filePath) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/JsonResourceManager.cs:line 147
at CounterStrikeSharp.API.Core.Translations.JsonResourceManager.TryLoadResourceSet(String cultureName) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/JsonResourceManager.cs:line 124
at CounterStrikeSharp.API.Core.Translations.JsonResourceManager.TryLoadResourceSet(CultureInfo culture) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/JsonResourceManager.cs:line 135
at CounterStrikeSharp.API.Core.Translations.JsonResourceManager.GetResourceSet(CultureInfo culture, Boolean tryParents) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/JsonResourceManager.cs:line 36
at CounterStrikeSharp.API.Core.Translations.JsonResourceManager.GetString(String name, CultureInfo culture) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/JsonResourceManager.cs:line 108
at CounterStrikeSharp.API.Core.Translations.JsonStringLocalizer.GetStringSafely(String name, CultureInfo culture) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/JsonStringLocalizer.cs:line 65
at CounterStrikeSharp.API.Core.Translations.JsonStringLocalizer.get_Item(String name) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/JsonStringLocalizer.cs:line 34
at CounterStrikeSharp.API.Core.Translations.StringLocalizer.get_Item(String name) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/StringLocalizer.cs:line 18
at cs2_rockthevote.StringLocalizer.LocalizeWithPrefixInternal(String prefix, String key, Object[] args) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/CrossCutting/StringLocalizer.cs:line 30
at cs2_rockthevote.StringLocalizer.LocalizeWithPrefix(String key, Object[] args) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/CrossCutting/StringLocalizer.cs:line 35
at cs2_rockthevote.RockTheVoteCommand.CommandHandler(CCSPlayerController player) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/RockTheVoteCommand.cs:line 93
at cs2_rockthevote.Plugin.OnChat(EventPlayerChat event, GameEventInfo info) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Plugin.cs:line 75
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
--- End of inner exception stack trace ---
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at CounterStrikeSharp.API.Core.FunctionReference.b__18_0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 120

cool down not working when you change the name of the maps in map list

-cool down not working when you change the name of the maps in map list
-lets say the real file name of them map is de_dust2_prefab and i change it in the maplist config file to de_dust2_csgo
-the server will sucessfully show this map and change it , but it wont be excluded in the next vote .
-so the plugin is counting the real name of the maps and not the workshop id.
-thats why the maps are always showing even tho i set exclude 3 latest maps .

i hope you find a way to fix this , now the reason why i change the name of the maps is that some maps are stupidly named and confuse the players , naming dd2 to dd2_csgo is better then dd2_prefab

Shared Api

Would be nice to have a shared api to check if the vote is on or not. Useful for plugins that need show other menus

[BUG] Error invoking callback | Exception has been thrown by the target of an invocation.

The end-of-map vote ends, but the map does not change to the map that won the vote.

Simply switch to the same map you are running on.

Log error:

2024-03-28 23:51:09.293 -03:00 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at cs2_rockthevote.ChangeMapManager.<ChangeNextMap>b__17_0() in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Core/ChangeMapManager.cs:line 81
   at InvokeStub_Action.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
   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

Plugin Version: 1.8.4
CSSharp Version: 202 (1.0.202+696ecad)

Map list:

de_mirage
de_vertigo
de_inferno
de_anubis
de_dust2
de_ancient
de_nuke
de_overpass

RockTheVote.json

Request: use mapgroups as mapcycle

A lot of people have Multi-Mode server set-ups, with dedicated mapcycles for each mode (usually loaded as mapgroups).

It would be amazing if a plugin like this one would allow to use the mapgroups as the voting list rather than a hardcoded file.

Any chance you'd consider this?

any way that only admin can RTV?

Hey, i try to do a workaround with Matchzy to Vote Maps,

is there any way that only admin can do the rtv command?

ty in advance

[BUG] Server crashing with new version v1.1.0

CSSv 159, Metamod:Source version 2.0.0-dev+1229, +game_type 0 +game_mode 0, roundtime 35, surf server

[EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at cs2_rockthevote.GameRules.SetGameRules() in C:\Users\Abner\source\repos\cs2-rockthevote\RockTheVote\CrossCutting\GameRules.cs:line 29
   at cs2_rockthevote.Plugin.OnRoundStartGameRules(EventRoundStart event, GameEventInfo info) in C:\Users\Abner\source\repos\cs2-rockthevote\RockTheVote\CrossCutting\GameRules.cs:line 13
   at InvokeStub_GameEventHandler`1.Invoke(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82

Only 4 maps in vote

I tested this and its random. Sometimes i have normal 6 maps in vote, sometimes 4, 5.

The crashes are happening unexpectedly

Every time the server crashes and I check the logs, I see these two types of crashes. It usually occurs when changing maps.

cs2_rockthevote.NominationCommand.PlayerDisconnected(CCSPlayerController player) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/NominationCommand.cs:line 177�[39;49m

cs2_rockthevote.Plugin.EventPlayerDisconnectVotemap(EventPlayerDisconnect event, GameEventInfo eventInfo) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/VotemapCommand.cs:line 25�[39;49m

Issue while the server starts

I'm getting the following error while a server start:

[EROR] (cssharp:Core) Error invoking callback System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at cs2_rockthevote.GameRules.get_WarmupRunning() in /home/runner/work/cs2-rockthevote/cs2-rockthevote/CrossCutting/GameRules.cs:line 50 at cs2_rockthevote.EndOfMapVote.<>c__DisplayClass13_0.<OnLoad>b__0(EventRoundStart ev, GameEventInfo info) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/EndOfMapVote.cs:line 62 at InvokeStub_GameEventHandler1.Invoke(Object, Object, IntPtr*)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
--- End of inner exception stack trace ---`

Latest version 1.8.1 shows error when starting the server

23:15:04 [INFO] (cssharp:PluginContext) Loading plugin RockTheVote
23:15:04 [EROR] (cssharp:PluginManager) Failed to load plugin from /home/container/game/csgo/addons/counterstrikesharp/plugins/RockTheVote/RockTheVote.dll
System.NullReferenceException: Object reference not set to an instance of an object.
at cs2_rockthevote.Core.MapCooldown.<.ctor>b__5_0(Object e, Map[] maps) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Core/MapCooldown.cs:line 24
at cs2_rockthevote.MapLister.LoadMaps() in /home/runner/work/cs2-rockthevote/cs2-rockthevote/CrossCutting/MapLister.cs:line 46
at cs2_rockthevote.MapLister.OnLoad(Plugin plugin) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/CrossCutting/MapLister.cs:line 59
at cs2_rockthevote.DependencyManager`2.OnPluginLoad(TPlugin plugin) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/CrossCutting/DependencyManager.cs:line 51
at cs2_rockthevote.Plugin.Load(Boolean hotReload) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Plugin.cs:line 62
at CounterStrikeSharp.API.Core.Plugin.PluginContext.Load(Boolean hotReload) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/PluginContext.cs:line 218
at CounterStrikeSharp.API.Core.Plugin.Host.PluginManager.LoadPlugin(String path) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/Host/PluginManager.cs:line 125
at CounterStrikeSharp.API.Core.Plugin.Host.PluginManager.Load() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Plugin/Host/PluginManager.cs:line 93

The !nominate menu no longer works after CS2 update. You can nominate a specific map using !nominate (map), but the menu isn't working.

This is the console log when doing !nominate

09:20:48 [EROR] (cssharp:Core) Error invoking callback
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at CounterStrikeSharp.API.Modules.Menu.ChatMenuInstance.Display() in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Menu/ChatMenu.cs:line 42
   at CounterStrikeSharp.API.Modules.Menu.MenuManager.OpenChatMenu(CCSPlayerController player, ChatMenu menu) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Menu/MenuManager.cs:line 50
   at cs2_rockthevote.NominationCommand.OpenNominationMenu(CCSPlayerController player) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/NominationCommand.cs:line 117
   at cs2_rockthevote.NominationCommand.CommandHandler(CCSPlayerController player, String map) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/NominationCommand.cs:line 107
   at cs2_rockthevote.Plugin.OnNominate(CCSPlayerController player, CommandInfo command) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/NominationCommand.cs:line 17
   at CounterStrikeSharp.API.Core.Commands.CommandManager.HandleCommandInternal(Int32 playerSlot, IntPtr commandInfo) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Commands/CommandManager.cs:line 159
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   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)

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.