Exemplo n.º 1
0
        public static PageDataList read(BinaryReader binaryReader)
        {
            PageDataList newObj = new PageDataList();

            newObj.i_bookID           = binaryReader.ReadUInt32();
            newObj.i_maxNumPages      = binaryReader.ReadUInt32();
            newObj.numPages           = binaryReader.ReadUInt32();
            newObj.maxNumCharsPerPage = binaryReader.ReadUInt32();

            uint used_pages = binaryReader.ReadUInt32();

            for (uint i = 0; i < used_pages; i++)
            {
                newObj.pageData.Add(BookPageDataResponse.read(binaryReader));
            }

            newObj.inscription = PStringChar.read(binaryReader);
            newObj.authorId    = binaryReader.ReadUInt32();
            newObj.authorName  = PStringChar.read(binaryReader);

            return(newObj);
        }
Exemplo n.º 2
0
    public override bool acceptMessageData(BinaryReader messageDataReader, TreeView outputTreeView)
    {
        bool handled = true;

        PacketOpcode opcode = Util.readOpcode(messageDataReader);

        switch (opcode)
        {
        case PacketOpcode.BOOK_DATA_RESPONSE_EVENT:
        {
            BookDataResponse message = BookDataResponse.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.BOOK_MODIFY_PAGE_RESPONSE_EVENT:
        {
            BookModifyPageResponse message = BookModifyPageResponse.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.BOOK_ADD_PAGE_RESPONSE_EVENT:
        {
            BookAddPageResponse message = BookAddPageResponse.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.BOOK_DELETE_PAGE_RESPONSE_EVENT:
        {
            BookDeletePageResponse message = BookDeletePageResponse.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.BOOK_PAGE_DATA_RESPONSE_EVENT:
        {
            BookPageDataResponse message = BookPageDataResponse.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Writing__BookData_ID:
        {
            BookData message = BookData.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Writing__BookModifyPage_ID: {
            BookModifyPage message = BookModifyPage.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Writing__BookAddPage_ID: {
            BookAddPage message = BookAddPage.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Writing__BookDeletePage_ID: {
            BookDeletePage message = BookDeletePage.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        case PacketOpcode.Evt_Writing__BookPageData_ID: {
            BookPageData message = BookPageData.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        // TODO: Evt_Writing__GetInscription_ID
        case PacketOpcode.Evt_Writing__SetInscription_ID: {
            SetInscription message = SetInscription.read(messageDataReader);
            message.contributeToTreeView(outputTreeView);
            break;
        }

        default: {
            handled = false;
            break;
        }
        }

        return(handled);
    }