Exemplo n.º 1
0
        private void ConnectAsyncCompleted(object sender, SocketAsyncEventArgs e)
        {
            // 6c12b527e6810ff7301d972042ae3614f3d73acc
            // ae9b056807ac8bfa58a3e879b1f1601ff17d1df5
            if (e.SocketError != SocketError.Success)
            {
                throw new SocketException((int)e.SocketError);
            }

            NetworkManager      = new NetworkManagerAsync(e.ConnectSocket, HandleReceivedPacket, HandleReceicedPacketFailed);
            NetworkManager.Seed = new Random().Next();
            QueuePacket(new LoginRequestPacket()
            {
                UserID                       = Avatar.ID,
                UserToken                    = Avatar.Token,
                ClientMajorVersion           = 7,
                ClientContentVersion         = 0,
                ClientMinorVersion           = 156,
                FingerprintHash              = "ae9b056807ac8bfa58a3e879b1f1601ff17d1df5",
                OpenUDID                     = "563a6f060d8624db",
                MacAddress                   = null,
                DeviceModel                  = "GT-I9300",
                LocaleKey                    = 2000000,
                Language                     = "en",
                AdvertisingGUID              = "",
                OSVersion                    = "4.0.4",
                IsAdvertisingTrackingEnabled = false,
                AndroidDeviceID              = "563a6f060d8624db",
                FacebookDistributionID       = "",
                VendorGUID                   = "",
                Seed = NetworkManager.Seed
            });
            KeepAliveManager.Start();
        }
Exemplo n.º 2
0
        private void ConnectAsyncCompleted(object sender, SocketAsyncEventArgs e)
        {
            if (e.SocketError != SocketError.Success)
            {
                throw new SocketException((int)e.SocketError);
            }

            NetworkManager = new NetworkManagerAsync(e.ConnectSocket);
            NetworkManager.PacketReceived += OnPacketReceived;
            NetworkManager.Seed            = new Random().Next();
            SendPacket(new LoginRequestPacket()
            {
                UserID                       = Avatar.ID,
                UserToken                    = Avatar.Token,
                ClientMajorVersion           = 7,
                ClientContentVersion         = 12,
                ClientMinorVersion           = 200,
                FingerprintHash              = "8771aa1095195c4217bd625d66e120d91e8d15b0",
                OpenUDID                     = "563a6f060d8624db",
                MacAddress                   = null,
                DeviceModel                  = "GT-I9300",
                LocaleKey                    = 2000000,
                Language                     = "en",
                AdvertisingGUID              = "",
                OSVersion                    = "4.0.4",
                IsAdvertisingTrackingEnabled = false,
                AndroidDeviceID              = "563a6f060d8624db",
                FacebookDistributionID       = "",
                VendorGUID                   = "",
                Seed = NetworkManager.Seed
            });
            KeepAliveManager.Start();
        }
Exemplo n.º 3
0
        public CoCClient()
        {
            UserID       = 0;
            UserToken    = null;
            Connection   = new Socket(SocketType.Stream, ProtocolType.Tcp);
            PacketLogger = new PacketLogger()
            {
                LogConsole = false
            };
            PacketHandlers   = new Dictionary <ushort, PacketHandler>();
            KeepAliveManager = new KeepAliveManager(this);

            LoginPacketHandlers.RegisterLoginPacketHandlers(this);
            InGamePacketHandlers.RegisterInGamePacketHandler(this);
        }
Exemplo n.º 4
0
        public CoCClient()
        {
            UserID = 0;
            UserToken = null;
            Connection = new Socket(SocketType.Stream, ProtocolType.Tcp);
            PacketLogger = new PacketLogger()
            {
                LogConsole = false
            };
            PacketHandlers = new Dictionary<ushort, PacketHandler>();
            KeepAliveManager = new KeepAliveManager(this);

            LoginPacketHandlers.RegisterLoginPacketHandlers(this);
            InGamePacketHandlers.RegisterInGamePacketHandler(this);
        }
Exemplo n.º 5
0
        public CoCClient()
        {
            Fingerprint = new Fingerprint();
            Home = new Village();
            Avatar = new Avatar();
            Connection = new Socket(SocketType.Stream, ProtocolType.Tcp);
            PacketHandlers = new Dictionary<ushort, PacketHandler>();
            KeepAliveManager = new KeepAliveManager(this);
            PacketLogger = new PacketLogger()
            {
                LogConsole = false
            };

            LoginPacketHandlers.RegisterLoginPacketHandlers(this);
            InGamePacketHandlers.RegisterInGamePacketHandler(this);
        }
Exemplo n.º 6
0
        public CoCClient()
        {
            Fingerprint      = new Fingerprint();
            Home             = new Village();
            Avatar           = new Avatar();
            Connection       = new Socket(SocketType.Stream, ProtocolType.Tcp);
            PacketHandlers   = new Dictionary <ushort, PacketHandler>();
            KeepAliveManager = new KeepAliveManager(this);
            PacketLogger     = new PacketLogger()
            {
                LogConsole = false
            };

            LoginPacketHandlers.RegisterLoginPacketHandlers(this);
            InGamePacketHandlers.RegisterInGamePacketHandler(this);
        }
Exemplo n.º 7
0
        private void Dispose(bool disposing)
        {
            if (m_Disposed)
            {
                return;
            }

            if (disposing)
            {
                KeepAliveManager.Dispose();
                NetworkManager.Dispose();
                PluginManager.Dispose();

                PacketHandlers.Clear();
                DefaultPacketHandlers.Clear();
            }

            m_Disposed = true;
        }
Exemplo n.º 8
0
        public CoCClient()
        {
            Fingerprint = new Fingerprint();
            Home = new Village();
            Avatar = new Avatar();
            Connection = new Socket(SocketType.Stream, ProtocolType.Tcp);
            DefaultPacketHandlers = new Dictionary<ushort, PacketHandler>();
            PacketHandlers = new Dictionary<ushort, PacketHandler>();
            KeepAliveManager = new KeepAliveManager(this);
            PacketLog = new PacketLog("packets.log")
            {
                AutoSave = true
            };
            PluginManager = new PluginManager(this);

            LoginPacketHandlers.RegisterLoginPacketHandlers(this);
            InGamePacketHandlers.RegisterInGamePacketHandler(this);
            PluginManager.LoadPlugins();
            PluginManager.EnablePlugins();
        }
Exemplo n.º 9
0
        public CoCClient()
        {
            Fingerprint = new Fingerprint(); // not used

            Home                  = new Village();
            Avatar                = new Avatar();
            Connection            = new Socket(SocketType.Stream, ProtocolType.Tcp);
            DefaultPacketHandlers = new Dictionary <ushort, PacketHandler>();
            PacketHandlers        = new Dictionary <ushort, PacketHandler>();
            KeepAliveManager      = new KeepAliveManager(this);
            PacketLog             = new PacketLog("packets.log")
            {
                AutoSave   = true,
                LogConsole = false
            };
            PluginManager = new PluginManager(this);

            LoginPacketHandlers.RegisterLoginPacketHandlers(this);
            InGamePacketHandlers.RegisterInGamePacketHandler(this);
            PluginManager.LoadPlugins();
            PluginManager.EnablePlugins();
        }