Author Topic: Duplicated Character (NWNX BUG)  (Read 354 times)

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Duplicated Character (NWNX BUG)
« on: October 16, 2014, 11:54:25 pm »


               

If you create a new character with the same name of other you have you can teleport to same location of your old character. You receive everything he had, excluding the items and level.


 


How can we block the creation of character with the same names (in the same account)?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Duplicated Character (NWNX BUG)
« Reply #1 on: October 17, 2014, 12:32:27 am »


               

this is not nwnx bug, this is old nwn exploit


 


I experimented with this but the fix I found had serious side effects so it needs to be workarounded. It also happens only on same account.


 


Anyway, to workaround this. A new character will always have 0 experiences. So just in OnEnter when new character login, check his position, if its not startin position, make him cutscene paralyzed+cutscene invisibility+immortality and maybe print some explanation into chat which will explain player that he is not allowed to do this. And if you have NWNX then possibly autodelete the character after player logs out.


 


Another option is reposition into starting location but that has vulnerabilities. Player could abuse this to get his character from dangerous situations/escape from jail. So if you want to do this, then you need to reposition the original character too. (Ie. new char with same name appears on old char position -> port into starting area. He log out, log in original char and appears in starting area -> port into original area.



               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Duplicated Character (NWNX BUG)
« Reply #2 on: October 20, 2014, 11:35:25 am »


               

Seems like to me there is no possible solution because:


 


A) You can't code for "Pre-Login"


'B)' Once they have logged in, the damage is done?


 


Nevertheless, obviously you will need to keep a variable of nNameCount in the database to know how many names exist and each time a new name is created, that is indeed original, you will need to set that nNameCount +1...


 


Essentially you will need a unique Name Identifier for each entry in the database..


 


string sBase = "ORIGINAL_NAME_"


 


string sCount = IntToString(nNameCount);


 


string sNew = sBase + sCount;


 


Store it into the database...


 


Every time a NEW player logs in, check to see if their name is original by looping through all of the entries in the database to see if sPlayersName exist already, if so, boot player...  (Obviously the PC won't know why they can't log in.)


 


I suspect it's a good way to run off potential players though, no doubt...



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Duplicated Character (NWNX BUG)
« Reply #3 on: October 20, 2014, 05:31:30 pm »


               

Thanks, Shadow and _Guile.


I tried Shadooows argument "A new character will always have 0 experiences.".


I check oncliententer if character XP is 0 and persistent location != 0 and boot (it only works because I give 1 XP to player when login and the player needs to have at least 1 XP)


 


It seems work