static void InitRest(SchedulerTask task) { IRC = new IRCBot(); if (Server.Config.UseIRC) { IRC.Connect(); } CountdownGame.Instance.AutoStart(); ZSGame.Instance.AutoStart(); LSGame.Instance.AutoStart(); CTFGame.Instance.AutoStart(); TWGame.Instance.AutoStart(); MainScheduler.QueueRepeat(BlockQueue.Loop, null, TimeSpan.FromMilliseconds(BlockQueue.Interval)); Critical.QueueRepeat(ServerTasks.TickPlayers, null, TimeSpan.FromMilliseconds(20)); Logger.Log(LogType.SystemActivity, "Finished setting up server, finding classicube.net url.."); SetupFinished = true; }
static void ShowAltsTask(SchedulerTask task) { string name = (string)task.State; Player p = PlayerInfo.FindExact(name); if (p == null || p.Socket.Disconnected) { return; } // Server host is exempt from alt listing if (IPAddress.IsLoopback(p.IP)) { return; } List <string> alts = PlayerInfo.FindAccounts(p.ip); // in older versions it was possible for your name to appear multiple times in DB while (alts.CaselessRemove(p.name)) { } if (alts.Count == 0) { return; } ItemPerms opchat = Chat.OpchatPerms; string altsMsg = "λNICK &Sis lately known as: " + alts.Join(); Chat.MessageFrom(p, altsMsg, (pl, obj) => pl.CanSee(p) && opchat.UsableBy(pl.Rank)); //IRCBot.Say(temp, true); //Tells people in op channel on IRC altsMsg = altsMsg.Replace("λNICK", name); Logger.Log(LogType.UserActivity, altsMsg); }
static void ShowAltsTask(SchedulerTask task) { string name = (string)task.State; Player p = PlayerInfo.FindExact(name); if (p == null || p.ip == "127.0.0.1" || p.disconnected) { return; } List <string> alts = PlayerInfo.FindAccounts(p.ip); // Remove online accounts from the list of accounts on the IP for (int i = alts.Count - 1; i >= 0; i--) { if (PlayerInfo.FindExact(alts[i]) == null) { continue; } alts.RemoveAt(i); } if (alts.Count == 0) { return; } LevelPermission adminChatRank = CommandOtherPerms.FindPerm("adminchat", LevelPermission.Admin); string altsMsg = p.ColoredName + " %Sis lately known as: " + alts.Join(); if (p.group.Permission < adminChatRank || !Server.adminsjoinsilent) { Chat.MessageOps(altsMsg); //IRCBot.Say(temp, true); //Tells people in op channel on IRC } Server.s.Log(altsMsg); }
public override void Load(bool startup) { task = Server.MainScheduler.QueueRepeat(CheckDirection, null, TimeSpan.FromMilliseconds(100)); }
void DoLotteryTick(SchedulerTask task) { DoLottery(); Server.MainScheduler.Cancel(task); }
public static void UpdaterTask(SchedulerTask task) { UpdateCheck(); task.Delay = TimeSpan.FromHours(2); }
static void LoadAllPlugins(SchedulerTask task) { Plugin.LoadAll(); }
static void InitHeartbeat(SchedulerTask task) { Heartbeat.Start(); }
void AllowMoreTntTask(SchedulerTask task) { CurrentAmountOfTnt--; }
/// <summary> Cancels a task if it is in the tasks list. /// <remarks> Does not cancel the task if it is currently executing. </remarks> public bool Cancel(SchedulerTask task) { lock (taskLock) { return(tasks.Remove(task)); } }