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
|
* Gibt "null" zurück, falls kein Client gefunden wurde
|
||||||
*/
|
*/
|
||||||
Client toReturn = null;
|
Client toReturn = null;
|
||||||
|
name = name.ToLower();
|
||||||
|
|
||||||
List<Client> playerList = NAPI.Pools.GetAllPlayers();
|
List<Client> playerList = NAPI.Pools.GetAllPlayers();
|
||||||
toReturn = playerList.Find(p => p.Name == name);
|
toReturn = playerList.Find(p => p.Name.ToLower() == name);
|
||||||
|
|
||||||
if(toReturn == null)
|
if(toReturn == null)
|
||||||
{
|
{
|
||||||
toReturn = playerList.Find(p => p.Name.StartsWith(name));
|
toReturn = playerList.Find(p => p.Name.ToLower().StartsWith(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
return toReturn;
|
return toReturn;
|
||||||
|
|||||||
Reference in New Issue
Block a user