throw errors for multiple character with same name + world set up in config
This commit is contained in:
@@ -78,10 +78,16 @@ public class ServerConfigurationManager
|
|||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
var auth = currentServer.Authentications.Find(f => string.Equals(f.CharacterName, charaName, StringComparison.Ordinal) && f.WorldId == worldId);
|
var auth = currentServer.Authentications.FindAll(f => string.Equals(f.CharacterName, charaName, StringComparison.Ordinal) && f.WorldId == worldId);
|
||||||
if (auth == null) return null;
|
if (auth.Count >= 2)
|
||||||
|
{
|
||||||
|
_mareMediator.Publish(new NotificationMessage("Multiple Identical Characters detected", "Your Service configuration has multiple characters with the same name and world set up. Please delete the duplicates.",
|
||||||
|
NotificationType.Error));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (auth.Count == 0) return null;
|
||||||
|
|
||||||
if (currentServer.SecretKeys.TryGetValue(auth.SecretKeyIdx, out var secretKey))
|
if (currentServer.SecretKeys.TryGetValue(auth.Single().SecretKeyIdx, out var secretKey))
|
||||||
{
|
{
|
||||||
return secretKey.Key;
|
return secretKey.Key;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user