def __init__(self, args):
        dcFileNames = ['direct.dc', 'ralph.dc']

        self.baseChannel = args.base_channel

        self.GameGlobalsId = GAME_GLOBALS_ID

        self.serverId = args.stateserver

        AstronInternalRepository.__init__(self, self.baseChannel, self.serverId, dcFileNames = dcFileNames,
                                  dcSuffix = 'UD', connectMethod = self.CM_NET,
                                  threadedNet = True)

        # This is needed so we can generate objects to our World object.
        self.districtId = self.allocateChannel()

        self.worldName = args.name

        # List of generated Ralph objects.
        self.avatars = []

        # Allow some time for other processes.
        base.setSleep(0.01)

        if ':' in args.astron_ip:
            hostname, tcpPort = args.astron_ip.split(':')
        else:
            hostname = args.astron_ip
            tcpPort = 7190
        self.acceptOnce('airConnected', self.connectSuccess)
        self.connect(hostname, int(tcpPort))
Ejemplo n.º 2
0
    def __init__(self, baseChannel, serverId, threadedNet = True):
        dcFileNames = ['direct.dc', 'tagger.dc']

        self.GameGlobalsId = 1000

        AstronInternalRepository.__init__(self, baseChannel, serverId, dcFileNames = dcFileNames,
                                  dcSuffix = 'AI', connectMethod = self.CM_NET,
                                  threadedNet = threadedNet)

        # Allow some time for other processes.
        base.setSleep(0.01)

        taskMgr.setupTaskChain('updateCells', numThreads = 1,
                               threadPriority = TPLow, frameSync = True)

        taskMgr.doMethodLater(5, self.__checkPosters, 'checkPosters')

        self.games = []

        self.managerId = self.allocateChannel()

        self.zoneAllocator = UniqueIdAllocator(3, 1000000)

        tcpPort = base.config.GetInt('ai-server-port', 7190)
        hostname = base.config.GetString('ai-server-host', '127.0.0.1')
        self.acceptOnce('airConnected', self.connectSuccess)
        self.connect(hostname, tcpPort)
 def __init__(self, baseChannel, serverId=None, dcFileNames=None,
              dcSuffix='AI', connectMethod=None, threadedNet=None):
     AstronInternalRepository.__init__(
         self, baseChannel, serverId=serverId, dcFileNames=dcFileNames,
         dcSuffix=dcSuffix, connectMethod=connectMethod, threadedNet=threadedNet)
     
     self.wantMongo = config.GetBool('want-mongo', False)
Ejemplo n.º 4
0
    def __init__(self, baseChannel, serverId, threadedNet=True):
        dcFileNames = ['direct.dc', 'toon.dc']

        self.GameGlobalsId = 1000

        AstronInternalRepository.__init__(self,
                                          baseChannel,
                                          serverId,
                                          dcFileNames=dcFileNames,
                                          dcSuffix='AI',
                                          connectMethod=self.CM_NET,
                                          threadedNet=threadedNet)

        # Allow some time for other processes.
        base.setSleep(0.01)

        self.games = []

        self.zoneTable = {}

        self.hoodArray = []

        self.hoods = []

        self.managerId = self.allocateChannel()
        self.toonMgrID = self.allocateChannel()

        self.zoneAllocator = UniqueIdAllocator(3, 1000000)

        tcpPort = base.config.GetInt('ai-server-port', 7199)
        hostname = base.config.GetString('ai-server-host', '127.0.0.1')
        self.acceptOnce('airConnected', self.connectSuccess)
        self.connect(hostname, tcpPort)
Ejemplo n.º 5
0
    def __init__(self, args):
        dcFileNames = ['direct.dc', 'ralph.dc']

        self.baseChannel = args.base_channel

        self.GameGlobalsId = GAME_GLOBALS_ID

        self.serverId = args.stateserver

        AstronInternalRepository.__init__(self,
                                          self.baseChannel,
                                          self.serverId,
                                          dcFileNames=dcFileNames,
                                          dcSuffix='UD',
                                          connectMethod=self.CM_NET,
                                          threadedNet=True)

        # Allow some time for other processes.
        base.setSleep(0.01)

        if ':' in args.astron_ip:
            hostname, tcpPort = args.astron_ip.split(':')
        else:
            hostname = args.astron_ip
            tcpPort = 7190
        self.acceptOnce('airConnected', self.connectSuccess)
        self.connect(hostname, int(tcpPort))
Ejemplo n.º 6
0
 def __init__(self, baseChannel, serverId, dcFileNames, dcSuffix,
              connectMethod, threadedNet):
     AstronInternalRepository.__init__(self,
                                       baseChannel,
                                       serverId=serverId,
                                       dcFileNames=dcFileNames,
                                       dcSuffix=dcSuffix,
                                       connectMethod=connectMethod,
                                       threadedNet=threadedNet)
    def __init__(self, baseChannel, serverId=None, dcFileNames=None,
                 dcSuffix='AI', connectMethod=None, threadedNet=None):
        AstronInternalRepository.__init__(
            self, baseChannel, serverId=serverId, dcFileNames=dcFileNames,
            dcSuffix=dcSuffix, connectMethod=connectMethod, threadedNet=threadedNet)

        self.netMessenger.register(0, 'shardStatus')
        self.netMessenger.register(1, 'queryShardStatus')
        self.netMessenger.register(2, 'startInvasion')
        self.netMessenger.register(3, 'stopInvasion')
 def __init__(self,
              baseChannel,
              serverId=None,
              dcFileNames=None,
              dcSuffix='AI',
              connectMethod=None,
              threadedNet=None):
     AstronInternalRepository.__init__(self, baseChannel, serverId,
                                       dcFileNames, dcSuffix, connectMethod,
                                       threadedNet)
     self._callbacks = {}
 def __init__(self, baseChannel, serverId=None, dcFileNames=None,
              dcSuffix='AI', connectMethod=None, threadedNet=None):
     AstronInternalRepository.__init__(
         self,
         baseChannel,
         serverId,
         dcFileNames,
         dcSuffix,
         connectMethod,
         threadedNet)
     self._callbacks = {}
Ejemplo n.º 10
0
    def __init__(self):
        self.baseChannel = 1000000
        self.GameGlobalsId = 1000
        self.serverId = 4002

        self.mongoCli = pymongo.MongoClient('localhost')
        self.dbCollection = self.mongoCli['jitsu']

        AstronInternalRepository.__init__(self, self.baseChannel, self.serverId,
                                          dcFileNames=['etc/jitsu.dc'],
                                          dcSuffix='UD', connectMethod=self.CM_NET, threadedNet=True)
Ejemplo n.º 11
0
    def __init__(self, baseChannel, serverId=None, dcFileNames = None,
                 dcSuffix='AI', connectMethod=None, threadedNet=None):
        AstronInternalRepository.__init__(self, baseChannel, serverId, dcFileNames,
                                 dcSuffix, connectMethod, threadedNet)
        self._callbacks = {}

        mongourl = mongodb_url.getValue()
        replicaset = mongodb_replicaset.getValue()
        db = (urlparse.urlparse(mongourl).path or '/test')[1:]
        if replicaset:
            self.mongo = pymongo.MongoClient(mongourl, replicaset=replicaset)
        else:
            self.mongo = pymongo.MongoClient(mongourl)
        self.mongodb = self.mongo[db]

        self.rpc = RPCClient()
    def __init__(self,
                 baseChannel,
                 serverId=None,
                 dcFileNames=None,
                 dcSuffix='AI',
                 connectMethod=None,
                 threadedNet=None):
        AstronInternalRepository.__init__(self,
                                          baseChannel,
                                          serverId=serverId,
                                          dcFileNames=dcFileNames,
                                          dcSuffix=dcSuffix,
                                          connectMethod=connectMethod,
                                          threadedNet=threadedNet)

        self.wantMongo = config.GetBool('want-mongo', False)
Ejemplo n.º 13
0
    def __init__(self, threadedNet = True):
        dcFileNames = ['direct.dc', 'tagger.dc']

        self.baseChannel = 100000000

        self.GameGlobalsId = 1000

        self.serverId = 402000

        AstronInternalRepository.__init__(self, self.baseChannel, self.serverId, dcFileNames = dcFileNames,
                                  dcSuffix = 'UD', connectMethod = self.CM_NET,
                                  threadedNet = threadedNet)

        # Allow some time for other processes.
        base.setSleep(0.01)

        tcpPort = base.config.GetInt('ai-server-port', 7190)
        hostname = base.config.GetString('ai-server-host', '127.0.0.1')
        self.acceptOnce('airConnected', self.connectSuccess)
        self.connect(hostname, tcpPort)
Ejemplo n.º 14
0
    def __init__(self, threadedNet = True):
        dcFileNames = ['direct.dc', 'toon.dc']

        self.baseChannel = 100000000

        self.GameGlobalsId = 1000

        self.serverId = 4002

        AstronInternalRepository.__init__(self, self.baseChannel, self.serverId, dcFileNames = dcFileNames,
                                  dcSuffix = 'UD', connectMethod = self.CM_NET,
                                  threadedNet = threadedNet)

        # Allow some time for other processes.
        base.setSleep(0.01)

        tcpPort = base.config.GetInt('ai-server-port', 7199)
        hostname = base.config.GetString('ai-server-host', '127.0.0.1')
        self.acceptOnce('airConnected', self.connectSuccess)
        self.connect(hostname, tcpPort)
Ejemplo n.º 15
0
    def __init__(self, baseChannel, stateserverId):
        self.GameGlobalsId = 1000
        AstronInternalRepository.__init__(self,
                                          baseChannel,
                                          stateserverId,
                                          dcFileNames=['etc/jitsu.dc'],
                                          dcSuffix='AI',
                                          connectMethod=self.CM_NET,
                                          threadedNet=True)

        self.games = []

        self.district = None
        self.districtId = self.allocateChannel()
        self.timeManager = None
        self.matchmaker = None
        self.game = None

        self.zoneAllocator = UniqueIdAllocator(3, 1048576)
        self.acceptOnce('airConnected', self.connectSuccess)
    def __init__(self, args):
        dcFileNames = ['direct.dc', 'ralph.dc']

        self.baseChannel = args.base_channel

        self.GameGlobalsId = GAME_GLOBALS_ID

        self.serverId = args.stateserver

        AstronInternalRepository.__init__(self, self.baseChannel, self.serverId, dcFileNames = dcFileNames,
                                  dcSuffix = 'UD', connectMethod = self.CM_NET,
                                  threadedNet = True)

        # Allow some time for other processes.
        base.setSleep(0.01)

        if ':' in args.astron_ip:
            hostname, tcpPort = args.astron_ip.split(':')
        else:
            hostname = args.astron_ip
            tcpPort = 7190
        self.acceptOnce('airConnected', self.connectSuccess)
        self.connect(hostname, int(tcpPort))
 def __init__(self, baseChannel, serverId=None, dcFileNames = None,
              dcSuffix = 'AI', connectMethod = None, threadedNet = None):
     if connectMethod is None:
         connectMethod = self.CM_NATIVE
         
     AstronInternalRepository.__init__(self, baseChannel, serverId, dcFileNames, dcSuffix, connectMethod, threadedNet)