Exemplo n.º 1
0
 def connected(self, perspective):
     self.perspective = perspective
     self.environment = yield perspective.callRemote('getEnvironment')
     self.environment.team = yield perspective.callRemote('getTeam')
     self.view = Window(self.environment)
     self.view.start("Client - %d" % (self.environment.team, ))
     self.controller = PlayerController(self.perspective, self.view)
     self.controller.go()
Exemplo n.º 2
0
 def connected(self, perspective):
     self.perspective = perspective
     self.environment = yield perspective.callRemote('getEnvironment')
     self.environment.team = yield perspective.callRemote('getTeam')
     self.view = Window(self.environment)
     self.view.start("Client - %d" % (self.environment.team, ))
     self.controller = PlayerController(self.perspective, self.view)
     self.controller.go()
Exemplo n.º 3
0
class Client():
    def connect(self, ip):
        factory = pb.PBClientFactory()
        reactor.connectTCP(ip, 8800, factory)
        d = factory.login(credentials.Anonymous())
        d.addCallback(self.connected)

    @defer.inlineCallbacks
    def connected(self, perspective):
        self.perspective = perspective
        self.environment = yield perspective.callRemote('getEnvironment')
        self.environment.team = yield perspective.callRemote('getTeam')
        self.view = Window(self.environment)
        self.view.start("Client - %d" % (self.environment.team, ))
        self.controller = PlayerController(self.perspective, self.view)
        self.controller.go()

    def shutdown(self, result):
        reactor.stop()
Exemplo n.º 4
0
class Client():
    def connect(self, ip):
        factory = pb.PBClientFactory()
        reactor.connectTCP(ip, 8800, factory)
        d = factory.login(credentials.Anonymous())
        d.addCallback(self.connected)

    @defer.inlineCallbacks
    def connected(self, perspective):
        self.perspective = perspective
        self.environment = yield perspective.callRemote('getEnvironment')
        self.environment.team = yield perspective.callRemote('getTeam')
        self.view = Window(self.environment)
        self.view.start("Client - %d" % (self.environment.team, ))
        self.controller = PlayerController(self.perspective, self.view)
        self.controller.go()

    def shutdown(self, result):
        reactor.stop()

    pygame.mixer.pre_init(frequency=16000, size=8, channels=1,
                          buffer=1024)  #, size=-8, channels=1)