[Release] Server Restarter

Results 1 to 16 of 16
  1. #1
    Proficient Member Matthew-the-man is offline
    MemberRank
    Aug 2009 Join Date
    Canada, OntarioLocation
    175Posts

    happy [Release] Server Restarter

    Hello Ragezone,

    I've got a lot of people asking me how did I make the server restart every week without touching the Server, Well I created a .bat for my Hotel called Blabbers Hotel and it was crashing a lot so I ran this program and it helped me ever since! All you have to do is add the minutes, and seconds on when it will restart the server. How is this useful? This is useful if you're away on holidays, your busy, or if your server crashes a lot. Here is a tutorial!

    [Open Notepad]​


    [You should have this]​


    [Go to http://pastie.org/8180280 and copy the text and paste in Notepad]​

    [Once you edit it you should have something like this]​


    [Now click File, Save As...]​


    [Name the file, restarter.bat and put the save as type "All Files" then Click Save!]​


    [You're Done! now right click "restarter.bat" and click "Run as administrator"​



    [Credits]​

    Matthewza - For making this Tutorial​
    Unknown.. - For making this Script​

    If you like this release feel free to show your appreciation by clicking the 'Like' button. :)

    Thanks,
    Matthew


  2. #2
    Hello there RetroPiggy is offline
    MemberRank
    Aug 2013 Join Date
    UKLocation
    288Posts

    Re: [Release] Server Restarter

    Tell me the link for your hotel please! I used to play it but lost the link.

  3. #3
    Proficient Member Matthew-the-man is offline
    MemberRank
    Aug 2009 Join Date
    Canada, OntarioLocation
    175Posts

    Re: [Release] Server Restarter

    Quote Originally Posted by Retro1 View Post
    Tell me the link for your hotel please! I used to play it but lost the link.
    It's still in developing I'll let you know when it's done.

  4. #4
    Hello there RetroPiggy is offline
    MemberRank
    Aug 2013 Join Date
    UKLocation
    288Posts

    Re: [Release] Server Restarter

    Quote Originally Posted by Matthew-the-man View Post
    It's still in developing I'll let you know when it's done.
    YAY! Thanks

  5. #5
    Google my name... Komakech is offline
    MemberRank
    Nov 2011 Join Date
    EnglandLocation
    528Posts

    Re: [Release] Server Restarter

    Eh, although this does work the one flaw is since the hotel will only reboot once per time set if your server crashes say 5 minutes after this reboot is done it will be down until the automatic reboot kicks in..

    I built a piece of software about 2 years ago that would listen to the emulator, if the task disappeared then it'd fire an event which opened a new instance. Unfortunately people these days don't force a shutdown and exit of the server upon a "fatal exception" so their server's hang and the task is never killed, this means the software is redundant to them. I guess the other method would be checking the port connection using a ping, if the port isn't open then force a restart of the server. Yet again though if the server doesn't close the port upon an error then it'd never reboot.

  6. #6
    Account Upgraded | Title Enabled! TheOleg is offline
    MemberRank
    Apr 2008 Join Date
    EstoniaLocation
    570Posts

    Re: [Release] Server Restarter

    Code:
    taskkill /f /im server.exe

  7. #7
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: [Release] Server Restarter

    Can you do this every night at 0:00?
    And works for Phoenix yeah?

  8. #8
    Google my name... Komakech is offline
    MemberRank
    Nov 2011 Join Date
    EnglandLocation
    528Posts

    Re: [Release] Server Restarter

    Quote Originally Posted by DutchenL View Post
    Can you do this every night at 0:00?
    And works for Phoenix yeah?
    Code:
     @echo off
        title Server Restarter
        :start
            set time=86400
            start server.exe
            :loop
                cls
                IF %time% GTR 0 (
                    set /a time=%time% - 1
                    set /a min=%time%/1440
                    echo (Server name) Will Restart In %time% Seconds.
                    echo (Server name) will Restart in %time% Seconds Which is %min% Minutes.
                    ping 127.0.0.1 -n 2 > NUL
                    goto loop
                )
                taskkill /f /im server.exe
                cls
                close server
                goto start
    That'll run every 24 hours, start it at midnight and it'll reboot every night at midnight.

    Edit:
    Yes it'll work for phoenix, it'd work for any application you could make it keep restarting your Skype or browser if you really wanted

  9. #9
    Just out there.. Flare is offline
    MemberRank
    Jun 2012 Join Date
    269Posts

    Re: [Release] Server Restarter

    Thanks, this is something I will look into.

  10. #10
    Horror! Rajito is offline
    MemberRank
    Aug 2010 Join Date
    The NetherlandsLocation
    1,046Posts

    Re: [Release] Server Restarter

    Its not that useful but a good try. Why use a timer to restart the server? Just make it that whenever the server crashes , it restarts itself. That way your hotel users won't get disconnected every (.. Minutes you configured).

    A better solution would be this server restarter i made a few years ago, i know it says uber and holo but it just works with any kind of server!
    http://forum.ragezone.com/f353/uber-...server-737248/

    Sent from my SM-N900W8 using Tapatalk

  11. #11
    Google my name... Komakech is offline
    MemberRank
    Nov 2011 Join Date
    EnglandLocation
    528Posts

    Re: [Release] Server Restarter

    Quote Originally Posted by Rajito View Post
    Its not that useful but a good try. Why use a timer to restart the server? Just make it that whenever the server crashes , it restarts itself. That way your hotel users won't get disconnected every (.. Minutes you configured).

    A better solution would be this server restarter i made a few years ago, i know it says uber and holo but it just works with any kind of server!
    http://forum.ragezone.com/f353/uber-...server-737248/

    Sent from my SM-N900W8 using Tapatalk
    Nice work, this is a much better idea than the script in this thread.

    But I must point out this still falls under the same issue that I've outlined before, I have not seen a single server released on this forum that handles all exceptions correctly. 99% of the released servers will hang telling you there is an issue but not shutting itself down in the process... This means that your software will only restart an emulator if it actually shutsdown (error or manual)

    Other than that your software is the better option out of the two.

  12. #12
    Proficient Member Matthew-the-man is offline
    MemberRank
    Aug 2009 Join Date
    Canada, OntarioLocation
    175Posts

    Re: [Release] Server Restarter

    Quote Originally Posted by Rajito View Post
    Its not that useful but a good try. Why use a timer to restart the server? Just make it that whenever the server crashes , it restarts itself. That way your hotel users won't get disconnected every (.. Minutes you configured).

    A better solution would be this server restarter i made a few years ago, i know it says uber and holo but it just works with any kind of server!
    http://forum.ragezone.com/f353/uber-...server-737248/

    Sent from my SM-N900W8 using Tapatalk
    That may be better, but I like the script I have, works better for me.

  13. #13
    Ask me about Daoism FullmetalPride is offline
    MemberRank
    Nov 2010 Join Date
    2,172Posts

    Re: [Release] Server Restarter

    Quote Originally Posted by Komakech View Post
    Eh, although this does work the one flaw is since the hotel will only reboot once per time set if your server crashes say 5 minutes after this reboot is done it will be down until the automatic reboot kicks in..

    I built a piece of software about 2 years ago that would listen to the emulator, if the task disappeared then it'd fire an event which opened a new instance. Unfortunately people these days don't force a shutdown and exit of the server upon a "fatal exception" so their server's hang and the task is never killed, this means the software is redundant to them. I guess the other method would be checking the port connection using a ping, if the port isn't open then force a restart of the server. Yet again though if the server doesn't close the port upon an error then it'd never reboot.
    A fatal exception means that a program must restart regardless of the programming. The port is always open regardless of endpoint status, and you can't "ping" a port, either.

    This is why remote desktop connection is essential..

    If immediate help is necessary, and you want to be prepared for when you're not available, create a simple little socket server that listens on a different port for a "shutdown" request to start a batch file, but don't open the port in Windows Firewall. Next, create a socket client that can send the request from housekeeping.


    Never tried the socket server part, but I know it's possible to execute batch files in PHP too.

    - - - Updated - - -

    Quote Originally Posted by Matthew-the-man View Post
    That may be better, but I like the script I have, works better for me.
    That's respectable^^

  14. #14
    Google my name... Komakech is offline
    MemberRank
    Nov 2011 Join Date
    EnglandLocation
    528Posts

    Re: [Release] Server Restarter

    Quote Originally Posted by FullmetalPride View Post
    A fatal exception means that a program must restart regardless of the programming. The port is always open regardless of endpoint status, and you can't "ping" a port, either.

    This is why remote desktop connection is essential..

    If immediate help is necessary, and you want to be prepared for when you're not available, create a simple little socket server that listens on a different port for a "shutdown" request to start a batch file, but don't open the port in Windows Firewall. Next, create a socket client that can send the request from housekeeping.


    Never tried the socket server part, but I know it's possible to execute batch files in PHP too.
    A fatal exception will exit the program by default. The issue is that emulators are not isolating exceptions from affecting other areas but pretend everything is okay.

    Most emulators do not sufficiently handle their exceptions causing the program to freeze or certain features to become unavailable - usually resulting in users disconnecting, rooms being bugged or generally nothing works.

    If an emulator is not handling these sorts of exceptions and terminating the program upon capture it is difficult to build an external software to restart the program because the program is still running.. This includes sockets as they can still send and receive data upon a fatal exception.

    If these exceptions were handled correctly to ensure all data was saved, an error was logged in a file or into the database and the program shut down safely. Then and only then would an external software be able to restart the emulation upon an exception 100% of the time.

    I do revoke my comment on pinging a port, I have been informed this is impossible to do, I'll be perfectly honest I have never worked with sockets or even looked into the region of them. Networking is not my sort of subject I am just a software and web engineer. Thanks to Cecer
    Last edited by Komakech; 10-01-14 at 04:06 PM.

  15. #15
    [̲̅$̲̅(̲̅1̲̅)̲̅$ ̲̅] leenster is offline
    MemberRank
    May 2008 Join Date
    KanaadaLocation
    992Posts

    Re: [Release] Server Restarter

    I like the simplicity of this batch file although I like emumonitor better as it monitors cpu and mem usage and restarts the emu if they exceed the preset limits for a preset amount of time.

    But its kind of cool you can achieve this with just a batch file. Good find.



    Sent from my BlackBerry 9800 using Tapatalk

  16. #16
    Ask me about Daoism FullmetalPride is offline
    MemberRank
    Nov 2010 Join Date
    2,172Posts

    Re: [Release] Server Restarter

    Quote Originally Posted by Komakech View Post
    A fatal exception will exit the program by default. The issue is that emulators are not isolating exceptions from affecting other areas but pretend everything is okay.

    Most emulators do not sufficiently handle their exceptions causing the program to freeze or certain features to become unavailable - usually resulting in users disconnecting, rooms being bugged or generally nothing works.

    If an emulator is not handling these sorts of exceptions and terminating the program upon capture it is difficult to build an external software to restart the program because the program is still running.. This includes sockets as they can still send and receive data upon a fatal exception.

    If these exceptions were handled correctly to ensure all data was saved, an error was logged in a file or into the database and the program shut down safely. Then and only then would an external software be able to restart the emulation upon an exception 100% of the time.

    I do revoke my comment on pinging a port, I have been informed this is impossible to do, I'll be perfectly honest I have never worked with sockets or even looked into the region of them. Networking is not my sort of subject I am just a software and web engineer. Thanks to Cecer

    A fatal exception will kill a process. No more processor = no more listener. I get what you're saying, though? People have written emulators to stay idle no matter what.



Advertisement