Ejemplo n.º 1
0
 def sendAvatarGenerate(self):
     datagram = PyDatagram()
     # Message type is 1
     datagram.addUint16(ALL_OBJECT_GENERATE_WITH_REQUIRED)
     # Avatar class type is 2
     datagram.addUint8(2)
     # A sample id
     datagram.addUint32(10)
     # The only required field is the zone field
     datagram.addUint32(999)
     self.cw.send(datagram, self.lastConnection)
Ejemplo n.º 2
0
 def sendAvatarGenerate(self):
     datagram = PyDatagram()
     # Message type is 1
     datagram.addUint16(ALL_OBJECT_GENERATE_WITH_REQUIRED)
     # Avatar class type is 2
     datagram.addUint8(2)
     # A sample id
     datagram.addUint32(10)
     # The only required field is the zone field
     datagram.addUint32(999)
     self.cw.send(datagram, self.lastConnection)
Ejemplo n.º 3
0
    def send(self, message, sentArgs=[]):
        """
        Send message to All AI and Uber Dog servers.
        """
        assert self.notify.debugCall()
        datagram = PyDatagram()
        # To:
        datagram.addUint8(1)
        datagram.addChannel(self.channels[0])
        # From:
        datagram.addChannel(self.air.ourChannel)
        #if 1: # We send this just because the air expects it:
        #    # Add an 'A' for AI
        #    datagram.addUint8(ord('A'))

        messageType = MESSAGE_STRINGS.get(message, 0)
        datagram.addUint16(messageType)
        if messageType:
            datagram.addString(str(dumps(sentArgs)))
        else:
            datagram.addString(str(dumps((message, sentArgs))))
        self.air.send(datagram)
Ejemplo n.º 4
0
    def send(self, message, sentArgs=[]):
        """
        Send message to All AI and Uber Dog servers.
        """
        assert self.notify.debugCall()
        datagram = PyDatagram()
        # To:
        datagram.addUint8(1)
        datagram.addChannel(self.channels[0])
        # From:
        datagram.addChannel(self.air.ourChannel)
        #if 1: # We send this just because the air expects it:
        #    # Add an 'A' for AI
        #    datagram.addUint8(ord('A'))

        messageType=MESSAGE_STRINGS.get(message, 0)
        datagram.addUint16(messageType)
        if messageType:
            datagram.addString(str(dumps(sentArgs)))
        else:
            datagram.addString(str(dumps((message, sentArgs))))
        self.air.send(datagram)