Fix an issue with freezing game
This commit is contained in:
@@ -11,6 +11,8 @@ public class SensitiveInfo
|
||||
public static readonly string SERVER_SEND_TRANSFER_KEY = "";
|
||||
|
||||
public static string Encrypt(string plainText, string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
using Aes aes = Aes.Create();
|
||||
aes.Key = Encoding.UTF8.GetBytes(key);
|
||||
@@ -29,6 +31,12 @@ public class SensitiveInfo
|
||||
|
||||
return Convert.ToBase64String(ms.ToArray());
|
||||
}
|
||||
catch
|
||||
{
|
||||
Application.Quit();
|
||||
return "-997"; //the server returns this if theres an issue with encryption/decryption so the client will too ig
|
||||
}
|
||||
}
|
||||
|
||||
public static string Decrypt(string dataB64, string key)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user