Ejemplo n.º 1
0
        //Remove any lingering hooks and dispose of discord client connection
        public void Dispose()
        {
            On.RoR2.Run.BeginStage -= Run_BeginStage;

            On.RoR2.SteamworksLobbyManager.OnLobbyCreated -= SteamworksLobbyManager_OnLobbyCreated;
            On.RoR2.SteamworksLobbyManager.OnLobbyJoined  -= SteamworksLobbyManager_OnLobbyJoined;
            On.RoR2.SteamworksLobbyManager.OnLobbyChanged -= SteamworksLobbyManager_OnLobbyChanged;
            On.RoR2.SteamworksLobbyManager.LeaveLobby     -= SteamworksLobbyManager_LeaveLobby;

            RoR2Application.onPauseStartGlobal -= OnGamePaused;
            RoR2Application.onPauseEndGlobal   -= OnGameUnPaused;

            client.Unsubscribe(DiscordRPC.EventType.Join);
            client.Unsubscribe(DiscordRPC.EventType.JoinRequest);

            client.Dispose();
        }