Skip to content

Commit

Permalink
Merge pull request #4 from Trickyyy/develop
Browse files Browse the repository at this point in the history
Added missing lines in retry cooldown code
  • Loading branch information
Kirollos authored Sep 1, 2019
2 parents b963214 + bfeb79a commit 0b0ebe1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Oxide.Ext.Discord/WebSockets/SocketListner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void SocketClosed(object sender, CloseEventArgs e)
{
Interface.Oxide.LogWarning($"[Discord Ext] Discord connection closed uncleanly: code {e.Code}, Reason: {e.Reason}");

if(++retries >= 5)
if(retries >= 5)
{
Interface.Oxide.LogError("[Discord Ext] Exceeded number of retries... Attempting in 15 seconds.");
Timer reconnecttimer = new Timer() { Interval = 15000f, AutoReset = false };
Expand All @@ -73,7 +73,10 @@ public void SocketClosed(object sender, CloseEventArgs e)
Interface.Oxide.LogWarning($"[Discord Ext] Attempting to reconnect to Discord...");
webSocket.Connect(client.WSSURL);
};
reconnecttimer.Start();
return;
}
retries++;

Interface.Oxide.LogWarning($"[Discord Ext] Attempting to reconnect to Discord...");

Expand Down

0 comments on commit 0b0ebe1

Please sign in to comment.