public ServerHistoryProvider(
            CharacterName characterName, IPersistent<PersistentModel.ServerHistory> persistentData,
            IWurmLogsMonitorInternal logsMonitor,
            IWurmLogsHistory logsSearcher,
            IWurmServerList wurmServerList,
            ILogger logger,
            IWurmCharacterLogFiles wurmCharacterLogFiles)
        {
            if (characterName == null) throw new ArgumentNullException("characterName");
            if (persistentData == null) throw new ArgumentNullException("persistentData");
            if (logsMonitor == null) throw new ArgumentNullException("logsMonitor");
            if (logsSearcher == null) throw new ArgumentNullException("logsSearcher");
            if (wurmServerList == null) throw new ArgumentNullException("wurmServerList");
            if (logger == null) throw new ArgumentNullException("logger");
            if (wurmCharacterLogFiles == null) throw new ArgumentNullException("wurmCharacterLogFiles");
            this.characterName = characterName;
            this.sortedServerHistory = new SortedServerHistory(persistentData);
            this.persistentData = persistentData;
            this.logsMonitor = logsMonitor;
            this.logsSearcher = logsSearcher;
            this.wurmServerList = wurmServerList;
            this.logger = logger;
            this.wurmCharacterLogFiles = wurmCharacterLogFiles;

            logsMonitor.SubscribeInternal(characterName, LogType.Event, HandleEventLogEntries);
        }
        public ServerHistoryProvider(
            [NotNull] CharacterName characterName,
            [NotNull] IPersistent <PersistentModel.ServerHistory> persistentData,
            [NotNull] IWurmLogsMonitorInternal logsMonitor,
            [NotNull] IWurmLogsHistory logsSearcher,
            [NotNull] IWurmServerList wurmServerList,
            [NotNull] IWurmApiLogger logger,
            [NotNull] IWurmCharacterLogFiles wurmCharacterLogFiles,
            [NotNull] IInternalEventAggregator eventAggregator)
        {
            if (characterName == null)
            {
                throw new ArgumentNullException(nameof(characterName));
            }
            if (persistentData == null)
            {
                throw new ArgumentNullException(nameof(persistentData));
            }
            if (logsMonitor == null)
            {
                throw new ArgumentNullException(nameof(logsMonitor));
            }
            if (logsSearcher == null)
            {
                throw new ArgumentNullException(nameof(logsSearcher));
            }
            if (wurmServerList == null)
            {
                throw new ArgumentNullException(nameof(wurmServerList));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (wurmCharacterLogFiles == null)
            {
                throw new ArgumentNullException(nameof(wurmCharacterLogFiles));
            }
            if (eventAggregator == null)
            {
                throw new ArgumentNullException(nameof(eventAggregator));
            }
            this.characterName         = characterName;
            sortedServerHistory        = new SortedServerHistory(persistentData);
            this.persistentData        = persistentData;
            this.logsMonitor           = logsMonitor;
            this.logsSearcher          = logsSearcher;
            this.wurmServerList        = wurmServerList;
            this.logger                = logger;
            this.wurmCharacterLogFiles = wurmCharacterLogFiles;
            this.eventAggregator       = eventAggregator;

            eventAggregator.Subscribe(this);
            logsMonitor.SubscribeInternal(characterName, LogType.Event, HandleEventLogEntries);
        }
 public void Setup()
 {
     DataDir = TempDirectoriesFactory.CreateEmpty();
     var lib = new PersistentCollectionsLibrary(new FlatFilesPersistenceStrategy(DataDir.AbsolutePath));
     System = new SortedServerHistory(lib.DefaultCollection.GetObject<WurmApi.Modules.Wurm.ServerHistory.PersistentModel.ServerHistory>("default"));
 }