• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient problem with receive opcodes

Tibia Idle

Active Member
Joined
Nov 23, 2023
Messages
149
Reaction score
28
I can’t receive the opcode from the server in OTClient, please help. This is what my code looks like. In the OTClient console it of course displays “OPCODE MODULE START,” but the second message about receiving the opcode doesn’t appear.

on otclient:
LUA:
function init()
    print("OPCODE MODULE START")


    ProtocolGame.registerExtendedOpcode(90, opcoderead)
end


function opcoderead(protocol, opcode, buffer)

    print("opcode from server")

end

on tfs

Code:
function onSay(player, words, param)

        player:sendExtendedOpcode(90, "Test opcode")


    return true
end
Post automatically merged:

omg. fixed ;p
 
Last edited:
I can’t receive the opcode from the server in OTClient, please help. This is what my code looks like. In the OTClient console it of course displays “OPCODE MODULE START,” but the second message about receiving the opcode doesn’t appear.

on otclient:
LUA:
function init()
    print("OPCODE MODULE START")


    ProtocolGame.registerExtendedOpcode(90, opcoderead)
end


function opcoderead(protocol, opcode, buffer)

    print("opcode from server")

end

on tfs

Code:
function onSay(player, words, param)

        player:sendExtendedOpcode(90, "Test opcode")


    return true
end
Post automatically merged:

omg. fixed ;p
looks good to me
 
the problem is not solved. why my otcleint does not respond to the received opcode?
you mean you sending something to the server?

OtClient
g_game.sendExtendedOpcode(opcode, data)

and handling is in fuction
void ProtocolGame::parseExtendedOpcode(NetworkMessage& msg)
 
Last edited:
Did you add JSON support to the data/lib folder? And did you enable the opcodes via OTClient, specifically in data/modules/game_feature/feature.lua? If not, you need to add JSON support so that both opcodes work properly. Alternatively, you can use Kondra's OTC detection system, which also works well with JSON. Also, you didn't mention the version of your TFS and its mechanics.

If you don't have JSON, just download Oen's JSON library and add it to your server

OTCv8 detection
 
Back
Top