aberos
New Member
- Joined
- Feb 26, 2014
- Messages
- 17
- Reaction score
- 0
I'm having to use opcode sending bytes, but is giving error .I'd whether and something that is missing in the function
error:
--[[ERROR: protected lua call failed: LUA ERROR:
/game_skills/skills.lua:77: attempt to index local 'msg' (a nil value)
stack traceback:
[C]: ?
/game_skills/skills.lua:77: in function </game_skills/skills.lua:76>
ERROR: protected lua call failed: LUA ERROR:
C++ call failed: InputMessage eof reached
stack traceback:
[C]: ?
[C]: in function 'getString'
/game_skills/skills.lua:77: in function 'callback'
/gamelib/protocolgame.lua:7: in function </gamelib/protocolgame.lua:4>
ERROR: protected lua call failed: LUA ERROR:
C++ call failed: InputMessage eof reached
stack traceback:
[C]: ?
[C]: in function 'getString'
/game_skills/skills.lua:77: in function 'callback'
/gamelib/protocolgame.lua:7: in function </gamelib/protocolgame.lua:
--]]
function server:
OPCODE_TESTE = 121
function testeCode(cid)
local msg = NetworkMessage.create()
msg:addString(getPlayerName(cid))
doSendPlayerExtendedOpcode(cid, OPCODE_TESTE, msg:getBuffer())
end
function otc:
ProtocolGame.registerOpcode(121, onTeste)
ProtocolGame.unregisterOpcode(121)
function onTeste(protocol, msg)
i = msg:getString()
print(i)
end
i'm using tfs 0.4
error:
--[[ERROR: protected lua call failed: LUA ERROR:
/game_skills/skills.lua:77: attempt to index local 'msg' (a nil value)
stack traceback:
[C]: ?
/game_skills/skills.lua:77: in function </game_skills/skills.lua:76>
ERROR: protected lua call failed: LUA ERROR:
C++ call failed: InputMessage eof reached
stack traceback:
[C]: ?
[C]: in function 'getString'
/game_skills/skills.lua:77: in function 'callback'
/gamelib/protocolgame.lua:7: in function </gamelib/protocolgame.lua:4>
ERROR: protected lua call failed: LUA ERROR:
C++ call failed: InputMessage eof reached
stack traceback:
[C]: ?
[C]: in function 'getString'
/game_skills/skills.lua:77: in function 'callback'
/gamelib/protocolgame.lua:7: in function </gamelib/protocolgame.lua:
--]]
function server:
OPCODE_TESTE = 121
function testeCode(cid)
local msg = NetworkMessage.create()
msg:addString(getPlayerName(cid))
doSendPlayerExtendedOpcode(cid, OPCODE_TESTE, msg:getBuffer())
end
function otc:
ProtocolGame.registerOpcode(121, onTeste)
ProtocolGame.unregisterOpcode(121)
function onTeste(protocol, msg)
i = msg:getString()
print(i)
end
i'm using tfs 0.4