README.md 1023 Bytes
Newer Older
zero's avatar
zero committed
1 2 3 4 5 6
## Discord RPC over HTTP

This is a simple utility that makes Rich Presence available over HTTP and handling leaving the game etc. 

If you are using Garry's Mod, you will need to modify the gmod_discordrpc Lua code slightly for this to work.

zero's avatar
zero committed
7 8 9 10
You can install this from here: [https://github.com/Tenrys/gmod_discordrpc](https://github.com/Tenrys/gmod_discordrpc)

If you are using another DiscordRPC library for Garry's Mod, you will have to take the code snippets below and apply it to your implementation.

zero's avatar
zero committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
In discordrpc.Init change the following from
```lua
    for port = 6463, 6473 do
```

To
```lua
    for port = 9000, 9000 do
```

At the end, change the following

```lua
function discordrpc.Shutdown()
	for pid, active in next, pids do
		if active then
			discordrpc.SetActivity(nil, function()
				pids[pid] = false
			end, pid) -- reset all of our rich presences
		end
	end
end
```

to

```lua
function discordrpc.Shutdown()
	
	http.Fetch(string.format("http://127.0.0.1:%s/shutdown", discordrpc.port))
	
end
```