mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-12-25 19:19:02 -06:00
Fixed rpc not working on linux
This commit is contained in:
parent
8c62f321a0
commit
54f4b0b890
@ -1,5 +1,23 @@
|
||||
local ffi = require "ffi"
|
||||
local discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc")
|
||||
|
||||
|
||||
-- Get the host os to load correct lib
|
||||
local os = love.system.getOS()
|
||||
local discordRPClib = nil
|
||||
|
||||
|
||||
if os == 'Linux' then
|
||||
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.so")
|
||||
elseif os == 'OS X' then
|
||||
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.dylib")
|
||||
elseif os == 'Windows' then
|
||||
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.dll")
|
||||
else
|
||||
-- Else it crashes later on
|
||||
discordRPClib = ffi.load(love.filesystem.getSource().."/libs/discord-rpc.e")
|
||||
print('Discord rpc not supported on platform')
|
||||
end
|
||||
|
||||
|
||||
ffi.cdef[[
|
||||
typedef struct DiscordRichPresence {
|
||||
|
Loading…
Reference in New Issue
Block a user