Valhalla Legends Forums Archive | Battle.net Bot Development | [c++] 0x0E question

AuthorMessageTime
mentalCo.
problem:

[code]
packetbuf.insert("hello");
packetbuf.sendpacket(sockfd, 0x0e);
[/code]


in the channel it says

<name>˙hello

why is the '˙' there?
June 17, 2004, 4:06 AM
Tuberload
[quote author=mentalCo. link=board=17;threadid=7289;start=0#msg65572 date=1087445175]
problem:

[code]
packetbuf.insert("hello");
packetbuf.sendpacket(sockfd, 0x0e);
[/code]


in the channel it says

<name>˙hello

why is the '˙' there?
[/quote]

Post your packet buffer code.
June 17, 2004, 4:36 AM
Stealth
It would seem a stray 0xFF in the packetbuffer send code is at fault here.
June 17, 2004, 5:12 AM
mentalCo.
i am using a packetbuffer class used in a lot of bots.


[code]

//insert into packet

void PacketBuffer::insert(const char *data) {
   strcpy(buffer + ipos, data);
   if(ipos + strlen(data) + 1 > len)
      len = ipos + strlen(data) + 1;
   ipos += strlen(data) + 1;
}




//send packet

void PacketBuffer::sendpacket(int s, char id)
{
   char packetbuffer[1024] = "";
   packetbuffer[0] = (char)0xff;
   packetbuffer[1] = id;
   *(unsigned short *)(packetbuffer + 2) = (unsigned short)len + 4;
   memcpy(packetbuffer + 4, buffer, len);
   send(s, packetbuffer, len + 4, 0);
   clear();
}

[/code]
June 18, 2004, 3:36 AM

Search