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.

Newcomers DBPro Corner / what to do with IP in multiplayer?

Author
Message
White Mink
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: USA
Posted: 23rd Feb 2004 21:42
hi, ive made a simple text chat program and i have gotten it to work on my local machine.

However i have not been able to get it to work across the internet.

I have only had a chance to test it against one machine.

Im new to DBP and have never played a game multiplayer using IP addresses other then on a local network.

on my local network i have never had to specify a IP to find a game.

And that is my problem i could really use some help with what exactly i should put in as my IP.

Do i use the IP that i can find by going to various websites? or do i need to find out what my ip is before it goes through my router or ISP?

thank you.

ps...pretty sad when you have to get help on how to use your own program...

__________
White Mink
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 23rd Feb 2004 22:55
Search about the forums, this topic has been brought up several times recently with some interesting solutions and advice.
--
TAZ

CKy
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location:
Posted: 24th Feb 2004 00:43
hey white mink, i was curious, could u show me the code u used for your program? im interested to see how to code network stuff with dbp. I am used to winsock programming with vb6, but not DBP... and maybe im not looking hard enough... but i cant see much control.
ie:
setting a port
choosing LAN,TCP/IP
connecting to a specific IP

lol i will look it up, but i just need a little bit of an example
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 24th Feb 2004 01:19
I am the guy who can help you out, since net is the only thing I do in Dark Basic. I can only help you out with DBP though being I never took the time to learn it in my DBC version.

Ok the reason the program may have failed with the other machine is that either of the two machines is behind a firewall that has not been deactivated.

If that is not the case then it is a problem with either yours or the other persons ISP.
If that is the case and it is yours with the problem then there is nothing you can do.

Rarely I find it to be the code with the error being that most of the time the connection codes are about 3-5 lines of simple commands.

Now... Since you said its asking for your IP, then that means you must be using default net game to connect. Thats fine, there is nothing wrong with that, but you need to type in the hosts IP.

Say you are the host. You just have to click OK when it asks. But for other people joining, they must type in your IP address to connect.

You can find you IP address by going here http://www.whatismyip.com

If you have any questions or if I failed to answer your question please let me know. I will be posting a net code on my site soon so you may want to check it out.

Hope I helped
Nicolas

White Mink
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: USA
Posted: 24th Feb 2004 01:43
CKy
here's some of the code, if you want more just ask. My program is basically a souped up version of one the one in Begginner's Guide to Dark Basic Programming. Mine has some features it doesnt and i think they tried to make the screen scroll but their's dindt work.

so yeah you can choose which connection you wnat, i dont remember what they are but i know you can do tcp/ip of course. Lan is the same thing just let the program search for an ip, least thats what i always did when playing TotalA over a lan.

as far as selecting an ip, you can do that, wether it works or not i cant say for certain since i havent gotten my program to connect over the internet yet.

Smokie, do you know if there is a way to set your firewall to allow tcp/ip without just turnning it off?

And thank you everyone who replied i really appreciate it.

__________
White Mink
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 24th Feb 2004 02:55
I have no clue if there is a way to set your firewall to allow usage with IP connections since I do not have a firewall on my computer.

All I know is that the results for most people change when they turn the firewall off.

Hope I helped
Nicolas

The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 24th Feb 2004 03:26
White Mink..
I have added a very decent net connection code to my websites snippet page. The code is a direct net connection.

Direct Net Connection is when the users at no point in time have to type in an ip address to log into the game. The host (Person who compiles it) has to type in there IP address and then that is it. In a matter of seconds the users are connected.

I find this way the best and easiest.

Well, I advise if you have not found a working solution to check mine out at [href]www.yobarinteractive.tk[/href] because for sure I know that one works. Have tested it with many people.

Hope I helped.
Nicolas

White Mink
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: USA
Posted: 24th Feb 2004 05:29
thanks i appreciate the code.

If you wouldnt mind, could you explain how this code works? The code im using seems remarkably similar except that the host doesnt have to state the ip, according to the remarks in the code from the book setting the ip to " " will make it the host.

Basically i just dont understand the client side i think.

thank you once again, i appreciate any help you give to me.

__________
White Mink
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 24th Feb 2004 05:52
Hmmm...
Are you building both a server and a client or just a client. In other words
C2S or C2C

My code, Yes I would gladly explain it.



That would be the code.

1. At the beginning the IP$ represents the IP to connect to.

2. You must input a username because it will not connect unless there is a username.

3. After inputing, it will show its connecting. Did this so users dont think there PC froze.

4. Performed A Checklist For net connections to see how many are available for use.

5. The for/to loop is a quick way of finding out the three net connections after performing the checklist.

6. "Internet TCP/IP Connection For DirectPlay" is one of the three net connections.

7. If that is one of them then set the connection

8. The default net game is the same as it was before except now it wont prompt you for an ip when you try to play. Its like that now becuase of directions 4-7.

9. Your now connected so you must goto a new loop because beleive me you dont want to get caught in the repeative state of connection.

Ok now that we've got that taken care of. Congradulations your connected.
In this new loop you can have whatever you want to have. Just got to know the very simple net commands. (Hardest net command you'll find is the receiving command, which isnt too hard when you get used to it.)

Um... that should cover it. If you need some more help let me know.
If you have MSN Messeger then you can IM me. I think I might make up a full net deal for my site. Maybe add the code for a chat program or something.

Hope I helped.
Nicolas

CKy
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location:
Posted: 24th Feb 2004 06:00
hey mink thx for the reference why i didnt look in the manual for internet stuff in the first place... i dunno lol
White Mink
20
Years of Service
User Offline
Joined: 7th Jan 2004
Location: USA
Posted: 24th Feb 2004 06:26
np CKy

thanks agian Smokie, i appreciate it.

My program works as teh Client or server depending on the users choice.

The host doesnt have to state his ip because ive already set the connection as well except i have the ip set as " ", but the client users do, unless its on a lan in which case they can leave the ip blank.

__________
White Mink

Login to post a reply

Server time is: 2024-09-21 22:28:11
Your offset time is: 2024-09-21 22:28:11