Commit 7025ee5e authored by nanahira's avatar nanahira

fix

parent 1763a8cc
...@@ -57,11 +57,13 @@ public class MyCardHelper { ...@@ -57,11 +57,13 @@ public class MyCardHelper {
string data_str = data.Stringify(); string data_str = data.Stringify();
UnityWebRequest www = UnityWebRequest.Post("https://api.moecube.com/accounts/signin", data_str); UnityWebRequest www = UnityWebRequest.Post("https://api.moecube.com/accounts/signin", data_str);
www.SetRequestHeader("Content-Type", "application/json"); www.SetRequestHeader("Content-Type", "application/json");
yield return www.SendWebRequest(); www.SendWebRequest();
if (www.isNetworkError || www.isHttpError) while (!www.isDone) {
{ if (www.isNetworkError || www.isHttpError)
fail_reason = www.error; {
return false; fail_reason = www.error;
return false;
}
} }
else if (www.responseCode >= 400) else if (www.responseCode >= 400)
{ {
...@@ -92,11 +94,13 @@ public class MyCardHelper { ...@@ -92,11 +94,13 @@ public class MyCardHelper {
string auth_str = Convert.ToBase64String(Encoding.UTF8.GetBytes(username + ":" + userid)); string auth_str = Convert.ToBase64String(Encoding.UTF8.GetBytes(username + ":" + userid));
UnityWebRequest www = UnityWebRequest.Post("https://api.mycard.moe/ygopro/match?locale=zh-CN&arena=" + match_type, new WWWForm()); UnityWebRequest www = UnityWebRequest.Post("https://api.mycard.moe/ygopro/match?locale=zh-CN&arena=" + match_type, new WWWForm());
www.SetRequestHeader("Authorization", "Basic " + auth_str); www.SetRequestHeader("Authorization", "Basic " + auth_str);
yield return www.SendWebRequest(); www.SendWebRequest();
if (www.isNetworkError || www.isHttpError) while (!www.isDone) {
{ if (www.isNetworkError || www.isHttpError)
fail_reason = www.error; {
return null; fail_reason = www.error;
return null;
}
} }
else if (www.responseCode >= 400) else if (www.responseCode >= 400)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment