Raised This Month: $51 Target: $400
 12% 

[CSGO] Panorama Map Crash Fix (v1.4.0 30/03/2019)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Kashinoda
Member
Join Date: Dec 2017
Plugin ID:
6487
Plugin Version:
1.4.0
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 03-28-2019 , 09:25   [CSGO] Panorama Map Crash Fix (v1.4.0 30/03/2019)
    Reply With Quote #1

    This is an alternative version of BOT Benson's plugin which was later modified by Agent Wesker.

    I made this for my clan server (5-10 players max), I haven't had any client crashes using RCON or CS:GO Map Voting. If you are using RTV, SM Map Voting, Extended Mapchooser etc. you may be better off with BOT Benson's plugin.


    Description
    This tries to fix client crashes that have been happening since Valve introduced Panorama. This is achieved by forcing clients to reconnect on map change.

    This does not look for hooks in Sourcemod plugins, it uses AddCommandListener to detect a map change then instantly sends 'retry' to all connected clients.

    I believe any map change sends the 'changelevel' command to the server so this should work with any plugin, tested with sm_map without issues.

    Why does this happen?
    Maps are rendered in either HDR, LDR or both, when clients switch from one to the other CSGO crashes.
    https://github.com/ValveSoftware/csg...ux/issues/1965

    Installation
    Place smx file in csgo/addons/sourcemod/plugins/

    Changelog
    Quote:
    1.4.0 - Simpler code using AddCommandListenier. Previous versions hooked onto the server_spawn event and had to use a timer as clients were not shown as connected, the retry command is now sent as early as possible and no timer is required.
    1.3.0 - Do not send 'retry' to Bots
    1.2.0 - Do not send 'retry' if client joins empty server
    1.1.0 - Game type check and versioning by b3none
    1.0.0 - Initial release
    Code

    PHP Code:
    #include <sourcemod> 

    #pragma semicolon 1
    #pragma tabsize 0
    #pragma newdecls required

    public Plugin myinfo =
    {
        
    name "[CSGO] Panorama Map Crash Fix",
        
    author "Kashinoda",
        
    description "Prevent client crashes on map change",
        
    version "1.4.0",
        
    url "http://alliedmods.net/" 
    };

    public 
    void OnPluginStart() 

       
    AddCommandListener(MapChange"changelevel");
       
    AddCommandListener(MapChange"map");
           


    public 
    Action MapChange (int client, const char[] cmdint argc)
    {
        
    LogMessage("Map changing, sending 'retry' to clients"); 

          for (
    int i 1<= MaxClientsi++) 
            {
              if (
    IsClientConnected(i) && !IsFakeClient(i))
                  {                 
                     
    ClientCommand(i"retry"); 
                     
    LogMessage("Sending retry to %N"i); 
                  } 
            }     

    Console Output
    Code:
    map aim_office
    L 03/30/2019 - 14:39:05: [test.smx] Map changing, sending 'retry' to clients
    L 03/30/2019 - 14:39:05: [test.smx] Sending retry to Kashinoda
    L 03/30/2019 - 14:39:05: "Kashinoda<63><STEAM_1:0:xxxxxx><TERRORIST>" disconnected (reason "Disconnect")
    L 03/30/2019 - 14:39:05: "Kashinoda<63><STEAM_1:0:xxxxxx><TERRORIST>" [256 704 544] committed suicide with "world"
    L 03/30/2019 - 14:39:05: "Kashinoda<63><STEAM_1:0:xxxxxx>" switched from team <TERRORIST> to <Unassigned>
    Dropped Kashinoda from server: Disconnect
    L 03/30/2019 - 14:39:05: [META] Loaded 0 plugins (1 already loaded)
    ---- Host_Changelevel ----
    L 03/30/2019 - 14:39:05: [META] Loaded 0 plugins (1 already loaded)
    *** Map Load: workshop/260679898/aim_office: Map Group funL 03/30/2019 - 14:39:05: Log file closed
    Server logging data to file logs/L164_132_203_029_27015_201903301439_000.log
    L 03/30/2019 - 14:39:05: Log file started (file "logs/L164_132_203_029_27015_201903301439_000.log") (game "/home/csgosv/serverfiles/csgo") (version "7436")
    L 03/30/2019 - 14:39:05: Loading map "workshop/260679898/aim_office"
    L 03/30/2019 - 14:39:05: server cvars start
    Attached Files
    File Type: sp Get Plugin or Get Source (PanoramaMapCrashFix-v1.4.0.sp - 2729 views - 870 Bytes)
    __________________

    Last edited by Kashinoda; 04-11-2019 at 14:21.
    Kashinoda is offline
    B3none
    AlliedModders Donor
    Join Date: Oct 2016
    Location: United Kingdom
    Old 03-28-2019 , 10:47   Re: [CSGO] Map Crash Fix All (v1 28/03/2019)
    Reply With Quote #2

    PHP Code:
    #include <sourcemod>
    #include <sdktools>

    #pragma semicolon 1
    #pragma tabsize 0
    #pragma newdecls required

    public Plugin myinfo =
    {
        
    name "Map Crash Fix",
        
    author "Kashinoda",
        
    description "Prevent client crashes on map change",
        
    version "1.0.0",
        
    url "http://alliedmods.net/"
    };

    public 
    void OnPluginStart()
    {
        
    HookEvent("server_spawn"EventNewMap);
    }
     
    public 
    void EventNewMap(Event event, const char[] namebool dontBroadcast)
    {
        
    CreateTimer(2.0RetryPlayers);    
        
    LogMessage("Map change, reconnecting players in 2 seconds...");
    }

    public 
    Action RetryPlayers(Handle timer)
    {
        for (
    int i 1<= MaxClientsi++)
        {
            if (
    IsClientConnected(i))
            {
                
    ClientCommand(i"retry");
                
    LogMessage("Sending retry to %N"i);
            }
        }

    Hey, the URL wasn't quite right. May as well also set the version to 1.0.0 so that people know the first major version.

    https://semver.org/

    Edit:

    I guess if you wanna be super tedious you could only hook the event for CS:GO.
    PHP Code:
    #include <sourcemod>
    #include <sdktools>

    #pragma semicolon 1
    #pragma tabsize 0
    #pragma newdecls required

    public Plugin myinfo =
    {
        
    name "[CSGO] Panorama Map Crash Fix",
        
    author "Kashinoda",
        
    description "Prevent client crashes on map change",
        
    version "1.1.0",
        
    url "http://alliedmods.net/"
    };

    public 
    void OnPluginStart()
    {
        if (
    GetEngineVersion() == Engine_CSGO)
        {
            
    HookEvent("server_spawn"EventNewMap);
        }
        else
        {
            
    LogError("This plugin is degisned to fix a bug for CS:GO");
        }
    }
     
    public 
    void EventNewMap(Event event, const char[] namebool dontBroadcast)
    {
        
    CreateTimer(2.0RetryPlayers);    
        
    LogMessage("Map change, reconnecting players in 2 seconds...");
    }

    public 
    Action RetryPlayers(Handle timer)
    {
        for (
    int i 1<= MaxClientsi++)
        {
            if (
    IsClientConnected(i))
            {
                
    ClientCommand(i"retry");
                
    LogMessage("Sending retry to %N"i);
            }
        }

    __________________

    Last edited by B3none; 03-28-2019 at 10:55.
    B3none is offline
    TheBOSS
    Member
    Join Date: Nov 2018
    Old 03-28-2019 , 11:07   Re: [CSGO] Panorama Map Crash Fix (v1.0.1 28/03/2019)
    Reply With Quote #3

    error 017: undefined symbol "RetryPlayers"
    SM 1.9
    TheBOSS is offline
    Kashinoda
    Member
    Join Date: Dec 2017
    Old 03-28-2019 , 11:15   Re: [CSGO] Panorama Map Crash Fix (v1.0.1 28/03/2019)
    Reply With Quote #4

    Quote:
    Originally Posted by TheBOSS View Post
    error 017: undefined symbol "RetryPlayers"
    SM 1.9
    Try the new smx I've attached. It's working for me on SM 1.9.0.6275 and 1.9.0.6269, I don't have any older servers to test on.

    Quote:
    Originally Posted by b3none View Post
    Hey, the URL wasn't quite right. May as well also set the version to 1.0.0 so that people know the first major version.

    https://semver.org/

    Edit:

    I guess if you wanna be super tedious you could only hook the event for CS:GO.
    I enjoy being tedious, thanks for the tips. Updated.

    Last edited by Kashinoda; 03-28-2019 at 11:23.
    Kashinoda is offline
    B3none
    AlliedModders Donor
    Join Date: Oct 2016
    Location: United Kingdom
    Old 03-28-2019 , 11:25   Re: [CSGO] Panorama Map Crash Fix (v1.0.0 28/03/2019)
    Reply With Quote #5

    Doh! Forgot to edit the event callback name:
    PHP Code:
    #include <sourcemod>
    #include <sdktools>

    #pragma semicolon 1
    #pragma tabsize 0
    #pragma newdecls required

    public Plugin myinfo =
    {
        
    name "[CSGO] Panorama Map Crash Fix",
        
    author "Kashinoda",
        
    description "Prevent client crashes on map change",
        
    version "1.1.0",
        
    url "http://alliedmods.net/"
    };

    public 
    void OnPluginStart()
    {
        if (
    GetEngineVersion() == Engine_CSGO)
        {
            
    HookEvent("server_spawn"OnServerSpawn);
        }
        else
        {
            
    LogError("This plugin is degisned to fix a bug for CS:GO");
        }
    }
     
    public 
    void OnServerSpawn(Event event, const char[] namebool dontBroadcast)
    {
        
    CreateTimer(2.0RetryPlayers);    
        
    LogMessage("Map change, reconnecting players in 2 seconds...");
    }

    public 
    Action RetryPlayers(Handle timer)
    {
        for (
    int i 1<= MaxClientsi++)
        {
            if (
    IsClientConnected(i))
            {
                
    ClientCommand(i"retry");
                
    LogMessage("Sending retry to %N"i);
            }
        }

    __________________
    B3none is offline
    Gerticek
    Member
    Join Date: Dec 2018
    Old 03-28-2019 , 12:28   Re: [CSGO] Panorama Map Crash Fix (v1.1.0 28/03/2019)
    Reply With Quote #6

    Works thank you very much.
    Gerticek is offline
    NanoC
    Veteran Member
    Join Date: Jan 2016
    Location: Argentina
    Old 03-28-2019 , 12:46   Re: [CSGO] Panorama Map Crash Fix (v1.1.0 28/03/2019)
    Reply With Quote #7

    Should we delete the BOT Benson's plugin before install this one?
    __________________
    NanoC is offline
    Send a message via Skype™ to NanoC
    Kashinoda
    Member
    Join Date: Dec 2017
    Old 03-28-2019 , 12:50   Re: [CSGO] Panorama Map Crash Fix (v1.1.0 28/03/2019)
    Reply With Quote #8

    Quote:
    Originally Posted by NanoC View Post
    Should we delete the BOT Benson's plugin before install this one?
    They may conflict, I'd advise running just one.
    Kashinoda is offline
    Cruze
    Veteran Member
    Join Date: May 2017
    Old 03-28-2019 , 14:46   Re: [CSGO] Panorama Map Crash Fix (v1.1.0 28/03/2019)
    Reply With Quote #9

    Can confirm no crashes since 5-7 map changes in bhop server using mapchooser extended! Thanks for sharing this dude!!
    __________________
    Taking paid private requests! Contact me
    Cruze is offline
    sneaK
    SourceMod Moderator
    Join Date: Feb 2015
    Location: USA
    Old 03-28-2019 , 23:33   Re: [CSGO] Panorama Map Crash Fix (v1.1.0 28/03/2019)
    Reply With Quote #10

    Odd, when testing by myself, the server looped retrys and I could never get in-game. Seems as though server_spawn is being fired every time the first client joins. Windows server, hibernation disabled. I'll try messing with configurations and report back if I get it solved. Great solution, much more proper than the existing one!
    __________________

    Last edited by sneaK; 03-28-2019 at 23:36.
    sneaK is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 07:00.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode