View previous topic :: View next topic |
Author |
Message |
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Mon Jan 18, 2010 14:20 Post subject: Object to String - Unique even after Logout? |
|
|
I was wondering,
the String that is returned from ObjectToString() for a player object/character.
Would that string remain constant between logouts within a module instance?
Eg -
If my character (Bilbo Baggins) had a string of ff0032 or something like that, and he logged out, and then in again would it still be ff0032.
I understand that the string may change between module restarts etc, but I was wondering if it remains constant between logins for character objects. |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Mon Jan 18, 2010 14:25 Post subject: |
|
|
Yes. _________________ In Soviet Russia, NWN plays you! |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Mon Jan 18, 2010 20:19 Post subject: |
|
|
Oddly, even if you delete the toon and make a new one, it seems to reassociate - bringing with it all the old vars. One of the more mischievous 'features' of nwn where exploits are involved. Presumably this is because nwn links playername and character or bicfile name, and links them to an object id until reset.
Funky |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Mon Jan 18, 2010 21:02 Post subject: |
|
|
Sure even with character tracking in persistent variable systems the only identifyers available are player account and character name/ bic. I'm not surprised that variables get reassociated with characters based of identical names. Bummer. |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Tue Jan 19, 2010 3:33 Post subject: |
|
|
Baaleos wrote: | Sure even with character tracking in persistent variable systems the only identifyers available are player account and character name/ bic. I'm not surprised that variables get reassociated with characters based of identical names. Bummer. |
Just generate a unique id, and stick it in the player's tag - this is how we do our unique ids. They're based off of time of creation, server number, and incrementing counter. Makes the whole thing a nonissue.
Funky |
|
Back to top |
|
|
Disco
Joined: 06 Dec 2006 Posts: 152
|
Posted: Tue Jan 19, 2010 13:33 Post subject: |
|
|
What I do is cdkey + mysql timestamp. You can't make two characters at the same time so it's an easy way to make a unique id and it is also kinda informative if you ever need to debug. You'd get something like this:
VDKU4MYP_20080820201917 |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Tue Jan 19, 2010 14:53 Post subject: CDKEY's arent good |
|
|
CDKEY's are not unique for characters.
Characters are unique to player account, but not to CDKEY's
while the timestamp does indeed allow you to create a unique string here, the cdkey however plays little part in it.
On my server, I encountered a bug with one of my systems, because a player who was playing on two machines, with different cdkeys used for the install.
The result was that any system I had, which used cdkey as part of an identifying variable of sorts, would not recognize him.
I had to change it so it used his player account name, which solved the problem, because it is unique to the character.
Eg - He can change his cdkey, and get into all of his characters still,
however, change his account name, and he gets thrown into different server vault folder. |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Wed Jan 20, 2010 9:52 Post subject: |
|
|
I use a 'birthday'/1xp combo, and disallow new characters with the same name as an existing one (for each player) |
|
Back to top |
|
|
Disco
Joined: 06 Dec 2006 Posts: 152
|
Posted: Thu Jan 21, 2010 17:35 Post subject: Re: CDKEY's arent good |
|
|
Baaleos wrote: | CDKEY's are not unique for characters.
Characters are unique to player account, but not to CDKEY's
while the timestamp does indeed allow you to create a unique string here, the cdkey however plays little part in it.
On my server, I encountered a bug with one of my systems, because a player who was playing on two machines, with different cdkeys used for the install.
The result was that any system I had, which used cdkey as part of an identifying variable of sorts, would not recognize him.
I had to change it so it used his player account name, which solved the problem, because it is unique to the character.
Eg - He can change his cdkey, and get into all of his characters still,
however, change his account name, and he gets thrown into different server vault folder. |
I keep a list of valid cdkey/account combinations so I don't have to use that buggy Master Server. The unique id is just that, but I notice it's handy if I take a look at the db and spot my own + date, for instance. |
|
Back to top |
|
|
|