Commit de6fdb19 authored by nanahira's avatar nanahira

update side detect

parent d3490d93
...@@ -1318,6 +1318,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -1318,6 +1318,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);
...@@ -3457,10 +3458,10 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3457,10 +3458,10 @@ public class Ocgcore : ServantWithCardDescription
if (finishable) if (finishable)
{ {
gameInfo.addHashedButton("sendSelected", 0, superButtonType.yes, InterString.Get("完成选择@ui")); gameInfo.addHashedButton("sendSelected", 0, superButtonType.yes, InterString.Get("完成选择@ui"));
} }
realizeCardsForSelect(); realizeCardsForSelect();
cardsSelected.Clear(); cardsSelected.Clear();
if (ES_selectHint != "") if (ES_selectHint != "")
ES_selectUnselectHint = ES_selectHint; ES_selectUnselectHint = ES_selectHint;
if (ES_selectUnselectHint != "") if (ES_selectUnselectHint != "")
{ {
...@@ -8834,6 +8835,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -8834,6 +8835,7 @@ public class Ocgcore : ServantWithCardDescription
public 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)
{ {
......
...@@ -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();
...@@ -570,12 +571,14 @@ public class Room : WindowServantSP ...@@ -570,12 +571,14 @@ 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) { //Change side when reconnect if(joinWithReconnect) { //Change side when reconnect
Program.I().ocgcore.onDuelResultConfirmed(); Program.I().ocgcore.onDuelResultConfirmed();
} }
} }
......
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