Browse Source

fixes for public net interface

David Rose 16 years ago
parent
commit
d8471bdf32

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

@@ -22,6 +22,8 @@ class ClientRepository(ClientRepositoryBase):
     # used by this implementation.
     GameGlobalsId = 0
 
+    doNotDeallocateChannel = True
+    
     def __init__(self, dcFileNames = None, dcSuffix = ''):
         ClientRepositoryBase.__init__(self, dcFileNames = dcFileNames, dcSuffix = dcSuffix)
         self.setHandleDatagramsInternally(False)
@@ -42,6 +44,8 @@ class ClientRepository(ClientRepositoryBase):
         self.doIdLast = self.doIdBase + di.getUint32()
         self.doIdAllocator = UniqueIdAllocator(self.doIdBase, self.doIdLast - 1)
 
+        self.ourChannel = self.doIdBase
+
         # Now that we've got a doId range, we can safely generate new
         # distributed objects.
         messenger.send('createReady')
@@ -370,6 +374,10 @@ class ClientRepository(ClientRepositoryBase):
             self.notify.warning(
                 "Asked to delete non-existent DistObj " + str(doId))
 
+    def stopTrackRequestDeletedDO(self, *args):
+        # No-op.  Not entirely sure what this does on the VR Studio side.
+        pass
+
     def sendUpdate(self, distObj, fieldName, args):
         """ Sends a normal update for a single field. """
         dg = distObj.dclass.clientFormatUpdate(

+ 7 - 4
direct/src/distributed/ConnectionRepository.py

@@ -221,9 +221,9 @@ class ConnectionRepository(
         """
         Reads in the dc files listed in dcFileNames, or if
         dcFileNames is None, reads in all of the dc files listed in
-        the Configrc file.
+        the Config.prc file.
         """
-        #import pdb; pdb.set_trace();
+
         dcFile = self.getDcFile()
         dcFile.clear()
         self.dclassesByName = {}
@@ -240,10 +240,13 @@ class ConnectionRepository(
             if not readResult:
                 self.notify.error("Could not read dc file.")
         else:
+            searchPath = getModelPath().getValue()
             for dcFileName in dcFileNames:
-                readResult = dcFile.read(Filename(dcFileName))
+                pathname = Filename(dcFileName)
+                vfs.resolveFilename(pathname, searchPath)
+                readResult = dcFile.read(pathname)
                 if not readResult:
-                    self.notify.error("Could not read dc file: %s" % (dcFileName))
+                    self.notify.error("Could not read dc file: %s" % (pathname))
 
         #if not dcFile.allObjectsValid():
         #    names = []

+ 7 - 1
direct/src/distributed/DistributedObjectAI.py

@@ -88,6 +88,12 @@ class DistributedObjectAI(DistributedObjectBase):
         if delEvent:
             messenger.send(delEvent)
 
+    def deleteOrDelay(self):
+        """ This method exists only to mirror the similar method on
+        DistributedObject.  AI objects don't have delayDelete, they
+        just get deleted immediately. """
+        self.delete()
+
     def delete(self):
         """
         Inheritors should redefine this to take appropriate action on delete
@@ -142,7 +148,7 @@ class DistributedObjectAI(DistributedObjectBase):
                 ### this delete message or to handle this message better
                 # TODO: do we still need this check?
                 if not hasattr(self, "doNotDeallocateChannel"):
-                    if self.air:
+                    if self.air and not hasattr(self.air, "doNotDeallocateChannel"):
                         if self.air.minChannel <= self.doId <= self.air.maxChannel:
                             self.air.deallocateChannel(self.doId)
                 self.air = None