Ejemplo n.º 1
0
        public static _DTO_begin_fight GetRoomInfoDTO2(Room room)
        {
            int count   = room.teamOne.Count;
            int count2  = room.teamTwo.Count;
            var players = new _DTO_player_info[count + count2];

            for (int i = 0; i < count; i++)
            {
                Room.Player player = room.teamOne[i];
                players[i] = ProtocolManager.DTO_player_info(player.hero, player.name, player.ready, ( byte )(player.model << 4 | player.skin), 0, player.id);
            }
            for (int i = 0; i < count2; i++)
            {
                Room.Player player = room.teamTwo[i];
                players[count + i] = ProtocolManager.DTO_player_info(player.hero, player.name, player.ready, ( byte )(player.model << 4 | player.skin), 1, player.id);
            }
            return(ProtocolManager.DTO_begin_fight(room.hostId, room.map, room.name, players, room.id));
        }