public ConnectionMessage(NetOutgoingMessage msg, string username, string password) { SubDataType = ConnectMsgType.LoginSuccess; msg.Write((byte)NetMsgType.Login); byte[] xUsername = Xor(Encoding.UTF8.GetBytes(username), EncryptionKey); byte[] xPassword = Xor(Encoding.UTF8.GetBytes(password), EncryptionKey); string encryptedUsername = Encoding.UTF8.GetChars(xUsername).ToString(); string encryptedPassword = Encoding.UTF8.GetChars(xPassword).ToString(); msg.Write(encryptedUsername); msg.Write(encryptedPassword); }
public ConnectionMessage(NetOutgoingMessage msg, ConnectMsgType type) { msg.Write((byte)type); Username = null; Password = null; }
public ConnectionMessage(NetIncomingMessage msg) { SubDataType = (ConnectMsgType)msg.ReadByte(); }