SQLMatches / Plugins

Plugins for SQLMatches
https://sqlmatches.com
GNU General Public License v3.0
5 stars 3 forks source link

Server crashes at the end of the game when it comes to showing the score #5

Open crashzk opened 3 years ago

crashzk commented 3 years ago

After the last plugin update: https://github.com/SQLMatches/Plugins/commit/bb8eea7d15cc680b15719b31b8e4c2fa112324cd

My competitive servers whenever the game ends and will show the scoreboard it hangs for a few seconds and then goes back to normal.

I use WarMod [BFG] to set up the mix / competitive. Can I do anything to fix this? Would it be something from the same SQLMatchers plugin or from WarMod?

crashzk commented 3 years ago

And even with this fix, (the demos were being finalized and uploaded to SQLMatches before finalizing the game) the problem still occurs.

Demos are uploaded to the site, but are not complete: https://sqlmatches.com/c/ZKServidores/scoreboard/810dc41f-3440-428e-ae0b-67a2acf757b7

This demo is the most recent and is not complete.

WardPearce commented 3 years ago

I don't think anything in the plugin should be causing these issues, most likely something with warmod is clashing with sqlmatches.

Do you have any errors?

crashzk commented 3 years ago

Plugin errors from what I see no, follow the most recent log:

L 04/23/2021 - 12:14:34: SourceMod error session started
L 04/23/2021 - 12:14:34: Info (map "de_mirage") (file "/home/ogp_agent/OGP_User_Files/whmcs/957/csgo/addons/sourcemod/logs/errors_20210423.log")
L 04/23/2021 - 12:14:34: [SM] Unable to load extension "system2.ext": /usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /home/ogp_agent/OGP_User_Files/whmcs/957/csgo/addons/sourcemod/extensions/system2.ext.so)
L 04/23/2021 - 12:14:34: [SM] Unable to load plugin "sbpp_discord.smx": Required extension "System2" file("system2.ext") not running
L 04/23/2021 - 12:14:34: [sqlmatches.smx] Error: ConVar sm_sqlmatches_key shouldn't be empty.
L 04/23/2021 - 12:14:34: [SM] Unable to load plugin "levels_ranks/levelsranks_exstats_geoip.smx": Native "GeoipCity" was not found
L 04/23/2021 - 12:14:38: [sbpp_comms.smx] You must set valid `ServerID` value in sourcebans.cfg!
L 04/23/2021 - 12:14:39: [sqlmatches.smx] HTTP_OnMapLoad - Invalid status code - Failed! Error: Invalid basic auth credentials
L 04/23/2021 - 12:14:39: [sqlmatches.smx] HTTP_UpdateServer - Invalid status code - Failed! Error: Invalid basic auth credentials
L 04/23/2021 - 12:14:39: [sqlmatches.smx] HTTP_UpdateServer - Invalid status code - Failed! Error: Invalid basic auth credentials
L 04/23/2021 - 12:14:41: Error log file session closed.
L 04/23/2021 - 12:14:45: SourceMod error session started
L 04/23/2021 - 12:14:45: Info (map "de_mirage") (file "/home/ogp_agent/OGP_User_Files/whmcs/957/csgo/addons/sourcemod/logs/errors_20210423.log")
L 04/23/2021 - 12:14:45: [sbpp_comms.smx] You must set valid `ServerID` value in sourcebans.cfg!
L 04/23/2021 - 12:14:46: [sqlmatches.smx] HTTP_UpdateServer - Invalid status code - Failed! Error: Invalid server
L 04/23/2021 - 12:14:46: [sqlmatches.smx] HTTP_OnMapLoad - Invalid status code - Failed! Error: Invalid version
L 04/23/2021 - 12:14:50: [vip/VIP_Stats.smx] [VIP STATS] [SteamWorks] IP:PORT inválido
L 04/23/2021 - 12:14:50: [vip/VIP_Stats.smx] [VIP STATS] [SteamWorks] IP:PORT inválido
L 04/23/2021 - 12:15:19: Error log file session closed.
L 04/23/2021 - 12:15:22: SourceMod error session started
L 04/23/2021 - 12:15:22: Info (map "de_mirage") (file "/home/ogp_agent/OGP_User_Files/whmcs/957/csgo/addons/sourcemod/logs/errors_20210423.log")
L 04/23/2021 - 12:15:22: [sbpp_comms.smx] You must set valid `ServerID` value in sourcebans.cfg!
L 04/23/2021 - 12:15:23: [sqlmatches.smx] HTTP_OnMapLoad - Invalid status code - Failed! Error: Invalid version
L 04/23/2021 - 12:15:28: [vip/VIP_Stats.smx] [VIP STATS] [SteamWorks] IP:PORT inválido

I am also thinking that it is something in WarMod, is that before the update / fix that you applied the demo it was not sent complete, it sent before finishing the game, but it didn’t crash the server when it finishes the game and was going to show the score.

About WarMod [BFG] it even has resources to record the demos automatically, but I disabled all of it and left only SQLMatches.

Follow the WarMod settings:

// WarMod Multiplayer
wm_active               "1"     //Enable or disable WarMod as active
wm_max_players          "10"    //Sets the maximum players allowed on both teams combined, others will be forced to spectator (0 = unlimited)
wm_round_money          "1"     //Enable or disable a client's team mates money to be displayed at the start of a round (to him only)
wm_min_ready            "10"    //Sets the minimum required ready players to Live on 3
wm_ingame_scores        "1"     //Enable or disable ingame scores to be showed at the end of each round
wm_lock_teams           "0"     //Enable or disable locked teams when a match is running
tv_enable               "1"     //GOTV enabled?
wm_auto_record          "1"     //Enable or disable auto SourceTV demo record on Live on 3

// Stats Site
wm_site_location        "zkservidores.com"          //Location of where the stats site is uploaded for download. Do not have '/' at end of string. eg. www.warmod.com
wm_site_data            "zkservidores.com/stats"    //Location of where the sites images, css and js files are. Do not have '/' at end of string. eg. warmod.bitbucket.org/stats
wm_demo_location        "zkservidores.com/demos/"   //Location of where the demo is uploaded for download. eg. www.warmod.com/demos/
wm_forums_location      "zkservidores.com/forum/"   //Location of where the community forums are. eg. www.warmod.com/forums/

// FTP Upload
wm_upload_results           "0"             //Enable or disable the uploading of match results via MySQL
wm_table_name               "wm_results"    //The MySQL table name to store match results in)
wm_table_name_players       "wm_players"    //The MySQL table name to store match players in)

// FTP Upload Demo
wm_autodemoupload_enable            "0"         //Automatically upload demos when finished recording
wm_autodemoupload_bzip2             "7"         //Compression level. If set > 0 demos will be compressed before uploading (Requires bzip2 extension)
wm_autodemoupload_delete            "0"         //Delete the demo (and the bz2) if upload was successful
wm_autodemoupload_ftptargetdemo     "demos"     //The ftp target to use for demo uploads
wm_autodemoupload_ftptargetlog      "logs"      //The ftp target to use for log uploads
wm_autodemoupload_ftptargetstats    "stats"     //The ftp target to use for stats site uploads
wm_autodemoupload_completed         "0"         //Only upload demos when match is completed

configs warmod.zip

WardPearce commented 3 years ago
wm_auto_record          "1"     //Enable or disable auto SourceTV demo record on Live on 3

Maybe try disabling this CVAR?

crashzk commented 3 years ago
wm_auto_record            "1"     //Enable or disable auto SourceTV demo record on Live on 3

Maybe try disabling this CVAR?

I've tried with it off and on and nothing, yet the problem remains.

In any case I deactivated it again, I will see the next demos if it solves the problem of not sending the complete competitive recording, until the end of the game.

WardPearce commented 3 years ago

If it was enabled, this would deffo cause issues.

if (GetConVarBool(wm_auto_record))
{
    ServerCommand("tv_stoprecord");
    if (!GetConVarBool(tv_enable))
    {
        LogError("[WarMod] GOTV is not enabled - Please enable to record demos or disable wm_auto_record");
    }
    else if (!StrEqual(save_dir, ""))
    {
        if (DirExists(save_dir))
        {
            ServerCommand("tv_record \"%s/%s%s.dem\"", save_dir, file_prefix, g_log_filename);
            g_log_warmod_dir = true;
            Format(g_sDemoPath, sizeof(g_sDemoPath), "%s/%s%s.dem", save_dir, file_prefix, g_log_filename);
            Format(g_sDemoName, sizeof(g_sDemoName), "%s%s.dem", file_prefix, g_log_filename);
            g_bRecording = true;
        }
        else
        {
            ServerCommand("tv_record \"%s%s.dem\"", file_prefix, g_log_filename);
            g_log_warmod_dir = false;
            Format(g_sDemoPath, sizeof(g_sDemoPath), "%s%s.dem", file_prefix, g_log_filename);
            Format(g_sDemoName, sizeof(g_sDemoName), "%s%s.dem", file_prefix, g_log_filename);
            g_bRecording = true;
        }
    }
    else
    {
        ServerCommand("tv_record \"%s%s.dem\"", file_prefix, g_log_filename);
        g_log_warmod_dir = false;
        Format(g_sDemoPath, sizeof(g_sDemoPath), "%s%s.dem", file_prefix, g_log_filename);
        Format(g_sDemoName, sizeof(g_sDemoName), "%s%s.dem", file_prefix, g_log_filename);
        g_bRecording = true;
    }
}

By the seems of it Warmod calls ResetMatch once a match ends, what handles a whole range of things. Most likely something here is causing a conflict.

Does using sm_sqlmatches_start_round_upload 1 fix anything?

I'm planning to rewrite this plugin once 1.0.0 of the API is completed, so if this continues to be a issue. I'll add Warmod support to my list.

crashzk commented 3 years ago

I disabled the WarMod cvar:

wm_auto_record          "0"     //Enable or disable auto SourceTV demo record on Live on 3

I changed to 1 the cvar sm_sqlmatches_start_round_upload from SQL Matches.

I will be testing it now and return with the results as soon as possible.

crashzk commented 3 years ago

@WardPearce I made the changes, even so nothing, demo is updated but not complete, finish the demo before ending in the case.

It also continues to crash the server at the end of the game, when it will show the score.

Remembering, this BUG only happens on competitive servers with WarMod [BFG], I believe it would have to be compatible with itself.

I will be waiting for you to finalize the API so you can test again.

DEMO with the CVARS changes mentioned above: https://sqlmatches.com/c/ZKServidores/scoreboard/8ddb4d7f-9d7e-4d3d-8354-b51162bdde15

crashzk commented 3 years ago

I took the liberty of recording now the end of a match to see the BUG crash.

https://drive.google.com/file/d/1kciew6gpKEwwjlfNDU7KjLm_e3AZ04n1/view?usp=sharing

WardPearce commented 3 years ago

odd, if its still crashing with those CVARS. Then it's most definitely a compatibility issue. I'll have to check it out once I'm done with the 1.0.0 api.

crashzk commented 3 years ago

@WardPearce checking the WarMod [BFG] code a little bit I saw that it stops recording demos after 5 seconds using the command tv_stoprecord:

    // stop tv recording after 5 seconds
    CreateTimer(5.0, StopRecord);
    CreateTimer(5.0, LogFileUpload);
//  CreateTimer(10.0, SQL_Player_Info_Clear);

Would implementing this delay in seconds solve the problem of not saving until the end of the game? Or it would have nothing to do, since if you don’t have the WarMod plugin everything works fine, we’re going to save it correctly.

WardPearce commented 3 years ago

Possibly, from my information without warmod it works correctly. Once the new API is out I'll be rewriting the plugin with plans to support get5/pugsetup & warmod better.