Commit 87102988 authored by SherryChaos's avatar SherryChaos

bug fix

parent 876cc5ed
MDPro3 v1.1.6.1更新:
1.修复部分卡片效果特效[灰流丽等]不播放的错误;
2.修复多端同步MyCard卡组时,删除的卡组死灰复燃、生生不息的错误。
3.修复对面的决斗场地[六世坏·帕拉索眦]播放触摸动画后,动画本体消失的错误。
MDPro3 v1.1.6更新: MDPro3 v1.1.6更新:
1.部分外观设置中新增随机、无设置等选项。 1.部分外观设置中新增随机、无设置等选项。
2.背景设置中新增DIY选项,支持设置中导入图片,或者修改[Picture\DIY\Background.png],jpg格式也支持,优先读取png格式。 2.背景设置中新增DIY选项,支持设置中导入图片,或者修改[Picture\DIY\Background.png],jpg格式也支持,优先读取png格式。
......
...@@ -174,9 +174,7 @@ namespace MDPro3 ...@@ -174,9 +174,7 @@ namespace MDPro3
if (request.result == UnityWebRequest.Result.Success) if (request.result == UnityWebRequest.Result.Success)
{ {
string jsonResult = request.downloadHandler.text; return JsonUtility.FromJson<ResponseSingleData>(request.downloadHandler.text).data;
var responseData = JsonUtility.FromJson<ResponseSingleData>(request.downloadHandler.text);
return responseData.data;
} }
else else
{ {
...@@ -532,6 +530,8 @@ namespace MDPro3 ...@@ -532,6 +530,8 @@ namespace MDPro3
public string deckMainSerial; public string deckMainSerial;
public int userid; public int userid;
public bool isPublic; public bool isPublic;
public string description;
public bool isDelete;
public OnlineDeckData() { } public OnlineDeckData() { }
......
...@@ -731,9 +731,12 @@ namespace MDPro3.Net ...@@ -731,9 +731,12 @@ namespace MDPro3.Net
deckList.Add(new Deck(deck)); deckList.Add(new Deck(deck));
var decksNeedUpload = new Dictionary<string, Deck>();//没在服务器找到对应的deckId的本地卡组 var decksNeedUpload = new Dictionary<string, Deck>();//没在服务器找到对应的deckId的本地卡组
var decksNeedUpdate= new Dictionary<string, Deck>();//找到deckId但本地时间大于服务器时间五秒以上的卡组 var decksNeedUpdate= new Dictionary<string, Deck>();//找到deckId但本地时间大于服务器时间五秒以上的卡组
var decksNeedUpdate2 = new Dictionary<string, Deck>();//找到deckId但本地时间小于服务器时间五秒以上的卡组 var decksNeedUpdate2 = new Dictionary<string, Deck>();//找到deckId但本地时间小于服务器时间五秒以上的卡组
var localDeckIds = new List<string>(); var localDeckIds = new List<string>();
var decksNeedDelete = new List<string>();//需要删除的卡组
for (int i = 0; i < deckList.Count; i++) for (int i = 0; i < deckList.Count; i++)
{ {
var deckName = Path.GetFileNameWithoutExtension(deckFiles[i]); var deckName = Path.GetFileNameWithoutExtension(deckFiles[i]);
...@@ -751,6 +754,12 @@ namespace MDPro3.Net ...@@ -751,6 +754,12 @@ namespace MDPro3.Net
{ {
deckIdFound = true; deckIdFound = true;
var fileInfo = new FileInfo(deckFiles[i]); var fileInfo = new FileInfo(deckFiles[i]);
if (od.isDelete)
{
decksNeedDelete.Add(deckName);
}
else
{
DateTime serverTime; DateTime serverTime;
try try
{ {
...@@ -763,18 +772,30 @@ namespace MDPro3.Net ...@@ -763,18 +772,30 @@ namespace MDPro3.Net
var diff = serverTime - fileInfo.LastWriteTime; var diff = serverTime - fileInfo.LastWriteTime;
if (diff.TotalSeconds > 5f) if (diff.TotalSeconds > 5f)
{ {
if(fileInfo.LastWriteTime > serverTime) if (fileInfo.LastWriteTime > serverTime)
decksNeedUpdate.Add(deckName, deckList[i]); decksNeedUpdate.Add(deckName, deckList[i]);
else else
decksNeedUpdate2.Add(deckName, deckList[i]); decksNeedUpdate2.Add(deckName, deckList[i]);
} }
} }
}
if (!deckIdFound) if (!deckIdFound)
{
var getDeck = OnlineDeck.GetDeck(deckList[i].deckId);
while(!getDeck.IsCompleted)
yield return null;
if(getDeck.Result == null)
decksNeedUpload.Add(deckName, deckList[i]);
else
{
if(getDeck.Result.isDelete)
decksNeedDelete.Add(deckName);
else
decksNeedUpload.Add(deckName, deckList[i]); decksNeedUpload.Add(deckName, deckList[i]);
} }
}
}
//上传已经有Id的本地较新卡组 //上传已经有Id的本地较新卡组
foreach (var deck in decksNeedUpdate) foreach (var deck in decksNeedUpdate)
...@@ -813,6 +834,7 @@ namespace MDPro3.Net ...@@ -813,6 +834,7 @@ namespace MDPro3.Net
//下载本地ID不存在的服务器卡组 //下载本地ID不存在的服务器卡组
List<OnlineDeck.OnlineDeckData> odtd = new List<OnlineDeck.OnlineDeckData>(); List<OnlineDeck.OnlineDeckData> odtd = new List<OnlineDeck.OnlineDeckData>();
foreach(var od in OnlineDeck.decks) foreach(var od in OnlineDeck.decks)
if(!od.isDelete)
if (!localDeckIds.Contains(od.deckId)) if (!localDeckIds.Contains(od.deckId))
odtd.Add(od); odtd.Add(od);
foreach(var deck in odtd) foreach(var deck in odtd)
...@@ -842,6 +864,10 @@ namespace MDPro3.Net ...@@ -842,6 +864,10 @@ namespace MDPro3.Net
info.LastWriteTime = DateTime.Parse(deck.deckUploadDate); info.LastWriteTime = DateTime.Parse(deck.deckUploadDate);
} }
} }
//删除已经被标记为删除的卡组
foreach(var deck in decksNeedDelete)
File.Delete(Program.deckPath + deck + Program.ydkExpansion);
} }
public void SetWatchRooms(List<MyCardRoom> rooms) public void SetWatchRooms(List<MyCardRoom> rooms)
......
...@@ -128,6 +128,8 @@ namespace MDPro3 ...@@ -128,6 +128,8 @@ namespace MDPro3
foreach (var d in OnlineDeck.decks) foreach (var d in OnlineDeck.decks)
{ {
if (d.isDelete)
continue;
if (decks.ContainsKey(d.deckName)) if (decks.ContainsKey(d.deckName))
{ {
int avoid = 2; int avoid = 2;
...@@ -355,7 +357,7 @@ namespace MDPro3 ...@@ -355,7 +357,7 @@ namespace MDPro3
{ {
count++; count++;
File.Delete(Program.deckPath + item.args[0] + Program.ydkExpansion); File.Delete(Program.deckPath + item.args[0] + Program.ydkExpansion);
MessageManager.Cast(InterString.Get("已删除卡组「[?]」", item.args[0])); MessageManager.Cast(InterString.Get("已删除本地卡组「[?]」", item.args[0]));
toDelete.Add(item.args[7]); toDelete.Add(item.args[7]);
} }
DeleteOnlineDecks(toDelete); DeleteOnlineDecks(toDelete);
......
...@@ -185,6 +185,7 @@ namespace YgomGame.Bg ...@@ -185,6 +185,7 @@ namespace YgomGame.Bg
tapPlaying = true; tapPlaying = true;
yield return new WaitForSeconds(activeTime == 0 ? 4 : activeTime); yield return new WaitForSeconds(activeTime == 0 ? 4 : activeTime);
tapPlaying = false; tapPlaying = false;
if(playingOnlyActive)
gameObject.SetActive(false); gameObject.SetActive(false);
} }
......
...@@ -633,3 +633,4 @@ YDK 内容不合法,主卡组必须满 40 张->YDK 内容不合法,主卡组 ...@@ -633,3 +633,4 @@ YDK 内容不合法,主卡组必须满 40 张->YDK 内容不合法,主卡组
注册->注册 注册->注册
自定义游戏->自定义游戏 自定义游戏->自定义游戏
检测到新版先行卡,请至 [游戏设置]-[扩展卡包]-[更新先行卡] 处进行更新。->检测到新版先行卡,请至 [游戏设置]-[扩展卡包]-[更新先行卡] 处进行更新。 检测到新版先行卡,请至 [游戏设置]-[扩展卡包]-[更新先行卡] 处进行更新。->检测到新版先行卡,请至 [游戏设置]-[扩展卡包]-[更新先行卡] 处进行更新。
已删除卡组「[?]」->已删除卡组「[?]」
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