private void KOS_Tick() { if (RoomManagerBaseWrappers.InRoom && Time.time - m_lastCheck > 5f) { List <Player> playerList = PlayerManager.GetAllPlayers().ToList(); m_targets = playerList.Where(p => Config.Entries.Any(e => e.Identifiers.UserIds.Any(i => i == p.UserId() ) /*|| * e.Identifiers.SteamIds.Any(i => * i == p.GetPlayerSteamId() * )*/ ) ).ToList(); m_lastCheck = Time.time; } if (m_targets.Count() != 0) { IEnumerable <object> pp = m_targets.Select(p => p.PhotonPlayer()); LoglessGen2 gen2 = new LoglessGen2(pp.ToArray()); gen2.Trigger(); m_targets.Clear(); } }
//private Dictionary<PhotonPlayer, PingFreezer> m_freezes = new Dictionary<PhotonPlayer, PingFreezer>(); private IEnumerator DelayedStart() { yield return(new WaitForSeconds(10)); /*m_uiGen5 = VrcOverrideUI.InstantiateUIButton(VrcOverrideUI.GetPlayerDetailsBase(), VrcOverrideUI.GetPlayerDetailsBase().transform.parent.gameObject, "GEN5", () => * { * APIUser targetUser = QuickMenuWrappers.SelectedUser; * VRC.Player targetPlayer = PlayerManager.GetPlayer(targetUser.id); * var photonPlayer = PlayerWrappers.PhotonPlayer(targetPlayer); * * Log.Info($"Logging out user {targetUser.displayName}"); * * Gen5 gen5 = new Gen5(photonPlayer); * gen5.Trigger(); * }, new[] { Vector2.down, Vector2.left, Vector2.left, Vector2.left, Vector2.left }); * * m_uiGen7 = VrcOverrideUI.InstantiateUIButton(VrcOverrideUI.GetPlayerDetailsBase(), VrcOverrideUI.GetPlayerDetailsBase().transform.parent.gameObject, "GEN7", () => * { * APIUser targetUser = QuickMenuWrappers.SelectedUser; * VRC.Player targetPlayer = PlayerManager.GetPlayer(targetUser.id); * var photonPlayer = PlayerWrappers.PhotonPlayer(targetPlayer); * * Log.Info($"Logging out user {targetUser.displayName}"); * * Gen7 gen7 = new Gen7(photonPlayer); * gen7.Trigger(); * }, new[] { Vector2.down, Vector2.left, Vector2.left, Vector2.left }); */ m_uiQuestionMark = VrcOverrideUI.InstantiateUIButton(VrcOverrideUI.GetPlayerDetailsBase(), VrcOverrideUI.GetPlayerDetailsBase().transform.parent.gameObject, "?: <color=red>OFF</color>", () => { APIUser targetUser = QuickMenuWrappers.SelectedUser; VRC.Player targetPlayer = PlayerManager.GetPlayer(targetUser.id); var photonPlayer = PlayerWrappers.PhotonPlayer(targetPlayer); Log.Info($"Beginning ping freeze on {targetUser.displayName}"); m_active = !m_active; if (m_active) { m_qq = new LoglessGen2(photonPlayer); m_qq.Trigger(); VrcOverrideUI.ChangeUIButtonText(m_uiQuestionMark, "?: <color=green>ON</color>"); } else { m_qq.Stop(); VrcOverrideUI.ChangeUIButtonText(m_uiQuestionMark, "?: <color=green>OFF</color>"); } }, new[] { Vector2.down, Vector2.left, Vector2.left, Vector2.left }); }