Archived

This topic is now archived and is closed to further replies.

Remote Procedure Call

This topic is 5113 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!!!

Share this post


Link to post
Share on other sites
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.)

Share this post


Link to post
Share on other sites
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!!!

Share this post


Link to post
Share on other sites