I'm confused on how:<br><br>[ size_of_game_data ] [ game_data ] [ voice_data ] <br><br>relates to:<br><br>[ (1 byte)1 ] [ (1 byte) user_id ] [ (80 bytes)voicedata ]<br>[ (1 byte)10 ] [ (1 byte) user_id, (9 bytes) text_message  ]<br>
<br><br><br><div class="gmail_quote">On Thu, Apr 14, 2011 at 7:56 AM, Sergio Martin <span dir="ltr"><<a href="mailto:smartin@freedomfactorystudios.com">smartin@freedomfactorystudios.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">Hi,<br>
<br>
Just to clarify, it's a hardware requirement of the platform I'm<br>
developing for to send physical UDP packets in this form.<br>
<br>
e.g. I need to send a physical UDP packet like this:<br>
<br>
[ (1 byte)1 ] [ (1 byte) user_id ] [ (80 bytes)voicedata ]<br>
<br>
or:<br>
<br>
[ (1 byte)10 ] [ (1 byte) user_id, (9 bytes) text_message  ] [ (0<br>
bytes)voicedata ]<br>
<br>
<br>
El 14/04/2011 13:42, Daniel Aquino escribió:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Doesn't sound right to me.  Your hard coding enet into only having the<br>
ability to create packets with voice data shoved onto them.  That's not<br>
very flexible.<br>
<br>
You can put any data you want into the packet so nothing stops you from<br>
making all your packets in the desired format.<br>
<br>
But the whole point of channels is to separate such data and treat them<br>
differently.<br>
<br>
Normally for voice packets you would send them on their own channel<br>
using unreliable + sequenced.  This way late packets would be dropped<br>
which is desired for voice.<br>
<br>
Also Enet is not going to send a physical udp packet until you flush the<br>
host.  So if you were to send a game packet and then send a voice packet<br>
and call flush they would both end up in the same udp packet on the wire.<br>
<br>
<br>
<br>
On Thu, Apr 14, 2011 at 6:40 AM, Sergio Martin<br>
<<a href="mailto:smartin@freedomfactorystudios.com" target="_blank">smartin@freedomfactorystudios.com</a><br>
<mailto:<a href="mailto:smartin@freedomfactorystudios.com" target="_blank">smartin@freedomfactorystudios.com</a>>> wrote:<br>
<br>
    Hi,<br>
<br>
    In order to meet our client custom network requirement, I need to<br>
    send each UDP packet data as following:<br>
<br>
    [ size_of_game_data ] [ game_data ] [ voice_data ]<br>
<br>
<br>
    How difficult would be to modify ENet behaviour to meet that pattern?<br>
    I'm not sure how to deal with ENet's packet fragmentation.<br>
<br>
    I'm thinking of adding to ENetPacket struct two new variables:<br>
    enet_uint8 * voiceData;             /**< allocated voice data for<br>
    packet */<br>
    size_t           voiceDataLength;  /**< length of voice data */<br>
<br>
    Change: enet_packet_create (const void * data, size_t dataLength,<br>
    enet_uint32 flags)<br>
    To this: enet_packet_create(const void * data, size_t dataLength,<br>
    const void * voiceData, size_t voiceDataLength, enet_uint32 flags)<br>
<br>
    And then modify the rest of ENet to support it.<br>
<br>
<br>
    Is this the correct approach?<br>
<br>
<br>
    Best Regards,<br>
    Sergio Martin.<br>
<br>
    _______________________________________________<br>
    ENet-discuss mailing list<br>
    <a href="mailto:ENet-discuss@cubik.org" target="_blank">ENet-discuss@cubik.org</a> <mailto:<a href="mailto:ENet-discuss@cubik.org" target="_blank">ENet-discuss@cubik.org</a>><br>
    <a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
<br>
<br>
</blockquote>
_______________________________________________<br>
ENet-discuss mailing list<br>
<a href="mailto:ENet-discuss@cubik.org" target="_blank">ENet-discuss@cubik.org</a><br>
<a href="http://lists.cubik.org/mailman/listinfo/enet-discuss" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
</div></div></blockquote></div><br>