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

This commit is contained in:
Joe Shochet 2007-08-27 21:20:06 +00:00
parent 43eecb979f
commit 11b54e8d73
2 changed files with 16 additions and 0 deletions

View File

@ -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:

View File

@ -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: