Ejemplo n.º 1
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              = MasterHash,
                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();
        }
Ejemplo n.º 2
0
        public CoCClient()
        {
            MasterHash       = "f6d70976c986a10f9c5984b146cd6b6a4d3c61e2";
            Home             = new Village();
            Avatar           = new Avatar();
            Connection       = new Socket(SocketType.Stream, ProtocolType.Tcp);
            PacketHandlers   = new Dictionary <ushort, PacketHandler>();
            KeepAliveManager = new KeepAliveManager(this);

            LoginPacketHandlers.RegisterLoginPacketHandlers(this);
        }
Ejemplo n.º 3
0
        private void Dispose(bool disposing)
        {
            if (m_Disposed)
            {
                return;
            }

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

                PacketHandlers.Clear();
            }

            m_Disposed = true;
        }