• Welcome to Valhalla Legends Archive.
 

Drawbacks of handling packets asynchronously?

Started by iago, March 15, 2004, 12:03 PM

Previous topic - Next topic

iago

Quote from: Kp on March 16, 2004, 02:49 PM
Quote from: DaRk-FeAnOr on March 16, 2004, 02:12 PMYou could always split the packets by every FF byte and send them to be parsed seperately.

IIRC, NullBot did this.  As such, you could confuse it rather badly by sending a 0xff embedded in a talk event, causing it to believe it had encountered the next packet in the sequence.

What about somebody who has a ping of -1?  ff 0f xx xx 00 00 00 00 00 00 00 00 ff ff ff ff would break it.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Eli_1

#16
what about someone talking in D2 colors?

FF 63 31 77 6F 30 74 21               ÿc1wo0t!

Kp

Yes, both those things would confuse a bot which simply scanned for 0xff.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Adron

Quote from: DaRk-FeAnOr on March 16, 2004, 02:12 PM
Quote from: Adron on March 16, 2004, 11:16 AM
This sounds like it won't work if you happen to get a packet that is split, and where the last bytes of the first part are 00's.
You could always split the packets by every FF byte and send them to be parsed seperately. Additionally, a packet terminating null byte will never be significant, at least in any battle.net packet that I have seen.

A packet terminating null byte won't be significant, but one in the middle of a split packet will be.

UserLoser.

Better yet, a D2 statstring is full of 0xff's if a character is naked (wearing no gear)

iago

hmm, I think I might need to add some synchronization:

QuoteLogin succeeded!
User in channel: pacinolife (Ping: 156, Flags: 0x0)
User in channel: 911kill (Ping: 63, Flags: 0x0)
User in channel: PaulMartin (Ping: 78, Flags: 0x0)
[....lots of users]
User in channel: starofblood04 (Ping: 62, Flags: 0x0)
User in channel: iago (Ping: 78, Flags: 0x10)
Info: Welcome to Battle.net!
Info: This server is hosted by AT&T.
Info: There are currently 67980 users playing 17174 games of Starcraft Broodwar,
and 196080 users playing 72459 games on Battle.net.
Info: Last logon: Wed Mar 17  4:28 PM
Joining channel: op [vL]
User in channel: [vL] (Ping: 63, Flags: 0x2)
User in channel: BinaryChat (Ping: 47, Flags: 0x0)
User in channel: '|'rance (Ping: 78, Flags: 0x0)
User in channel: tmp (Ping: 188, Flags: 0x0)
[....lots of users again.....]
User in channel: MacBinaryBot (Ping: -1, Flags: 0x10)
User in channel: iago (Ping: 78, Flags: 0x10)
Unknown packet recieved
Joining channel: Brood War CAN-1
User in channel: Naked_Zergling (Ping: 62, Flags: 0x0)
User in channel: ooooooooooo (Ping: 78, Flags: 0x0)
Ping recieved; returning
)

Somehow, the channel joining packet ended up in totally the wrong place :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


iago

lmao, I tried adding Java's version of a Critical Section around the 0x0F processing and it made some stuff worse and stuff stuff better:

QuoteUser in channel: pacinolife (Ping: 156, Flags: 0x0)
User in channel: 911kill (Ping: 63, Flags: 0x0)
User in channel: Naked_Zergling (Ping: 62, Flags: 0x0)
Joining channel: Brood War CAN-1
User in channel: popIN (Ping: 47, Flags: 0x0)
User in channel: Em0kid (Ping: 31, Flags: 0x0)
User in channel: RockN_TiGeR (Ping: 32, Flags: 0x0)
User in channel: ooooooooooo (Ping: 78, Flags: 0x0)
User in channel: PaulMartin (Ping: 78, Flags: 0x0)
User in channel: Fr3EDoM (Ping: 46, Flags: 0x0)
Info: Last logon: Wed Mar 17  4:28 PM
Info: There are currently 65174 users playing 16390 games of Starcraft Broodwar, and 193485 users playing 71894 games on Battle.net.
User in channel: death_master90 (Ping: 31, Flags: 0x0)
User in channel: Halmir (Ping: 78, Flags: 0x0)
User in channel: thestingar (Ping: 266, Flags: 0x0)
User in channel: frankyc (Ping: 63, Flags: 0x0)
User in channel: iago (Ping: 63, Flags: 0x10)
Info: This server is hosted by AT&T.
User in channel: Knight_Lewis (Ping: 16, Flags: 0x0)
User in channel: DeerPoop99 (Ping: 78, Flags: 0x0)
User in channel: yiliangzhao (Ping: 484, Flags: 0x0)
User in channel: tiny_pest438 (Ping: 31, Flags: 0x0)
Info: Welcome to Battle.net!
User in channel: JO-BU (Ping: 47, Flags: 0x0)
User in channel: [vL] (Ping: 63, Flags: 0x2)
User in channel: '|'rance (Ping: 78, Flags: 0x0)
User in channel: tmp (Ping: 188, Flags: 0x0)
User in channel: [vL]Kp (Ping: 62, Flags: 0x0)
User in channel: [vL]Grok (Ping: 47, Flags: 0x0)
User in channel: thuscelackpiss (Ping: 109, Flags: 0x0)
User in channel: Zakath[vL] (Ping: 15, Flags: 0x0)
User in channel: Hostile[vL] (Ping: 0, Flags: 0x0)
User in channel: JoKeR[vL] (Ping: 0, Flags: 0x0)
User in channel: [vL]DarkVirus (Ping: 47, Flags: 0x0)
User in channel: hismajesty. (Ping: 32, Flags: 0x0)
User in channel: UserLoser. (Ping: 234, Flags: 0x0)
User in channel: naem@Azeroth (Ping: 93, Flags: 0x0)
User in channel: Eibro@Azeroth (Ping: 94, Flags: 0x0)
Joining channel: op [vL]
User in channel: BinaryChat (Ping: 47, Flags: 0x0)
User in channel: Yoni-L (Ping: 187, Flags: 0x0)
User in channel: Yoni-R (Ping: 453, Flags: 0x0)
User in channel: Skywing[vL]@Azeroth (Ping: 47, Flags: 0x0)
User in channel: Skywing[vL] (Ping: 0, Flags: 0x0)
User in channel: Telos.fe (Ping: 953, Flags: 0x0)
User in channel: Arta (Ping: 157, Flags: 0x0)
User in channel: Arta[vL] (Ping: 125, Flags: 0x0)
User in channel: cipher (Ping: 532, Flags: 0x0)
User in channel: Winner[vL] (Ping: 62, Flags: 0x0)
User in channel: iago (Ping: 63, Flags: 0x10)
User in channel: MacBinaryBot (Ping: -1, Flags: 0x10)
Ping recieved; returning
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Skywing

I think you need to set up some kind of event on on each incoming data packet to wait on before you process it (at least for chat events).

In fact, I really don't see why you are trying to do this asynchronously.  Given the short processing time, it's likely that you will have more overhead associated with setting up the asynchronous requests than it will take to process the data.

iago

Quote from: Skywing on March 17, 2004, 10:51 AM
I think you need to set up some kind of event on on each incoming data packet to wait on before you process it (at least for chat events).

In fact, I really don't see why you are trying to do this asynchronously.  Given the short processing time, it's likely that you will have more overhead associated with setting up the asynchronous requests than it will take to process the data.

That's also what I was thinking.  It seemed like it could be interesting to set up, though.  I might just go back to processing them the old fashioned way :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


iago

ohwell, it was fun while it lasted.  Fixed it now, though.  It just does processing the old fashioned way.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*