Jump to content
  • Advertisement
Sign in to follow this  
shoeb

Chess Server

This topic is 4775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi guys I am making a Chess server in WIN32 API.I have almost completed the standalone version of the game i.e. you can play with yourself.All the constraints on the moves of characters are there.Now I want to implement the client server architecture i.e. two players on different machines can connect to the Chess server and play with each other. I need help in following : (1) I want to simulate the client server architecture on a single machine for testing purpose.Is it possible to run chess server and the client on the same machine ? (2)What is the best way to implement client server architecture in WIN32 API? I request all the geeks here to help me in this project

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by shoeb
(1) I want to simulate the client server architecture on a single machine for testing purpose.Is it possible to run chess server and the client on the same machine ?


Yes, of course. Just use the 127.0.0.1 address (or your machine's actual IP if you know it).

Share this post


Link to post
Share on other sites
(2)
Use tcp/ip as it guarantees correct packet transmission and ordering.

Make a class that will serve as a connection router. I.e. it will be in the main thread and will listen to a given socket on a given port. Anytime it sees a connection, it should make new thread and bind a socket for it.

Then, think something about game class that will be created inside each new thread. This class must have methods to bind players/spectators to the particular game, to get, check and send their turns and turn reports (to prevent cheating).

Finaly, prepare connection router to enumerate and find free games (i.e. with just one player logged in). You also can let players to choose what games to connect to, between ones that are free.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!