Exemplo n.º 1
0
        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)
            //{
            //}
        }
Exemplo n.º 2
0
 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("");
     }
 }
Exemplo n.º 3
0
        //是否可以连接服务器
        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);
            }
        }