Example #1
0
 public void gameOver()
 {
     System.Random r = new System.Random((int)this.transform.position.x * (int)Time.time);
     if (r.Next(1, 100) <= 50)
     {
         navi.destination = LocationQueue.getNextPos();
     }
     else
     {
         navi.destination = new Vector3(0f, 0f, 32.23f);
     }
 }
        //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)
            {
            }
        }
Example #3
0
 // Use this for initialization
 void Start()
 {
     navi             = GetComponent <NavMeshAgent>();
     navi.destination = LocationQueue.getNextPos();
 }
Example #4
0
 void needPlayer()
 {
     LocationQueue.store(this.gameObject.transform);
 }