08-21-2014, 12:50 AM
I think we should bring this question back.
Maybe we should allow Lua to send packets if we want to support mods. (No idea what mod but I'm sure some mods add new packets)
We could export the cPacketizer class. Then add a cClientHandle function called something like "SendPacket". With 2 parameters. The packet type and a callback function.
pseudo-code:
Thoughts??
Maybe we should allow Lua to send packets if we want to support mods. (No idea what mod but I'm sure some mods add new packets)
We could export the cPacketizer class. Then add a cClientHandle function called something like "SendPacket". With 2 parameters. The packet type and a callback function.
pseudo-code:
// The send packet function in clienthandle. void cClientHandle::SendPacket(Byte a_Packet, cLuaPacketCallback a_Callback) { m_Protocol->SendLuaPacket(a_Packet, a_Callback); } // The function that will actualy create the cPacketizer and call the Lua function. void cProtocol172::SendLuaPacket(Byte a_Packet, cLuaPacketCallback a_Callback) { cPacketizer Pkt(*this, a_Packet); a_Callback->Item(Pkt); }
Thoughts??