AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Map Cycle Restoration on Crash (Linux Only) (https://forums.alliedmods.net/showthread.php?t=23957)

Maddo 02-06-2006 00:00

Map Cycle Restoration on Crash (Linux Only)
 
2 Attachment(s)
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.

Hawk552 02-06-2006 15:14

What is with your indentation?

Other than that, good idea.

Maddo 02-06-2006 22:07

I find code is more readable when the braces are aligned with the indentation. That's just how I like it.

Twilight Suzuka 02-06-2006 23:04

You should use this stock in amxmisc.inc:

get_configsdir(name[],len)

Instead of your localinfo download.

It will make your plugin look cleaner.

Maddo 02-06-2006 23:16

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

Battousai-sama 08-01-2007 22:30

Re: Map Cycle Restoration on Crash (Linux Only)
 
is this tested and does it work?

Maddo 08-06-2007 01:43

Re: Map Cycle Restoration on Crash (Linux Only)
 
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.

Battousai-sama 08-06-2007 02:22

Re: Map Cycle Restoration on Crash (Linux Only)
 
aa well tried it server dint crash yet if it crash il check if it will reset.

couk 08-06-2007 08:41

Re: Map Cycle Restoration on Crash (Linux Only)
 
can u make windows one please

Battousai-sama 08-08-2007 01:10

Re: Map Cycle Restoration on Crash (Linux Only)
 
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....


All times are GMT -4. The time now is 20:05.

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