Esempio n. 1
0
        private void onRoomsFoundToJoin(GetRoomsOperation operation, HttpResponse httpResponse)
        {
            List <RoomIdentifier> roomsFound = operation.RoomsFound;

            if (roomsFound.Count > 0)
            {
                JoinRoomInWorldSequence joinRoomInWorldSequence = new JoinRoomInWorldSequence(clubPenguinClient, roomsFound[0], errorHandler, successHandler);
                joinRoomInWorldSequence.JoinRoom();
            }
            else
            {
                errorHandler.onNoRoomsFound();
            }
        }
Esempio n. 2
0
    public APICall <GetRoomsOperation> GetRooms(string language, string[] worlds, string[] rooms, int limit = 0)
    {
        GetRoomsOperation getRoomsOperation = new GetRoomsOperation(language);

        if (worlds != null && worlds.Length > 0)
        {
            string stringToEscape = string.Join(",", Array.ConvertAll(worlds, (string x) => x.ToString()));
            getRoomsOperation.Worlds = Uri.EscapeUriString(stringToEscape);
        }
        if (rooms != null && rooms.Length > 0)
        {
            string stringToEscape2 = string.Join(",", Array.ConvertAll(rooms, (string x) => x.ToString()));
            getRoomsOperation.Rooms = Uri.EscapeUriString(stringToEscape2);
        }
        getRoomsOperation.Limit = limit;
        return(new APICall <GetRoomsOperation>(clubPenguinClient, getRoomsOperation));
    }
Esempio n. 3
0
 private void onRoomsFoundToJoinError(GetRoomsOperation operation, HttpResponse response)
 {
     NetworkErrorService.OnError(response, errorHandler);
 }