コード例 #1
0
        public Func <Message, IResult <Message, Reason> > Apply(
            Func <Message, IResult <Message, Reason> > next,
            EntityCommandBuffer commandBuffer
            )
        {
            return((message) => {
                if (GlobalSettings.ReplayEnabled && !message.IsReplayTarget)
                {
                    return new Error <Message, Reason>(Reason.Canceled);
                }

                if (GlobalSettings.ReplayEnabled && message.IsReplayTarget)
                {
                    return next(message);
                }

                message.Frame = MessageHistorySystem.Frame;
                var entity = commandBuffer.CreateEntity();
                commandBuffer.AddComponent(entity, new MessageHistoryRecord {
                    Record = StringStore.Store(message.Serialize()),
                });

                return next(message);
            });
        }
コード例 #2
0
 protected override Settings Convert()
 {
     return(new Settings {
         ReplayEnabled = this.ReplayEnabled,
         LoggingEnabled = this.LoggingEnabled,
         LogFilter = StringStore.Store(String.Join(":", this.LogFilter)),
     });
 }