Upon a succesful invitation, I store the name of the user in the invitation object like this:
Code: Select all
invitations[invId] = ({
hostUser:user.getName(),
hostUserId:user.getUserId()
});
So far so good.
Now, I disconnect and reconnect the client. The zone level extension has the object in the server's memory, and I try to initiate a second invitation from the same user.
now, what I want is to forbid the user to initiate a second invitation if an invitation with his name is found in the list of invitations.
so I do:
Code: Select all
for (m in invitations) {
trace("stored user is '"+invitations[m].hostUser+"'");
trace("current user is '"+user.getName()+"'");
trace(invitations[m].hostUser == user.getName());
}
stored user is 'aMUSiC'
current user is 'aMUSiC'
false
the username is hardcoded in the client so there's absolutely no way it is in a different codepage, or mistyped. So.. I basically see that my stored variable derived from user.getName() and user.getName() produce the same result.. but they are NOT equal.. therefore an
Code: Select all
if (invitations[m].hostUser == user.getName()) {
... do stuff...
}
I also tried using toString() but the result is the same... not equal!