fCraft.ModerationCommands.PatrolHandler C# (CSharp) Method

PatrolHandler() private static method

private static PatrolHandler ( Player player, Command cmd ) : void
player Player
cmd Command
return void
        private static void PatrolHandler( Player player, Command cmd )
        {
            World playerWorld = player.World;
            if ( playerWorld == null )
                PlayerOpException.ThrowNoWorld( player );

            Player target = playerWorld.GetNextPatrolTarget( player );
            if ( target == null ) {
                player.Message( "Patrol: No one to patrol in this world." );
                return;
            }

            player.TeleportTo( target.Position );
            player.Message( "Patrol: Teleporting to {0}", target.ClassyName );
        }