static void WorldFlushHandler( Player player, Command cmd ) {
string worldName = cmd.Next();
World world = player.World;
if( worldName != null ) {
world = WorldManager.FindWorldOrPrintMatches( player, worldName );
if( world == null ) return;
} else if( world == null ) {
player.Message( "When using /WFlush from console, you must specify a world name." );
return;
}
Map map = world.Map;
if( map == null ) {
player.MessageNow( "WFlush: {0}&S has no updates to process.",
world.ClassyName );
} else {
player.MessageNow( "WFlush: Flushing {0}&S ({1} blocks)...",
world.ClassyName,
map.UpdateQueueLength + map.DrawQueueBlockCount );
world.Flush();
}
}