public override void OnRaiseEvent(IRaiseEventCallInfo info) { var res = this.CheckPreConditions(info); if (!string.IsNullOrEmpty(res)) { info.Fail(res); return; } try { base.OnRaiseEvent(info); } catch (Exception e) { this.PluginHost.BroadcastErrorInfoEvent(e.ToString(), info); return; } res = this.CheckPostConditions(info); if (!string.IsNullOrEmpty(res)) { this.PluginHost.BroadcastErrorInfoEvent(res, info); } }
public override void OnRaiseEvent(IRaiseEventCallInfo info) { ++this.CallsCount; try { this.CheckIRaiseEventCallInfo(info); this.CheckBeforeOnRaiseEvent(info); } catch (Exception e) { info.Fail(e.ToString()); return; } try { base.OnRaiseEvent(info); this.CheckAfterOnRaiseEvent(info); } catch (Exception e) { this.PluginHost.BroadcastErrorInfoEvent(e.ToString(), info); } }
public override void OnRaiseEvent(IRaiseEventCallInfo info) { if (info.Request.EvCode == 0) { base.OnRaiseEvent(info); } else if (info.Request.EvCode == 1) { info.Defer(); } else if (info.Request.EvCode == 2) { info.Cancel(); } else if (info.Request.EvCode == 3) { info.Fail(); this.PluginHost.BroadcastErrorInfoEvent("We called fail method"); } else if (info.Request.EvCode == 4) { throw new Exception("Event 4 exception"); } else if (info.Request.EvCode == 5) { var request = new HttpRequest { Async = true, Callback = HttpCallbackWithException, Url = "http://photon.webscript.io/auth-demo/", }; this.PluginHost.HttpRequest(request); info.Defer(); } else if (info.Request.EvCode == 6) { var request = new HttpRequest { Async = false, Callback = HttpCallbackWithException, Url = "http://photon.webscript.io/auth-demo/", }; this.PluginHost.HttpRequest(request); info.Continue(); } else if (info.Request.EvCode == 7) { this.timer = this.PluginHost.CreateOneTimeTimer(this.TimerAction, 100); info.Defer(); } else if (info.Request.EvCode == 8) { this.timer = this.PluginHost.CreateTimer(this.TimerAction, 100, 100); info.Defer(); } }
public override void OnRaiseEvent(IRaiseEventCallInfo info) { if (info.Request.EvCode == 0) { base.OnRaiseEvent(info); } else if (info.Request.EvCode == 1) { #pragma warning disable CS0618 // Type or member is obsolete info.Defer(); #pragma warning restore CS0618 // Type or member is obsolete } else if (info.Request.EvCode == 2) { info.Cancel(); } else if (info.Request.EvCode == 3) { info.Fail(); this.PluginHost.BroadcastErrorInfoEvent("We called fail method"); } else if (info.Request.EvCode == 4) { throw new Exception("Event 4 exception"); } else if (info.Request.EvCode == 5) { var request = new HttpRequest { Async = true, Callback = HttpCallbackWithException, Url = "https://wt-e4c18d407aa73a40e4182aaf00a2a2eb-0.run.webtask.io/auth/auth-demo/", }; this.PluginHost.HttpRequest(request, info); } else if (info.Request.EvCode == 6) { var request = new HttpRequest { Async = false, Callback = HttpCallbackWithException, Url = "https://wt-e4c18d407aa73a40e4182aaf00a2a2eb-0.run.webtask.io/auth/auth-demo/", }; this.PluginHost.HttpRequest(request, info); } else if (info.Request.EvCode == 7) { this.timer = this.PluginHost.CreateOneTimeTimer(info, this.TimerAction, 100); } else if (info.Request.EvCode == 8) { this.timer = this.PluginHost.CreateTimer(this.TimerAction, 100, 100); } }
void Fire(IRaiseEventCallInfo info) { var ammo = (int)GetActor(info.ActorNr).Properties.GetProperty("Ammo").Value; if (ammo <= 0) { this.PluginHost.LogError("Fire failed for player " + info.ActorNr); info.Fail("No ammo available"); } else { SetAmmo(info.ActorNr, ammo - 1); info.Continue(); } }
public override void OnRaiseEvent(IRaiseEventCallInfo info) { var res = this.CheckPreConditions(info); if (!string.IsNullOrEmpty(res)) { info.Fail(res); return; } try { base.OnRaiseEvent(info); } catch (Exception e) { this.PluginHost.BroadcastErrorInfoEvent(e.ToString(), info); return; } res = this.CheckPostConditions(info); if (!string.IsNullOrEmpty(res)) { this.PluginHost.BroadcastErrorInfoEvent(res, info); } }
/// <summary> /// Calls info.Fail /// </summary> /// <param name="info"></param> public void OnRaiseEvent(IRaiseEventCallInfo info) { info.Fail(this.errorMsg); }
public override void OnRaiseEvent(IRaiseEventCallInfo info) { if (info.Request.EvCode == 0) { base.OnRaiseEvent(info); } else if (info.Request.EvCode == 1) { info.Defer(); } else if (info.Request.EvCode == 2) { info.Cancel(); } else if (info.Request.EvCode == 3) { info.Fail(); this.PluginHost.BroadcastErrorInfoEvent("We called fail method"); } else if (info.Request.EvCode == 4) { throw new Exception("Event 4 exception"); } else if (info.Request.EvCode == 5) { var request = new HttpRequest { Async = true, Callback = HttpCallbackWithException, Url = "http://photon.webscript.io/auth-demo/", }; this.PluginHost.HttpRequest(request); info.Defer(); } else if (info.Request.EvCode == 6) { var request = new HttpRequest { Async = false, Callback = HttpCallbackWithException, Url = "http://photon.webscript.io/auth-demo/", }; this.PluginHost.HttpRequest(request); info.Continue(); } else if (info.Request.EvCode == 7) { this.timer = this.PluginHost.CreateOneTimeTimer(this.TimerAction, 100); info.Defer(); } else if (info.Request.EvCode == 8) { this.timer = this.PluginHost.CreateTimer(this.TimerAction, 100, 100); info.Defer(); } }
/// <summary> /// Calls info.Fail /// </summary> /// <param name="info"></param> public void OnRaiseEvent(IRaiseEventCallInfo info) { info.Fail(this.errorMsg); }