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 Discussion / Chat Program Help Please

Author
Message
Duke Blue Devils
19
Years of Service
User Offline
Joined: 11th Mar 2006
Location:
Posted: 12th Mar 2006 04:33
I created two separate programs, one for the server and one for the client. They can both connect to the internet with a specified IP address, but I cannot get the client program to recognize the net session created by the server. I am really frustrated because I can't find any errors in my code. I have searched the forum for tutorials but can't find any relevant material.

Server Code:


Client Code:


Any help would be greatly appreciated.
Thank you

J.J. Redick-Player of the year
2006 National Champions
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 15th Mar 2006 05:07
To be honest I've always ignored that session stuff and specified 1 as the session number each time.

Tempest - P2P UDP Multiplayer Plugin - 70%
Download the free version
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 15th Mar 2006 11:21
Quote: "perform checklist for net connections
for a=1 to checklist quantity()
print a,". ",checklist string$(a)
next x
input "WHAT NUMBER IS INTERNET TCP/IP CONNECTION (ABOVE):",con_type
set net connection con_type,"""


to select TCP/IP automatically...



likewise: this could be overwritten as well:

Quote: "for b=1 to checklist quantity()
print b,". ",checklist string$(b)
next b
input "WHAT NUMBER IS DARK CHAT:",session_num
input "Enter a screen name:",screen_name$"


with:



There's nothing actually wrong with your code - most likely cause - Your server [and/or] client is behind a router
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 15th Mar 2006 11:43
Erm. Just looking through that code, I've noticed you don't specify an IP address in either programs. Did you take it out intentionally before posting it here?

Tempest - P2P UDP Multiplayer Plugin - 70%
Download the free version
Duke Blue Devils
19
Years of Service
User Offline
Joined: 11th Mar 2006
Location:
Posted: 15th Mar 2006 18:00
@SimSmall
Thanks for your advice. Your code is an excellent alternative. I think I will implement it into my program. I didn't know to specify 255.255.255.255 for the client program. Does that just search every IP address on the network? In that case will it take a long time. Anyway, I'll give it a try and let you know what happens.

@Benjamin
You are correct. I took out the IP address intentionally before posting it (although it doesn't matter because my IPs are dynamic). Also if you specify "" in place of the IP address a window will pop up asking you to input an IP address. That's helpful especially if you have dynamic IPs.

Thanks

J.J. Redick-Player of the year
2006 National Champions
Duke Blue Devils
19
Years of Service
User Offline
Joined: 11th Mar 2006
Location:
Posted: 19th Mar 2006 05:34 Edited at: 19th Mar 2006 05:35
Bump

If using a server/client connection are all net messages automatically routed through the server and then to the specified client. If not then what is the difference between pier to pier and client/server? What do most people use?

Also when I tested my server and client on the same computer it worked, but when I attempted to test from two different computers it didn't work. If a router is not a factor then what could be wrong?

Benjamin can you help me

J.J. Redick-Player of the year
2006 National Champions
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 20th Mar 2006 15:48
When using client/server everything must pass through the server. you need to you the:
net message player to() command to work out who send it to, then the server should pass it to that player... It's not done for you, so it is possible to have a sort of ignore list for each player stored on the server. if the sender is not on the recipient's ignore list, then send the message, otherwise don't... that sort of thing. (With peer-to-peer you will always send the message directly to that player and not the host (unless you send to player 0))

Generally speaking I always use Client/Server, but then my version of this system is network only (because all web chat is filtered at college...)

If you can't connect on your own network, perhaps your TCP/IP settings are incorrect... There isn't much to set up for TCP/IP.

Duke Blue Devils
19
Years of Service
User Offline
Joined: 11th Mar 2006
Location:
Posted: 21st Mar 2006 02:29
Then what is the advantage of sending everything through the host first?

J.J. Redick-Player of the year
2006 National Champions

Login to post a reply

Server time is: 2025-05-23 23:09:04
Your offset time is: 2025-05-23 23:09:04