![](smile.gif)
Remote Procedure Call
Hi ppl,
Say we have a cross/dots game (where it is needed to place 5 crosses/dots in a straight line, on an infinite field, to win). The aim is to make a multiplayer mode for this game, so that it is possible to play from different computers. I hope to make it with the help of RPC, but just can''t figure out:
* who has to be server and who client - the two players seem to have the same rights
* How to manage data transfer? I think of having a MakeMove(int x, int y); function, that places a token in (x,y) point... This function is provided by the server (using RPC technology), but again if only one player is server, and the other is client, how to tell a client of a server''s move? in a return value?
* And what if i want Save/Load game?
So, finally, my question is:
How to solve client/server problem?
I beleive, it IS possible to do such things with RPC...
C++ RULEZ!!!
![](smile.gif)
C++ RULEZ!!! :)
If you''re set on using RPC to do this, probably the easiest way is to make both of them servers. When one player makes a move, it calls an RPC function on the other player''s computer.
For save/load, it''s probably just easier to just use normal sockets programming to serialize the game state. (Not to say it can''t be done with RPC, but I personally am not up to the headache of trying.)
For save/load, it''s probably just easier to just use normal sockets programming to serialize the game state. (Not to say it can''t be done with RPC, but I personally am not up to the headache of trying.)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement