Exemplo n.º 1
0
        // 服务器反馈, 加入观看房间
        private void OnJoinWatchRoom(NetworkingPlayer player, Binary frame)
        {
            ulong             roomUid = frame.StreamData.GetBasicType <ulong>();
            NetJoinRoomResult ret     = (NetJoinRoomResult)frame.StreamData.GetBasicType <int>();

            if (ret != NetJoinRoomResult.Failed_NoRoom)
            {
                room = new NetRoomClient(this, roomInfo);
            }
            OnPlayerJoinWatchRoom(roomUid, player, ret);
        }
Exemplo n.º 2
0
        // 服务器反馈, 离开房间
        private void OnLeftWatchRoom(NetworkingPlayer player, Binary frame)
        {
            ulong             roomUid = frame.StreamData.GetBasicType <ulong>();
            NetLeftRoomResult ret     = (NetLeftRoomResult)frame.StreamData.GetBasicType <int>();

            if (room != null)
            {
                room.OnLeftRoom();
                room = null;
            }
            OnPlayerLeftWatchRoom(roomUid, player, ret);
        }