• 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!

Unhandled opcode

Yalasari

Active Member
Joined
Jul 16, 2017
Messages
82
Solutions
8
Reaction score
46
Hello,

I need help with OTClient error "unhandled opcode". I created function in tfs which sends to client info about auto-looted item, everything seems to work fine on server side, but how to read it properly and print? I tried various scripts found on forum but nothing worked.

35721

Any tips would be helpful
 
Solution
Great job so far!


So right now you have to
a) Create some variable, where you will store itemId;
b) Bind it to some already existing class (or create a new one if you need);
c) Go to luafunctions.cpp and add singleton function OR bind class member function that will return your itemid.

I am unsure what you're trying to achieve so it's hard to tell the exact solution.
Can you show us your opcode 52 handling on the client-side?
It seems like it's not handled at all, and should be done via sources (in ProtocolGame if I remember correctly).
 
Well, this is pure otclient from GitHub with minor changes that doesn't relates to my problem. So yeah, i tried some things but all ended with compilation error or doesn't worked at all.
 
If you're interested in learning that, I would try to find
Code:
case Proto::GameServerVipAdd:
        parseVipAdd(msg);
        break;
protocolgameparse.cpp file, follow where parseVipAdd leads, then try to add analogic functions/cases that suits your opcode 52 (from server-side). Right now we know little-to-none what you're trying exactly to achieve, but parseVipAdd might be an easy example of how it should be handled.
 
Well, now i did something like this and looks like everything is working fine:
C++:
int ProtocolGame::getAutoLootItemInfo(const InputMessagePtr& msg)
{
    uint32 itemid = msg->getU32();

    return itemid;
}
(ofc with other things like case, declaration in .h...)

And now - how i can read opcode value using lua?
 
Great job so far!


So right now you have to
a) Create some variable, where you will store itemId;
b) Bind it to some already existing class (or create a new one if you need);
c) Go to luafunctions.cpp and add singleton function OR bind class member function that will return your itemid.

I am unsure what you're trying to achieve so it's hard to tell the exact solution.
 
Solution
Unfortunately i hit a wall once again:

Problem is I added this line in luafunctions.cpp:
C++:
g_lua.bindClassMemberFunction<ProtocolGame>("getAutoLootItemInfo", &ProtocolGame::getAutoLootItemInfo);

And i don't really know how to read opcode value using lua EVERY time client receives it.
 
Back
Top