Commit 5786eba3 authored by SherryChaos's avatar SherryChaos

bug fix

parent 61be2be9
...@@ -4,6 +4,8 @@ MDPro3 v1.3.1更新: ...@@ -4,6 +4,8 @@ MDPro3 v1.3.1更新:
2.修复Linux端决斗中需要显示“解放怪兽”特效时,游戏卡死的问题。 2.修复Linux端决斗中需要显示“解放怪兽”特效时,游戏卡死的问题。
3.*修复Mac端非Apple Silicon芯片的设备无法本地决斗的错误。 3.*修复Mac端非Apple Silicon芯片的设备无法本地决斗的错误。
4.*修复非Windows端无法导入、导出文件的错误。 4.*修复非Windows端无法导入、导出文件的错误。
5.修复安卓端和Linux端中,外观设置中CrossDuel的宠物选项不显示的错误。
6.修复游戏启动后不同步在线卡组的错误。
MDPro3 v1.3.0更新: MDPro3 v1.3.0更新:
0.本次更新跳过了v1.2.9版本,仅提供完整包安装。 0.本次更新跳过了v1.2.9版本,仅提供完整包安装。
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -16,6 +16,7 @@ namespace MDPro3.Net ...@@ -16,6 +16,7 @@ namespace MDPro3.Net
public static OnlineDeckData[] decks; public static OnlineDeckData[] decks;
#region Const #region Const
const string url = "http://rarnu.xyz:38383"; const string url = "http://rarnu.xyz:38383";
const string liteAPI = "/api/mdpro3/deck/list/lite"; const string liteAPI = "/api/mdpro3/deck/list/lite";
const string getAPI = "/api/mdpro3/deck/"; const string getAPI = "/api/mdpro3/deck/";
...@@ -33,9 +34,11 @@ namespace MDPro3.Net ...@@ -33,9 +34,11 @@ namespace MDPro3.Net
const string contentTypeHeader = "Content-Type"; const string contentTypeHeader = "Content-Type";
const string jsonHeader = "application/json"; const string jsonHeader = "application/json";
const string tokenHeader = "token"; const string tokenHeader = "token";
#endregion #endregion
#region Online Get #region Online Get
public static async Task<OnlineDeckData[]> FetchSimpleDeckList(int size, string keyWord = "", string contributor = "", bool sortLike = true) public static async Task<OnlineDeckData[]> FetchSimpleDeckList(int size, string keyWord = "", string contributor = "", bool sortLike = true)
{ {
string apiUrl = url + liteAPI + $"?size={size}&keyWord={keyWord}&contributor={contributor}&sortLike={sortLike}"; string apiUrl = url + liteAPI + $"?size={size}&keyWord={keyWord}&contributor={contributor}&sortLike={sortLike}";
...@@ -73,6 +76,7 @@ namespace MDPro3.Net ...@@ -73,6 +76,7 @@ namespace MDPro3.Net
request.downloadHandler.Dispose(); request.downloadHandler.Dispose();
} }
} }
public static async Task<OnlineDeckData> GetDeck(string deckID) public static async Task<OnlineDeckData> GetDeck(string deckID)
{ {
string apiUrl = url + getAPI + deckID; string apiUrl = url + getAPI + deckID;
...@@ -128,6 +132,7 @@ namespace MDPro3.Net ...@@ -128,6 +132,7 @@ namespace MDPro3.Net
if (request.result == UnityWebRequest.Result.Success) if (request.result == UnityWebRequest.Result.Success)
{ {
//UnityEngine.Debug.Log(request.downloadHandler.text);
decks = JsonUtility.FromJson<ResponseMultiSimpleData>(request.downloadHandler.text).data; decks = JsonUtility.FromJson<ResponseMultiSimpleData>(request.downloadHandler.text).data;
return decks; return decks;
} }
...@@ -137,6 +142,7 @@ namespace MDPro3.Net ...@@ -137,6 +142,7 @@ namespace MDPro3.Net
return null; return null;
} }
} }
public static async void LikeDeck(string deckId) public static async void LikeDeck(string deckId)
{ {
string apiUrl = url + likeAPI + deckId; string apiUrl = url + likeAPI + deckId;
...@@ -161,9 +167,11 @@ namespace MDPro3.Net ...@@ -161,9 +167,11 @@ namespace MDPro3.Net
else else
MessageManager.Cast(InterString.Get("点赞卡组失败:") + request.error); MessageManager.Cast(InterString.Get("点赞卡组失败:") + request.error);
} }
#endregion #endregion
#region Online Post #region Online Post
public static async Task<bool> UploadDecks(List<Deck> decks, List<string> deckNames) public static async Task<bool> UploadDecks(List<Deck> decks, List<string> deckNames)
{ {
string apiUrl = url + getIdsAPI + decks.Count; string apiUrl = url + getIdsAPI + decks.Count;
...@@ -355,6 +363,7 @@ namespace MDPro3.Net ...@@ -355,6 +363,7 @@ namespace MDPro3.Net
return false; return false;
} }
} }
public static async Task<bool> UpdatePublicState(string deckId, bool isPublic) public static async Task<bool> UpdatePublicState(string deckId, bool isPublic)
{ {
var apiUrl = url + publicAPI; var apiUrl = url + publicAPI;
...@@ -391,6 +400,7 @@ namespace MDPro3.Net ...@@ -391,6 +400,7 @@ namespace MDPro3.Net
#endregion #endregion
#region Functions #region Functions
public static OnlineDeckData GetByID(string deckId) public static OnlineDeckData GetByID(string deckId)
{ {
if (decks == null) if (decks == null)
...@@ -400,6 +410,7 @@ namespace MDPro3.Net ...@@ -400,6 +410,7 @@ namespace MDPro3.Net
return deck; return deck;
return null; return null;
} }
public static bool GetDeckPublicState(string deckId) public static bool GetDeckPublicState(string deckId)
{ {
if (decks == null) if (decks == null)
...@@ -409,6 +420,7 @@ namespace MDPro3.Net ...@@ -409,6 +420,7 @@ namespace MDPro3.Net
return deck.isPublic; return deck.isPublic;
return false; return false;
} }
public static bool StringIsIdFormat(string deckId) public static bool StringIsIdFormat(string deckId)
{ {
return !string.IsNullOrEmpty(deckId); return !string.IsNullOrEmpty(deckId);
...@@ -418,6 +430,7 @@ namespace MDPro3.Net ...@@ -418,6 +430,7 @@ namespace MDPro3.Net
return false; return false;
return true; return true;
} }
private static bool DeckNameExist(string deckName) private static bool DeckNameExist(string deckName)
{ {
if (decks == null) if (decks == null)
...@@ -468,6 +481,7 @@ namespace MDPro3.Net ...@@ -468,6 +481,7 @@ namespace MDPro3.Net
return DateTime.Parse(deckUploadDate); return DateTime.Parse(deckUploadDate);
} }
} }
} }
[Serializable] [Serializable]
...@@ -494,6 +508,7 @@ namespace MDPro3.Net ...@@ -494,6 +508,7 @@ namespace MDPro3.Net
public string message; public string message;
public bool data; public bool data;
} }
[Serializable] [Serializable]
public class ResponseMultiSimpleData public class ResponseMultiSimpleData
{ {
...@@ -512,6 +527,7 @@ namespace MDPro3.Net ...@@ -512,6 +527,7 @@ namespace MDPro3.Net
public int pages; public int pages;
public OnlineDeckData[] records; public OnlineDeckData[] records;
} }
[Serializable] [Serializable]
public class ResponseDeckID public class ResponseDeckID
{ {
...@@ -519,6 +535,7 @@ namespace MDPro3.Net ...@@ -519,6 +535,7 @@ namespace MDPro3.Net
public int message; public int message;
public string data; public string data;
} }
[Serializable] [Serializable]
public class ResponseDeckIDs public class ResponseDeckIDs
{ {
...@@ -584,6 +601,8 @@ namespace MDPro3.Net ...@@ -584,6 +601,8 @@ namespace MDPro3.Net
public string deckId; public string deckId;
public bool isPublic; public bool isPublic;
} }
#endregion #endregion
} }
} }
...@@ -10,6 +10,7 @@ using TMPro; ...@@ -10,6 +10,7 @@ using TMPro;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
using MDPro3.Net; using MDPro3.Net;
using MDPro3.UI.ServantUI; using MDPro3.UI.ServantUI;
using static MDPro3.Duel.YGOSharp.PacksManager;
namespace MDPro3.Servant namespace MDPro3.Servant
{ {
...@@ -215,11 +216,12 @@ namespace MDPro3.Servant ...@@ -215,11 +216,12 @@ namespace MDPro3.Servant
private void LoginSuccessEvent() private void LoginSuccessEvent()
{ {
if (servantUI == null || MyCard.account == null) if (MyCard.account == null)
return; return;
StartCoroutine(RefreshMyCardAssets());
StartCoroutine(SyncDecks()); StartCoroutine(SyncDecks());
if (servantUI == null)
return;
StartCoroutine(RefreshMyCardAssets());
} }
private IEnumerator RefreshMyCardAssets() private IEnumerator RefreshMyCardAssets()
...@@ -272,7 +274,6 @@ namespace MDPro3.Servant ...@@ -272,7 +274,6 @@ namespace MDPro3.Servant
for (int i = 0; i < decks.Count; i++) for (int i = 0; i < decks.Count; i++)
{ {
var deckName = Path.GetFileNameWithoutExtension(deckFiles[i]); var deckName = Path.GetFileNameWithoutExtension(deckFiles[i]);
if (decks[i].userId != MyCard.account.user.id.ToString()) if (decks[i].userId != MyCard.account.user.id.ToString())
{ {
decksNeedUpload.Add(deckName, decks[i]); decksNeedUpload.Add(deckName, decks[i]);
...@@ -282,6 +283,7 @@ namespace MDPro3.Servant ...@@ -282,6 +283,7 @@ namespace MDPro3.Servant
bool deckIdFound = false; bool deckIdFound = false;
foreach (var od in OnlineDeck.decks) foreach (var od in OnlineDeck.decks)
{ {
Debug.Log(od.deckId);
if (od.deckId == decks[i].deckId) if (od.deckId == decks[i].deckId)
{ {
deckIdFound = true; deckIdFound = true;
......
...@@ -414,6 +414,7 @@ namespace MDPro3.UI.ServantUI ...@@ -414,6 +414,7 @@ namespace MDPro3.UI.ServantUI
int code = int.Parse(files[i].Name.Replace(".bundle", string.Empty)); int code = int.Parse(files[i].Name.Replace(".bundle", string.Empty));
var card = CardsManager.Get(code, true); var card = CardsManager.Get(code, true);
GameObject item = Instantiate(Template); GameObject item = Instantiate(Template);
item.SetActive(true);
var itemMono = item.GetComponent<SelectionToggle_AppearanceItem>(); var itemMono = item.GetComponent<SelectionToggle_AppearanceItem>();
itemMono.index = itemCount++; itemMono.index = itemCount++;
itemMono.itemID = code; itemMono.itemID = code;
......
...@@ -857,7 +857,7 @@ PlayerSettings: ...@@ -857,7 +857,7 @@ PlayerSettings:
PS4: PS4:
QNX: QNX:
Server: Server:
Standalone: SUPPORT_WINDOWS_PORT Standalone:
WebGL: WebGL:
Windows Store Apps: Windows Store Apps:
XboxOne: XboxOne:
......
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