Whitelist shell feedback (#10694)
Co-authored-by: Visne <39844191+Visne@users.noreply.github.com>
This commit is contained in:
@@ -31,10 +31,17 @@ public sealed class AddWhitelistCommand : IConsoleCommand
|
|||||||
var guid = data.UserId;
|
var guid = data.UserId;
|
||||||
var isWhitelisted = await db.GetWhitelistStatusAsync(guid);
|
var isWhitelisted = await db.GetWhitelistStatusAsync(guid);
|
||||||
if (isWhitelisted)
|
if (isWhitelisted)
|
||||||
|
{
|
||||||
|
shell.WriteLine(Loc.GetString("command-whitelistadd-existing", ("username", data.Username)));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await db.AddToWhitelistAsync(guid);
|
await db.AddToWhitelistAsync(guid);
|
||||||
|
shell.WriteLine(Loc.GetString("command-whitelistadd-added", ("username", data.Username)));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shell.WriteError(Loc.GetString("command-whitelistadd-not-found", ("username", args[0])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,10 +67,17 @@ public sealed class RemoveWhitelistCommand : IConsoleCommand
|
|||||||
var guid = data.UserId;
|
var guid = data.UserId;
|
||||||
var isWhitelisted = await db.GetWhitelistStatusAsync(guid);
|
var isWhitelisted = await db.GetWhitelistStatusAsync(guid);
|
||||||
if (!isWhitelisted)
|
if (!isWhitelisted)
|
||||||
|
{
|
||||||
|
shell.WriteLine(Loc.GetString("command-whitelistremove-existing", ("username", data.Username)));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await db.RemoveFromWhitelistAsync(guid);
|
await db.RemoveFromWhitelistAsync(guid);
|
||||||
|
shell.WriteLine(Loc.GetString("command-whitelistremove-removed", ("username", data.Username)));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shell.WriteError(Loc.GetString("command-whitelistremove-not-found", ("username", args[0])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,15 @@ whitelist-not-whitelisted-rp = You are not whitelisted. To become whitelisted, v
|
|||||||
|
|
||||||
command-whitelistadd-description = Adds the player with the given username to the server whitelist.
|
command-whitelistadd-description = Adds the player with the given username to the server whitelist.
|
||||||
command-whitelistadd-help = whitelistadd <username>
|
command-whitelistadd-help = whitelistadd <username>
|
||||||
|
command-whitelistadd-existing = {$username} is already on the whitelist!
|
||||||
|
command-whitelistadd-added = {$username} added to the whitelist
|
||||||
|
command-whitelistadd-not-found = Unable to find '{$username}'
|
||||||
|
|
||||||
command-whitelistremove-description = Removes the player with the given username from the server whitelist.
|
command-whitelistremove-description = Removes the player with the given username from the server whitelist.
|
||||||
command-whitelistremove-help = whitelistremove <username>
|
command-whitelistremove-help = whitelistremove <username>
|
||||||
|
command-whitelistremove-existing = {$username} is not on the whitelist!
|
||||||
|
command-whitelistremove-removed = {$username} removed from the whitelist
|
||||||
|
command-whitelistremove-not-found = Unable to find '{$username}'
|
||||||
|
|
||||||
command-kicknonwhitelisted-description = Kicks all non-whitelisted players from the server.
|
command-kicknonwhitelisted-description = Kicks all non-whitelisted players from the server.
|
||||||
command-kicknonwhitelisted-help = kicknonwhitelisted
|
command-kicknonwhitelisted-help = kicknonwhitelisted
|
||||||
|
|||||||
Reference in New Issue
Block a user