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

Crashed Map Recovery v1.5


Post New Thread Reply   
 
Thread Tools Display Modes
Author
crazydog
AlliedModders Donor
Join Date: Jan 2006
Plugin ID:
1062
Plugin Version:
1.5
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    33 
    Plugin Description:
    Reloads map server was on before it crashed
    Old 08-03-2009 , 11:14   Crashed Map Recovery v1.5
    Reply With Quote #1

    Description:
    This plugin will save the map your server is on to a data file, and reload that map when the server restarts for any reason (for example, after a crash).

    Installation:
    1) Upload crashmap.smx to addons/sourcemod/plugins/
    2) Restart your server (Important!)
    3) Edit cfg/sourcemod/plugin.crashmap.cfg to your needs

    Cvars:
    sm_crashmap_enabled - Enables (1-Default) or Disables (0) the plugin. Note that if disabled, map names will not be stored
    sm_crashmap_recovertime - Enables (1) or Disables (0-Default) the ability to recover the timelimit of the server.
    sm_crashmap_interval - Time interval (in seconds) between updates of timeleft. (Default 20, min 1)
    sm_crashmap_maxrestarts - Number of restarts that can happen before the default map is loaded. (Default 5, min 3)
    sm_crashmap_version - Shows the version

    Notes:
    A little about how sm_crashmap_maxrestarts works:
    Every time the map is recovered after a crash, the # of restarts goes up. Once it's higher than sm_crashmap_maxrestarts, the server will stay on the default map (set in the command line). If your default map crashes, that's something YOU should fix.

    There are 2 ways for the # of restarts to be reset:
    1) A player successfully connects to the server after a recovery
    2) The max restarts limit is reached, and the default map is loaded

    Changelog:
    Code:
    1.5
     - Messages are now logged to logs/CMR.log
     - crashmap.txt is now generated automatically
    1.4.3
     - Fixed compile warnings
     - Backs up and restores nextmap on crash + recover (test feature!)
    1.4.2
     - Autoconfig added. cfg/sourcemod/plugin.crashmap.cfg
    1.4.1
     - Added FCVAR_DONTRECORD to version cvar
    1.4
     - Added sm_crashmap_maxrestarts
     - Added support for checking if the map being changed to crashes the server
    1.3
     - Changed method of enabling/disabling recover time to improve performance
     - Added sm_crashmap_interval
    1.2
     - Added timelimit recovery
     - Added sm_crashmap_recovertime
    1.1
     - Added log message when map is recovered on restart
    1.0
     - Initial Release
    Attached Files
    File Type: sp Get Plugin or Get Source (crashmap.sp - 5175 views - 6.9 KB)

    Last edited by crazydog; 10-04-2009 at 17:09.
    crazydog is offline
    exvel
    SourceMod Donor
    Join Date: Jun 2006
    Location: Russia
    Old 08-03-2009 , 11:30   Re: Crashed Map Recovery
    Reply With Quote #2

    Good idea.
    You can also save timelimit.
    __________________
    For admins: My plugins

    For developers: Colors library
    exvel is offline
    Send a message via ICQ to exvel
    crazydog
    AlliedModders Donor
    Join Date: Jan 2006
    Old 08-03-2009 , 11:45   Re: Crashed Map Recovery
    Reply With Quote #3

    Quote:
    Originally Posted by exvel View Post
    Good idea.
    You can also save timelimit.
    That's also a good idea.

    After writing this plugin I'm surprised it hasn't already been written.

    Edit:
    Do you mean timeleft? or mp_timelimit?

    I can't save the timeleft since the server would have crashed.
    I don't think I need to save mp_timelimit, since I'd have to assume most people have mp_timelimit set in some config.

    Last edited by crazydog; 08-03-2009 at 12:18.
    crazydog is offline
    Sexual Harassment Panda
    Veteran Member
    Join Date: Dec 2008
    Location: San Diego, CA
    Old 08-03-2009 , 22:18   Re: Crashed Map Recovery
    Reply With Quote #4

    oh wow amazing idea crazydog. will install immediately.
    __________________
    Sexual Harassment Panda is offline
    exvel
    SourceMod Donor
    Join Date: Jun 2006
    Location: Russia
    Old 08-04-2009 , 04:17   Re: Crashed Map Recovery
    Reply With Quote #5

    Quote:
    Originally Posted by crazydog View Post
    Do you mean timeleft? or mp_timelimit?

    I can't save the timeleft since the server would have crashed.
    I don't think I need to save mp_timelimit, since I'd have to assume most people have mp_timelimit set in some config.
    I see the way how do it. You can save timeleft with GetMapTimeLeft each 20 seconds than after crash and server restart just set convar mp_timeleft to the latest saved time.
    __________________
    For admins: My plugins

    For developers: Colors library
    exvel is offline
    Send a message via ICQ to exvel
    crazydog
    AlliedModders Donor
    Join Date: Jan 2006
    Old 08-04-2009 , 04:36   Re: Crashed Map Recovery
    Reply With Quote #6

    I really don't like timers, as things happening repeatedly always makes me worry about performance, but I guess I'll put it in.

    v. 1.2 up. Includes support for saving timelimit.

    Last edited by crazydog; 08-04-2009 at 09:31.
    crazydog is offline
    Chris-_-
    SourceMod Donor
    Join Date: Oct 2008
    Old 08-04-2009 , 11:22   Re: Crashed Map Recovery
    Reply With Quote #7

    I'm surprised no one has made this till now : o
    Chris-_- is offline
    Doc-Holiday
    AlliedModders Donor
    Join Date: Jul 2007
    Old 08-05-2009 , 04:31   Re: Crashed Map Recovery
    Reply With Quote #8

    How ever server doc has an option when server crashes to go back the map it was on right or does it go back just to a certain map?
    Doc-Holiday is offline
    retsam
    Veteran Member
    Join Date: Aug 2008
    Location: so-cal
    Old 08-05-2009 , 05:04   Re: Crashed Map Recovery
    Reply With Quote #9

    Yeah id have to agree. Amazing this hasnt been created yet. Definitely useful. Good work.
    retsam is offline
    Timiditas
    Senior Member
    Join Date: Apr 2009
    Old 08-05-2009 , 05:14   Re: Crashed Map Recovery
    Reply With Quote #10

    Great idea. However...
    What if the server crashed *because* of a certain map? Then it would repeatedly crash over and over. Any way to detect that?

    Maybe you could count if the server has crashed for more than X times in a preset amount of time and if yes, do not change to the last map but to a random one. (This should be logged also)
    __________________

    Timiditas 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 11:47.


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