예제 #1
0
 public override void Handshake(string accountName)
 {
     Thread.Sleep(100);
     SendPacket(EncryptionKey.ToString(), true);
     Thread.Sleep(100);
     SendPacket($"DAC {accountName} {_dacIdentifier} 7");
 }
예제 #2
0
        public void SecretsToStringTest()
        {
            var encryptionSecret = new EncryptionSecret(1, Guid.NewGuid().ToByteArray());

            Assert.IsTrue(Regex.IsMatch(encryptionSecret.ToString(),
                                        "EncryptionSecret\\{SecretBytes\\=HASH\\[(-)?(\\d)+\\], Version=1\\}"));
            var customEncryptionKey = new CustomEncryptionKey(1, Guid.NewGuid().ToByteArray());

            Assert.IsTrue(Regex.IsMatch(customEncryptionKey.ToString(),
                                        "CustomEncryptionKey\\{SecretBytes\\=HASH\\[(-)?(\\d)+\\], Version=1\\}"));
            var encryptionKey = new EncryptionKey(1, Encoding.UTF8.GetBytes("123456789012345678901234567890Ab"));

            Assert.IsTrue(Regex.IsMatch(encryptionKey.ToString(),
                                        "EncryptionKey\\{SecretBytes\\=HASH\\[(-)?(\\d)+\\], Version=1\\}"));
        }