www.pudn.com > Wcell.rar > ToggleRegionUpdates.cs


/************************************************************************* 
 * 
 *   file		: ToggleRegionUpdates.cs 
 *   copyright		: (C) The WCell Team 
 *   email		: info@wcell.org 
 *   last changed	: $LastChangedDate: 2008-03-10 08:52:03 +0800 (星期一, 10 三月 2008) $ 
 *   last author	: $LastChangedBy: tobz $ 
 *   revision		: $Rev: 190 $ 
 * 
 *   This program is free software; you can redistribute it and/or modify 
 *   it under the terms of the GNU General Public License as published by 
 *   the Free Software Foundation; either version 2 of the License, or 
 *   (at your option) any later version. 
 * 
 *************************************************************************/ 
 
using WCell.RealmServer.World; 
 
namespace WCell.RealmServerConsole.Commands 
{ 
    ///  
    /// Command for toggling all of the regions on or off  
    /// (turning updates on or off) 
    ///  
    public class ToggleRegionUpdates 
    { 
        ///  
        /// Toggles all the regions on or off 
        ///  
        /// the arguments of the command 
        [ConsoleCommand("togglergnupdates")] 
        public static void Execute(string[] arguments) 
        { 
            foreach (Region rgn in  WorldMgr.Regions) 
            { 
                if (!rgn.Running) 
                { 
                    rgn.Start(); 
                } 
                else 
                { 
                    rgn.Stop(); 
                } 
            } 
        } 
    } 
}