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 
 
[Problem] NWNx2

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



Joined: 09 Sep 2006
Posts: 17

PostPosted: Sat Sep 09, 2006 18:28    Post subject: [Problem] NWNx2 Reply with quote

[I'm french, sorry for my english :/]

Hi there,

I want a base for my module with NWNx/APS but I have some problem to do.

I ever work with NWN_FF but now I wan't to try NWNx2 ^^

I just want to link NWN to SQL no more.

Due NWNx2 is litlle and not release with a big factory script system I will do my proper factory script with NWNx2 ^^

I follow the manual to install NWNx2 on my server but when I play the aps_demo's module test, the first panel write me that NWNx is not ready :/

What happened ?

I use easyphp for my database (mysql) and my server has 2 ethernet card and is behind a router. Port needed are open.

So I post the log and I hope for help Wink

Code:

[Sat Sep 09 18:09:01] Loading Module: aps_demo
[Sat Sep 09 18:09:01]---- Server Options ----
Max Players: 10
Char Levels: (1-10)
Player Password: YES
DM Login Enabled: NO
Server Admin Login Enabled: YES
Post Game To Internet: YES
Game Type: PW Story
Difficulty: 2
PVP Setting: FULL
Vault: SERVER
Only One Party: NO
Enforce Legal Characters: YES
Item Level Restrictions: YES
Player pausing: DISABLED
Auto Save: Disabled
Saving Characters in Saved Game
---- End Server Options ----
[Sat Sep 09 18:09:01] APS initialized. Waiting for NWNX to become ready.
Connection Attempt made by Master_Prince (VD73LRPQ)
[Sat Sep 09 18:09:23] Master_Prince (VD73LRPQ) Joined as Player 1
[Sat Sep 09 18:09:58] APS/NWNX: Early query. Not executed.
[Sat Sep 09 18:09:58] APS/NWNX: Early query. Not executed.
[Sat Sep 09 18:10:02] APS/NWNX: Early query. Not executed.
[Sat Sep 09 18:10:02] APS/NWNX: Early query. Not executed.
[Sat Sep 09 18:10:04] APS/NWNX: Early query. Not executed.
[Sat Sep 09 18:10:21] Master_Prince Left as a Player (0 players left)
[Sat Sep 09 18:10:31] Server Shutting Down
Back to top
View user's profile Send private message Visit poster's website
Master_Prince



Joined: 09 Sep 2006
Posts: 17

PostPosted: Sat Sep 09, 2006 18:29    Post subject: Reply with quote

And a copy paste of my nwnx.ini

Code:

; NWNX2 configuration file
; These are the default values for NWNX2. Values specified on the command
; line take precedence.

[NWNX]
ServerPort = 5121
ModuleName = "aps_demo"
WatchdogProcess = yes
UpdateIntervalProcess = 5
WatchdogGamespy = no
UpdateIntervalGamespy = 20
GamespyRetries = 5
OldGamespyProtocol = no
RestartDelay = 5

[ODBC2]
; Log file
MaxLogSize = 512 ; in KByte
LogLevel = 2 ; 0=nothing, 1=only errors, 2=everything

;Use these two settings for the SQLite internal database
;source = sqlite
;file   = sqlite.db

; Use these two settings for ODBC connections
;source = odbc
;dsn    = nwn

;Use these five settings for MySQL connections
source = mysql
server = localhost
user   = *************
pwd    = *************
db     = nwn

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

[PROFILER]
MaxLogSize = 512 ; in KByte
LogLevel = 1 ; 1=overall statistics, 2=full script callstack
Back to top
View user's profile Send private message Visit poster's website
Master_Prince



Joined: 09 Sep 2006
Posts: 17

PostPosted: Sat Sep 09, 2006 18:32    Post subject: Reply with quote

And the createtable :

Code:

// Name     : Demo create table
// Purpose  : Create a table for persistent data
// Authors  : Ingmar Stieger
// Modified : January 30, 2003

// This file is licensed under the terms of the
// GNU GENERAL PUBLIC LICENSE (GPL) Version 2

#include "aps_include"

void main()
{
    SQLExecDirect("DROP TABLE pwdata");
    SendMessageToPC(GetLastUsedBy(), "Table 'pwdata' deleted.");

    SQLExecDirect("CREATE TABLE pwdata (" +
                    "player VARCHAR(64) default NULL," +
                    "tag VARCHAR(64) default NULL," +
                    "name VARCHAR(64) default NULL," +
                    "val TEXT," +
                    "expire SMALLINT UNSIGNED default NULL," +
                    "last TIMESTAMP(14) NOT NULL," +
                    "KEY idx (player,tag,name)" +
                    ")" );

    SendMessageToPC(GetLastUsedBy(), "Table 'pwdata' created.");
}


I just remove SQLite and Access part of script.
Back to top
View user's profile Send private message Visit poster's website
xaltos



Joined: 03 Jun 2006
Posts: 31
Location: Germany

PostPosted: Sat Sep 09, 2006 19:37    Post subject: Reply with quote

There should be some more log files in the logs.0 folder.
Look for nwnx_odbc.txt and nwnx.txt.

Have you init the nwnx² system with the SQLInit(); function ?
Back to top
View user's profile Send private message
Master_Prince



Joined: 09 Sep 2006
Posts: 17

PostPosted: Sat Sep 09, 2006 19:42    Post subject: Reply with quote

Yes the module is tha aps_demo so APS_LOAD is set.

I just install the nwnx2, no more plugin like odbc.

NwnX2 work with sql alone no ?

Here is the last log that there is.

Code:

NWN Extender V.2.6.1
(c) 2005 by Ingmar Stieger (Papillon) and Jeroen Broekhuizen
visit us at http://www.nwnx.org

* Loading plugins...
* Error: No plugins found
* NWNX2 activated.
* Function not specified.* Function not specified.* NWNX2 shutting down...
* NWNX2 shutdown successfull.
Back to top
View user's profile Send private message Visit poster's website
xaltos



Joined: 03 Jun 2006
Posts: 31
Location: Germany

PostPosted: Sat Sep 09, 2006 19:55    Post subject: Reply with quote

As far as I know are all function implemented as dlls's.
So you need the nwnx_odbc.dll as well.

The log should look like this.
Code:
* Loading plugins...
* Plugin odbc is loaded.
* Plugin profiler is loaded.
* NWNX2 activated.
Back to top
View user's profile Send private message
Master_Prince



Joined: 09 Sep 2006
Posts: 17

PostPosted: Sat Sep 09, 2006 19:58    Post subject: Reply with quote

Ok but why there isnt a package with nwnx2+odbc+profiler if nwnx2 can't work without ? :/

I will try with odbc and profiler plugin.

Thanks you
Back to top
View user's profile Send private message Visit poster's website
Acrodania



Joined: 02 Jan 2005
Posts: 208

PostPosted: Sun Sep 10, 2006 0:26    Post subject: Reply with quote

The ODBC dll is required for even direct connect or SQLite to function; it is more than just hte ODBC connector...

NWNX can funciton without it, but cannot connect to a database Wink
Back to top
View user's profile Send private message
Master_Prince



Joined: 09 Sep 2006
Posts: 17

PostPosted: Sun Sep 10, 2006 11:02    Post subject: Reply with quote

Okay, so NWNx can connect SQL alone.

It doesn't need any plugin for just communicate with SQL

But why this dll isn't with the nwnx2 package :S

I have no time to try this yesterday so I do today Smile

Thank you Wink
Back to top
View user's profile Send private message Visit poster's website
Master_Prince



Joined: 09 Sep 2006
Posts: 17

PostPosted: Sun Sep 10, 2006 13:08    Post subject: Reply with quote

Ok so I success my test (Wouhou!)

I just but put the odbc dll and it works, but I see that nowhere in the manual :S

Thanks you Wink

It works but now I will ask you another thing.

I always use a translator script made by a scripter of my staff.

I like to have the same for use the same fonction tha t it defines but with aps_include and no ff_include (coming from nwn_ff system).

Some exemple of these fonctions :

Code:

void SetStringSql ( string sTable, string sColonne, string sColonneAVerif, string sValeurAVerif, string sValeur )
{
   SQLExecDirect ( "UPDATE " + sTable + \
                   " SET " + sColonne + "='" + sValeur + "'" + \
                   " WHERE " + sColonneAVerif + "='" + sValeurAVerif + "'" );
}

string GetStringSql ( string sTable, string sColonneAChoisir, string sColonneAVerif, string sValeurAVerif )
{
   return SQLExecAndFetchSingle ( "SELECT " + sColonneAChoisir + \
                                  " FROM " + sTable + \
                                  " WHERE " + sColonneAVerif + "='" + sValeurAVerif + "'" );
}


My wish wiil that I can use fonction type like GetStringSql but with aps_include.

If someone can do that It will so cool !!!

But aps_include seems not integrate Fetching with exec direct :/
Back to top
View user's profile Send private message Visit poster's website
Acrodania



Joined: 02 Jan 2005
Posts: 208

PostPosted: Sun Sep 10, 2006 17:52    Post subject: Reply with quote

Actually the SQLExecDirect() command is also used to retrive. It simply passes the query through. Example:

string sSqlQuery="SELECT Count() FROM pwinfo WHERE Quest1 = 'Finished'";
SQLExecDirect(sSqlQuery);

Would return the count of how many time Quest1 was finished by players. If my syntax is correct anyways, I'm not really awake...
Back to top
View user's profile Send private message
Master_Prince



Joined: 09 Sep 2006
Posts: 17

PostPosted: Sun Sep 10, 2006 19:25    Post subject: Reply with quote

I don't understand all then how use that with my include ???
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows 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