The World of Layonara
The Layonara Community => Ask A Gamemaster => Topic started by: Moredo on March 03, 2009, 04:58:30 PM
-
Hi guys! :)
Let me start off this thread, by saying it's nice to see other NWN servers thriving at this 'late' stage in the NWN life! :D
I'm wondering about the php script you guys are running on your serverstatus page. It returns the uptime of the server, and I'm wondering if that is done strictly through php, or if you guys run a script on the module which returns that information.
If it is possible, I would definitely like to learn how it is done - as I that is something I'd like to add to the server which I'm a part of.
Hope I didn't post this in the wrong forum! :)
- Moredo (from Avlis)
-
Hiya, we update a db table from nwn when the module is started up, here is the actual code as a matter of fact.
sSQL = "UPDATE serverdata SET last_reset = unix_timestamp(now()) WHERE mod_id = '"+GetServerId()+"'";
Then our server status page queries that table, takes the current time and subtracts the time of the last_reset to give us our uptime in seconds. Then we just translate that to hours/minutes/seconds.
Take care.
-
Hiya, we update a db table from nwn when the module is started up, here is the actual code as a matter of fact.
sSQL = "UPDATE serverdata SET last_reset = unix_timestamp(now()) WHERE mod_id = '"+GetServerId()+"'";
Then our server status page queries that table, takes the current time and subtracts the time of the last_reset to give us our uptime in seconds. Then we just translate that to hours/minutes/seconds.
Take care.
Thanks Orth! :D