Commit ce07cb07 authored by SherryChaos's avatar SherryChaos

bug fix

parent 9fa6409f
MDPro3 v1.1.2更新: MDPro3 v1.1.2更新:
1.修复了在决斗中需要输入文字时(如抹杀之指名者),会响应快捷键功能的错误。 1.修复了在决斗中需要输入文字时(如[抹杀之指名者]),会响应快捷键功能的错误。
2.修复由对方发动的[闪刀起动-交闪]的特效中的卡片不是检索的卡片的错误。
3.增加发送消息的间隔时间,减少CPU开销。
MDPro3 v1.1.1更新: MDPro3 v1.1.1更新:
1.新投稿动画:琰魔龙 红莲魔·渊、龙骑士 D-终。 1.新投稿动画:琰魔龙 红莲魔·渊、龙骑士 D-终。
......
This diff is collapsed.
...@@ -959,8 +959,7 @@ namespace MDPro3 ...@@ -959,8 +959,7 @@ namespace MDPro3
cacheP.position = (int)CardPosition.FaceDownAttack; cacheP.position = (int)CardPosition.FaceDownAttack;
ModelAt(cacheP); ModelAt(cacheP);
} }
if (Program.I().ocgcore.nextMoveAction != null)
if(Program.I().ocgcore.nextMoveAction != null)
{ {
OcgCore.messagePass = false; OcgCore.messagePass = false;
Program.I().ocgcore.nextMoveAction.Invoke(); Program.I().ocgcore.nextMoveAction.Invoke();
......
...@@ -32,8 +32,10 @@ namespace MDPro3 ...@@ -32,8 +32,10 @@ namespace MDPro3
try try
{ {
senderThead?.Abort(); senderThead?.Abort();
senderThead = new Thread(Sender); senderThead = new Thread(Sender)
senderThead.IsBackground = true; {
IsBackground = true
};
senderThead.Start(); senderThead.Start();
} }
catch catch
...@@ -251,12 +253,12 @@ namespace MDPro3 ...@@ -251,12 +253,12 @@ namespace MDPro3
{ {
while (tcpClient != null && tcpClient.Connected) while (tcpClient != null && tcpClient.Connected)
{ {
senderThead.Join(100);
Package currentMessage; Package currentMessage;
lock (locker) lock (locker)
{ {
if (messageQueue.Count == 0) if (messageQueue.Count == 0)
{ {
senderThead.Join(100);
continue; continue;
} }
currentMessage = messageQueue.Dequeue(); currentMessage = messageQueue.Dequeue();
......
...@@ -19,6 +19,7 @@ using MDPro3.YGOSharp; ...@@ -19,6 +19,7 @@ using MDPro3.YGOSharp;
using MDPro3.YGOSharp.OCGWrapper.Enums; using MDPro3.YGOSharp.OCGWrapper.Enums;
using static YgomGame.Bg.BgEffectSettingInner; using static YgomGame.Bg.BgEffectSettingInner;
using MDPro3.UI; using MDPro3.UI;
using Mono.Cecil.Cil;
namespace MDPro3 namespace MDPro3
{ {
...@@ -1416,6 +1417,8 @@ namespace MDPro3 ...@@ -1416,6 +1417,8 @@ namespace MDPro3
bool needDamageResponseInstant; bool needDamageResponseInstant;
public Action endingAction; public Action endingAction;
public Action nextMoveAction; public Action nextMoveAction;
Renderer nextMoveActionTargetRenderer;
public int lastSelectedCard = 0; public int lastSelectedCard = 0;
public ElementObjectManager nextMoveManager; public ElementObjectManager nextMoveManager;
public float nextMoveTime = 0f; public float nextMoveTime = 0f;
...@@ -1586,6 +1589,8 @@ namespace MDPro3 ...@@ -1586,6 +1589,8 @@ namespace MDPro3
try try
{ {
var messageIsHandled = false; var messageIsHandled = false;
GetConfirmedCard();
while (!pause && messagePass) while (!pause && messagePass)
{ {
if (packages.Count == 0) break; if (packages.Count == 0) break;
...@@ -2502,6 +2507,27 @@ namespace MDPro3 ...@@ -2502,6 +2507,27 @@ namespace MDPro3
log.AddLog(item, indent); log.AddLog(item, indent);
} }
private void GetConfirmedCard()
{
if (nextMoveAction == null || nextMoveActionTargetRenderer == null)
return;
for (int i = 0; i < packages.Count; i++)
{
if ((GameMessage)packages[i].Function == GameMessage.ConfirmCards)
{
var r = packages[i].Data.reader;
r.BaseStream.Seek(0, 0);
r.ReadByte();
r.ReadByte();
int nextConfirmedCard = r.ReadInt32();
StartCoroutine(Program.I().texture_.LoadCardToRendererWithMaterialAsync(nextMoveActionTargetRenderer, nextConfirmedCard, true));
nextMoveActionTargetRenderer = null;
lastMoveCard.SetCode(nextConfirmedCard);
}
}
}
//Start 决斗改名 //Start 决斗改名
//AiName 残局改名 //AiName 残局改名
//sibyl_name 回放改名 //sibyl_name 回放改名
...@@ -3646,10 +3672,7 @@ namespace MDPro3 ...@@ -3646,10 +3672,7 @@ namespace MDPro3
{ {
Destroy(effect); Destroy(effect);
}; };
var cardFace = manager.GetElement<Renderer>("SummonPosDummy"); nextMoveActionTargetRenderer = manager.GetElement<Renderer>("SummonPosDummy");
if (condition != Condition.Replay && lastMoveCard.GetData().Id != lastSelectedCard)
lastMoveCard.SetCode(lastSelectedCard);
StartCoroutine(Program.I().texture_.LoadCardToRendererWithMaterialAsync(cardFace, lastMoveCard.GetData().Id, true));
}; };
} }
else if(code == 19613556) else if(code == 19613556)
......
...@@ -57,7 +57,7 @@ namespace MDPro3.UI ...@@ -57,7 +57,7 @@ namespace MDPro3.UI
public override void Clear() public override void Clear()
{ {
foreach(var item in items) foreach(var item in items)
item.gameObject.GetComponent<SuperScrollViewItemTwoStage>().Dispose(); item.gameObject?.GetComponent<SuperScrollViewItemTwoStage>().Dispose();
items.Clear(); items.Clear();
scrollView.content.sizeDelta = new Vector2(0, 0); scrollView.content.sizeDelta = new Vector2(0, 0);
} }
......
...@@ -85,6 +85,7 @@ namespace YgomSystem.Timeline ...@@ -85,6 +85,7 @@ namespace YgomSystem.Timeline
card.ResetModelRotation(); card.ResetModelRotation();
card.model.transform.position = target.position; card.model.transform.position = target.position;
card.model.transform.eulerAngles = new Vector3(- target.eulerAngles.x, 0f, 0f); card.model.transform.eulerAngles = new Vector3(- target.eulerAngles.x, 0f, 0f);
Program.I().ocgcore.nextMoveAction = null; Program.I().ocgcore.nextMoveAction = null;
card.Move(card.p, false, 0f, Program.I().ocgcore.nextMoveTime); card.Move(card.p, false, 0f, Program.I().ocgcore.nextMoveTime);
DOTween.To(v => { }, 0, 0, Program.I().ocgcore.nextMoveTime).OnComplete(() => DOTween.To(v => { }, 0, 0, Program.I().ocgcore.nextMoveTime).OnComplete(() =>
......
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