Post by baaleos on Nov 14, 2008 19:33:41 GMT
Hey Funky,
Me need your help
I have implimented a persistent time keeping system in my server, not just for uptime, but a system to track the in-game months and years.
The idea is to allow myself to set certain events to happen on certain days, automatically.
However, I find that nwnx is using the reset!plugin everytime I attempt to set the ingame month to anything above 8. (I know you offer no support for this, however I would appreciate if you had any insight on it)
Please have a look at my code, and let me know if there is anything obviously wrong.
This is portion of my heartbeat script... deals with updating the ingame time
The next bit is the portion from my onModLoad script.
Note - Only just added the delaycommand, to see if it fixes it.
The issue is not that it resets when the time reaches 8th month, it resets when you are restarting the module, and it receives the 8th month from the database.
Result: Continuous resets, until I set the month field in the mySQL database to 7 or less.
The following is from the odbc logfile.
The game heartbeat, beats once, then closes the module.
Could this actually be a bug with nwnx2? Since it only happens when it is active, and nwnserver itself is incapable of closing itself down.
Below is an example logfile of what it looks like when working/
Me need your help
I have implimented a persistent time keeping system in my server, not just for uptime, but a system to track the in-game months and years.
The idea is to allow myself to set certain events to happen on certain days, automatically.
However, I find that nwnx is using the reset!plugin everytime I attempt to set the ingame month to anything above 8. (I know you offer no support for this, however I would appreciate if you had any insight on it)
Please have a look at my code, and let me know if there is anything obviously wrong.
This is portion of my heartbeat script... deals with updating the ingame time
string iDay = IntToString(GetCalendarDay());
string iMonth= IntToString(GetCalendarMonth());
string iYear = IntToString(GetCalendarYear());
SQLExecDirect("UPDATE uptime SET UPTIME = '"+sUptime+"', gameday = '"+iDay+"', gamemonth ='"+iMonth+"', gameyear = '"+iYear+"'");
The next bit is the portion from my onModLoad script.
SQLExecDirect("SELECT gameday,gamemonth,gameyear from uptime");
if (SQLFetch() == SQL_SUCCESS) {
int iDay = StringToInt(SQLGetData(1));
int iMonth = StringToInt(SQLGetData(2));
int iYear = StringToInt(SQLGetData(3));
DelayCommand(5.00,SetCalendar(iYear,iMonth,iDay));
}
Note - Only just added the delaycommand, to see if it fixes it.
The issue is not that it resets when the time reaches 8th month, it resets when you are restarting the module, and it receives the 8th month from the database.
Result: Continuous resets, until I set the month field in the mySQL database to 7 or less.
The following is from the odbc logfile.
Logfile maximum size limit is: 524288 bytes
o Log level: Everything will be logged.
o Using MySQL connection.
o Hooking SCO....hooked at 5d5830
o Hooking RCO....hooked at 5d5710
o Connect successful.
o Got request: SELECT UNIX_TIMESTAMP()
o Sent response (10 bytes): 1226690307
o Got request: SELECT gameday,gamemonth,gameyear from uptime
o Sent response (8 bytes): 591374
The game heartbeat, beats once, then closes the module.
Could this actually be a bug with nwnx2? Since it only happens when it is active, and nwnserver itself is incapable of closing itself down.
Below is an example logfile of what it looks like when working/
o Logfile maximum size limit is: 524288 bytes
o Log level: Everything will be logged.
o Using MySQL connection.
o Hooking SCO....hooked at 5d5830
o Hooking RCO....hooked at 5d5710
o Connect successful.
o Got request: SELECT UNIX_TIMESTAMP()
o Sent response (10 bytes): 1226690408
o Got request: SELECT gameday,gamemonth,gameyear from uptime
o Sent response (8 bytes): 571374
o Got request: SELECT UNIX_TIMESTAMP() - 1226690408
o Sent response (1 bytes): 8
o Got request: UPDATE uptime SET UPTIME = '8', gameday = '5', gamemonth ='7', gameyear = '1374'
o Got request: SELECT UNIX_TIMESTAMP() - 1226690408
o Sent response (2 bytes): 16
o Got request: UPDATE uptime SET UPTIME = '16', gameday = '5', gamemonth ='7', gameyear = '1374'
o Got request: SELECT UNIX_TIMESTAMP() - 1226690408
o Sent response (2 bytes): 24