Ejemplo n.º 1
0
 def dataReceived(self, data):
     print "Data received", data
     bigdata = safe_loads(data)
     for jdata in bigdata:
         if "id" in jdata:
             self.world.player.id = jdata["id"]
         self.world.update_data(jdata)
Ejemplo n.º 2
0
 def dataReceived(self, data):
     print "Data received", data
     bigdata = safe_loads(data)
     for jdata in bigdata:
         if "id" in jdata:
             self.world.player.id = jdata["id"]
         self.world.update_data(jdata)
Ejemplo n.º 3
0
    def dataReceived(self, data):
        print 'Data received', data
        for jdata in safe_loads(data):
            dataToSend = jdata

            if "id" not in dataToSend:
                dataToSend["id"] = self.id
            self.world.update_player(dataToSend)
            for p in self.factory.clients:
                if p != self:
                    p.transport.write(json.dumps({"player": dataToSend}))
Ejemplo n.º 4
0
    def dataReceived(self, data):
        print 'Data received', data
        for jdata in safe_loads(data):
            dataToSend = jdata

            if "id" not in dataToSend:
                dataToSend["id"] = self.id
            self.world.update_player(dataToSend)
            for p in self.factory.clients:
                if p != self:
                    p.transport.write(json.dumps({"player": dataToSend}))