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)); }
public override void loadData(SeedBase seed) { base.loadData(seed); PSeed p = (PSeed)seed; jumpTargetPos = p.jumpTargetPos; }
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); }
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); }
public void read(MemoryStream msdata) { PSeed.readLoop(msdata, seed); }
public void read(MemoryStream msdata) { type = proto_util.readUByte(msdata); PSeed.readLoop(msdata, seed); }