Beispiel #1
0
    def prepare(self, message, sentArgs=[]):
        """
        Prepare the datagram that would get sent in order to send this message
        to its designated channel.
        """
        assert self.notify.debugCall()

        # Make sure the message is registered:
        if message not in self.__message2type:
            self.notify.error('Tried to send unregistered message %s!' %
                              message)
            return

        datagram = PyDatagram()
        # To:
        datagram.addUint8(1)
        datagram.addChannel(self.__message2channel[message])
        # From:
        datagram.addChannel(self.air.ourChannel)

        messageType = self.__message2type[message]
        datagram.addUint16(messageType)
        datagram.addString(str(dumps(sentArgs)))

        return datagram
Beispiel #2
0
    def enterSetAvatar(self):
        channel = self.mgr.GetAccountConnectionChannel(self.target)

        datagramCleanup = PyDatagram()
        datagramCleanup.addServerHeader(self.playerId, channel, STATESERVER_OBJECT_DELETE_RAM)
        datagramCleanup.addUint32(self.playerId)
        datagram = PyDatagram()
        datagram.addServerHeader(channel, self.air.ourChannel, CLIENTAGENT_ADD_POST_REMOVE)
        datagram.addUint16(datagramCleanup.getLength())
        datagram.appendData(datagramCleanup.getMessage())
        self.air.send(datagram)

        # Activate the avatar on the DBSS:
        self.air.sendActivate(self.playerId, 0, 0, self.air.dclassesByName['DistributedPlayerUD'],
                              fields={'setName': [self.token]})

        # Next, add them to the avatar channel:
        datagram = PyDatagram()
        datagram.addServerHeader(channel, self.air.ourChannel, CLIENTAGENT_OPEN_CHANNEL)
        datagram.addChannel(self.mgr.GetPuppetConnectionChannel(self.target))
        self.air.send(datagram)

        # Finally, grant ownership and shut down.
        self.air.setOwner(self.playerId, self.target)

        self.air.clientAddSessionObject(self.target, self.playerId)

        # Now set their sender channel to represent their account affiliation:
        datagram = PyDatagram()
        datagram.addServerHeader(self.target, self.air.ourChannel, CLIENTAGENT_SET_CLIENT_ID)
        datagram.addChannel(self.mgr.GetPuppetConnectionChannel(self.playerId))
        self.air.send(datagram)
        self.demand('Done')
    def unloadAvatar(self, target, doId):
        channel = self.GetAccountConnectionChannel(target)

        print "unloadAvatar"

        # Allow the avatar to be deleted now.
        self.air.clientRemoveSessionObject(target, doId)

        # Clear the postremove
        dg = PyDatagram()
        dg.addServerHeader(channel, self.air.ourChannel,
                           CLIENTAGENT_CLEAR_POST_REMOVES)
        self.air.send(dg)

        # Remove avatar channel
        dg = PyDatagram()
        dg.addServerHeader(channel, self.air.ourChannel,
                           CLIENTAGENT_CLOSE_CHANNEL)
        dg.addChannel(self.GetPuppetConnectionChannel(doId))
        self.air.send(dg)

        # Reset sender channel
        dg = PyDatagram()
        dg.addServerHeader(channel, self.air.ourChannel,
                           CLIENTAGENT_SET_CLIENT_ID)
        dg.addChannel(doId << 32)
        self.air.send(dg)

        # Delete avatar object
        dg = PyDatagram()
        dg.addServerHeader(doId, channel, STATESERVER_OBJECT_DELETE_RAM)
        dg.addUint32(doId)
        self.air.send(dg)
    def setAccount(self, sender, accountId):
        # Check if this account is already logged in.
        print "setAccount: accountId = %s" % accountId
        dg = PyDatagram()
        dg.addServerHeader(self.GetAccountConnectionChannel(accountId),
                           self.air.ourChannel, CLIENTAGENT_EJECT)
        dg.addUint16(EC_MULTIPLE_LOGINS)
        dg.addString('This account is already logged in.')
        self.air.send(dg)

        # Add this connection to the account channel.
        dg = PyDatagram()
        dg.addServerHeader(sender, self.air.ourChannel,
                           CLIENTAGENT_OPEN_CHANNEL)
        dg.addChannel(self.GetAccountConnectionChannel(accountId))
        self.air.send(dg)

        # Set the sender channel to represent their account affiliation.
        dg = PyDatagram()
        dg.addServerHeader(sender, self.air.ourChannel,
                           CLIENTAGENT_SET_CLIENT_ID)
        dg.addChannel(accountId << 32)
        self.air.send(dg)

        # Unsandbox the client.
        self.unsandboxClient(sender)
        self.d_loginAccepted(sender)
        self.notify.info("Successfully created a new account object.")
Beispiel #5
0
    def enterSetAccount(self):
        channel = self.mgr.GetAccountConnectionChannel(self.accountId)

        datagram = PyDatagram()
        datagram.addServerHeader(channel, self.mgr.air.ourChannel, CLIENTAGENT_EJECT)
        datagram.addUint16(100)
        datagram.appendData(b'This account has been logged in from elsewhere.')
        self.mgr.air.send(datagram)

        # Next, add this connection to the account channel.
        datagram = PyDatagram()
        datagram.addServerHeader(self.target, self.mgr.air.ourChannel, CLIENTAGENT_OPEN_CHANNEL)
        datagram.addChannel(channel)
        self.mgr.air.send(datagram)

        # when this dg is added, the accId is correct, but avId=0
        datagram = PyDatagram()
        datagram.addServerHeader(self.target, self.air.ourChannel, CLIENTAGENT_SET_CLIENT_ID)
        datagram.addChannel(self.accountId << 32)
        self.air.send(datagram)

        # Un-sandbox them!
        datagram = PyDatagram()
        datagram.addServerHeader(self.target, self.mgr.air.ourChannel, CLIENTAGENT_SET_STATE)
        datagram.addUint16(2)  # ESTABLISHED
        self.mgr.air.send(datagram)

        self.mgr.sendUpdateToChannel(self.target, 'loginResponse', [LOGIN_SUCCESS])
        self.demand('SetAvatar')
Beispiel #6
0
 def registerShardDownMessage(self, stateserverid):
     assert self.notify.debugStateCall(self)
     datagram = PyDatagram()
     datagram.addServerHeader(stateserverid, self.ourChannel, STATESERVER_SHARD_REST)
     datagram.addChannel(self.ourChannel)
     # schedule for execution on socket close
     self.addPostSocketClose(datagram)
    def requestAccess(self):
        clientId = self.air.getMsgSender()
        
        self.air.setClientState(clientId, 2)

        dg = PyDatagram()
        dg.addServerHeader(clientId, self.air.ourChannel, CLIENTAGENT_OPEN_CHANNEL)
        dg.addChannel(self.GetPuppetConnectionChannel(clientId))
        self.air.send(dg)

        self.sendUpdateToChannel(clientId, 'accessResponse', [True])
    def requestAccess(self):
        clientId = self.air.getMsgSender()
        
        self.air.setClientState(clientId, 2)

        dg = PyDatagram()
        dg.addServerHeader(clientId, self.air.ourChannel, CLIENTAGENT_OPEN_CHANNEL)
        dg.addChannel(self.GetPuppetConnectionChannel(clientId))
        self.air.send(dg)

        self.sendUpdateToChannel(clientId, 'accessResponse', [True])
 def prepare(self, message, sentArgs=[]):
     if message not in self.__message2type:
         self.notify.error('Tried to send unregistered message %s!' %
                           message)
         return
     datagram = PyDatagram()
     datagram.addUint8(1)
     datagram.addChannel(self.__message2channel[message])
     datagram.addChannel(self.air.ourChannel)
     messageType = self.__message2type[message]
     datagram.addUint16(messageType)
     datagram.addString(str(dumps(sentArgs)))
     return datagram
Beispiel #10
0
    def unregisterForChannel(self, channel):
        """
        Unregister a channel subscription on the Message Director. The Message
        Director will cease to relay messages to this AIR sent on the channel.
        """

        if channel not in self._registeredChannels:
            return
        self._registeredChannels.remove(channel)

        dg = PyDatagram()
        dg.addServerControlHeader(CONTROL_REMOVE_CHANNEL)
        dg.addChannel(channel)
        self.send(dg)
Beispiel #11
0
    def registerForChannel(self, channel):
        """
        Register for messages on a specific Message Director channel.

        If the channel is already open by this AIR, nothing will happen.
        """

        if channel in self._registeredChannels:
            return
        self._registeredChannels.add(channel)

        dg = PyDatagram()
        dg.addServerControlHeader(CONTROL_SET_CHANNEL)
        dg.addChannel(channel)
        self.send(dg)
Beispiel #12
0
    def prepare(self, message, sentArgs=[], channels=None):
        dg = PyDatagram()

        if channels is None:
            channels = [OtpDoGlobals.MESSENGER_CHANNEL_ALL]

        dg.addInt8(len(channels))
        for channel in channels:
            dg.addChannel(channel)

        dg.addChannel(self.msgType)
        dg.addUint16(self.msgType)
        dg.addString(message)
        dg.addString(zlib.compress(cPickle.dumps(sentArgs)))
        return dg
    def giveClientOwnershipOfObject(self, context, accId, doId, dclassNum):
        print "CSM: giveClientOwnershipOfObject:", context, accId, doId
        sender = self.air.getMsgSender()

        # Activate the object on the db stateserver.
        self.air.sendActivate(doId, 0, 0)

        # Grant the client ownership of the object.
        dg = PyDatagram()
        dg.addServerHeader(doId, self.air.ourChannel,
                           STATESERVER_OBJECT_SET_OWNER)
        dg.addChannel(accId << 32 | doId)
        self.air.send(dg)

        self.sendUpdateToChannel(sender, 'clientObjectOwnershipGranted',
                                 [context, accId, doId])
    def requestAvatar(self):
        clientId = self.air.getAvatarIdFromSender()

        player = DistributedToonAI.DistributedToonAI(self.air)
        player.generateWithRequired(2000)
        print "CREATED TOON %d" % player.doId

        self.air.setOwner(player.doId, clientId)

        self.air.clientAddSessionObject(clientId, player.doId)

        dg = PyDatagram()
        dg.addServerHeader(clientId, self.air.ourChannel,
                           CLIENTAGENT_SET_CLIENT_ID)
        dg.addChannel(self.GetPuppetConnectionChannel(player.doId))
        self.air.send(dg)
 def unloadAvatar(self, target, doId):
     channel = self.GetAccountConnectionChannel(target)
     dg = PyDatagram()
     dg.addServerHeader(channel, self.air.ourChannel, CLIENTAGENT_CLEAR_POST_REMOVES)
     self.air.send(dg)
     dg = PyDatagram()
     dg.addServerHeader(channel, self.air.ourChannel, CLIENTAGENT_CLOSE_CHANNEL)
     dg.addChannel(self.GetPuppetConnectionChannel(doId))
     self.air.send(dg)
     dg = PyDatagram()
     dg.addServerHeader(channel, self.air.ourChannel, CLIENTAGENT_SET_CLIENT_ID)
     dg.addChannel(doId << 32)
     self.air.send(dg)
     dg = PyDatagram()
     dg.addServerHeader(doId, channel, STATESERVER_OBJECT_DELETE_RAM)
     dg.addUint32(doId)
     self.air.send(dg)
Beispiel #16
0
    def unloadAvatar(self, target, doId):
        channel = self.GetAccountConnectionChannel(target)

        print "unloadAvatar"

        # Clear the postremove
        dg = PyDatagram()
        dg.addServerHeader(
            channel,
            self.air.ourChannel,
            CLIENTAGENT_CLEAR_POST_REMOVES
        )
        self.air.send(dg)

        # Remove avatar channel
        dg = PyDatagram()
        dg.addServerHeader(
            channel,
            self.air.ourChannel,
            CLIENTAGENT_CLOSE_CHANNEL)
        dg.addChannel(self.GetPuppetConnectionChannel(doId))
        self.air.send(dg)

        # Reset sender channel
        dg = PyDatagram()
        dg.addServerHeader(
            channel,
            self.air.ourChannel,
            CLIENTAGENT_SET_CLIENT_ID
        )
        dg.addChannel(doId<<32)
        self.air.send(dg)

        # Delete avatar object
        dg = PyDatagram()
        dg.addServerHeader(
            doId,
            channel,
            STATESERVER_OBJECT_DELETE_RAM
        )
        dg.addUint32(doId)
        self.air.send(dg)

        # Tell the friends manager a toon has gone offline.
        self.__handleToonOffline(doId)
 def setAccount(self, sender, accountId):
     print 'setAccount: accountId = %s' % accountId
     dg = PyDatagram()
     dg.addServerHeader(self.GetAccountConnectionChannel(accountId), self.air.ourChannel, CLIENTAGENT_EJECT)
     dg.addUint16(EC_MULTIPLE_LOGINS)
     dg.addString('This account is already logged in.')
     self.air.send(dg)
     dg = PyDatagram()
     dg.addServerHeader(sender, self.air.ourChannel, CLIENTAGENT_OPEN_CHANNEL)
     dg.addChannel(self.GetAccountConnectionChannel(accountId))
     self.air.send(dg)
     dg = PyDatagram()
     dg.addServerHeader(sender, self.air.ourChannel, CLIENTAGENT_SET_CLIENT_ID)
     dg.addChannel(accountId << 32)
     self.air.send(dg)
     self.unsandboxClient(sender)
     self.d_loginAccepted(sender)
     self.notify.info('Successfully created a new account object.')
Beispiel #18
0
    def __connected(self):
        self.notify.info('Connected successfully.')

        # Listen to our channel...
        self.registerForChannel(self.ourChannel)

        # If we're configured with a State Server, register a post-remove to
        # clean up whatever objects we own on this server should we unexpectedly
        # fall over and die.
        if self.serverId:
            dg = PyDatagram()
            dg.addServerHeader(self.serverId, self.ourChannel,
                               STATESERVER_DELETE_AI_OBJECTS)
            dg.addChannel(self.ourChannel)
            self.addPostRemove(dg)

        messenger.send('airConnected')
        self.handleConnected()
Beispiel #19
0
    def requestPlayer(self, name, color):
        clientId = self.air.getAvatarIdFromSender()

        player = TagPlayerAI(self.air)
        player.setName(name)
        player.setColor(color)
        player.setGameId(self.doId)
        player.generateWithRequired(self.objZone)

        self.air.setOwner(player.doId, clientId)

        self.air.clientAddSessionObject(clientId, player.doId)

        dg = PyDatagram()
        dg.addServerHeader(clientId, self.air.ourChannel, CLIENTAGENT_SET_CLIENT_ID)
        dg.addChannel(self.GetPuppetConnectionChannel(player.doId))
        self.air.send(dg)

        self.newPlayer(player)
Beispiel #20
0
    def requestJoin(self, name):
        sender = self.air.getMsgSender()
        for avatar in self.air.avatars:
            if avatar.name == name:
                # The name is taken, so let's tell
                # the client that.
                self.sendUpdateToChannel(sender, 'nameOccupied', [])
                return
        ralph = RalphAI(self.air)
        ralph.setName(name)
        ralph.generateWithRequired(0)
        self.air.setOwner(ralph.doId, sender)
        self.air.clientAddSessionObject(sender, ralph.doId)

        dg = PyDatagram()
        dg.addServerHeader(sender, self.air.ourChannel, CLIENTAGENT_SET_CLIENT_ID)
        dg.addChannel(self.GetPuppetConnectionChannel(ralph.doId))
        self.air.send(dg)

        self.air.avatars.append(ralph)
Beispiel #21
0
    def requestJoin(self, name):
        sender = self.air.getMsgSender()
        for avatar in self.air.avatars:
            if avatar.name == name:
                # The name is taken, so let's tell
                # the client that.
                self.sendUpdateToChannel(sender, 'nameOccupied', [])
                return
        ralph = RalphAI(self.air)
        ralph.setName(name)
        ralph.generateWithRequired(0)
        self.air.setOwner(ralph.doId, sender)
        self.air.clientAddSessionObject(sender, ralph.doId)

        dg = PyDatagram()
        dg.addServerHeader(sender, self.air.ourChannel,
                           CLIENTAGENT_SET_CLIENT_ID)
        dg.addChannel(self.GetPuppetConnectionChannel(ralph.doId))
        self.air.send(dg)

        self.air.avatars.append(ralph)
    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)
Beispiel #23
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)
    def setAvatar(self, fields, avId, sender):
        accId = self.GetAccountConnectionChannel(sender)

        # Give a POST_REMOVE to unload the avatar just
        # in case we lose connection while working.
        dgc = PyDatagram()
        dgc.addServerHeader(avId, accId, STATESERVER_OBJECT_DELETE_RAM)
        dgc.addUint32(avId)
        dg = PyDatagram()
        dg.addServerHeader(accId, self.air.ourChannel,
                           CLIENTAGENT_ADD_POST_REMOVE)
        dg.addString(dgc.getMessage())
        self.air.send(dg)

        # Activate the avatar on the db stateserver.
        self.air.sendActivate(
            avId, 0, 0, self.air.dclassesByName['DistributedPlayerToonUD'])

        # Add the connection to the avatar channel.
        dg = PyDatagram()
        dg.addServerHeader(accId, self.air.ourChannel,
                           CLIENTAGENT_OPEN_CHANNEL)
        dg.addChannel(self.GetPuppetConnectionChannel(avId))
        self.air.send(dg)

        # Set the sender channel to represent their account affiliation.
        dg = PyDatagram()
        dg.addServerHeader(accId, self.air.ourChannel,
                           CLIENTAGENT_SET_CLIENT_ID)
        dg.addChannel(sender << 32 | avId)
        self.air.send(dg)

        # Grant the client ownership of the avatar.
        dg = PyDatagram()
        dg.addServerHeader(avId, self.air.ourChannel,
                           STATESERVER_OBJECT_SET_OWNER)
        dg.addChannel(sender << 32 | avId)
        self.air.send(dg)

        # The avatar should stay around for the entire client session.
        self.air.clientAddSessionObject(accId, avId)

        # OLD WAY: Tell the friends manager a toon has gone online.
        # self.__handleToonOnline(avId)

        # NEW WAY: Tell the FriendsManagerUD that a toon is online.
        # Let's use the netMessenger.
        self.air.netMessenger.send('avatarOnline', [avId])

        # Let's prepare the avatarOffline message if the avatar disconnects unexpectedly.
        cleanupDatagram = self.air.netMessenger.prepare(
            'avatarOffline', [avId])
        dg = PyDatagram()
        dg.addServerHeader(accId, self.air.ourChannel,
                           CLIENTAGENT_ADD_POST_REMOVE)
        dg.addString(cleanupDatagram.getMessage())
        self.air.send(dg)
Beispiel #25
0
    def prepare(self, message, sentArgs=[]):
        """
        Prepare the datagram that would get sent in order to send this message
        to its designated channel.
        """
        assert self.notify.debugCall()

        # Make sure the message is registered:
        if message not in self.__message2type:
            self.notify.error('Tried to send unregistered message %s!' % message)
            return

        datagram = PyDatagram()
        # To:
        datagram.addUint8(1)
        datagram.addChannel(self.__message2channel[message])
        # From:
        datagram.addChannel(self.air.ourChannel)

        messageType=self.__message2type[message]
        datagram.addUint16(messageType)
        datagram.addString(str(dumps(sentArgs)))

        return datagram
Beispiel #26
0
    def setAvatar(self, fields, avId, sender):
        accId = self.GetAccountConnectionChannel(sender)

        # Give a POST_REMOVE to unload the avatar just
        # in case we lose connection while working.
        dgc = PyDatagram()
        dgc.addServerHeader(avId, accId,
                STATESERVER_OBJECT_DELETE_RAM)
        dgc.addUint32(avId)
        dg = PyDatagram()
        dg.addServerHeader(accId,
                self.air.ourChannel,
                CLIENTAGENT_ADD_POST_REMOVE)
        dg.addString(dgc.getMessage())
        self.air.send(dg)

        # Activate the avatar on the db stateserver.
        self.air.sendActivate(avId, 0, 0, self.air.dclassesByName['DistributedToonUD'])

        # Add the connection to the avatar channel.
        dg = PyDatagram()
        dg.addServerHeader(accId, self.air.ourChannel, CLIENTAGENT_OPEN_CHANNEL)
        dg.addChannel(self.GetPuppetConnectionChannel(avId))
        self.air.send(dg)

        # Set the sender channel to represent their account affiliation.
        dg = PyDatagram()
        dg.addServerHeader(accId, self.air.ourChannel,
                    CLIENTAGENT_SET_CLIENT_ID)
        dg.addChannel(sender << 32 | avId)
        self.air.send(dg)

        # Grant the client ownership of the avatar.
        dg = PyDatagram()
        dg.addServerHeader(avId, self.air.ourChannel, STATESERVER_OBJECT_SET_OWNER)
        dg.addChannel(sender << 32 | avId)
        self.air.send(dg)

        # Tell the friends manager a toon has gone online.
        self.__handleToonOnline(avId)
 def setAvatar(self, fields, avId, sender):
     accId = self.GetAccountConnectionChannel(sender)
     dgc = PyDatagram()
     dgc.addServerHeader(avId, accId, STATESERVER_OBJECT_DELETE_RAM)
     dgc.addUint32(avId)
     dg = PyDatagram()
     dg.addServerHeader(accId, self.air.ourChannel, CLIENTAGENT_ADD_POST_REMOVE)
     dg.addString(dgc.getMessage())
     self.air.send(dg)
     self.air.sendActivate(avId, 0, 0, self.air.dclassesByName['DistributedToonUD'])
     dg = PyDatagram()
     dg.addServerHeader(accId, self.air.ourChannel, CLIENTAGENT_OPEN_CHANNEL)
     dg.addChannel(self.GetPuppetConnectionChannel(avId))
     self.air.send(dg)
     dg = PyDatagram()
     dg.addServerHeader(accId, self.air.ourChannel, CLIENTAGENT_SET_CLIENT_ID)
     dg.addChannel(sender << 32 | avId)
     self.air.send(dg)
     dg = PyDatagram()
     dg.addServerHeader(avId, self.air.ourChannel, STATESERVER_OBJECT_SET_OWNER)
     dg.addChannel(sender << 32 | avId)
     self.air.send(dg)
 def claimOwnership(self, channel):
     dg = PyDatagram()
     dg.addServerHeader(channel, self.ourChannel, STATESERVER_OBJECT_SET_AI)
     dg.addChannel(self.ourChannel)
     self.send(dg)
 def claimOwnership(self, channel):
     dg = PyDatagram()
     dg.addServerHeader(channel, self.ourChannel, STATESERVER_OBJECT_SET_AI)
     dg.addChannel(self.ourChannel)
     self.send(dg)
Beispiel #30
0
 def registerChannel(self):
     dg = PyDatagram()
     dg.addServerControlHeader(CONTROL_ADD_CHANNEL)
     dg.addChannel(self.channel)
     self.cWriter.send(dg, self.serverConnection)
     print "Registered channel: " + str(self.channel)
Beispiel #31
0
        assert self.notify.debugCall()
        for i in self.channels:
            self.air.unRegisterChannel(i)
        del self.air
        del self.channels
        Messenger.clear(self)
     
   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)
        
   def handle(self, pickleData):