diff --git a/Matterbridge.csproj b/Matterbridge.csproj index 2fb81bd..fca7eb1 100644 --- a/Matterbridge.csproj +++ b/Matterbridge.csproj @@ -31,10 +31,17 @@ False --> + + $(VINTAGE_STORY)/Lib/Newtonsoft.Json.dll + False + + + $(VINTAGE_STORY)/Lib/websocket-sharp.dll + False + - diff --git a/modinfo.json b/modinfo.json index 4addbe6..da00fa9 100644 --- a/modinfo.json +++ b/modinfo.json @@ -5,7 +5,7 @@ "version": "$Version$", "description" : "$Description$", - "website": "https://github.com/NikkyAI/vs-matterbridge", + "website": "$Website$", "authors": [ "$Author$" ], "side": "Server", diff --git a/src/MatterbridgeMod.cs b/src/MatterbridgeMod.cs index 78f93bd..4d06027 100644 --- a/src/MatterbridgeMod.cs +++ b/src/MatterbridgeMod.cs @@ -95,7 +95,7 @@ public override void StartServerSide(ICoreServerAPI api) public override void Dispose() { - WebsocketHandler.Close(); + WebsocketHandler.Dispose(); base.Dispose(); } diff --git a/src/WebsocketHandler.cs b/src/WebsocketHandler.cs index 2be65c5..00f91ac 100644 --- a/src/WebsocketHandler.cs +++ b/src/WebsocketHandler.cs @@ -11,7 +11,7 @@ namespace Matterbridge { - internal class WebsocketHandler + internal class WebsocketHandler : IDisposable { private readonly ICoreServerAPI _api; private readonly Mod _mod; @@ -236,5 +236,14 @@ private void websocket_MessageReceived(object sender, MessageReceivedEventArgs e } } } + + public void Dispose() + { + if (_websocket != null) + { + _websocket.Close(); + ((IDisposable) _websocket).Dispose(); + } + } } } \ No newline at end of file