+ Reply to Thread
Results 1 to 3 of 3

Thread: Logged out user can't log in.

  1. #1
    Member
    Join Date
    Mar 2008
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Logged out user can't log in.

    I have been working with your tutorial for Advanced Chat (http://www.es-wiki.com/index.php?tit..._Chat_Tutorial) and it seems like once you hit the "Log Out" button, you queue on the subsequent login.
    I made a slight change that you might be interested in.

    I imported the "ConnectionClosedEvent"
    In the "onConnectionEvent" I added:
    Code:
    es.addEventListener(MessageType.ConnectionClosedEvent, "onConnectionClosed", this);
    Then added:
    Code:
    		public function onConnectionClosed(e:ConnectionClosedEvent)
    		{
    			es.getConnections().pop();
    		}
    Now there is no confusion as to which connection I'm getting the id from and it doesn't seem to queue the login request.

    (Now if you could just find out where the "^" in the Data.event is coming from)

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,212
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    Interesting. The usual workaround is to create a new instance of the es object (ElectroServer) for the new login.

    On the server side, if I remember correctly "^" is a "user kicked from the gateway" event (or something like that) but this is missing from the list of valid types on the client. It's a bug that we have possible fixes for but haven't settled on which fix is the best yet.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Member
    Join Date
    Mar 2008
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Good to hear about the "^". ( I just modified my Connection.as to bypass the PreData because it works for me. )

    Creating a new instance would require re-launching the Flash movie. This doesn't work if you say... wanted to login as a super-user to check something like a database lookup and report back to the client if a name is available or not.
    By just "dropping" the connection you recreate the connection id=0 and this eliminates the problem with message id's that are tracked at the connection level and queued if out of sequence.

    Also found that this method requires the user "leave" the current room before sending the logoutrequest so it cleans up the usermanager array.

+ Reply to Thread

Similar Threads

  1. User login problems (User already logged in)
    By frank95a in forum ES4 General Discussion
    Replies: 7
    Last Post: 07-30-2010, 10:50 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts