public override void OnSetProperties(ISetPropertiesCallInfo info) { try { // we check the request contains the expected game properties if (!info.Request.Properties.ContainsKey("EventSize") || !info.Request.Properties.ContainsKey("Interval")) { info.Fail("Mising GameProperties in Request: EventSize or Interval"); } if (this.timer != null) { this.PluginHost.StopTimer(this.timer); this.timer = null; } var properties = info.Request.Properties; this.SetTimer(properties); base.OnSetProperties(info); } catch (Exception ex) { info.Fail(this.GetType().Name + "." + MethodBase.GetCurrentMethod().Name + "():" + ex.Message); } }
public override void OnSetProperties(ISetPropertiesCallInfo info) { base.OnSetProperties(info); var setPropertiesRequest = info.Request; var url = this.gamePropertiesUrl; if (setPropertiesRequest.HttpForward && !string.IsNullOrEmpty(url)) { var state = WebFlags.ShouldSendState(info.Request.WebFlags) ? this.GetGameState() : null; this.PostJsonRequest( url, new WebhooksRequest { Type = info.Request.ActorNumber == 0 ? "Game" : "Actor", TargetActor = info.Request.ActorNumber == 0 ? null : (int?)info.Request.ActorNumber, GameId = this.PluginHost.GameId, AppId = this.AppId, AppVersion = this.AppVersion, Region = this.Region, UserId = info.UserId, Nickname = info.Nickname, ActorNr = info.ActorNr, Properties = setPropertiesRequest.Properties, State = state, AuthCookie = WebFlags.ShouldSendAuthCookie(info.Request.WebFlags) ? info.AuthCookie : null, }, this.LogIfFailedCallback, null, callAsync: !WebFlags.ShouldSendSync(info.Request.WebFlags)); } }
public override void OnSetProperties(ISetPropertiesCallInfo info) { if (!this.PluginHost.GameId.EndsWith("OnSetPropertiesForgotCall")) { base.OnSetProperties(info); } }
public override void OnSetProperties(ISetPropertiesCallInfo info) { try { // we check the request contains the expected game properties if (!info.Request.Properties.ContainsKey("EventSize") || !info.Request.Properties.ContainsKey("Interval")) { info.Fail("Mising GameProperties in Request: EventSize or Interval"); } if (timer != null) { this.PluginHost.StopTimer(timer); timer = null; } var properties = info.Request.Properties; this.SetTimer(properties); base.OnSetProperties(info); } catch (Exception ex) { info.Fail(this.GetType().Name + "." + MethodBase.GetCurrentMethod().Name + "():" + ex.Message); } }
public override void OnSetProperties(ISetPropertiesCallInfo info) { Loger.LogTagFormat(Loger.TagPlugin, "OnSetProperties===============BEGIN"); Loger.LogTagFormat(Loger.TagPlugin, info.ToStr()); base.OnSetProperties(info); Loger.LogTagFormat(Loger.TagPlugin, "OnSetProperties---------------END"); }
private string CheckAfterOnSetProperties(ISetPropertiesCallInfo info) { var value = (string)info.Request.Properties["ActorProperty"]; if (value == "BeforeSetPropertiesPostCheckFail") { return("OnSetPropertiesPostCheckFail is set. we fail"); } return(string.Empty); }
public void OnSetProperties(ISetPropertiesCallInfo info) { try { this.Plugin.OnSetProperties(info); this.StrictModeCheck(info); } catch (Exception e) { this.ExceptionHanlder(info, e); } }
public static string ToStr(this ISetPropertiesCallInfo info) { StringBuilder builder = new StringBuilder(); builder.AppendLine("ISetPropertiesCallInfo =========== BEGIN"); builder.AppendLine(string.Format("ISetPropertiesCallInfo.ActorNr={0}", info.ActorNr)); builder.AppendLine(((ITypedCallInfo <ISetPropertiesRequest>)info).ToStr <ISetPropertiesRequest>()); builder.AppendLine(((ICallInfo)info).ToStr()); builder.AppendLine("ISetPropertiesCallInfo ----------- END"); return(builder.ToString()); }
/// <summary> /// Plugin callback called when info.Continue() is called inside <see cref="IGamePlugin.BeforeSetProperties"/>. /// </summary> /// <param name="info">Data passed in the callback call.</param> void IGamePlugin.OnSetProperties(ISetPropertiesCallInfo info) { try { this.OnSetProperties(info); this.StrictModeCheck(info); } catch (Exception e) { ((IGamePlugin)this).ReportError(ErrorCodes.UnhandledException, e); CallFailSafe(info, e.ToString()); } }
public override void OnSetProperties(ISetPropertiesCallInfo info) { var res = this.CheckBeforeOnSetProperties(info); if (!string.IsNullOrEmpty(res)) { info.Fail(res); return; } try { base.OnSetProperties(info); } catch (Exception e) { this.PluginHost.BroadcastErrorInfoEvent(e.ToString(), info); return; } res = this.CheckAfterOnSetProperties(info); if (!string.IsNullOrEmpty(res)) { this.PluginHost.BroadcastErrorInfoEvent(res, info); } }
public override void OnSetProperties(ISetPropertiesCallInfo info) { ++this.CallsCount; try { this.CheckISetPropertiesCallInfo(info); this.CheckBeforeOnSetProperties(); } catch (Exception e) { info.Fail(e.ToString()); return; } try { base.OnSetProperties(info); this.CheckAfterOnSetProperties(); } catch (Exception e) { this.PluginHost.BroadcastErrorInfoEvent(e.ToString(), info); } }
public override void OnSetProperties(ISetPropertiesCallInfo info) { this.MethodBody(info, MethodBase.GetCurrentMethod().Name); }
/// <summary> /// Calls info.Fail /// </summary> /// <param name="info"></param> public void OnSetProperties(ISetPropertiesCallInfo info) { info.Fail(this.errorMsg); }
public override void OnSetProperties(ISetPropertiesCallInfo info) { this.onSetPropertiesEvent.Set(); info.Continue(); }
public override void OnSetProperties(ISetPropertiesCallInfo info) { base.OnSetProperties(info); }
/// <summary> /// Plugin callback called when info.Continue() is called inside <see cref="IGamePlugin.BeforeSetProperties"/>. /// </summary> /// <param name="info">Data passed in the callback call.</param> void IGamePlugin.OnSetProperties(ISetPropertiesCallInfo info) { this.OnSetProperties(info); }
/// <summary> /// Calls info.Continue(). Override to change. /// </summary> /// <param name="info">Data passed in the callback call.</param> public virtual void OnSetProperties(ISetPropertiesCallInfo info) { System.Diagnostics.Debug.Assert(this.PluginHost != null); info.Continue(); }
private void CheckISetPropertiesCallInfo(ISetPropertiesCallInfo info) { this.CheckBaseInfo(info); Console.Write(info.ActorNr); CheckISetPropertiesRequest(info.Request); }