Author | Message | Time |
---|---|---|
titan0060 | Hey, im tryin to make my first bot, i have Visual basic 6... i pretty much know my way arround VB, but i dont know what to do next. I've got the main form laid out, but now i dont know what to do. Please reach me at: [ this forum ] [color=#8080FF]Removed contact info. Ask your questions here so everyone can conveniently help you and others can benefit from the information. - Spht[/color] | August 21, 2004, 2:14 PM |
Kp | [quote author=titan0060 link=board=17;threadid=8280;start=0#msg76537 date=1093097657]Hey, im tryin to make my first bot, i have Visual basic 6... i pretty much know my way arround VB, but i dont know what to do next. I've got the main form laid out, but now i dont know what to do. Please reach me at: [ this forum ][/quote] Open a TCP socket to port 6112 on any of the active BNCS. Send your connection select byte, then go into a net loop on the received data. Beware of partial receipts as well as receiving multiple bncs messages in a single receive operation. Consult BnetDocs for details of the individual packet formats. | August 21, 2004, 3:45 PM |
TangoFour | [quote]Beware of partial receipts[/quote] Ummm - you mean packets getting scrambled? Didn't ever think of that as a possibility... Ok, that means I gotta rewrite a part of my bot's connection code | August 21, 2004, 6:20 PM |
Newby | I think he meant a packet that doesn't contain all the information it should, almost as if it had been cut off. | August 21, 2004, 6:31 PM |
Myndfyr | [quote author=TangoFour link=board=17;threadid=8280;start=0#msg76563 date=1093112403] [quote]Beware of partial receipts[/quote] Ummm - you mean packets getting scrambled? Didn't ever think of that as a possibility... Ok, that means I gotta rewrite a part of my bot's connection code [/quote] No -- what he means that, Battle.net will sometimes put more than one packet together: Example: extremely unlikely, but it illustrates the point. [code] ff 00 04 00 ff 00 04 00 [/code] It will also sometimes not send an entire packet with one Receive callback: [code] ff 0b 4c 00 (P) (u) (b) (l) (i) (c) ( ) (C) (h) (a) (t) ( ) (U) (S) (A) (-) (1) 00 (O) (p) (e) (n) ( ) [/code] If you look at the length specifier (sorry, I was too lazy to look up hex codes for all the ASCII chars), you can see that the specified packet is supposed to be *much longer* than the data that was received (0x4c vs 0x1b). That's what it means. There's no "scrambling" of packet info. | August 21, 2004, 6:33 PM |
TangoFour | So, more like: I receive a SID_PING, which should be 8 bytes long (1 for FF, 1 for Packet ID, 2 for length, 4 for Ping value), but I only receive 4 bytes - in that case I should wait for the other 4 bytes... Is it possible then, that I receive 4 bytes for SID_PING, then receive a SID_AUTH_INFO, and then the rest of SID_PING? My code already properly deals with packets that are "concatenated" | August 21, 2004, 6:35 PM |
ChR0NiC | [quote author=titan0060 link=board=17;threadid=8280;start=0#msg76537 date=1093097657] Hey, im tryin to make my first bot, i have Visual basic 6... i pretty much know my way arround VB, but i dont know what to do next. [/quote] This has to stop, you mods should make a sticky saying before asking this question use the search button and look in the Battle.net Bot Development References before you ask questions. Thanks if any mods decide to do this. | August 21, 2004, 7:33 PM |
Kp | [quote author=TangoFour link=board=17;threadid=8280;start=0#msg76574 date=1093113308] So, more like: I receive a SID_PING, which should be 8 bytes long (1 for FF, 1 for Packet ID, 2 for length, 4 for Ping value), but I only receive 4 bytes - in that case I should wait for the other 4 bytes... Is it possible then, that I receive 4 bytes for SID_PING, then receive a SID_AUTH_INFO, and then the rest of SID_PING?[/quote] Yes. No. Therefore, you're ok. | August 21, 2004, 8:34 PM |
Zakath | Indeed. You may get part of a packet, a whole packet, or multiple packets clumped together. Those are the situations you have to handle. | August 22, 2004, 12:34 AM |
TangoFour | Alright, thank you very much | August 22, 2004, 9:25 AM |
tA-Kane | So just to make sure it's clear, you should NEVER receive a partial packet, then another packet before receiving the rest of the partial packet. | August 22, 2004, 7:35 PM |