AxiHttp网络异常处理,PSVita RenderTexture分辨率
This commit is contained in:
parent
5caff2dbda
commit
bbcd4de0b8
@ -132,6 +132,13 @@ namespace AxibugEmuOnline.Client.ClientCore
|
||||
yield return request.SendWebRequest;
|
||||
if (!request.downloadHandler.isDone)
|
||||
yield break;
|
||||
|
||||
if (request.downloadHandler.Err != null)
|
||||
{
|
||||
App.log.Error(request.downloadHandler.Err);
|
||||
yield break;
|
||||
}
|
||||
|
||||
Resp_CheckStandInfo resp = JsonUtility.FromJson<Resp_CheckStandInfo>(request.downloadHandler.text);
|
||||
|
||||
/*UnityWebRequest request = UnityWebRequest.Get($"{App.httpAPI.WebSiteApi}/CheckStandInfo?platform={platform}&version={Application.version}");
|
||||
|
@ -151,15 +151,9 @@ public static class AxiHttp
|
||||
{
|
||||
if (!dictIP2Address.ContainsKey(str))
|
||||
{
|
||||
try
|
||||
{
|
||||
IPAddress ip = Dns.GetHostEntry(str).AddressList[0];
|
||||
dictIP2Address[str] = ip;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
IPHostEntry host = Dns.GetHostEntry(str);
|
||||
IPAddress ip = host.AddressList[0];
|
||||
dictIP2Address[str] = ip;
|
||||
}
|
||||
return dictIP2Address[str];
|
||||
}
|
||||
@ -232,11 +226,12 @@ public static class AxiHttp
|
||||
string strRelativePath = "";
|
||||
bool bSSL = false;
|
||||
bool foward_302 = true;
|
||||
string ourErrMsg = "";
|
||||
|
||||
if (!ParseURI(strURI, ref bSSL, ref strHost, ref strIP, ref port, ref strRelativePath))
|
||||
if (!ParseURI(strURI, ref bSSL, ref strHost, ref strIP, ref port, ref strRelativePath,ref ourErrMsg))
|
||||
{
|
||||
Log("ParseURI False");
|
||||
respinfo.Err = "ParseURI False";
|
||||
respinfo.Err = ourErrMsg;
|
||||
respinfo.code = 0;
|
||||
respinfo.isDone = true;
|
||||
return;
|
||||
@ -531,11 +526,12 @@ public static class AxiHttp
|
||||
string strRelativePath = "";
|
||||
bool bSSL = false;
|
||||
bool foward_302 = true;
|
||||
string ourErrMsg = "";
|
||||
|
||||
if (!ParseURI(strURI, ref bSSL, ref strHost, ref strIP, ref port, ref strRelativePath))
|
||||
if (!ParseURI(strURI, ref bSSL, ref strHost, ref strIP, ref port, ref strRelativePath, ref ourErrMsg))
|
||||
{
|
||||
Log("ParseURI False");
|
||||
respinfo.Err = "ParseURI False";
|
||||
respinfo.Err = ourErrMsg;
|
||||
respinfo.code = 0;
|
||||
respinfo.isDone = true;
|
||||
return;
|
||||
@ -980,7 +976,13 @@ public static class AxiHttp
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public static bool ParseURI(string strURI, ref bool bIsSSL, ref string strHost, ref string strIP, ref int Port, ref string strRelativePath)
|
||||
public static bool ParseURI(string strURI,
|
||||
ref bool bIsSSL,
|
||||
ref string strHost,
|
||||
ref string strIP,
|
||||
ref int Port,
|
||||
ref string strRelativePath,
|
||||
ref string errMsg)
|
||||
{
|
||||
string strAddressRet;
|
||||
string strPortRet;
|
||||
@ -1013,7 +1015,10 @@ public static class AxiHttp
|
||||
strRelativePathRet = strLeft.Substring(nIndexRelative, strLeft.Length - nIndexRelative);
|
||||
}
|
||||
else
|
||||
{
|
||||
errMsg = "Err Url";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1025,18 +1030,19 @@ public static class AxiHttp
|
||||
strRelativePathRet = strLeft.Substring(nIndexRelative, strLeft.Length - nIndexRelative);
|
||||
}
|
||||
else
|
||||
{
|
||||
errMsg = "Err Url";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
strHost = strAddressRet;
|
||||
try
|
||||
{
|
||||
//IPHostEntry hostinfo = Dns.GetHostEntry(strAddressRet);
|
||||
//IPAddress[] aryIP = hostinfo.AddressList;
|
||||
//strIPRet = aryIP[0].ToString();
|
||||
strIPRet = GetDnsIP(strAddressRet).ToString();
|
||||
}
|
||||
catch
|
||||
catch(Exception ex)
|
||||
{
|
||||
errMsg = ex.ToString();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,13 @@ namespace AxibugEmuOnline.Client
|
||||
private RenderTexture result = null;
|
||||
public Texture ExecuteFilterRender(Texture src)
|
||||
{
|
||||
|
||||
#if UNITY_PSP2
|
||||
if (result == null)
|
||||
{
|
||||
result = RenderTexture.GetTemporary(Screen.width / 2, Screen.height / 2);
|
||||
}
|
||||
#else
|
||||
if (result == null)
|
||||
{
|
||||
result = RenderTexture.GetTemporary(Screen.width, Screen.height);
|
||||
@ -59,7 +66,7 @@ namespace AxibugEmuOnline.Client
|
||||
RenderTexture.ReleaseTemporary(result);
|
||||
result = RenderTexture.GetTemporary(Screen.width, Screen.height);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
bool anyFilterEnable = false;
|
||||
|
@ -63,6 +63,13 @@ namespace AxibugEmuOnline.Client
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (request.downloadHandler.Err != null)
|
||||
{
|
||||
App.log.Error(request.downloadHandler.Err);
|
||||
callback.Invoke(null);
|
||||
yield break;
|
||||
}
|
||||
|
||||
/*
|
||||
UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/NesRomList?Page={page}&PageSize={pageSize}&SearchKey={searchKey}");
|
||||
yield return request.SendWebRequest();
|
||||
@ -85,6 +92,13 @@ namespace AxibugEmuOnline.Client
|
||||
callback.Invoke(null);
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (request.downloadHandler.Err != null)
|
||||
{
|
||||
App.log.Error(request.downloadHandler.Err);
|
||||
callback.Invoke(null);
|
||||
yield break;
|
||||
}
|
||||
/*
|
||||
UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/NesRomList?Page={page}&PageSize={pageSize}");
|
||||
yield return request.SendWebRequest();
|
||||
@ -110,6 +124,13 @@ namespace AxibugEmuOnline.Client
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (request.downloadHandler.Err != null)
|
||||
{
|
||||
App.log.Error(request.downloadHandler.Err);
|
||||
callback.Invoke(null);
|
||||
yield break;
|
||||
}
|
||||
|
||||
/*
|
||||
UnityWebRequest request = UnityWebRequest.Get($"{WebSiteApi}/RomInfo?PType={PlatformType.Nes}&RomID={RomID}");
|
||||
yield return request.SendWebRequest();
|
||||
|
Loading…
Reference in New Issue
Block a user