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.

DarkBASIC Professional Discussion / Multisync - Connecting to server without asking for IP?

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Sep 2010 22:16
Hey guys!


I decided to finally download and implement Multisync into my current project, and came across a simple problem : Is there a way to connect to the server without asking for the IP address of the server?

DBP was able to do it by scanning for currently hosted net games, and then entering a server, but Multisync doesn't have this option...

What's the best way to solve this?

TheComet

thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 29th Sep 2010 22:57
Well, I'm pretty sure the native system worked because the TGC website can be used to get all the servers, but I might be totally wrong on that. I think the best way would to set up a master server either with a static IP or a DynDNS service, and then have all the servers running send a packet to the master server every ten minutes or so telling the server it is still running, and if not the server gets deleted off the list. You could then have the clients request the server list, and then make a menu that displays all of them along with the info.
The system I'm using in OpenFPS is based on just sending one string for the commands, with "&" to separate each section of the packet. Here's a few examples, Client refresh command to the master server would be "&cr"
The info command from the game server to the master server would be: "&Server Name&MapName&#OfPlayers"
That's just a rough system I have in place, not quite the best though, but the quickest I've seen. Also, if you do go with this system, I'd suggest using a different coding language such as python for the master server, that way you could buy a server and not have to worry about directX being installed. Python runs at very low CPU and most servers come with it installed.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Sep 2010 23:10
Oh, I forgot to state that I was just thinking of a LAN connection...

Thanks thenerd, I will keep that in mind when I want to move my game to be an online game

TheComet

Michael P
20
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 30th Sep 2010 00:27 Edited at: 30th Sep 2010 00:27
You can't do that with multisync, but you can with DarkNet.

With DarkNet you use a broadcast instance to broadcast a packet to all entities on a LAN. This packet usually contains the name, IP, port etc. of a server on the LAN which the recipient of the broadcast packet can then connect to.

And if you are really interested, here is the documentation for that system:
http://www.darknetworking.net/GeneratedDocumentation/html/class_net_instance_broadcast.html

Note that you can broadcast to a specific subnet too.

Xsnip3rX
19
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 7th Dec 2010 04:23
Michael, you're wrong.

it's very simple:

Michael P
20
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 7th Dec 2010 09:59
I don't think that's what he was asking. I think he wanted to know if it were possible to detect games that are running on the LAN and then connect to them without knowing what their IP and port were originally.

=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 7th Dec 2010 11:08
I worked around this issue by sending my IP address in a text file to an ftp folder on a webserver (using DBP's ftp commands, and a spare lump of webspace); then the 2nd pc would read the file from the webserver and be able to read the IP to connect to using Multisync.

I was using this method to connect computers across the internet, I see no reason why it shouldn't work on a LAN as well.

Hope it helps

Login to post a reply

Server time is: 2026-07-21 19:18:29
Your offset time is: 2026-07-21 19:18:29