[SOLVED] Unable to rejoin an existing room. Possibly bug.

All Union Platform questions, comments, feature requests, and bug reports.

Unable to rejoin an existing room. Possibly bug.  

Postby goodguy » Sat 25 Aug 2012 10:39

Hi,
I've got a problem with rejoining room after disconnection or kick. When my client first connects to the room, using the next code:
Code: Select all
_room = _reactor.getRoomManager().joinRoom(roomID);

the room is created on client side and I can add listeners to it and so on, I mean it isn't null.
Then I save the room's id to a variable to be able to rejoin it if disconnection occurs
But when I try to join it again, room manager's method joinRoom() returns null. And getNumRoom() returns 0 (if it was the only room on the server).
Even though the room still persists on server side, I can see it in union admin tool.
I've looked thru docs, but didn't find the reason why it happens.
So, is it a bug? Or is it an intentional behavior and there's some solution?

btw, even after reconnecting and re-logining into the system, client manager still can't join the room

regards, Konstantin.
goodguy
 
Posts: 66
Joined: Sun 23 Oct 2011 01:47

Re: Unable to rejoin an existing room. Possibly bug.

Postby goodguy » Thu 06 Sep 2012 00:38

hello?
goodguy
 
Posts: 66
Joined: Sun 23 Oct 2011 01:47

Re: Unable to rejoin an existing room. Possibly bug.

Postby niraj » Sun 16 Sep 2012 21:05

this is not a bug
it is common for game server to close room when no players are online
you need to re create the rooms dynamically.
Flash media server also does same thing
niraj
 
Posts: 6
Joined: Sun 16 Sep 2012 21:03

Re: Unable to rejoin an existing room. Possibly bug.

Postby goodguy » Mon 17 Sep 2012 07:50

no, it's not like that.
I set removeOnEmpty flag to false when I create a room. And room persists on the server even when there's no clients connected to it, but reactors' room manager does not know about this room anymore, and no room data is refreshed after reconnection
It also says the room is null even where there are still some players in the room

It definitely is a bug
goodguy
 
Posts: 66
Joined: Sun 23 Oct 2011 01:47

Re: Unable to rejoin an existing room. Possibly bug.

Postby colin » Tue 13 Nov 2012 04:48

hi konstantin,
i have not been able to reproduce the issue you're describing in an isolated test. to create the test room, i used the following code:

Code: Select all
var settings:RoomSettings = new RoomSettings();
settings.removeOnEmpty = false;
reactor.getRoomManager().createRoom(roomID, settings);


i then joined to room, disconnected on join notification, and auto-reconnected.

here's my test:

Code: Select all
package {
  import flash.display.Sprite;
  import flash.text.TextField;
  import flash.utils.setInterval;
 
  import net.user1.logger.Logger;
  import net.user1.reactor.Client;
  import net.user1.reactor.HTTPConnection;
  import net.user1.reactor.Reactor;
  import net.user1.reactor.ReactorEvent;
  import net.user1.reactor.Room;
  import net.user1.reactor.RoomEvent;
  import net.user1.reactor.RoomSettings;
 
  public class UnionTest1 extends Sprite {
    protected var reactor:Reactor;
    protected var output:TextField;
    protected var roomID:String = "rejoinTestRoom";
    protected var room:Room;
   
    public function UnionTest1 () {
      reactor = new Reactor();
      reactor.addEventListener(ReactorEvent.READY, readyListener);
      reactor.getConnectionMonitor().setAutoReconnectFrequency(5000);
      reactor.getLog().setLevel(Logger.DEBUG);
     
      reactor.connect("tryunion.com", 80);
     
      output = new TextField();
      output.width = 400;
      output.height = 300;
      output.background = true;
      output.border = true;
     
      addChild(output);
    }
   
    public function readyListener (e:ReactorEvent):void {
      room = reactor.getRoomManager().joinRoom(roomID);
      room.addEventListener(RoomEvent.JOIN, joinListener);
    }
   
    public function joinListener (e:RoomEvent):void {
      output.appendText("Joined room: " + room + "\n");
      reactor.disconnect();
    }
  }
}


and my output:

Code: Select all
Joined room: [ROOM id: rejoinTestRoom]
Joined room: [ROOM id: rejoinTestRoom]
Joined room: [ROOM id: rejoinTestRoom]
Joined room: [ROOM id: rejoinTestRoom]
Joined room: [ROOM id: rejoinTestRoom]
Joined room: [ROOM id: rejoinTestRoom]
Joined room: [ROOM id: rejoinTestRoom]
Joined room: [ROOM id: rejoinTestRoom]


do you have a test case to reproduce the issue? i'll mark this question solved until you post code demonstrating the error.

colin
colin
 
Posts: 232
Joined: Mon 17 Oct 2011 18:47


Return to Union Platform

Online

Users browsing this forum: No registered users and 1 guest