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); }); }
protected override Settings Convert() { return(new Settings { ReplayEnabled = this.ReplayEnabled, LoggingEnabled = this.LoggingEnabled, LogFilter = StringStore.Store(String.Join(":", this.LogFilter)), }); }