Send packets to player
#9
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:
// 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??
Reply
Thanks given by:


Messages In This Thread
Send packets to player - by artur9010 - 07-04-2014, 06:26 AM
RE: Send packets to player - by worktycho - 07-04-2014, 08:05 AM
RE: Send packets to player - by xoft - 07-04-2014, 05:09 PM
RE: Send packets to player - by tigerw - 07-05-2014, 12:19 AM
RE: Send packets to player - by xoft - 07-05-2014, 12:29 AM
RE: Send packets to player - by NiLSPACE - 07-05-2014, 12:37 AM
RE: Send packets to player - by worktycho - 07-05-2014, 01:27 AM
RE: Send packets to player - by NiLSPACE - 07-05-2014, 01:34 AM
RE: Send packets to player - by NiLSPACE - 08-21-2014, 12:50 AM
RE: Send packets to player - by xoft - 08-21-2014, 01:11 AM
RE: Send packets to player - by NiLSPACE - 08-21-2014, 01:15 AM
RE: Send packets to player - by LO1ZB - 08-21-2014, 01:35 AM
RE: Send packets to player - by NiLSPACE - 08-21-2014, 01:38 AM
RE: Send packets to player - by xoft - 08-21-2014, 01:46 AM
RE: Send packets to player - by NiLSPACE - 08-21-2014, 02:22 AM
RE: Send packets to player - by SamJBarney - 08-21-2014, 02:24 AM
RE: Send packets to player - by NiLSPACE - 08-21-2014, 02:31 AM



Users browsing this thread: 2 Guest(s)