예제 #1
0
        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);
        }
예제 #3
0
        public WurmCharacterSkills([NotNull] IWurmCharacter character, [NotNull] IPublicEventInvoker publicEventInvoker,
                                   [NotNull] IWurmLogsMonitorInternal logsMonitor, [NotNull] IWurmLogsHistory logsHistory,
                                   [NotNull] IWurmApiLogger logger, IWurmPaths wurmPaths,
                                   [NotNull] IInternalEventAggregator internalEventAggregator)
        {
            if (character == null)
            {
                throw new ArgumentNullException(nameof(character));
            }
            if (publicEventInvoker == null)
            {
                throw new ArgumentNullException(nameof(publicEventInvoker));
            }
            if (logsMonitor == null)
            {
                throw new ArgumentNullException(nameof(logsMonitor));
            }
            if (logsHistory == null)
            {
                throw new ArgumentNullException(nameof(logsHistory));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (internalEventAggregator == null)
            {
                throw new ArgumentNullException(nameof(internalEventAggregator));
            }
            this.character          = character;
            this.publicEventInvoker = publicEventInvoker;
            this.logsMonitor        = logsMonitor;
            this.logsHistory        = logsHistory;
            this.logger             = logger;

            skillsMap  = new SkillsMap();
            skillDumps = new SkillDumpsManager(character, wurmPaths, logger);

            UpdateCurrentServer();

            onSkillsChanged =
                publicEventInvoker.Create(
                    InvokeOnSkillsChanged,
                    WurmApiTuningParams.PublicEventMarshallerDelay);

            internalEventAggregator.Subscribe(this);

            logsMonitor.SubscribeInternal(character.Name, LogType.Skills, EventHandler);
        }