Commit f1bd5418 authored by mercury233's avatar mercury233

update deck error handling

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