Quote:
Originally Posted by Caesarw
to extract:
00 T_BIN : BLAHBLAHBLAH
char* s=p.GetElement(0)->str; // your bin string
to pack:
PacketData d;
CMabiPacket p;
char bin[32]="BLAHBLAHBLAH\0"; // your bin string
d.type=7; d.str=bin; d.len=strlen(bin); p.AddElement(&d);
|
Thanks for your code. I tried using it to get the T_BIN in the 5211 packet and write it out in the log file but somehow failed, here's my code:
pdata = recvPacket.GetElement( 2 );
LPSTR iINFO = pdata->str;
WriteLog(iINFO);
No content about the T_BIN is written in the log file. The only result is as following:
"[04/03/14 16:00:00] - "
Did I misunderstand anything?
Anyways, thanks for letting me know that type=7 stands for T_BIN.
And by the way, could you tell me how to make functions execute asynchronously in the mod? Normally we use SendHook and RecvHook to monitor the packets and perform immediate action after identifying specific ones, but in some cases a delayed response is needed.
For example, if I want to make the mod capable of AFK training bard skills, what I would try to do is to send an activate skill packet and wait for a certain amount of time before sending the next one. However, the simplest implementation which is delay(Nms) delays (actually freezes) the entire client. I've also tried using a separate thread that waits for signal to perform operation but it crashes the client every time the Send function is called. Any hint on this one?
:)