public override void OnLeave(ILeaveGameCallInfo info) { if (!this.PluginHost.GameId.EndsWith("OnLeaveForgotCall")) { base.OnLeave(info); } }
public override void OnLeave(ILeaveGameCallInfo info) { base.OnLeave(info); var url = this.gameLeaveUrl; if (!string.IsNullOrEmpty(url)) // && info.ActorNr != -1 we don't restrict this anymore as in forwardplugin to see all leaves { this.PostJsonRequest( url, new WebhooksRequest { Type = LeaveReason.ToString(info.Reason), GameId = this.PluginHost.GameId, AppId = this.AppId, AppVersion = this.AppVersion, Region = this.Region, UserId = info.UserId, Nickname = info.Nickname, ActorNr = info.ActorNr, IsInactive = info.IsInactive, Reason = info.Reason.ToString(), AuthCookie = WebFlags.ShouldSendAuthCookie(info.Request.WebFlags) ? info.AuthCookie : null, }, this.LogIfFailedCallback, callAsync: true); } }
//On leave is also called when player is inside a room or got disconnected public override void OnLeave(ILeaveGameCallInfo info) { base.OnLeave(info); m_InfoRoom.I_NumberOfPlayers--; if (m_InfoRoom.I_NoOfClientReady >= 0) { m_InfoRoom.I_NoOfClientReady--; } int numberPlayerCounter = m_InfoRoom.I_NumberOfPlayers - 1; if ((m_InfoRoom.I_NoOfClientReady < numberPlayerCounter) || (m_InfoRoom.I_NoOfClientReady == 0 && numberPlayerCounter == 0)) { PluginHost.BroadcastEvent(target: ReciverGroup.Others, senderActor: 0, targetGroup: 0, data: new Dictionary <byte, object>() { { (byte)245, null }, { 254, 0 } }, evCode: (byte)MyOwnEventCode.S2C_Not_ReadyToStart, cacheOp: 0); } }
public override void OnLeave(ILeaveGameCallInfo info) { if (this.PluginHost.GameId.StartsWith("OnLeaveFailsInPlugins")) { throw new ExpectedTestException("Expected test exception"); } var oldValue = this.PluginHost; if (this.PluginHost.GameId.StartsWith("OnLeaveNullsPluginHost")) { this.PluginHost = null; this.fireAssert = false; } try { base.OnLeave(info); } finally { this.PluginHost = oldValue; this.fireAssert = true; } }
public override void OnLeave(ILeaveGameCallInfo info) { base.OnLeave(info); if (info.ActorNr != 2) { return; } var msg = string.Empty; try { this.PluginHost.SetProperties(2, new Hashtable() { { "xx", "yy" } }, null, false); } catch (Exception e) { msg = e.Message; } this.BroadcastEvent(0, new Dictionary <byte, object> { { 0, msg } }); }
public override void OnLeave(ILeaveGameCallInfo info) { Loger.LogTagFormat(Loger.TagPlugin, "OnLeave===============BEGIN"); Loger.LogTagFormat(Loger.TagPlugin, info.ToStr()); base.OnLeave(info); Loger.LogTagFormat(Loger.TagPlugin, "OnLeave---------------END"); }
/// <summary> /// Called when player leaves the game /// </summary> /// <param name="info"></param> public override void OnLeave(ILeaveGameCallInfo info) { base.OnLeave(info); if (IsGameStarted) { if (scoreManager.ContainPlayer(info.ActorNr))//if player gets kicked on join { scoreManager.RemovePlayer(info.ActorNr, info.UserId); } } }
public void OnLeave(ILeaveGameCallInfo info) { try { this.Plugin.OnLeave(info); this.StrictModeCheck(info); } catch (Exception e) { this.ExceptionHanlder(info, e); } }
public override void OnLeave(ILeaveGameCallInfo info) { if (PlayerManager.Players.Count == 0) { Shutdown(true); } else { _simulationLifecycleManager.ECSRoot.ECS.PlayerDisconnected(info.ActorNr - 1); PlayingStateCheck(); } base.OnLeave(info); }
public override void OnLeave(ILeaveGameCallInfo info) { if (PlayerManager.Players.Count == 0) { Shutdown(true); } else { _simulationLifecycleManager.ECSRoot.ECS.PlayerDisconnected(info.ActorNr - 1); PlayerFeedbackSentEvent?.Invoke(PlayerManager.Players); } base.OnLeave(info); }
/// <summary> /// Plugin callback when a peer is disconnected from the room. /// The corresponding actor is either removed or marked as inactive. /// This can be triggered by an explicit or unexpected Disconnect or a call to Op Leave or RemoveActor. /// </summary> /// <param name="info">Data passed in the callback call.</param> void IGamePlugin.OnLeave(ILeaveGameCallInfo info) { try { this.OnLeave(info); this.StrictModeCheck(info); } catch (Exception e) { ((IGamePlugin)this).ReportError(ErrorCodes.UnhandledException, e); CallFailSafe(info, e.ToString()); } }
/// <summary> /// Calls info.Continue(). Override to change. /// Handles MasterClient switch if needs be. (if the leaving actor is MasterClient) /// </summary> /// <param name="info">Data passed in the callback call.</param> public virtual void OnLeave(ILeaveGameCallInfo info) { System.Diagnostics.Debug.Assert(this.PluginHost != null); var masterClientId = this.PluginHost.MasterClientId; info.Continue(); var newMasterClientId = this.PluginHost.MasterClientId; if (masterClientId != newMasterClientId) { this.OnChangeMasterClientId(masterClientId, newMasterClientId); } }
private void CheckBeforeOnLeave(ILeaveGameCallInfo info) { if (info.ActorNr == 2) { Assert.AreEqual(2, this.PluginHost.GameActors.Count); } else if (info.ActorNr == 1) { Assert.AreEqual(1, this.PluginHost.GameActors.Count); } else { Assert.Fail("Unexpected execution path"); } }
public static string ToStr(this ILeaveGameCallInfo info) { StringBuilder builder = new StringBuilder(); builder.AppendLine("ILeaveGameCallInfo =========== BEGIN"); builder.AppendLine(string.Format("ILeaveGameCallInfo.ActorNr={0}", info.ActorNr)); builder.AppendLine(string.Format("ILeaveGameCallInfo.Details={0}", info.Details)); builder.AppendLine(string.Format("ILeaveGameCallInfo.IsInactive={0}", info.IsInactive)); builder.AppendLine(string.Format("ILeaveGameCallInfo.Reason={0}", info.Reason)); builder.AppendLine(((ITypedCallInfo <ILeaveGameRequest>)info).ToStr <ILeaveGameRequest>()); builder.AppendLine(((ICallInfo)info).ToStr()); builder.AppendLine("ILeaveGameCallInfo ----------- END"); return(builder.ToString()); }
public override void OnLeave(ILeaveGameCallInfo info) { if (PlayerManager.Players.Count == 0) { Shutdown(true); } else { _simulationLifecycleManager.ECSRoot.ECS.PlayerDisconnected(info.ActorNr - 1); if (!InitializingPlayerCheck()) { PlayersInitialized?.Invoke(PlayerManager.Players); } } base.OnLeave(info); }
private void CheckAfterOnLeave(ILeaveGameCallInfo info) { if (info.ActorNr == 2) { Assert.AreEqual(1, this.PluginHost.GameActors.Count); Assert.AreNotEqual(info.ActorNr, this.PluginHost.GameActors[0].ActorNr); } else if (info.ActorNr == 1) { Assert.AreEqual(0, this.PluginHost.GameActors.Count); } else { Assert.Fail("Unexpected execution path"); } }
public override void OnLeave(ILeaveGameCallInfo info) { if (info.IsInactive) { this.onDisconnectEvent.Set(); } else { this.onLeaveEvent.Set(); } info.Continue(); if (info.UserId.Contains("Ban")) { this.PluginHost.RemoveActor(info.ActorNr, RemoveActorReason.Banned, "TestBan"); } }
private void CheckILeaveGameCallInfo(ILeaveGameCallInfo info) { this.CheckBaseInfo(info); Assert.AreNotEqual(0, info.ActorNr); Console.Write(info.Details); if (this.firstOnLeave) { Assert.IsTrue(info.IsInactive); Assert.AreNotEqual(0, info.Reason); Assert.IsTrue(info.Request.IsCommingBack); this.firstOnLeave = false; } else { Assert.IsFalse(info.IsInactive); Assert.AreEqual(0, info.Reason); Assert.IsFalse(info.Request.IsCommingBack); } }
public override void OnLeave(ILeaveGameCallInfo info) { base.OnLeave(info); var msg = string.Empty; if (!this.PluginHost.GameId.Contains("NonZero")) { if (info.IsInactive) { msg = "ILeaveCallInfo.IsInactive should be false"; } } else { if (!info.IsInactive) { msg = "ILeaveCallInfo.IsInactive should be true"; } } this.BroadcastEvent(1, new Dictionary <byte, object> { { 0, msg } }); }
public override void OnLeave(ILeaveGameCallInfo info) { ++this.CallsCount; try { this.CheckILeaveGameCallInfo(info); this.CheckBeforeOnLeave(info); } catch (Exception e) { info.Fail(e.ToString()); return; } try { base.OnLeave(info); this.CheckAfterOnLeave(info); } catch (Exception e) { this.PluginHost.BroadcastErrorInfoEvent(e.ToString(), info); } }
public override void OnLeave(ILeaveGameCallInfo info) { base.OnLeave(info); }
/// <summary> /// Calls info.Continue /// </summary> /// <param name="info"></param> public void OnLeave(ILeaveGameCallInfo info) { info.Continue(); }
public override void OnLeave(ILeaveGameCallInfo info) { _stateController.OnLeave(info); }
public override void OnLeave(ILeaveGameCallInfo info) { this.PluginHost.RemoveActor(info.ActorNr, RemoveActorReason.Kick, ""); base.OnLeave(info); }
public override void OnLeave(ILeaveGameCallInfo info) { this.BroadcastEvent(123, null); base.OnLeave(info); }
public override void OnLeave(ILeaveGameCallInfo info) { this.PluginHost.LogError(string.Format("OnLeave {0}", info.ActorNr)); this.BroadcastEvent(123, null); base.OnLeave(info); }
public override void OnLeave(ILeaveGameCallInfo info) { this.PluginHost.LogInfo("Leaving player " + info.ActorNr); base.OnLeave(info); }
/// <summary> /// Plugin callback when a peer is disconnected from the room. /// The corresponding actor is either removed or marked as inactive. /// This can be triggered by an explicit or unexpected Disconnect or a call to Op Leave or RemoveActor. /// </summary> /// <param name="info">Data passed in the callback call.</param> void IGamePlugin.OnLeave(ILeaveGameCallInfo info) { this.OnLeave(info); }
public override void OnLeave(ILeaveGameCallInfo info) { this.MethodBody(info, MethodBase.GetCurrentMethod().Name); }