Missing group safeguards.

- Server will no longer start up when the guest or default groups cannot
  be located.
- Players joining with unknown groups assigned to them will be
  disconnected with an error
This commit is contained in:
quake1337 2021-07-13 21:33:35 +02:00
parent c5421460ae
commit 48370d74b7
6 changed files with 41 additions and 5 deletions

View file

@ -212,6 +212,17 @@ namespace TShockAPI
} while (TilePlacementValid(tileX, tileY) && TileSolid(tileX, tileY));
}
public bool AssertGroupValid(TSPlayer player, Group group)
{
if (group == null)
{
player.Disconnect("Your account's group could not be found. Please contact server administrators about this.");
return false;
}
return true;
}
/// <summary>
/// Determines if a tile is valid.
/// </summary>