AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Parsing Response Thru Socket (https://forums.alliedmods.net/showthread.php?t=282608)

tenub 05-11-2016 22:28

Parsing Response Thru Socket
 
If I want to parse a response via socket, this results in a string being received due to the RESP protocol (remote Redis server). I need to then parse this based on the protocol specification, but in Pawn I can't just return the data/type I parse that string to; I must pass a buffer to copy the result to. However, when I parse, it could result in a variable data type (string, integer, array, etc.). Yet the buffer can only handle the data type I declare it as in the calling function before passing it to the parsing function to "fill". I think you may already see my problem. How do I handle variable data types for a buffer? Rather, what is the correct method to retrieve parsed data from a string buffer? I come from a JavaScript background so Pawn is an exceptional hurdle for me.


All times are GMT -4. The time now is 18:41.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.