About three months ago I asked a question about making a game lobby (for playing chess online). I've been thinking about it and a week ago one of my teachers said to us that they wanted that everyone makes a website (of their end-work) which will be hosted (or whatever the proper term is) on a server in school. That reminded me of this problem.
The people posting in the last topic gave me the idea that the clients connects to a server that tells them who is online and who wants to play. The server also handles the game requests and the games themselves.
But I'm not sure what will happen if 10 games are played simultaneously, wouldn't that be too stressful on the server? I thought about letting the server handle the requests but the clients connect to each-other and handle the games themselves.
This is my idea of what needs to happen:
- Client connects to server.
- Server takes info from client (name, ip, ...).
- Server sends info about new person to everyone else.
- If someone wants to play a game he sends to server a sort message saying "I want to play a game with [name]".
- The server sends a message to the right person saying "[name] wants to play a game, do you accept?".
- The other person sends something back to confirm.
- The server sends to the first person that he can connect to the second.
- And if someone leaves (even if the internet connection fails if possible) or enters a game, the other clients should also be notified.
The actual question is "how?", how should I do this? Please, help me with this.
Try to avoid saying "search google" or "go to [section] of this site", I can't find it.
Sam HobbsPosted Sep 17, 2010, 5:51 PM
I think you need to learn how to search. Try something such as: http://www.bing.com/search?q=chat+server+sample&go=&form=QBLH&qs=&sk=
Felipe RamosPosted Sep 17, 2010, 7:56 AM
Roy SPosted Sep 17, 2010, 4:49 AM
Sam HobbsPosted Sep 16, 2010, 2:56 PM
Felipe RamosPosted Sep 15, 2010, 8:27 AM
Roy SPosted Sep 15, 2010, 8:01 AM
Roy I am sure that you will get better answers, but I think you won't have an issue with handling everything at the server. The most intensive calculation you may perform is if you are calculation best moves for the cpu. Since chess doesn't concern itself with many graphics, your packages to update the player should be relatively small. The .net library offers libraries for UDP and TCP so you have alot there as well. You can also create a WCF service to manage all of your concurrent games.
You mean that the clients still make their decisions and the program on their computer checks if it's possible but I fail to see any benefits to have those moves go through the server (the server just passes them to the correct person).
Felipe RamosPosted Sep 13, 2010, 5:24 PM