Re: Writing a small battleship game server in Python

2005-08-12 Thread Paul Rubin
Michael Goettsche <[EMAIL PROTECTED]> writes: > Assuming the server accepts connections in an endless loop, how > would I handle communication without additional threads and create > new games in that loop? Could you give me pseudo-code for this? I've always done this kind of thing with the Socke

Re: Writing a small battleship game server in Python

2005-08-12 Thread Mike Meyer
Michael Goettsche <[EMAIL PROTECTED]> writes: > On Thursday 11 August 2005 18:34, Dan wrote: >> > The server should accept connections from new players and be able to >> > handle multiple games concurrently. >> >> Multiple threads would be the way to go for a real application. But if >> you want t

Re: Writing a small battleship game server in Python

2005-08-12 Thread Michael Goettsche
On Thursday 11 August 2005 18:34, Dan wrote: > > The server should accept connections from new players and be able to > > handle multiple games concurrently. > > Multiple threads would be the way to go for a real application. But if > you want to avoid the complexity involved in threading and > syn

Re: Writing a small battleship game server in Python

2005-08-12 Thread Michael Goettsche
On Thursday 11 August 2005 19:03, [EMAIL PROTECTED] wrote: > Why not using directly SOAP ? > > A minimalistic 'Hello world' client looks like : > >from SOAPpy import SOAPProxy > >server= SOAPProxy("http://localhost:8080";) >print server.Hello("world") > > and the server side like : > >

Re: Writing a small battleship game server in Python

2005-08-12 Thread Michael Goettsche
On Thursday 11 August 2005 18:08, Brian Quinlan wrote: > Michael Goettsche wrote: > > What would be a good, but still easy way to write such a server? > > You could use SimpleXMLRPCServer. A client call sequence could like this: Thanks for the example Brian. I wonder... is there a standard impleme

Re: Writing a small battleship game server in Python

2005-08-11 Thread Mike Meyer
Dan <[EMAIL PROTECTED]> writes: >> The server should accept connections from new players and be able to handle >> multiple games concurrently. > > Multiple threads would be the way to go for a real application. But if > you want to avoid the complexity involved in threading and > synchronization

Re: Writing a small battleship game server in Python

2005-08-11 Thread googlenews
Why not using directly SOAP ? A minimalistic 'Hello world' client looks like : from SOAPpy import SOAPProxy server= SOAPProxy("http://localhost:8080";) print server.Hello("world") and the server side like : from SOAPpy import SOAPServer def Hello(name): print "Wishing

Re: Writing a small battleship game server in Python

2005-08-11 Thread Dan
> The server should accept connections from new players and be able to handle > multiple games concurrently. Multiple threads would be the way to go for a real application. But if you want to avoid the complexity involved in threading and synchronization in this exercize, you can avoid threads by

Re: Writing a small battleship game server in Python

2005-08-11 Thread Brian Quinlan
Michael Goettsche wrote: > What would be a good, but still easy way to write such a server? You could use SimpleXMLRPCServer. A client call sequence could like this: >>> s = xmlrpclib.Server('http://...') >>> token = s.join_game() # blocks until another player joins >>> s.send_board( ... ['.

Writing a small battleship game server in Python

2005-08-11 Thread Michael Goettsche
Hi there, for a project in our computer science lessons at school we decided to write a client/server based battleship like game [1]. I know this game could be written without a server, but the whole project is for educational purposes. Being the initiator of this project, I thought I would wr