AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Server Crash Recovery (https://forums.alliedmods.net/showthread.php?t=187906)

Liverwiz 06-19-2012 14:41

Server Crash Recovery
 
Whats the code to recover after a server crash?
I've seen it around but i can't figure out what to search for. Asking is just easiest, as well as having a dedicated thread for it.

Exolent[jNr] 06-19-2012 14:55

Re: Server Crash Recovery
 
What do you want to recover? Last map played?

Liverwiz 06-19-2012 15:07

Re: Server Crash Recovery
 
Just check to see if it has just recovered after a restart/crash.

http://forums.alliedmods.net/showpos...1&postcount=22
That is what i'm trying to fix.

Exolent[jNr] 06-19-2012 15:11

Re: Server Crash Recovery
 
https://forums.alliedmods.net/showpo...83&postcount=8

Liverwiz 06-19-2012 16:05

Re: Server Crash Recovery
 
Quote:

Originally Posted by Exolent[jNr] (Post 1731843)

Thanks, but that's not what i'm looking for. What i need is code that goes in the #defines that tells the plugin if it was just rebooted.

Exolent[jNr] 06-19-2012 16:14

Re: Server Crash Recovery
 
That's not possible, because #defines are resolved at compile time not run time.

Liverwiz 06-19-2012 16:57

Re: Server Crash Recovery
 
Quote:

Originally Posted by Exolent[jNr] (Post 1731890)
That's not possible, because #defines are resolved at compile time not run time.

I know. That was a bad description.
How can i tell when the server just started?

Exolent[jNr] 06-19-2012 17:53

Re: Server Crash Recovery
 
Every map end create a file that is empty, used for checking if it was created last map.
On map start, check if this file exists. If not, the server just started. If it does, delete it.

This won't work if your server crashes on map change, such as missing a required model for a map.


All times are GMT -4. The time now is 06:10.

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