diff --git a/.gitignore b/.gitignore index 89ad0e0..0c9c343 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ # Files used to weave for NuGet TwitchLib/FodyWeavers.xml TwitchLib/packages.config +TwitchLib.Unity/FodyWeavers.xml +TwitchLib.Unity/FodyWeavers.xsd # User-specific files *.suo diff --git a/TwitchLib.Unity/Client.cs b/TwitchLib.Unity/Client.cs index 7074f8c..7f26ad4 100644 --- a/TwitchLib.Unity/Client.cs +++ b/TwitchLib.Unity/Client.cs @@ -11,8 +11,6 @@ namespace TwitchLib.Unity { public class Client : TwitchClient, ITwitchClient { - public new bool OverrideBeingHostedCheck { get; set; } - #region Events /// /// Fires whenever a log write happens. @@ -109,11 +107,6 @@ public class Client : TwitchClient, ITwitchClient /// public new event EventHandler OnContinuedGiftedSubscription; - /// - /// Fires when a hosted streamer goes offline and hosting is killed. - /// - public new event EventHandler OnHostLeft; - /// /// Fires when Twitch notifies client of existing users in chat. /// @@ -124,16 +117,6 @@ public class Client : TwitchClient, ITwitchClient /// public new event EventHandler OnUserLeft; - /// - /// Fires when the joined channel begins hosting another channel. - /// - public new event EventHandler OnHostingStarted; - - /// - /// Fires when the joined channel quits hosting another channel. - /// - public new event EventHandler OnHostingStopped; - /// /// Fires when bot has disconnected. /// @@ -179,16 +162,6 @@ public class Client : TwitchClient, ITwitchClient /// public new event EventHandler OnSendReceiveData; - /// - /// Fires when client receives notice that a joined channel is hosting another channel. - /// - public new event EventHandler OnNowHosting; - - /// - /// Fires when the library detects another channel has started hosting the broadcaster's stream. MUST BE CONNECTED AS BROADCASTER. - /// - public new event EventHandler OnBeingHosted; - /// /// Fires when a raid notification is detected in chat /// @@ -208,9 +181,6 @@ public class Client : TwitchClient, ITwitchClient /// Fires when newly raided channel is mature audience only. public new event EventHandler OnRaidedChannelIsMatureAudience; - /// Fires when a ritual for a new chatter is received. - public new event EventHandler OnRitualNewChatter; - /// Fires when the client was unable to join a channel. public new event EventHandler OnFailureToReceiveJoinConfirmation; @@ -237,18 +207,12 @@ public Client() : base(null) { ThreadDispatcher.EnsureCreated(); - base.OverrideBeingHostedCheck = true; - base.OnLog += (object sender, OnLogArgs e) => { ThreadDispatcher.Enqueue(() => OnLog?.Invoke(sender, e)); }; base.OnConnected += ((object sender, OnConnectedArgs e) => { ThreadDispatcher.Enqueue(() => OnConnected?.Invoke(sender, e)); }); base.OnJoinedChannel += ((object sender, OnJoinedChannelArgs e) => { ThreadDispatcher.Enqueue(() => OnJoinedChannel?.Invoke(sender, e)); - - if (OnBeingHosted == null) return; - if (e.Channel.ToLower() != TwitchUsername && !OverrideBeingHostedCheck) - ThreadDispatcher.Enqueue(() => throw new BadListenException("BeingHosted", "You cannot listen to OnBeingHosted unless you are connected to the broadcaster's channel as the broadcaster. You may override this by setting the TwitchClient property OverrideBeingHostedCheck to true.")); }); base.OnIncorrectLogin += ((object sender, OnIncorrectLoginArgs e) => { ThreadDispatcher.Enqueue(() => OnIncorrectLogin?.Invoke(sender, e)); }); @@ -267,11 +231,8 @@ public Client() : base(null) base.OnReSubscriber += ((object sender, OnReSubscriberArgs e) => { ThreadDispatcher.Enqueue(() => OnReSubscriber?.Invoke(sender, e)); }); base.OnPrimePaidSubscriber += ((object sender, OnPrimePaidSubscriberArgs e) => { ThreadDispatcher.Enqueue(() => OnPrimePaidSubscriber?.Invoke(sender, e)); }); base.OnContinuedGiftedSubscription += ((object sender, OnContinuedGiftedSubscriptionArgs e) => { ThreadDispatcher.Enqueue(() => OnContinuedGiftedSubscription?.Invoke(sender, e)); }); - base.OnHostLeft += ((object sender, EventArgs arg) => { ThreadDispatcher.Enqueue(() => OnHostLeft?.Invoke(sender, arg)); }); base.OnExistingUsersDetected += ((object sender, OnExistingUsersDetectedArgs e) => { ThreadDispatcher.Enqueue(() => OnExistingUsersDetected?.Invoke(sender, e)); }); base.OnUserLeft += ((object sender, OnUserLeftArgs e) => { ThreadDispatcher.Enqueue(() => OnUserLeft?.Invoke(sender, e)); }); - base.OnHostingStarted += ((object sender, OnHostingStartedArgs e) => { ThreadDispatcher.Enqueue(() => OnHostingStarted?.Invoke(sender, e)); }); - base.OnHostingStopped += ((object sender, OnHostingStoppedArgs e) => { ThreadDispatcher.Enqueue(() => OnHostingStopped?.Invoke(sender, e)); }); base.OnDisconnected += ((object sender, OnDisconnectedEventArgs e) => { ThreadDispatcher.Enqueue(() => OnDisconnected?.Invoke(sender, e)); }); base.OnConnectionError += ((object sender, OnConnectionErrorArgs e) => { ThreadDispatcher.Enqueue(() => OnConnectionError?.Invoke(sender, e)); }); base.OnChatCleared += ((object sender, OnChatClearedArgs e) => { ThreadDispatcher.Enqueue(() => OnChatCleared?.Invoke(sender, e)); }); @@ -281,12 +242,9 @@ public Client() : base(null) base.OnModeratorsReceived += ((object sender, OnModeratorsReceivedArgs e) => { ThreadDispatcher.Enqueue(() => OnModeratorsReceived?.Invoke(sender, e)); }); base.OnChatColorChanged += ((object sender, OnChatColorChangedArgs e) => { ThreadDispatcher.Enqueue(() => OnChatColorChanged?.Invoke(sender, e)); }); base.OnSendReceiveData += ((object sender, OnSendReceiveDataArgs e) => { ThreadDispatcher.Enqueue(() => OnSendReceiveData?.Invoke(sender, e)); }); - base.OnNowHosting += ((object sender, OnNowHostingArgs e) => { ThreadDispatcher.Enqueue(() => OnNowHosting?.Invoke(sender, e)); }); - base.OnBeingHosted += ((object sender, OnBeingHostedArgs e) => { ThreadDispatcher.Enqueue(() => OnBeingHosted?.Invoke(sender, e)); }); base.OnRaidNotification += ((object sender, OnRaidNotificationArgs e) => { ThreadDispatcher.Enqueue(() => OnRaidNotification?.Invoke(sender, e)); }); base.OnGiftedSubscription += ((object sender, OnGiftedSubscriptionArgs e) => { ThreadDispatcher.Enqueue(() => OnGiftedSubscription?.Invoke(sender, e)); }); base.OnRaidedChannelIsMatureAudience += ((object sender, EventArgs arg) => { ThreadDispatcher.Enqueue(() => OnRaidedChannelIsMatureAudience?.Invoke(sender, arg)); }); - base.OnRitualNewChatter += ((object sender, OnRitualNewChatterArgs e) => { ThreadDispatcher.Enqueue(() => OnRitualNewChatter?.Invoke(sender, e)); }); base.OnFailureToReceiveJoinConfirmation += ((object sender, OnFailureToReceiveJoinConfirmationArgs e) => { ThreadDispatcher.Enqueue(() => OnFailureToReceiveJoinConfirmation?.Invoke(sender, e)); }); base.OnUnaccountedFor += ((object sender, OnUnaccountedForArgs e) => { ThreadDispatcher.Enqueue(() => OnUnaccountedFor?.Invoke(sender, e)); }); base.OnSelfRaidError += ((object sender, EventArgs e) => { ThreadDispatcher.Enqueue(() => OnSelfRaidError?.Invoke(sender, e)); }); diff --git a/TwitchLib.Unity/PubSub.cs b/TwitchLib.Unity/PubSub.cs index fd16afd..616d07e 100644 --- a/TwitchLib.Unity/PubSub.cs +++ b/TwitchLib.Unity/PubSub.cs @@ -55,8 +55,6 @@ public class PubSub : TwitchPubSub, ITwitchPubSub /// EventHandler for channel subscriptions. public new event EventHandler OnChannelSubscription; /// EventHandler for named event. - public new event EventHandler OnChannelCommerceReceived; - /// EventHandler for named event. public new event EventHandler OnChannelExtensionBroadcast; /// EventHandler for named event. public new event EventHandler OnFollow; @@ -122,7 +120,6 @@ public PubSub(EndPoint proxy = null) : base(null) base.OnViewCount += ((object sender, OnViewCountArgs e) => { ThreadDispatcher.Enqueue(() => OnViewCount?.Invoke(sender, e)); }); base.OnWhisper += ((object sender, OnWhisperArgs e) => { ThreadDispatcher.Enqueue(() => OnWhisper?.Invoke(sender, e)); }); base.OnChannelSubscription += ((object sender, OnChannelSubscriptionArgs e) => { ThreadDispatcher.Enqueue(() => OnChannelSubscription?.Invoke(sender, e)); }); - base.OnChannelCommerceReceived += ((object sender, OnChannelCommerceReceivedArgs e) => { ThreadDispatcher.Enqueue(() => OnChannelCommerceReceived?.Invoke(sender, e)); }); base.OnChannelExtensionBroadcast += ((object sender, OnChannelExtensionBroadcastArgs e) => { ThreadDispatcher.Enqueue(() => OnChannelExtensionBroadcast?.Invoke(sender, e)); }); base.OnFollow += ((object sender, OnFollowArgs e) => { ThreadDispatcher.Enqueue(() => OnFollow?.Invoke(sender, e)); }); base.OnCustomRewardCreated += ((object sender, OnCustomRewardCreatedArgs e) => { ThreadDispatcher.Enqueue(() => OnCustomRewardCreated?.Invoke(sender, e)); }); diff --git a/TwitchLib.Unity/TwitchLib.Unity.csproj b/TwitchLib.Unity/TwitchLib.Unity.csproj index 9c341f7..f340906 100644 --- a/TwitchLib.Unity/TwitchLib.Unity.csproj +++ b/TwitchLib.Unity/TwitchLib.Unity.csproj @@ -12,7 +12,7 @@ https://github.com/TwitchLib/TwitchLib.Unity https://opensource.org/licenses/MIT Copyright 2021 - Version bumps for Unity to match latest dev branch of TwitchLib. + Updates to packages and removed outdated code https://github.com/TwitchLib/TwitchLib.Unity Git twitch library unity3d unity dotnet c# csharp net standard 2.0 @@ -42,14 +42,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + +