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 
 
nwnstartup.sh ignoring module variable

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



Joined: 27 Dec 2008
Posts: 35

PostPosted: Fri Nov 04, 2011 3:58    Post subject: nwnstartup.sh ignoring module variable Reply with quote

I'm setting up the Linux version of NWNX on an Arch Linux box for a development server. After copying everything to the nwn folder (nwnstartup.sh, nwnx_*.so, etc.), I set up the options in the nwnstartup.sh to run the aps_demo.mod to verify that everything is set with MySQL. The problem I'm having is that no matter what options I use (-servername and -module primarily), the result comes up in LAN as "Dedicated Server" and "No module".

Code:

#!/bin/sh

export LD_PRELOAD=./nwnx2.so

./nwserver \
        -publicserver 1 \
        -servername TestServer \
        -dmpassword ******* \
        -oneparty 0 \
        -pvp 0 \
        -difficulty 2 \
        -elc 1 \
        -reloadwhenempty 0 \
        -module aps_demo.mod \
        -maxclients 2 \
        -servervault 1 \
        -maxlevel 40 \
        -gametype 0 \
        -autosaveinterval 0 \
        "$@"


I've tried using quotes and no quotes around the module name, with and without the .mod extension. But nothing seems to work. This is the correct file to use, isn't it?

And yes, the module is in the module folder. Very Happy

--------------------
System information:
Arch Linux i686
Linux 3.0-ARCH #1 SMP PREEMPT Wed Oct 19 10:27:51 CEST 2011 x86_64 Intel(R) Core(TM)2 Duo CPU T5550 @ 1.83GHz GenuineIntel GNU/Linux

NWN install directory: /home/<user>/nwn

Using the binaries of nwnx (did not compile them myself).
Back to top
View user's profile Send private message
12o



Joined: 27 Dec 2008
Posts: 35

PostPosted: Fri Nov 04, 2011 8:15    Post subject: Reply with quote

I might've found the problem. In looking through the logs, I found the message:

Code:

NWNX2 ODBC2 version 0.3 for Linux.
(c) 2005-2006 by dumbo (dumbo@nm.ru) & virusman (virusman@virusman.ru)
o Critical Error: Section [ODBC2] not found in NWNX.INI
o Shutdown


According to this, I need the NWNX.INI file. But the file located in the nwn directory is nwnx2.ini. I tried copying the nwnx2.ini to nwnx.ini. That didn't work. Since nwnx2.ini does not contain the [ODBC2] section at all, it appears I need to build one. It does contain [Database] which has all of the information to connect to the database server.

I'm using only the files that came with the following downloads:

Code:

http://www.nwnx.org/uploads/media/linnwnx2-2.5.3-rc1.tar_01.gz
http://www.nwnx.org/uploads/media/nwnx-2.7-beta4-linux_01.rar
http://www.nwnx.org/uploads/media/nwnx_odbc-0.3-static-sqlite.rar


located one the page: http://www.nwnx.org/index.php?id=nwnx2

When I run the nwnstartup.sh as a normal user or with sudo, I get the message:

Code:

NWNX2lib: Init
NWNX2lib: org SetString() at 0x81f41b4, new SetString() at 0xb77aaf00
NWNX2lib: org GetObj() at 0x81f40bc, new GetObj() at 0xb77aaf28
* 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...
ERROR: ODBC: OnCreate() failed.
* NWNX2 activated.
Neverwinter Nights Server
Build:8109
Copyright BioWare Corp 1998-2004

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

Server: Loading module "aps_demo.mod"
Server: Unable to load module
Server: Exiting...
NWNX2lib: Server exiting.


nwnx2.txt file contains:

Code:

NWN Extender v2.7-beta4
ERROR: ODBC: OnCreate() failed.
* NWNX2 activated.


nwserverLog1.txt file contains:
Code:

[Thu Nov  3 23:02:12] Loading Module: aps_demo.mod
[Thu Nov  3 23:02:12] Server Shutting Down


nwserverError1.txt file is empty.

The problem is obviously due to the missing NWNX.INI file that is supposed to have the [ODBC2] section. Can someone possibly help me build one?

I'm not sure if the inability to find the module is related to this same problem. The module is in the modules directory, along with the .erf in the erf directory. The MySQL database app is running and does allow access through the appropriate account (tested).

Any help with this would be greatly appreciated. Thank you in advance.

Regards.
Back to top
View user's profile Send private message
Squatting Monk



Joined: 28 Jun 2007
Posts: 76

PostPosted: Sun Nov 06, 2011 4:12    Post subject: Reply with quote

It's not included in the package on the nwnx.org page, but it is in the SVN repository where its filename is indeed nwnx2.ini, not NWNX.ini. NWNX.ini is the filename in the Windows version, but it looks like the logging was never updated to take this into account.

Here's what it should look like:


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

[Database]
# The old database driver (plugins/db)
server=               #name of the database server
user=                 #username to access db
pass=                 #password for username
db=                   #database to connect to

[ODBC2]
# The new database driver (plugins/odmbc) - recommended

; Use these five settings for MySQL connections
source=mysql
server=localhost
user=root
pass=
db=

; SQLite settings
;source=sqlite
;file=sqlite.db

; Set hookscorco to false if you want to disable hooking of
; StoreCampaignObject and RetrieveCampaignObject entirely

hookscorco = true


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

[LogDir]
logdir=logs.0         #Set to the relative root of the log directory.
Back to top
View user's profile Send private message
12o



Joined: 27 Dec 2008
Posts: 35

PostPosted: Sun Nov 06, 2011 16:53    Post subject: Reply with quote

Thank you very much for the info, Squatting Monk! It got me a little further. Rather than deal with any problems, I opted to get the SVN version and compile new. I was able to run ./configure easily enough (with the format included in the README file). However, I did run into another problem.

Commands:
./configure --prefix=/home/nwn/nwnserver --with-extraplugins=plugins/odmbc plugins/chat

During the 'make install' run, the script abruptly stopped with this:


Code:

...
/usr/lib/gcc/i686-pc-linux-gnu/4.6.2/../../../../include/c++/4.6.2/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
g++ -m32 -w -fPIC -shared -W -Wall  -o nwnx_resman.so HookDemandRes.o NwnDefines.o NWNXResMan.o plugin-resman.o
make[1]: Leaving directory `/home/nwn/temp/trunk/plugins/resman'
make -C plugins/spells PLUGIN_CFLAGS="-mtune=i386 -pipe -g -O2 -m32 -Iinclude -DHAVE_CONFIG_H" PLUGIN_CPPFLAGS="-mtune=i386 -pipe  -m32 -Iinclude -DHAVE_CONFIG_H" PLUGIN_LFLAGS="-m32 -w -fPIC -shared -W -Wall "
make[1]: Entering directory `/home/nwn/temp/trunk/plugins/spells'
gcc -mtune=i386 -pipe -g -O2 -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o funcs/f_GetSpellOption.o funcs/f_GetSpellOption.c
gcc -mtune=i386 -pipe -g -O2 -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o funcs/f_IntToObject.o funcs/f_IntToObject.c
gcc -mtune=i386 -pipe -g -O2 -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o funcs/f_SetSpellOption.o funcs/f_SetSpellOption.c
gcc -mtune=i386 -pipe -g -O2 -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include -mtune=i386 -pipe  -Wall -Werror -D_REENTRANT -D_THREAD_SAFE -I. -I.. -I../.. -I ../../include -I/usr/local/include  -c -o hooks/h_ComputeSpellRange.o hooks/h_ComputeSpellRange.c
hooks/h_ComputeSpellRange.c: In function ‘Hook_GetSpellRange’:
hooks/h_ComputeSpellRange.c:36:10: error: variable ‘no_bonus’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
/h_ComputeSpellRange.o
make[1]: *** [hooks/h_ComputeSpellRange.o] Error 1
make[1]: Leaving directory `/home/nwn/temp/trunk/plugins/spells'
make: *** [plugins/spells] Error 2


I did a search for the h_ComputeSpellRange.o file, but there's no trace of it. Not sure if this is a file created by the make script or if this simply isn't in the SVN. I can't get by this error. Any suggestions?
Back to top
View user's profile Send private message
12o



Joined: 27 Dec 2008
Posts: 35

PostPosted: Mon Nov 07, 2011 19:06    Post subject: Reply with quote

The last failure was apparently due to using 'make install' which according to other threads does not work. Using './install.sh' is supposed to work. Trying it instead...
Back to top
View user's profile Send private message
Ravine



Joined: 26 Jul 2006
Posts: 105

PostPosted: Tue Nov 08, 2011 17:42    Post subject: Reply with quote

Probably not, newer distribs always had some new problems. New kernel, newer compiler... on debian, current gcc is 4.4.5, on your's is 4.6.2... i vote for incompatible compiler/libs/headers.

And i think you don't have to use the '--with-extraplugins' parameter in this case. Odmbc and chat plugins are base plugins afaik, they compiled by default.
Back to top
View user's profile Send private message
PlasmaJohn



Joined: 04 Mar 2005
Posts: 70
Location: The Garage

PostPosted: Tue Nov 08, 2011 21:01    Post subject: Reply with quote

Quote:
Code:
hooks/h_ComputeSpellRange.c: In function ‘Hook_GetSpellRange’:
hooks/h_ComputeSpellRange.c:36:10: error: variable ‘no_bonus’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

Why the compilation is failing is simple: The compiler warned that the 'no_bonus' variable not being used and the compiler was told to treat all warnings as errors. KaBoom.

Easiest way to get around that is to look through the gcc manual on how to disable the warnings as errors feature (since I don't remember off the top of my head). As an alternative, you could comment out the declaration and assignment of the no_bonus variable.
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