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更新:
1.部分外观设置中新增随机、无设置等选项。
2.背景设置中新增DIY选项,支持设置中导入图片,或者修改[Picture\DIY\Background.png],jpg格式也支持,优先读取png格式。
......
......@@ -174,9 +174,7 @@ namespace MDPro3
if (request.result == UnityWebRequest.Result.Success)
{
string jsonResult = request.downloadHandler.text;
var responseData = JsonUtility.FromJson<ResponseSingleData>(request.downloadHandler.text);
return responseData.data;
return JsonUtility.FromJson<ResponseSingleData>(request.downloadHandler.text).data;
}
else
{
......@@ -532,6 +530,8 @@ namespace MDPro3
public string deckMainSerial;
public int userid;
public bool isPublic;
public string description;
public bool isDelete;
public OnlineDeckData() { }
......
......@@ -731,9 +731,12 @@ namespace MDPro3.Net
deckList.Add(new Deck(deck));
var decksNeedUpload = new Dictionary<string, Deck>();//没在服务器找到对应的deckId的本地卡组
var decksNeedUpdate= new Dictionary<string, Deck>();//找到deckId但本地时间大于服务器时间五秒以上的卡组
var decksNeedUpdate2 = new Dictionary<string, Deck>();//找到deckId但本地时间小于服务器时间五秒以上的卡组
var localDeckIds = new List<string>();
var decksNeedDelete = new List<string>();//需要删除的卡组
for (int i = 0; i < deckList.Count; i++)
{
var deckName = Path.GetFileNameWithoutExtension(deckFiles[i]);
......@@ -751,31 +754,49 @@ namespace MDPro3.Net
{
deckIdFound = true;
var fileInfo = new FileInfo(deckFiles[i]);
DateTime serverTime;
try
{
serverTime = DateTime.Parse(od.deckUpdateDate);
}
catch
if (od.isDelete)
{
serverTime = DateTime.Parse(od.deckUploadDate);
decksNeedDelete.Add(deckName);
}
var diff = serverTime - fileInfo.LastWriteTime;
if (diff.TotalSeconds > 5f)
else
{
if(fileInfo.LastWriteTime > serverTime)
decksNeedUpdate.Add(deckName, deckList[i]);
else
decksNeedUpdate2.Add(deckName, deckList[i]);
DateTime serverTime;
try
{
serverTime = DateTime.Parse(od.deckUpdateDate);
}
catch
{
serverTime = DateTime.Parse(od.deckUploadDate);
}
var diff = serverTime - fileInfo.LastWriteTime;
if (diff.TotalSeconds > 5f)
{
if (fileInfo.LastWriteTime > serverTime)
decksNeedUpdate.Add(deckName, deckList[i]);
else
decksNeedUpdate2.Add(deckName, deckList[i]);
}
}
}
if (!deckIdFound)
decksNeedUpload.Add(deckName, deckList[i]);
{
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]);
}
}
}
//上传已经有Id的本地较新卡组
foreach (var deck in decksNeedUpdate)
{
......@@ -813,8 +834,9 @@ namespace MDPro3.Net
//下载本地ID不存在的服务器卡组
List<OnlineDeck.OnlineDeckData> odtd = new List<OnlineDeck.OnlineDeckData>();
foreach(var od in OnlineDeck.decks)
if (!localDeckIds.Contains(od.deckId))
odtd.Add(od);
if(!od.isDelete)
if (!localDeckIds.Contains(od.deckId))
odtd.Add(od);
foreach(var deck in odtd)
{
var d = new Deck(deck.deckYdk, Deck.defaultDeckAuthor);
......@@ -842,6 +864,10 @@ namespace MDPro3.Net
info.LastWriteTime = DateTime.Parse(deck.deckUploadDate);
}
}
//删除已经被标记为删除的卡组
foreach(var deck in decksNeedDelete)
File.Delete(Program.deckPath + deck + Program.ydkExpansion);
}
public void SetWatchRooms(List<MyCardRoom> rooms)
......
......@@ -128,6 +128,8 @@ namespace MDPro3
foreach (var d in OnlineDeck.decks)
{
if (d.isDelete)
continue;
if (decks.ContainsKey(d.deckName))
{
int avoid = 2;
......@@ -355,7 +357,7 @@ namespace MDPro3
{
count++;
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]);
}
DeleteOnlineDecks(toDelete);
......
......@@ -185,7 +185,8 @@ namespace YgomGame.Bg
tapPlaying = true;
yield return new WaitForSeconds(activeTime == 0 ? 4 : activeTime);
tapPlaying = false;
gameObject.SetActive(false);
if(playingOnlyActive)
gameObject.SetActive(false);
}
private IEnumerator CheckParticleEffectEnd()
......
......@@ -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