[Include] safeDialogs - Complete protection against spoofed dialog data!
#16

safeDialogs - v1.0.3 (optional/minor update) released!

- Added a static-global array to handle huge strings, thereby freeing more heap space. If you were facing any heap space related warning after including safeDialogs earlier, it should be fixed now.
- Improved list-item filtering. There used to be a confusion for non-hex codes between curly braces in list-item string, no more now though!
- Added new function : GetPlayerDialogItem - It stores the list-item string/data into destination. Using this function, you don't have to rely on inputtext for list-type dialogs to get their string data. In cases of DIALOG_STYLE_TABLIST or DIALOG_STYLE_TABLIST_HEADERS - it stores the complete list-item data.
pawn Code:
GetPlayerDialogItem(playerid, listitem, dest[], bool:filter = false, size = sizeof(dest));

playerid - The player to obtain data from.
listitem - The listitem of which data/string has to be obtained.
dest[] - Array to store string/data.
filter = false - Whether to filter the contents in a list-item. If filter is set to true,
                   it will automatically remove color embedding and make it look like
                   how it's shown to clients / players.
                   If filter is set to false (by default it'
s false), it will show the raw data
                   which may or may not include color embedding, depending on how the
                   code is.
size = sizeof(dest) - The size of destination array.
- Fixed functions : Functions from safeDialogs can now be used under OnDialogResponse and OnDialogSpoof.
- Include initialization won't call OnPlayerConnect completely anymore, instead it only resets necessary variables. This also means that "_ALS_" hook errors upon including certain libraries along with safeDialogs, are fixed.

This is an optional update, but I'd recommend anyone using this include to update to the latest version.

-----


Output of how the whole text can be retrieved for tabbed dialogs. (The same applies for header type dialogs)

pawn Code:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST,
"DIALOG_STYLE_TABLIST",
"Item\t1\n\
{FF0000}Stuff\t2\n\
{FFFaf9}Other\t3"
, "Select", "Close");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {

    if(dialogid == 1) {
   
        new
            tmpString[256];
           
        GetPlayerDialogItem(playerid, listitem, tmpString, false, sizeof(tmpString));
        //filter is false - This output can include color embedding if the script has done so.
        printf("%s", tmpString);
       
        tmpString[0] = EOS;
        GetPlayerDialogItem(playerid, listitem, tmpString, true, sizeof(tmpString));
        //filter is true - It will print the text exactly like how clients view in game.
        printf("%s", tmpString);
       
        return 1;
    }
    return 0;
}
Output: (I selected each and every list-items)
Code:
Item	1
Item	1
{FF0000}Stuff	2
Stuff	2
{FFFaf9}Other	3
Other	3
Reply


Messages In This Thread
safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 04.02.2017, 13:13
Re: safeDialogs - Complete protection against spoofed dialog data! - by Naruto_Emilio - 04.02.2017, 14:02
Re: safeDialogs - Complete protection against spoofed dialog data! - by HydraHumza - 04.02.2017, 14:07
Re: safeDialogs - Complete protection against spoofed dialog data! - by GoldenLion - 04.02.2017, 14:51
Re: safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 04.02.2017, 14:53
Re: safeDialogs - Complete protection against spoofed dialog data! - by GoldenLion - 04.02.2017, 15:00
Re: safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 04.02.2017, 15:21
Re: safeDialogs - Complete protection against spoofed dialog data! - by PrO.GameR - 04.02.2017, 15:32
Re: safeDialogs - Complete protection against spoofed dialog data! - by Private200 - 04.02.2017, 15:37
Re: safeDialogs - Complete protection against spoofed dialog data! - by GoldenLion - 04.02.2017, 17:52
Re: safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 04.02.2017, 18:21
Re: safeDialogs - Complete protection against spoofed dialog data! - by GoldenLion - 04.02.2017, 19:07
Re: safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 05.02.2017, 03:36
Re: safeDialogs - Complete protection against spoofed dialog data! - by PrO.GameR - 05.02.2017, 12:40
Re: safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 06.02.2017, 15:35
Re: safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 08.02.2017, 17:17
Re: safeDialogs - Complete protection against spoofed dialog data! - by GoldenLion - 12.02.2017, 18:30
Re: safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 12.02.2017, 23:58
Re: safeDialogs - Complete protection against spoofed dialog data! - by GoldenLion - 13.02.2017, 10:48
Re: safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 14.02.2017, 14:50
Re: safeDialogs - Complete protection against spoofed dialog data! - by GoldenLion - 14.02.2017, 14:58
Re: safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 14.02.2017, 15:02
Re: safeDialogs - Complete protection against spoofed dialog data! - by GoldenLion - 15.02.2017, 15:24
Re: safeDialogs - Complete protection against spoofed dialog data! - by Naruto_Emilio - 20.02.2017, 20:20
Re: safeDialogs - Complete protection against spoofed dialog data! - by iKernel - 20.02.2017, 22:26
Re: safeDialogs - Complete protection against spoofed dialog data! - by Lordzy - 21.02.2017, 02:43
Re: safeDialogs - Complete protection against spoofed dialog data! - by Naruto_Emilio - 23.02.2017, 11:02
Re: safeDialogs - Complete protection against spoofed dialog data! - by TheLeech - 11.03.2017, 18:52

Forum Jump:


Users browsing this thread: 3 Guest(s)