komplexität verringert

This commit is contained in:
Fabian Wessels
2021-04-08 10:17:51 +02:00
parent 4b17aab84d
commit d99f3ad6d5

View File

@@ -37,9 +37,9 @@ namespace ReallifeGamemode.Server.Events
if (user == null) if (user == null)
{ {
player.TriggerEvent("SERVER:Login_Error", "Der Benutzer existiert nicht! Registriere dich zuerst!"); player.TriggerEvent("SERVER:Login_Error", "Der Benutzer existiert nicht! Registriere dich zuerst!");
return;
} }
else
{
if (user.SocialClubName != player.SocialClubName && user.Password == NAPI.Util.GetHashSha256(password)) if (user.SocialClubName != player.SocialClubName && user.Password == NAPI.Util.GetHashSha256(password))
{ {
player.TriggerEvent("SERVER:Login_Error", "Dieser Benutzer gehört dir nicht!"); player.TriggerEvent("SERVER:Login_Error", "Dieser Benutzer gehört dir nicht!");
@@ -51,9 +51,9 @@ namespace ReallifeGamemode.Server.Events
if (user.Password != NAPI.Util.GetHashSha256(password)) if (user.Password != NAPI.Util.GetHashSha256(password))
{ {
player.TriggerEvent("SERVER:Login_Error", "Passwort inkorrekt!"); player.TriggerEvent("SERVER:Login_Error", "Passwort inkorrekt!");
return;
} }
else
{
player.SetData("dbId", user.Id); player.SetData("dbId", user.Id);
player.Name = username; player.Name = username;
player.TriggerEvent("SERVER:Login_Success"); player.TriggerEvent("SERVER:Login_Success");
@@ -149,6 +149,4 @@ namespace ReallifeGamemode.Server.Events
} }
} }
} }
}
}
} }