Esempio n. 1
0
 public GameThread(D2gsConnection connection, D2gsHandler handler, UInt32 chickenLife, UInt32 potLife)
 {
     _d2gsConnection      = connection;
     _d2gsHandler         = handler;
     GameData             = new GameData();
     GameData.ChickenLife = chickenLife;
     GameData.PotLife     = potLife;
     _strategies.Add(new PartyStrategy(connection, GameData));
     _strategies.Add(new FollowStrategy(connection, GameData));
 }
Esempio n. 2
0
        public D2GS(String character, String account, UInt32 chickenLife, UInt32 potLife)
        {
            //ConnectedToGs = false;
            m_d2gsConnection = new D2gsConnection();
            m_d2gsReader     = new D2gsReader(ref m_d2gsConnection, character);
            m_d2gsHandler    = new D2gsHandler(ref m_d2gsConnection);
            m_gsPing         = new GameServerPing(ref m_d2gsConnection);
            m_gameThread     = new GameThread(m_d2gsConnection, chickenLife, potLife);
            m_asciiMap       = new AsciiMap(m_gameThread.GameData, m_d2gsConnection);

            m_d2gsConnection.StartThread += delegate {
                m_d2gsHandlerThread      = new Thread(m_d2gsHandler.ThreadFunction);
                m_d2gsHandlerThread.Name = account + " [D2Gs]:";
                m_d2gsReaderThread       = new Thread(m_d2gsReader.ThreadFunction);
                m_d2gsReaderThread.Name  = account + " [D2GS]:";

                m_d2gsHandlerThread.Start();
                m_d2gsReaderThread.Start();
            };

            m_d2gsHandler.StartPinging += delegate
            {
                m_gsPingThread      = new Thread(m_gsPing.Run);
                m_gsPingThread.Name = account + " [D2GS]:";
                m_gsPingThread.Start();
                m_mapThread = new Thread(m_asciiMap.ThreadFunction);
                m_mapThread.Start();
            };


            m_botThread      = new Thread(m_gameThread.BotThread);
            m_botThread.Name = account + " [BOT]:";
            m_botThread.Start();

            SubscribeGameServerEvents();
        }
Esempio n. 3
0
 public virtual void RemoveListeners(D2gsHandler handler)
 {
 }
Esempio n. 4
0
 public virtual void AddListeners(D2gsHandler handler)
 {
 }
Esempio n. 5
0
 public override void RemoveListeners(D2gsHandler handler)
 {
     handler.PartyUpdateEvent -= OnPartyUpdateEvent;
 }
Esempio n. 6
0
 public override void AddListeners(D2gsHandler handler)
 {
     handler.PartyUpdateEvent += OnPartyUpdateEvent;
 }
Esempio n. 7
0
 public override void RemoveListeners(D2gsHandler handler)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 8
0
 public override void AddListeners(D2gsHandler handler)
 {
     handler.UpdatePlayerPosition += OnUpdatePlayerPosition;
 }