def _get_server_list():
    """
        获取游戏服务器列表
    """
    from apps.game_manager.mysql import server_list
    all_server_list = server_list.get_all_server(True)
    server_list = []
    #server_list.append({'id': -1, 'name': u'通服务器'},)
    for item in all_server_list:
        server_id = item['id']
        server_name = item['name'] + '_' + str(item['id'])
        server_dict = {'id': server_id, 'name': server_name}
        server_list.append(server_dict)
    platform_list = [
        {'id': -1, 'name': u'通平台'},
        {'id': 0, 'name': u'测试'},
        {'id': 800003, 'name': u'海马'},
        {'id': 800004, 'name': u'飞流'},
        # {'id': 2, 'name': u'anysdk'},
        {'id': 500001, 'name':  u'iOS-91手机助手'},
        {'id': 500004, 'name':  u'iOS-iTools'},
        {'id': 500015, 'name':  u'iOS-快用'},
        {'id': 500017, 'name':  u'iOS-海马助手'},
        {'id': 500020, 'name':  u'iOS-爱思助手'},
        {'id': 500030, 'name':  u'iOS-XY助手'},
        {'id': 500002, 'name':  u'同步推'},
        {'id': 500003, 'name':  u'pp助手'},
        {'id': 800006, 'name':  u'爱苹果'},
        {'id': 500035, 'name':  u'叉叉助手'}
    ]
    return server_list, platform_list
def get_server_id_lst():
    """
        获取游戏服务器id列表 [10001,30001,10003,10004,10005,10006]
    """
    all_server_list = server_list.get_all_server(True)
    server_id_lst = []
    for item in all_server_list:
        server_id = int(item['id'])
        server_id_lst.append(server_id)
    return server_id_lst
示例#3
0
def server_lst(request):
    """
    服武器列表
    """
    data = {}
    table_list = []
    all_server_lst = server_list.get_all_server(True)
    for server in all_server_lst:
        temp_content = []
        temp_content.insert(0,str(server['id']))
        temp_content.insert(1,str(server['url']))
        temp_content.insert(2,str(server['name']))
        temp_content.insert(3,str(game_define.SERVER_STATE_NAME_DICT[server['state']]))
        temp_content.insert(4,str(server['version']))
        temp_content.insert(5,str(server['open_server_time'].strftime('%Y-%m-%d')))
        temp_content.insert(6,SERVER_HIDDEN_NAME_DICT[server['hidden']])
        table_list.append(temp_content)

    data['ser_info'] = table_list
    data['head_lst'] = head_lst
    return render_to_response("server_lst/server_lst.html", data, RequestContext(request))
def _get_server_list():
    """
        获取游戏服务器列表
    """
    from apps.game_manager.mysql import server_list
    all_server_list = server_list.get_all_server(True)
    server_list = []
    #server_list.append({'id': -1, 'name': u'通服务器'},)
    for item in all_server_list:
        server_id = item['id']
        server_name = item['name'] + '_' + str(item['id'])
        server_dict = {'id': server_id, 'name': server_name}
        server_list.append(server_dict)
    platform_list = [
        {
            'id': -1,
            'name': u'通平台'
        },
        {
            'id': 0,
            'name': u'测试'
        },
        {
            'id': 800003,
            'name': u'海马'
        },
        {
            'id': 800004,
            'name': u'飞流'
        },
        # {'id': 2, 'name': u'anysdk'},
        {
            'id': 500001,
            'name': u'iOS-91手机助手'
        },
        {
            'id': 500004,
            'name': u'iOS-iTools'
        },
        {
            'id': 500015,
            'name': u'iOS-快用'
        },
        {
            'id': 500017,
            'name': u'iOS-海马助手'
        },
        {
            'id': 500020,
            'name': u'iOS-爱思助手'
        },
        {
            'id': 500030,
            'name': u'iOS-XY助手'
        },
        {
            'id': 500002,
            'name': u'同步推'
        },
        {
            'id': 500003,
            'name': u'pp助手'
        },
        {
            'id': 800006,
            'name': u'爱苹果'
        },
        {
            'id': 500035,
            'name': u'叉叉助手'
        }
    ]
    return server_list, platform_list