Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Assemblies/ILMerge.exe
Binary file not shown.
4 changes: 0 additions & 4 deletions TwitchLib.Unity/Api.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using TwitchLib.Api;
using TwitchLib.Api.Interfaces;
using TwitchLib.Api.Sections;
using UnityEngine;

namespace TwitchLib.Unity
Expand Down
2 changes: 2 additions & 0 deletions TwitchLib.Unity/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ public Client() : base(null)
base.OnRitualNewChatter += ((object sender, OnRitualNewChatterArgs e) => { ThreadDispatcher.Instance().Enqueue(() => OnRitualNewChatter?.Invoke(sender, e)); });
base.OnFailureToReceiveJoinConfirmation += ((object sender, OnFailureToReceiveJoinConfirmationArgs e) => { ThreadDispatcher.Instance().Enqueue(() => OnFailureToReceiveJoinConfirmation?.Invoke(sender, e)); });
base.OnUnaccountedFor += ((object sender, OnUnaccountedForArgs e) => { ThreadDispatcher.Instance().Enqueue(() => OnUnaccountedFor?.Invoke(sender, e)); });
base.OnSelfRaidError += ((object sender, EventArgs e) => { ThreadDispatcher.Instance().Enqueue(() => OnSelfRaidError?.Invoke(sender, e)); });
base.OnNoPermissionError += ((object sender, EventArgs e) => { ThreadDispatcher.Instance().Enqueue(() => OnNoPermissionError?.Invoke(sender, e)); });
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions TwitchLib.Unity/ColorExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TwitchLib.Unity
{
public static class ColorExtension
{
public static UnityEngine.Color ToUnity(this System.Drawing.Color color)
{
return new UnityEngine.Color(color.R, color.G, color.B, color.A);
}
}

}
3 changes: 0 additions & 3 deletions TwitchLib.Unity/ThreadDispatcher.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

namespace TwitchLib.Unity
Expand Down
2 changes: 1 addition & 1 deletion TwitchLib.Unity/TwitchLib.Unity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
</Reference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="del $(OutDir)*.pdb&#xD;&#xA;..\packages\ILMerge.2.14.1208\tools\ilmerge /out:$(OutDir)TwitchLib.Unity.dll $(OutDir)TwitchLib.Unity.dll $(OutDir)Microsoft.Extensions.Logging.Abstractions.dll $(OutDir)Newtonsoft.Json.dll $(OutDir)Serilog.dll $(OutDir)Serilog.Extensions.Logging.dll $(OutDir)SuperSocket.ClientEngine.dll $(OutDir)TwitchLib.Api.dll $(OutDir)TwitchLib.Client.dll $(OutDir)TwitchLib.PubSub.dll $(OutDir)WebSocket4Net.dll&#xD;&#xA;del $(OutDir)Microsoft.Extensions.Logging.Abstractions.dll &#xD;&#xA;del $(OutDir)Newtonsoft.Json.dll&#xD;&#xA;del $(OutDir)Serilog.dll &#xD;&#xA;del $(OutDir)Serilog.Extensions.Logging.dll &#xD;&#xA;del $(OutDir)SuperSocket.ClientEngine.dll &#xD;&#xA;del $(OutDir)TwitchLib.Api.dll &#xD;&#xA;del $(OutDir)TwitchLib.Client.dll &#xD;&#xA;del $(OutDir)TwitchLib.PubSub.dll &#xD;&#xA;del $(OutDir)WebSocket4Net.dll&#xD;&#xA;del $(OutDir)UnityEngine.*" />
<Exec Command="del $(OutDir)*.pdb&#xD;&#xA;..\Assemblies\ilmerge /out:$(OutDir)TwitchLib.Unity.dll $(OutDir)TwitchLib.Unity.dll $(OutDir)Microsoft.Extensions.Logging.Abstractions.dll $(OutDir)Newtonsoft.Json.dll $(OutDir)Serilog.dll $(OutDir)Serilog.Extensions.Logging.dll $(OutDir)SuperSocket.ClientEngine.dll $(OutDir)TwitchLib.Api.dll $(OutDir)TwitchLib.Client.dll $(OutDir)TwitchLib.PubSub.dll $(OutDir)WebSocket4Net.dll&#xD;&#xA;del $(OutDir)Microsoft.Extensions.Logging.Abstractions.dll &#xD;&#xA;del $(OutDir)Newtonsoft.Json.dll&#xD;&#xA;del $(OutDir)Serilog.dll &#xD;&#xA;del $(OutDir)Serilog.Extensions.Logging.dll &#xD;&#xA;del $(OutDir)SuperSocket.ClientEngine.dll &#xD;&#xA;del $(OutDir)TwitchLib.Api.dll &#xD;&#xA;del $(OutDir)TwitchLib.Client.dll &#xD;&#xA;del $(OutDir)TwitchLib.PubSub.dll &#xD;&#xA;del $(OutDir)WebSocket4Net.dll&#xD;&#xA;del $(OutDir)UnityEngine.*" />
</Target>
</Project>
12 changes: 5 additions & 7 deletions TwitchLib.Unity/UnityFollowerService.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
using System;
using System.Net;
using UnityEngine;
using TwitchLib.Api;
using TwitchLib.Api.Enums;
using TwitchLib.Api.Interfaces;
using TwitchLib.Api.Services;
using TwitchLib.Api.Services.Exceptions;
using TwitchLib.Api.Services.Events.FollowerService;

namespace TwitchLib.Unity {
public class UnityFollowerService : FollowerService {
namespace TwitchLib.Unity
{
public class UnityFollowerService : FollowerService
{
private readonly GameObject _threadDispatcher;

#region Events
Expand All @@ -22,7 +20,7 @@ public class UnityFollowerService : FollowerService {
#endregion

public UnityFollowerService(ITwitchAPI api, int checkIntervalSeconds = 60, int queryCount = 25) : base(api, checkIntervalSeconds, queryCount) {
_threadDispatcher = new GameObject("ThreadDispatcher");
_threadDispatcher = new GameObject("UnityFollowerServiceThreadDispatcher");
_threadDispatcher.AddComponent<ThreadDispatcher>();
UnityEngine.Object.DontDestroyOnLoad(_threadDispatcher);

Expand Down
14 changes: 6 additions & 8 deletions TwitchLib.Unity/UnityLiveStreamMonitor.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
using System;
using System.Net;
using UnityEngine;
using TwitchLib.Api;
using TwitchLib.Api.Enums;
using TwitchLib.Api.Interfaces;
using TwitchLib.Api.Services;
using TwitchLib.Api.Services.Exceptions;
using TwitchLib.Api.Services.Events.LiveStreamMonitor;

namespace TwitchLib.Unity {
public class UnityLiveStreamMonitor : LiveStreamMonitor {
namespace TwitchLib.Unity
{
public class UnityLiveStreamMonitor : LiveStreamMonitor
{
private readonly GameObject _threadDispatcher;

#region EVENTS
Expand All @@ -27,8 +25,8 @@ public class UnityLiveStreamMonitor : LiveStreamMonitor {
public new event EventHandler<OnStreamsSetArgs> OnStreamsSet;
#endregion

public UnityFollowerService(ITwitchAPI api, int checkIntervalSeconds = 60, bool checkStatusOnStart = true, bool invokeEventsOnStart = false) : base(api, checkIntervalSeconds, checkStatusOnStart, invokeEventsOnStart) {
_threadDispatcher = new GameObject("ThreadDispatcher");
public UnityLiveStreamMonitor(ITwitchAPI api, int checkIntervalSeconds = 60, bool checkStatusOnStart = true, bool invokeEventsOnStart = false) : base(api, checkIntervalSeconds, checkStatusOnStart, invokeEventsOnStart) {
_threadDispatcher = new GameObject("UnityLiveStreamMonitorThreadDispatcher");
_threadDispatcher.AddComponent<ThreadDispatcher>();
UnityEngine.Object.DontDestroyOnLoad(_threadDispatcher);

Expand Down