Skip to content
This repository has been archived by the owner on Jun 26, 2019. It is now read-only.

Commit

Permalink
forgot this
Browse files Browse the repository at this point in the history
  • Loading branch information
Tenrys committed Apr 17, 2018
1 parent 2a46145 commit 2202356
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/discordrpc/init.lua
Expand Up @@ -32,7 +32,7 @@ function discordrpc.Print(...)
print(unpack(args))
end

local function try(port)
local function try(port, callback)
if port > 6473 then discordrpc.Print("Error: couldn't find Discord RPC server.") return end

http.Fetch(("http://127.0.0.1:%s"):format(port), function(body)
Expand All @@ -57,13 +57,13 @@ local function try(port)
end)
end
end, function()
try(port + 1)
try(port + 1, callback)
end)
end
function discordrpc.Init(callback)
if not discordrpc.port then
discordrpc.Print("Finding port")
try(6463)
try(6463, callback)
end
end

Expand Down

0 comments on commit 2202356

Please sign in to comment.