Is it possible to search a Half-Life server via the Winsock control, and retrieve info from it ? If it is, could anyone tell me how to do it, just give me the theory...
Cheers!
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Good and bad news, good news is its possible, I attemped to do it before, but for the bad news, I dont know what commands to send once I connect to WON.NET, and I can not find ANY documentation, only people telling me to DL and study the SDK.. this is my program, I made it a long time ago, It isnt really a program, I just put some code together to see if I can connect to WOn.NET:
VB Code:
Option Explicit
Private Sub Form_Load()
Winsock1.RemoteHost = "half-life.east.won.net"
Winsock1.RemotePort = 6003
Winsock1.Connect
End Sub
Private Sub Winsock1_Connect()
Form1.Print "Connected"
Winsock1.SendData "update"
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Form1.Print "winsock1_connectionRequest invoked"
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Killer
Winsock1.GetData Killer
List1.AddItem Killer
End Sub
Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Form1.Print ("Error: " & Description)
End Sub
Private Sub Winsock1_SendProgress(ByVal bytesSent As Long, ByVal bytesRemaining As Long)
After you somehow get the servers to show, you can make code to open the server on click by using the shortcut, lets say for CS: itll be:
Shell("C:\SIERRA\Half-Life\hl.exe -noforcemparms -game cstrike -noforcemaccel -console +connect " & ServerIP,1)
could you guys tell us how to do it when you find out, that will be very nice.
Best Regards,
seec77
If you helped me, cosinder yourself thanked.
Get each and every Garfield strip here! Here you can get all Calvin & Hobes strips!
Damn UComics! It was probably unprofitable for them to allow us to just download Garfield and Calving & Hobes strips... so they made folder indexing unallowed on their server!!!
I installed the SDK, I am reading this file at the moment: maybe I should learn C/C++ first^_^
Request full server list from HL master server.
==================
*/
void Host_GetBatchServerList_f( void )
{
unsigned char c[10];
adrlist_t *p;
int i = 0;
// Request a server list from the master servers.
NET_Config( true ); // Initialize networking
if ( gfNoMasterServer )
return;
if ( !valvemaster_adr )
return;
c[0] = A2M_GET_SERVERS_BATCH; // ascii 'e'
i++;
*(int *)&c[1] = 0; // Request first batch.
i += sizeof( int );
p = valvemaster_adr;
while ( p )
{
// send to valve master
Con_Printf ("Requesting batch server list from %s\n", NET_AdrToString ( p->adr) );
NET_SendPacket (NS_CLIENT, i, c, p->adr );
p = p->next;
}
}
// Upon receiving ( 5 bytes, 4 for the -1 and 1 byte for the 'f' character ):
int32 -1
M2A_SERVER_BATCH // Ascii 'f', the response to the above
void CL_ParseBatchServerList( void )
{
char szAddress[128] = "";
unsigned char cIP[4];
int i;
unsigned short iIPPort;
int nNumAddresses;
int count = 1;
int unique = 0;
MSG_ReadByte(); // Skip \r
unique = MSG_ReadLong();
// So far we have read 6 chars. Remainder of message length is iBytesRead - 6
nNumAddresses = net_message.cursize - sizeof(int) - sizeof(unsigned char) - sizeof(byte);
// Each address is 6 bytes long
//
nNumAddresses /= 6;
while (nNumAddresses-- > 0)
{
memset(szAddress, 0, 128);
i found the answer to the problem!!
i attached a text file i found in the sdk... i don't really understand what it means, but i am 99% sure it is what you guys need!! who's the man?? *lol*
Best Regards,
seec77
If you helped me, cosinder yourself thanked.
Get each and every Garfield strip here! Here you can get all Calvin & Hobes strips!
Damn UComics! It was probably unprofitable for them to allow us to just download Garfield and Calving & Hobes strips... so they made folder indexing unallowed on their server!!!