View previous topic :: View next topic |
Author |
Message |
Makazasky
Joined: 27 Apr 2008 Posts: 21
|
Posted: Sun Apr 27, 2008 8:57 Post subject: NWNX Enforce Legal Character |
|
|
I made a plugin that check if a character file is valid base on "converted 2da" file. For the moment, it only has one function that check all stat of a character file and return if is legal or not.
http://rapidshare.com/files/114746581/nwnx_elc_2.rar.html
This plugin can be use with the bioware elc to complete it or with the legendary system by FunkySwerve.
Last edited by Makazasky on Wed May 14, 2008 5:00; edited 7 times in total |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Sun Apr 27, 2008 19:02 Post subject: |
|
|
So, if I create character in PRC's character creator, this plugin is able to check legality? _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
Makazasky
Joined: 27 Apr 2008 Posts: 21
|
Posted: Sun Apr 27, 2008 19:32 Post subject: |
|
|
it should... but i haven't tryed
i also dont know how PRC work... if its ony 2da change then yes it should work |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Sun Apr 27, 2008 23:47 Post subject: |
|
|
--
Here's a X-post from the Server Admin guild
Now while this is designed specifically to exclude the need for NWNX, adding the required functionality (an encryptor) should be easy enough.
--
I've been putting together a system for server side ONLY validation of characters. The validation is dynamic so a player can't just hack a BIC file. [Only Server Vault characters allowed]
It's a three-part system.
1. an XP grant (all of one XP)
2. a Passport item and
3. a Check w/ encryptor
On Player Loaded.
Code: | if (GetXP(oPlayer)==0) {
oPassport = GetItemPossessedBy( oPlayer, PASSPORT);
if (GetIsObjectValid( oPassport)) {
sAlert = "Fake Passport Detected";
//BootPC() }
else {
oPassport = CreateItemOnObject( PASSPORT, oPlayer, 1, PASSPORT, 1);
SetLocalInt( oPassport, PLAYER_CLASS_1, GetClassByPosition( 1, oPlayer));
GiveXPToCreature(o Player,1);
ExecuteScript( OnPlayerPassport, oPlayer);
ExportSingleCharacter( oPlayer); }
oPassport = GetItemPossessedBy( oPlayer, PASSPORT);
if (!GetIsObjectValid( oPassport)) {
sAlert = "Missing Passport Detected";
//BootPC()}
else if ( GetLocalInt( oPassport, PASSPORT) != GetClassByPosition(1, oPlayer)) {
sAlert = "Invalid Character Detected"; //BootPC()} |
OK, the above code is not too neat (cut/paste didn't keep code format) but it gives you a taste of how it works...
It takes for granted that new characters will always have 0xp on creation, and NOT have a Passport.
New characters get a Passport and 1 XP.
IMMEDIATELY followed by a save to the Server Vault.
This means that a returning player should ALWAYS have at least 1 XP AND have a passport.
This gives YOU control over the characters as they will always be Server Vault characters (at least once they get loaded)
Now the last part, the checking and encryptor... well that's your secret.
ExecuteScript( OnPlayerPassport, oPlayer);
Your 'OnPlayerPassport' saves variables to the passport item. - these are checked for consistancy the next time the character gets loaded.
If you run 'OnPlayerPassport' at regular intervals (HB,OnRest etc) you can update what is saved.
You can also (as mentioned) add encryption, in some form, to obscure the data - just don't make variable names too obvious. (unlike the following)
int iRandom = d100(100);
SetLocalString( oPassport, "Code", IntToHexString( iRandom));
SetLocalInt( oPassport, "Check", iRandom);
So when logging back on check that
IntToHexString( "Check") == "Code"
True, and you're in, false and you can Boot the PC
A very simple example, but unless you give away your passport code it's just not going to be worth even trying to hack a BIC
Of course any character that looses their passport is going to be in trouble, so it should be a no-drop/cursed item. (Or are locals now persistent on a character? - no passport required)
Cheers
Gryphyn |
|
Back to top |
|
|
Makazasky
Joined: 27 Apr 2008 Posts: 21
|
Posted: Mon Apr 28, 2008 1:33 Post subject: |
|
|
Im not sure to understand Is it possible to load a local character on a servervault server ?
As for this plugin... it is only made to prevent basic 2da change or more advanced change (like changing the packet that are send to the server... has anyone done that? ) that let player get illegal stat while they are levelling. |
|
Back to top |
|
|
ronchese
Joined: 30 Dec 2007 Posts: 30
|
Posted: Wed Apr 30, 2008 7:42 Post subject: |
|
|
Yes, is possible to load a character from localvault to servervault.
Makazasky, what if the bugger export a exploited char already containing a Passport?
(They can get Passport properties by saving the character) |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Wed Apr 30, 2008 12:35 Post subject: |
|
|
ronchese wrote: |
Makazasky, what if the bugger export a exploited char already containing a Passport?
(They can get Passport properties by saving the character) |
I guess you where 'meaning' me (?)...
The premise is that every new character starts with 0 (zero) xp.
On PC creation it's not too difficult to spot an exploiter, incorrect point spends, out-of-range stats, etc. A new PC WILL NOT have a passport (if they do you've caught a cheater - boot them)
So you have a valid 'starter' PC, give them 1XP and a passport, then save them to the server vault. Contained in the passport is a 'special code(s)' that get checked whenever a non-zero XP PC connects.
So not only do you need a 0xp passport-less PC to start, you need a 1+XP passport (with something in it) PC to return. The Key is in the 'something' which can only be determined by the server. Unless you release the details an exploiter will never know what the 'something' is, even if they know a passport is required.
Cheers
Gryphyn |
|
Back to top |
|
|
Makazasky
Joined: 27 Apr 2008 Posts: 21
|
Posted: Wed Apr 30, 2008 15:21 Post subject: |
|
|
Quote: | Yes, is possible to load a character from localvault to servervault. |
... It is possible for players to load a local character on a servervault server?
Quote: | On PC creation it's not too difficult to spot an exploiter, incorrect point spends, out-of-range stats, etc. A new PC WILL NOT have a passport (if they do you've caught a cheater - boot them) |
It is difficult, with the standart scripting function to check if a character is legal and this must be done at all level (im even considering that it is not possible to load a local character on a servervault), and it is not something that should be done at half. |
|
Back to top |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Wed Apr 30, 2008 21:50 Post subject: |
|
|
Any chance to have this for nwn2 (nwnx4)? |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Thu May 01, 2008 0:15 Post subject: |
|
|
For NWNX use,
I had intended to have a MD5 check after every Save.
ExportSingleCharacter(oPC);
NWNX_MD5Check(oPC); *still waiting on storing objects
--
oPC has a field containing the filename.
Use this data to get a MD5 of the file.
--
OnAreaExit: Export & MD5
--
OnClientEnter: XP=0, File ModDate=CreateDate=<Today.Now+/->
OnClientEnter: XP>0, Check the MD5 with that of the ServerVault file
--
@Makazasky,
The whole point is that you create your own validation, once a PC has entered your server. (Remember new PC's have 0XP, or should, returning PC's have 1XP+) Once you have vetted the 0XP PC, it's only your validation that matters.
Cheers
Gryphyn |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Thu May 01, 2008 6:21 Post subject: |
|
|
Makazasky wrote: | Quote: | Yes, is possible to load a character from localvault to servervault. |
... It is possible for players to load a local character on a servervault server?
|
Yes, though thankfully not many seem to know how to do it.
Funky |
|
Back to top |
|
|
Makazasky
Joined: 27 Apr 2008 Posts: 21
|
Posted: Thu May 01, 2008 18:08 Post subject: |
|
|
Quote: | Yes, though thankfully not many seem to know how to do it. |
Is it possible to know how to do it
From what i have tested, it is not possible :
|
|
Back to top |
|
|
Makazasky
Joined: 27 Apr 2008 Posts: 21
|
Posted: Sat May 03, 2008 22:48 Post subject: |
|
|
Anyone contest my screenshot? |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Mon May 05, 2008 19:58 Post subject: |
|
|
I'm not sure what there is to contest. It's definitely possible, though not the way you seem to be trying it. Players are able to swap out a newly created character with whatever they like, during creation, if they know how.
Funky |
|
Back to top |
|
|
Makazasky
Joined: 27 Apr 2008 Posts: 21
|
Posted: Mon May 05, 2008 20:47 Post subject: |
|
|
I know that they can get the stat they want at character creation... but can they create a char with experience? |
|
Back to top |
|
|
|