?
Solved

C#  multiplayer server side web game

Posted on 2003-03-17
8
Medium Priority
?
554 Views
Last Modified: 2010-04-16
I have an online version of TicTactoe. I need to make it multiplayer. Just like Yahoo card games but the difference being that those are applets but this program will run on the server side. Is there a way so that I can synchronize and connect two users accessing the web site. That is display the same image in both browsers. That is provide a two player web game that runs on the server.
0
Comment
Question by:firebird_stang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
8 Comments
 
LVL 3

Accepted Solution

by:
a_goat earned 250 total points
ID: 8156231
First, it's probably easiest to implement this as a web service.  Create a web service which allows users to list games in progress, allows them to join a game, and allows them to post a move.  Whenever a move is posted, the routine can wait until the other players moves or the game is over to respond.

Then create a client.  Give the client the same functionality but provide an interface for the user to use.  If you break it up into those individual steps, it's not too hard to create.

You probably want to use threading so that your interface doesn't lock up while waiting for the other player to move.
0
 

Author Comment

by:firebird_stang
ID: 8159844
Clear but not clear enough. Can I avoid this web service thuing altogether. How about if I use the class webclient. Create two web clients. Make sure that each player takes his own turn and update the second web clients page when the first web client makes a move. Will this work or is this doomed to fail. This web services thing really makes me uncomfortable.
0
 
LVL 3

Expert Comment

by:a_goat
ID: 8160643
The problem is that each of those clients needs to access a central server.  You'd need to build the server itself which'd be a pretty big pain.

The Web Services are easy to set up, easy to use, and work over port 80 which is open almost ubiquitously.  Create a web services project in Visual Studio.  You'll see it's super simple.

As an added bonus you can allow third parties to create their own interfaces to your Tic Tac Toe server.  It uses your game logic engine, but allows people to play on whatever system they want.

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:firebird_stang
ID: 8160763
Well Ok. I know how to create a web service.And I already have the interface built. I am not sure if I can use the TCP/IP classes to connect the two online users. My inteface is on a web form. So I need a class though which I can connect two users. Somehow I feel that the class webclient will solve this problem.I have been stuck on this for two days. I have seen many client/server, client to client window forms applications but not a web form one. Man this thing 's really got me confused and frustrated. Isn't there a nice way out there to synchronize a single web form on two different machines(two different clients).
0
 

Author Comment

by:firebird_stang
ID: 8160851
Well Ok. I know how to create a web service.And I already have the interface built. I am not sure if I can use the TCP/IP classes to connect the two online users. My inteface is on a web form. So I need a class though which I can connect two users. Somehow I feel that the class webclient will solve this problem.I have been stuck on this for two days. I have seen many client/server, client to client window forms applications but not a web form one. Man this thing 's really got me confused and frustrated. Isn't there a nice way out there to synchronize a single web form on two different machines(two different clients).
0
 

Author Comment

by:firebird_stang
ID: 8160885
Well Ok. I know how to create a web service.And I already have the interface built. I am not sure if I can use the TCP/IP classes to connect the two online users. My inteface is on a web form. So I need a class though which I can connect two users. Somehow I feel that the class webclient will solve this problem.I have been stuck on this for two days. I have seen many client/server, client to client window forms applications but not a web form one. Man this thing 's really got me confused and frustrated. Isn't there a nice way out there to synchronize a single web form on two different machines(two different clients).
0
 

Author Comment

by:firebird_stang
ID: 8160887
Well Ok. I know how to create a web service.And I already have the interface built. I am not sure if I can use the TCP/IP classes to connect the two online users. My inteface is on a web form. So I need a class though which I can connect two users. Somehow I feel that the class webclient will solve this problem.I have been stuck on this for two days. I have seen many client/server, client to client window forms applications but not a web form one. Man this thing 's really got me confused and frustrated. Isn't there a nice way out there to synchronize a single web form on two different machines(two different clients).
0
 

Author Comment

by:firebird_stang
ID: 8160894
Well Ok. I know how to create a web service.And I already have the interface built. I am not sure if I can use the TCP/IP classes to connect the two online users. My inteface is on a web form. So I need a class though which I can connect two users. Somehow I feel that the class webclient will solve this problem.I have been stuck on this for two days. I have seen many client/server, client to client window forms applications but not a web form one. Man this thing 's really got me confused and frustrated. Isn't there a nice way out there to synchronize a single web form on two different machines(two different clients).
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question