Пример #1
0
    private void OnRoomUpdate(string data)
    {
        string[] storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);

        _currentRoom           = new GP_RTM_Room();
        _currentRoom.id        = storeData[0];
        _currentRoom.creatorId = storeData[1];

        string[] ParticipantsInfo = storeData[2].Split(","[0]);

        for (int i = 0; i < ParticipantsInfo.Length; i += 6)
        {
            if (ParticipantsInfo[i] == AndroidNative.DATA_EOF)
            {
                break;
            }

            GP_Participant p = new GP_Participant(ParticipantsInfo[i], ParticipantsInfo[i + 1], ParticipantsInfo[i + 2], ParticipantsInfo[i + 3], ParticipantsInfo[i + 4], ParticipantsInfo[i + 5]);
            _currentRoom.AddParticipant(p);
        }



        _currentRoom.status            = (GP_RTM_RoomStatus)System.Convert.ToInt32(storeData[3]);
        _currentRoom.creationTimestamp = System.Convert.ToInt64(storeData[4]);

        Debug.Log("GooglePlayRTM OnRoomUpdate Room State: " + _currentRoom.status.ToString());

        ActionRoomUpdated(_currentRoom);
    }
Пример #2
0
    //--------------------------------------
    // INITIALIZATION
    //--------------------------------------

    void Awake()
    {
        DontDestroyOnLoad(gameObject);
        _currentRoom = new GP_RTM_Room();

        Debug.Log("GooglePlayRTM Created");
    }
    private void OnRoomUpdate(string data)
    {
        string[] storeData = data.Split(AndroidNative.DATA_SPLITTER[0]);

        _currentRoom = new GP_RTM_Room {
            id        = storeData[0],
            creatorId = storeData[1]
        };

        var participantsInfo = storeData[2].Split(',');

        for (int i = 0; i < participantsInfo.Length; i += 6)
        {
            if (participantsInfo[i] == AndroidNative.DATA_EOF)
            {
                break;
            }

            var p = new GP_Participant(participantsInfo[i], participantsInfo[i + 1], participantsInfo[i + 2],
                                       participantsInfo[i + 3], participantsInfo[i + 4], participantsInfo[i + 5]);
            _currentRoom.AddParticipant(p);
        }

        _currentRoom.status            = (GP_RTM_RoomStatus)Convert.ToInt32(storeData[3]);
        _currentRoom.creationTimestamp = Convert.ToInt64(storeData[4]);

        Debug.Log("GooglePlayRTM OnRoomUpdate Room State: " + _currentRoom.status);

        ActionRoomUpdated(_currentRoom);
    }
Пример #4
0
 public UM_RTM_Room(GP_RTM_Room room)
 {
     foreach (GP_Participant p in room.participants)
     {
         UM_RTM_Participant participant = new UM_RTM_Participant(p);
         _Participants.Add(participant);
     }
 }
Пример #5
0
    //--------------------------------------
    // INITIALIZATION
    //--------------------------------------

    void Awake()
    {
        DontDestroyOnLoad(gameObject);
        _currentRoom = new GP_RTM_Room();


        GooglePlayInvitationManager.instance.Init();
        Debug.Log("GooglePlayRTM Created");
    }
Пример #6
0
    private void OnLeftRoom(string data)
    {
        Debug.Log("OnLeftRoom Created OnRoomUpdate");
        string[]      storeData = data.Split(AndroidNative.DATA_SPLITTER [0]);
        GP_RTM_Result package   = new GP_RTM_Result(storeData[0], storeData [1]);


        _currentRoom = new GP_RTM_Room();
        ActionRoomUpdated(_currentRoom);

        ActionLeftRoom(package);
    }
Пример #7
0
    //--------------------------------------
    // INITIALIZATION
    //--------------------------------------

    void Awake()
    {
        DontDestroyOnLoad(gameObject);
        _currentRoom = new GP_RTM_Room();

        GooglePlayInvitationManager.ActionInvitationReceived += OnInvitationReceived;
        GooglePlayInvitationManager.ActionInvitationRemoved  += OnInvitationRemoved;
        GooglePlayInvitationManager.ActionInvitationAccepted += OnInvitationAccepted;

        GooglePlayInvitationManager.Instance.Init();
        Debug.Log("GooglePlayRTM Created");
    }
 private void HandleActionRoomUpdated(GP_RTM_Room room)
 {
     _CurrentRoom = new UM_RTM_Room(room);
     RoomUpdated();
 }