Commit 192291f8 authored by nanahira's avatar nanahira

test mycard avatar

parent acf17130
......@@ -3,6 +3,7 @@ using System;
using System.Text;
using System.Collections.Generic;
using System.IO;
using System.Web;
[Serializable]
public class LoginUserObject {
......@@ -103,4 +104,36 @@ public class MyCardHelper {
fail_reason = null;
return ret;
}
public static void DownloadFace(string name) {
try {
WWW www = new WWW("https://api.moecube.com/accounts/users/"+HttpUtility.UrlEncode(name)+".avatar");
while (!www.isDone) {
if (Application.internetReachability == NetworkReachability.NotReachable || !string.IsNullOrEmpty(www.error))
{
return;
}
}
string result = www.text;
if(result == "{\"message\":\"Not Found\"}")
return;
DownloadFaceFromUrl(name, result);
} catch (Exception e) {
return;
}
}
private static void DownloadFaceFromUrl(string nameFace, string url)
{
string face = "textures/face/" + nameFace + ".png";
HttpDldFile df = new HttpDldFile();
df.Download(url, face);
if (File.Exists(face))
{
Texture2D Face = UIHelper.getTexture2D(face);
UIHelper.faces.Remove(nameFace);
UIHelper.faces.Add(nameFace, Face);
}
}
}
......@@ -1115,7 +1115,7 @@ public class Program : MonoBehaviour
string FPS = m_FPS.ToString();
try { FPS = FPS.Substring(0, 5); } catch{}
GUI.Label(new Rect(10, 5, 200, 200), "[Ver 1.034.9-B] " + "FPS: " + FPS);
GUI.Label(new Rect(10, 5, 200, 200), "[Ver 1.034.9-B-test1] " + "FPS: " + FPS);
}
void Update()
......
......@@ -5,6 +5,7 @@ using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using YGOSharp.Network.Enums;
using System.Threading;
public class Room : WindowServantSP
{
......@@ -163,6 +164,17 @@ public class Room : WindowServantSP
RoomPlayer player = new RoomPlayer();
player.name = name;
player.prep = false;
if (Program.I().mycard.isMatching && name != "********") //athletic match name mask
{
(new Thread(() =>
{
MyCardHelper.DownloadFace(name);
if(isShowed)
realize();
else if(Program.I().ocgcore.isShowed && Program.I().ocgcore.gameInfo)
Program.I().ocgcore.gameInfo.realize();
})).Start();
}
roomPlayers[pos] = player;
realize();
UIHelper.Flash();
......
......@@ -1417,7 +1417,7 @@ MonoBehaviour:
keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3}
mFont: {fileID: 0}
mText: KoishiPro2 iOS 1.034.9-B
mText: KoishiPro2 iOS 1.034.9-B-test1
mFontSize: 18
mFontStyle: 0
mAlignment: 1
......
......@@ -123,7 +123,7 @@ PlayerSettings:
16:10: 1
16:9: 1
Others: 1
bundleVersion: 1.034.9-B
bundleVersion: 1.034.9-B-test1
preloadedAssets: []
metroInputSource: 0
m_HolographicPauseOnTrackingLoss: 1
......
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