Commit f1bd5418 authored by mercury233's avatar mercury233

update deck error handling

parent 5b3d7387
...@@ -281,16 +281,21 @@ namespace WindBot.Game ...@@ -281,16 +281,21 @@ namespace WindBot.Game
packet.ReadByte(); packet.ReadByte();
packet.ReadByte(); packet.ReadByte();
packet.ReadByte(); packet.ReadByte();
int code = packet.ReadInt32(); int pcode = packet.ReadInt32();
if (msg == 2) //ERRMSG_DECKERROR if (msg == 2) //ERRMSG_DECKERROR
{ {
NamedCard card = NamedCard.Get(code); int code = pcode & 0xFFFFFFF;
if (card != null) int flag = pcode >> 28;
_ai.OnDeckError(card.Name); if (flag <= 5) //DECKERROR_CARDCOUNT
else if (code == 1) {
_ai.OnDeckError("DECK"); NamedCard card = NamedCard.Get(code);
if (card != null)
_ai.OnDeckError(card.Name);
else
_ai.OnDeckError("Unknown Card");
}
else else
_ai.OnDeckError("Unknown Card"); _ai.OnDeckError("DECK");
} }
//Connection.Close(); //Connection.Close();
} }
......
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