3 Replies - 4280 Views - Last Post: 30 April 2010 - 10:59 AM Rate Topic: -----

#1 Guest_hgn*


Reputation:

Client / Server in a turn-based game

Posted 30 April 2010 - 03:00 AM

Hello,

I'm working on a turn-based game, that always includes 2 players, and uses the client/server model. For various reasons I decided to use C++/Qt4, and XML-RPC (I didn't decide to use SOAP because XML-RPC seems to be good enough for a turn-based game).
In the future, more than one pair of players should be able to play on one server.

Now the problem:
I don't have any experience in programming network apps. But soon I realized, that it could be a small problem to get events, that are received by the server from one client, to some other client (because the server is passive).

I thought of long polling, but I'm not really sure. How is this problem solved in other online-games?

Thank you,
and sorry for my bad english,
hgn.

Is This A Good Question/Topic? 0

Replies To: Client / Server in a turn-based game

#2 Jahmbo  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 35
  • Joined: 17-March 10

Re: Client / Server in a turn-based game

Posted 30 April 2010 - 04:24 AM

View Posthgn, on 30 April 2010 - 02:00 AM, said:

Hello,

I'm working on a turn-based game, that always includes 2 players, and uses the client/server model.


Haven't tried any client/server stuff myself yet but I did read through this tutorial and it looked good.
http://www.dreaminco...rking-tutorial/

Maybe there is something in there that will help steer you in the direction you want to go.
Was This Post Helpful? 0
  • +
  • -

#3 sparkart  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 113
  • View blog
  • Posts: 688
  • Joined: 16-February 09

Re: Client / Server in a turn-based game

Posted 30 April 2010 - 10:46 AM

Here's the basic process:

1 - Open a port to listen for connections.
2 - Check and accept any new connections.
3 - Iterate through each connection and accept any messages.
4 - Perform logic based on message.
5 - Go back to step 2.
Was This Post Helpful? 0
  • +
  • -

#4 James_Alex  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 7
  • View blog
  • Posts: 156
  • Joined: 21-August 09

Re: Client / Server in a turn-based game

Posted 30 April 2010 - 10:59 AM

or you can RakNet, it's a multiplayer games network engine
http://www.jenkinssoftware.com/
RakNet makes you're networking part more easier
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1