HandleRPCPacketFunc can't respond RPC_ShowDialog at 0.3.DL

benberk

Member
Joined
Jan 19, 2020
Messages
19
Reaction score
3
Location
Constantine
at 0.3DL RPC_ShowDialog can't get logged by HandleRPCPacketFunc
Tried to log with a line and still not working somhow
 
Last edited:

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
165
Location
Poland
Code:
            case RPC_ShowDialog:
            {
                traceLastFunc("RPC_ShowDialog");
                if (isCheatPanicEnabled() || !set.showdialog) break;
                /*
                {'onShowDialog', 
                {dialogId = 'uint16'}, 
                {style = 'uint8'}, 
                {title = 'string8'}, 
                {button1 = 'string8'}, 
                {button2 = 'string8'}, 
                {text = 'encodedString4096'}}
                */
                BitStream    bsData(rpcParams->input, rpcParams->numberOfBitsOfData / 8, false);
                uint16_t dialogId;
                uint8_t style, titleLen, button1Len, button2Len;
                char title[257], button1[257], button2[257];

                bsData.Read(dialogId);
                bsData.Read(style);
                bsData.Read(titleLen);
                bsData.Read(title, titleLen);
                title[titleLen] = '\0';
                bsData.Read(button1Len);
                bsData.Read(button1, button1Len);
                button1[button1Len] = '\0';
                bsData.Read(button2Len);
                bsData.Read(button2, button2Len);
                button2[button2Len] = '\0';

                if (set.showdialog)
                {
                    addMessageToChatWindow("{FFFFFF}dialogId: {FF0000}%d {FFFFFF}title: {FF0000}%s", dialogId, title);
                    if (strstr(title, "Logowanie"))
                    {
                        // code
                    }
                }

                break;
            }
Code:
void RakClient::SendDialogTextResponse(WORD wDialogID, BYTE bButtonID, WORD wListBoxItem, char* szInputResp)
{
    BYTE respLen = (BYTE)strlen(szInputResp);
    BitStream bsSend;
    bsSend.Write(wDialogID);
    bsSend.Write(bButtonID);
    bsSend.Write(wListBoxItem);
    bsSend.Write(respLen);
    bsSend.Write(szInputResp, respLen);
    g_RakClient->RPC(RPC_DialogResponse, &bsSend);
}
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,386
Solutions
4
Reaction score
893
Location
Israel
at 0.3DL RPC_ShowDialog can't get logged by HandleRPCPacketFunc
Tried to log with a line and still not working somhow
It works great! , Problem you have a file that removes the dialog and recreates it =)

B.S: If you are not successful yourself I will tell you what the file is, but I believe in you
 

benberk

Member
Joined
Jan 19, 2020
Messages
19
Reaction score
3
Location
Constantine
Yes, I noticed the problem was on samp addon, i deleted it and rpc worked. Also I need to receive the text of the dialog
{text = 'encodedString4096'}}
there's some way to receive it but it doesn't work fine to me
 
Last edited:

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,386
Solutions
4
Reaction score
893
Location
Israel
Yes, I noticed the problem was on samp addon, i deleted it and rpc worked. Also I need to receive the text of the dialog there's some way to receive it but it doesn't work fine to me
Yes it does problem, even if you try to add "fullraknet" code crash, in my experience need to update offset manually to 0.3.DL
 

JaggerJam

Active member
Joined
Sep 14, 2017
Messages
97
Reaction score
21
It works great! , Problem you have a file that removes the dialog and recreates it =)

B.S: If you are not successful yourself I will tell you what the file is, but I believe in you
Sorry for off topic, but it is possible to skip this somehow? Like to disable and enable it back or SAMPAddon is a piece of shet
 

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,386
Solutions
4
Reaction score
893
Location
Israel
Ok... but a lot of users have installed SAMPAddon and I can't tell them just to delete samp.asi
This is not supposed to be your problem, this is their problem. They are the ones who know what they are throwing in their folder
 
Top