GetAllRooms is returning zero

0 votes

I'm trying to get a list of rooms in my Unity app. I have created two rooms on the appwarp console. But when I call getallarooms()  in onGetAllRoomsDone Debug.Log ("Getallrooms " + eventObj.getResult ()) returns 0. I'm thinking it should return the number of rooms?

These are my Listeners:

        listen = GetComponent<Listener>();
        WarpClient.GetInstance().AddConnectionRequestListener(listen);
        WarpClient.GetInstance().AddChatRequestListener(listen);
        WarpClient.GetInstance().AddLobbyRequestListener(listen);
        WarpClient.GetInstance().AddNotificationListener(listen);
        WarpClient.GetInstance().AddRoomRequestListener(listen);
        WarpClient.GetInstance().AddUpdateRequestListener(listen);
        WarpClient.GetInstance().AddZoneRequestListener(listen);

I'm able to connect successfully and join the lobby, I'm even able to join a room using a roomId,  but not sure what I might be doing wrong as far as getting all existing rooms is concerned ...

Is there a Unity example available that has multiple rooms to choose from? (so I can explore the onGetAllRoomsDone results in a working sample)

 

Thanks

asked Jul 1, 2016 in Unity by dapdap53 (15 points)

1 Answer

0 votes
 
Best answer

Hi,

In every callback for example onGetAllRoomsDone, the result is the response code of the request made.

In your case, eventObj.getResult () returning 0 means the request of getting rooms was successfully processed.

The onGetAllRoomsDone gives you an object of AllRoomsEvent  which has two informations result code and array of available roomIDs.

You can get the roomIDs using following method of AllRoomsEvent:

  1. public String[] getRoomIds(); 

Let me know if you have any further queries.

Regards,

Rajeev

answered Jul 1, 2016 by rajeev.etc (1,660 points)
selected Jul 10, 2016 by dapdap53
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
...