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] Basics of connecting to another computer?

Author
Message
Alaror
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 2nd Mar 2012 00:11 Edited at: 2nd Mar 2012 00:22
Fair warning: I know very little about anything relating to networking or multiplayer. My problem is probably as basic as it gets

I've been working on getting multiplayer functional in my game using the Multisync DLL over the past few says, and am at the point where I can run two copies of the game on my computer and have one connect to another using the default IP address (127.0.0.1). Because this is working I know my code is correct, but I'm having trouble when trying to connect to other computers.

I used this webpage to find my computer's IP address, which I wanted to use as the host for this test. When I tried connecting to that IP address on another computer using the same wireless network it failed. What steps need to be taken to allow the second computer to connect to the game being hosted on the first? Is there anything specific to the Multisync DLL that needs to be done?

Jean Philippe
18
Years of Service
User Offline
Joined: 10th Jul 2007
Location:
Posted: 2nd Mar 2012 01:21 Edited at: 2nd Mar 2012 01:22
I know i have to forward port 3999 on my router to get multisync to work. Have you tried it?
Gunslinger
19
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 2nd Mar 2012 01:56 Edited at: 2nd Mar 2012 02:00
You have to use your internal network IP if you want to connect with a computer in the same network.

On that page is a tutorial howto get that IP. (cmd -> ipconfig)

So
If you want to connect from your own computer, on a server running on your own computer, you have to use the localhost IP: 127.0.0.1

If you want to connect from another computer in your network, to a server running on your own PC, you have to use your network IP: something like 192.168.x.x

if you want to connect from 'outside' (internet), you have to use that IP Address that is shown on the Webpage. And maybe forward the ports on your router.
Alaror
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 2nd Mar 2012 02:23
Thanks for the replies!

I tried forwarding the port but as Gunslinger said, it didn't work. I used the cmd -> ipconfig method and got two results similar to what you said they'd be. The first was listed as "IPv4 Address" and the second was "Default Gateway." The other computer is being used right now but hopefully I'll get a chance to try those out soon.

Millenium7
21
Years of Service
User Offline
Joined: 13th Dec 2004
Location:
Posted: 2nd Mar 2012 06:05
the IPv4 address is the computer's local address within the network, so that's what you'll want to be connecting to. In most cases it'll work straight up as routers rarely block internal ports
You may however have to disable any software firewalls, or allow access
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 3rd Mar 2012 02:04 Edited at: 3rd Mar 2012 02:19
the IPv4 LAN address connection should be pretty simple, you don't even need to mess with port forwarding. Just make sure that your security settings allow the connection and remember that this address will likely change regularly.

For the external internet IP, you will need to set up port forwarding. the best way to get everything configured is to log in to your router. The default gateway address is the router and most have a configuration page which can be accessed by entering this ip into a web browser. Unless it's specifically been changed it probably uses a default log in like admin:admin or admin:password

http://portforward.com/help/pfprogression.htm

is a good resource for networking info and getting this sort of thing working, and they have an extensive list of routers and logins.

finally, I put this together back when I was trying to get this stuff figured out. I've never had issues using port 8000 but you can change it to whatever you want. the getIP$() function for getting your external IP came from somewhere on these boards though I forget now who it was from.

I've successfully connected using computers both inside and outside the network with this. get your connectivity working here and you should be able to adapt it to your project.



Login to post a reply

Server time is: 2026-07-09 20:55:03
Your offset time is: 2026-07-09 20:55:03