PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
server countdown and shutdown of 5mins

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help 096
Display posts from previous:   

Author Message
snick



Joined: 29 Oct 2006
Posts: 13
Location: From Virginia living in Ontario

PostPosted: Thu Sep 06, 2007 9:36 pm    Post subject: server countdown and shutdown of 5mins Reply with quote

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.

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 517

PostPosted: Thu Sep 06, 2007 10:57 pm    Post subject: Reply with quote

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.

Author Message
snick



Joined: 29 Oct 2006
Posts: 13
Location: From Virginia living in Ontario

PostPosted: Thu Sep 06, 2007 11:23 pm    Post subject: Reply with quote

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?

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 517

PostPosted: Thu Sep 06, 2007 11:33 pm    Post subject: Reply with quote

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.

Author Message
snick



Joined: 29 Oct 2006
Posts: 13
Location: From Virginia living in Ontario

PostPosted: Thu Sep 06, 2007 11:41 pm    Post subject: Reply with quote

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]

Author Message
snick



Joined: 29 Oct 2006
Posts: 13
Location: From Virginia living in Ontario

PostPosted: Thu Sep 06, 2007 11:58 pm    Post subject: Reply with quote

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 Fri Sep 07, 2007 12:17 am; edited 1 time in total

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 517

PostPosted: Fri Sep 07, 2007 12:13 am    Post subject: Reply with quote

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

Author Message
snick



Joined: 29 Oct 2006
Posts: 13
Location: From Virginia living in Ontario

PostPosted: Fri Sep 07, 2007 12:48 am    Post subject: Reply with quote

I just took it out but may try the way you have it.

Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help 096 All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty