Commit 5faaf46a authored by Unicorn369's avatar Unicorn369

Merge

parents 1cfb22c7 f3f87c63
...@@ -58,3 +58,4 @@ strings.conf ...@@ -58,3 +58,4 @@ strings.conf
AI_core_vs2017solution/core.VC.db AI_core_vs2017solution/core.VC.db
AI_core_vs2017solution/core.VC.VC.opendb AI_core_vs2017solution/core.VC.VC.opendb
AI_core_vs2017solution/System.Servicemodel.Faltexception.dll AI_core_vs2017solution/System.Servicemodel.Faltexception.dll
Assets/StreamingAssets/update.zip*
...@@ -3,7 +3,7 @@ using System.Collections.Generic; ...@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
public static class Config public static class Config
{ {
public static uint ClientVersion = 0x1348; public static uint ClientVersion = 0x1349;
class oneString class oneString
{ {
......
...@@ -144,13 +144,13 @@ public class Menu : WindowServantSP ...@@ -144,13 +144,13 @@ public class Menu : WindowServantSP
Application.OpenURL("https://github.com/Unicorn369/pro2_android_closeup/releases/tag/1.0"); Application.OpenURL("https://github.com/Unicorn369/pro2_android_closeup/releases/tag/1.0");
#elif UNITY_ANDROID //Android #elif UNITY_ANDROID //Android
AndroidJavaObject jo = new AndroidJavaObject("cn.unicorn369.library.API"); AndroidJavaObject jo = new AndroidJavaObject("cn.unicorn369.library.API");
if (!File.Exists("updates/closeup_version1.1.txt")) {//用于检查更新 if (!File.Exists("updates/closeup_version1.2.txt")) {//用于检查更新
if (File.Exists("closeup_version1.1.zip")) {//如果有则直接解压 if (File.Exists("closeup_version1.2.zip")) {//如果有则直接解压
jo.Call("doExtractZipFile", "closeup_version1.1.zip", Program.ANDROID_GAME_PATH); jo.Call("doExtractZipFile", "closeup_version1.2.zip", Program.ANDROID_GAME_PATH);
} else if (File.Exists("updates/closeup_version1.0.txt")){//如果有则下载更新包 } else if (File.Exists("updates/closeup_version1.1.txt")){//如果有则下载更新包
jo.Call("doDownloadZipFile", "https://github.com/Unicorn369/pro2_android_closeup/releases/download/1.0/up_closeup_version1.1.zip"); jo.Call("doDownloadZipFile", "https://github.com/Unicorn369/pro2_android_closeup/releases/download/1.0/up_closeup_version1.2.zip");
} else {//否则下载并解压,锁定目录:/ygocore } else {//否则下载并解压,锁定目录:ANDROID_GAME_PATH
jo.Call("doDownloadZipFile", "https://github.com/Unicorn369/pro2_android_closeup/releases/download/1.0/closeup_version1.1.zip"); jo.Call("doDownloadZipFile", "https://github.com/Unicorn369/pro2_android_closeup/releases/download/1.0/closeup_version1.2.zip");
} }
} else { } else {
jo.Call("showToast", "已下载,无需再次下载!"); jo.Call("showToast", "已下载,无需再次下载!");
......
...@@ -334,7 +334,7 @@ public static class TcpHelper ...@@ -334,7 +334,7 @@ public static class TcpHelper
deckStrings.Clear(); deckStrings.Clear();
Package message = new Package(); Package message = new Package();
message.Fuction = (int)CtosMessage.JoinGame; message.Fuction = (int)CtosMessage.JoinGame;
Config.ClientVersion = (uint)GameStringManager.helper_stringToInt(version); //Config.ClientVersion = (uint)GameStringManager.helper_stringToInt(version);
message.Data.writer.Write((Int16)Config.ClientVersion); message.Data.writer.Write((Int16)Config.ClientVersion);
message.Data.writer.Write((byte)204); message.Data.writer.Write((byte)204);
message.Data.writer.Write((byte)204); message.Data.writer.Write((byte)204);
...@@ -715,17 +715,6 @@ public static class BinaryExtensions ...@@ -715,17 +715,6 @@ public static class BinaryExtensions
{ {
l2 = r.ReadInt32(); l2 = r.ReadInt32();
} }
if (((flag & (int)Query.Level) != 0) || ((flag & (int)Query.Rank) != 0))
{
if (l1 > l2)
{
data.Level = l1;
}
else
{
data.Level = l2;
}
}
if ((flag & (int)Query.Attribute) != 0) if ((flag & (int)Query.Attribute) != 0)
data.Attribute = r.ReadInt32(); data.Attribute = r.ReadInt32();
...@@ -741,8 +730,8 @@ public static class BinaryExtensions ...@@ -741,8 +730,8 @@ public static class BinaryExtensions
r.ReadInt32(); r.ReadInt32();
if ((flag & (int)Query.Reason) != 0) if ((flag & (int)Query.Reason) != 0)
r.ReadInt32(); r.ReadInt32();
//if ((flag & (int)Query.ReasonCard) != 0) if ((flag & (int)Query.ReasonCard) != 0)
// r.ReadInt32(); r.ReadInt32();
if ((flag & (int)Query.EquipCard) != 0) if ((flag & (int)Query.EquipCard) != 0)
{ {
cardToRefresh.addTarget(Program.I().ocgcore.GCS_cardGet(r.ReadGPS(), false)); cardToRefresh.addTarget(Program.I().ocgcore.GCS_cardGet(r.ReadGPS(), false));
...@@ -788,6 +777,26 @@ public static class BinaryExtensions ...@@ -788,6 +777,26 @@ public static class BinaryExtensions
data.LScale = r.ReadInt32(); data.LScale = r.ReadInt32();
if ((flag & (int)Query.RScale) != 0) if ((flag & (int)Query.RScale) != 0)
data.RScale = r.ReadInt32(); data.RScale = r.ReadInt32();
int l3 = 0;
if ((flag & (int)Query.Link) != 0)
{
l3 = r.ReadInt32(); //link value
data.rDefense = r.ReadInt32(); //link marker
}
if (((flag & (int)Query.Level) != 0) || ((flag & (int)Query.Rank) != 0) || ((flag & (int)Query.Link) != 0))
{
if (l1 > l2)
{
data.Level = l1;
}
else
{
data.Level = l2;
}
if(l3 > data.Level)
data.Level = l3;
}
cardToRefresh.set_data(data); cardToRefresh.set_data(data);
// //
} }
...@@ -891,4 +900,4 @@ public class TcpClientWithTimeout ...@@ -891,4 +900,4 @@ public class TcpClientWithTimeout
exception = ex; exception = ex;
} }
} }
} }
\ No newline at end of file
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text.RegularExpressions;
using UnityEngine; using UnityEngine;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
public class Ocgcore : ServantWithCardDescription public class Ocgcore : ServantWithCardDescription
...@@ -1303,6 +1304,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -1303,6 +1304,7 @@ public class Ocgcore : ServantWithCardDescription
logicalClearChain(); logicalClearChain();
surrended = false; surrended = false;
Program.I().room.duelEnded = false; Program.I().room.duelEnded = false;
Program.I().room.joinWithReconnect = false;
turns = 0; turns = 0;
deckReserved = false; deckReserved = false;
keys.Insert(0, currentMessageIndex); keys.Insert(0, currentMessageIndex);
...@@ -1316,6 +1318,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -1316,6 +1318,7 @@ public class Ocgcore : ServantWithCardDescription
isFirst = ((playertype & 0xf) > 0) ? false : true; isFirst = ((playertype & 0xf) > 0) ? false : true;
gameInfo.swaped = false; gameInfo.swaped = false;
isObserver = ((playertype & 0xf0) > 0) ? true : false; isObserver = ((playertype & 0xf0) > 0) ? true : false;
r.ReadByte(); // duel_rule
life_0 = r.ReadInt32(); life_0 = r.ReadInt32();
life_1 = r.ReadInt32(); life_1 = r.ReadInt32();
lpLimit = life_0; lpLimit = life_0;
...@@ -1366,7 +1369,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -1366,7 +1369,7 @@ public class Ocgcore : ServantWithCardDescription
gameField.currentPhase = GameField.ph.dp; gameField.currentPhase = GameField.ph.dp;
result = duelResult.disLink; result = duelResult.disLink;
deckReserved = false; deckReserved = false;
isFirst = true; //isFirst = true;
gameInfo.swaped = false; gameInfo.swaped = false;
logicalClearChain(); logicalClearChain();
surrended = false; surrended = false;
...@@ -3233,18 +3236,32 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3233,18 +3236,32 @@ public class Ocgcore : ServantWithCardDescription
code = r.ReadInt32(); code = r.ReadInt32();
gps = r.ReadShortGPS(); gps = r.ReadShortGPS();
r.ReadByte(); r.ReadByte();
int cr = 95; int cr = r.ReadInt32();
if (Config.ClientVersion >= 0x233c)
{
int cp = r.ReadInt32();
if (cp > 0)
cr = cp;
}
desc = GameStringManager.get(cr);
card = GCS_cardGet(gps, false); card = GCS_cardGet(gps, false);
desc = desc.Replace("[%ls]", "「" + card.get_data().Name + "」");
if (card != null) if (card != null)
{ {
string displayname = "「" + card.get_data().Name + "」";
if (cr == 0)
{
desc = GameStringManager.get(200);
Regex forReplaceFirst = new Regex("\\[%ls\\]");
desc = forReplaceFirst.Replace(desc, GameStringManager.formatLocation(gps), 1);
desc = forReplaceFirst.Replace(desc, displayname, 1);
}
else if (cr == 221)
{
desc = GameStringManager.get(221);
Regex forReplaceFirst = new Regex("\\[%ls\\]");
desc = forReplaceFirst.Replace(desc, GameStringManager.formatLocation(gps), 1);
desc = forReplaceFirst.Replace(desc, displayname, 1);
desc = desc + "\n" + GameStringManager.get(223);
}
else
{
desc = GameStringManager.get(cr);
Regex forReplaceFirst = new Regex("\\[%ls\\]");
desc = forReplaceFirst.Replace(desc, displayname, 1);
}
string hin = ES_hint + ",\n" + desc; string hin = ES_hint + ",\n" + desc;
RMSshow_yesOrNo("return", hin, new messageSystemValue { value = "1", hint = "yes" }, new messageSystemValue { value = "0", hint = "no" }); RMSshow_yesOrNo("return", hin, new messageSystemValue { value = "1", hint = "yes" }, new messageSystemValue { value = "0", hint = "no" });
card.add_one_decoration(Program.I().mod_ocgcore_decoration_chain_selecting, 4, Vector3.zero, "chain_selecting"); card.add_one_decoration(Program.I().mod_ocgcore_decoration_chain_selecting, 4, Vector3.zero, "chain_selecting");
...@@ -3401,8 +3418,6 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3401,8 +3418,6 @@ public class Ocgcore : ServantWithCardDescription
cancalable = (r.ReadByte() != 0) || finishable; cancalable = (r.ReadByte() != 0) || finishable;
ES_min = r.ReadByte(); ES_min = r.ReadByte();
ES_max = r.ReadByte(); ES_max = r.ReadByte();
ES_min = finishable ? 0 : 1; // SelectUnselectCard can actually always select 1 card
ES_max = 1; // SelectUnselectCard can actually always select 1 card
ES_level = 0; ES_level = 0;
count = r.ReadByte(); count = r.ReadByte();
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
...@@ -3419,12 +3434,13 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3419,12 +3434,13 @@ public class Ocgcore : ServantWithCardDescription
allCardsInSelectMessage.Add(card); allCardsInSelectMessage.Add(card);
} }
} }
count = r.ReadByte(); cardsSelected.Clear();
for (int i = 0; i < count; i++) int count2 = r.ReadByte();
for (int i = count; i < count + count2; i++)
{ {
code = r.ReadInt32(); code = r.ReadInt32();
gps = r.ReadGPS(); gps = r.ReadGPS();
/*card = GCS_cardGet(gps, false); card = GCS_cardGet(gps, false);
if (card != null) if (card != null)
{ {
card.set_code(code); card.set_code(code);
...@@ -3432,16 +3448,24 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3432,16 +3448,24 @@ public class Ocgcore : ServantWithCardDescription
card.forSelect = true; card.forSelect = true;
card.selectPtr = i; card.selectPtr = i;
allCardsInSelectMessage.Add(card); allCardsInSelectMessage.Add(card);
}*/ cardsSelected.Add(card);
}
} }
if (cancalable && !finishable) if (cancalable && !finishable)
{ {
gameInfo.addHashedButton("cancleSelected", -1, superButtonType.no, InterString.Get("取消选择@ui")); gameInfo.addHashedButton("cancleSelected", -1, superButtonType.no, InterString.Get("取消选择@ui"));
} }
if (finishable)
{
gameInfo.addHashedButton("sendSelected", 0, superButtonType.yes, InterString.Get("完成选择@ui"));
}
realizeCardsForSelect(); realizeCardsForSelect();
cardsSelected.Clear();
if (ES_selectHint != "") if (ES_selectHint != "")
ES_selectUnselectHint = ES_selectHint;
if (ES_selectUnselectHint != "")
{ {
gameField.setHint(ES_selectHint + " " + ES_min.ToString() + "-" + ES_max.ToString()); gameField.setHint(ES_selectUnselectHint + " " + ES_min.ToString() + "-" + ES_max.ToString());
} }
else else
{ {
...@@ -5648,7 +5672,6 @@ public class Ocgcore : ServantWithCardDescription ...@@ -5648,7 +5672,6 @@ public class Ocgcore : ServantWithCardDescription
} }
break; break;
case GameMessage.SelectCard: case GameMessage.SelectCard:
case GameMessage.SelectUnselectCard:
if (cardsSelectable.Count <= ES_min) if (cardsSelectable.Count <= ES_min)
{ {
autoSendCards(); autoSendCards();
...@@ -5820,18 +5843,6 @@ public class Ocgcore : ServantWithCardDescription ...@@ -5820,18 +5843,6 @@ public class Ocgcore : ServantWithCardDescription
real_send = true; real_send = true;
} }
} }
if (currentMessage == GameMessage.SelectUnselectCard)
{
if (cardsSelected.Count >= ES_min)
{
sendable = true;
}
if (cardsSelected.Count == ES_max || cardsSelected.Count == cardsSelectable.Count)
{
sendable = true;
real_send = true;
}
}
if (currentMessage == GameMessage.SelectTribute) if (currentMessage == GameMessage.SelectTribute)
{ {
int all = 0; int all = 0;
...@@ -5878,7 +5889,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -5878,7 +5889,7 @@ public class Ocgcore : ServantWithCardDescription
} }
} }
} }
else else if (currentMessage != GameMessage.SelectUnselectCard)
{ {
gameInfo.removeHashedButton("sendSelected"); gameInfo.removeHashedButton("sendSelected");
} }
...@@ -8078,6 +8089,8 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8078,6 +8089,8 @@ public class Ocgcore : ServantWithCardDescription
string ES_phaseString = ""; string ES_phaseString = "";
string ES_selectUnselectHint = "";
void toDefaultHint() void toDefaultHint()
{ {
gameField.setHint(ES_turnString + ES_phaseString); gameField.setHint(ES_turnString + ES_phaseString);
...@@ -8485,7 +8498,6 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8485,7 +8498,6 @@ public class Ocgcore : ServantWithCardDescription
} }
break; break;
case GameMessage.SelectCard: case GameMessage.SelectCard:
case GameMessage.SelectUnselectCard:
case GameMessage.SelectTribute: case GameMessage.SelectTribute:
case GameMessage.SelectSum: case GameMessage.SelectSum:
if (card.forSelect) if (card.forSelect)
...@@ -8526,6 +8538,16 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8526,6 +8538,16 @@ public class Ocgcore : ServantWithCardDescription
realizeCardsForSelect(); realizeCardsForSelect();
} }
break; break;
case GameMessage.SelectUnselectCard:
if (card.forSelect)
{
cardsSelected.Add(card);
gameInfo.removeHashedButton("sendSelected");
sendSelectedCards();
realize();
toNearest();
}
break;
case GameMessage.SelectChain: case GameMessage.SelectChain:
if (card.forSelect) if (card.forSelect)
{ {
...@@ -8589,14 +8611,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8589,14 +8611,7 @@ public class Ocgcore : ServantWithCardDescription
BinaryMaster binaryMaster = new BinaryMaster(); BinaryMaster binaryMaster = new BinaryMaster();
for (int i = 0; i < allCardsInSelectMessage.Count; i++) for (int i = 0; i < allCardsInSelectMessage.Count; i++)
{ {
if (Config.ClientVersion>=0x133d) binaryMaster.writer.Write((short)allCardsInSelectMessage[i].counterSELcount);
{
binaryMaster.writer.Write((short)allCardsInSelectMessage[i].counterSELcount);
}
else
{
binaryMaster.writer.Write((byte)allCardsInSelectMessage[i].counterSELcount);
}
} }
sendReturn(binaryMaster.get()); sendReturn(binaryMaster.get());
} }
...@@ -8811,8 +8826,9 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8811,8 +8826,9 @@ public class Ocgcore : ServantWithCardDescription
public Dictionary<int, int> sideReference = new Dictionary<int, int>(); public Dictionary<int, int> sideReference = new Dictionary<int, int>();
void onDuelResultConfirmed() public void onDuelResultConfirmed()
{ {
Program.I().room.joinWithReconnect = false;
if (Program.I().room.duelEnded == true || surrended || TcpHelper.tcpClient == null || TcpHelper.tcpClient.Connected == false) if (Program.I().room.duelEnded == true || surrended || TcpHelper.tcpClient == null || TcpHelper.tcpClient.Connected == false)
{ {
......
...@@ -295,7 +295,7 @@ public class Program : MonoBehaviour ...@@ -295,7 +295,7 @@ public class Program : MonoBehaviour
#elif UNITY_ANDROID //Android #elif UNITY_ANDROID //Android
/** /**
* public String GamePath(String path) { * public String GamePath(String path) {
* GAME_DIR = Environment.getExternalStorageDirectory().toString(); + path; * GAME_DIR = Environment.getExternalStorageDirectory().toString() + path;
* return GAME_DIR; * return GAME_DIR;
* } * }
*/ */
...@@ -304,7 +304,7 @@ public class Program : MonoBehaviour ...@@ -304,7 +304,7 @@ public class Program : MonoBehaviour
Screen.sleepTimeout = SleepTimeout.NeverSleep; Screen.sleepTimeout = SleepTimeout.NeverSleep;
if (!File.Exists(ANDROID_GAME_PATH + "updates/version2.0.txt")) if (!File.Exists(ANDROID_GAME_PATH + "updates/version2.0.txt"))
{ {
string filePath = Application.streamingAssetsPath + "/ygocore.zip"; string filePath = Application.streamingAssetsPath + "/ygopro2-data.zip";
var www = new WWW(filePath); var www = new WWW(filePath);
while (!www.isDone) { } while (!www.isDone) { }
byte[] bytes = www.bytes; byte[] bytes = www.bytes;
...@@ -321,7 +321,17 @@ public class Program : MonoBehaviour ...@@ -321,7 +321,17 @@ public class Program : MonoBehaviour
byte[] bytes = www.bytes; byte[] bytes = www.bytes;
ExtractZipFile(bytes, ANDROID_GAME_PATH); ExtractZipFile(bytes, ANDROID_GAME_PATH);
} }
/* //选择性更新
if (!File.Exists(ANDROID_GAME_PATH + "updates/version2.2.2.txt"))
{
string filePath = Application.streamingAssetsPath + "/update.zip";
var www = new WWW(filePath);
while (!www.isDone) { }
byte[] bytes = www.bytes;
ExtractZipFile(bytes, ANDROID_GAME_PATH);
//File.Create(ANDROID_GAME_PATH + ".nomedia");
}
*/
Environment.CurrentDirectory = ANDROID_GAME_PATH; Environment.CurrentDirectory = ANDROID_GAME_PATH;
System.IO.Directory.SetCurrentDirectory(ANDROID_GAME_PATH); System.IO.Directory.SetCurrentDirectory(ANDROID_GAME_PATH);
...@@ -329,11 +339,8 @@ public class Program : MonoBehaviour ...@@ -329,11 +339,8 @@ public class Program : MonoBehaviour
string GamePaths = Application.persistentDataPath + "/ygopro2/"; string GamePaths = Application.persistentDataPath + "/ygopro2/";
if (!File.Exists(GamePaths + "updates/version2.0.txt")) if (!File.Exists(GamePaths + "updates/version2.0.txt"))
{ {
string filePath = Application.streamingAssetsPath + "/ygocore.zip"; string filePath = Application.streamingAssetsPath + "/ygopro2-data.zip";
var www = new WWW(filePath); ExtractZipFile(System.IO.File.ReadAllBytes(filePath), GamePaths);
while (!www.isDone) { }
byte[] bytes = www.bytes;
ExtractZipFile(System.IO.File.ReadAllBytes(bytes), GamePaths);
} }
Environment.CurrentDirectory = GamePaths; Environment.CurrentDirectory = GamePaths;
System.IO.Directory.SetCurrentDirectory(GamePaths); System.IO.Directory.SetCurrentDirectory(GamePaths);
...@@ -399,26 +406,26 @@ public class Program : MonoBehaviour ...@@ -399,26 +406,26 @@ public class Program : MonoBehaviour
loadResources(); loadResources();
#if !UNITY_EDITOR && UNITY_ANDROID //Android Java Test #if !UNITY_EDITOR && UNITY_ANDROID //Android Java Test
if (!File.Exists("updates/image_version1.1.txt"))//用于检查更新 if (!File.Exists("updates/image_version1.2.txt"))//用于检查更新
{ {
if (File.Exists("pics.zip")) {//YGOMobile内置的卡图包 if (File.Exists("pics.zip")) {
jo.Call("doExtractZipFile", "pics.zip", ANDROID_GAME_PATH); jo.Call("doExtractZipFile", "pics.zip", ANDROID_GAME_PATH);
File.Copy("updates/version2.0.txt", "updates/image_version1.1.txt", true); File.Copy("updates/version2.0.txt", "updates/image_version1.2.txt", true);
} else { } else {
//Application.OpenURL("https://www.taptap.com/app/37972"); jo.Call("doDownloadZipFile", "https://github.com/Unicorn369/pro2_android_closeup/releases/download/1.0/pics.zip");
jo.Call("showToast", "没有发现卡图包,是否未安装YGOMobile");
} }
} }
/** /**
* 使用Termux编译生成的:libgdiplus.so (https://github.com/Unicorn369/libgdiplus-Android) * 使用Termux编译生成的:libgdiplus.so (https://github.com/Unicorn369/libgdiplus-Android)
* 经测试,只有Android 6.0以上才能正常使用。为了让Android 6.0以下的也能凑合使用立绘效果,需做判断 * 经测试,只有Android 6.0以上才能正常使用。为了让Android 6.0以下的也能凑合使用立绘效果,需做判断
* 部分6.0机型可能无法正常使用,如需支持需要额外判断型号:华为、OPPO、VIVO、乐视等机型
* *
* public boolean APIVersion() { * public boolean APIVersion() {
* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { * if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
* return true; * return true;
* } else { * } else {
* return true; * return false;
* } * }
* } * }
*/ */
...@@ -1074,7 +1081,7 @@ public class Program : MonoBehaviour ...@@ -1074,7 +1081,7 @@ public class Program : MonoBehaviour
_padScroll = 0; _padScroll = 0;
} }
GUI.Label(new Rect(10, 5, 200, 200), "[Version 2.2] " + "FPS: " + m_FPS); GUI.Label(new Rect(10, 5, 200, 200), "[Ver 2.2.2] " + "FPS: " + m_FPS);
} }
void Update() void Update()
......
...@@ -12,7 +12,7 @@ public static class GameStringManager ...@@ -12,7 +12,7 @@ public static class GameStringManager
public static List<hashedString> hashedStrings = new List<hashedString>(); public static List<hashedString> hashedStrings = new List<hashedString>();
public static List<hashedString> xilies = new List<hashedString>(); public static List<hashedString> xilies = new List<hashedString>();
public static int helper_stringToInt(string str) public static int helper_stringToInt(string str)
{ {
...@@ -86,7 +86,7 @@ public static class GameStringManager ...@@ -86,7 +86,7 @@ public static class GameStringManager
return re; return re;
} }
internal static string get_unsafe(int hashCode) internal static string get_unsafe(int hashCode)
{ {
string re = ""; string re = "";
foreach (hashedString s in hashedStrings) foreach (hashedString s in hashedStrings)
...@@ -100,7 +100,7 @@ public static class GameStringManager ...@@ -100,7 +100,7 @@ public static class GameStringManager
return re; return re;
} }
internal static string get(int description) internal static string get(int description)
{ {
string a = ""; string a = "";
if (description < 10000) if (description < 10000)
...@@ -122,5 +122,30 @@ public static class GameStringManager ...@@ -122,5 +122,30 @@ public static class GameStringManager
} }
return a; return a;
} }
internal static string formatLocation(uint location, uint sequence)
{
if (location == 0x8)
{
if (sequence < 5)
return get(1003);
else if (sequence == 5)
return get(1008);
else
return get(1009);
}
uint filter = 1;
int i = 1000;
for (; filter != 0x100 && filter != location; filter <<= 1)
++i;
if (filter == location)
return get(i);
else
return "???";
}
internal static string formatLocation(GPS gps)
{
return formatLocation(gps.location, gps.sequence);
}
} }
...@@ -619,6 +619,11 @@ public class GameTextureManager ...@@ -619,6 +619,11 @@ public class GameTextureManager
file.Read(data, 0, (int)file.Length); file.Read(data, 0, (int)file.Length);
} }
pic.data = data; pic.data = data;
if (!loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{
loadedList.Add(hashPic(pic.code, pic.type), pic);
}
} }
} }
else else
......
...@@ -497,6 +497,7 @@ public class Room : WindowServantSP ...@@ -497,6 +497,7 @@ public class Room : WindowServantSP
Program.I().ocgcore.returnServant = Program.I().selectServer; Program.I().ocgcore.returnServant = Program.I().selectServer;
needSide = false; needSide = false;
joinWithReconnect = true;
if (Program.I().deckManager.isShowed) if (Program.I().deckManager.isShowed)
{ {
Program.I().deckManager.hide(); Program.I().deckManager.hide();
...@@ -524,16 +525,21 @@ public class Room : WindowServantSP ...@@ -524,16 +525,21 @@ public class Room : WindowServantSP
is_host = ((type >> 4) & 0xf) != 0; is_host = ((type >> 4) & 0xf) != 0;
if (is_host) if (is_host)
{ {
if (selftype < 4 && roomPlayers[selftype] != null) {
roomPlayers[selftype].prep = false;
}
UIHelper.shiftButton(startButton(), true); UIHelper.shiftButton(startButton(), true);
lazyRoom.start.localScale = Vector3.one; lazyRoom.start.localScale = Vector3.one;
lazyRoom.ready.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f + 30f, 0);
lazyRoom.duelist.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f, 0); lazyRoom.duelist.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f, 0);
lazyRoom.observer.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f-30f, 0); lazyRoom.observer.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f, 0);
lazyRoom.start.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f - 30f, 0); lazyRoom.start.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f - 30f, 0);
} }
else else
{ {
UIHelper.shiftButton(startButton(), false); UIHelper.shiftButton(startButton(), false);
lazyRoom.start.localScale = Vector3.zero; lazyRoom.start.localScale = Vector3.zero;
lazyRoom.ready.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f, 0);
lazyRoom.duelist.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f, 0); lazyRoom.duelist.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f, 0);
lazyRoom.observer.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f - 30f, 0); lazyRoom.observer.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f - 30f, 0);
lazyRoom.start.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f - 30f - 30f, 0); lazyRoom.start.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f - 30f - 30f, 0);
...@@ -570,12 +576,16 @@ public class Room : WindowServantSP ...@@ -570,12 +576,16 @@ public class Room : WindowServantSP
public bool needSide = false; public bool needSide = false;
public bool joinWithReconnect = false;
public void StocMessage_ChangeSide(BinaryReader r) public void StocMessage_ChangeSide(BinaryReader r)
{ {
Program.I().ocgcore.surrended = false; Program.I().ocgcore.surrended = false;
Program.I().ocgcore.returnServant = Program.I().deckManager; Program.I().ocgcore.returnServant = Program.I().deckManager;
needSide = true; needSide = true;
if(Program.I().ocgcore.condition != Ocgcore.Condition.duel || joinWithReconnect) { //Change side when reconnect
Program.I().ocgcore.onDuelResultConfirmed();
}
} }
GameObject handres = null; GameObject handres = null;
...@@ -739,9 +749,9 @@ public class Room : WindowServantSP ...@@ -739,9 +749,9 @@ public class Room : WindowServantSP
r.ReadByte(); r.ReadByte();
r.ReadByte(); r.ReadByte();
code = r.ReadInt32(); code = r.ReadInt32();
string hexOutput = "0x"+String.Format("{0:X}", code); //string hexOutput = "0x"+String.Format("{0:X}", code);
Program.I().selectServer.set_version(hexOutput); //Program.I().selectServer.set_version(hexOutput);
RMSshow_none(InterString.Get("你输入的版本号和服务器不一致,[7CFC00]YGOPro2已经智能切换版本号[-],请重新链接。")); //RMSshow_none(InterString.Get("你输入的版本号和服务器不一致,[7CFC00]YGOPro2已经智能切换版本号[-],请重新链接。"));
break; break;
default: default:
break; break;
...@@ -1013,6 +1023,7 @@ public class Room : WindowServantSP ...@@ -1013,6 +1023,7 @@ public class Room : WindowServantSP
UIHelper.registUIEventTriggerForClick(exitButton().gameObject, listenerForClicked); UIHelper.registUIEventTriggerForClick(exitButton().gameObject, listenerForClicked);
UIHelper.registUIEventTriggerForClick(duelistButton().gameObject, listenerForClicked); UIHelper.registUIEventTriggerForClick(duelistButton().gameObject, listenerForClicked);
UIHelper.registUIEventTriggerForClick(observerButton().gameObject, listenerForClicked); UIHelper.registUIEventTriggerForClick(observerButton().gameObject, listenerForClicked);
UIHelper.registUIEventTriggerForClick(readyButton().gameObject, listenerForClicked);
realize(); realize();
superScrollView.refreshForOneFrame(); superScrollView.refreshForOneFrame();
} }
...@@ -1059,12 +1070,32 @@ public class Room : WindowServantSP ...@@ -1059,12 +1070,32 @@ public class Room : WindowServantSP
return UIHelper.getByName<UIButton>(gameObject, "observer_"); return UIHelper.getByName<UIButton>(gameObject, "observer_");
} }
private UIButton readyButton()
{
return UIHelper.getByName<UIButton>(gameObject, "ready_");
}
void listenerForClicked(GameObject gameObjectListened) void listenerForClicked(GameObject gameObjectListened)
{ {
if (gameObjectListened.name == "exit_") if (gameObjectListened.name == "exit_")
{ {
Program.I().ocgcore.onExit(); Program.I().ocgcore.onExit();
} }
if (gameObjectListened.name == "ready_")
{
if (selftype < realPlayers.Length && realPlayers[selftype] != null)
{
if (realPlayers[selftype].getIfPreped())
{
TcpHelper.CtosMessage_HsNotReady();
}
else
{
TcpHelper.CtosMessage_UpdateDeck(new YGOSharp.Deck("deck/" + Config.Get("deckInUse", "wizard") + ".ydk"));
TcpHelper.CtosMessage_HsReady();
}
}
}
if (gameObjectListened.name == "duelist_") if (gameObjectListened.name == "duelist_")
{ {
TcpHelper.CtosMessage_HsToDuelist(); TcpHelper.CtosMessage_HsToDuelist();
......
...@@ -111,8 +111,8 @@ public class RoomList : WindowServantSP ...@@ -111,8 +111,8 @@ public class RoomList : WindowServantSP
string versionString = UIHelper.getByName<UIInput>(Program.I().selectServer.gameObject, "version_").value; string versionString = UIHelper.getByName<UIInput>(Program.I().selectServer.gameObject, "version_").value;
if (versionString == "") if (versionString == "")
{ {
UIHelper.getByName<UIInput>(Program.I().selectServer.gameObject, "version_").value = "0x1348"; UIHelper.getByName<UIInput>(Program.I().selectServer.gameObject, "version_").value = "0x1349";
versionString = "0x1348"; versionString = "0x1349";
} }
Program.I().roomList.hide(); Program.I().roomList.hide();
Program.I().selectServer.KF_onlineGame(Name, ipString, portString, versionString, pswString); Program.I().selectServer.KF_onlineGame(Name, ipString, portString, versionString, pswString);
......
...@@ -53,7 +53,7 @@ public class PrecyOcg ...@@ -53,7 +53,7 @@ public class PrecyOcg
} }
else else
{ {
Config.ClientVersion = 0x233c; //Config.ClientVersion = 0x233c;
Program.I().shiftToServant(Program.I().ocgcore); Program.I().shiftToServant(Program.I().ocgcore);
} }
((CardDescription)Program.I().cardDescription).setTitle(path); ((CardDescription)Program.I().cardDescription).setTitle(path);
...@@ -78,7 +78,7 @@ public class PrecyOcg ...@@ -78,7 +78,7 @@ public class PrecyOcg
} }
else else
{ {
Config.ClientVersion = 0x233c; //Config.ClientVersion = 0x233c;
Program.I().shiftToServant(Program.I().ocgcore); Program.I().shiftToServant(Program.I().ocgcore);
} }
} }
......
...@@ -19,7 +19,6 @@ public class SelectServer : WindowServantSP ...@@ -19,7 +19,6 @@ public class SelectServer : WindowServantSP
UIHelper.registEvent(gameObject, "exit_", onClickExit); UIHelper.registEvent(gameObject, "exit_", onClickExit);
UIHelper.registEvent(gameObject, "face_", onClickFace); UIHelper.registEvent(gameObject, "face_", onClickFace);
UIHelper.registEvent(gameObject, "join_", onClickJoin); UIHelper.registEvent(gameObject, "join_", onClickJoin);
//UIHelper.registEvent(gameObject, "roomList_", onClickRoomList);
UIHelper.getByName<UIInput>(gameObject, "name_").value = Config.Get("name","一秒一喵机会"); UIHelper.getByName<UIInput>(gameObject, "name_").value = Config.Get("name","一秒一喵机会");
list = UIHelper.getByName<UIPopupList>(gameObject, "history_"); list = UIHelper.getByName<UIPopupList>(gameObject, "history_");
UIHelper.registEvent(gameObject,"history_", onSelected); UIHelper.registEvent(gameObject,"history_", onSelected);
...@@ -27,7 +26,8 @@ public class SelectServer : WindowServantSP ...@@ -27,7 +26,8 @@ public class SelectServer : WindowServantSP
inputIP = UIHelper.getByName<UIInput>(gameObject, "ip_"); inputIP = UIHelper.getByName<UIInput>(gameObject, "ip_");
inputPort = UIHelper.getByName<UIInput>(gameObject, "port_"); inputPort = UIHelper.getByName<UIInput>(gameObject, "port_");
inputPsw = UIHelper.getByName<UIInput>(gameObject, "psw_"); inputPsw = UIHelper.getByName<UIInput>(gameObject, "psw_");
inputVersion = UIHelper.getByName<UIInput>(gameObject, "version_"); //inputVersion = UIHelper.getByName<UIInput>(gameObject, "version_");
set_version("0x" + String.Format("{0:X}", Config.ClientVersion));
SetActiveFalse(); SetActiveFalse();
} }
...@@ -76,7 +76,7 @@ public class SelectServer : WindowServantSP ...@@ -76,7 +76,7 @@ public class SelectServer : WindowServantSP
inputIP.value = ip; inputIP.value = ip;
inputPort.value = port; inputPort.value = port;
inputPsw.value = psw; inputPsw.value = psw;
inputVersion.value = version; //inputVersion.value = version;
} }
public override void show() public override void show()
...@@ -143,11 +143,6 @@ public class SelectServer : WindowServantSP ...@@ -143,11 +143,6 @@ public class SelectServer : WindowServantSP
string portString = UIHelper.getByName<UIInput>(gameObject, "port_").value; string portString = UIHelper.getByName<UIInput>(gameObject, "port_").value;
string pswString = UIHelper.getByName<UIInput>(gameObject, "psw_").value; string pswString = UIHelper.getByName<UIInput>(gameObject, "psw_").value;
string versionString = UIHelper.getByName<UIInput>(gameObject, "version_").value; string versionString = UIHelper.getByName<UIInput>(gameObject, "version_").value;
if (versionString=="")
{
UIHelper.getByName<UIInput>(gameObject, "version_").value = "0x1348";
versionString = "0x1348";
}
KF_onlineGame(Name, ipString, portString, versionString, pswString); KF_onlineGame(Name, ipString, portString, versionString, pswString);
} }
...@@ -162,11 +157,6 @@ public class SelectServer : WindowServantSP ...@@ -162,11 +157,6 @@ public class SelectServer : WindowServantSP
string portString = UIHelper.getByName<UIInput>(gameObject, "port_").value; string portString = UIHelper.getByName<UIInput>(gameObject, "port_").value;
string pswString = "L"; string pswString = "L";
string versionString = UIHelper.getByName<UIInput>(gameObject, "version_").value; string versionString = UIHelper.getByName<UIInput>(gameObject, "version_").value;
if (versionString == "")
{
UIHelper.getByName<UIInput>(gameObject, "version_").value = "0x1348";
versionString = "0x1348";
}
KF_onlineGame(Name, ipString, portString, versionString, pswString); KF_onlineGame(Name, ipString, portString, versionString, pswString);
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
Owner = 0x40000, Owner = 0x40000,
Status = 0x80000, Status = 0x80000,
LScale = 0x200000, LScale = 0x200000,
RScale = 0x400000 RScale = 0x400000,
Link = 0x800000
} }
} }
\ No newline at end of file
...@@ -594,7 +594,7 @@ Transform: ...@@ -594,7 +594,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 195152} m_GameObject: {fileID: 195152}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 300, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 419752} - {fileID: 419752}
...@@ -745,7 +745,7 @@ Transform: ...@@ -745,7 +745,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 196122} m_GameObject: {fileID: 196122}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3, y: 0, z: 0} m_LocalPosition: {x: 303, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 428902} m_Father: {fileID: 428902}
...@@ -1762,7 +1762,7 @@ MonoBehaviour: ...@@ -1762,7 +1762,7 @@ MonoBehaviour:
keepCrispWhenShrunk: 1 keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} mTrueTypeFont: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
mFont: {fileID: 0} mFont: {fileID: 0}
mText: "\u623F\u95F4\u540D\uFF1A" mText: "\u623F\u95F4\u5BC6\u7801\uFF1A"
mFontSize: 25 mFontSize: 25
mFontStyle: 0 mFontStyle: 0
mAlignment: 1 mAlignment: 1
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections; using System.Collections;
public class lazyRoom : MonoBehaviour { public class lazyRoom : MonoBehaviour {
public Transform ready;
public Transform duelist; public Transform duelist;
public Transform observer; public Transform observer;
public Transform start; public Transform start;
......
...@@ -2212,7 +2212,7 @@ MonoBehaviour: ...@@ -2212,7 +2212,7 @@ MonoBehaviour:
keepCrispWhenShrunk: 1 keepCrispWhenShrunk: 1
mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3} mTrueTypeFont: {fileID: 12800000, guid: f775853fdfd14bb47934543e95c3bae3, type: 3}
mFont: {fileID: 0} mFont: {fileID: 0}
mText: YGOPro2 Android 1.034.8 mText: YGOPro2 Android 1.034.9
mFontSize: 18 mFontSize: 18
mFontStyle: 0 mFontStyle: 0
mAlignment: 1 mAlignment: 1
......
This diff is collapsed.
...@@ -123,7 +123,7 @@ PlayerSettings: ...@@ -123,7 +123,7 @@ PlayerSettings:
16:10: 1 16:10: 1
16:9: 1 16:9: 1
Others: 1 Others: 1
bundleVersion: 1.034.8 (Test 2.2) bundleVersion: 2.2.2 (1.034.9)
preloadedAssets: [] preloadedAssets: []
metroInputSource: 0 metroInputSource: 0
m_HolographicPauseOnTrackingLoss: 1 m_HolographicPauseOnTrackingLoss: 1
...@@ -148,7 +148,7 @@ PlayerSettings: ...@@ -148,7 +148,7 @@ PlayerSettings:
tvOS: cn.ygopro2.ygopro2android tvOS: cn.ygopro2.ygopro2android
buildNumber: buildNumber:
iOS: iOS:
AndroidBundleVersionCode: 4 AndroidBundleVersionCode: 5
AndroidMinSdkVersion: 16 AndroidMinSdkVersion: 16
AndroidTargetSdkVersion: 0 AndroidTargetSdkVersion: 0
AndroidPreferredInstallLocation: 0 AndroidPreferredInstallLocation: 0
......
# Download game
https://github.com/Unicorn369/YGOPro2_Droid/releases
# You have just found ygopro v2 in Unity 3D! # You have just found ygopro v2 in Unity 3D!
YGOPro v2 is a card simulation game created in Unity Engine, with same protocol to ygopro. YGOPro v2 is a card simulation game created in Unity Engine, with same protocol to ygopro.
......
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