Пример #1
0
    public void ParsePacket()
    {
        Debug.Log(BitConverter.ToInt32(RecvBuf, 0));
        int protocol = BitConverter.ToInt32(RecvBuf, sizeof(int));

        switch (protocol)
        {
        case Protocol.PT_REG_USER:
            loginCtrl.PROC_REG_USER(RecvBuf);
            break;

        case Protocol.PT_USER_LOGIN:
            loginCtrl.PROC_USER_LOGIN(RecvBuf);
            break;

        case Protocol.PT_ROOM_ENTER:
            LobbyToRoom();
            break;

        case Protocol.PT_ROOM_USERINC:
            roomCtrl.RoomUserInc(RecvBuf);
            break;

        case Protocol.PT_USER_CHAT:
            roomCtrl.RecvChat(RecvBuf);
            break;

        default:
            break;
        }
    }