Пример #1
0
def getGameCount(userId, clientId):
    count = 0
    for gameId in pokerconf.getConfigGameIds():
        if gameId not in gdata.games():
            continue

        gCount = gdata.games()[gameId].getPlayGameInfoByKey(userId, clientId, TYGame.PLAY_COUNT)
        ftlog.debug('hall_simple_invite.getGameCount gameId:', gameId, ' gameCount:', gCount)
        if gCount:
            count += gCount

    ftlog.debug('hall_simple_invite.getGameCount gameIds:', pokerconf.getConfigGameIds()
                , ' gameCount:', count)
    return count
Пример #2
0
def getAllTcDatas(moduleName):
    datas = {}
    games = pokerconf.getConfigGameIds()

    for gid in games:
        subdata = configure.getGameJson(gid, moduleName, {},
                                        configure.CLIENT_ID_TEMPLATE)
        for k, d in subdata.items():
            if not k in datas:
                if isinstance(d, dict):
                    datas[k] = {}
                else:
                    datas[k] = []

            if isinstance(d, dict):
                # check dict config
                for k1, d1 in d.items():
                    if k1 in datas[k]:
                        ftlog.debug('Notice ModuleName:', moduleName,
                                    ' Duplicated key:', k1, ' gameId:', gid,
                                    ' content:', d1)
                datas[k].update(d)
            elif isinstance(d, list):
                datas[k].extend(d)
            # try:
            #                     datas[k].sort(key=lambda x: x['name'])
            #                 except:
            #                     try:
            #                         datas[k].sort(key=lambda x: x['id'])
            #                     except:
            #                         pass
            else:
                datas[k] = d
                #     ftlog.debug('getAllTcDatas', 'all', moduleName, datas)
    return datas
Пример #3
0
def getGameCount(userId, clientId):
    count = 0
    for gameId in pokerconf.getConfigGameIds():
        if gameId not in gdata.games():
            continue

        gCount = gdata.games()[gameId].getPlayGameInfoByKey(
            userId, clientId, TYGame.PLAY_COUNT)
        ftlog.debug('hall_simple_invite.getGameCount gameId:', gameId,
                    ' gameCount:', gCount)
        if gCount:
            count += gCount

    ftlog.debug('hall_simple_invite.getGameCount gameIds:',
                pokerconf.getConfigGameIds(), ' gameCount:', count)
    return count
Пример #4
0
def getAllTcDatas(moduleName):
    datas = {}
    for gid in pokerconf.getConfigGameIds():
        subdata = configure.getGameJson(gid, moduleName, {}, configure.CLIENT_ID_TEMPLATE)
        #         ftlog.debug('getAllTcDatas', gid, moduleName, subdata)
        for k, d in subdata.items():
            if not k in datas:
                if isinstance(d, dict):
                    datas[k] = {}
                else:
                    datas[k] = []

            if isinstance(d, dict):
                # check dict config
                for k1, d1 in d.items():
                    if k1 in datas[k]:
                        ftlog.debug('Notice ModuleName:', moduleName
                                    , ' Duplicated key:', k1
                                    , ' gameId:', gid
                                    , ' content:', d1)
                datas[k].update(d)
            elif isinstance(d, list):
                datas[k].extend(d)
            # try:
            #                     datas[k].sort(key=lambda x: x['name'])
            #                 except:
            #                     try:
            #                         datas[k].sort(key=lambda x: x['id'])
            #                     except:
            #                         pass
            else:
                datas[k] = d
                #     ftlog.debug('getAllTcDatas', 'all', moduleName, datas)
    return datas
Пример #5
0
def _reloadConf():
    _gameSharePointMap.clear()
    for gameId in pokerconf.getConfigGameIds():
        _reloadGameConf(gameId)
Пример #6
0
def _onConfChanged(event):
    if _inited and event.isModuleChanged('share3'):
        for gameId in pokerconf.getConfigGameIds():
            if event.isChanged('game:%s:share3:0' % (gameId)):
                _reloadGameConf(gameId)