Raised This Month: $ Target: $400
 0% 

Sockets & A2S


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 01-06-2006 , 10:42   Sockets & A2S
Reply With Quote #1

im all confused.. how do those a2s things work?
im trying to get A2S_INFO from a cs 1.6 server..

tried this, but it just says: "Lenght: 0, Text: ", which means that the server responds to me but why won't it send any data?
Code:
public send_request() {     new text[32]     setc(text,4, 0xff)     format(text[4],31, "TSource Engine Query")     setc(text[24],1, 0x00)     socket_send(socket, text,31)     set_task(0.5, "receive_info")     return PLUGIN_HANDLED } public receive_info() {     new recv[128]     while(socket_change(socket,1)) {         socket_recv(socket, recv,127)         client_print(0,print_chat, "Lenght: %d, Text: %s", strlen(recv), recv)     }     return PLUGIN_HANDLED }

if i replace the "TSource Engine Query" with "W" (which is the challenge request thingy) i get "Lenght: 6, Text: " (in spite of that recv[4] is "A", but thats it..)
__________________
plop
p3tsin is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 01-09-2006 , 08:17  
Reply With Quote #2

come on, surely sum1 knows about that A2S stuff ..?

just give me anything to get on with this.. or another way of getting the server status
__________________
plop
p3tsin is offline
More
Member
Join Date: Nov 2004
Location: Internet
Old 01-09-2006 , 15:49  
Reply With Quote #3

each command that is send to the server and back has 4 special digits in front. you need to send them infront of your command if you want the server to respond.
here they are in php code:

pack('N', 0xFFFFFFFF)

sry i dont know how to make them with small
More is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 01-10-2006 , 08:41  
Reply With Quote #4

umm, yeah, but isnt that the same as this ?
Code:
setc(text,4, 0xff)
__________________
plop
p3tsin is offline
Reply



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 15:58.


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