Author Topic: Boot Players Who Use Previously Used Names  (Read 298 times)

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
Boot Players Who Use Previously Used Names
« on: October 05, 2015, 09:02:31 pm »


               

i managed to get quests working with PQJ, but i've come across a bit of a problem. a players quest status gets updated for created characters that have the same character name as one used before... this only occurs for each individual account/login though.



can anyone help me create a script for oncliententer that could boot players that use a previously used character name?



thank ya.

 



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Boot Players Who Use Previously Used Names
« Reply #1 on: October 06, 2015, 03:50:57 pm »


               

Your issue here is that PlayerName and CharacterName are being used as a primary index/key.


 


However these two things are not unique - in fact, I could create as many characters as I want with the same name, and they would in effect share database variables with eachother.


 


In order to give each character a unique ID you need to find something that identifies character creation.


Eg: When a character logs in with a specific item : it means they have been logged in before, and are not just out of character creation.


If they log in and have no item - then they are brand new.


 


If they are brand new - spawn in a 1x1 item into their inventory, and give it a unique ID.


Either an auto-incrementing number from the database, or consider UnixTimestamp


 


Store that number on the item as a local var.


Ensure that the item is non-droppable.


 


Then on client login - check for existance of that item - if it is present, copy the player ID to the character.


Get/SetLocalInt etc


 


If it is not present - do as I mentioned above, about creating the item.


 


 


This way - when it comes to setting / getting persistent variables - you use the player ID as the unique identifier, instead of their PlayerName and CharacterName.


               
               

               
            

Legacy_Wawmong

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +0/-0
Boot Players Who Use Previously Used Names
« Reply #2 on: October 06, 2015, 05:30:47 pm »


               

ok, i think i understand. i'll give it a go. thanks. although i'm unsure how i'd give the item a unique id from the database, and is this possible using the built in database?


               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Boot Players Who Use Previously Used Names
« Reply #3 on: October 07, 2015, 01:51:32 am »


               It's still do able with default bioware db, just not as performant


the unique I'd could just be an int value that increments each time a new character is made

Remember the logic I described for detecting character creation- eg: presence of item or not


When "not" - this means a new character was made, therefore we increment the db int

And assign that value to the player and their newly made item