Exemplo n.º 1
0
    static void UPDATE_ROOM_INFO(byte[] bytes)
    {
        UpdateRoomInfo input = UpdateRoomInfo.Parser.ParseFrom(bytes);

        if (!input.IsRemove)
        {
            RoomInfo roomInfo = new RoomInfo()
            {
                RoomName       = input.RoomName,
                RoomId         = input.RoomId,
                CurPlayerCount = input.CurPlayerCount,
                MaxPlayerCount = input.MaxPlayerCount,
                IsRunning      = input.IsRunning,
                Creator        = input.Creator,
            };
            ServerLobbyManager.Instance.Rooms[input.RoomId] = roomInfo;
            var rsi = ServerLobbyManager.Instance.GetRoomServer(_args);
            if (rsi != null)
            {
                rsi.Rooms.Add(input.RoomId);
            }
        }
        else
        {// 删除这个房间
            ServerLobbyManager.Instance.Rooms.Remove(input.RoomId);
        }

        UpdateRoomInfoReply output = new UpdateRoomInfoReply()
        {
            Ret = true,
        };

        ServerLobbyManager.Instance.SendMsg(_args, LOBBY_REPLY.UpdateRoomInfoReply, output.ToByteArray());
    }
Exemplo n.º 2
0
    private static void UPDATE_ROOM_INFO_REPLY(byte[] bytes)
    {
        UpdateRoomInfoReply input = UpdateRoomInfoReply.Parser.ParseFrom(bytes);

        if (!input.Ret)
        {
            MixedManager.Instance.LobbyManager.Log("MSG: LobbyMsgReply UPDATE_ROOM_INFO_REPLY Error - Update room information failed!"); // 更新房间信息失败!
        }
    }