Exemplo n.º 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;
            }
        }
Exemplo n.º 2
0
        public void ReceiveHandleGamePacket(HandleGamePacket handleGamePacket)
        {
            HandleGamePacketReceivedArgs parameter = new HandleGamePacketReceivedArgs();

            parameter.Data = handleGamePacket;

            HandleGamePacketEvent(parameter);
        }
Exemplo n.º 3
0
        public static HandleGamePacket HandleGamePacket_ToStruct(byte[] packet)
        {
            HandleGamePacket temp = new HandleGamePacket();
            object           obj  = (object)temp;

            PacketToStruct(packet, ref obj);
            temp = (HandleGamePacket)obj;
            return(temp);
        }
Exemplo n.º 4
0
 public void SendGameStartMessage(Header header, DataHandler.HandleGamePacket gameHandlePacket, ClientInfo clientInfoParam)
 {
     indianPokerServer.SendMessage(header, gameHandlePacket, clientInfoParam.ClientSocket);
 }