public static void PacketParsing(byte[] packet, Socket clientSocket = null)
        {
            switch (packet[0])
            {
            case (byte)Header.Login:
                LoginPacket loginPacket = LoginPacket_ToStruct(packet);
                EventManager.Instance.ReceiveLoginPacket(loginPacket, clientSocket);
                break;

            case (byte)Header.Matching:
                MatchingPacket matchingPacket = MatchingPacket_ToStruct(packet);
                EventManager.Instance.ReceiveMatchingPacket(matchingPacket);
                break;

            case (byte)Header.Game:
                HandleGamePacket handleGamePacket = HandleGamePacket_ToStruct(packet);
                EventManager.Instance.ReceiveHandleGamePacket(handleGamePacket);
                break;

            case (byte)Header.GameMotion:
                IndianPokerGamePacket indianpokerGamePacket = IndianPokerGamePacket_ToStruct(packet);
                EventManager.Instance.ReceiveIndianPokerGamePacket(indianpokerGamePacket);
                break;
            }
        }
        public void ReceiveMatchingPacket(MatchingPacket matchingPacket)
        {
            MatchingPacketReceivedArgs parameter = new MatchingPacketReceivedArgs();

            parameter.Data = matchingPacket;

            MatchingPacketEvent(parameter);
        }
        public static MatchingPacket MatchingPacket_ToStruct(byte[] packet)
        {
            MatchingPacket temp = new MatchingPacket();
            object         obj  = (object)temp;

            PacketToStruct(packet, ref obj);
            temp = (MatchingPacket)obj;
            return(temp);
        }