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 
 
NWNX Enforce Legal Character
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Makazasky



Joined: 27 Apr 2008
Posts: 21

PostPosted: Sun Apr 27, 2008 8:57    Post subject: NWNX Enforce Legal Character Reply with quote

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
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun Apr 27, 2008 19:02    Post subject: Reply with quote

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
View user's profile Send private message
Makazasky



Joined: 27 Apr 2008
Posts: 21

PostPosted: Sun Apr 27, 2008 19:32    Post subject: Reply with quote

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
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sun Apr 27, 2008 23:47    Post subject: Reply with quote

--
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
View user's profile Send private message
Makazasky



Joined: 27 Apr 2008
Posts: 21

PostPosted: Mon Apr 28, 2008 1:33    Post subject: Reply with quote

Im not sure to understand Embarassed Is it possible to load a local character on a servervault server Shocked?

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? Razz) that let player get illegal stat while they are levelling.
Back to top
View user's profile Send private message
ronchese



Joined: 30 Dec 2007
Posts: 30

PostPosted: Wed Apr 30, 2008 7:42    Post subject: Reply with quote

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
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Wed Apr 30, 2008 12:35    Post subject: Reply with quote

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
View user's profile Send private message
Makazasky



Joined: 27 Apr 2008
Posts: 21

PostPosted: Wed Apr 30, 2008 15:21    Post subject: Reply with quote

Quote:
Yes, is possible to load a character from localvault to servervault.


Shocked ... 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
View user's profile Send private message
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Wed Apr 30, 2008 21:50    Post subject: Reply with quote

Any chance to have this for nwn2 (nwnx4)?
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Thu May 01, 2008 0:15    Post subject: Reply with quote

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
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Thu May 01, 2008 6:21    Post subject: Reply with quote

Makazasky wrote:
Quote:
Yes, is possible to load a character from localvault to servervault.


Shocked ... 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
View user's profile Send private message
Makazasky



Joined: 27 Apr 2008
Posts: 21

PostPosted: Thu May 01, 2008 18:08    Post subject: Reply with quote

Quote:
Yes, though thankfully not many seem to know how to do it.


Is it possible to know how to do it Razz

From what i have tested, it is not possible :
Back to top
View user's profile Send private message
Makazasky



Joined: 27 Apr 2008
Posts: 21

PostPosted: Sat May 03, 2008 22:48    Post subject: Reply with quote

Anyone contest my screenshot?
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Mon May 05, 2008 19:58    Post subject: Reply with quote

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
View user's profile Send private message
Makazasky



Joined: 27 Apr 2008
Posts: 21

PostPosted: Mon May 05, 2008 20:47    Post subject: Reply with quote

I know that they can get the stat they want at character creation... but can they create a char with experience?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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