Aller au contenu

Photo

HCR2 database?


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
ShadowDragon311

ShadowDragon311
  • Members
  • 2 messages
Just a question, does anyone have working MySql scripts for HCR2 that proccesses SQLEncodeSpecialChars ?
hcr2_mysqldb_c
and any others that apply to get read / write to database working properly..

I've been working on it for three days and testing to no avail, not sure what I'm doing wrong... having issues with the death system and MySql with player names like Jo'long Jon'son.

:blink:

#2
ShadowDragon311

ShadowDragon311
  • Members
  • 2 messages
Nevermind, apparently it's almost impossible.

#3
kamal_

kamal_
  • Members
  • 5 260 messages
you should try the nwn2 irc channel

#4
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
You mean this --> CSLNWNX_SQLEncodeSpecialChars which is part of _CSLCore_Nwnx.nss ( and other similar code ).


example usage ( which is being used in real situations )
sSQL = "INSERT INTO "+CSLDB_PREFIX+"player (playerlogin,cdkey,firstlogin) VALUES( "+CSLInQs(sPlayerLogin)+", "+CSLInQs(sCDKey)+", NOW() );";

that quoting function is ( which is in the above file i linked to )
string CSLInQs( string sIn )
{ // Encodes Special Chars and Encloses a string in Single Quotes
	
	return "'" + CSLNWNX_SQLEncodeSpecialChars( sIn ) + "'";
	//return "'" + CSLNWNX_SQLEncodeSpecialChars(sIn) + "'";
	//return "'" + sIn + "'";
}


I have a string function as well which cleans up oddball characters in a players name. This makes it so players don't use accents which prevent other players from typing their names in if they want to chat with them.