View Single Post
Author Message
Xablau
Member
Join Date: Dec 2014
Old 01-04-2015 , 14:49   [ socket_recv + json/data ]
Reply With Quote #1

See my code:

PHP Code:
public client_connect(id)
{
    
get_player_info(id)
}
public 
get_player_info(id
{
    new 
ip[64], nick[32], steamid[32], errorsendbuffer[512]
    
get_user_ip(0,ip,63,0// IP
    
get_user_name(id,nick31// Nick
    
get_user_authid(id,steamid,31// SteamID
    
    
g_Socket socket_open("site.com"80SOCKET_TCPerror
    
    
format(sendbuffer511"GET %s HTTP/1.1^nHost:site.com^r^n^r^n""/player.php?steamid=%s&server=%s&nick=%s"steamidipnick)
    
socket_send(g_Socketsendbuffer511)
    
    
// It changed? 
    
if (socket_change(g_Socket)) 
    { 
        
// Get the data 
        
socket_recv(g_Socketg_Data999)
    }
    
socket_close(g_Socket

site.com/player.php will return a data dictionary to player.
How do I interpret this dictionary?

I need the dictionary is in json. Or have another best method?

Last edited by Xablau; 01-04-2015 at 14:50.
Xablau is offline