Exemplo n.º 1
0
 def __init__(self, host, port, sock=None):
     Handler.__init__(self, host, port, sock=sock)
     # ip_port is set when the peer connects to me and sends a 'join' message
     # or when I open the connection to that peer (I know the peer's ip_port)
     self.ip_port = None
     self.box = None  # updated when that player moves
     peers.add(self)
Exemplo n.º 2
0
 def __init__(self, host, port, sock=None):
     Handler.__init__(self, host, port, sock=sock)
     # ip_port is set when the peer connects to me and sends a 'join' message
     # or when I open the connection to that peer (I know the peer's ip_port)
     self.ip_port = None
     self.box = None  # updated when that player moves
     peers.add(self)
Exemplo n.º 3
0
 def __init__(self):
     Handler.__init__(self,'localhost', 8888)
     print "Connected!"
     self.borders = []
     self.pellets = []
     self.players = {}
     self.myname = None
     self.game_over = False
Exemplo n.º 4
0
 def __init__(self, model, view, port):
     self.host = HOST
     self.port = port
     self.model = model
     self.view = view
     self.file_writer = fileWriter.FileWriter()
     self.quit_requested = False
     self.conversation_started = False
     Handler.__init__(self, self.host, self.port) ##old style Class can't use super() constructor
Exemplo n.º 5
0
 def __init__(self):
     Handler.__init__(self,'localhost', 8888)
     print "Server is connected."
     self.players = {}
     self.borders = [[0, 0, 2, 300],
                     [0, 0, 400, 2],
                     [398, 0, 2, 300],
                     [0, 298, 400, 2]]
     self.pellets = [ [randint(10, 380), randint(10, 280), 5, 5] 
                     for _ in range(4) ]
     self.myname = None
     self.game_over = False
     self.mydir = self.cmd_directions['down']  # start direction: down
     self.mybox = [200, 150, 10, 10]  # start in middle of the screen
Exemplo n.º 6
0
 def __init__(self, host, port):
     self.directory_received = False
     Handler.__init__(self, host, port)
Exemplo n.º 7
0
 def __init__(self, model, host, port):
     Handler.__init__(self, host, port)
     self.m = model
Exemplo n.º 8
0
 def __init__(self, m):
     Handler.__init__(self,'localhost', 8888)
     self.m = m
Exemplo n.º 9
0
 def __init__(self, model, host, port):
     Handler.__init__(self, host, port)
     self.m = model
Exemplo n.º 10
0
 def __init__(self, manager):
     host, port = 'localhost', 8888
     Handler.__init__(self, host, port)
     self.manager = manager
     self.do_send({'join': myname})
Exemplo n.º 11
0
 def __init__(self, host, port):
     self.directory_received = False
     Handler.__init__(self, host, port)
Exemplo n.º 12
0
 def __init__(self, m):
     self.m = m
     host, port = 'localhost', 8888
     Handler.__init__(self, host, port)
Exemplo n.º 13
0
 def __init__(self, host, port, sock=None):
     self.ip_port = None # set when that player sends a 'join' message
     self.box = None # updated when that player moves
     Handler.__init__(self, host, port, sock=sock)
Exemplo n.º 14
0
	def __init__(self, host, port):
		Handler.__init__(self, host, port)
Exemplo n.º 15
0
	def __init__(self, host, port, sock=None):
		Handler.__init__(self, host, port, sock)
		self.log = []
Exemplo n.º 16
0
 def __init__(self, model):
     Handler.__init__(self, 'localhost', 8888)   # connect asynchronously
     self.model = model
Exemplo n.º 17
0
	def __init__(self, host, port):
	    Handler.__init__(self, host, port)
	    print 'client built'