Added comments to some functions, renamed GetClientByName to GetClientByNameOrId
This commit is contained in:
@@ -19,6 +19,13 @@ namespace reallife_gamemode.Server.Extensions
|
||||
{
|
||||
public static class ClientExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// Gibt das User-Objekt eines Client's zurück
|
||||
/// Gibt nichts zurück, wenn der Client nicht eingeloggt ist
|
||||
/// </summary>
|
||||
/// <param name="client">Der Client, dessen User man bekommen möchte</param>
|
||||
/// <param name="context">Ein eventuell vorhandener Datenbank-Context, falls man Änderungen in der Datenbank vornehmen will</param>
|
||||
/// <returns></returns>
|
||||
public static User GetUser(this Client client, DatabaseContext context = null)
|
||||
{
|
||||
if (!client.IsLoggedIn()) return null;
|
||||
@@ -35,6 +42,11 @@ namespace reallife_gamemode.Server.Extensions
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt zurück, ob ein Client eingeloggt ist
|
||||
/// </summary>
|
||||
/// <param name="player">Der Client, dessen Login-Status man bekommen möchte</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsLoggedIn(this Client player)
|
||||
{
|
||||
return player.HasData("isLoggedIn") ? player.GetData("isLoggedIn") : false;
|
||||
|
||||
Reference in New Issue
Block a user