ConductedClever
ConductedClever

Reputation: 4305

Developing the server-side of a online multiplayer game

I have some key question in developing the server of a multiplayer game. I need the best concept then I will use that in both C# and PHP. Currently I want to make a game like this:

online multiplayer racket game

The button racket is mine and the upper is yours. I need to transfer the data every 40 milliseconds to refresh the screen. The first idea was that I write a web service that computes the current position of the objects and respond to the clients as JSON.

But the problem was the data on server. I couldn't share the session data across the clients. I thought to use DB but it was slow enough to not to use! Is it any way to share data between different clients of one web service?

And the second question: is it good to use web services? I thought of sockets but the thing is how much ports do we have on the server to answer to the clients requests? And if the web services are good to use, then how can I advance the time of the game in the server when any client is not requesting data and web service is down?

Upvotes: 1

Views: 928

Answers (1)

karthik manchala
karthik manchala

Reputation: 13650

Sockets, in general are much faster than web services. You can use them in your implementation.

I thought of sockets but the thing is how much ports do we have on the server to answer to the clients requests

They don't require a port for each connection. One port is required for the service and you can instantiate many socket objects between client and server.

Upvotes: 1

Related Questions