-
May 20th, 2011, 04:21 AM
#1
Thread Starter
New Member
network multiplayer game
I'm making a battleships game and i have a working single player but i want to add a network multiplayer mode. As far as i can tell all i need to be able to do is find a way to send messages between two instances of the program. Can anyone help me with this or point me in the direction of a good tutorial?
There are 10 types of people in the world, those who understand binary and those who don't
-
May 20th, 2011, 06:08 AM
#2
Re: network multiplayer game
What language are you using?
-
May 20th, 2011, 12:09 PM
#3
Re: network multiplayer game
What language and what protocol? There are two different ones you can use and each have their pluses and minuses.
-
May 21st, 2011, 12:20 AM
#4
Thread Starter
New Member
Re: network multiplayer game
using VB.net 2010 so far i have a semi working program that uses TCP that can send messages to each other but i can't figure out how to check for a disconnection and it will only work if both instances are trying to connect at the same time
There are 10 types of people in the world, those who understand binary and those who don't
-
May 23rd, 2011, 06:48 AM
#5
Re: network multiplayer game
You can not get notified when the TCP connection is closed. When a client disconnects "peacefully" (ie, when the connection is not abruptly terminated), you should handle this by having the client notify the server of this just before it closes its connection. For unforseen connection drops, there's not much you can do other than handle the exception that will occur.
As for the other problem you mention:
it will only work if both instances are trying to connect at the same time
You're going to have to give a more elaborate description of your problem.
-
May 23rd, 2011, 05:00 PM
#6
Re: network multiplayer game
You could check out RattleSnake [link in my signature] or you can check out JMC's Asynchronous Client/Server system, both use Async methods and both handle connections, disconnections, and data sending/receiving.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|