Don't generate keys on dedis.

This commit is contained in:
momo5502 2016-02-23 18:54:28 +01:00
parent a3d8ee8094
commit 818c21b3c3

View File

@ -148,15 +148,19 @@ namespace Components
void Auth::StoreKey() void Auth::StoreKey()
{ {
Proto::Auth::Certificate cert; if (!Dedicated::IsDedicated() && !ZoneBuilder::IsEnabled())
cert.set_token(Auth::GuidToken.ToString()); {
cert.set_privatekey(Auth::GuidKey.Export(PK_PRIVATE)); Proto::Auth::Certificate cert;
cert.set_token(Auth::GuidToken.ToString());
cert.set_privatekey(Auth::GuidKey.Export(PK_PRIVATE));
Utils::WriteFile("players/guid.dat", cert.SerializeAsString()); Utils::WriteFile("players/guid.dat", cert.SerializeAsString());
}
} }
void Auth::LoadKey(bool force) void Auth::LoadKey(bool force)
{ {
if (Dedicated::IsDedicated() || ZoneBuilder::IsEnabled()) return;
if (!force && Auth::GuidKey.IsValid()) return; if (!force && Auth::GuidKey.IsValid()) return;
Proto::Auth::Certificate cert; Proto::Auth::Certificate cert;