2 Replies - 1462 Views - Last Post: 15 July 2009 - 04:57 PM Rate Topic: -----

#1 barig4  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-June 09

Hosting a game between two players

Post icon  Posted 03 July 2009 - 06: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.
Is This A Good Question/Topic? 0
  • +

Replies To: Hosting a game between two players

#2 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 929
  • View blog
  • Posts: 6,316
  • Joined: 18-October 08

Re: Hosting a game between two players

Posted 03 July 2009 - 07:42 AM

View Postbarig4, on 3 Jul, 2009 - 07:19 AM, said:

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.
Was This Post Helpful? 1
  • +
  • -

#3 barig4  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-June 09

Re: Hosting a game between two players

Posted 15 July 2009 - 04:57 PM

View PostSixOfEleven, on 3 Jul, 2009 - 06:42 AM, said:

View Postbarig4, on 3 Jul, 2009 - 07:19 AM, said:

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:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1