hch
8 小时以前 862aeae51fdc2c8abd8753ac8d72c2ef2f07c03e
0312 服务器列表查找增加测试组
1个文件已修改
36 ■■■■■ 已修改文件
Main/System/Login/ServerListCenter.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Login/ServerListCenter.cs
@@ -90,6 +90,7 @@
    //从有数据的服务器列表 或者 总列表获取
    public ServerData GetServerData(int _id)
    {
        //历史登录列表 可能存在不存在的服务器
        if (serverInfoPlayer != null && serverInfoPlayer.player != null && serverInfoPlayer.player.group_list != null)
        {
            var serverGroup = serverInfoPlayer.player;
@@ -145,28 +146,35 @@
    //从总服务器列表获取
    public ServerData GetServerDataEx(int _id)
    {
        if (serverInfoCommon == null)
        if (serverInfoCommon != null && serverInfoCommon.common != null)
        {
            return default(ServerData);
        }
        else
        {
            if (serverInfoCommon.common != null)
            for (int i = 0; i < serverInfoCommon.common.Length; i++)
            {
                for (int i = 0; i < serverInfoCommon.common.Length; i++)
                var group = serverInfoCommon.common[i];
                for (int j = 0; j < group.group_list.Length; j++)
                {
                    var group = serverInfoCommon.common[i];
                    for (int j = 0; j < group.group_list.Length; j++)
                    var serverData = group.group_list[j];
                    if (serverData.region_flag == _id)
                    {
                        var serverData = group.group_list[j];
                        if (serverData.region_flag == _id)
                        {
                            return serverData;
                        }
                        return serverData;
                    }
                }
            }
        }
        //从白名单的服务器表中查找(测试用)
        if (serverInfoPlayer != null && serverInfoPlayer.gametest != null && serverInfoPlayer.gametest.group_list != null)
        {
            var serverGroup = serverInfoPlayer.gametest;
            for (int i = 0; i < serverGroup.group_list.Length; i++)
            {
                var serverData = serverGroup.group_list[i];
                if (serverData.region_flag == _id)
                {
                    return serverData;
                }
            }
        }
        return default(ServerData);
    }