Raised This Month: $ Target: $400
 0% 

[ socket_recv + json/data ]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:23.


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