Extended Opcodes (Server Side)

BeniS

Intermediate OT User
Joined
Aug 8, 2009
Messages
1,850
Best answers
0
Reaction score
183
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:

ianelli

Ramza
Joined
Mar 18, 2010
Messages
123
Best answers
0
Reaction score
43
Location
Brazil
Thanks dude!
Was looking for that ! =D
 
Last edited:

Dunos

New Member
Joined
Oct 28, 2012
Messages
22
Best answers
0
Reaction score
0
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...
 

ianelli

Ramza
Joined
Mar 18, 2010
Messages
123
Best answers
0
Reaction score
43
Location
Brazil
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...
 

Dunos

New Member
Joined
Oct 28, 2012
Messages
22
Best answers
0
Reaction score
0
sending from the server to the client only works, for something of this function is isPlayerUsingOtclient(cid)
 

Ksisio

New Member
Joined
Feb 21, 2008
Messages
54
Best answers
0
Reaction score
0
Location
Stalowa Wola
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);
 

CipsoftStinks

www.relicaria.com
Joined
Oct 1, 2016
Messages
906
Best answers
3
Reaction score
113
Location
Chile
where i should add theses? to my otserver source scripts? or otclient source?
 

Chriss Angel

Excellent OT User
Joined
Jun 7, 2008
Messages
38
Best answers
0
Reaction score
0
@BeniS is necessary to put all the codes in the current source?
Or have you already implemented them in the source code?
 
Top