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 
 
Server crash on client leave
Goto page 1, 2  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Technical support
View previous topic :: View next topic  
Author Message
mostal



Joined: 29 Apr 2005
Posts: 60

PostPosted: Sat Nov 11, 2006 20:24    Post subject: Reply with quote

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
View user's profile Send private message
yi



Joined: 17 May 2005
Posts: 12
Location: France

PostPosted: Sat Nov 11, 2006 21:18    Post subject: Reply with quote

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
View user's profile Send private message
mostal



Joined: 29 Apr 2005
Posts: 60

PostPosted: Sat Nov 11, 2006 22:19    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
amphiprion



Joined: 07 Nov 2006
Posts: 44
Location: Toulouse (France)

PostPosted: Sat Nov 11, 2006 23:41    Post subject: Reply with quote

Same problem here
Back to top
View user's profile Send private message
mostal



Joined: 29 Apr 2005
Posts: 60

PostPosted: Sun Nov 12, 2006 10:13    Post subject: Reply with quote

did you try with pwdata or custom table definition ?
Back to top
View user's profile Send private message
mostal



Joined: 29 Apr 2005
Posts: 60

PostPosted: Sun Nov 12, 2006 10:59    Post subject: Reply with quote

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
View user's profile Send private message
amphiprion



Joined: 07 Nov 2006
Posts: 44
Location: Toulouse (France)

PostPosted: Sun Nov 12, 2006 12:45    Post subject: Reply with quote

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 Wink
Back to top
View user's profile Send private message
mostal



Joined: 29 Apr 2005
Posts: 60

PostPosted: Sun Nov 12, 2006 13:06    Post subject: Reply with quote

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
View user's profile Send private message
amphiprion



Joined: 07 Nov 2006
Posts: 44
Location: Toulouse (France)

PostPosted: Sun Nov 12, 2006 13:16    Post subject: Reply with quote

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
View user's profile Send private message
amphiprion



Joined: 07 Nov 2006
Posts: 44
Location: Toulouse (France)

PostPosted: Sun Nov 12, 2006 13:50    Post subject: Reply with quote

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 Wink
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Nov 12, 2006 18:51    Post subject: Reply with quote

@amphiprion: Thanks! I like bug reports like this one Wink

I was able to fix the crash problem and will upload a new prototype in the next few hours.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
amphiprion



Joined: 07 Nov 2006
Posts: 44
Location: Toulouse (France)

PostPosted: Sun Nov 12, 2006 21:32    Post subject: Reply with quote

Perfect, no more crash Wink

Great job Papillon
Back to top
View user's profile Send private message
mostal



Joined: 29 Apr 2005
Posts: 60

PostPosted: Tue Nov 14, 2006 16:12    Post subject: Reply with quote

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 Smile

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
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue Nov 14, 2006 18:11    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
mostal



Joined: 29 Apr 2005
Posts: 60

PostPosted: Tue Nov 14, 2006 23:43    Post subject: Reply with quote

I have to recheck and send you examples
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Technical support All times are GMT + 2 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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