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 
 
letoscript and server crash

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



Joined: 13 Jul 2010
Posts: 29
Location: Italy

PostPosted: Tue Jul 13, 2010 3:16    Post subject: letoscript and server crash Reply with quote

First of all, sorry for my english, isn't my mother language.

I want to solve this problem, at first login of a player, i would check -and if necessary modify- it's class. Is letoscript the right tool or there are other function/plugin maybe better for execute this task?

If letoscript it's the right choice (i will use it also to modify hp, feats, ability and so on) i can't make it work, let's talk about my configuration.

I'm using an ubunt server edition 9.10 32bit.


NWNX2.ini:
Code:

   [NWNX]
   disablenwnxinit=n     #Set to "y" to not enforce the NWNX!INIT requirement

   [ODBC2]
   source=mysql
   server=127.0.0.1      #name of the database server
   user=###             #username to access db
   pass=###              #password for username
   db=###                #database to connect to

   [Debug]
   debuglevel=1          #Set to 1 or higher to output successively
   #                     # verbose debug information

   [LogDir]
   logdir=logs.0         #Set to the relative root of the log directory.


The module i load is all blank expect the demo script of aps (with relative include) and this script for testing the letoscript:
Code:

   void main()
   {

      object PC = GetLastUsedBy();
         SetLocalString(PC, "NWNX!LETO!SCRIPT", "print 'test'");
         FloatingTextStringOnCreature( GetLocalString(PC, "NWNX!LETO!SCRIPT"), PC );
   }


On the moduleOnLoad i have inserted:
Code:

   #include "x2_inc_switches" //Standard script
   #include "x2_inc_restsys" //Standard script

   #include "aps_include"

   void main()
   {

      // APS Init placeholders for ODBC gateway
      SQLInit();

//All above this is standard script
      if (GetGameDifficulty() ==  GAME_DIFFICULTY_CORE_RULES || GetGameDifficulty() ==  GAME_DIFFICULTY_DIFFICULT)
      {
         SetModuleSwitch (MODULE_SWITCH_ENABLE_UMD_SCROLLS, TRUE);
      }

      SetModuleSwitch (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE);

      if (GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == TRUE)
      {
         WMBuild2DACache();
      }

   }


I launch the server via ./nwnstartup.sh, it doesn't return any errors.
Code:

   NWNX2lib: Init
   NWNX2lib: org SetString() at 0x81f41b4, new SetString() at 0xb8032f00
   NWNX2lib: org GetObj() at 0x81f40bc, new GetObj() at 0xb8032f28
   * Parsing configuration...
   NWN Extender v2.7-beta4
   (c) 2004 by the APS/NWNX Linux Conversion Group
   (c) 2007-2008 by virusman
   Based on the Win32 version (c) 2003 by Ingmar Stieger (Papillon)
   and Jeroen Broekhuizen
   visit us at http://www.avlis.org

   * Loading modules...
   ODBC plugin Registerred.
   LETO plugin Registerred.
   * NWNX2 activated.
   Neverwinter Nights Server
   Build:8109
   Copyright BioWare Corp 1998-2004

   Server: Loading...
   Server: Running...

   Server: Loading module "SERVER"...
   Server: Module loaded
   INIT(S): valid ret=0x082041ec


At this poit, i open my nwn client and i connect at my server, at the end of loading the client disconnect and the server crash.

There is not errors on the server logs, there is only the client connection and anything other..
nwnserverLog:
Code:

   GameSpy Server Error: Unable to query the server. You may need to open port 5121 for incoming traffic.
   Connection Attempt made by Epitaffio85 (#####)
   [Tue Jul 13 01:56:27] Epitaffio85 (#####) Joined as Player 1


nwserverError is empty

nwnx_leto:
Code:

   NWNX-Leto Linux module (build 03)
   * Loading LetoScript.so...
   * LetoScript plugin activated.



I have alredy tried nwnx_easy and all the versions of leto at sourceforge.


Any idea? Thanks in advance.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Tue Jul 13, 2010 21:55    Post subject: sounds like Reply with quote

Right, there are 2 things to consider.


1. Letoscript is somewhat outdated now. It was a fantastic thing back in the day, but now nwnx_funcs for windows and linux, can actually do most if not all of the letoscript functions, more over, they dont require the player to log out either.

2. You describe the crash as occuring on Player Disconnect. I would check your onClientExit script, and see if you have the Letoscript() function running there.

I believe you may be leaving an invalid local variable on your chacater, which gets processed by the Letoscript function in the onClientExit script.



The purpose of the onClientExit script, is to execute the letoscript file changes on the bic files, whent he player leaves.

If you are accidentally putting a command such as print 'test' into this variable, and it is being picked up by the onClientExit, it may, and I stress 'may' be trying to execute this command as a file write command to the bic file, which is probably considered invalid, and causes a crash.


If you are going to do "print 'test';" I would suggest that you erase the locally stored variable, after you have placed it on the player.

Eg
Code:

object PC = GetLastUsedBy();
SetLocalString(PC, "NWNX!LETO!SCRIPT", "print 'test'");
DeleteLocalString(oPC,"NWNX!LETO!SCRIPT");



Other possiblities are

Letoscript.dll or module/binary is not the standard revision used by all.
I heard that the most recent dll for windows, is not actually the most stable revision, its possible the same can be said for linux?
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Wed Jul 14, 2010 1:21    Post subject: Re: sounds like Reply with quote

Baaleos wrote:
I heard that the most recent dll for windows, is not actually the most stable revision, its possible the same can be said for linux?


It is true, the most recent release 3+26 does not work, but 3+24 does. However, my package comes with the correct version and apparently he's tried that.
Back to top
View user's profile Send private message
Epitaffio



Joined: 13 Jul 2010
Posts: 29
Location: Italy

PostPosted: Wed Jul 14, 2010 1:31    Post subject: Reply with quote

Hum, first of all thanks for the tip on nwnx_funcs, i'll try it immediatly : )


About the second point, maybe i expressed myself badly. The crash will occur when the client is still on loading the area, practically at the end of the progress bar..

The only script i have is the onModuleLoad (the aps include plus the default script) and the leto_test that is on the onUse of a placeable.


But if nwnx_funcs can handle my problem (basically replace the first level class at the entering client) i've got my solution! Razz
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux 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