internal void StartTasks() { lock ( taskLock ) { updateTask = Scheduler.NewTask(UpdateTask); updateTask.RunForever(this, TimeSpan.FromMilliseconds(ConfigKey.TickInterval.GetInt()), TimeSpan.Zero); if (ConfigKey.SaveInterval.GetInt() > 0) { saveTask = Scheduler.NewTask(SaveTask); saveTask.RunForever(this, TimeSpan.FromSeconds(ConfigKey.SaveInterval.GetInt()), TimeSpan.FromSeconds(ConfigKey.SaveInterval.GetInt())); } if (ConfigKey.BackupInterval.GetInt() > 0) { backupTask = Scheduler.NewTask(BackupTask); TimeSpan interval = TimeSpan.FromMinutes(ConfigKey.BackupInterval.GetInt()); backupTask.RunForever(this, interval, (ConfigKey.BackupOnStartup.GetBool() ? TimeSpan.Zero : interval)); } } }
public List <Vector3I> PositionList = new List <Vector3I>(); //Vectors in this list are connected, but not neccessarily in a line #region Public Methods /// <summary> /// Sets a bot, as well as the bot values. Must be called before any other bot classes. /// </summary> public void setBot(String botName, World botWorld, Position pos, int entityID) { Name = botName; World = botWorld; Position = pos; ID = entityID; thread = Scheduler.NewTask(t => NetworkLoop()); thread.RunForever(TimeSpan.FromSeconds(0.1)); //run the network loop every 0.1 seconds Server.Bots.Add(this); }
void StartTasks() { lock( taskLock ) { updateTask = Scheduler.NewTask( UpdateTask ); updateTask.RunForever( this, TimeSpan.FromMilliseconds( ConfigKey.TickInterval.GetInt() ), TimeSpan.Zero ); if( ConfigKey.SaveInterval.GetInt() > 0 ) { saveTask = Scheduler.NewBackgroundTask( SaveTask ); saveTask.RunForever( this, TimeSpan.FromSeconds( ConfigKey.SaveInterval.GetInt() ), TimeSpan.FromSeconds( ConfigKey.SaveInterval.GetInt() ) ); } } }
void StartTasks() { lock( taskLock ) { updateTask = Scheduler.NewTask( UpdateTask ); updateTask.RunForever( this, TimeSpan.FromMilliseconds( ConfigKey.TickInterval.GetInt() ), TimeSpan.Zero ); if( ConfigKey.SaveInterval.GetInt() > 0 ) { saveTask = Scheduler.NewBackgroundTask( SaveTask ); saveTask.IsCritical = true; saveTask.AdjustForExecutionTime = true; saveTask.RunForever( this, TimeSpan.FromSeconds( ConfigKey.SaveInterval.GetInt() ), TimeSpan.FromSeconds( ConfigKey.SaveInterval.GetInt() ) ); } } }
internal static void StartSaveTask() { saveTask = Scheduler.NewBackgroundTask(SaveTask); saveTask.IsCritical = true; saveTask.RunForever(SaveInterval, SaveInterval + TimeSpan.FromSeconds(15)); }
public void Start() { started = true; task = Scheduler.NewTask(StartFeed); task.RunForever(TimeSpan.FromMilliseconds(600)); }
/// <summary> /// Sets a bot, as well as the bot values. Must be called before any other bot classes. /// </summary> public void setBot(String botName, World botWorld, Position pos, int entityID) { Name = botName; World = botWorld; Position = pos; ID = entityID; thread = Scheduler.NewTask(t => NetworkLoop()); thread.RunForever(TimeSpan.FromSeconds(0.1));//run the network loop every 0.1 seconds Server.Bots.Add(this); }
public void Start() { started = true; task = Scheduler.NewTask( StartFeed ); task.RunForever( TimeSpan.FromMilliseconds( 600 ) ); }
internal void StartTasks() { lock( taskLock ) { updateTask = Scheduler.NewTask( UpdateTask ); updateTask.RunForever( this, TimeSpan.FromMilliseconds( ConfigKey.TickInterval.GetInt() ), TimeSpan.Zero ); if( ConfigKey.SaveInterval.GetInt() > 0 ) { saveTask = Scheduler.NewTask( SaveTask ); saveTask.RunForever( this, TimeSpan.FromSeconds( ConfigKey.SaveInterval.GetInt() ), TimeSpan.FromSeconds( ConfigKey.SaveInterval.GetInt() ) ); } if( ConfigKey.BackupInterval.GetInt() > 0 ) { backupTask = Scheduler.NewTask( BackupTask ); TimeSpan interval = TimeSpan.FromMinutes( ConfigKey.BackupInterval.GetInt() ); backupTask.RunForever( this, interval, (ConfigKey.BackupOnStartup.GetBool() ? TimeSpan.Zero : interval) ); } } }