コード例 #1
0
        public override int HandlePacket(GamePlayer player, GSPacketIn packet)
        {
            int hallType = packet.ReadInt();

            RoomMgr.EnterWaitingRoom(player, hallType);
            return(1);
        }
コード例 #2
0
ファイル: MarryStateHandler.cs プロジェクト: uvbs/DDTank-3.0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            int stateID = packet.ReadInt();

            switch (stateID)
            {
            //客户端进入结婚房间已经准备完成
            case 0:
                if (client.Player.IsInMarryRoom)
                {
                    //GSPacketIn msgEnter = client.Out.SendPlayerEnterMarryRoom(client.Player);
                    if (client.Player.MarryMap == 1)
                    {
                        client.Player.X = 646;
                        client.Player.Y = 1241;
                    }
                    else if (client.Player.MarryMap == 2)
                    {
                        client.Player.X = 800;
                        client.Player.Y = 763;
                    }

                    GamePlayer[] list = client.Player.CurrentMarryRoom.GetAllPlayers();
                    foreach (GamePlayer p in list)
                    {
                        if (p != client.Player && p.MarryMap == client.Player.MarryMap)
                        {
                            p.Out.SendPlayerEnterMarryRoom(client.Player);
                            client.Player.Out.SendPlayerEnterMarryRoom(p);
                        }
                    }
                }
                break;

            //客户端进入大厅
            case 1:
                RoomMgr.EnterWaitingRoom(client.Player);
                break;
            }

            return(0);
        }
コード例 #3
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            switch (packet.ReadInt())
            {
            case 0:
                if (client.Player.IsInMarryRoom)
                {
                    if (client.Player.MarryMap == 1)
                    {
                        client.Player.X = 646;
                        client.Player.Y = 1241;
                    }
                    else
                    {
                        if (client.Player.MarryMap == 2)
                        {
                            client.Player.X = 800;
                            client.Player.Y = 763;
                        }
                    }
                    GamePlayer[] allPlayers = client.Player.CurrentMarryRoom.GetAllPlayers();
                    GamePlayer[] array      = allPlayers;
                    for (int i = 0; i < array.Length; i++)
                    {
                        GamePlayer gamePlayer = array[i];
                        if (gamePlayer != client.Player && gamePlayer.MarryMap == client.Player.MarryMap)
                        {
                            gamePlayer.Out.SendPlayerEnterMarryRoom(client.Player);
                            client.Player.Out.SendPlayerEnterMarryRoom(gamePlayer);
                        }
                    }
                }
                break;

            case 1:
                RoomMgr.EnterWaitingRoom(client.Player);
                break;
            }
            return(0);
        }
コード例 #4
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            int screenStyle = packet.ReadInt();

            BaseRoom[]      rooms = RoomMgr.Rooms;
            List <BaseRoom> list  = new List <BaseRoom>();

            client.Player.ScreenStyle = screenStyle;
            switch (screenStyle)
            {
            case 1:
                for (int i = 0; i < rooms.Length; i++)
                {
                    if (!rooms[i].IsEmpty && (rooms[i].RoomType == eRoomType.Match || rooms[i].RoomType == eRoomType.Freedom))
                    {
                        list.Add(rooms[i]);
                    }
                }
                break;

            case 2:
                for (int j = 0; j < rooms.Length; j++)
                {
                    if (!rooms[j].IsEmpty && rooms[j].RoomType == eRoomType.Dungeon)
                    {
                        list.Add(rooms[j]);
                    }
                }
                break;

            default:
                RoomMgr.EnterWaitingRoom(client.Player);
                break;
            }
            if (list.Count > 0)
            {
                client.Out.SendUpdateRoomList(list);
            }
            return(1);
        }