コード例 #1
0
        public async Task Handle(ISession session, WebSocketSession webSocketSession, dynamic message)
        {
            CatchState.AddFastPokemapItem(message.Data);

            await HumanWalkSnipeTask.AddFastPokemapItem(message.Data);

            //Console.WriteLine(JsonConvert.DeserializeObject(message.Data));
        }
コード例 #2
0
        private static void ONFPMBridgeData(ISession session, string message)
        {
            var match = Regex.Match(message, "42\\[\"fpm\",(.*)]");

            if (match != null && !string.IsNullOrEmpty(match.Groups[1].Value))
            {
                //var data = JsonConvert.DeserializeObject<List<Logic.Tasks.HumanWalkSnipeTask.FastPokemapItem>>(match.Groups[1].Value);
                HumanWalkSnipeTask.AddFastPokemapItem(match.Groups[1].Value);
            }
        }
コード例 #3
0
        private static void ONFPMBridgeData(ISession session, string message)
        {
            var match = Regex.Match(message, "42\\[\"fpm\",(.*)]");

            if (match != null && !string.IsNullOrEmpty(match.Groups[1].Value))
            {
                //var data = JsonConvert.DeserializeObject<List<Logic.Tasks.HumanWalkSnipeTask.FastPokemapItem>>(match.Groups[1].Value);

                // jjskuld - Ignore CS4014 warning for now.
#pragma warning disable 4014
                HumanWalkSnipeTask.AddFastPokemapItem(match.Groups[1].Value);
#pragma warning restore 4014
            }
        }
コード例 #4
0
 private static void onSocketMessageRecieved(ISession session, object sender, WebSocketSharp.MessageEventArgs e)
 {
     try
     {
         var match = Regex.Match(e.Data, "42\\[\"pokemon\",(.*)]");
         if (match != null && !string.IsNullOrEmpty(match.Groups[1].Value))
         {
             var data = JsonConvert.DeserializeObject <EncounteredEvent>(match.Groups[1].Value);
             data.IsRecievedFromSocket = true;
             session.EventDispatcher.Send(data);
             if (session.LogicSettings.AllowAutoSnipe)
             {
                 var move1 = PokemonMove.Absorb;
                 var move2 = PokemonMove.Absorb;
                 Enum.TryParse <PokemonMove>(data.Move1, true, out move1);
                 Enum.TryParse <PokemonMove>(data.Move1, true, out move2);
                 MSniperServiceTask.AddSnipeItem(session, new MSniperServiceTask.MSniperInfo2()
                 {
                     Latitude     = data.Latitude,
                     Longitude    = data.Longitude,
                     EncounterId  = Convert.ToUInt64(data.EncounterId),
                     SpawnPointId = data.SpawnPointId,
                     PokemonId    = (short)data.PokemonId,
                     Iv           = data.IV,
                     Move1        = move1,
                     Move2        = move2
                 });
             }
             return;
         }
         match = Regex.Match(e.Data, "42\\[\"fpm\",(.*)]");
         if (match != null && !string.IsNullOrEmpty(match.Groups[1].Value))
         {
             //var data = JsonConvert.DeserializeObject<List<Logic.Tasks.HumanWalkSnipeTask.FastPokemapItem>>(match.Groups[1].Value);
             HumanWalkSnipeTask.AddFastPokemapItem(match.Groups[1].Value);
             return;
         }
     }
     catch (Exception ex)
     {
         #if DEBUG
         Logger.Write("ERROR TO ADD SNIPE< DEBUG ONLY " + ex.Message, LogLevel.Info, ConsoleColor.Yellow);
         #endif
     }
 }