Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Master server

Author
Message
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 21st Jan 2014 12:55
I was wanting to create a master server that lists dedicated servers (ie client connects to master server, gets list of all game servers, select the desired server to play on, then connect to it.) The problem is that there is no command to gather each server's IP address. Without an IP address, how can the master server direct the client to the desired game server? Anybody have ideas and/or suggestions?

Thank you!
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 21st Jan 2014 18:54
Your master server will run two servers; one for connecting normal clients (player), and another to which the slave servers will connect. The only issue is that your slave servers must know the master server's IP at all times but that can be ensured with relative ease.


"Why do programmers get Halloween and Christmas mixed up?"
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 22nd Jan 2014 05:00 Edited at: 22nd Jan 2014 05:04
Thank you for your reply, but that doesn't really answer anything. How will the master server be able to direct connecting clients to their appropriate dedicated servers, being run on other computer elsewhere, if the master server isn't able to give each client the IP address for that dedicated server?

*Edit: perhaps I could make it a requirement in the dedicated server config file to put the IP address in it and the server will send this to the master server as a string.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Jan 2014 11:38
The master server will obtain the IP address of any incomming connections, including those from the other servers


"Why do programmers get Halloween and Christmas mixed up?"
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 22nd Jan 2014 12:40 Edited at: 22nd Jan 2014 12:41
Yes, but there are no commands in the API to actually get those addresses. Thus, you can't tell the client what address to connect to.

For example, there's no way to:
*Dedicated server connects to master server
*Master server adds dedicated server to list of servers
*Client connects to master server and gets list of servers
*Client tells master server which server it wants to connect to
*Master server gives IP address to client, so it can connect to it

The last step is the problem. There is no command to get a string containing the IP address of each dedicated server. Yes, the master server internally knows the connection info, but there's no way to access it.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 22nd Jan 2014 18:41
What API are you using?
The built-in one is pretty much useless; I would recommend DarkNET or Multisync* if you want a free alternative. Both of those should allow you to see the IP and port number of an incoming connection. They also allow tonnes more compared to DBPro's basic net support.


* I think Multisync only works with TCP, while DarkNET also exposes UDP functionality.


"Why do programmers get Halloween and Christmas mixed up?"
Gunslinger
16
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 4th Feb 2014 14:10 Edited at: 4th Feb 2014 14:12
Dont use the standard GDK functions.
Check out Winsock Tutorials, isnt that hard...

e/ I would use a console app for a masterserver - not a DGDK project anyway.
So you could easy make it crossplattform.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Feb 2014 17:58
It's pretty easy to get the IP address.

Just use the HTTP commands to access a website that returns your IP address. (There is one on the game creators website, but I cant remember the address.) Then your slave app will connect to the server and give it the IP address. The server will store the IP address in a table relating to whatever server is hosting that particular game.

For example, the main server will have a database something like this.

Server01Table
Slave IP Addresses: 1.1.1.1, 2.2.2.2, 3.3.3.3 and so on.

Server02Table
Slave IP Addresses: 4.4.4.4, 5.5.5.5, 6.6.6.6 and so on.


Server01 will connect to the master server and look for new IP address, then allow that machine to connect.

Likewise, the slave will ask the master server for the IP address for the selected server to initiate the connection.


If this makes sense??

Login to post a reply

Server time is: 2024-04-20 06:00:09
Your offset time is: 2024-04-20 06:00:09