/// <summary> /// 停止 /// </summary> private void OnStopping(StoppingEventArgs e) { if (Stopping != null) { Stopping(this, e); } }
internal void OnWarheadStop(StoppingEventArgs ev) { if (!config.Warhead.canBeDisabledGlobal && !config.Warhead.canBeDisabled[ev.Player.Role]) { ev.IsAllowed = false; } }
public async void OnStoppingWarhead(StoppingEventArgs ev) { if (Instance.Config.EventsToLog.StoppingWarhead && (ev.Player == null || (ev.Player != null && (!ev.Player.DoNotTrack || !Instance.Config.ShouldRespectDoNotTrack)))) { object[] vars = ev.Player == null? Array.Empty <object>() : new object[] { ev.Player.Nickname, Instance.Config.ShouldLogUserIds ? ev.Player.UserId : Language.Redacted, ev.Player.Role }; await Network.SendAsync(new RemoteCommand("log", "gameEvents", string.Format(ev.Player == null ? Language.CanceledWarhead : Language.PlayerCanceledWarhead, vars))).ConfigureAwait(false); } if (Instance.Config.StaffOnlyEventsToLog.StoppingWarhead) { object[] vars = ev.Player == null ? Array.Empty <object>() : new object[] { ev.Player.Nickname, ev.Player.UserId, ev.Player.Role }; await Network.SendAsync(new RemoteCommand("log", "staffCopy", string.Format(ev.Player == null ? Language.CanceledWarhead : Language.PlayerCanceledWarhead, vars))).ConfigureAwait(false); } }
/// <summary> /// /// </summary> public void Stop() { if (IsRuning) { var e = new StoppingEventArgs(); OnStopping(e); if (!e.Canceled) { IsRuning = false; bool wait = true; while (wait) { if (!IsSleeping) { wait = true; } else { wait = false; OnStoped(new EventArgs()); } } } } }
internal void OnStopping(StoppingEventArgs ev) { if (ev.IsAllowed) { AnnouncementSettings settings = SimpleCassie.Instance.Config.WarheadStop; Log.Info( $"RoundStart: {settings.Enabled}, roundStartMsg: {settings.Message}, roundStartDelay: {settings.Delay}, roundStartNoise: {settings.MakeNoise}"); Timing.RunCoroutine(Extensions.CassieMessage(settings.Message, false, (bool)settings.MakeNoise, (float)settings.Delay)); } }
internal void Stopping(StoppingEventArgs ev) { if (Plugin.Instance.Config.Stopping == "") { return; } string message = Plugin.Instance.Config.Stopping.Replace("%player%", ev.Player.ToString()); if (Plugin.Instance.Config.debug_to_console) { Log.Debug(message: "[ " + Plugin.Instance.Config.warhead_name + "] " + message); } Plugin.sendWebHook(Plugin.Instance.Config.warhead_url, message, Plugin.Instance.Config.warhead_name); }
private static bool Prefix(AlphaWarheadController __instance, GameObject disabler) { ServerLogs.AddLog(ServerLogs.Modules.Warhead, "Detonation cancelled.", ServerLogs.ServerLogType.GameEvent); if (!__instance.inProgress || __instance.timeToDetonation <= 10.0) { return(false); } if (__instance.timeToDetonation <= 15.0 && disabler != null) { __instance.GetComponent <PlayerStats>().TargetAchieve(disabler.GetComponent <NetworkIdentity>().connectionToClient, "thatwasclose"); } var ev = new StoppingEventArgs(API.Features.Player.Get(disabler) ?? API.Features.Server.Host); Warhead.OnStopping(ev); return(ev.IsAllowed && !API.Features.Warhead.IsWarheadLocked); }
public void RunWhenWarheadIsStopped(StoppingEventArgs ev) { if (!Instance.Config.EnableWarheadDetonationWhenCanceledChance || _isWarheadDetonated) { return; } int newChance = _randNum.Next(0, 100); if (newChance >= Instance.Config.InstantWarheadDetonationChance) { return; } Warhead.Start(); Warhead.DetonationTimer = 0.05f; if (!Instance.Config.PreventCtBroadcasts) { Map.Broadcast(5, "<color=red>Someone tried to disable the warhead but pressed the wrong button</color>"); } }
private static void executor_Stopping(object sender, StoppingEventArgs e) { Console.WriteLine("正在停止..."); }
internal void OnWarheadStop(StoppingEventArgs ev) => ev.IsAllowed = !(!Autonuke.instance.Config.CanStopDetonation && isAutoNukeGoingOff);
private void OnStopping(StoppingEventArgs e) { if (Stopping != null) { Stopping(this, e); } }
/// <summary> /// 停止工作 /// </summary> public void Stop() { if (IsRuning) { var e = new StoppingEventArgs(); OnStopping(e); if (!e.Canceled) { IsRuning = false; bool wait = true; while (wait) { if (!IsSleeping) { wait = true; } else { wait = false; OnStoped(new EventArgs()); } } } } }
/// <summary> /// Called before stopping the warhead. /// </summary> /// <param name="ev">The <see cref="StoppingEventArgs"/> instance.</param> public static void OnStopping(StoppingEventArgs ev) => Stopping.InvokeSafely(ev);
private static void sender_Stopping(object sender, StoppingEventArgs e) { Console.WriteLine(@"正在结束..."); }
public void OnStopping(StoppingEventArgs ev) { Warhead.Start(); }
public void OnAlphaCancel(StoppingEventArgs ev) { Map.Broadcast(15, Plugin.Instance.Config.AlphaStop.Replace("{player.Nickname}", ev.Player.Nickname)); }
public void OnAlphaCancel(StoppingEventArgs ev) { Log.Info($"Alpha Warhead is Off, {ev.Player.Nickname}({ev.Player})"); Map.Broadcast(15, $"<size=50><color=red>알파탄두</color> 폭★파 절차가 <color=red>취소</color>되었습니다.\n취소한 사람 : {ev.Player.Nickname}</size>"); }
/// <inheritdoc cref="Events.Handlers.Warhead.OnStopping(StoppingEventArgs)"/> public void OnStopping(StoppingEventArgs ev) { Log.Info($"{ev.Player?.Nickname} stopped the warhead!"); }
void WorkerStopping(object sender, StoppingEventArgs e) { ExitCode = 1066; Stop(); }