bool CALLBACK recv_rpc(stRakNetHookParams *params)
{
if (params->packetId == ScriptRPCEnumeration::RPC_ScrShowDialog)
{
WORD DialogID;
BYTE style, caplen, button1_len, button2_len;
char caption[255], button1[25], button2[25], info[0x1000];
params->bitStream->ResetReadPointer();
params->bitStream->Read(DialogID);
params->bitStream->Read(style);
params->bitStream->Read(caplen);
caption[caplen] = '\0';
params->bitStream->Read(button1_len);
params->bitStream->Read(button1, button1_len);
button1[button1_len] = '\0';
params->bitStream->Read(button2_len);
params->bitStream->Read(button2, button2_len);
button2[button2_len] = '\0';
SF->getRakNet()->DecodeString(info, 0x1000, params->bitStream);
std::string cap = caption, text = info;
SF->Log("DialogID: %d - caption %s\n%s", DialogID, caption, info);
}
return true;
}