Esempio n. 1
0
        public LocalIDManager_MS(GlobalAccountIDManager globalAccountIDManager, IDTypes IDType)
        {
            _IDSupplier = globalAccountIDManager;
            if (_IDSupplier != null)
            {
                _IDSupplier.GetFreeIDs(_minIDCount * 2);
            }
            else
            {
                ConsoleManager.WriteLine("Warning: networkIDSupplier is null in LocalIDManager constructor. This should only be the case when running DBFiller.", ConsoleMessageType.Warning);
            }


            _IDType = IDType;
        }
Esempio n. 2
0
        public MinimalMockServer(GalacticProperties gp, IDatabaseManager databaseManager, IDbIdIoService dbIdIoService)
        {
            Logger.Initialize();

            DatabaseManager = databaseManager;
            DbIdIoService   = dbIdIoService;

            //Minimal initializations
            GalaxyIDManager  = new LocalIDManager(null, IDTypes.GalaxyID);
            TeamIDManager    = new LocalIDManager(null, IDTypes.TeamID);
            accountIDManager = new LocalIDManager(null, IDTypes.AccountID);

            InitializeIdData(gp);

            globalGalaxyIDManager = new GlobalGalaxyIDManager(dbIdIoService, gp);
            GenerateIDsForLocalIDManager(globalGalaxyIDManager, GalaxyIDManager, gp.IdProperties[IDTypes.GalaxyID].LastIDAdded);

            globalTeamIDManager = new GlobalTeamIDManager(dbIdIoService, gp);
            GenerateIDsForLocalIDManager(globalTeamIDManager, TeamIDManager, gp.IdProperties[IDTypes.TeamID].LastIDAdded);

            globalAccountIDManager = new GlobalAccountIDManager(dbIdIoService, gp);
            GenerateIDsForLocalIDManager(globalAccountIDManager, accountIDManager, gp.IdProperties[IDTypes.AccountID].LastIDAdded);

            _redisServer = new RedisServer(Logger.LogRedisError, Logger.LogRedisInfo, new RedisConfig().Address);


            TeamManager        = new GlobalTeamManager(TeamIDManager, null, null, null, DatabaseManager);
            PlayerManager      = new PlayerManager(DatabaseManager, null, _redisServer, GalaxyIDManager, null);
            GalaxyManager      = new GalaxyManager(gp.SolID, TeamManager);
            shipManager        = new ShipManager(null, GalaxyManager, null, null, DatabaseManager);
            CollisionManager   = new CollisionManager(GalaxyManager, null, null, null);
            GalaxyGenerator    = new DebugGalaxyGenerator(PlayerManager, GalaxyManager, shipManager);
            AccountManager     = new AccountManager_MasterServer(accountIDManager, DatabaseManager, false);
            CargoSynchronizer  = new Server.Managers.CargoSynchronizer();
            StructureManager   = new StructureManager(DatabaseManager, GalaxyManager, GalaxyIDManager, CargoSynchronizer);
            RegistrationManger = new GalaxyRegistrationManager(GalaxyManager, shipManager, CollisionManager, GalaxyIDManager, PlayerManager, null, CargoSynchronizer, StructureManager);
            ColonyFactory.Initialize(GalaxyIDManager, RegistrationManger);
            StructureFactory.Initialize(GalaxyIDManager, RegistrationManger);
            LocatorService = new LocatorService(RegistrationManger, PlayerManager, GalaxyManager, shipManager, AccountManager, TeamManager, TeamManager, null, StructureManager, null);

            WarpManager = new WarpManager(GalaxyManager, null, null, _redisServer, AccountManager, null);

            CargoSynchronizer.Start(10, 4);
        }