Browse Source

added a function to send an update to an account with channel 3 instead of the old 1

Joe Shochet 18 years ago
parent
commit
11b54e8d73

+ 8 - 0
direct/src/distributed/DistributedObjectAI.py

@@ -331,6 +331,9 @@ class DistributedObjectAI(DistributedObjectBase, EnforcesCalldowns):
     def GetPuppetConnectionChannel(self, doId):
         return doId + (1L << 32)
 
+    def GetAccountConnectionChannel(self, doId):
+        return doId + (3L << 32)
+
     def GetAccountIDFromChannelCode(self, channel):
         return channel >> 32
 
@@ -342,6 +345,11 @@ class DistributedObjectAI(DistributedObjectBase, EnforcesCalldowns):
         channelId = self.GetPuppetConnectionChannel(avId)
         self.sendUpdateToChannel(channelId, fieldName, args)
 
+    def sendUpdateToAccountId(self, accountId, fieldName, args):
+        assert self.notify.debugStateCall(self)
+        channelId = self.GetAccountConnectionChannel(accountId)
+        self.sendUpdateToChannel(channelId, fieldName, args)
+
     def sendUpdateToChannel(self, channelId, fieldName, args):
         assert self.notify.debugStateCall(self)
         if self.air:

+ 8 - 0
direct/src/distributed/DistributedObjectUD.py

@@ -262,6 +262,9 @@ class DistributedObjectUD(DistributedObjectBase):
     def GetPuppetConnectionChannel(self, doId):
         return doId + (1L << 32)
 
+    def GetAccountConnectionChannel(self, doId):
+        return doId + (3L << 32)
+
     def GetAccountIDFromChannelCode(self, channel):
         return channel >> 32
 
@@ -273,6 +276,11 @@ class DistributedObjectUD(DistributedObjectBase):
         channelId = self.GetPuppetConnectionChannel(avId)
         self.sendUpdateToChannel(channelId, fieldName, args)
 
+    def sendUpdateToAccountId(self, accountId, fieldName, args):
+        assert self.notify.debugStateCall(self)
+        channelId = self.GetAccountConnectionChannel(accountId)
+        self.sendUpdateToChannel(channelId, fieldName, args)
+
     def sendUpdateToChannel(self, channelId, fieldName, args):
         assert self.notify.debugStateCall(self)
         if self.air: