AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sockets & A2S (https://forums.alliedmods.net/showthread.php?t=22891)

p3tsin 01-06-2006 10:42

Sockets & A2S
 
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..)

p3tsin 01-09-2006 08:17

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

just give me anything to get on with this.. or another way of getting the server status :)

More 01-09-2006 15:49

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

p3tsin 01-10-2006 08:41

umm, yeah, but isnt that the same as this ? :o
Code:
setc(text,4, 0xff)


All times are GMT -4. The time now is 15:58.

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