From: Bernhard Brodowsky on 27 Apr 2010 13:02 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... -- Posted via http://www.ruby-forum.com/.
From: Roger Pack on 27 Apr 2010 13:24 > 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 -- Posted via http://www.ruby-forum.com/.
|
Pages: 1 Prev: local install of sqlite3-ruby Next: Hpricot files ------ |