Когда я получаю переменную из файла и сравнить ее с другой она возвращает null
if(cmdValue == Configuration.AdminPass)
{
Device.Player.Home.admin = 2;
}
else
{
var admin = new ChatStreamEntry
{
Message =
$"Command not found. Use /help for the list of commands."
};
admin.SetSender(Device.Player);
alliance.AddEntry(admin);
}
Сам AdminPass:
[JsonProperty("admin_pass")]
public int AdminPass = 1;
Сохранение в конфиг:
var config = JsonConvert.DeserializeObject<Configuration>(File.ReadAllText("config.json"));
EncryptionKey = config.EncryptionKey;
SentryApiUrl = config.SentryApiUrl;
MySqlUserId = config.MySqlUserId;
MySqlServer = config.MySqlServer;
MySqlPassword = config.MySqlPassword;
MySqlDatabase = config.MySqlDatabase;
PatchUrl = config.PatchUrl;
UseContentPatch = config.UseContentPatch;
AdminPass = config.AdminPass;
ServerPort = config.ServerPort;
UpdateUrl = config.UpdateUrl;
UseUdp = config.UseUdp;
ClusterServerPort = config.ClusterServerPort;
ClusterKey = config.ClusterKey;
ClusterNonce = config.ClusterNonce;