Пример #1
0
        public static void HandleClientReadyMessage(ClientReadyMessage message, LoLClient client)
        {
            client.Ready = true;

            client.Send(new LoadScreenInfoMessage(6, 6, ConfigurationProvider.Instance.GetBlueIds(), ConfigurationProvider.Instance.GetPurpleIds()), Channel.CHL_LOADING_SCREEN);

            foreach (var player in ConfigurationProvider.Instance.Configuration.Players)
            {
                client.Send(new LoadScreenPlayerNameMessage(player.UserId, player.SkinId, player.Name, 0), Channel.CHL_LOADING_SCREEN);
                client.Send(new LoadScreenPlayerChampionMessage(player.UserId, player.SkinId, player.ChampionName, 0), Channel.CHL_LOADING_SCREEN);
            }
        }
Пример #2
0
        public static void HandleKeyCheckMessage(KeyCheckMessage message, LoLClient client)
        {
            long userId = LoLServer.BlowFish.Decrypt((ulong)message.checkId);

            logger.Write("User (" + userId + ") connected!");

            if (userId != message.userId)
            {
                return;
            }
            client.UserId = userId;

            PlayerData datas = ConfigurationProvider.Instance.GetPlayerData(userId);

            if (datas == null)
            {
                logger.Write("No player data for userId:" + userId, MessageState.WARNING);
                return;
            }

            Game targetGame = GameProvider.TestGame;

            if (targetGame.Contains(userId))
            {
                logger.Write(userId + "try to connect a second time!", MessageState.WARNING);
                return;
            }
            client.DefinePlayer(new AIHero(client, datas, AIUnitRecord.GetAIUnitRecord(datas.ChampionName)));

            client.Hero.DefineGame(targetGame);

            client.Hero.Game.AddUnitToTeam(client.Hero, client.Hero.Data.Team);

            client.Hero.PlayerNo = client.Hero.Game.PopNextPlayerNo();

            // on montre aux joueurs de la partie que je suis la !
            client.Hero.Game.Send(new KeyCheckMessage(PartialKey, client.Hero.PlayerNo, userId, 0, 0, 0), Channel.CHL_HANDSHAKE);

            // on montre a moi les autre joueurs de la partie
            foreach (var player in client.Hero.Game.Players)
            {
                client.Send(new KeyCheckMessage(PartialKey, player.PlayerNo, player.Client.UserId.Value, 0, 0, 0), Channel.CHL_HANDSHAKE);
            }

            // useless??
            client.Send(new WorldGameNumberMessage(client.Hero.Game.Id, client.Hero.Game.Name), Channel.CHL_S2C);

            // blowfish >= 8
            client.Encrypt = true;
        }
Пример #3
0
        public static void TestCommand(LoLClient client)
        {
            client.Send(new ChangeSlotSpellDataMessage(client.Hero.NetId, 0, false, new ChangeSpellDataSpellName()
            {
                SpellName = "BlindMonkQTwo",
            }));
            return;

            for (int i = 0; i < 10; i++)
            {
                JungleManager.Instance.SpawnMonster("SRU_OrderMinionMelee", client.Hero.Game, client.Hero.Position + new Vector2(i * 150, 0));
            }

            for (int i = 0; i < 10; i++)
            {
                JungleManager.Instance.SpawnMonster("SRU_OrderMinionRanged", client.Hero.Game, client.Hero.Position + new Vector2(0, i * 150));
            }

            client.Hero.Game.Send(new BuffAddMessage(client.Hero.NetId, 0, BuffTypeEnum.Counter
                                                     , 1, false, "Recall".HashString(), (uint)client.Hero.GetHash(), 0f, 1f, client.Hero.NetId));

            return;

            /* client.Hero.Game.Send(new WaypointGroupWithSpeedMessage(client.Hero.NetId, new MovementDataWithSpeed[]{
             * new MovementDataWithSpeed()
             * {
             *  HasTeleportID = false,
             *  SpeedParams =new SpeedParams()
             *  {
             *      Facing = false,
             *      FollowBackDistance =0f,
             *      FollowDistance = 0f,
             *      FollowNetID = 0,
             *      FollowTravelTime =0f,
             *      ParabolicGravity =102f,
             *      ParabolicStartPoint = client.Hero.Position,
             *      PathSpeedOverride = 200F,// DashManager.GetDash().Speed,
             *  },
             *  TeleportID = 0,
             *  TeleportNetID = client.Hero.NetId,
             *  Waypoints= GridPosition.Translate(new Vector2[]{client.Hero.Position,client.Hero.Position+new Vector2(100,100) },client.Hero.Game.Map.Size)
             * } }, Environment.TickCount));
             * return;
             * //    client.Hero.Game.Send(new UpdateModelMessage(t.NetId, "SRUAP_Turret_Chaos1", true, 0));
             */


            client.Hero.BlueTip("Legends", "This is for developpement purpose only!", "", TipCommandEnum.ACTIVATE_TIP_DIALOGUE);
            return;

            var turret = client.Hero.Game.GetUnit <AITurret>("Turret_T2_C_01");

            List <short> items = new List <short>()
            {
                1501, 1502, 1503, 1505
            };
        }
Пример #4
0
        public static void HandleViewRequestMessage(ViewRequestMessage message, LoLClient client)
        {
            byte requestNo = 0x00;

            if (message.requestNo == 0xFE)
            {
                requestNo = 0xFF;
            }
            else
            {
                requestNo = message.requestNo;
            }

            client.Send(new ViewMessage(requestNo));
        }
Пример #5
0
        public static void HandleSynchVersionMessage(SynchVersionMessage message, LoLClient client)
        {
            string version = Crypto.GetVersion(message.version);

            if (version != LoLServer.CLIENT_REQUIRED_VERSION)
            {
                client.Disconnect();
            }
            else
            {
                var infos = ConfigurationProvider.Instance.GetPlayersInformations();
                client.Send(new SynchVersionAnswerMessage(0, 1, (int)client.Hero.Game.Map.Id, infos,
                                                          LoLServer.CLIENT_REQUIRED_VERSION, GameModeEnum.CLASSIC, "NA1", 487826), Channel.CHL_S2C);
            }
        }
Пример #6
0
 public static void HandleQueryStatusRequest(QueryStatusRequestMessage message, LoLClient client)
 {
     client.Send(new QueryStatusAnswerMessage(0, 1), Channel.CHL_S2C);
 }