private void OnUpdateDeck(BinaryReader packet) { if (Type == (int)PlayerType.Observer) { return; } Deck deck = new Deck(); int main = packet.ReadInt32(); int side = packet.ReadInt32(); for (int i = 0; i < main; i++) { deck.AddMain(packet.ReadInt32()); } for (int i = 0; i < side; i++) { deck.AddSide(packet.ReadInt32()); } if (Game.State == GameState.Lobby) { Deck = deck; Game.IsReady[Type] = false; } else if (Game.State == GameState.Side) { if (Game.IsReady[Type]) { return; } if (!Deck.Check(deck)) { BinaryWriter error = GamePacketFactory.Create(StocMessage.ErrorMsg); error.Write((byte)3); error.Write(0); Send(error); return; } Deck = deck; Game.IsReady[Type] = true; Send(GamePacketFactory.Create(StocMessage.DuelStart)); Game.MatchSide(); } }