Exemplo n.º 1
0
 public DirectoryProcessor(IProcess processor, IFileWrapper fileWrapper, IDBWriter dbWriter, EntityType type)
 {
     _processor   = processor;
     _fileWrapper = fileWrapper;
     _dbWriter    = dbWriter;
     _type        = type;
 }
Exemplo n.º 2
0
 public void ProcessFile(string path, IFileWrapper fileWrapper, IDBWriter dbWriter, EntityType type)
 {
     if (Path.GetFileNameWithoutExtension(path).ToString().Contains("spec"))
     {
         fileWrapper.WriteData(path, Program.TestResultFilePath);
         dbWriter.WriteToDB(Path.GetFileName(Path.GetDirectoryName(path)), type);
     }
 }
Exemplo n.º 3
0
 public Worker(ILogger <Worker> logger, IDBWriter writer, IParser parser, IConvert convert, Settings settings)
 {
     _logger    = logger;
     _writer    = writer;
     _parser    = parser;
     _settings  = settings;
     _converter = convert;
 }
Exemplo n.º 4
0
        /// <summary>
        /// SHOULD ONLY BE CALLED BY a PlayerManager instance
        /// Logs the player out and pushes the player, account, and all ships to the DB
        /// </summary>
        public virtual void LogOut(IDBWriter dbWriter)
        {
            OnDisconnect();
            IsOnline = false;
            dbWriter.SaveAsync(this);
            dbWriter.SaveAsync(_shipLocator.GetShipAsync(_model.ActiveShipId).Result);
            //account.LastSystemID = CurrentArea.Id;
            dbWriter.SaveAsync(GetAccount());

            dbWriter.SaveAsync(_areaLocator.GetArea(_model.CurrentAreaID)); //Required in case client warps, logs out, and server crashes before area is written to DB
                                                                            //If this proves excessive, we'll probably have to force all ships to a certain area or manually ensure that IShip areas and area.ship match on server restart, which we'll probably have to do anyway
        }
Exemplo n.º 5
0
        public DBSyncer(IDBWriter DBWriter, GalaxyManager gm, ShipManager sm, PlayerManager pm, AccountManager am, StructureManager scm)
        {
            _DBWriter         = DBWriter;
            _galaxyManager    = gm;
            _shipManager      = sm;
            _playerManager    = pm;
            _accountManager   = am;
            _structureManager = scm;

            _time = new Stopwatch();
            _time.Start();
        }
        public void ProcessFile(string path, IFileWrapper fileWrapper, IDBWriter dbWriter, EntityType type)
        {
            if (Path.GetFileNameWithoutExtension(path).ToString().Contains("selectors"))
            {
                List <string> result = getAllSelectors(path);

                foreach (string selector in result)
                {
                    if (!Program.ExistingSelectors.Contains(selector))
                    {
                        fileWrapper.WriteData(selector, Program.SelectorResultFilePath);
                        dbWriter.WriteToDB(selector, type);
                    }
                }
            }
        }
 public void ProcessFile(string path, IFileWrapper fileWrapper, IDBWriter dbWriter, EntityType type)
 {
     fileWrapper.WriteData(path, Program.TestResultFilePath);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Writes all players to the db
 /// </summary>
 /// <param name="dbr"></param>
 public async Task SyncPlayers(IDBWriter dbr)
 {
     //TODO: Add lock
     await dbr.SaveAsyncBulk(_objects.Values.ToList());
 }
Exemplo n.º 9
0
 /// <summary>
 /// SHOULD ONLY BE CALLED BY a PlayerManager instance
 /// Logs the player out and pushes the player, account, and all ships to the DB
 /// </summary>
 public override void LogOut(IDBWriter dbWriter)
 {
     return;
 }