Raised This Month: $105 Target: $400
 26% 

Map Cycle Restoration on Crash (Linux Only)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Server Management        Approver:   EKS (167)
Maddo
Member
Join Date: Dec 2004
Old 02-06-2006 , 01:00   Map Cycle Restoration on Crash (Linux Only)
Reply With Quote #1

This combination of modified hlds_run shell script and AMXX plugin allows a crashing server to resume at the point in the mapcycle at which it left. The plugin "writenextmap.amxx" writes the contents of "amx_nextmap" to file at the start of each map. Upon a server crash the modified hlds_run script will read the mapname from this file, and restart the server using this map. A second shell script will also be called, which will reorder mapcycle.txt so that the map it is starting with, will now be at the end, and the mapcycle resumes as if the server never crashed. Upon exiting hlds, the original maycycle.txt and nextmap.txt will be restored.

There a number of things you must do to have this work properly
-You must use mapcycle.txt, and not maps.ini.
-You must have the core plugin, nextmap.amxx running.
-mapcycle.txt must only have one instance of each map. (it will still work, but reordering will not be correct if amx_nextmap is a duplicated map)
-make sure mapcycle.txt ends in a new line, otherwise a map will be dropped from the cycle on a server crash.
-To start the server, do not use a +map parameter. Put the map you want to start with in nextmap.txt, in the addons/amxmodx/configs folder.

Installation:
-Place "hlds_run_mapcycle" and "mapcycle" inside the root hlds folder
-Place "writenextmap.amxx" in your plugins folder and add it to plugins.ini
-Make sure the core plugin "nextmap.amxx" is also in plugins.ini
-Create a file "/addons/amxmodx/configs/nextmap.txt"
-inside "nextmap.txt", write the name of the map you want to start your server with

To start the server with map cycle recovery, use hlds_run_mapcycle rather than hlds_run, and make sure writenextmap.amxx and nexmap.amxx are loaded in plugins.ini. Do no use a +map paramater to start the server, this will cause problems. Stick the map you want to run first inside addons/amxmodx/configs/nextmap.txt.

For example, to start a TS server, you may type:
Code:
./hlds_run_mapcycle -game ts +maxplayers 12
Thanks to darkpast for writing the mapcycle shell script, and modifying the hlds_run shell script. Without his shell scripting skill, this modification would not have been possible.
Attached Files
File Type: zip mapcycle.zip (4.9 KB, 671 views)
File Type: sma Get Plugin or Get Source (writenextmap.sma - 1763 views - 1.1 KB)
Maddo is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-06-2006 , 16:14  
Reply With Quote #2

What is with your indentation?

Other than that, good idea.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Maddo
Member
Join Date: Dec 2004
Old 02-06-2006 , 23:07  
Reply With Quote #3

I find code is more readable when the braces are aligned with the indentation. That's just how I like it.
Maddo is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-07-2006 , 00:04  
Reply With Quote #4

You should use this stock in amxmisc.inc:

get_configsdir(name[],len)

Instead of your localinfo download.

It will make your plugin look cleaner.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Maddo
Member
Join Date: Dec 2004
Old 02-07-2006 , 00:16  
Reply With Quote #5

Thanks Suzuka, I acutally tried to do that when I first wrote it. I thought it was in amxmodx, and not amxmisc, so it wouldn't compile.

Cheers
Maddo is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 08-01-2007 , 23:30   Re: Map Cycle Restoration on Crash (Linux Only)
Reply With Quote #6

is this tested and does it work?
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
Maddo
Member
Join Date: Dec 2004
Old 08-06-2007 , 02:43   Re: Map Cycle Restoration on Crash (Linux Only)
Reply With Quote #7

It was tested and did work when it was written. If there's been an update to the hlds_run script by Valve since then, these changes won't be in the modified script.
Maddo is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 08-06-2007 , 03:22   Re: Map Cycle Restoration on Crash (Linux Only)
Reply With Quote #8

aa well tried it server dint crash yet if it crash il check if it will reset.
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
couk
BANNED
Join Date: Jul 2007
Location: United Kingdom
Old 08-06-2007 , 09:41   Re: Map Cycle Restoration on Crash (Linux Only)
Reply With Quote #9

can u make windows one please
couk is offline
Send a message via ICQ to couk Send a message via AIM to couk Send a message via MSN to couk
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 08-08-2007 , 02:10   Re: Map Cycle Restoration on Crash (Linux Only)
Reply With Quote #10

ok this doesn't work >.< my server finaly crashed after 3 days since amx super 3.4 updated to amx super 3.6 but 3.6 still has problems maybe it crashed it...but this plugin din't restore it....
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
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 15:31.


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