• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

TFS 1.X+ TFS 1.4.2 Otcv8 opcode

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,279
Solutions
68
Reaction score
919
I am sending a packet with otcv8 to the server and getting info back. The packet itself is working as intended but in otcv8 I am getting and error. The error is causing other problems. Does anyone know how to fix it?

Code:
ERROR: ProtocolGame parse message exception (9141 bytes, 5546 unread, last opcode is 0x01 (1), prev opcode is 0x00 (0)): unhandled opcode 1

Inside otcv8 the code is
Lua:
ProtocolGame.registerExtendedOpcode(55, onRecvSkillsOpcode)

ProtocolGame.unregisterExtendedOpcode(55)

function onRecvSkillsOpcode(protocol, opcode, buffer)
    local player = g_game.getLocalPlayer()
    if not player then return end
 
    local buffer = unserialize(buffer)
    for skillType, skillInfo in ipairs(buffer.skills) do
        onSkillChange(player, skillType, tonumber(skillInfo.level), tonumber(skillInfo.percent))
        onBaseSkillChange(player, skillType, tonumber(skillInfo.base))
    end
    return true
end

There isn't any error or problem with the code itself. Otcv8 is just saying that error but everything is working other than the problems that are being caused from otclient not reading the info correct or whatever it is doing that is making it show an error. Whenever an item is changed its not shown in-game until I get the item out of the screen window, also whenever I add skill tries to my player the skills go crazy with their numbers.

TFS
Lua:
local CE_SendSkills = CreatureEvent("CE_SendSkills")
function CE_SendSkills.onExtendedOpcode(player, opcode, buffer)
    if opcode == 201 then
        local packet = NetworkMessage()
        packet:addByte(0x32) -- Extended Opcode (0x32 = 50 (in dec))
        packet:addByte(0x37) -- The Opcode of this Request (0x37 = 55 (in dec))
      
        local buffer = {}
        buffer.skills = {}
      
        for i = SKILL_STRENGTH, SKILL_ENCHANTING do
            buffer.skills[i] = {stuffhere}
        end
      
        packet:addString(serialize(buffer))
        packet:sendToPlayer(player)
    end
    return true
end
CE_SendSkills:register()

I just noticed the error used to say the opcode was 201 that had a problem. Now its saying its 0x00..... No freaking clue what is going on lmao
 
Last edited:
Solution
Using otcv8-tfs code was your first mistake.
The fault seems to be on server side so protocolgame.cpp is what you should look into. Also chceck if you don't have any game features enabled that require packets modification on the server side.
Read again dude. I am not using otcv8-tfs. I am looking through it to see if there is anything in there that might be related to a fix.

I am using TFS 1.4.2 and ive updated it pretty much with all changes for 1.5.

I have gone through protocolgame and network message multiple times. The only new info I have for this is, it also happens on mehah otclient and I will assume normal otclient.

I am 98% sure it has to do with enabling extended opcode. So, I am looking at the differences in what...

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,202
Solutions
27
Reaction score
669
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
I think I have a similar issue, having this log from a player
Code:
ERROR: ProtocolGame parse message exception (11 bytes, 2 unread, last opcode is 239, prev opcode is -1): unhandled opcode 239

and this on the client i'm using
Code:
ERROR: ProtocolGame parse message exception (2818 bytes, 310 unread, last opcode is 0xaa (170), prev opcode is 0x83 (131)): unknown message mode 46
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 860)
 
OP
OP
Itutorial

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,279
Solutions
68
Reaction score
919
Yeah its really weird. There is something going on when login happens with otcv8. I have been going through otcv8-tfs distro looking for a fix.

I am pretty sure it has to do with having extendedopcode enabled, and sending any new opcodes when you aren't using otcv8-tfs.
 

oen432

Legendary OT User
Joined
Oct 3, 2014
Messages
1,644
Solutions
54
Reaction score
1,774
Location
Poland
GitHub
Oen44
Yeah its really weird. There is something going on when login happens with otcv8. I have been going through otcv8-tfs distro looking for a fix.

I am pretty sure it has to do with having extendedopcode enabled, and sending any new opcodes when you aren't using otcv8-tfs.
Using otcv8-tfs code was your first mistake.
The fault seems to be on server side so protocolgame.cpp is what you should look into. Also chceck if you don't have any game features enabled that require packets modification on the server side.
 
OP
OP
Itutorial

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,279
Solutions
68
Reaction score
919
Using otcv8-tfs code was your first mistake.
The fault seems to be on server side so protocolgame.cpp is what you should look into. Also chceck if you don't have any game features enabled that require packets modification on the server side.
Read again dude. I am not using otcv8-tfs. I am looking through it to see if there is anything in there that might be related to a fix.

I am using TFS 1.4.2 and ive updated it pretty much with all changes for 1.5.

I have gone through protocolgame and network message multiple times. The only new info I have for this is, it also happens on mehah otclient and I will assume normal otclient.

I am 98% sure it has to do with enabling extended opcode. So, I am looking at the differences in what would be sent that would cause an error on otclient side. Without extended opcode enabled the error doesn't happen on any otclient.
Post automatically merged:

Update:

So, im not sure exactly what the problem is but I know its linked to opcodes and what I was doing for skills. I changed over to mehah and added the skills, ect. into the actual source code and everything is working correctly again. No error nothing. I will assume my issue was the skills had to be included in the source code.
 
Last edited:
Solution

oen432

Legendary OT User
Joined
Oct 3, 2014
Messages
1,644
Solutions
54
Reaction score
1,774
Location
Poland
GitHub
Oen44
So, im not sure exactly what the problem is but I know its linked to opcodes and what I was doing for skills. I changed over to mehah and added the skills, ect. into the actual source code and everything is working correctly again. No error nothing. I will assume my issue was the skills had to be included in the source code.
OTCv8 supports additional skills. You just have to move skills opcode to Lua.
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,202
Solutions
27
Reaction score
669
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
OTCv8 supports additional skills. You just have to move skills opcode to Lua.

I did the otcv8-tfs commit merge, I have to turn back the changes? Or simply add a .lua file that recognize theese op-codes?
In case that there's a .lua file missing, there's a chance that you could post it so I can try a possible solution? Thanks in advance!
 

oen432

Legendary OT User
Joined
Oct 3, 2014
Messages
1,644
Solutions
54
Reaction score
1,774
Location
Poland
GitHub
Oen44
I did the otcv8-tfs commit merge, I have to turn back the changes? Or simply add a .lua file that recognize theese op-codes?
In case that there's a .lua file missing, there's a chance that you could post it so I can try a possible solution? Thanks in advance!
For skills? Its a custom code, not part of v8. You have to edit server side to change skills opcode id, then register that opcode in your module and read it properly.
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,202
Solutions
27
Reaction score
669
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
For skills? Its a custom code, not part of v8.
Can't say specifically what i'm looking for, all I can provide is this .log file with packets. In case u don't really know what could be the issue, it's ok I understand it, because this is really weird... by the way, this started to happen as soon I updated otcv8 bot module to the latest version of vithrax bot.

I'm trying another modified bot with a friend, it seems it solves the issue. But not sure yet, still need to test a little bit more.

PS: @Itutorial sorry for spamming your thread btw, ^^
 

Attachments

Top