|
|
@@ -3,11 +3,12 @@
|
|
|
from direct.directnotify.DirectNotifyGlobal import directNotify
|
|
|
from direct.distributed.DistributedObjectBase import DistributedObjectBase
|
|
|
from direct.showbase import PythonUtil
|
|
|
+from direct.showbase.PythonUtil import EnforcesCalldowns, calldownEnforced
|
|
|
from pandac.PandaModules import *
|
|
|
#from PyDatagram import PyDatagram
|
|
|
#from PyDatagramIterator import PyDatagramIterator
|
|
|
|
|
|
-class DistributedObjectAI(DistributedObjectBase):
|
|
|
+class DistributedObjectAI(DistributedObjectBase, EnforcesCalldowns):
|
|
|
notify = directNotify.newCategory("DistributedObjectAI")
|
|
|
QuietZone = 1
|
|
|
|
|
|
@@ -18,6 +19,8 @@ class DistributedObjectAI(DistributedObjectBase):
|
|
|
self.DistributedObjectAI_initialized = 1
|
|
|
DistributedObjectBase.__init__(self, air)
|
|
|
|
|
|
+ EnforcesCalldowns.__init__(self)
|
|
|
+
|
|
|
self.accountName=''
|
|
|
# Record the repository
|
|
|
self.air = air
|
|
|
@@ -84,6 +87,7 @@ class DistributedObjectAI(DistributedObjectBase):
|
|
|
if delEvent:
|
|
|
messenger.send(delEvent)
|
|
|
|
|
|
+ @calldownEnforced
|
|
|
def delete(self):
|
|
|
"""
|
|
|
Inheritors should redefine this to take appropriate action on delete
|
|
|
@@ -139,6 +143,8 @@ class DistributedObjectAI(DistributedObjectBase):
|
|
|
del self.zoneId
|
|
|
self.__generated = False
|
|
|
|
|
|
+ EnforcesCalldowns.EC_destroy(self)
|
|
|
+
|
|
|
def isDeleted(self):
|
|
|
"""
|
|
|
Returns true if the object has been deleted,
|
|
|
@@ -167,6 +173,7 @@ class DistributedObjectAI(DistributedObjectBase):
|
|
|
self.doId = self.air.allocateChannel()
|
|
|
self.__preallocDoId = 1
|
|
|
|
|
|
+ @calldownEnforced
|
|
|
def announceGenerate(self):
|
|
|
"""
|
|
|
Called after the object has been generated and all
|
|
|
@@ -373,6 +380,7 @@ class DistributedObjectAI(DistributedObjectBase):
|
|
|
self.generate()
|
|
|
self.announceGenerate()
|
|
|
|
|
|
+ @calldownEnforced
|
|
|
def generate(self):
|
|
|
"""
|
|
|
Inheritors should put functions that require self.zoneId or
|
|
|
@@ -380,6 +388,7 @@ class DistributedObjectAI(DistributedObjectBase):
|
|
|
"""
|
|
|
assert self.notify.debugStateCall(self)
|
|
|
|
|
|
+ @calldownEnforced
|
|
|
def generateInit(self, repository=None):
|
|
|
"""
|
|
|
First generate (not from cache).
|