nickj609 / GameModeManager

A Counter-Strike 2 server plugin to help administrators manage custom game modes, settings, and map rotations.
MIT License
34 stars 2 forks source link

[Bug] !modes menu not displaying correctly (1.0.4) #12

Closed mavproductions closed 3 months ago

mavproductions commented 3 months ago

Hey @nickj609

Sorry to bother, just installed 1.0.4 and it looks like the !modes menu isn't updating to my changes and for some reason storing the default configuration. image When my List looks like:

"List": {
          "10Mans" : "10-Mans",
      "AimMap" : "Aim Maps",
      "AWP" : "AWP Maps",
      "BHop" : "BHop",
      "Casual : "Casual"",
          "Casual-1.6" : "Casual 1.6",
      "Course" : "Course Maps",
          "DeathRun" : "Deathrun',
      "DM-MultiCFG" : "DM-MultiCFG",
      "DM-Valve" : "DM-Valve",
      "Executes" : "Executes",
      "GunGame" : "GunGame",
      "HideNSeek" : "Hide and Seek",
      "KZ" : "KZ",
      "MiniGames" : "Mini Games",
          "MiniMaps" : "Mini Maps",
      "Multi1v1-Arena" : "Multi-1v1 Arenas,
          "Prac" : "Prac",
      "Prefire" : "Prefire Practice",
      "Retakes" : "Retakes",
      "Scoutzknivez" : "Scoutzknivez",
      "Soccer" : "Soccer",
      "Surf" : "Surf',
      "Wingman" : "Wingman
    }

If I pick something like 1 vs 1 for Multi1v1-Arena, it still switches just fine. but the list is missing my modes.

Here is my entire config.


// This configuration was automatically generated by CounterStrikeSharp for plugin 'GameModeManager', at 2024/06/08 09:52:11
{
  "Version": 2,
  "RTV": {
    "Enabled": false,
    "Plugin": "/home/steam/cs2/game/csgo/addons/counterstrikesharp/plugins/disabled/RockTheVote/RockTheVote.dll",
    "MapListFile": "/home/steam/cs2/game/csgo/addons/counterstrikesharp/plugins/disabled/RockTheVote/maplist.txt",
    "DefaultMapFormat": false
  },
  "MapGroup": {
    "Delay": 0,
    "Default": "mg_active",
    "File": "gamemodes_server.txt"
  },
  "Settings": {
    "Enabled": true,
    "Folder": "settings",
    "Style": "center"
  },
  "GameMode": {
    "Rotation": true,
    "Interval": 4,
    "Delay": 5,
    "Style": "center",
    "ListEnabled": true,
    "List": {
      "10Mans" : "10-Mans",
      "AimMap" : "Aim Maps",
      "AWP" : "AWP Maps",
      "BHop" : "BHop",
      "Casual : "Casual"",
          "Casual-1.6" : "Casual 1.6",
      "Course" : "Course Maps",
          "DeathRun" : "Deathrun',
      "DM-MultiCFG" : "DM-MultiCFG",
      "DM-Valve" : "DM-Valve",
      "Executes" : "Executes",
      "GunGame" : "GunGame",
      "HideNSeek" : "Hide and Seek",
      "KZ" : "KZ",
      "MiniGames" : "Mini Games",
          "MiniMaps" : "Mini Maps",
      "Multi1v1-Arena" : "Multi-1v1 Arenas,
          "Prac" : "Prac",
      "Prefire" : "Prefire Practice",
      "Retakes" : "Retakes",
      "Scoutzknivez" : "Scoutzknivez",
      "Soccer" : "Soccer",
      "Surf" : "Surf',
      "Wingman" : "Wingman
    }
  },
  "Votes": {
    "Enabled": true,
    "Map": true,
    "GameMode": true,
    "GameSetting": true,
    "Style": "center"
  },
  "ConfigVersion": 2
}```

Lmk what you think!
nickj609 commented 3 months ago

@mavproductions, can you try running !rcon css_plugins reload GameModeManager to see if that changes the behavior? Also, does restarting the server change the behavior? You might have to run it twice in a row in the event there are still deregistration issues with the plugin.

nickj609 commented 3 months ago

@mavproductions , also, you are missing an end quotation in your list.

"Wingman" : "Wingman

should be

"Wingman" : "Wingman"

EDIT: You are also missing another quotation here:

"Multi1v1-Arena" : "Multi-1v1 Arenas,

should be:

"Multi1v1-Arena" : "Multi-1v1 Arenas",

mavproductions commented 3 months ago

omg lol

mavproductions commented 3 months ago

@mavproductions, can you try running !rcon css_plugins reload GameModeManager to see if that changes the behavior? Also, does restarting the server change the behavior? You might have to run it twice in a row in the event there are still deregistration issues with the plugin.

Is there anything wrong with how I call my RockTheVote.dll? It appears to be having issues loading it. (plugin:GameModeManager) Cannot find RTV 'Plugin': /home/steam/cs2/game/csgo/addons/counterstrikesharp/plugins/disabled/RockTheVote/RockTheVote.dll

I tried tinkering going from absolute to relative pathing and it seems to be still erroring out

nickj609 commented 3 months ago

Hey @mavproductions, I double checked on this just to make sure there weren't any issues with the current release. The relative path you should be using in your configuration should be the following:

addons/counterstrikesharp/plugins/disabled/RockTheVote/RockTheVote.dll

This is because I concatenate the game directory (/home/steam/cs2/game/csgo/) with this semi-relative path. I hope this helps and I might update the README.md to be more specific, but you can also refer to it to see the default values.

mavproductions commented 3 months ago

Yeah I think I'm getting !maps issues now. It keeps clinging to the default map groups. I'm not sure what else could've changed from my previous setup. RTV works now, but only for the default mapgroup

image

nickj609 commented 3 months ago

Hey @mavproductions , this is a great find! I believe updating the deregistration of votes was one of the last things I added and I clearly did not do enough testing!

I just made a commit with the bug fix. Can you build that and verify its working as intended? If so, I may just updated the v1.0.4 release since I believe your the only one who has downloaded it so far.

Thanks so much for all your testing!

mavproductions commented 3 months ago

No worries at all @nickj609 ! I'll build and compile in a sec and let you know how I make out

mavproductions commented 3 months ago

@nickj609 There we are!

I'll be pushing this build to my cs2-modded-server repo. That appears to have fixed my problems! :)

SOOO happy I can stop bothering you on your Sunday LOL 😂

nickj609 commented 3 months ago

Hey @mavproductions, fantastic news! Thrilled to hear it's working perfectly now. This plugin has the potential to be a game-changer for modded server administrators, offering them the flexibility to tailor features to their specific needs.

A couple of things to note:

  1. Votes will switch immediately if only 1 person is in the server (I believe this was the desired effect you requested, please correct me if I am wrong).

  2. Game mode rotations only occur when a custom RTV plugin is not being used. Additionally, Game mode/map rotations only get counted when performed automatically by my custom event game end handler. This is to prevent weird issues that may occur if an admin is trying to change maps or map groups and doesn't want the event handler to override their choices. It also makes it so voting map or mode changes do not get counted either. This could potentially be improved with some additional logic if desired.

I also made sure to include you in the latest release!

mavproductions commented 3 months ago

Hey @nickj609, All looks good. 1) Yes using !changemode does work exactly as I was expecting. It might be cool eventually to make alias that work per mode (I don't think that's an option right now?) 2) I need to test this out a little but this is something I'm really interested in having available. My biggest problem I'm facing right now with cs2-modded-server is that when people join the server and leave (usually on one_round modes like surf) and a player comes back to the server later (while it's empty), and goes instantly to the "End-match phase".

With rotation working (even while server is empty) that would potentially mitigate this problem entirely. But it might be tricky and require me doing some research into what events happen while the server is empty after a player comes in and leaves.

I'll let you know how things go when I test with Gamemode rotations. I assume it requires people in the server currently, so it probably requires me to do some testing and event logging.

Cheers and enjoy your weekend!!!

mavproductions commented 3 months ago

And thanks for including me in the contributors!! You didn't need to do that! :P

nickj609 commented 2 months ago

@mavproductions, added! :)