Hi, im thinking if there is any better way of sending op codes. I will show u examples of my code. I would appreciate any advice and tips.
atm im doing something like this on server side:
On client side doing this way:
protocolGame:sendExtendedOpcode(15, json.encode(data))
In addition if im using for example action1 in few places. Some times im sending opcodes twice in one if statement for example im sendOpCode for action1 and action2. Im wondering if i should always force it to one ExtentedOpcode.
atm im doing something like this on server side:
Lua:
if json_data.action == "action1" then
-- some code
elseif json_data.action == "action2" then
-- some code
elseif json_data.action == "action3" then
-- some code
end
On client side doing this way:
Code:
local data = {
action = "action1",
taskId = taskId
}
In addition if im using for example action1 in few places. Some times im sending opcodes twice in one if statement for example im sendOpCode for action1 and action2. Im wondering if i should always force it to one ExtentedOpcode.