FreeKill/lua/client/client.lua

22 lines
592 B
Lua
Raw Normal View History

local Client = class('Client')
freekill.client_callback = {}
function Client:initialize()
self.client = freekill.ClientInstance
self.notifyUI = function(self, command, json_data)
freekill.Backend:emitNotifyUI(command, json_data)
end
self.client.callback = function(_self, command, json_data)
local cb = freekill.client_callback[command]
if (type(cb) == "function") then
cb(json_data)
else
2022-03-01 09:40:02 +00:00
self:notifyUI(command, json_data);
end
end
end
-- Create ClientInstance (used by Lua)
ClientInstance = Client:new()