Exemplo n.º 1
0
        public static void ProcessGameActionStartRequest(WorldClient Client, string Packet)
        {
            // fake Packet
            if (Packet.Length < 5)
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }

            int ActionId = 0;

            if (!int.TryParse(Packet.Substring(2, 3), out ActionId))
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }

            // action existante ?
            if (!Enum.IsDefined(typeof(GameActionTypeEnum), ActionId))
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }

            if (!Client.CanGameAction((GameActionTypeEnum)ActionId) && (GameActionTypeEnum)ActionId != GameActionTypeEnum.CELL_ACTION)
            {
                Client.Send(new BasicNoOperationMessage());
                return;
            }
            switch ((GameActionTypeEnum)ActionId)
            {
            case GameActionTypeEnum.MAP_MOVEMENT:
                GameActionHandler.ProcessGameMapMovementRequest(Client, Packet);
                break;

            case GameActionTypeEnum.CHALLENGE_REQUEST:
                GameActionHandler.ProcessGameMapChallengeRequest(Client, Packet);
                break;

            case GameActionTypeEnum.CELL_ACTION:
                GameActionHandler.ProcessGameCellActionRequest(Client, Packet);
                break;

            case GameActionTypeEnum.CHALLENGE_DENY:
                GameActionHandler.ProcessGameChallengeDenyRequest(Client);
                break;

            case GameActionTypeEnum.CHALLENGE_ACCEPT:
                GameActionHandler.ProcessGameChallengeAcceptRequest(Client);
                break;

            case GameActionTypeEnum.FIGHT_AGGRESSION:
                GameActionHandler.ProcessGameAggressionRequest(Client, Packet);
                break;

            case GameActionTypeEnum.FIGHT_LAUNCHSPELL:
                GameActionHandler.ProcessGameFightLaunchSpellRequest(Client, Packet);
                break;

            case GameActionTypeEnum.FIGHT_USEWEAPON:
                GameActionHandler.ProcessGameFightLaunchWeaponRequest(Client, Packet);
                break;

            case GameActionTypeEnum.FIGHT_JOIN:
                FightHandler.ProcessGameFightJoinRequest(Client, Packet);
                break;

            case GameActionTypeEnum.TAXCOLLECTOR_AGRESSION:
                FightHandler.ProcessStartTaxCollectorFightRequest(Client, Packet);
                break;

            case GameActionTypeEnum.OPEN_PRISM_MENU:
                GameActionHandler.OpenPrismMenuRequest(Client, Packet);
                break;

            case GameActionTypeEnum.PRISM_ATTACK:
                FightHandler.ProcessStartPrismFightRequest(Client, Packet);
                break;
            }
        }
Exemplo n.º 2
0
        public static void ProcessPacket(WorldClient Client, string Packet)
        {
            switch (Packet[1])
            {
            case 'A':
                GameActionHandler.ProcessGameActionStartRequest(Client, Packet);
                break;

            case 'K':
                switch (Packet[2])
                {
                case 'K':
                    GameActionHandler.ProcessGameActionFinishRequest(Client);
                    break;

                case 'E':
                    GameActionHandler.ProcessGameMapMovementAbortRequest(Client, Packet);
                    break;
                }
                break;

            case 'F':
                if (Client.Character.HasRestriction(RestrictionEnum.RESTRICTION_IS_TOMBESTONE))
                {
                    //Client.GetCharacter().OnFreeSoul();
                }
                break;

            case 'R':
                FightHandler.ProcessGameReadyRequest(Client);
                break;

            case 'T':
                FightHandler.ProcessGameTurnReadyRequest(Client);
                break;

            case 't':
                FightHandler.ProcessGameTurnPassRequest(Client);
                break;

            case 'Q':
                FightHandler.ProcessGameRageQuitRequest(Client, Packet);
                break;

            case 'p':
                FightHandler.ProcessGamePlacementRequest(Client, Packet);
                break;

            case 'P':
                AlignmentHandler.ProcessAlignmentEnableRequest(Client, Packet);
                break;

            case 'd':
                if (Packet.Length < 3)
                {
                    Client.Send(new BasicNoOperationMessage());
                    return;
                }
                switch (Packet[2])
                {
                case 'i':
                    if (Client.GetFight() != null && Client.GetFight().Challanges.Where(c => c.Id == int.Parse(Packet.Substring(3))).Count() != 0)
                    {
                        var chall  = Client.GetFight().Challanges.FirstOrDefault(c => c.Id == int.Parse(Packet.Substring(3)));
                        var target = Client.GetFight().Fighters.FirstOrDefault(f => !f.Dead && f.ActorId == chall.TargetId);
                        if (target == null)
                        {
                            Client.Send(new BasicNoOperationMessage());
                            return;
                        }
                        Client.Send(new FightShowCell(chall.TargetId, target.CellId));
                    }
                    break;
                }
                break;
            }
        }
Exemplo n.º 3
0
        public static void ProcessPacket(WorldClient Client, string Packet)
        {
            switch (Packet[0])
            {
            case 'A':
                switch (Packet[1])
                {
                case 'B':
                    CharacterHandler.ProcessBoostStatsRequest(Client, Packet);
                    break;
                }
                break;

            case 'B':
                BasicHandler.ProcessPacket(Client, Packet);
                break;

            case 'c':
                ConsoleHandler.ProcessPacket(Client, Packet);
                break;

            case 'C':
                ConquestHandler.ProcessPacket(Client, Packet);
                break;

            case 'D':
                DialogHandler.ProcessPacket(Client, Packet);
                break;

            case 'E':
                ExchangeHandler.ProcessPacket(Client, Packet);
                break;

            case 'e':
                EnvironmentHandler.ProcessPacket(Client, Packet);
                break;

            case 'f':
                switch (Packet[1])
                {
                case 'D':
                    FightHandler.ProcessFightDetailsRequest(Client, Packet);
                    break;

                case 'L':
                    Client.Send(new FightListMessage(Client.GetCharacter().myMap.GetFights()));
                    break;

                case 'N':
                case 'S':
                case 'P':
                case 'H':
                    FightHandler.ProcessToggleLockRequest(Client, Packet);
                    break;
                }
                break;

            case 'F':
                FriendHandler.ProcessPacket(Client, Packet);
                break;

            case 'G':
                GameActionHandler.ProcessPacket(Client, Packet);
                break;

            case 'g':
                GuildHandler.ProcessPacket(Client, Packet);
                break;

            case 'i':
                EnnemyHandler.ProcessPacket(Client, Packet);
                break;

            case 'P':
                PartyHandler.ProcessPacket(Client, Packet);
                break;

            case 'R':
                MountParkHandler.ProcessPacket(Client, Packet);
                break;

            case 'S':
                SpellHandler.ProcessPacket(Client, Packet);
                break;

            case 'O':
                ObjectHandler.ProcessPacket(Client, Packet);
                break;

            case 'W':
                WayPointHandler.ProcessPacket(Client, Packet);
                break;
            }

            if (Packet.Length > 3 && Packet.Substring(0, 4).Equals("ping"))
            {
                Client.Send(new PingPacket(false));
                return;
            }
            if (Packet.Length > 4 && Packet.Substring(0, 5).Equals("qping"))
            {
                Client.Send(new PingPacket(true));
                return;
            }
        }