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 
 
News
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Nov 03, 2006 23:26    Post subject: Reply with quote

@Morpheus: There will be an ODBC plugin in the future.

Development update 03.11.2006:

I haven't received my copy of NWN2 yet, so right now it is difficult to set a release date for the prototype (i.e. alpha) version. I think it is going to be in the next few days. Please do not expect a fully developed version with all the bells and whistles - it will be a functional prototype, not a finished application with a shiny GUI in the first few weeks.

The first database plugin (SQLite) is done and seems to work fine, although I did not get a chance to fully test it. Right after the first release, the plan is to continue work on the plugin interface, and after that is done, move on to the other plugins like SQL2005, MySQL, and so on. I will probably not do all by myself, though, so you can expect more open development tasks in this forum soon.
_________________
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: Sat Nov 04, 2006 17:50    Post subject: Reply with quote

if you want a beta or alpha tester, i can help you...My module is ready for SQL database and wait for your plugins Wink

And it will be a pleasure to help U
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Nov 11, 2006 16:01    Post subject: Reply with quote

Development update 11.11.2006:

Prototype 1.02 (Version 4.0.0.2) is available.

I fixed the problem with the SQLGetData function not recognizing the columns by simply throwing everything out and redoing the way resultsets and columns are handled. Now you can have bigger rows, bigger columns, it is considerably faster, and the hack of using a special separater is gone.

Have fun!

* 11.11.2006: Version: 4.0.0.2 (Prototype 1.02)
- Rewrote and optimized parts sql_include und xp_sqlite
- SQLInit() function is no longer necessary and thus has been removed
- Fetching resultsets with SQLFetch() is now 25% faster
- Fetching columns with SQLGetData() is now 25% faster
- SQLGetData() retrieves columns directly from the SQL plugin, thus eliminating the need for a special separator character
- There is no longer a size limit for result set rows, since columns are fetched individually
- New function SQLGetDataText() for retrieving large columns (e.g. 1024 bytes, no hard limit)

* 05.11.2006: Version: 4.0.0.1 (Prototype 1)
- Initial release of first prototype version
_________________
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: Sat Nov 11, 2006 17:45    Post subject: Reply with quote

Papillon,

nwserver.exe still crash when player exit game. Do you have any idea ?
Someone else have same problems ?
Back to top
View user's profile Send private message
mostal



Joined: 29 Apr 2005
Posts: 60

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

papillon, here is my msn adress to talk together if you want: roller.94@hotmail.fr
Back to top
View user's profile Send private message
sstacha



Joined: 08 Nov 2006
Posts: 3

PostPosted: Sat Nov 11, 2006 20:09    Post subject: Confirmed working: GetData(i) & Get/Set PersistantString Reply with quote

FYI

I downloaded and tried 1.02 today and I was able to successfully get a test using both Get and Set Persistant string as well as an ExceuteDirect.

Tested using "select * from pwdata where player = GetPCPlayerName(oPlayer) and tag = GetName(oPlayer) and name = "area" (the variable name that I wanted to store for this player). I then did a getData(4) for the value and it worked perfectly. The data was saved using SetPersistantData(oPlayer, "area", GetTag(GetArea(oPlayer))) and I also tested that I got the same value back with the GetPersistantData() call.

Nice work!
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 14:33    Post subject: Reply with quote

Great!

One request: Please restrict yourself to one or two posts in the news thread. If you want to discuss a longer topic, then create a new one. I've split the discussion about the crash, you can find it here.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

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

Development update 12.11.2006:

Prototype 1.03 (Version 4.0.0.3) is available.

- Fixed a crash situation on player exit
- New functions for querying NWNX and plugin status: NWNXInstalled, NWNXGetPluginCount, NWNXGetPluginClass (example)
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Fri Nov 17, 2006 16:37    Post subject: I'm doing something wrong Reply with quote

I downloaded version 1.03 and set everything up. When I imported the erf, only 1 script imported (the OnLoad script was missing). No problem, i dewnloaded version 1.01 and imported just the OnLoad script from the erf.

When I compile All Scripts, the OnLoad script throws an error. It appears that sqlinit() is not in the include file.

Have I missed something major somewhere?

Also, has anyone got an SQL script for creating test tables?
_________________
Jim (aka, Urlord)
Visit the Persistent World of Nymri


Last edited by Urlord on Sat Nov 18, 2006 21:25; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
amphiprion



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

PostPosted: Fri Nov 17, 2006 16:55    Post subject: Reply with quote

There is no error in the 1.03 erf, there is no more need of SQLInit() (so no more onLoad pecific script for nwnx4)
Back to top
View user's profile Send private message
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Fri Nov 17, 2006 17:53    Post subject: Reply with quote

amphiprion wrote:
There is no error in the 1.03 erf, there is no more need of SQLInit() (so no more onLoad pecific script for nwnx4)


Oh great - Thanks Amphiprion!
_________________
Jim (aka, Urlord)
Visit the Persistent World of Nymri


Last edited by Urlord on Sat Nov 18, 2006 21:25; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Nov 18, 2006 13:50    Post subject: Reply with quote

Development update 18.11.2006:

- New function SQLGetAffectedRows() returns the number of rows that were affected by the last INSERT, UPDATE, or DELETE operation.
- INSERT, UPDATE, and DELETE no longer overwrite the active resultset.
- New functions NWNXGetPluginSubClass, NWNXGetPluginVersion, and NWNXGetPluginDescription for getting additional data on a plugin

1) Here's an example of what can be done with the better resultset handling.

The code fetches two rows from a test table, then inserts a new row, then fetches a third row from the original result set.

Code:

void SQLResultsetTest()
{
   string s;
   
   SQLExecDirect("select * from test");
   if (SQLFetch() == SQL_SUCCESS)
   {
      s = SQLGetData(1);
      WriteTimestampedLogEntry("First row column 1: " + s);
   }
   if (SQLFetch() == SQL_SUCCESS)
   {
      s = SQLGetData(1);
      WriteTimestampedLogEntry("Second row column 1: " + s);
   }
   
   string sSQL = "INSERT INTO test VALUES ('abc', '123')";
   WriteTimestampedLogEntry("Executing: " + sSQL);   
   SQLExecDirect(sSQL);
   WriteTimestampedLogEntry("Affected rows: " + IntToString(SQLGetAffectedRows()));   
   
   if (SQLFetch() == SQL_SUCCESS)
   {
      s = SQLGetData(1);
      WriteTimestampedLogEntry("Third row column 1: " + s);
   }
   
}


Output:

Code:
[Sat Nov 18 12:27:55] First row column 1: abc0
[Sat Nov 18 12:27:55] Second row column 1: abc1
[Sat Nov 18 12:27:55] Executing: INSERT INTO test VALUES ('abc', '123')
[Sat Nov 18 12:27:55] Affected rows: 1
[Sat Nov 18 12:27:55] Third row column 1: abc2


2) Here's how to use the new query plugin functions:

Code:
void queryStatus()
{
   if (NWNXInstalled())
      WriteTimestampedLogEntry("NWNX is installed.");
   else
      WriteTimestampedLogEntry("NWNX is NOT installed.");

   int iPluginCount = NWNXGetPluginCount();
   if (iPluginCount > 0)
   {
      WriteTimestampedLogEntry("Number of plugins installed: " + IntToString(iPluginCount));
      WriteTimestampedLogEntry("Enumerating installed plugins:");
      
      int i;
      string sClass, sSubClass, sVersion, sDesc;

      for (i=1; i<=iPluginCount; i++)
      {   
         sClass = NWNXGetPluginClass(i);
         sSubClass = NWNXGetPluginSubClass(sClass);
         sVersion = NWNXGetPluginVersion(sClass);
         sDesc = NWNXGetPluginDescription(sClass);
         
         WriteTimestampedLogEntry("Plugin " + IntToString(i) + " provides function class " +
            sClass + " (subclass " + sSubClass + "). Version: " + sVersion);
            
         WriteTimestampedLogEntry("Description: " + sDesc);
      }
   }      
   else         
      WriteTimestampedLogEntry("There are no plugins installed.");

   
}


Output:

Code:
[Sat Nov 18 12:27:55] NWNX is installed.
[Sat Nov 18 12:27:55] Number of plugins installed: 1
[Sat Nov 18 12:27:55] Enumerating installed plugins:
[Sat Nov 18 12:27:55] Plugin 1 provides function class SQL (subclass SQLite). Version: 0.0.1
[Sat Nov 18 12:27:55] Description: This plugin provides database storage. It uses SQLite 3.3.8 as databaserver server and therefore is very ease to configure and maintain.

_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Urlord



Joined: 17 Nov 2006
Posts: 122

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

This is awesome Papillion. I can't tell you how many times I had to write testing routines with NWN2 just to find out if a Plug-in was properly installed. Thanks a heap!

Is prototype 1.04 available for download yet? I don't see it on the Download page, but the ChangLog shows the changed.
_________________
Jim (aka, Urlord)
Visit the Persistent World of Nymri
Back to top
View user's profile Send private message Send e-mail
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Nov 18, 2006 23:15    Post subject: Reply with quote

Development update 18.11.2006 (part 2):

Prototype 1.04 (Version 4.0.0.4) is available.

- MySQL plugin released
- Timer plugin + include file released

MySQL plugin has been tested with MySQL 4.1 and 5.0. Linking against the mysql library became quite an adventure today. MySQL AB seems to use Visual C++ 2003, while I use the 2005 version. This leads to all kinds of nasty problems, effectively, you can not use their binary static library. I had to recompile it on 2005 to make it work. No problem, though, I'll just include the files with the source so everyone who wants to compile the MySQL plugin can save herself some headache Wink

NOTE: Only have either xp_sqlite.dll or xp_mysql.dll in the nwnx4 directory! Rename the one you do not want to use to e.g. off_xp_mysql.dll or simply delete it. If you have both in the directory, nwnx.txt will tell you which one got activated, and which one was skipped !


Have fun!
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Sun Nov 19, 2006 0:10    Post subject: Reply with quote

Excellent news. Should have a set of demos available in short order.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
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