tänkte fråga hur man öppnar sockets..
tänkte göra något liknande
http://www.webforum.nu/showthread.php?s=&threadid=15950&highlight=CounterStrike+info
i .NET ?
5 svar · 285 visningar · startad av Nickemannen
tänkte fråga hur man öppnar sockets..
tänkte göra något liknande
http://www.webforum.nu/showthread.php?s=&threadid=15950&highlight=CounterStrike+info
i .NET ?
Jag har försökt med UdpClient men fick inte något vidare resultat, ska testa igen med TcpClienten via UDP protokollet.
Här är en specifikation på hur protkollet fungerar:
HL SDK skrev:
Game servers will answer the following messages:
Messages are sent to the server by sending 4 consecutive bytes of 255
(32-bit integer -1) and then the string command followed by a zero byte
to terminate it"ping"
Server responds with a single byte code ASCII 'j'"info"
Server responds with the following packet:
(int32) -1
(byte) ASCII 'C' (info response, S2A_INFO)
(string) net address of server
(string) name of the host / server
(string) name of the map
(string) game directory (i.e. valve/)
(string) Game description (e.g. "half-life multiplay")
(byte) active client count
(byte) maximum clients allowed
(byte) protocol version (currently 7)"players"
Server responds with the following packet:
(int32) -1
(byte) ASCII 'D' (players response, S2A_PLAYER)
(byte) active client countfor each active client
(byte) client number / index
(string) player name
(int32) client's frag total
(float32) client's total time in-game"rules"
Server responds with the following packet:
(int32) -1
(byte) ASCII 'E' (rules response, S2A_RULES)
(int16) number of rulesfor each rule
(string) rule name
(string) rule value
tack!
Ett tips istället för att bara skicka
"info"
skicka
"infostring" istället man får mer data då
t.ex. vad det är för OS, Dedicerad eller ej, lösenord eller ej osv
vet inte, jag ville veta hur man laddade ner hela HL-server listan
Så jag fick tag på alla ip som fanns så jag satte en sniffer på min UDP och uppdaterade listan och då såg jag att hl skickade infostring istället för bara info.
Plus att jag kom på att man måste ju kunna se om den körs av en windows eller linux, dedicerad eller ej i hl listan