//private static void Connection_Reconnected() //{ // Logger.Write("reconnected", LogLevel.Service); //} private static void Connection_Received(string obj) { try { HubData xx = _connection.JsonDeserializeObject <HubData>(obj); switch (xx.Method) { case "sendIdentity": _botIdentiy = xx.List[0]; Logger.Write($"(Identity) [ {_botIdentiy} ] connection establisted", LogLevel.Service); //Console.WriteLine($"[{numb}]now waiting pokemon request (15sec)"); break; case "sendPokemon": RefreshLocationQueue(); if (LocationQueue.Count > 0) { LocationQueue = LocationQueue.OrderByDescending(p => p.Iv).ToList(); //Logger.Write($"pokemons are sending.. {LocationQueue.Count} count", LogLevel.Service); AddToVisited(LocationQueue.Select(p => p.GetEncounterId()).ToList()); _msniperHub.Invoke("RecvPokemons", LocationQueue); LocationQueue.RemoveRange(0, LocationQueue.Count); } break; case "Exceptions": var defaultc = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Logger.Write("ERROR: " + xx.List.FirstOrDefault(), LogLevel.Service); Console.ForegroundColor = defaultc; break; } } catch (Exception) { } }