Browse Source

Nallowing new Global DC objects that are always in scope

Roger Hughston 21 years ago
parent
commit
3d952861b5
2 changed files with 26 additions and 0 deletions
  1. 22 0
      direct/src/distributed/ClientRepository.py
  2. 4 0
      direct/src/distributed/MsgTypes.py

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

@@ -181,6 +181,28 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
             # updateRequiredFields calls announceGenerate
         return distObj
 
+    def generateGlobalObject(self , doId, dcname):
+        # Look up the dclass
+        dclass = self.dclassesByName[dcname]
+        # Create a new distributed object, and put it in the dictionary
+        #distObj = self.generateWithRequiredFields(dclass, doId, di)
+        
+        # Construct a new one
+        classDef = dclass.getClassDef()
+        if classDef == None:
+             self.notify.error("Could not create an undefined %s object." % (dclass.getName()))
+        distObj = classDef(self)
+        distObj.dclass = dclass
+        # Assign it an Id
+        distObj.doId = doId
+        # Put the new do in the dictionary
+        self.doId2do[doId] = distObj
+        # Update the required fields
+        distObj.generateInit()  # Only called when constructed
+        distObj.generate()
+        # updateRequiredFields calls announceGenerate
+        return  distObj       
+
     def generateWithRequiredOtherFields(self, dclass, doId, di):
         if self.doId2do.has_key(doId):
             # ...it is in our dictionary.

+ 4 - 0
direct/src/distributed/MsgTypes.py

@@ -88,3 +88,7 @@ QUIET_ZONE_IGNORED_LIST = [
 CLIENT_LOGIN_2_GREEN = 1       # Disney's GoReg subscription token, not used.
 CLIENT_LOGIN_2_PLAY_TOKEN = 2  # VR Studio PlayToken.
 CLIENT_LOGIN_2_BLUE = 3        # The international GoReg token.
+
+
+# Global Object ID 's 
+GLOBAL_ID_FRIEND_MANAGER=  4501