当前位置: 首页>>代码示例>>C#>>正文


C# FlatBufferBuilder.ToProtocolMessage方法代码示例

本文整理汇总了C#中FlatBuffers.FlatBufferBuilder.ToProtocolMessage方法的典型用法代码示例。如果您正苦于以下问题:C# FlatBufferBuilder.ToProtocolMessage方法的具体用法?C# FlatBufferBuilder.ToProtocolMessage怎么用?C# FlatBufferBuilder.ToProtocolMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FlatBuffers.FlatBufferBuilder的用法示例。


在下文中一共展示了FlatBufferBuilder.ToProtocolMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateAssignSessionId

        public static byte[] CreateAssignSessionId(uint sessionId)
        {
            var fbb = new FlatBufferBuilder(1024);

            var oAssignSessionId = Messages.AssignSessionId.CreateAssignSessionId(fbb, sessionId);
            Messages.AssignSessionId.FinishAssignSessionIdBuffer(fbb, oAssignSessionId);

            return fbb.ToProtocolMessage(MessageIds.AssignSessionId);
        }
开发者ID:wuyuntao,项目名称:DeterministicLockstepNetworking,代码行数:9,代码来源:Schema.cs

示例2: Serialize

        public byte[] Serialize()
        {
            var fbb = new FlatBufferBuilder(1024);
            var msg = MetadataMsg.CreateMetadata(fbb,
                    ColorFrameWidth, ColorFrameHeight,
                    DepthFrameWidth, DepthFrameHeight);
            fbb.Finish(msg.Value);

            return fbb.ToProtocolMessage(MessageIds.Metadata);
        }
开发者ID:wuyuntao,项目名称:Mokap,代码行数:10,代码来源:MetaData.cs

示例3: CreateInputCommand

        public static byte[] CreateInputCommand(CommandFrame frame)
        {
            var fbb = new FlatBufferBuilder(1024);

            var oFrame = CreateCommandFrameOffset(frame, fbb);

            var oInputCommand = Messages.InputCommand.CreateInputCommand(fbb, oFrame);
            Messages.InputCommand.FinishInputCommandBuffer(fbb, oInputCommand);

            return fbb.ToProtocolMessage(MessageIds.InputCommand);
        }
开发者ID:wuyuntao,项目名称:DeterministicLockstepNetworking,代码行数:11,代码来源:Schema.cs

示例4: Serialize

        public byte[] Serialize()
        {
            var fbb = new FlatBufferBuilder(1024);

            var bodies = Array.ConvertAll(Bodies, body => body.Serialize(fbb));
            var msg = BodyFrameDataMsg.CreateBodyFrameData(fbb,
                    RelativeTime.Ticks,
                    BodyFrameDataMsg.CreateBodiesVector(fbb, bodies));
            fbb.Finish(msg.Value);

            return fbb.ToProtocolMessage(MessageIds.BodyFrameData);
        }
开发者ID:wuyuntao,项目名称:Mokap,代码行数:12,代码来源:BodyFrameData.cs

示例5: CreateSyncFrame

        public static byte[] CreateSyncFrame(CommandFrame[] frames)
        {
            var fbb = new FlatBufferBuilder(1024);

            var oFrames = CreateFrameOffsets(fbb, frames);
            var vFrames = Messages.SyncFrame.CreateFramesVector(fbb, oFrames);

            var oSyncFrame = Messages.SyncFrame.CreateSyncFrame(fbb, vFrames);
            Messages.SyncFrame.FinishSyncFrameBuffer(fbb, oSyncFrame);

            return fbb.ToProtocolMessage(MessageIds.SyncFrame);
        }
开发者ID:wuyuntao,项目名称:DeterministicLockstepNetworking,代码行数:12,代码来源:Schema.cs


注:本文中的FlatBuffers.FlatBufferBuilder.ToProtocolMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。