splewis / get5

CS:GO Sourcemod plugin for competitive matches/scrims
GNU General Public License v3.0
557 stars 175 forks source link

New scrim command not working as expected. #91

Closed Walks2K closed 7 years ago

Walks2K commented 7 years ago

Problem

The ready system is not working, it never tries to ready up the home team, only the away one.

Expected behavior

Players ready up and teams fix themselves and begin the match/knife round.

Actual behavior

Players ready up and when the teams need to ready up, everyone in the server readies up the "Away" team despite having their Steam ID's in the scrim_template.cfg It also adds everyone to the "Away" team by default.

Steps to reproduce

Ready up on the CT side (Home) and it will ready up the Away team.

splewis commented 7 years ago

Can you post your scrim_template.cfg file here? As well as any error logs in addons/sourcemod/logs.

Walks2K commented 7 years ago

scrim_template.cfg:

// You can customize some of the get5_scrim command settings here.
// You should not try to add a  "team2" or "spectators" sections.
// You should also not add a "maplist" section here.
// Besides those, you can add anything you would normally add to a
// match config here.

"Match"
{
    "scrim"     "1"
    "side_type"     "never_knife"
    "players_per_team"      "5"
    "maps_to_win"       "1"
    "skip_veto"     "1"

    // You should fill in this section. You can put as many player entries as you want.
    "team1"
    {
        "name"      "Outlaw.UK"
        "players"
        {
            "STEAM_1:0:161992302"       ""
            "STEAM_1:0:184488604"       ""
            "STEAM_1:0:180603120"       ""
            "STEAM_1:1:40303740"        ""
            "STEAM_1:1:112653044"       ""
            "STEAM_1:0:51931555"        ""
        }
    }

    "cvars"
    {
        "mp_halftime_duration"      "15"
        "mp_match_can_clinch"       "0" // Forces 30-round playout
        "mp_overtime_enable"        "0"
        "mp_limitteams"             "0"
        "get5_max_pause_time"       "0"
        "get5_check_auths"      "1"
        "get5_demo_name_format"     "scrim_{TIME}_{MAPNAME}" // Set to "" to disable recording
        "get5_kick_when_no_match_loaded"        "0"
    }

}

Sourcemod error logs (just me force trying to force ready the home team on CT but it readies the away side):

L 12/01/2016 - 04:13:11: Info (map "de_dust2") (file "errors_20161201.log")
L 12/01/2016 - 04:13:11: [SM] Unable to load extension "cleaner.ext": Failed to find signature. Please contact the author.
L 12/01/2016 - 04:13:12: [SM] Unable to load extension "curl.ext": /home/csgoserver/serverfiles/csgo/addons/sourcemod/extensions/curl.ext.so: undefined symbol: _ZNSs9_M_mutateEjjj
L 12/01/2016 - 04:14:01: Error log file session closed.
L 12/01/2016 - 04:14:02: SourceMod error session started
L 12/01/2016 - 04:14:02: Info (map "de_dust2") (file "errors_20161201.log")
L 12/01/2016 - 04:14:02: [UPDATER] --- BEGIN ERRORS FROM AUTOMATIC UPDATER ---
L 12/01/2016 - 04:14:02: [UPDATER] Checksums for file "sm-cstrike.games/game.csgo.txt" do not match:
L 12/01/2016 - 04:14:02: [UPDATER] Expected: 6f37030ae448d1a3a364e199be2ef1d4 Real: e894c33aaaacd1b5aca9c2b8a909969b
L 12/01/2016 - 04:14:02: [UPDATER] --- END ERRORS FROM AUTOMATIC UPDATER ---

I feel like it's just a case of the STEAMID's not working for some reason. I believe they are correct because I pulled them through the console. EDIT: Also, I use the exact same STEAMID's for my admins cfg and they work fine AFAIK.

Walks2K commented 7 years ago

Also just tested on another server that I have and it comes out with the same result after force readying. Despite having my STEAMID on the "players" section of scrim_template it readies me up as if I was on the away team, which is what was happening yesterday when we tried to use it in a scrim before just using the creatematch command.

Technoblazed commented 7 years ago

@splewis remind me again why each row in the team section has double quotation marks?

@walks2000 You should probably install both the curl and cleaner extensions to your server as well :^)

Walks2K commented 7 years ago

@Technoblazed I have but for some reason they won't load due to their respective errors, even after redownloading and installing the latest versions.

Technoblazed commented 7 years ago

@Walks2000 latest linux build for curl right? There was another patch for linux that's separate from the normal curl.

Walks2K commented 7 years ago

@Technoblazed AFAIK I used the _Linux build yeah, I just get the invalid signature error that is in the log above and cleaner's error is above it. I've tried reinstalling them both but no luck yet.

splewis commented 7 years ago

Thanks for giving the actual scrim_template.cfg file, everything looks fine there. The other extension issues in the logs are probably worth fixing, but are unrelated.

Can you clarify what happened? (if you happen to have screenshots, that helps as well)

Players ready up and when the teams need to ready up, everyone in the server readies up the "Away" team despite having their Steam ID's in the scrim_template.cfg

I'm not sure what you mean by "everyone readies up the Away team". They are marking themselves as ready. The only way to ready up a "team" is either:

When you say "added to the away team", that's also confusing. Right now, the "home" team is always put on ct and the "away" is on T. But you don't seem to imply everyone got put on T. Is the only reason you say this because the ready messages indicate the "away" team becoming ready?

@Technoblazed It's a keyvalues value, so you can't just put in the steamid in quotes. That's the key, but it needs a value to parse, even if it's an empty string.

Walks2K commented 7 years ago

What I mean by "everyone readies up the away team" is that whenever anyone readies up, on CT or T with their STEAMID in the template file, it only readies up the Away team and not the Home team. And the "adds everyone to Away team" I mean when people join, they usually get defaulted to T-Side like they are away but they are set in team1 in the template cfg. It's like the plugin is not registering the STEAMID's properly which is why no-one can join CT and it only ever readies up the Away (T) side even if they are on CT. I'll try and get a few people in and test it with a video of what I mean.

EDIT: Example image of what I mean (my SteamID is in the cfg and I'm CT, updated to latest build too) http://i.imgur.com/VQMRMqt.jpg

splewis commented 7 years ago

I think what is happening is that there is a problem writing the match config get5_scrim generates and so bogus values get loaded that don't reflect your scrim template file. This would probably be caused by the server not having some read/write permissions on needed files/directories.

I added some error checking in f5040faaba3e9ec1b86b15c16700f6374a3309dc that would make that case log errors at the least. Can you try using a newer build that includes that change?

A common reason this happens is that people upload plugin config files as root, which might cause issues for plugins trying to read files they can't access.

Walks2K commented 7 years ago

Used the new version which has now outputted this error:

get5_scrimL 12/04/2016 - 19:29:28: [get5.smx] Failed to load match config: Failed to read scrim template in addons/sourcemod/configs/get5/scrim_template.cfg
L 12/04/2016 - 19:29:28: get5_event: {
    "params": {
        "reason": "Failed to read scrim template in addons/sourcemod/configs/get5/scrim_template.cfg"
    },
    "matchid": "",
    "event": "match_config_load_fail"
}
L 12/04/2016 - 19:29:28: {
    "params": {
        "reason": "Failed to read scrim template in addons/sourcemod/configs/get5/scrim_template.cfg"
    },
    "matchid": "",
    "event": "match_config_load_fail"
}

These are my permissions for the template: https://gyazo.com/94993e9df1722db2df690140e81a197e

Technoblazed commented 7 years ago

@Walks2000 Can you show a FULL directory path to your scrim_template :)

Walks2K commented 7 years ago

@Technoblazed You can see the full directory at the top of this screenshot: https://gyazo.com/3a3a40e1fa12cb07f99a9d3a0fd68fde

Technoblazed commented 7 years ago

@Walks2000 file permissions for the get5 directory please.

Walks2K commented 7 years ago

@Technoblazed https://gyazo.com/8869249bcbed6bd3a67c06065ffb1639

Technoblazed commented 7 years ago

Well your permissions aren't wrong there, and I assume there's no need to go back further, because your sourcemod configs folder is acting as normally correct? Any chance you could check your sourcemod error logs for anything?

Walks2K commented 7 years ago

Everything else has the same permissions without the public write AFAIK. Quite stumped on this one but I'm trying to give my csgoserver user full super user to see if it makes a difference.

Technoblazed commented 7 years ago

@walks2000 Do you have ssh access?

Walks2K commented 7 years ago

If you mean via Putty and connecting as the csgoserver user then yes I can.

Technoblazed commented 7 years ago

Just to check that all files actually belong to the user :)

chown -R csgoserver:csgoserver /home/csgoserver/
Walks2K commented 7 years ago

Ran the command and no output returned, guessing everything belongs to csgoserver?

Technoblazed commented 7 years ago

I guess so :^) Test again and see if you get the error again.

Walks2K commented 7 years ago

Nope, still the same outputted error from earlier. :(

Technoblazed commented 7 years ago

Would you be able to test with the default config file?

Walks2K commented 7 years ago

Reuploaded the default one and still the same error code. Quite stumped on this one :P

Technoblazed commented 7 years ago

Whutttttttttttttttttttttttttttttttttttttttttttttt, Honestly no idea.

Walks2K commented 7 years ago

Just to check that get5 isn't weird I copied the example_match.cfg to the main directory and executed it flawlessly. Idek at this point

Technoblazed commented 7 years ago

I bet there's something messed up in the scrim settings somewhere :^)

Walks2K commented 7 years ago

Yeah, I've got no ideas on anything to try now, perms are setup correctly and there shouldn't be any reason the plugin can't read the file.

Technoblazed commented 7 years ago

I guess we could try this, over rcon: sm_basepath

Walks2K commented 7 years ago
"sm_basepath" = "addons/sourcemod" - SourceMod base path (set via command line)
Technoblazed commented 7 years ago
if (kv.ImportFromFile(templateFile)) {
    delete kv;
    MatchConfigFail("Failed to read scrim template in %s", templateFile);
    return Plugin_Handled;
  }

  if (!kv.ExportToFile(path)) {
    delete kv;
    MatchConfigFail("Failed to read write scrim config to %s", path);
    return Plugin_Handled;
  }

Look at that for a second, pretty sure SP screwed up.

Walks2K commented 7 years ago

Nothing looks wrong there to me Kappa

Technoblazed commented 7 years ago

@splewis Shouldn't kv.ImportFromFile(templateFile) have a ! at the start of it? Isn't the current situation sending an error even if the file is imported correctly.

splewis commented 7 years ago

Yes, it should.

Walks2K commented 7 years ago

Using newest version now, believe the issue has been found:

{
    "params": {
        "reason": "Missing \"team2\" section in match kv"
    },
    "matchid": "scrim",
    "event": "match_config_load_fail"
}
L 12/04/2016 - 20:04:32: [get5.smx] Failed to load match config: invalid match kv
L 12/04/2016 - 20:04:32: get5_event: {
    "params": {
        "reason": "invalid match kv"
    },
    "matchid": "scrim",
    "event": "match_config_load_fail"
}
L 12/04/2016 - 20:04:32: {
    "params": {
        "reason": "invalid match kv"
    },
    "matchid": "scrim",
    "event": "match_config_load_fail"
}
Technoblazed commented 7 years ago

All your problems will be solved ☁️

splewis commented 7 years ago

I've made many mistakes today.

Fixed that. The original cause is probably fixed since it wouldn't have reached that section if the import/export of the match config files were failing.

Walks2K commented 7 years ago

Just tested with the latest version and I can now run the get5_scrim command and load into the game, but when I join I was defaulted to T-Side (Away), I did not update the scrim_template.cfg with the default one.

splewis commented 7 years ago

Hm. Can you:

Walks2K commented 7 years ago

My profile: http://steamcommunity.com/id/me0wgoescat get5_scrim.cfg:

"Match"
{
    "matchid"       "scrim"
    "scrim"     "1"
    "maplist"
    {
        "de_dust2"      "x"
    }
    "scrim"     "1"
    "side_type"     "always_knife"
    "players_per_team"      "5"
    "maps_to_win"       "1"
    "skip_veto"     "1"
    "team1"
    {
        "name"      "Outlaw.UK"
        "players"
        {
        }
    }
    "cvars"
    {
        "get5_live_countdown_time"      "5"
        "mp_halftime_duration"      "15"
        "mp_match_can_clinch"       "0"
        "mp_overtime_enable"        "0"
        "get5_max_pause_time"       "0"
        "get5_check_auths"      "1"
        "get5_demo_name_format"     "scrim_{TIME}_{MAPNAME}"
        "get5_kick_when_no_match_loaded"        "0"
    }
    "team2"
    {
        "name"      "Away"
    }
}
splewis commented 7 years ago

So the issue is clearly that some items from the scrim template aren't making it into that generated file. You can remove your steamid if you don't want that public, since no steamids made it into that actual config get5 loaded.

I'll investigate this a bit more with your exact config.

Walks2K commented 7 years ago

Tried the default CFG and that too never returned any players in the team1 section of get5_scrim.cfg, surely this is the issue because if the players were there they could most likely join their respective teams.

Technoblazed commented 7 years ago

@Walks2000

I'll investigate this a bit more with your exact config.
Walks2K commented 7 years ago

@Technoblazed Just letting him know I also face issues using the default cfg. Surely that one would work if my CFG was the issue but that doesn't seem to be the case :P seems to just be an issue of writing the players to the get5_scrim.cfg and if that was fixed it would probably work as intended.

Technoblazed commented 7 years ago

@Walks2000 Could you try something for me? In your scrim_template.cfg, for each player in the second set of "" could you change those to "x" and retry?

The default plugin creates this as the file:

"team1"
    {
        "players"
        {
            "76561198142258240"     "x"
        }
    }

May just be a case that the keyvalues doesn't like "" as the value, because its not set.

Walks2K commented 7 years ago

New scrim.cfg:

"Match"
{
    "matchid"       "scrim"
    "scrim"     "1"
    "maplist"
    {
        "de_dust2"      "x"
    }
    "scrim"     "1"
    "side_type"     "always_knife"
    "players_per_team"      "5"
    "maps_to_win"       "1"
    "skip_veto"     "1"
    "team1"
    {
        "name"      "Outlaw.UK"
        "players"
        {
            "STEAM_1:0:161992302"       "x"
            "STEAM_1:0:180603120"       "x"
            "STEAM_1:1:40303740"        "x"
            "STEAM_1:1:112653044"       "x"
            "STEAM_1:0:51931555"        "x"
            "STEAM_1:0:184488604"       "x"
        }
    }
    "cvars"
    {
        "get5_live_countdown_time"      "5"
        "mp_halftime_duration"      "15"
        "mp_match_can_clinch"       "0"
        "mp_overtime_enable"        "0"
        "get5_max_pause_time"       "0"
        "get5_check_auths"      "1"
        "get5_demo_name_format"     "scrim_{TIME}_{MAPNAME}"
        "get5_kick_when_no_match_loaded"        "0"
    }
    "team2"
    {
        "name"      "Away"
    }
}

The players loaded PogChamp, I'll go in game and test it now to confirm it works.

Walks2K commented 7 years ago

Entered the game and was correctly placed on the CT side and force-ready readied up my team instead of the Away side. With the "x" get5_scrim is working as intended. @Technoblazed thank you :D

Technoblazed commented 7 years ago

Looks like it was trying to get a value that wasn't there :D

@splewis https://github.com/splewis/get5/pull/93

splewis commented 7 years ago

I really do hate valve's keyvalues system. I wouldn't say "trying to get a value that wasn't there", an empty string is a value is any reasonable system, but evidently the valve keyvalue library doesn't write out keyvalue pairs if the value is an empty string.

Thanks for the fix.