Changed ClientService.GetClientFromName() to case-insensitive names
This commit is contained in:
@@ -21,13 +21,14 @@ namespace reallife_gamemode.Server.Services
|
||||
* Gibt "null" zurück, falls kein Client gefunden wurde
|
||||
*/
|
||||
Client toReturn = null;
|
||||
name = name.ToLower();
|
||||
|
||||
List<Client> playerList = NAPI.Pools.GetAllPlayers();
|
||||
toReturn = playerList.Find(p => p.Name == name);
|
||||
toReturn = playerList.Find(p => p.Name.ToLower() == name);
|
||||
|
||||
if(toReturn == null)
|
||||
{
|
||||
toReturn = playerList.Find(p => p.Name.StartsWith(name));
|
||||
toReturn = playerList.Find(p => p.Name.ToLower().StartsWith(name));
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
|
||||
Reference in New Issue
Block a user