Securing Your Server Without Master Server Authentication
#76
Posté 06 septembre 2012 - 02:51
I'll try it here.
but tell me one thing, if I want to drive to a DB on my FTP server, could I?
If yes, how?
#77
Posté 06 septembre 2012 - 04:12
HUNTER_of_Wisdom wrote...
Hello, Lightfoot8
I'll try it here.
but tell me one thing, if I want to drive to a DB on my FTP server, could I?
If yes, how?
The inly thing the .bat file does is write a NW source Script. If your NWN can write to your FTP server, then sure. Just open the Script up in the Toolset script editor and make any adjustments you need to make.
#78
Posté 07 septembre 2012 - 04:56
A mug of ale to you for the bat file and addition to the script. THANKS!!!
#79
Posté 09 septembre 2012 - 02:34
hey dude, i do not disturbe, but very weak in nwn BD, can you help me?
Can you give the tutorial Implemented to this? I mean from the beginning? even if I create and how a table in my DB ....
Sorry to this, but i need the your help in this.
I know, you help so much, and I so very happy to this.
Thanks to your help, Guy.
#80
Posté 03 octobre 2012 - 06:13
As we rebuild the PW (overhaul), security will be an issue. I have recovered the hard drive for the old server, from the rubble, and have managed to save the database file and mod file and everything else.
It will probably be 2013 before there's anything available to host.
#81
Posté 14 décembre 2012 - 08:06
None of the reports I received, however, mentioned seeing that player's characters, and one of them actually specifically says they are NOT there, so I figured it would be to good to post a clarification. All of what I'm about to say pertains only to MySQL-Linux. It SHOULD be true for other versions, but if it is not, I'd definitely like to hear about it. My experience with those other setups is simply too old for me to be sure, however. That caveat aside:
NWN treats playernames as case-sensitive. FunkySwerve and Funkyswerve are two totally different accounts. Having the server security script treat them as one would be inappropriate. This is actually a common point of confusion for our returning players, who can't figure out where all their characters went, and post asking if they've been deleted, when they're simply using the wrong playername because they forgot to capitalize something (or decapitalize it).
That said, NWN DOES have issue distinguishing identical player and character name combinations when dealing with local variables, requiring an entirely different anti-exp!0it code to cover certain situations if you allow players to delete characters. Those issues, however, are ALSO case-sensitive, so far as I know.
About the only other possible problem I can imagine is if your other databasing is failing to distinguish case sensitivity, which could lead to overlapping player/player-character database associations. That, however, is an issue with your approach to databasing, and not with this server security script.
As I said, if your experience varies from the above, and is not simply based on some confusion clarified above, I'd like to hear about it - either here, or in PM if you feel the issue requires some discretion.
Thanks,
Funky
#82
Posté 14 décembre 2012 - 08:30
You can fix it by using GetStringUpperCase or GetStringLowerCase to force all cases to either upper or lower. I'm amending the script in the initial post. Thanks to all who pointed this out.
Thanks,
Funky
#83
Posté 14 décembre 2012 - 09:12
UPDATE table SET colname=LCASE(colname);
Just substitute 'table' for your table's name, and colname for the column name, and you're golden (that example sets them all to lowercase). UCASE is the function should you want to set them all to uppercase.
Funky
#84
Posté 14 décembre 2012 - 09:29
UPDATE table SET colname=lower(colname);
SQLite apparently does not recognize the function LCASE, but uses lower(x) instead.
Modifié par AlgernonsGhost, 14 décembre 2012 - 09:30 .
#85
Posté 14 décembre 2012 - 09:33
Funky
Modifié par FunkySwerve, 14 décembre 2012 - 09:34 .
#86
Posté 14 décembre 2012 - 10:01
I actually like that this fix effectively locks in all letter case variations of a player's ID to that one player, thus giving them a completely unique name on the server.
I've already tested this fix on a Windows XP server client with SQLite default database that comes/installs with NWNX2, and it's working perfectly.
Thank you Funky!
Modifié par AlgernonsGhost, 14 décembre 2012 - 10:02 .
#87
Posté 10 janvier 2013 - 04:32
ultima03 wrote...
Non sql data storage is not reliable. (more like horrible)
Funky:. Thanks for sharing. I know you posted/mentioned these a long time ago but I set my NWN server aside for a while and am only now getting back into building. I took a look to compare them to my own scripts and glad to know I'm on the right track with my authentication plan.
Ultima03: Your post quoted above is misinformation.
I've been using the FoxPro based BioDB from day 1 for nearly 7 years now with absolutely 0 problems. You just need to know how to maintain the database properly.
Grab a DBF repacking tool and run it once every 60-90 days, or whenever your database files start to get large, and you'll be fine. I personally use iLabMalta's inexpensive DBFpacker. It works great, is fast, and can even be called from a scheduled job or script with instructions to repack an entire folder. There may be a good freeware alternative out there as well.
SQL is better for certain applications, especially if you have more advanced needs shared across multiple servers. But BioDB will work fine for these authentication scripts.
Modifié par maddogfarg0, 10 janvier 2013 - 04:40 .
#88
Posté 26 janvier 2013 - 03:58
One of the main advantages of the bioware database is its prepacked/user-friendly aspect, but having to use an external utility kills a lot of that - as you say, it requires additional knowedge. Given that, I can't really think of a reason to advocate for it over SQL, other than the inconvenience of having to transfer data from a user's old tables to new SQL tables.
Funky
#89
Posté 31 mars 2013 - 01:32
The script for a dm to remove a cd key from a player account. Does that involve the dm using normal chat, or the console commands?
I like the idea about a five minute time for accepting a new cd key, but the solution posted did not give a version for the Bioware database. I am curious about one thing. If a player wants to add another cd key, and sets their account to recieve a new key, does this option close after the player relogs, or does it stay open until next server reset.
Sorry for the questions, but these scripts are hard for me to understand some of it.
Thank you.
#90
Posté 01 avril 2013 - 04:45
Normal chat. Nothing I code uses the console commands.The script for a dm to remove a cd key from a player account. Does that involve the dm using normal chat, or the console commands?
It closes as soon as they relog.If a player wants to add another cd key, and sets their account to recieve a new key, does this option close after the player relogs, or does it stay open until next server reset.
Funky
#91
Posté 01 avril 2013 - 09:34
#92
Posté 24 août 2013 - 04:43
int VerifyPlayernameAgainstCDKey(object oPlayer) {
int nBoot = FALSE;
string sUnencoded = GetPCPlayerName(oPlayer);
string sPlayer = SQLEncodeSpecialChars(sUnencoded);
string sKey = GetPCPublicCDKey(oPlayer);
string sStoredKey, sAddingKey;
string sSQL = "SELECT val, tag FROM pwdata WHERE name='PlayernameKey" + sPlayer + "'";
object oMessenger = GetMessenger();
SQLExecDirect(sSQL);
/* there's at least one key stored already */
if (SQLFetch() == SQL_SUCCESS) {
sStoredKey = SQLGetData(1);
sAddingKey = SQLGetData(2);
/* they indicated that they wanted to add a key this login */
if (sAddingKey == "Adding") {
/* their current key is not in the key string, add it unless at 7 keys already */
if (FindSubString(sStoredKey, sKey) == -1) {
int nKeyLength = GetStringLength(sStoredKey);
if (sKey == "Q7RREKF3") {
DelayCommand(19.0, FloatingTextStringOnCreature("WARNING! You are using a public cd key from GoG. Check your chat log for more information", oPlayer, FALSE));
DelayCommand(20.0, SendChatLogMessage(oPlayer, COLOR_RED +
"We do not store the public key provided by Good Old Games, because it would allow anyone with that key to log in to your account. The key will not be added to your list of allowed cd keys." + COLOR_END, oMessenger));
/* must mark as no longer adding */
sSQL = "UPDATE pwdata SET tag='Set' WHERE name='PlayernameKey" + sPlayer + "'";
SQLExecDirect(sSQL);
} else if (nKeyLength > 61) { /* allow 7 keys max key-key-key-key-key-key-key 6 spacers + 7x8 keys = 62 */
nBoot = TRUE;
/* must mark as no longer adding */
sSQL = "UPDATE pwdata SET tag='Set' WHERE name='PlayernameKey" + sPlayer + "'";
SQLExecDirect(sSQL);
/* add the key to the string */
} else {
sSQL =
"UPDATE pwdata SET tag='Set',val='" + sStoredKey + "-" + sKey + "' WHERE name='PlayernameKey" + sPlayer +
"'";
SQLExecDirect(sSQL);
DelayCommand(25.0, FloatingTextStringOnCreature("New CD Key Successfully Added!", oPlayer, FALSE));
}
/* let them know they already had this key in their string */
} else {
DelayCommand(25.0,
FloatingTextStringOnCreature("CD Key Addition Failed! This key already listed for this account!", oPlayer,
FALSE));
/* must mark as no longer adding */
sSQL = "UPDATE pwdata SET tag='Set' WHERE name='PlayernameKey" + sPlayer + "'";
SQLExecDirect(sSQL);
}
/* they are not adding, and the cd key doesnt match those listed - boot and log */
} else if (FindSubString(sStoredKey, sKey) == -1) {
string sReport = "INCORRECT CD KEY DETECTED! ID: " + sUnencoded + "; Name: " +
GetName(oPlayer) + "; CD Key: " + sKey + "; IP: " + GetPCIPAddress(oPlayer) +
":" + IntToString(GetPCPort(oPlayer));
WriteTimestampedLogEntry(sReport);
SendMessageToAllDMs(sReport);
SendMessageToPCDMs(sReport);
SendMessageToPCAdmins(sReport);
nBoot = TRUE;
}
/* new account, add the key */
} else {
if (sKey == "Q7RREKF3") {
DelayCommand(19.0, FloatingTextStringOnCreature("WARNING! You are using a public cd key from GoG. Check your chat log for more information", oPlayer, FALSE));
DelayCommand(19.5, SendChatLogMessage(oPlayer, COLOR_RED +
"Everyone who buys a copy of NWN from Good Old Games gets the cd key you are using. This can cause many problems, including an inability to log in whenever anyone else is using the key. You should refer to our Installation Guide at http://wiki.hgweb.org/wiki/Installation_Guide for instrucitons on how to obtain a private cd key form GoG." + COLOR_END, oMessenger));
DelayCommand(20.0, SendChatLogMessage(oPlayer, COLOR_RED +
"We do not store the public key provided by Good Old Games, because it would allow anyone with that key to log in to your account. The key will not be added to your list of allowed cd keys, and anyone will be able to log in to your account, until you obtain a private key." + COLOR_END, oMessenger));
} else {
sSQL = "INSERT INTO pwdata (val,name) VALUES" + "('" + sKey + "','PlayernameKey" + sPlayer + "')";
SQLExecDirect(sSQL);
}
}
return nBoot;
}
Funky
#93
Posté 11 décembre 2013 - 05:15
Not to take anything away from this, but could a much simpler (but less robust) version simply write the cdkey onto the character persistently (nwnx2) and check using that and a much smaller script?
Just considering my options
#94
Posté 11 décembre 2013 - 07:01
slappy_the_ringthief wrote...
seems like a great system. I was just looking into this as I'm putting my server back up, after auth servers were closed.
Not to take anything away from this, but could a much simpler (but less robust) version simply write the cdkey onto the character persistently (nwnx2) and check using that and a much smaller script?
Just considering my options
THat would only lock a character to a CD key. It would not secure a players vault(USER NAME) to the player.
So if slappy_the_ringthief was playing a thief one day, you would not know if it was the same player playing slappy_the_ringthief the fighter the next.
#95
Posté 11 décembre 2013 - 10:30
The benefit of this system, though, is that you can link multiple CD keys to a player, and allow the player to add new ones. I've cooked up a slimmer system that uses a custom table. No string manipulation required to parse results.
#96
Posté 12 décembre 2013 - 04:46
Lightfoot8 wrote...
slappy_the_ringthief wrote...
seems like a great system. I was just looking into this as I'm putting my server back up, after auth servers were closed.
Not to take anything away from this, but could a much simpler (but less robust) version simply write the cdkey onto the character persistently (nwnx2) and check using that and a much smaller script?
Just considering my options
THat would only lock a character to a CD key. It would not secure a players vault(USER NAME) to the player.
So if slappy_the_ringthief was playing a thief one day, you would not know if it was the same player playing slappy_the_ringthief the fighter the next.
True, I had not thought of it that way. My characters would be safe but not my identity
#97
Posté 18 décembre 2013 - 02:32
Modifié par slappy_the_ringthief, 18 décembre 2013 - 02:41 .
#98
Posté 18 décembre 2013 - 08:25
Modifié par Squatting Monk, 18 décembre 2013 - 08:25 .
#99
Posté 02 juillet 2014 - 09:14
I implemented this system some time ago, before the exception for the generic GoG key was put in.
I now have a problem where there are a few accounts with that key bound to them.
Will adding that final else segment let them log in, or is there a further alteration that will be needed so they can at least log in until they get a new key? ie: I need it to purge the GoG key from their entry.
#100
Posté 16 août 2014 - 09:26
Can anyone help me please, I am very Noob at scripting. And I am in the need of this script but I cant seem to get it to work properly.
if anyone is up to it I just need a script I can put in conversation with a NPC that's binds the cd key when they choose to answer yes.
I don't want the key to bind until they talk to the npc and do it manually, and multiple keys are not important since so few ppl will play my server.
Please please and thank you in advance for any help I can get





Retour en haut







