Skip to content

Commit

Permalink
Merge pull request #53 from rusty595/master
Browse files Browse the repository at this point in the history
Update TwitchLib packages, add missing event overrides to PubSub and Client
  • Loading branch information
swiftyspiffy authored Jul 12, 2020
2 parents b453d3e + 2aceabf commit b9b6805
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
22 changes: 22 additions & 0 deletions TwitchLib.Unity/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,21 @@ public class Client : TwitchClient, ITwitchClient

/// <summary>Fires when data is received from Twitch that is not able to be parsed.</summary>
public new event EventHandler<OnUnaccountedForArgs> OnUnaccountedFor;

/// <summary>Fires when named event occurs.</summary>
public new event EventHandler<OnMessageClearedArgs> OnMessageCleared;
/// <summary>Fires when named event occurs.</summary>
public new event EventHandler<OnReconnectedEventArgs> OnReconnected;
/// <summary>Fires when named event occurs.</summary>
public new event EventHandler<OnWhisperThrottledEventArgs> OnWhisperThrottled;
/// <summary>Fires when named event occurs.</summary>
public new event EventHandler<OnMessageThrottledEventArgs> OnMessageThrottled;
/// <summary>Fires when named event occurs.</summary>
public new event EventHandler<OnCommunitySubscriptionArgs> OnCommunitySubscription;
/// <summary>Fires when named event occurs.</summary>
public new event EventHandler<OnErrorEventArgs> OnError;
/// <summary>Fires when named event occurs.</summary>
public new event EventHandler<OnVIPsReceivedArgs> OnVIPsReceived;
#endregion

public Client() : base(null)
Expand Down Expand Up @@ -264,6 +279,13 @@ public Client() : base(null)
base.OnUnaccountedFor += ((object sender, OnUnaccountedForArgs e) => { ThreadDispatcher.Enqueue(() => OnUnaccountedFor?.Invoke(sender, e)); });
base.OnSelfRaidError += ((object sender, EventArgs e) => { ThreadDispatcher.Enqueue(() => OnSelfRaidError?.Invoke(sender, e)); });
base.OnNoPermissionError += ((object sender, EventArgs e) => { ThreadDispatcher.Enqueue(() => OnNoPermissionError?.Invoke(sender, e)); });
base.OnMessageCleared += ((object sender, OnMessageClearedArgs e) => { ThreadDispatcher.Enqueue(() => OnMessageCleared?.Invoke(sender, e)); });
base.OnReconnected += ((object sender, OnReconnectedEventArgs e) => { ThreadDispatcher.Enqueue(() => OnReconnected?.Invoke(sender, e)); });
base.OnWhisperThrottled += ((object sender, OnWhisperThrottledEventArgs e) => { ThreadDispatcher.Enqueue(() => OnWhisperThrottled?.Invoke(sender, e)); });
base.OnMessageThrottled += ((object sender, OnMessageThrottledEventArgs e) => { ThreadDispatcher.Enqueue(() => OnMessageThrottled?.Invoke(sender, e)); });
base.OnCommunitySubscription += ((object sender, OnCommunitySubscriptionArgs e) => { ThreadDispatcher.Enqueue(() => OnCommunitySubscription?.Invoke(sender, e)); });
base.OnError += ((object sender, OnErrorEventArgs e) => { ThreadDispatcher.Enqueue(() => OnError?.Invoke(sender, e)); });
base.OnVIPsReceived += ((object sender, OnVIPsReceivedArgs e) => { ThreadDispatcher.Enqueue(() => OnVIPsReceived?.Invoke(sender, e)); });
}

private new void HandleNotInitialized()
Expand Down
42 changes: 42 additions & 0 deletions TwitchLib.Unity/PubSub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,34 @@ public class PubSub : TwitchPubSub, ITwitchPubSub
public new event EventHandler<OnWhisperArgs> OnWhisper;
/// <summary>EventHandler for channel subscriptions.</summary>
public new event EventHandler<OnChannelSubscriptionArgs> OnChannelSubscription;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnChannelCommerceReceivedArgs> OnChannelCommerceReceived;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnChannelExtensionBroadcastArgs> OnChannelExtensionBroadcast;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnFollowArgs> OnFollow;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnCustomRewardCreatedArgs> OnCustomRewardCreated;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnCustomRewardUpdatedArgs> OnCustomRewardUpdated;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnCustomRewardDeletedArgs> OnCustomRewardDeleted;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnRewardRedeemedArgs> OnRewardRedeemed;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnLeaderboardEventArgs> OnLeaderboardSubs;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnLeaderboardEventArgs> OnLeaderboardBits;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnRaidUpdateArgs> OnRaidUpdate;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnRaidUpdateV2Args> OnRaidUpdateV2;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnRaidGoArgs> OnRaidGo;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnMessageDeletedArgs> OnMessageDeleted;
/// <summary>EventHandler for named event.</summary>
public new event EventHandler<OnLogArgs> OnLog;
#endregion

public PubSub(EndPoint proxy = null) : base(null)
Expand Down Expand Up @@ -82,6 +110,20 @@ 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)); });
base.OnCustomRewardUpdated += ((object sender, OnCustomRewardUpdatedArgs e) => { ThreadDispatcher.Enqueue(() => OnCustomRewardUpdated?.Invoke(sender, e)); });
base.OnCustomRewardDeleted += ((object sender, OnCustomRewardDeletedArgs e) => { ThreadDispatcher.Enqueue(() => OnCustomRewardDeleted?.Invoke(sender, e)); });
base.OnRewardRedeemed += ((object sender, OnRewardRedeemedArgs e) => { ThreadDispatcher.Enqueue(() => OnRewardRedeemed?.Invoke(sender, e)); });
base.OnLeaderboardSubs += ((object sender, OnLeaderboardEventArgs e) => { ThreadDispatcher.Enqueue(() => OnLeaderboardSubs?.Invoke(sender, e)); });
base.OnLeaderboardBits += ((object sender, OnLeaderboardEventArgs e) => { ThreadDispatcher.Enqueue(() => OnLeaderboardBits?.Invoke(sender, e)); });
base.OnRaidUpdate += ((object sender, OnRaidUpdateArgs e) => { ThreadDispatcher.Enqueue(() => OnRaidUpdate?.Invoke(sender, e)); });
base.OnRaidUpdateV2 += ((object sender, OnRaidUpdateV2Args e) => { ThreadDispatcher.Enqueue(() => OnRaidUpdateV2?.Invoke(sender, e)); });
base.OnRaidGo += ((object sender, OnRaidGoArgs e) => { ThreadDispatcher.Enqueue(() => OnRaidGo?.Invoke(sender, e)); });
base.OnMessageDeleted += ((object sender, OnMessageDeletedArgs e) => { ThreadDispatcher.Enqueue(() => OnMessageDeleted?.Invoke(sender, e)); });
base.OnLog += ((object sender, OnLogArgs e) => { ThreadDispatcher.Enqueue(() => OnLog?.Invoke(sender, e)); });
}
}
}
6 changes: 3 additions & 3 deletions TwitchLib.Unity/TwitchLib.Unity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@

<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="TwitchLib.Api" Version="3.1.2" />
<PackageReference Include="TwitchLib.Client" Version="3.1.4" />
<PackageReference Include="TwitchLib.PubSub" Version="3.1.3" />
<PackageReference Include="TwitchLib.Api" Version="3.1.3" />
<PackageReference Include="TwitchLib.Client" Version="3.1.5" />
<PackageReference Include="TwitchLib.PubSub" Version="3.1.4" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit b9b6805

Please sign in to comment.