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

Problem with extended opcodes

ianelli

Ramza
Joined
Mar 18, 2010
Messages
125
Reaction score
47
Location
Brazil
I can't send STRING from server to client... give "InputMessage eof reached" error...
Here's the string function i'm using on SERVER-side:

Code:
function NetworkMessage:addString(value)
        if not self:addU16(string.len(value)) then
            self:logDebug("String length is bigger than " .. U16 .. ".")
            return false
        end
        
        local strLen = string.len(value)
        for i=1,strLen do
            self.data[self.pos + i-1] = string.byte(value, i)
        end
        self.pos = self.pos + strLen
        self.size = self.size + strLen
        return true
    end

Does anybody know how to fix it? :S
 
Ianiele update the TFS sources patched from otclient team, in otclient repository look for tools folder!
 
Which server are you using?

What has the addString function to do with the opcode system?
Show how you use it in your code.
 
Tfs 0.3.6pl1!

Using like this (server-side):

Code:
function sendDogName(cid)
   local msg = NetworkMessage.create()
   local info = getDogInfoByID(cid)
   msg:addData("Test")
   doSendPlayerExtendedOpcode(cid, 103, msg:getBuffer()) 
return true
end
 
You just use:
doSendPlayerExtendedOpcode(cid, 103, "Test")
 
how much max letters ?

local text = "1111111111111111111112222222222222222222222222222333333333333333333"
doSendPlayerExtendedOpcode(cid, 103, text")
 
is possible obtain a list of the opcodes and wich is the function of each?
 
you have to add your own ..
now work:
opcode: 1 - select language
opcode: 2 - ping ?
 
Back
Top