Well upon connecting I receive for example:
Code:
> Outgoing(4000 - 52) > [0][0][0]4 [0]!PRODUCTION-201506161211-776084490[0][5]FLASH[0][0][0][1][0][0][0][0]
---------------
> Outgoing(112 - 2) > [0][0][0][2][0]p
---------------
Processing Handshake...
---------------
< Incoming(2172 - 518) < [0][0][2][6][8]|[1][0]58f067b301041a5cc1a604513b1c769d8d0752a367dc92b343a4c0959461bae9c82292796601b87e6d23286acaf247582c132fc1b2e31eb68e616052f332af48813b4cc3775bdfbed7a3c94d30926f2d6afecde7e8d512f81c0c23763d3a65c7e967a95893bb0dc203c6996854d26d70ba79a595512241902db90ab2399f8355[1][0]102fc444ed067ea931285a3d74cf757f916c3674cf690d01d7af09f7f0f3c02d1c8d63e57043a1558d4fe22d628f966dd38150d2983ba6ce97e46872a6b0752b5d392a0061d39dd2c4873632757b33a9bf7e5fa2cbddb3c96a94412997fb965bdca268b8a582f11e0ec836421dc6a0f24bbc7f6b6a225c6a2f9cb29d7285788a
---------------
> Outgoing(3713 - 260) > [0][0][1][4][1][0]df278f61c1adeeadb446eea92daef9bf0f55a5bd009a5a69446a9d28e4b65b1c05d1f0791b117cd0d2e97f0d8e8b734cc56ad90f35a32157d3af2044c92a429c4da34d6cf99018fb4199f3284c4478760bbc1f5d78361c120f795ff2089d70a0a1260a293f3ca4b32302238f484fabf5b311757c8acc06a9994f953da8b21b29
---------------
< Incoming(690 - 261) < [0][0][1][5][2]²[1][0]61defc11c75d4a164e158f60381d5c4dc39d97421d0cdc88e3461c7d71717bbfd6e8004f03a1972956bf3f23132ed2cafe034cda97a2a7a79c2208fbf772f3d6a264c3b0fb129865333252ed223a8bc94b258bb32456de6bb1560956a50cc1c3021a29c126c042ba23b7acc27e441d7533bbb6d305fdc7770dae5230f64932ba[1]
---------------
Handshake Finished!
---------------
> Outgoing(881 - 171) > [0][0][0]«[3]q[0][0][1]‘[0]Ghttps://habboo-a.akamaihd.net/gordon/PRODUCTION-201506161211-776084490/[0]Zhttps://www.habbo.com/gamedata/external_variables/00667976af31cf436536685496ee0aaa9a3d77fc
---------------
> Outgoing(135 - 114) > [0][0][0]r[0]‡[0]////
---------------
> Outgoing(2649 - 53) > [0][0][0]5[10]Y[0]////[0][0]Ÿ
---------------
< Incoming(3151 - 2) < [0][0][0][2][12]O
---------------
< Incoming(689 - 6) < [0][0][0][6][2]±[0][0][0][0]
---------------
< Incoming(1773 - 18) < [0][0][0][6]í[0][0][0][1][0][0][0][4][0][0][0][1][0][0][0]Ø
---------------
< Incoming(3281 - 10) < [0][0][0][10][12]Ñ[0][0][0][0][0][0][0][0]
---------------
< Incoming(2895 - 6) < [0][0][0][6][11]O[0][0][0][0]
---------------
< Incoming(2895 - 6) < [0][0][0][6][11]O[0][0][0][0]
---------------
< Incoming(2895 - 6) < [0][0][0][6][11]O[0][0][0][0]
---------------
< Incoming(2895 - 6) < [0][0][0][6][11]O[0][0][0][0]
---------------
< Incoming(2895 - 6) < [0][0][0][6][11]O[0][0][0][0]
---------------
< Incoming(2895 - 6) < [0][0][0][6][11]O[0][0][0][0]
---------------
< Incoming(2895 - 6) < [0][0][0][6][11]O[0][0][0][0]
---------------
< Incoming(2895 - 6) < [0][0][0][6][11]O[0][0][0][0]
---------------
< Incoming(2895 - 6) < [0][0][0][6][11]O[0][0][0][0]
---------------
< Incoming(3978 - 6) < [0][0][0][6]Š[0][0][0][0]
---------------
< Incoming(925 - 11) < [0][0][0][11][3][0][0][0][0][0][0][0][0][0]
---------------
< Incoming(820 - 5) < [0][0][0][5][3]4[1][0][1]
---------------
< Incoming(1711 - 3) < [0][0][0][3][6]¯[1]
---------------
< Incoming(74 - 94) < [0][0][0]^[0]J[0][0][0][11][0][0][0][0][0][0][2]Š[0][0][0][1][0][0][0][0][0][0][0][2][0][0][0][0][0][0][0][3][0][0][0][0][0][0][0][4][0][0][0][0][0][0][0][5][0][0][0][0][0][0][0]e[0][0][0][0][0][0][0]f[0][0][0][0][0][0][0]g[0][0][0][0][0][0][0]h[0][0][0][0][0][0][0]i[0][0][0][0]
---------------
< Incoming(1560 - 6) < [0][0][0][6][6][0][0][3]µ
---------------
< Incoming(1719 - 3) < [0][0][0][3][6]·[0]
---------------
< Incoming(1474 - 6) < [0][0][0][6][5]Â[0][0][0][0]
---------------
< Incoming(2920 - 18) < [0][0][0][11]h[0][0][0][0][0][0][0]d[0][1]† [0][0][0][0]
---------------
< Incoming(2159 - 10) < [0][0][0][10][8]o[3]½ì[0][0][0][0]
---------------
< Incoming(3455 - 10) < [0][0][0][10][13][0][0][0][0][0][0][0]
---------------
> Outgoing(2269 - 48) > [0][0][0]0[8]Ý[0],2013-05-08 13:00,gamesmaker;2013-05-11 13:00
---------------
> Outgoing(1465 - 2) > [0][0][0][2][5]¹
---------------
< Incoming(986 - 50) < [0][0][0]2[3]Ú[0],2013-05-08 13:00,gamesmaker;2013-05-11 13:00[0][0]
---------------
> Outgoing(1465 - 2) > [0][0][0][2][5]¹
---------------
> Outgoing(3975 - 2) > [0][0][0][2]‡
---------------
> Outgoing(2269 - 36) > [0][0][0]$[8]Ý[0] 2015-06-01 00:00,jurassic15furni
---------------
> Outgoing(2269 - 36) > [0][0][0]$[8]Ý[0] 2015-05-11 09:00,jurassic15furni
---------------
> Outgoing(2269 - 30) > [0][0][0][8]Ý[0]2015-04-12 19:00,smallpool
---------------
> Outgoing(2269 - 4) > [0][0][0][4][8]Ý[0][0]
---------------
> Outgoing(2173 - 2) > [0][0][0][2][8]}
---------------
> Outgoing(3747 - 39) > [0][0][0]'£[0][5]Login[0][6]socket[0]client.auth_ok[0][0][0][0][0][0]
---------------
> Outgoing(1043 - 2) > [0][0][0][2][4]
---------------
> Outgoing(275 - 2) > [0][0][0][2][1]
---------------
> Outgoing(2537 - 2) > [0][0][0][2][9]é
---------------
> Outgoing(2072 - 2) > [0][0][0][2][8]
---------------
> Outgoing(1121 - 2) > [0][0][0][2][4]a
---------------
> Outgoing(2838 - 2) > [0][0][0][2][11]
---------------
> Outgoing(3785 - 14) > [0][0][0]É[0][10]habbo_club
---------------
> Outgoing(392 - 2) > [0][0][0][2][1]ˆ
As you can see there are a lot of incoming packets logged first, after then a lot of outgoing. I'm absolutely convinced that this is not exactly the dataflow in the client.
So you suggest something like this:
Read outgoing data.
Once the client has sent a packet, wait until a response is given to continue reading more request/outgoing data?
Yes exactly this.
The thing is, what if a response is never received, and even if I add a sort of timer to determine the max wait time, it will cause a delay in the flow of data itself, which is a no-no.
Don't worry about that, there is always a chance it is never received even with no packetlogger. Chances are slim so it is most likely not going to happen. Adding a delay of 300ms between each packet send to the client could log the dataflow in a better way.
I don't think the solution with locks will work as big data packets from the server may take longer to send to the client and therefor end up after another client packet.