Пример #1
0
    /// <summary>
    /// Executes this request.
    /// </summary>
    /// <returns>Service response.</returns>
    GetRoomsResponse Execute()
    {
        GetRoomsResponse serviceResponse = (GetRoomsResponse)this.InternalExecute();

        serviceResponse.ThrowIfNecessary();
        return(serviceResponse);
    }
Пример #2
0
    public static void GetRooms(Packet _packet)
    {
        string json = _packet.ReadJson();

        Debug.Log($"GetRooms Message from server: {json}");

        GetRoomsResponse response = JsonUtility.FromJson <GetRoomsResponse>(json);

        string[] rooms = response.Rooms.Split(',');
        DeleteClosedRooms(rooms); // delete the closed room
        // Adding only the new rooms (without touching the other rooms)
        GameObject copy;

        foreach (string room in rooms)
        {
            print("room: " + room);
            if (!RoomFoundInList(uint.Parse(room.Split(':')[1]))) // If it is a new room
            {
                copy = Instantiate(UIManager.instance.roomTemplate);
                copy.GetComponentInChildren <TextMeshProUGUI>().text = room.Split(':')[0];
                copy.GetComponent <Room>().roomId = uint.Parse(room.Split(':')[1]);
                copy.transform.parent             = UIManager.instance.roomsList.transform;
            }
        }
    }
Пример #3
0
    object ParseResponse(EwsServiceXmlReader reader)
    {
        GetRoomsResponse response = new GetRoomsResponse();

        response.LoadFromXml(reader, XmlElementNames.GetRoomsResponse);
        return(response);
    }
Пример #4
0
        public void SendAllRoomStatus(GamePeer peer, SendParameters sendParameters)
        {
            GetRoomsResponse response = new GetRoomsResponse();

            response.RoomProperties = PacketHelper.Serialize <RoomPropertyList>(GetRoomProperties());
            peer.SendOperationResponse(new OperationResponse(CommonOperationCode.GetRooms, response), sendParameters);
        }