NoMercy
Joined: 03 Jan 2005 Posts: 123 Location: UK
|
Posted: Fri Mar 11, 2005 5:35 Post subject: |
|
|
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 :) |
|