private CheckWorldPermissions ( |
||
p | ||
Résultat | bool |
private bool CheckWorldPermissions( Player p )
{
if ( !p.Info.Rank.AllowSecurityCircumvention ) {
SecurityCheckResult buildCheck = _world.BuildSecurity.CheckDetailed( p.Info );
switch ( buildCheck ) {
case SecurityCheckResult.BlackListed:
p.Message( "Cannot add life to world {0}&S: You are barred from building here.",
p.ClassyName );
return false;
case SecurityCheckResult.RankTooLow:
p.Message( "Cannot add life to world {0}&S: You are not allowed to build here.",
p.ClassyName );
return false;
}
}
return true;
}
private static void OnCreate(Player p, Command cmd) { LifeHandler handler = new LifeHandler(); if (!handler.CheckAndGetLifeZone(p, cmd)) { return; } if (!handler.CheckWorldPermissions(p)) { return; } if (null != handler._life) { p.Message("&WLife with such name exists already, choose another"); return; } p.SelectionStart(2, handler.LifeCreateCallback, null, Permission.DrawAdvanced); p.MessageNow("Select life zone: place/remove a block or type /Mark to use your location."); }