Ejemplo n.º 1
0
        private void NetClient_Connected(object sender, EventArgs e)
        {
            Log.Info("Connected!");
            CurrentLoginStep = LoginSteps.VerifyingAccount;

            if (Client.Version >= ClientVersion.CV_6040)
            {
                uint clientVersion = (uint)Client.Version;

                byte major = (byte)(clientVersion >> 24);
                byte minor = (byte)(clientVersion >> 16);
                byte build = (byte)(clientVersion >> 8);
                byte extra = (byte)clientVersion;

                PSeed packet = new PSeed(NetClient.ClientAddress, major, minor, build, extra);

                NetClient.LoginSocket.Send(packet.ToArray(), packet.Length, true, true);
            }
            else
            {
                uint address = NetClient.ClientAddress;

                byte[] packet = new byte[4];
                packet[0] = (byte)(address >> 24);
                packet[1] = (byte)(address >> 16);
                packet[2] = (byte)(address >> 8);
                packet[3] = (byte)address;

                NetClient.LoginSocket.Send(packet, packet.Length, true, true);
            }

            NetClient.LoginSocket.Send(new PFirstLogin(Account, Password));
        }
Ejemplo n.º 2
0
    public override void loadData(SeedBase seed)
    {
        base.loadData(seed);
        PSeed p = (PSeed)seed;

        jumpTargetPos = p.jumpTargetPos;
    }
Ejemplo n.º 3
0
 public void read(MemoryStream msdata)
 {
     code = proto_util.readUShort(msdata);
     id   = proto_util.readUInt(msdata);
     pos  = proto_util.readUByte(msdata);
     type = proto_util.readUByte(msdata);
     PSeed.readLoop(msdata, goods);
 }
Ejemplo n.º 4
0
        private void NetClient_Connected(object sender, EventArgs e)
        {
            Log.Info("Connected!");
            CurrentLoginStep = LoginSteps.VerifyingAccount;

            uint address = NetClient.LoginSocket.LocalIP;

            EncryptionHelper.Initialize(true, address, (ENCRYPTION_TYPE)Settings.GlobalSettings.Encryption);

            if (Client.Version >= ClientVersion.CV_6040)
            {
                uint clientVersion = (uint) Client.Version;

                byte major = (byte) (clientVersion >> 24);
                byte minor = (byte) (clientVersion >> 16);
                byte build = (byte) (clientVersion >> 8);
                byte extra = (byte) clientVersion;

                PSeed packet = new PSeed
                (
                    address,
                    major,
                    minor,
                    build,
                    extra
                );

                NetClient.LoginSocket.Send(packet.ToArray(), packet.Length, true, true);
            }
            else
            {
                // TODO: stackalloc
                byte[] packet = new byte[4];
                packet[0] = (byte) (address >> 24);
                packet[1] = (byte) (address >> 16);
                packet[2] = (byte) (address >> 8);
                packet[3] = (byte) address;

                NetClient.LoginSocket.Send(packet, packet.Length, true, true);
            }

            NetClient.LoginSocket.Send(new PFirstLogin(Account, Password));
        }
 public void read(MemoryStream msdata)
 {
     code = proto_util.readUShort(msdata);
     PSeed.readLoop(msdata, goods);
 }
Ejemplo n.º 6
0
 public void read(MemoryStream msdata)
 {
     PSeed.readLoop(msdata, seed);
 }
Ejemplo n.º 7
0
 public void read(MemoryStream msdata)
 {
     type = proto_util.readUByte(msdata);
     PSeed.readLoop(msdata, seed);
 }