onSubscribeRoomDone called many times

0 votes

I have my code to subscribe a room, but the onSubscribeRoomDone  had been called many times. 

here's my code:

 

the SubscribeRoom function had been only called once.

the onSubscribeRoomDone had been called many times until string buff overflow.

I'm using AppWarp server(not cloud), and Unity3d client SDK. and it is turn based room

 

    public void onJoinRoomDone(RoomEvent eventObj)

    {
            if (eventObj.getResult () == 0) 
                     WarpClient.GetInstance ().SubscribeRoom (eventObj.getData().getId());
    }
 
    public void onSubscribeRoomDone(RoomEvent eventObj)
    {
           if (eventObj.getResult () == WarpResponseResultCode.SUCCESS) {
                  label += '*';
                  WarpClient.GetInstance ().SubscribeRoom (eventObj.getData ().getId ());
          }
    }
 
call stack:
 
ChessListener.onSubscribeRoomDone (eventObj={com.shephertz.app42.gaming.multiplayer.client.events.RoomEvent}) in C:\adams\chess\Assets\AppWarp\ChessListener.cs:169
com.shephertz.app42.gaming.multiplayer.client.WarpClient.OnResponse (msg={ PayLoad : {"owner":"","maxUsers":2,"name":"Room1","id":"935122658","desc":""}}) in 
com.shephertz.app42.gaming.multiplayer.client.WarpClient.Update () in 
asked Jul 26, 2014 in AppWarp by wwang1110 (10 points)
recategorized Oct 26, 2014 by sushil

1 Answer

0 votes
In AppWarp S2, the default behavior when you call joinRoom is to automatically subscribes as well. So you actually don't need to call subscribeRoom if you've joined the room successfully.
answered Jul 26, 2014 by dhruvc (1,099 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...