public RavenfallConnection( ILogger logger, IKernel kernel, IBotServer server, IPlayerProvider playerProvider, IMessageBus messageBus, RavenfallGameClientConnection client) { this.logger = logger; this.kernel = kernel; this.server = server; this.playerProvider = playerProvider; this.messageBus = messageBus; messageBus.Subscribe <ROBot.Core.Twitch.TwitchUserJoined>(nameof(TwitchUserJoined), OnUserJoined); messageBus.Subscribe <ROBot.Core.Twitch.TwitchUserLeft>(nameof(TwitchUserLeft), OnUserLeft); messageBus.Subscribe <ROBot.Core.Twitch.TwitchCheer>(nameof(TwitchCheer), OnUserCheer); messageBus.Subscribe <ROBot.Core.Twitch.TwitchSubscription>(nameof(TwitchSubscription), OnUserSub); this.client = client; this.client.Connected += Client_Connected; this.client.Disconnected += Client_Disconnected; this.client.Subscribe("session_owner", RegisterSessionOwner); this.client.Subscribe("pong", PongReceived); this.client.Subscribe("join_failed", SendResponseToTwitchChat); this.client.Subscribe("join_success", SendResponseToTwitchChat); this.client.Subscribe("arena_join_success", SendResponseToTwitchChat); this.client.Subscribe("arena_join_failed", SendResponseToTwitchChat); this.client.Subscribe("raid_join_success", SendResponseToTwitchChat); this.client.Subscribe("raid_join_failed", SendResponseToTwitchChat); this.client.Subscribe("raid_start", SendResponseToTwitchChat); this.client.Subscribe("player_stats", SendResponseToTwitchChat); this.client.Subscribe("player_resources", SendResponseToTwitchChat); this.client.Subscribe("highest_skill", SendResponseToTwitchChat); this.client.Subscribe("kick_success", SendResponseToTwitchChat); this.client.Subscribe("kick_failed", SendResponseToTwitchChat); this.client.Subscribe("craft_success", SendResponseToTwitchChat); this.client.Subscribe("craft_failed", SendResponseToTwitchChat); this.client.Subscribe("duel_failed", SendResponseToTwitchChat); this.client.Subscribe("duel_alert", SendResponseToTwitchChat); this.client.Subscribe("duel_accept", SendResponseToTwitchChat); this.client.Subscribe("duel_declined", SendResponseToTwitchChat); this.client.Subscribe("duel_result", SendResponseToTwitchChat); this.client.Subscribe("item_pickup", SendResponseToTwitchChat); this.client.Subscribe("item_trade_result", SendResponseToTwitchChat); this.client.Subscribe("ferry_enter_failed", SendResponseToTwitchChat); this.client.Subscribe("ferry_leave_failed", SendResponseToTwitchChat); this.client.Subscribe("ferry_travel_failed", SendResponseToTwitchChat); this.client.Subscribe("train_failed", SendResponseToTwitchChat); this.client.Subscribe("ferry_success", SendResponseToTwitchChat); this.client.Subscribe("train_info", SendResponseToTwitchChat); this.client.Subscribe("island_info", SendResponseToTwitchChat); this.client.Subscribe("message", SendResponseToTwitchChat); }
public Subscription(RavenfallGameClientConnection client, string identifier, Action <IGameSessionCommand> onCommand) { this.client = client; this.Identifier = identifier; this.onCommand = onCommand; }