facebookarchive / RakNet

RakNet is a cross platform, open source, C++ networking engine for game programmers.
Other
3.3k stars 1.02k forks source link

Fixed sorting on splitted packages... #65

Open JoergBoehnel opened 9 years ago

JoergBoehnel commented 9 years ago

When splitted packages where received in the wrong order*, RakNet never sorted those but returned wrong data on the receiving instance. This commit sorts the received packages.

ideallx commented 9 years ago

good job~ this problem also happened in my project and now I find your solution, it worked!

rsklnkv commented 8 years ago

Sounds like a great fix, but I can't get it to compile:

reliabilitylayer.cpp(3081): error C2039: 'Size' : is not a member of 'RakNet::SortedSplittedPackets' reliabilitylayer.h(66) : see declaration of 'RakNet::SortedSplittedPackets' reliabilitylayer.cpp(3084): error C2676: binary '[' : 'RakNet::SortedSplittedPackets' does not define this operator or a conversion to a type acceptable to the predefined operator reliabilitylayer.cpp(3085): error C2676: binary '[' : 'RakNet::SortedSplittedPackets' does not define this operator or a conversion to a type acceptable to the predefined operator reliabilitylayer.cpp(3089): error C2039: 'Clear' : is not a member of 'RakNet::SortedSplittedPackets' reliabilitylayer.h(66) : see declaration of 'RakNet::SortedSplittedPackets' reliabilitylayer.cpp(3101): error C2039: 'Push' : is not a member of 'RakNet::SortedSplittedPackets' reliabilitylayer.h(66) : see declaration of 'RakNet::SortedSplittedPackets'

What I'm doing wrong? :)

JoergBoehnel commented 8 years ago

Hello rsklnkv,

could you check if you have PREALLOCATE_LARGE_MESSAGES==1 defined? Apparently I have not tested it with PREALLOCATE_LARGE_MESSAGES enabled since we don't use it ourself, sorry about that. I'll post when I find the time and fix it for PREALLOCATE_LARGE_MESSAGES enabled, thanks for the report.

rsklnkv commented 8 years ago

Hello Joerg,

Turning PREALLOCATE_LARGE_MESSAGES off, allowed me to compile the project, thanks. I'll re-check performance with this flag off and if it will work fine, I'll keep it as it is now

Thanks!

Jimbly commented 7 years ago

I get corrupt packets 100% of the time if any packet (other than the last) in a split packet is dropped. Can simulate this trivially with clumsy on Windows and then just send 2K packets through the Chat sample, and half the time the message ends up split and in reverse order. I do not have the vocabulary to express how baffled I am that RakNet does not reassemble split packets in order, it seems reliable delivery is the one thing I asked of it -_-.

Anyway, your fix works great, thank you so much.