コード例 #1
0
ファイル: vesal_network.cs プロジェクト: RelinkaKing/UnityPC
        public static string get_ipfromlist(String url)
        {
            //try
            //{
            string str = Vesal_Http_Oper.http_get(url, "");

            if (str == "")
            {
                return("");
            }
            ip_info info = JsonConvert.DeserializeObject <ip_info>(str);

            for (int i = 0; i < info.list.Length; i++)
            {
                vesal_log.vesal_write_log("服务器地址: " + info.list[i].server + PublicClass.fix_server_interface);
                var list_info = info.list[i];
//                #if UNITY_EDITOR || UNITY_IOS
//                return list_info.server;
//#endif
                if (get_network_is_acitve() && get_vesal_server_is_available(list_info.server + PublicClass.fix_server_interface))
                {
                    return(list_info.server);
                }
            }
            return("");
            // throw new NotImplementedException();
            //}
            //catch (Exception)
            //{
            //}
        }
コード例 #2
0
ファイル: vesal_network.cs プロジェクト: RelinkaKing/UnityPC
 public static string get_low_res_ablist(String url)
 {
     try
     {
         string str = Vesal_Http_Oper.http_get(url, "");
         if (str == "")
         {
             return("");
         }
         return(str);
     }
     catch
     {
         return("");
     }
 }
コード例 #3
0
ファイル: vesal_network.cs プロジェクト: RelinkaKing/UnityPC
        //是否可以连接服务器
        public static bool get_vesal_server_is_available(String server_url)
        {
//            #if UNITY_EDITOR || UNITY_IOS
//            return true;
//#endif
            try
            {
                string str = Vesal_Http_Oper.http_get(server_url, "");
                if (str == "")
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception)
            {
                return(false);
            }
        }