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

Crash map recovery


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Plugin ID:
4173
Plugin Version:
0.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Try restore map what was before server crash/reboot
    Old 04-21-2014 , 12:42   Crash map recovery
    Reply With Quote #1

    Plugin keeps eye of played maps and try re-load map what was before:
    server crash/server reboot/server launch or reloading this plugin.

    To get this work in very first time, need change few level and let each map run 30 sec.
    Map what have work over 30 seconds would be loaded next time when server launch.
    If map haven't run that long, then plugin try load previous map of this one.
    If this map also haven't run that long, plugin not make any action anymore.
    You really need check your server then why it crash.

    If current map have running continually over 24 hour before server crash/reboot, it will not get loaded.

    Rant:
    If you have trouble on your server after installing this plugin, then remove it.
    I haven't much knowledge about SQL, so this plugin can be really

    FREE TO TRY! REMEMBER CRY, in here, this topic, so others can see!


    Plugin commands & cvars
    - There isn't.

    Installation / Settings
    Edit
    ...addons/sourcemod/configs/databases.cfg
    and add configure marked as red
    databases.cfg

    - If you not own any MySQL database, use SM SQLite:
    "driver" "sqlite"
    It will create database in ...addons\sourcemod\data\sqlite\sourcemod.sq3
    + EXTRA:

    Some reason, if you want use MySQL database,
    change "driver" to "mysql" and rest of settings to connect your host.


    Drop plugin *.smx in ...addons\sourcemod\plugins


    *Wait second, I get this URL
    Log:
    22.04.2014 V0.1
    - Added 24 hour limit in MySQL query
    Attached Files
    File Type: sp Get Plugin or Get Source (crash_map_recovery.sp - 1102 views - 3.2 KB)

    Last edited by Bacardi; 04-22-2014 at 00:47. Reason: Added 24 hour limit in MySQL query
    Bacardi is offline
    hkkelvin1995
    Senior Member
    Join Date: Jun 2009
    Location: Hong Kong
    Old 04-21-2014 , 13:45   Re: Crash map recovery
    Reply With Quote #2

    This seems useful as sometimes I always get my server crashed
    Here is my suggestion
    How about use a text file to store what map are you playing instead?
    Because some of ppl does host one server only which means SQL isn't necessary to them.
    And it will save more time of setting up the plugin.
    Anyway the plugin is nice, thanks
    hkkelvin1995 is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 04-21-2014 , 14:28   Re: Crash map recovery
    Reply With Quote #3

    Quote:
    Originally Posted by hkkelvin1995 View Post
    ...
    Because some of ppl does host one server only which means SQL isn't necessary to them.
    ...
    SourceMod have SQLite extension. Just remember add that setting into config file.
    Bacardi is offline
    Sarabveer
    Veteran Member
    Join Date: Feb 2014
    Old 04-21-2014 , 15:06   Re: Crash map recovery
    Reply With Quote #4

    Hey Bacardi, thanks for the ORIGINAL plugin! And finally I know how to use it MySQL!
    __________________
    Sarabveer is offline
    hkkelvin1995
    Senior Member
    Join Date: Jun 2009
    Location: Hong Kong
    Old 04-24-2014 , 04:20   Re: Crash map recovery
    Reply With Quote #5

    Quote:
    Originally Posted by Bacardi View Post
    SourceMod have SQLite extension. Just remember add that setting into config file.
    Oh yes, I almost forgot that.
    Btw I'm using MySQL now as I got multiple servers.
    It will be painful of switching to MySQL from SQLite
    I have that experience...

    Last edited by hkkelvin1995; 04-24-2014 at 04:37.
    hkkelvin1995 is offline
    Root_
    Veteran Member
    Join Date: Jan 2012
    Location: ryssland
    Old 04-24-2014 , 05:42   Re: Crash map recovery
    Reply With Quote #6

    Hey Bacardi! Threaded queries is fine for plugins that query data a bit often or/and during gameplay. Also threaded can be delayed for long time, so I recommend you to use simple queries. To be honest, I would just create a text file with latest map or maplist, and then load map from this instead of using database.
    I'd like to see the maps which have been nominated/played/excluded from mapvote before server crash. So server will return with previous nominations/recently played maps/whatever. In that case database would be nice.
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot
    Root_ is offline
    Bacardi
    Veteran Member
    Join Date: Jan 2010
    Location: mom's basement
    Old 04-24-2014 , 11:38   Re: Crash map recovery
    Reply With Quote #7

    Quote:
    Originally Posted by Root_ View Post
    Hey Bacardi! Threaded queries is fine for plugins that query data a bit often or/and during gameplay. Also threaded can be delayed for long time, so I recommend you to use simple queries.
    Hi HI.
    Yeh, this do two threaded queries, connect and ask two previous map when plugin start.
    I assume, those binded statements are "normal" :/ ?

    And I don't see any harm if those threaded ones get delayed very long time, best is server not get halted because of this.
    But again, servers not have huge map collection, why need it.

    And again, what I remember Asherkin said in somewhere, "should not leave database connection open for long time..." or something.
    So, if I didn't misread, need connect/disconnect to database when need it.

    do these changes -> later. Valve time

    Quote:
    Originally Posted by Root_ View Post
    To be honest, I would just create a text file with latest map or maplist, and then load map from this instead of using database.
    yes, that would be better choice.
    I just started with these for testing purpose, just a example if someone want look code.

    Quote:
    Originally Posted by Root_ View Post
    I'd like to see the maps which have been nominated/played/excluded from mapvote before server crash. So server will return with previous nominations/recently played maps/whatever. In that case database would be nice.
    Doomsday will comes first before I succeed in this


    @hkkelvin1995
    This can be connect separatelly to using SQLite extension and let other connect to MySQL or where ever.
    But if run (forked) multiple server from one srcds program, should install then SM to each server, more on wiki.

    Last edited by Bacardi; 04-24-2014 at 11:39.
    Bacardi is offline
    Tank Missile
    Member
    Join Date: Aug 2013
    Old 04-29-2014 , 02:28   Re: Crash map recovery
    Reply With Quote #8

    There is already a plugin that recovers a map after a restart/crash: https://forums.alliedmods.net/showthread.php?p=889196 That one doesn't require a database.
    Tank Missile is offline
    Sarabveer
    Veteran Member
    Join Date: Feb 2014
    Old 04-30-2014 , 08:27   Re: Crash map recovery
    Reply With Quote #9

    Quote:
    Originally Posted by Tank Missile View Post
    There is already a plugin that recovers a map after a restart/crash: https://forums.alliedmods.net/showthread.php?p=889196 That one doesn't require a database.
    The thing is, I requested this plugin because THAT plugin messed up Synergy. SourceMod "sm_map" command won't work and it also messed up the "changelevel" command. If you want to see why to requested this, goto this topic. https://forums.alliedmods.net/showthread.php?t=238673
    __________________
    Sarabveer is offline
    Reply


    Thread Tools
    Display Modes

    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 10:17.


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