示例#1
0
        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;
            }
        }
示例#2
0
        public void ReceiveIndianPokerGamePacket(IndianPokerGamePacket indianPokerGamePacket)
        {
            IndianPokerGamePacketReceivedArgs parameter = new IndianPokerGamePacketReceivedArgs();

            parameter.Data = indianPokerGamePacket;

            IndianPokerGamePacketEvent(parameter);
        }
示例#3
0
        public static IndianPokerGamePacket IndianPokerGamePacket_ToStruct(byte[] packet)
        {
            IndianPokerGamePacket temp = new IndianPokerGamePacket();
            object obj = (object)temp;

            PacketToStruct(packet, ref obj);
            temp = (IndianPokerGamePacket)obj;
            return(temp);
        }
 private void SendPokerGameMessage(Header header, DataHandler.IndianPokerGamePacket pokerGamePacket, ClientInfo clientInfoParam)
 {
     indianPokerServer.SendMessage(header, pokerGamePacket, clientInfoParam.ClientSocket);
 }