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

Extended Opcodes (Server Side)

BeniS

Advanced OT User
Senator
Joined
Aug 8, 2009
Messages
1,850
Reaction score
189
Location
New Zealand
Extended opcodes is a system to allow adding new opcodes to game protocol using just lua scripts in both client and server sides, thus making easy to implement new client/server side features independently of the game cor made in C++. Just one opcode is supported at the moment, the 0x01 which is sent by the client informing the current player language. New opcodes will be added in the future, including opcodes for playing sounds and new interfaces.

protocolgame.h
-[Diff] protocolgame.h - Pastebin.com

protocolgame.cpp
-[Diff] protocolgame.cpp - Pastebin.com

const.h
-[Diff] const.h - Pastebin.com

luascript.h
-[Diff] luascript.h - Pastebin.com

luascript.cpp
-[Diff] luascript.cpp - Pastebin.com

player.h
-[Diff] player.h - Pastebin.com

creatureevent.h
-[Diff] creatureevent.h - Pastebin.com

creatureevent.cpp
-[Diff] creatureevent.cpp - Pastebin.com

game.h
-[Diff] game.h - Pastebin.com

game.cpp
-[Diff] game.cpp - Pastebin.com

/creaturescripts/creaturescrips.xml
-[Diff] creaturescripts.xml - Pastebin.com

/creaturescripts/extendedopcode.lua
-
LUA:
 extendedopcode.lua - Pastebin.com[/url]

Or the raw patch file here: [url]https://github.com/edubart/otclient/blob/master/tools/tfs_extendedopcode.patch[/url]

Haven't tested these exact edits, let me know if there are any issues.

Credits to edubart
 
Last edited:
I need to change client something? I like login through OtClient and test on serwer

if isPlayerUsingOtclient(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "YOU USE OTCLIENT")
end

no work...
 
Dunos, check on your sources if you've installed everything correctly, here worked :S
But i can't send STRING from server to client... give "InputMessage eof reached" error...
 
sending from the server to the client only works, for something of this function is isPlayerUsingOtclient(cid)
 
protocolgame.cpp
Code:
// process additional opcodes via lua script event
    addGameTask(&Game::parsePlayerExtendedOpcode, player->getId(), opcode, buffer);

It should be getID right?
Code:
// process additional opcodes via lua script event
    addGameTask(&Game::parsePlayerExtendedOpcode, player->getID(), opcode, buffer);
 
i have problem only with gameprotocol someone can help my last step?
 
Back
Top