C# School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a C# Expert!

Join 300,475 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,746 people online right now. Registration is fast and FREE... Join Now!




Hosting a game between two players

 

Hosting a game between two players

barig4

3 Jul, 2009 - 05:19 AM
Post #1

New D.I.C Head
*

Joined: 26 Jun, 2009
Posts: 7

Hi, I've made a Tic-Tac-Toe game in C# and I want to play with a friend of mine over the net. I need to write a code that will enable one of us to host the game, so that the other will join it.

I need help getting the information i need, I've searched the net but the closest thing i found was Client/Server connection and I didn't think that it fits my needs. I don't know where to start and I could use some help.

User is offlineProfile CardPM
+Quote Post


SixOfEleven

RE: Hosting A Game Between Two Players

3 Jul, 2009 - 06:42 AM
Post #2

Code Guru
Group Icon

Joined: 18 Oct, 2008
Posts: 2,910



Thanked: 165 times
Dream Kudos: 725
Expert In: C, C#, XNA, Game Programming, Programming Concepts

My Contributions
QUOTE(barig4 @ 3 Jul, 2009 - 07:19 AM) *

Hi, I've made a Tic-Tac-Toe game in C# and I want to play with a friend of mine over the net. I need to write a code that will enable one of us to host the game, so that the other will join it.

I need help getting the information i need, I've searched the net but the closest thing i found was Client/Server connection and I didn't think that it fits my needs. I don't know where to start and I could use some help.


You would basically want a type of client/server connection. The best thing I can think is this:

When the program starts you give the player the choice to host the game or join the game.

If the player hosts the game, you get the players IP address and set up a TCP/IP listener on the IP address.

The other player would have to know what the TCP/IP listener's properties are and would connect to that listner with a TCP/IP client.

Just an idea on what you can look at.
User is offlineProfile CardPM
+Quote Post

barig4

RE: Hosting A Game Between Two Players

15 Jul, 2009 - 03:57 PM
Post #3

New D.I.C Head
*

Joined: 26 Jun, 2009
Posts: 7

QUOTE(SixOfEleven @ 3 Jul, 2009 - 06:42 AM) *

QUOTE(barig4 @ 3 Jul, 2009 - 07:19 AM) *

Hi, I've made a Tic-Tac-Toe game in C# and I want to play with a friend of mine over the net. I need to write a code that will enable one of us to host the game, so that the other will join it.

I need help getting the information i need, I've searched the net but the closest thing i found was Client/Server connection and I didn't think that it fits my needs. I don't know where to start and I could use some help.


You would basically want a type of client/server connection. The best thing I can think is this:

When the program starts you give the player the choice to host the game or join the game.

If the player hosts the game, you get the players IP address and set up a TCP/IP listener on the IP address.

The other player would have to know what the TCP/IP listener's properties are and would connect to that listner with a TCP/IP client.

Just an idea on what you can look at.


That's helpful though i need more basic information. After the connection will be made, how will the two

computers receive each others actions? (the button pressing with the mouse), I'm not sure what to look for here

and I'm a little confused. blink.gif

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 03:13AM

Live C# Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month