1

Topic: How can i connect to master servers?

Hello,
How can i connect to master servers in delphi 7?

I saw, some ppl made php-files with server information.
I want make program, that show me all servers, like http://test.teevision.eu/test/index.php

So, tell me how connect to master servers please smile

2

Re: How can i connect to master servers?

There should be PHP sourcecode around here somewhere. If you don't find anything you can check out the source of my Python lib which is rather hard to follow though because it's event based or look into the Teeworlds source directly.

3 (edited by TT <3 2012-06-28 04:07:27)

Re: How can i connect to master servers?

Install the Indy components in Delphi. They make it a lot more easier.

For TW you need a UDP-Client, after you installed the components you can find it in the clients-tab in Delphi.
Also read the TW-source to know what data you must send to the server and read the manuals to learn how to use these components.

4

Re: How can i connect to master servers?

Thanks!

5

Re: How can i connect to master servers?

I posted the PHP script here: https://www.teeworlds.com/forum/viewtopic.php?id=9499
So you can have a look on how I did it.

I'm not familiar with Delphi, but you basicly can request the 0.6 server list like this:
* Send UDP package to masterserver containing data: \xff\xff\xff\xff\xff\xff\xff\xff\xff\xffreq2
* Read response. Always read 1364 bytes because this is the maximum package size and does make it easier.
* Cut off first 14 bytes of the response and check against \xff\xff\xff\xff\xff\xff\xff\xff\xff\xfflis2.
* Cut rest in parts of 18 bytes where the first 16 bytes are the IP and the last 2 bytes the port.
* If you got 75 servers out that one response, you'll need to read 1364 bytes again. And again, until you get less than 1364 bytes back. (This is not very clean, but there is no clean way to check how long the whole response is.)

6

Re: How can i connect to master servers?

Ok )