Advertisement

Remote Procedure Call

Started by December 14, 2003 11:28 AM
1 comment, last by BrennendeKomet 21 years, 1 month ago
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!!!
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.)
Advertisement
Thanks SiCrane! I''ll think of that - just haven''t thought of making them both servers - i thought one should be always a client (well they are actually servers and clients of each other, if i got it!)

C++ RULEZ!!!
C++ RULEZ!!! :)

This topic is closed to new replies.

Advertisement