Aller au contenu

Photo

Boot Players Who Use Previously Used Names


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Wawmong

Wawmong
  • Members
  • 50 messages

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.
 



#2
Baaleos

Baaleos
  • Members
  • 1 330 messages

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.


  • Wawmong aime ceci

#3
Wawmong

Wawmong
  • Members
  • 50 messages

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?



#4
Baaleos

Baaleos
  • Members
  • 1 330 messages
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