These are chat archives for ZaneDubya/UltimaXNA

24th
Nov 2015
Taras Polishchuk
@wake-up-neo
Nov 24 2015 01:15
I've got the problem. The server sends 0xB9 packet (features, 3 bytes) and 0xA9 (Characters, random bytes, let's say 370) together... NetworkClient do DecompressOnePacket, but this one packet consist of multiple packets combined together. Then of course it doesn't recognize any packet as they are merged. So should I rewrite GetPacketSizeAndHandler to read first byte and then try to split it manually or I miss something already implemented for this case? @ZaneDubya @jeffboulanger please help guys!
Jeff Boulanger
@jeffboulanger
Nov 24 2015 01:44
The code recognizes the scenarios of multiple packets in 1 on receive and it recognizes partial packets in 1 on receive, sounds like your problem is something else. Can you start from scratch and post the debug log somewhere for us to see?
Jeff Boulanger
@jeffboulanger
Nov 24 2015 01:54
DecompressOnePacket is in a while loop and would have returned true because it was able to decompress the 1st packet, it only returns fast if it cannot, in which case, we hold onto the data till more data comes in since the packets can be split between receive calls
if DecompressOnePacket wasnt working correctly or we werent handling multiple packets per OnReceive when they occur, we wouldnt be able to test UltimaXNA against the latest version, as it would hang when more than 1 packet was received.
Zane Wagner
@ZaneDubya
Nov 24 2015 16:34
I remember fixing a related issue months ago, but I don't recall the details.
It had something to do with having either an incomplete packet in the buffer, I think.
But then again, it might have had something to do with multiple packets received at once.
I can't find my fix in the history - must have moved the file. ;|
In any case, it's entirely plausible that this issue, or a related one, remains in the code.
Jeff Boulanger
@jeffboulanger
Nov 24 2015 16:53
Seems unlikely though given how well it works with current servers, being that the whole partial packet or multiple packets isnt related to UO, but to how net code works in general
I think the best way to help would be to get the debug.log so we can look at how the communication works in the order server.
@wake-up-neo
Taras Polishchuk
@wake-up-neo
Nov 24 2015 17:20
That makes sense. Here it is http://codeshare.io/AMYiO Line 76 is the final message I receive from the client.
Starting from the row 77 it is manually added LogPacket trigger for this case. The case I described previously is row 82 - packet B9 - 3 bytes starting from [0] and then packet A9 starting from [3] on the same row
Taras Polishchuk
@wake-up-neo
Nov 24 2015 17:30
The only thing I've changed in the code is the seed packet to 4 bytes (/dev/Ultima/Network/Client/SeedPacket.cs), otherwise the server doesn't respond to this packet and the SelectServerPacket index, has added +1 to it. I realize that there will be many issue to fix the protocol, different packets etc. in order to make it works, but first of all I want to understand the main thing - will it work with our server at all or not
Taras Polishchuk
@wake-up-neo
Nov 24 2015 17:40
I've made a small mistake in this debug log) The real packet length starting from the row 81 is about 300-400 bytes, other 65000 bytes is the output of m_ReceiveBuffer, coz it was used for LogPacket()