Hello, I have a problem.
How can I send a signal from OTClient to TFS that this is my OTClient?
I added code to a module:
Everything sends correctly and works fine, but unfortunately it’s a bit too late — after logging in, I receive the first packets from the server, and only after that does it send the information that I’m using my OTClient.
Does anyone know how I can achieve this?
How can I send a signal from OTClient to TFS that this is my OTClient?
I added code to a module:
LUA:
MyClientId = {}
local OPCODE_MYCLIENT = 50
local PAYLOAD = "MYCLIENT"
local function sendHello()
if not g_game.isOnline() then
g_logger.info("[game_myclientid] not online")
return
end
local proto = g_game.getProtocolGame()
if not proto then
g_logger.error("[game_myclientid] no protocol")
return
end
g_logger.info("[game_myclientid] sending extended opcode " .. OPCODE_MYCLIENT)
proto:sendExtendedOpcode(OPCODE_MYCLIENT, PAYLOAD)
end
function init()
g_logger.info("[game_myclientid] INIT")
connect(g_game, {
onGameStart = function()
g_logger.info("[game_myclientid] onGameStart")
addEvent(sendHello, 200)
end
})
end
function terminate()
g_logger.info("[game_myclientid] TERMINATE")
MyClientId = nil
end
Everything sends correctly and works fine, but unfortunately it’s a bit too late — after logging in, I receive the first packets from the server, and only after that does it send the information that I’m using my OTClient.
Does anyone know how I can achieve this?