Client server

B

Bernhard Brodowsky

Hi,
in our family, we often play a strongly modified version of Monopoly.
But since this sometimes needs a lot of calculations, I'm programming
this for Computers with brother.

We intended to use a server which handles the game logic and clients
which are basically just user interfaces.
I never did anything with networks in Ruby. Of course, I could just do
the whole program with Rails, then I wouldn't have to worry about
anything, but I just wanted to do it "on my own" for once, since it is
very useful to learn network stuff.
But now I don't know anything about how this is done properly. Of
course, there are sockets, I assume there is something like remote
procedure call or so and maybe there is something fancier and more Ruby
like around.

And by the way, it's the first time for me to combine the client server
model with MVC. I just thought I'd put all the game logic, that would be
the model, into the server program. The view of course has to be the
user's GUI. But I don't really know yet how to handle the controller. I
could just let the client only consist of the GUI and put all the
controller logic into the server. But somehow this doesn't seem very
flexible since I want to put other views and maybe even AI players there
instead of the GUI. So I'm slightly confused how to do that properly
right now.

Sorry for posting so many questions at once, but I just was sick today
and programmed all day, so I just got some questions...
 
R

Roger Pack

But now I don't know anything about how this is done properly. Of
course, there are sockets, I assume there is something like remote
procedure call or so and maybe there is something fancier and more Ruby
like around.

there is drb:
http://segment7.net/projects/ruby/drb/introduction.html
client server
require 'socket';
TCPServer.new '0.0.0.0', 8000; # server
TCPSocket.new '127.0.0.1', 8000; # client

and EventMachine, basically (probably a few more options).
GL!
-rp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top