Esempio n. 1
0
        public override string Build(Client client)
        {
            var state = Engine.Instance.LicenseManager.State(client.DecryptedSection(1));

            if (state == (int)LicenseState.Occupied || state == (int)LicenseState.Invalid)
            {
                return
                    ($"{Id.ToString()}|{AesOperation.Encrypt(client, ((int) RequestState.Fail).ToString())}|{AesOperation.Encrypt(client, state.ToString())}");
            }
            Logger.Log(
                $"[+] {client.IpAddress} -> bound license {client.DecryptedSection(1)} with hwid {client.DecryptedSection(2)}");
            Engine.Instance.LicenseManager.Register(client.DecryptedSection(1), client.DecryptedSection(2));
            return
                ($"{Id.ToString()}|{AesOperation.Encrypt(client, ((int) RequestState.Success).ToString())}|{AesOperation.Encrypt(client, state.ToString())}");
        }
Esempio n. 2
0
 public override string Build(Client client)
 {
     return($"{Id.ToString()}|{AesOperation.Encrypt(client, Engine.Instance.LicenseManager.Whitelisted(client.DecryptedSection(1)).ToString())}");
 }