On Tue, 2006-03-21 at 08:45 +0900, James Edward Gray II wrote: > On Mar 20, 2006, at 3:00 PM, Ross Bamford wrote: > > > On Tue, 2006-03-21 at 02:48 +0900, James Edward Gray II wrote: > >> On Mar 20, 2006, at 11:41 AM, Ross Bamford wrote: > >> > >>> Anyway, the problem with that was that, since Sector handles most > >>> of the > >>> output (and will probably just call puts) the output all goes to the > >>> server's terminal :( > >> > >> Could you have the client pass you $stdout and $stdin, then set them > >> on the server? > > > > I had a go with this, but couldn't get it to work. > > Bummer. Here is where I got the idea, just FYI: > > http://ian.blenke.com/drb Ahh, I see. It looks like we had pretty similar concepts of how it should work, but my stdout/stdin references kept on turning into DRb::DRbUnknown instances after I made the first call on them. The other problem was that, because we have to handle multiple players and sectors use 'puts' for output, I had to keep the right bits for each player somewhere and redefine puts to take account of that. Fortuntely DRb seems to do thread-per-client so I could store it there. Doing that, though, I realised it might be nicer to route everything through the player after all - the output setup is currently completely transparent from the game classes' point of view, so could be easily changed e.g. to use a different output style, or for internationalization (instead of marshalling the messages, give each message a number that is sent over the wire, and looked up on the client to get the right message). Also, since the player is provided by the client, different clients could be using different output formats or whatever with the server having no knowledge of that :) -- Ross Bamford - rosco / roscopeco.REMOVE.co.uk