Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ reboot countdown

reboot countdown

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Celest   (3 posts)  Bio
Date Thu 05 Oct 2006 09:54 PM (UTC)
Message
I was just wondering, what would be the easiest way to tweak the reboot code to include a global countdown. Ie. 5 Minutes to system reboot, 4 min etc. etc

Celest, Manager
EldhaMUD2, Forever Darkness
4everdarkness.eldhamud2.org
4everdarkness.eldhamud2.org port 8000
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Thu 05 Oct 2006 09:56 PM (UTC)
Message
Simply replace the existing echoes that display on a reboot.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Celest   (3 posts)  Bio
Date Reply #2 on Fri 06 Oct 2006 02:22 AM (UTC)
Message
True, but how would i setup the timing for it, is there any specific function i can use instead of it echoing everything all it once. ie. 5 min to reboot, (a minute passes) 4min to reboot etc.
Thanks for the reply though :)

Celest, Manager
EldhaMUD2, Forever Darkness
4everdarkness.eldhamud2.org
4everdarkness.eldhamud2.org port 8000
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #3 on Fri 06 Oct 2006 05:40 AM (UTC)
Message
Isn't that already set up?
When it prepares for a reboot it echos various messages about the world losing stabilty and so forth at very specific numbers of minutes before the actual reboot. All you should have to do is change those messages.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Reply #4 on Fri 06 Oct 2006 06:07 AM (UTC)
Message
in update.c there is a function called reboot_check, post the code to it and also post the code where it is called from, not the whole function, just the specific section surrounding it, if it is spitting all the echoes at once something is wrong with the code.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #5 on Fri 06 Oct 2006 09:39 PM (UTC)
Message
As he said, in update.c look for these lines:


void reboot_check( time_t reset )
{
   static char *tmsg[] = { "You feel the ground shake as the end comes near!",
      "Lightning crackles in the sky above!",
      "Crashes of thunder sound across the land!",
      "The sky has suddenly turned midnight black.",
      "You notice the life forms around you slowly dwindling away.",
      "The seas across the realm have turned frigid.",
      "The aura of magic that surrounds the realms seems slightly unstable.",
      "You sense a change in the magical forces surrounding you."
   };
   static const int times[] = { 60, 120, 180, 240, 300, 600, 900, 1800 };


Just change the messages like "You sense a change in the magical forces surrounding you." to "Reboot in 3 minutes", and so on.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #6 on Sat 07 Oct 2006 04:32 AM (UTC)
Message
That's what I'd suggested on mudbytes in response to this too, but I was told there that what he's asking about has to do with the reboot command rather than the auto-reboot and that the manual reboot doesn't call reboot_check and that he's also having issues with it outputting all of those messages at once. So I'm at a loss. The best suggestion I've seen so far for him was that AFK no longer has auto-reboot but instead has something like what he's after and to take a look at it.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #7 on Sat 07 Oct 2006 05:51 AM (UTC)
Message
Check out the setboot command:

http://www.gammon.com.au/forum/?wiki=setboot

Can't you just set a reboot in 15 minutes, and let the messages come out? I tried that and it seemed to work ok:


setboot time 15 50
Log: Nick: setboot time 15 50
Boot time set to Sat Oct  7 15:50:00 2006

(a minute later)

Lightning crackles in the sky above!

(a minute later)

You feel the ground shake as the end comes near!

(a minute later)

You are forced from these realms by a strong magical presence
as life here is reconstructed.
Log: Automatic Reboot

Log: Normal termination of game.
Log: Cleaning up Memory.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #8 on Sun 08 Oct 2006 12:26 AM (UTC)
Message
*shrug* Works that way for me too. I routinely use setboot to set when my auto-reboot will take place.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #9 on Sun 08 Oct 2006 06:09 PM (UTC)
Message
With the way I changed it in AFKMud it doesn't need the setboot command. In fact, that command doesn't even exist anymore in our code. Typing "reboot" with no arguments leads to an immediate 5 minute countdown. This countdown can be aborted by typing reboot again before it's finished.

The automatic reboot was a hack by the Smaug team to cover up a whole lot of serious memory leak problems they had with the code. Since 99% of those have been caught now between FUSS and AFKMud, the automatic boot isn't really necessary anymore. The mud will run for days, weeks, probably months if I'd let it, without significant memory loss.
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #10 on Sun 08 Oct 2006 09:47 PM (UTC)
Message
I should probably rip out the auto reboot stuff on mine and replace it with what AFK has too. Usually I use setboot to set the boot time to 6am on the 1st of the upcoming month more as a reminder to the staff and players that we'll be rebooting the server then. I only actually hotboot my mud every so often to bring online new stuff (varies from weekly to several times per day, depending on how busy my staff & I have been) and reboot my server itself (rather than the mud) on the first of each month. I can't recall the last time my mud actually did a reboot. *shrug*

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


32,922 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.