Beispiel #1
0
    // 获取服务器列表地址
    public static string GetServerListUrl()
    {
#if  UNITY_WP8 && !UNITY_EDITOR
        string strServerListPath = WPSDKHelperScript.Instance().WPGetServerlistUrl();
#elif UNITY_ANDROID && !UNITY_EDITOR
        string strServerListPath = AndroidHelper.platformHelper("getServerlistUrl");
#elif UNITY_IPHONE && !UNITY_EDITOR
        string strServerListPath = IOSHelper.Common_GetServerListUrl();
#else
        string strServerListPath = "0";
#endif
        if (string.Equals(strServerListPath, "0") || string.IsNullOrEmpty(strServerListPath))
        {
            //如果从平台URL获取错误,使用包体内的IPList
#if UNITY_ANDROID && !UNITY_EDITOR
            strServerListPath = Application.streamingAssetsPath + "/IPList.txt";
#else // IOS PC Editor
            strServerListPath = "file://" + Application.streamingAssetsPath + "/IPList.txt";
#endif
        }
        else
        {
            strServerListPath = DownloadHelper.AddTimestampToUrl(strServerListPath);
        }
        return(strServerListPath);
    }
Beispiel #2
0
    private DownloadHelper(string url, bool bRemote, string fileSavePath, DelegateDownloadFinish delFun)
    {
        m_curUrlArray         = new string[1];
        m_curFilePathArray    = new string[1];
        m_curFilePathArray[0] = fileSavePath;
        if (bRemote)
        {
            m_curUrlArray[0] = DownloadHelper.AddTimestampToUrl(url);
        }
        else
        {
            m_curUrlArray[0] = url;
        }

        m_curDelFun = delFun;
        m_bStop     = false;
    }
Beispiel #3
0
    private DownloadHelper(List <string> urlList, bool bRemote, List <string> fileSavePathList, DelegateDownloadFinish delFun)
    {
        m_curUrlArray = new string[urlList.Count];
        for (int i = 0; i < urlList.Count; i++)
        {
            if (bRemote)
            {
                m_curUrlArray[i] = DownloadHelper.AddTimestampToUrl(urlList[i]);
            }
            else
            {
                m_curUrlArray[i] = urlList[i];
            }
        }

        m_curFilePathArray = new string[fileSavePathList.Count];
        for (int i = 0; i < fileSavePathList.Count; i++)
        {
            m_curFilePathArray[i] = fileSavePathList[i];
        }

        m_curDelFun = delFun;
        m_bStop     = false;
    }