コード例 #1
0
 public void OnApplicationStart()
 {
     Logger.log.Debug("OnApplicationStart");
     ChatCoreInstance = ChatCoreInstance.Create();
     ChatService      = ChatCoreInstance.RunAllServices();
     //this._controller = new GameObject("MultiSongRequestManagerController").AddComponent<MultiSongRequestManagerController>();
     RequestBot.Current.Init();
 }
コード例 #2
0
 public override void OnEnable()
 {
     base.OnEnable();
     _sc = ChatCoreInstance.Create();
     //_sc.OnLogReceived += _sc_OnLogReceived;
     _svcs = _sc.RunAllServices();
     _svcs.OnJoinChannel               += QueueOrSendOnJoinChannel;
     _svcs.OnTextMessageReceived       += QueueOrSendOnTextMessageReceived;
     _svcs.OnChatCleared               += QueueOrSendOnClearChat;
     _svcs.OnMessageCleared            += QueueOrSendOnClearMessage;
     _svcs.OnChannelResourceDataCached += QueueOrSendOnChannelResourceDataCached;
     ChatImageProvider.TouchInstance();
     Task.Run(HandleOverflowMessageQueue);
     BSEvents.menuSceneLoadedFresh += BSEvents_menuSceneLoadedFresh;
 }
コード例 #3
0
        public static void Load()
        {
            ChatCoreInstance = ChatCore.ChatCoreInstance.Create();
            streamingService = ChatCoreInstance.RunAllServices();
            // Setup chat message callbacks
            streamingService.OnTextMessageReceived += (ChatCore.Interfaces.IChatService service, ChatCore.Interfaces.IChatMessage message) =>
            {
                if (message.Message.Contains("!gm"))
                {
                    commandChannel = message.Channel;
                }
                else
                {
                    return;
                }
                TwitchMessage twitchMessage = message is TwitchMessage ? message as TwitchMessage : null;


                if (GameModifiersController.charges < 0)
                {
                    GameModifiersController.charges = 0;
                }
                Plugin.twitchCommands.CheckChargeMessage(message);
                Plugin.twitchCommands.CheckConfigMessage(message);
                Plugin.twitchCommands.CheckStatusCommands(message);
                Plugin.twitchCommands.CheckInfoCommands(message);

                if (Config.allowEveryone || (Config.allowSubs && (twitchMessage?.Sender as TwitchUser).IsSubscriber) || (twitchMessage?.Sender).IsModerator)
                {
                    if (GMPUI.chatIntegration && Plugin.isValidScene && !Plugin.cooldowns.GetCooldown("Global") && Plugin.twitchPluginInstalled)
                    {
                        GameModifiersController.commandsLeftForMessage = Config.commandsPerMessage;
                        Plugin.twitchCommands.CheckMapSwapCommands(message);
                        Plugin.twitchCommands.CheckRotationCommands(message);
                        Plugin.twitchCommands.CheckSpeedCommands(message);
                        Plugin.twitchCommands.CheckPauseMessage(message);
                        Plugin.twitchCommands.CheckGameplayCommands(message);
                        Plugin.twitchCommands.CheckHealthCommands(message);
                        Plugin.twitchCommands.CheckSizeCommands(message);
                        Plugin.twitchCommands.CheckGlobalCoolDown();
                    }
                }
                GameModifiersController.trySuper        = false;
                GameModifiersController.sizeActivated   = false;
                GameModifiersController.healthActivated = false;
            };
        }