אני צריך סוקטים ( Socket ) לשרתים...
תודה
----------------------------------------------------------------------------
Cs-scokinfp
----------------------------------------------------------------------------
alias dfsfdffs {
sockclose csquery
set %ticde $ticks
bset &send 1 255 255 255 255 84 83 111 117 114 99 101 32 69 110 103 105 110 101 32 81 117 101 114 121 0
; bset &send 1 377 377 377 377 84 83 111 117 114 99 101 32 69 110 103 105 110 101 32 81 117 101 114 121 0
echo -a test >> $bvar(&send,1,$bvar(&send,0)).text
sockudp -k csquery $replace($1,:,$chr(32)) &send
echo -a test
}
on *:udpread:csqu*:{
sockread &reply
var %offset, %name, %map, %game, %num, %max, %ip, %dir
echo -a @@@ $bvar(&reply,1,$bvar(&reply,0))
if ($chr($bvar(&reply,5)) == m) {
%offset = 6
%ip = $bvar(&reply,%offset,128).text
inc %offset $calc($len(%ip) + 1)
%name = $bvar(&reply,%offset,128).text
inc %offset $calc($len(%name) + 1)
%map = $bvar(&reply,%offset,128).text
inc %offset $calc($len(%map) + 1)
%dir = $bvar(&reply,%offset,128).text
inc %offset $calc($len(%dir) + 1)
%game = $bvar(&reply,%offset,128).text
inc %offset $calc($len(%game) + 1)
%num = $bvar(&reply,%offset)
%max = $bvar(&reply,$calc(%offset + 1))
}
else {
%offset = 7
%name = $bvar(&reply,%offset,128).text
inc %offset $calc($len(%name) + 1)
%map = $bvar(&reply,%offset,128).text
inc %offset $calc($len(%map) + 1)
%dir = $bvar(&reply,%offset,128).text
inc %offset $calc($len(%dir) + 1)
%game = $bvar(&reply,%offset,128).text
inc %offset $calc($len(%game) + 1)
%num = $bvar(&reply,$calc(%offset + 2))
%max = $bvar(&reply,$calc(%offset + 3))
%pass = $bvar(&reply,$calc(%offset + 5))
}
echo -a Name: %name
echo -a Map: %map
echo -a Game: %game
echo -a Players: %num $+ / $+ %max
echo -a Ping: $calc($ticks - %ticde)
}
/dfsfdffs ip:port