Пример #1
0
 void OnUserRemoved(string name, int code)
 {
     i_PlayerID = m_PlayerController.GetIndex();
     // Reset State of Ready Button
     m_PlayerController.SetLobbyState(UXUser.LobbyState.Wait);
     Debug.Log("OnUserRemoved > name : " + name + " , Code : " + code + " , PlayerID : " + i_PlayerID);
 }
Пример #2
0
        /** Set player's lobby state
         *      @param state lobby state
         *      @see UXUser.LobbyState
         */
        public void SetPlayerState(UXUser.LobbyState state)
        {
            UXPlayerController player = UXPlayerController.Instance;

            player.SetLobbyState(state);

            string stateString = "";

            if (state == UXUser.LobbyState.Ready)
            {
                stateString = "ready";
            }
            else
            {
                stateString = "wait";
            }

            string sendString = "{\"cmd\":\"change_lobby_state\",\"u_code\":\"" + player.GetCode() + "\",\"l_code\":\"" + room.RoomNumber + "\",\"state\":\"" + stateString + "\"}" + UXConnectController.DATA_DELIMITER; //<-?

            Send(sendString);                                                                                                                                                                                             //{"cmd":change_lobby_state","u_code":player.GetCode()","l_code":"GetRoomNumber()","state":stateString"}232
        }