cs_Urizen
Messages postés3Date d'inscriptionvendredi 2 août 2002StatutMembreDernière intervention 6 août 2002
-
4 août 2002 à 14:14
cs_seby54
Messages postés1Date d'inscriptionjeudi 26 décembre 2002StatutMembreDernière intervention21 juin 2005
-
21 juin 2005 à 14:00
voila tout en ds le titre su sujet, je voudrai récuperer les info d'un serveur half-life, liste des joueurs nb de frags etc...
comment faire a partir de VB
cs_Urizen
Messages postés3Date d'inscriptionvendredi 2 août 2002StatutMembreDernière intervention 6 août 2002 6 août 2002 à 22:08
ben en fait c pour rechercher un pseudo en particulier ds une liste de serveur commune a plusieur pote, voila en gros, j'ai essayer avec winsock mais y veux pas se connecter, si tu trouve la solution t'es mon idole qq part merci aa+____
Vous n’avez pas trouvé la réponse que vous recherchez ?
cs_GRenard
Messages postés1662Date d'inscriptionlundi 16 septembre 2002StatutMembreDernière intervention30 juillet 20081 9 déc. 2002 à 22:07
moi g trouver :)
ca va etre dans mon programme... sauf que j'ai un tit bugs... genre je recois 4 chiffres et la jsais pas koi faire avec ca pour les mettre en client-time
cs_krust
Messages postés140Date d'inscriptionmercredi 3 juillet 2002StatutMembreDernière intervention19 novembre 2006 16 déc. 2002 à 21:26
====================================
KRUST
c'est bien sympa de nous le dire mais dit nous plutôt comment :p
j'ai lut le sdk de hl
voilà ce qu'il dit :
faut utiliser udp et non tcp ip pour la connect
il faut envoyer 4 fois un integer 32bit contenant 255 à la connect
ensuite pour chaque commande faut:
envoyer 4 bit à zero puis envoyer la commande que vous sauhaitée : enfin voilà le texte orgiinal :
Note to those writing remote admin programs that issue rcon commands (the in-client rcon commands work as before), you will need to change your rcon tools to use the following revised protocol.
Remote App sends a UDP packet to the server on the server's port (e.g., 127.0.0.1:27015):
The packet should start with 4 consecutive bytes of 255 (32-bit integer -1) and the string:
"challenge rcon\n".
The server will respond to the requesting system on the purported remote IP address and port with four 255's and:
"challenge rcon number\n" where number is an unsigned int32 number.
To issue the actual rcon, the remote App then responds with a UDP packet containing 4 255s and:
"rcon number "password" rconcommands" where password is the rcon_password ( should be enclosed in quotes as noted so that multiple word passwords will continue to work ), number is the unsigned int32 number received from the server and rconcommands is the actual rcon command string.
If the remote App fails to send the appropriate challenge number, waits too long to send the challenge, or uses an invalid password more than a few times in the course of a few seconds, the remote App will be assumed to be malicious and the actual ip address used by the remote host will be permanently and automatically banned from the server (as with the addip command). You can use listip to see the list of banned ip addresses on a server.
-----------------------------
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 count
for 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 rules
for each rule
(string) rule name
(string) rule value
// This is followed by as many 6 byte ip addresses as will fit in the message. The master currently feeds about 2K worth of IP address ( 300+ or so ), but we may up that # significantly in the near future.
(4 x byte) ip address
(int16) port #
The old protocol is still valid, but there is a new, extended protocol:
Here are both the old and new protocols ( the new one is the "details" message ):
"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 37)
"details"
(int32) -1
(byte) ASCII 'm' ( S2A_INFO_DETAILED )
(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 37)
(byte) type of server == 'l' for listen or 'd' for dedicated
(byte) os of server == 'w' for win32 or 'l' for linux
(byte) password on server == 1 or yes, 0, for no
(byte) is server running a mod? == 1 for yes, 0 for no
IFF the server is running mod byte was 1:
(string) URL for mod's "info" website
(string) URL for mod's download ftp server
(int32) mod version #
(int32) mod download size ( in bytes, approx. )(byte) is the mod a server side only mod? 1 yes, 0 no(byte) does this server require you to have a custom client side .dll ( client.dll )? 1 yes, 0 no.
====================
a plus Krust :p
====================
cs_GRenard
Messages postés1662Date d'inscriptionlundi 16 septembre 2002StatutMembreDernière intervention30 juillet 20081 17 déc. 2002 à 01:44
bravo tu as trouvé, la seule chose qui ne marche pas c'est le getting des serveurs par le master... disons qu'on ne prend que comme il dit 300 serveurs mais comment faire pour avoir le reste ? de plus en VB comment faire pour utiliser la putain de fonction unpack qui se trouve en C et en php !?!? car c'est le plus utile pour par exemple l'ip du serveur CS (celle la jlai meme pas trouvé en php c quoi le format) et ca sert pour le time du players... ca c float :p
mais alors en VB C'EST KOI !!!!
kaoul
Messages postés2Date d'inscriptionmercredi 4 février 2009StatutMembreDernière intervention 4 février 2009 29 juil. 2003 à 20:35
----------------------
Lu les programmeurs
----------------------
J'ai besoin de la mm chose... En plus si quelqu'un connait une commande pour obtenir le score des equipe CT et Terro (c'est pour un prg qui recupere les scor des matchs)
Je n'arrive toujours pas a me connecter aux serveurs par ce moyen, je ne sais pas comment envoyer les données par udp quelqu'un pourrait-il ecrire le code en entier ? Voici le mien mais faites attentions je suis nul il doit être faux :
Private Sub Command1_Click()
' Envoie le texte dès qu'il est tapé.
Dim dccc As Byte
dccc = 255
udpPeerB.SendData (dccc)
udpPeerB.SendData (dccc)
udpPeerB.SendData (dccc)
udpPeerB.SendData (dccc)
udpPeerB.SendData (txtSend.Text)
End Sub
Private Sub Form_Load()
' Le nom du contrôle est udpPeerB
With udpPeerB
' IMPORTANT : assurez-vous de changer la
' valeur de RemoteHost pour lui donner le nom
' de votre ordinateur.
.RemoteHost = "Kaoul"
.RemotePort = 27015
' Port auquel on se connecte.
.Bind
' Établit le lien avec le port local.
End With
End Sub
Private Sub udpPeerB_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
udpPeerB.GetData strData
txtOutput.Text = strData
End Sub
cs_seby54
Messages postés1Date d'inscriptionjeudi 26 décembre 2002StatutMembreDernière intervention21 juin 2005 21 juin 2005 à 14:00
Suite a l'arrivée de VAC2 les requettes ont malheureusement changées.
Voici les nouvelles dite moi ce que vous en pensez et si vous arrivez a les piloter.
au passages il me semble que "ping" fonctionne toujours.
récuperer les infos d'un serveur half life avec VAC2
****************** VAC2, Server Queries for counter Strike 1.6 & Condition zero & source ********************
The Source engine allows you to query information from a running game server using UDP/IP packets.
This document describes the packet formats and protocol to access this data.
---- Basic Data Types ----
All server queries consist of 5 basic types of data packed together into a data stream.
Name Description
byte 8 bit character
short 16 bit signed integer
long 32 bit signed integer
float 32 bit float value
string Variable length byte field, terminated by 0x00
---- Query Types ----
The server responds to 4 queries:
A2S_SERVERQUERY_GETCHALLENGE - Returns a challenge number for use in the player and rules query.
A2S_INFO - Basic information about the server.
A2S_PLAYER - Details about each player on the server.
A2S_RULES - The rules the server is using.
Queries should be sent in UDP packets to the listen port of the server, which is typically port 27015.
*** A2S_SERVERQUERY_GETCHALLENGE ***
Request format
Challenge values are required for A2S_PLAYER and A2S_RULES requests, you can use this request to get one.
Note: You can also send A2S_PLAYER and A2S_RULES queries with a challenge value of -1 (0xFF FF FF FF FF FF FF FF) and they will respond with a challenge value to use (using the reply format below).
FF FF FF FF 57
Reply format
Data Type Comment
Type byte Should be equal to 'A' (0x41)
Challenge long The challenge number to use
Type byte Should be equal to 'I' (0x49)
Version byte Network version
Hostname string The Servers name
Map string The current map being played
Game Directory string The Game type
Game Description string A friendly string name for the game type
AppID short Steam Application number (currently always set to 0)
Num players byte The number of players currently on the server
Max players byte Maximum allowed players for the server
Num of bots byte Number of bot players currently on the server
Dedicated byte Set to 1 for dedicated servers
OS byte 'l' for Linux, 'w' for Windows
Password byte If set to 1 a password is required to join this server
Secure byte If set to 1 this server is running VAC
Game Version string The version of the game
Reply format (Counter Strike : 1.6 & Conditon Zero)
Data Type Comment
Type byte Should be equal to 'm' (0x6D)
Game IP string Game Server IP address and port
Hostname string The Servers name
Map string The current map being played
Game Directory string The Game type
Game Description string A friendly string name for the game type
Num players byte The number of players currently on the server
Max players byte Maximum allowed players for the server
Version byte Network version
Dedicated byte Set to 'd' for dedicated servers, 'l' for listen
OS byte 'l' for Linux, 'w' for Windows
Password byte If set to 1 a password is required to join this server
IsMod byte If set to 1 this packet has a mod details section, 0 otherwise
URLInfo string (MOD Detail Only) URL containing information about this mod
URLDL string (MOD Detail Only) URL to download this mod
Unused string (MOD Detail Only) Will always be an empty string
ModVersion long (MOD Detail Only) Version of the installed mod
ModSize long (MOD Detail Only) The download size of this mod
SvOnly byte (MOD Detail Only) If 1 this is a server side only mod
ClDLL byte (MOD Detail Only) If 1 this mod has a custom client dll
Secure byte If set to 1 this server is running VAC
Num of bots byte Number of bot players currently on the server
*** A2S_PLAYER ***
Request format
FF FF FF FF 55 <4 byte challenge number>
The challenge number can either be set to -1 (0xFF FF FF FF FF FF FF FF) to have the server reply with S2C_CHALLENGE, or use the value from a previous A2S_SERVERQUERY_GETCHALLENGE request.
Reply format
The players response has two sections, the initial header:
Data Type Comment
Type byte Should be equal to 'D' (0x44)
Num Players byte The number of players reported in this response
Then for each player the following fields are sent:
Data Type Comment
Index byte The index into [0.. Num Players] for this entry
Player Name string Player's name
Kills long Number of kills this player has
Time connected float The time in seconds this player has been connected
***A2S_RULES
Request format
FF FF FF FF 56 <4 byte challenge number>
The challenge number can either be set to -1 (0xFF FF FF FF FF FF FF FF) to have the server reply with S2C_CHALLENGE, or use the value from a previous A2S_SERVERQUERY_GETCHALLENGE request.
Reply format
The rules response has two sections, the initial header:
Data Type Comment
Type byte Should be equal to 'E' (0x45)
Num Rules short The number of rules reported in this response
Then for each rule the following fields are sent:
Data Type Comment
Rule Name string The name of the rule
Rule Value string The rules value