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 
 
NeX System

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Nul_Char



Joined: 11 Jan 2005
Posts: 4

PostPosted: Fri Mar 11, 2005 5:08    Post subject: NeX System Reply with quote

Anyone using this system?

http://nwvault.ign.com/Files/scripts/data/1077811531000.shtml

I'm having the following problems:

1. What a player has an ' in there name it doesn't record it in the database
2. Doesn't tally any of the death status.

I'm still learning SQL and NWNX so any help would be great!

Nul_Char
Back to top
View user's profile Send private message
NoMercy



Joined: 03 Jan 2005
Posts: 123
Location: UK

PostPosted: Fri Mar 11, 2005 5:35    Post subject: Reply with quote

1. What a player has an ' in there name it doesn't record it in the database

The aps_include file has functions to handle this:
Code:
string SQLEncodeSpecialChars(string sString);
string SQLDecodeSpecialChars(string sString);

This encodes all ' characters as ^

What you, or if you can contact the scripts author they should do is every time something like:
Code:
sSQL = "SELECT player, ip, pubkey from players WHERE player='"
 + GetPCPlayerName(oPC)
 + "' AND tag='"
 + GetName(oPC)
 + "' LIMIT 1";


You need to wrap a SQLEncodeSpecialChars() function around the Get's eg:

Code:
sSQL = "SELECT player, ip, pubkey from players WHERE player='"
 + SQLEncodeSpecialChars( GetPCPlayerName(oPC) )
 + "' AND tag='"
 + SQLEncodeSpecialChars( GetName(oPC) )
 + "' LIMIT 1";


When reading things out of the database and you have code like:
Code:

sSQL = "SELECT player, ip, pubkey from...
...
RunSecCheck(oPC,
            SQLGetData(1),
            SQLGetData(2),
            SQLGetData(3));


You need to SQLDecodeSpecialChars the relevent fields, in this case:

Code:
RunSecCheck(oPC,
            SQLDecodeSpecialChars(SQLGetData(1)),
            SQLGetData(2),
            SQLGetData(3));


I've cleaned up the code a bit for this post to make things clear, but it shouln't be too hard to fix, as for the death status issue, that's probably a bug to take up with the author, and I'm not willing to dig though the logic to see what's happening just yet :)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Nul_Char



Joined: 11 Jan 2005
Posts: 4

PostPosted: Sat Mar 19, 2005 18:28    Post subject: Reply with quote

Thanks works great! I also learned a few things while do it Smile
Back to top
View user's profile Send private message
chunkymonky



Joined: 20 Feb 2005
Posts: 31

PostPosted: Thu Mar 24, 2005 23:44    Post subject: Reply with quote

i need to make this system save hp and would love to have it save feats and spells as well, but cannot figure out the scripting for it...anyone?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules 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