The World of Layonara  Forums

Author Topic: Question about the Server Status page  (Read 401 times)

Moredo

  • Newbie
  • *
    • Posts: 2
      • View Profile
    Question about the Server Status page
    « 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)
     

    orth

    Re: Question about the Server Status page
    « Reply #1 on: March 03, 2009, 05:16:39 PM »
    Hiya, we update a db table from nwn when the module is started up, here is the actual code as a matter of fact.

    Code: [Select]
    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.
     

    Moredo

    • Newbie
    • *
      • Posts: 2
        • View Profile
      Re: Question about the Server Status page
      « Reply #2 on: March 03, 2009, 05:28:19 PM »
      Quote from: orth
      Hiya, we update a db table from nwn when the module is started up, here is the actual code as a matter of fact.

      Code: [Select]

      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
       

       

      SimplePortal 2.3.7 © 2008-2026, SimplePortal