PenUltima Online

It is currently Sun Sep 07, 2008 2:23 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: server countdown and shutdown of 5mins
PostPosted: Thu Sep 06, 2007 5:36 pm 
Offline

Joined: Sun Oct 29, 2006 12:05 am
Posts: 13
Location: From Virginia living in Ontario
I've looked and haven't found an answer. How do I implement this in the console or is it implemented already? I want it to notify players that server will shutdown in 5 mins to be restarted and to then countdown and shutdown.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 06, 2007 6:57 pm 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 549
Take a look in the config/consoles.cfg file. In amongst the commands are these:
Code:
Commands
{
   CMD 1 shutdown Shutdown in 6 minutes
   CMD 2 shutdown Shutdown in 12 minutes
   CMD 3 shutdown Shutdown in 18 minutes
   CMD 4 shutdown Shutdown in 24 minutes
   CMD 5 shutdown Shutdown in 30 minutes
   CMD 6 shutdown Shutdown in 36 minutes
   CMD 7 shutdown Shutdown in 42 minutes
   CMD 8 shutdown Shutdown in 48 minutes
   CMD 9 shutdown Shutdown in 54 minutes
   CMD 0 shutdown Shutdown in 60 minutes
}



Then write a script in scripts/console to do the shutdown called shutdown.src. The following is an example and doesn't do exactly what you want but it's a good start. (This is either from an old distro or the WorldOfDreams scripts, not sure which:)

Code:
use uo;
use os;
use util;

include "include/clock";


program console_shutdown(cmd)
   cmd := CInt(cmd);
   var basetime;
   var nexttime;
   var i;
   case ( cmd )
      0: basetime := 60;
      1: basetime := 6;
      2: basetime := 12;
      3: basetime := 18;
      4: basetime := 24;
      5: basetime := 30;
      6: basetime := 36;
      7: basetime := 42;
      8: basetime := 48;
      9: basetime := 54;
   endcase

   for ( i := 1; i <= 3; i += 1 )
      nexttime := basetime - (( basetime / 3) * (i - 1));
      print("System Message: " + nexttime + " minutes to shutdown!");
      foreach onlinechr in EnumerateOnlineCharacters()
         SendSysMessage(onlinechr, "System Message: " + nexttime + " minutes to shutdown!", 3, 38);
      endforeach
      sleep(60 * basetime / 3);
   endfor
   Shutdown();
endprogram




I find I don't use the console though. For admin purposes I find it more convenient to use the internal pol webserver and manage it from there.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 06, 2007 7:23 pm 
Offline

Joined: Sun Oct 29, 2006 12:05 am
Posts: 13
Location: From Virginia living in Ontario
thank you very much that wasn't included in the wod scripts I have. I'm trying to get that webserver up but it says page not found......the address I'm putting in my browser is http://ip:5002 Is this correct?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 06, 2007 7:33 pm 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 549
That depends on your pol.cfg entry for the port.

http://127.0.0.1:5002 should work on the server if the defaults are then and the www server enabled in pol.cfg. Of course you need something in scripts/www/ for anything to be displayed.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 06, 2007 7:41 pm 
Offline

Joined: Sun Oct 29, 2006 12:05 am
Posts: 13
Location: From Virginia living in Ontario
Yes something is in the www folder from wod but still i'm getting page not found. My firewall isn't blocking my access to this computer? Seems strange that it would block me from my own computer but will check it.
Code:
#############################################################################
## Integrated Web Server
#############################################################################

#
# WebServer: in multithread mode only, run the internal web server
#            This may be a security risk.  It's susceptible to DoS attacks.
#            If someone knows a little about TCP/IP, they could cause you
#            trouble if it's enabled.
#
WebServer=1

#
# WebServerPort: What TCP/IP port to listen for web requests
#
WebServerPort=5002

#
# WebServerLocalOnly: Only allow access from localhost
#
WebServerLocalOnly=1

#
# WebServerDebug: Print trace information about http requests
#
WebServerDebug=0

#
# WebServerPassword: username/password required for access to the web server.
#                    if not specified, no password is required.
#
WebServerPassword=tweedledum/tweedledee
[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 06, 2007 7:58 pm 
Offline

Joined: Sun Oct 29, 2006 12:05 am
Posts: 13
Location: From Virginia living in Ontario
Now i'm getting the user/pw box to come up but it won't take the pw....have I got that in right? I can get on the webserver now. I took the pw out and added index.html to that address.


Last edited by snick on Thu Sep 06, 2007 8:17 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 06, 2007 8:13 pm 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 549
If your internet web server is for local only, there isn't really a need for a password is there?

Don't know, haven't used it.
Try
WebServerPassword=tweedledum:tweedledee


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 06, 2007 8:48 pm 
Offline

Joined: Sun Oct 29, 2006 12:05 am
Posts: 13
Location: From Virginia living in Ontario
I just took it out but may try the way you have it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl