logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Time....

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support
View previous topic :: View next topic  
Author Message
Disco



Joined: 06 Dec 2006
Posts: 152

PostPosted: Wed Sep 19, 2007 12:02    Post subject: Time.... Reply with quote

For some background info, see : http://www.nwnx.org/phpBB2/viewtopic.php?t=723

This is about NWN1, though.

I use something like this as a runtime counter in seconds:

Code:
    sDateTime = IntToString(date.year);
    sDateTime += ":" + IntToString(date.month);
    sDateTime += ":" + IntToString(date.day);
    sDateTime += ":" + IntToString(date.hour);
    sDateTime += ":" + IntToString(date.minute);
    sDateTime += ":" + IntToString(date.second);


I use this to track the amount of time a PC spends on our server. At this moment this is done by making a database write every time a player changes areas. Anyway, I use the runtime counter to do this in a bit more efficient manner and have the login time also available in game without checking the database. At this moment I have both the new and the old system running parallel to check the results.

One thing I discovered is that the times recorded in MySQL are not equal to the times given by the counter above. After placing a few tracers I spotted this...

format: MySQL time - log message ( real time according to NWN )

2007-09-18 17:07:19 - Server Start
2007-09-18 18:00:11 - RunTime 4375 secs ( 18:20:50 )
2007-09-18 20:53:19 - Runtime 14763 secs ( 21:13:24 )

2007-09-18 20:55:40 - Server Start
2007-09-18 22:03:55 - Runtime 4097 secs ( 22:04:08 )
2007-09-19 00:37:14 - Runtime 13296 secs ( 00:37:40 )

2007-09-19 00:48:54 - Server Start
2007-09-19 02:21:08 - Runtime 5537 secs ( 02:21:22 )
2007-09-19 04:02:16 - Runtime 11605 secs ( 04:02:37 )


The first one is wacky. Our server gets a reset every 4 hours, effectively closing down the module at 03:53 hours of runtime. The first one has an internal time over 4 hours at the last measurement! The whole procedure is 20 minutes off within 10 minutes after the reset and stays that way.

The next logs are quite OK. The start of the runtimer and the logging of the server start aren't in the same function, so a few seconds is nothing I worry about.

Anyway, whatever the cause... it does suggest that the internal NWN clock isn't too reliable.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group