Commit f1bd5418 authored by mercury233's avatar mercury233

update deck error handling

parent 5b3d7387
...@@ -281,17 +281,22 @@ namespace WindBot.Game ...@@ -281,17 +281,22 @@ 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
{
int code = pcode & 0xFFFFFFF;
int flag = pcode >> 28;
if (flag <= 5) //DECKERROR_CARDCOUNT
{ {
NamedCard card = NamedCard.Get(code); NamedCard card = NamedCard.Get(code);
if (card != null) if (card != null)
_ai.OnDeckError(card.Name); _ai.OnDeckError(card.Name);
else if (code == 1)
_ai.OnDeckError("DECK");
else else
_ai.OnDeckError("Unknown Card"); _ai.OnDeckError("Unknown Card");
} }
else
_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