View previous topic :: View next topic |
Author |
Message |
mostal
Joined: 29 Apr 2005 Posts: 60
|
Posted: Sat Nov 11, 2006 20:24 Post subject: |
|
|
I don't know why but, i delete scripts that called sql_include but nwn2server crash too when player deconnect...Without nwnx4 it works but with nwnx4 it crashed....really strange....
I try another test with small module and it works..
May be module size interfers ? |
|
Back to top |
|
|
yi
Joined: 17 May 2005 Posts: 12 Location: France
|
Posted: Sat Nov 11, 2006 21:18 Post subject: |
|
|
mostal wrote: | I don't know why but, i delete scripts that called sql_include but nwn2server crash too when player deconnect...Without nwnx4 it works but with nwnx4 it crashed....really strange....
I try another test with small module and it works..
May be module size interfers ? |
I DO have the same issue... exactly the same _________________ http://www.arkalym.com |
|
Back to top |
|
|
mostal
Joined: 29 Apr 2005 Posts: 60
|
Posted: Sat Nov 11, 2006 22:19 Post subject: |
|
|
At 18:00, I have removed a script and server not crash anymore...this script create a SetLocalInt(GetModule(),"test",1)...curious but it works without it....
At 20:00, i'va made some new tests...database access create 3 lines in sqllite database, with SetPersistantInt function (by sql_include). The 3 lines successfully written in database, but i have errors in log file ("! SQL Error: SQL logic error or missing database") and server crash after log out....
It makes me crazy |
|
Back to top |
|
|
amphiprion
Joined: 07 Nov 2006 Posts: 44 Location: Toulouse (France)
|
Posted: Sat Nov 11, 2006 23:41 Post subject: |
|
|
Same problem here |
|
Back to top |
|
|
mostal
Joined: 29 Apr 2005 Posts: 60
|
Posted: Sun Nov 12, 2006 10:13 Post subject: |
|
|
did you try with pwdata or custom table definition ? |
|
Back to top |
|
|
mostal
Joined: 29 Apr 2005 Posts: 60
|
Posted: Sun Nov 12, 2006 10:59 Post subject: |
|
|
SetPersistantString retuirns log error, but not SetPErsistantInt
And it seems that SetLocalString(GetModule(),xxx,yy) function (in same script that SetPErsistantString function) makes nwn2servercrash with nwnx4 (in player logoff), but works without SetLocalString(GetModule(),xxx,yy) calls
Any ideas ? |
|
Back to top |
|
|
amphiprion
Joined: 07 Nov 2006 Posts: 44 Location: Toulouse (France)
|
Posted: Sun Nov 12, 2006 12:45 Post subject: |
|
|
Ok if found the problem (or at least my problem, but i think we have all the same issue)
As soon as you use SetLocalString on a player, the server will craft at loggout. SetLocalString make the server crash anywhere you place the code (not only onClientEnter, i tested on onUse and the crash occurs at loggout)
I tested SetLocalString on a placeable and there is no crash at loggout
I don't tested SetLocalInt, SetLocalLocation, ... on Player to see if it's only SetLocalString, or all SetLocal on player that crash the server at client loggout
Papillon, we are at your feet |
|
Back to top |
|
|
mostal
Joined: 29 Apr 2005 Posts: 60
|
Posted: Sun Nov 12, 2006 13:06 Post subject: |
|
|
you think that if a SetLocalString on a player is called during module working, it crashed server at logout, isn't it ?
And if SetLocalString is saved on item in player, do you think it could work ? |
|
Back to top |
|
|
amphiprion
Joined: 07 Nov 2006 Posts: 44 Location: Toulouse (France)
|
Posted: Sun Nov 12, 2006 13:16 Post subject: |
|
|
more informations (following new test)
Case 1: No bug at loggout
Script onUse on a lever
Code: |
void main() {
object oLevier = OBJECT_SELF;
object oPC = GetLastUsedBy();
SetLocalString(oPC, "titi", "tr");
}
|
Script onClientEnter
Code: |
void main() {
object oPC = GetEnteringObject();
SendMessageToPC(oPC,"ON ENTER");
WriteTimestampedLogEntry("************ ENTER");
if (!GetIsPC(oPC)) return;
SendMessageToPC(oPC,"ON ENTER suite");
WriteTimestampedLogEntry("************ ykENTER suite");
if (GetLocalInt(GetModule(),"ModuleInit") && !GetIsDM(oPC)) {
BootPC(oPC);
return;
}
}
|
no crash if player use the lever then quit
Case 2:
Same on use script
OnClientEnter (just adding last line):
Code: |
void main() {
object oPC = GetEnteringObject();
SendMessageToPC(oPC,"ON ENTER");
WriteTimestampedLogEntry("************ ENTER");
if (!GetIsPC(oPC)) return;
SendMessageToPC(oPC,"ON ENTER suite");
WriteTimestampedLogEntry("************ ykENTER suite");
if (GetLocalInt(GetModule(),"ModuleInit") && !GetIsDM(oPC)) {
BootPC(oPC);
return;
}
SetLocalInt(oPC, "InitRunning", 1);
}
|
crash if player use the lever then quit
Case 3:
Same script as case 2, but if the user DON'T use the lever and quit there is no bug.
So it seem that is the combinaison of a SetLocalInt(oPC, "InitRunning", 1); and SetLocalString (and maybe other SetLocal) on PC that cause the crash
If in the onClientEnter script i use SetLocalString instead of SetLocalInt the same bug occurs
PS: mostal, i don't know |
|
Back to top |
|
|
amphiprion
Joined: 07 Nov 2006 Posts: 44 Location: Toulouse (France)
|
Posted: Sun Nov 12, 2006 13:50 Post subject: |
|
|
Oki, last test (can't be simplier)
nothing is done in OnModuleLoad, OnClientEnter and OnClientLeave scripts
i create simply a script on the onUse of a lever
Code: |
void main() {
object oLevier = OBJECT_SELF;
object oPC = GetLastUsedBy();
SendMessageToPC(oPC, "levier=" + GetName(oLevier));
SetLocalString(oPC, "toto", "aatr");
SetLocalString(oPC, "titi", "tr");
}
|
BUG when client leave
Code: |
void main() {
object oLevier = OBJECT_SELF;
object oPC = GetLastUsedBy();
SendMessageToPC(oPC, "levier=" + GetName(oLevier));
SetLocalString(oPC, "titi", "tr");
}
|
Work fine when client leave
So two local variable on PC crash the server on exit
And the bug only occurs if the server is launched by NWNX4, hope you have an idea Papillon to this strange bug |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sun Nov 12, 2006 18:51 Post subject: |
|
|
@amphiprion: Thanks! I like bug reports like this one
I was able to fix the crash problem and will upload a new prototype in the next few hours. _________________ Papillon |
|
Back to top |
|
|
amphiprion
Joined: 07 Nov 2006 Posts: 44 Location: Toulouse (France)
|
Posted: Sun Nov 12, 2006 21:32 Post subject: |
|
|
Perfect, no more crash
Great job Papillon |
|
Back to top |
|
|
mostal
Joined: 29 Apr 2005 Posts: 60
|
Posted: Tue Nov 14, 2006 16:12 Post subject: |
|
|
yes, thank you Papillon for this work...
For next version, just few questions: do you plan to work on performance improvement ? Could we setup log details ?
I've made som test with 1.03 and it works fine with little table but tables with more than 200 records seems to be much longer than in nwn1 version to retrieve informations...but may be NWN2 engine is responsible for that and not NWNX4...ay be some request SQL logs may be useful to find if NWNX4 or NWN2 responsability
If you need some help, tell me, it will be a pleasure....
In "bug section", I may be wrong but it seems ReadPersitantInt function retrieve strange results when converted by IntToString function in NWN2 engine....
Mostal |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Tue Nov 14, 2006 18:11 Post subject: |
|
|
mostal wrote: | I've made som test with 1.03 and it works fine with little table but tables with more than 200 records seems to be much longer than in nwn1 version to retrieve informations... |
NWN2 + NWNX4 retrieve 500 rows in 15 milliseconds. That is considerably faster than it was in NWN1 + NWNX2 (look here), especially since in this test, I was reading the column value also, while in the old test, the row was only fetched without a column read.
mostal wrote: | In "bug section", I may be wrong but it seems ReadPersitantInt function retrieve strange results when converted by IntToString function in NWN2 engine.... |
Can you give me an example ? _________________ Papillon |
|
Back to top |
|
|
mostal
Joined: 29 Apr 2005 Posts: 60
|
Posted: Tue Nov 14, 2006 23:43 Post subject: |
|
|
I have to recheck and send you examples |
|
Back to top |
|
|
|