Remove Utils.ForceKickAll; add TSPlayer.KickAll.
This commit is contained in:
parent
1ea04ffd4f
commit
8301d6a6f3
3 changed files with 18 additions and 18 deletions
|
|
@ -110,6 +110,22 @@ namespace TShockAPI
|
|||
return found;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disconnects all players from the server without checking for immunetokick permission.
|
||||
/// </summary>
|
||||
/// <param name="force">If the kick should bypass permission checks.</param>
|
||||
/// <param name="reason">The reason for the kick.</param>
|
||||
public static void KickAll(bool force, string reason)
|
||||
{
|
||||
foreach (TSPlayer player in TShock.Players)
|
||||
{
|
||||
if (player != null && player.Active)
|
||||
{
|
||||
player.Kick(reason, force, true, null, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The amount of tiles that the player has killed in the last second.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -496,21 +496,6 @@ namespace TShockAPI
|
|||
return GetPrefixByName(idOrName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Kicks all player from the server without checking for immunetokick permission.
|
||||
/// </summary>
|
||||
/// <param name="reason">string reason</param>
|
||||
public void ForceKickAll(string reason)
|
||||
{
|
||||
foreach (TSPlayer player in TShock.Players)
|
||||
{
|
||||
if (player != null && player.Active)
|
||||
{
|
||||
player.Kick(reason, true, true, null, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops the server after kicking all players with a reason message, and optionally saving the world
|
||||
/// </summary>
|
||||
|
|
@ -520,12 +505,10 @@ namespace TShockAPI
|
|||
{
|
||||
TShock.ShuttingDown = true;
|
||||
|
||||
ForceKickAll(reason);
|
||||
if (save)
|
||||
SaveManager.Instance.SaveWorld();
|
||||
|
||||
// Save takes a while so kick again
|
||||
ForceKickAll(reason);
|
||||
TSPlayer.KickAll(true, reason);
|
||||
|
||||
// Broadcast so console can see we are shutting down as well
|
||||
TShock.Utils.Broadcast(reason, Color.Red);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue