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 
 
Object to String - Unique even after Logout?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Mon Jan 18, 2010 14:20    Post subject: Object to String - Unique even after Logout? Reply with quote

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



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Jan 18, 2010 14:25    Post subject: Reply with quote

Yes.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Mon Jan 18, 2010 20:19    Post subject: Reply with quote

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



Joined: 02 Sep 2007
Posts: 830

PostPosted: Mon Jan 18, 2010 21:02    Post subject: Reply with quote

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



Joined: 02 Jun 2005
Posts: 377

PostPosted: Tue Jan 19, 2010 3:33    Post subject: Reply with quote

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



Joined: 06 Dec 2006
Posts: 152

PostPosted: Tue Jan 19, 2010 13:33    Post subject: Reply with quote

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



Joined: 02 Sep 2007
Posts: 830

PostPosted: Tue Jan 19, 2010 14:53    Post subject: CDKEY's arent good Reply with quote

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



Joined: 20 Jan 2005
Posts: 431

PostPosted: Wed Jan 20, 2010 9:52    Post subject: Reply with quote

I use a 'birthday'/1xp combo, and disallow new characters with the same name as an existing one (for each player)
Back to top
View user's profile Send private message
Disco



Joined: 06 Dec 2006
Posts: 152

PostPosted: Thu Jan 21, 2010 17:35    Post subject: Re: CDKEY's arent good Reply with quote

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. Very Happy 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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Page 1 of 1

 
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