コード例 #1
0
 def __init__(self):
     base.cr = ClientRepository(
         dcFileNames=['phase_3/etc/direct.dc', 'phase_3/etc/toon.dc'],
         dcSuffix='AI')
     base.cr.connect([url],
                     successCallback=self.connectSuccess,
                     failureCallback=self.connectFailure)
     base.cTrav = CollisionTraverser()
     self.skeleton = 0
     if base.config.GetBool('want-suits', True):
         base.accept("SpawnSuit", self.createSuit)
     self.activeInvasion = False
     self.invasionSize = 0
     self.difficulty = ""
     self.title = DirectLabel(text="Server Menu",
                              pos=(-0.05, -0.1, -0.1),
                              scale=0.1,
                              relief=None,
                              text_fg=(1, 1, 1, 1),
                              parent=base.a2dTopRight,
                              text_align=TextNode.ARight)
     self.Suits = []
     base.pathNodes = []
     self.SuitCount = 0
     self.automaticSuits = 0
     self.hoodUtil = HoodUtil(base.cr)
     self.tournament = SuitTournament()
     self.lastChoice = None
     self.zoneAllocator = UniqueIdAllocator(50, 500)
コード例 #2
0
    def handleSetDoIdrange(self, di):
        self.doIdBase = di.getUint32()
        self.doIdLast = self.doIdBase + di.getUint32()
        self.doIdAllocator = UniqueIdAllocator(self.doIdBase,
                                               self.doIdLast - 1)

        self.ourChannel = self.doIdBase

        self.createReady()