• Welcome to Valhalla Legends Archive.
 

Clumped packets not parsing correctly (VB)

Started by FuzZ, March 16, 2004, 02:44 PM

Previous topic - Next topic

Eric

Quote from: o.OV on March 17, 2004, 07:26 PM
Quote from: UserLoser. on March 17, 2004, 07:21 PM
Quote from: o.OV on March 17, 2004, 07:14 PM
Quote from: UserLoser. on March 17, 2004, 06:39 PM
Shouldn't do > 4, some packets like SID_NULL may only be 4 bytes long and shouldn't be ignored

I wouldn't use such a check either.
However.. It isn't really ignored.
It will get "processed" as soon as another packet arrives.

But then wouldn't the following packet not be processed?

I'd then be something below be parsed?:

FF 00 04 00 <other packet>

huh? what are you talking about.
In the example by fuzz
it allows the null packet to sit in the buffer
without actually entering the loop
until another packet arrives which
adds to the length of the buffer so len(buffer) > 4
then it starts to process.
The buffer would be redimmed as soon as a packet was received, unless you were to declare it as a static variable.

FuzZ

#16
I've noticed sometimes that I recieve SID_NULL if I've been sittin in a channel for a while when I enter any kind of chat. (I have a notice to see when it was requested) for example

[0:57:44:125] <AoD-Ekion@Azeroth Blizzsource Radio Will Be Down Today For Awhile Due To Maintance And Other Stuff Thanks>
[1:1:22:953] Keep Alive.
[1:1:42:578] Keep Alive.
[1:1:42:593] To your friends: do do do do do do do do do do do do od od do do do do do dod od od od do do dod od od od do do d


I'm not really sure, but I dont think I recieved anything in between those. although when I sent that /f m I did recieve one as soon as i hit enter.

Edit-> I just noticed that it was probably processed because of another SID_NULL that was recieved, which was then stuck in the buffer. Perhaps, I should change it from Len(strBuffer) > 4 to Len(strBuffer) >= 4 ??

o.OV

#17
Quote from: LoRd[nK] on March 17, 2004, 10:00 PM
Quote from: o.OV on March 17, 2004, 07:26 PM
Quote from: UserLoser. on March 17, 2004, 07:21 PM
Quote from: o.OV on March 17, 2004, 07:14 PM
Quote from: UserLoser. on March 17, 2004, 06:39 PM
Shouldn't do > 4, some packets like SID_NULL may only be 4 bytes long and shouldn't be ignored

I wouldn't use such a check either.
However.. It isn't really ignored.
It will get "processed" as soon as another packet arrives.

But then wouldn't the following packet not be processed?

I'd then be something below be parsed?:

FF 00 04 00 <other packet>

huh? what are you talking about.
In the example by fuzz
it allows the null packet to sit in the buffer
without actually entering the loop
until another packet arrives which
adds to the length of the buffer so len(buffer) > 4
then it starts to process.
The buffer would be redimmed as soon as a packet was received, unless you were to declare it as a static variable.

Eh? Here are some quotes for you, Lord[nK].

Quote from: Lenny on March 17, 2004, 01:49 PM
You're strBuffer should be a static variable or else you wont be able to parse any packets that come in pieces rather than whole...


Dim strBuffer As String

should be

Static strBuffer as String


Quote from: FuzZ on March 17, 2004, 02:21 PM
Yeah, LoRd that has been pissin me off, just to worried about other stuff to fix it.
Lenny, i bet you're absolutely right, let me go try that.
Success! Thank you Lenny.. I figured it was probably something stupid like that I wouldn't notice.
As I'm sure you can probably tell I'm just a beginner (newb) when it comes to programming.. Thanks so much :)
If the facts don't fit the theory, change the facts. - Albert Einstein

Skywing

Quote from: UserLoser. on March 17, 2004, 07:00 PM
Quote from: iago on March 17, 2004, 06:55 PM
Actually, SID_NULL should be ignored :P

Why?

I try to be like the real game client as much as possible, in my opinion, so should other bots. I believe it's best to support every message that you can and handle them properly

Edit:

Ok, better example: 0x59
The official client has discarded messages with ID < 0x05 for a long, long time now.

iago

Quote from: Skywing on March 18, 2004, 01:11 AM
Quote from: UserLoser. on March 17, 2004, 07:00 PM
Quote from: iago on March 17, 2004, 06:55 PM
Actually, SID_NULL should be ignored :P

Why?

I try to be like the real game client as much as possible, in my opinion, so should other bots. I believe it's best to support every message that you can and handle them properly

Edit:

Ok, better example: 0x59
The official client has discarded messages with ID < 0x05 for a long, long time now.

Oh yeah, before the switch it subtracts 4 from the code.  I had completely forgotten about that :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*