Hi,

I am in the process of making an application to query Quake 3 servers, but I am starting with querying the master server as I'd like to get the server list down so I can then start to query them individually.

I've read through a number of threads on various forums and while it has helped me to an extent, I've hit the proverbial brick wall.

My code is like this:

Option Explicit

Private Sub Command1_Click()
    Winsock1.Close
    
    Winsock1.RemoteHost = "monster.idsoftware.com"
    Winsock1.RemotePort = 27950
    
    Winsock1.Protocol = sckUDPProtocol
    Winsock1.Bind

    Winsock1.SendData "ÿÿÿÿgetservers 68 'empty'"
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    
    Text1.Text = "Data Received" & vbCrLf
    Dim strData As String, DataString
    Winsock1.GetData strData, vbString
    DataString = DataString & strData

    Text1.Text = Text1.Text & DataString & vbCrLf
    
End Sub

When I run the app, and click the button (Command1), I get the following into the text box (Text1):

Data Received
ÿÿÿÿgetserversResponse\úym8\YjDmV\ÑÕÖŽm8\WbÚŠm8 \>@mB\Õû†Gm8\>KÞem8\Âiâfm9\>@m8\Âiâfm:\SˆYzq \UƒÝi‚\Uƒ‰3i‡\X¿7m8\X•—Éi\UÈsm8\JV-(mB\ÁÊsÝm9\ÂmE[m8\RÀNmB\?Ón8m8\Õäm8\úym;\Ãz‡PÃP\B–¼fm8\Î/»m8\U–um8\Âiâlm:\Î{FŠm8\U“¨m:\RÀNm8\Aµm8\EÜ?m\RÀNm8\B7Ÿ†m8\EqÂXm8\K~†ÁmB\X•—Êi{\Âiâ fm<\>QàÉm9\ÔH¯m;\Âiâlm<\U
ÄÆmB\>Qòu0\>QàÊm8\BÕÄem8\X•—Éi„\Á*Úm@\X•—Êi„\ȱå mB\ÔH¯Sm9\>•Ì•m8\úym=\ %m8\>K›m8\Km8\>QàÉm8\†Üˆm8\Ù—¦m8\[yV§m;\U
ÁTm8\EÜm\Ã
>o¸\ÎûIâmB\EOT

What do I need to do with that gobbledigook in order to make it readable, or is it meant to be like that, I capture it and send another message back over winsock?

Any help will be massively appreciated.

Thanks,

Jon

Hi,

I am in the process of making an application to query Quake 3 servers, but I am starting with querying the master server as I'd like to get the server list down so I can then start to query them individually.

I've read through a number of threads on various forums and while it has helped me to an extent, I've hit the proverbial brick wall.

My code is like this:

Option Explicit

Private Sub Command1_Click()
    Winsock1.Close
    
    Winsock1.RemoteHost = "monster.idsoftware.com"
    Winsock1.RemotePort = 27950
    
    Winsock1.Protocol = sckUDPProtocol
    Winsock1.Bind

    Winsock1.SendData "ÿÿÿÿgetservers 68 'empty'"
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    
    Text1.Text = "Data Received" & vbCrLf
    Dim strData As String, DataString
    Winsock1.GetData strData, vbString
    DataString = DataString & strData

    Text1.Text = Text1.Text & DataString & vbCrLf
    
End Sub

When I run the app, and click the button (Command1), I get the following into the text box (Text1):


What do I need to do with that gobbledigook in order to make it readable, or is it meant to be like that, I capture it and send another message back over winsock?

Any help will be massively appreciated.

Thanks,

Jon

First thing to need to do is Remove the ÿÿÿÿgetserversResponse\ from the code then you need to convert it back to a string and then split it and put it back all that contains is a bunch of IP's and ports im not 100% sure how to do it on VB. net im currently messing around with it in C#.Net

maybe if you have msn or AIM you can message me and i'll see what i can do to help..
MSN: Hotboyrizzle@hotmail.com
AIM:Hotboyrizzle

MSN is also my main email..


i have a program built in c#.net not 100% complete but it does the job if getting Ip's
Shown below........

The Jibberish is before the data is converted..

==================================================================
Quake 3 Master Server Query Tool.
Version 1.3a
By: Kasper
==================================================================
[SAVING TO]:Q3Servers.cfg
[MASTER]:monster.idsoftware.com:27950
[Transfer Type]:UDP
[DataToSend]:ÿÿÿÿgetservers 68 'empty'
[Saving To]:F:\Projects\C_Sharp\My Projects\Query Tools\Quake3\bin\Debug\Q3Servers.cfg
Connecting...
Sending Request...
Degugging...
>?*xm=\>?*xm9\???
?2\Y???n?\??↕?mR\??↕?m>\???♀m9\? ????\?r◄H♠
\???♀?g\???♂m8\?r◄H♦\???♂??\?W←ek?\?*??m8\???
m9\U?←  ?5\???
??\?r◄]m2\?W←ek?\u/z?'?\?r◄]m<\?W←ek?\???♫??\?W←ek?\CL>?m<\@"?↕mO\@"?↕m!\@"?↕m
m8\?W←e?B\X?↓5}♦\Y???pd\???♀??\???
m8\???♂??\X?↓5u4\???
??\G?D↔l?\???♀?R\W????P\???♂?:\???
?►\>?*??Y\>?*???\Y???q?\Y???o7\>?*??}\???♀??\>?*???\???♂??\?O??~-\???
?↑\?O??~?\U◄?Gl4\U◄?GlR\U◄?slf\Dn♂↑?z\Y???q?\???♀?D\???♂?\\??8&f?\U§??U?\? ????\
???
??\???♀?‼\U??♀m8\???♂?v\?+☼xm8\?+☼?m>\?+☼?m8\???
??\G?D↔l?\?+☼?m8\?+☼+m8\???♫?Y\?+☼?m8\?+☼?m8\?+☼?m8\?+☼Mm8\?+1?m8\?+☼?m8\EOT
Press Enter to List servers

Query Adress:
62.63.42.120:27965

----------------------
Press Enter to List servers
Query Adress:
62.63.42.120:27961

----------------------
Press Enter to List servers

Query Adress:
63.63.63.10:16200

----------------------
Press Enter to List servers
Query Adress:
62.63.42.120:24383

----------------------
Press Enter to List servers

Query Adress:
87.63.63.63:16226

----------------------
Press Enter to List servers
Query Adress:
63.63.63.14:16191

----------------------
Press Enter to List servers

Query Adress:
89.63.63.63:28223

----------------------
Press Enter to List servers
Query Adress:
69.64.95.63:27960

----------------------
Press Enter to List servers

Query Adress:
63.63.63.13:16178

----------------------
Press Enter to List servers
Query Adress:
89.63.63.63:28223

----------------------
Press Enter to List servers

Query Adress:
63.63.18.63:27986

----------------------
Press Enter to List servers
Query Adress:
63.63.18.63:27966

----------------------
Press Enter to List servers

Query Adress:
63.63.63.12:27961

----------------------
Press Enter to List servers
Query Adress:
63.32.63.63:16191

----------------------
Press Enter to List servers

Query Adress:
63.114.17.72:1546

----------------------
Press Enter to List servers
Query Adress:
63.63.63.12:16231

----------------------
Press Enter to List servers

hope this gives you an idea

oh and you need to process the incomming data with a function
being thats only part of your program theres not much i can go off of..

Hi DaKasper,

Thanks for your reply, I will set about removing the ÿÿÿÿgetserversResponse\ from the incoming text now and go from there.
I'm using VB6 for this, but am unsure how I would go about converting the incoming gibberish to a string - is it like doing a CStr(strData) or something? I guess there is only one way to find out!!

Would be great if we could both figure this out between us. I don't know about you, but I've been scratching my head for weeks trying to figure this out and I finally stopped being stubborn and put up a question on a forum instead :)

Thanks again,
Jon


Edit: Well foolish me for thinking it could be all so straight forward!
CStr(strData) failed miserably, so I'm back to square one :)

Another Edit: Just noticed DaKasper, it's your first post here - welcome to Daniweb :)

Update:

I've managed to figure it out (by accident as it happens). DaKasper, you helped by saying I needed to convert it to a string - on hunting google, I managed to find that each character in the gibberish is like an ASCII character. The decimal value of a character is the part of the IP.

Between each \ marker, there is 6 bytes of data. The first 4 bytes is the IP (one byte per octet) and the final 2 bytes make up the port number (sum of first byte * 256 + sum of second byte)

So for example:
J4ƒ9m8 is equal to 74.52.131.57:27960

J = 74
4 = 52
ƒ = 131
9 = 57
m = 109
8 = 56

109 * 256 + 56 = 27960

Therefore as above, the server address is 74.52.131.57:27960

However, while I can work out the 6 byte addresses, the 5 byte ones don't seem to work (as my code stops when it reaches the \ marker and starts again on the next IP) - I presume I need to recognise if there isn't a 2nd byte for the port number and base my calculation on the first byte * 256 only?


Thanks,

Jon

theres alot of ips in that and you need to either slpit each one put them all into a file then query each IP or Get a IP Query it then goto the next one and so on

When you Query the Master Server all you get is a list of the Severs IPs and Port Numbers
and Querying the Servers Seemed like a big pain to me so i looked around the internet and found a protocal i used for it.

if you have any questions about it just ask...

Later..


Oh yeah you should try VB.net
if you like 6.0

Hi DaKasper,

I managed to get the output from the master server, dumped it into a text file. I'm in the process of pulling the IPs back into the application, and can get info back about the servers, but am struggling a bit with the format of what I'm receiving.

With the help of a work colleague, I've got the server info into a listview control and can get server details into another listview, but now I'm at the point where I am looking to be able to update the listview, but without clearing it out and re-populating it, I don't know if I can update it to show new player numbers or new ping etc.

What is this protocol you mentioned to do the querying instead?

I will start picking up .net in the future, but I use VB6 at work, so am using it at home to expand my knowledge of it.

Hi DaKasper,

I managed to get the output from the master server, dumped it into a text file. I'm in the process of pulling the IPs back into the application, and can get info back about the servers, but am struggling a bit with the format of what I'm receiving.

With the help of a work colleague, I've got the server info into a listview control and can get server details into another listview, but now I'm at the point where I am looking to be able to update the listview, but without clearing it out and re-populating it, I don't know if I can update it to show new player numbers or new ping etc.

What is this protocol you mentioned to do the querying instead?

I will start picking up .net in the future, but I use VB6 at work, so am using it at home to expand my knowledge of it.

This is how i know it works you Get the info from the master Server IPs only after your done you then have to Query each server. I donno how its done on VB6 but VB.net is best used for multi threading that because it takes alot of time it seems for me to Query each server. From what i know this method sucks. I Think you should get all the info from the server. but yeah all that info your getting is just the IPs

heres a site i found that might come in handy for you but i donno.

http://int64.org/docs/gamestat-protocols/index.html

This article has been dead for over six months. Start a new discussion instead.