Exemple #1
0
 public DBFillerUtils(IDatabaseManager databaseManager, GalaxyManager galaxyManager, LocatorService locatorService, WarpManager warpManager, LocalIDManager galaxyIdManager)
 {
     _databaseManager = databaseManager;
     _galaxyManager   = galaxyManager;
     _locatorService  = locatorService;
     ShipFactory      = new ShipFactory(locatorService.RegistrationManager, warpManager, galaxyIdManager, locatorService, databaseManager);
 }
Exemple #2
0
        public Ship(ShipModelType s, LocatorService ls)
        {
            _model = s;

            StatBonuses = new ShipBonusHandler();

            Debuffs = new DebuffHandler();

            switch (ShipStats.ShieldType)
            {
            case ShieldTypes.QuickRegen:
                Shields = new QuickRegenShieldHandler(ShipStats, StatBonuses, Debuffs);
                break;

            case ShieldTypes.SlowRegen:
                Shields = new SlowRegenShieldHandler(ShipStats, StatBonuses, Debuffs);
                break;

            case ShieldTypes.NoRegen:
                Shields = new NoRegenShieldHandler(ShipStats, StatBonuses, Debuffs);
                break;
            }

            RecalculateModuleBonuses();

            Cargo = new CargoHandler_ReadOnlyVM <CargoHandlerModel>(s.Cargo);


            _playerLocator = ls.PlayerLocator;
            _areaLocator   = ls.AreaLocator;
            _teamLocator   = ls.TeamLocator;
        }
Exemple #3
0
        public NPCPlayer CreateNPCPlayer(LocatorService ls)
        {
            string username = _npcNameProvider.GetRandomName(2, a => { return(a[0] + " " + a[1]); });

            while (_usernameToPlayer.ContainsKey(username.ToLower()))
            {
                username += _npcNameProvider.GetRandomName();
            }


            var p = new NPCPlayer(_playerIDManager.PopFreeID(), username, ls);

            //p.area = new Area();
            _objects.TryAdd(p.Id, p);

            _usernameToPlayer.TryAdd(username, p);
            if (!_usernameToPlayer.ContainsKey(username.ToLower()))
            {
                // Any player that has Caps in their name is added twice
                _usernameToPlayer.TryAdd(username.ToLower(), p);
            }

            p.CashOnHand = 1000000; // I am a kind god ;D
            return(p);
        }
 public static void SetMainPage()
 {
     NavigationPage = new NavigationPage(new PlacesPage())
     {
         Title = "Todos",
         Icon  = "ic_filter_list_white_24dp.png"
     };
     Current.MainPage = new MasterDetailPage
     {
         BindingContext = LocatorService.Get <MainViewModel>(),
         Detail         = new TabbedPage
         {
             Children =
             {
                 NavigationPage,
                 new NavigationPage(new AddPlacePage())
                 {
                     Title = "Agregar",
                     Icon  = "ic_place_white_24dp.png"
                 },
             }
         },
         Master = new MenuPage
         {
             Title = "ContentPage"
         }
     };
 }
        // Token: 0x06000C4F RID: 3151 RVA: 0x00037C18 File Offset: 0x00035E18
        public IAsyncResult BeginSaveDomain(SmtpDomain domain, string domainKey, Guid tenantId, KeyValuePair <DomainProperty, PropertyValue>[] properties, AsyncCallback callback, object asyncState)
        {
            SaveDomainRequest saveDomainRequest   = LocatorServiceClientWriter.ConstructSaveDomainRequest(domain, domainKey, tenantId, properties);
            LocatorService    locatorService      = this.AcquireServiceProxy();
            IAsyncResult      internalAsyncResult = locatorService.BeginSaveDomain(this.requestIdentity, saveDomainRequest, new AsyncCallback(LocatorServiceClientAdapter.OnWebServiceRequestCompleted), new GlsAsyncState(callback, asyncState, locatorService));

            return(new GlsAsyncResult(callback, asyncState, locatorService, internalAsyncResult));
        }
        // Token: 0x06000C4D RID: 3149 RVA: 0x00037B60 File Offset: 0x00035D60
        public void DeleteDomain(SmtpDomain domain, Guid tenantId, Namespace ns)
        {
            DeleteDomainRequest request = LocatorServiceClientWriter.ConstructDeleteDomainRequest(domain, tenantId, ns);
            LocatorService      proxy   = this.AcquireServiceProxy();

            GLSLogger.LoggingWrapper <DeleteDomainResponse>(this, domain.ToString(), proxy.GetHashCode().ToString(), () => proxy.DeleteDomain(this.requestIdentity, request));
            base.ReleaseServiceProxy(proxy);
        }
        // Token: 0x06000C51 RID: 3153 RVA: 0x00037CB4 File Offset: 0x00035EB4
        public IAsyncResult BeginDeleteDomain(SmtpDomain domain, Guid tenantId, Namespace ns, AsyncCallback callback, object asyncState)
        {
            DeleteDomainRequest deleteDomainRequest = LocatorServiceClientWriter.ConstructDeleteDomainRequest(domain, tenantId, ns);
            LocatorService      locatorService      = this.AcquireServiceProxy();
            IAsyncResult        internalAsyncResult = locatorService.BeginDeleteDomain(this.requestIdentity, deleteDomainRequest, new AsyncCallback(LocatorServiceClientAdapter.OnWebServiceRequestCompleted), new GlsAsyncState(callback, asyncState, locatorService));

            return(new GlsAsyncResult(callback, asyncState, locatorService, internalAsyncResult));
        }
Exemple #8
0
 public ShipFactory(IGalaxyRegistrationManager rm, WarpManager wm, ILocalIDManager galaxyIdManager, LocatorService ls, IDatabaseManager dbm)
 {
     _galaxyRegistrationManager = rm;
     _warpManager     = wm;
     _galaxyIdManager = galaxyIdManager;
     _locatorService  = ls;
     _databaseManager = dbm;
 }
Exemple #9
0
        public IAsyncResult BeginDomainExists(SmtpDomain domain, Namespace[] ns, AsyncCallback callback, object asyncState)
        {
            FindDomainRequest findDomainRequest   = LocatorServiceClientReader.ConstructDomainExistsRequest(domain, ns, this.glsReadFlag);
            LocatorService    locatorService      = this.AcquireServiceProxy();
            IAsyncResult      internalAsyncResult = locatorService.BeginFindDomain(this.requestIdentity, findDomainRequest, new AsyncCallback(LocatorServiceClientAdapter.OnWebServiceRequestCompleted), new GlsAsyncState(callback, asyncState, locatorService));

            return(new GlsAsyncResult(callback, asyncState, locatorService, internalAsyncResult));
        }
Exemple #10
0
 internal static IGlobalLocatorServiceReader Create(GlsCallerId glsCallerId, LocatorService serviceProxy)
 {
     if (AppConfigGlsReader.AppConfigOverrideExists())
     {
         return(new AppConfigGlsReader());
     }
     return(new LocatorServiceClientReader(glsCallerId, serviceProxy));
 }
Exemple #11
0
        public IAsyncResult BeginFindDomains(SmtpDomain[] domains, DomainProperty[] domainProperties, TenantProperty[] tenantProperties, AsyncCallback callback, object asyncState)
        {
            FindDomainsRequest findDomainsRequest  = LocatorServiceClientReader.ConstructFindDomainsRequest(domains, domainProperties, tenantProperties, this.glsReadFlag);
            LocatorService     locatorService      = this.AcquireServiceProxy();
            IAsyncResult       internalAsyncResult = locatorService.BeginFindDomains(this.requestIdentity, findDomainsRequest, new AsyncCallback(LocatorServiceClientAdapter.OnWebServiceRequestCompleted), new GlsAsyncState(callback, asyncState, locatorService));

            return(new GlsAsyncResult(callback, asyncState, locatorService, internalAsyncResult));
        }
        // Token: 0x06000C4B RID: 3147 RVA: 0x00037A34 File Offset: 0x00035C34
        public void SaveDomain(SmtpDomain domain, string domainKey, Guid tenantId, KeyValuePair <DomainProperty, PropertyValue>[] properties)
        {
            SaveDomainRequest request = LocatorServiceClientWriter.ConstructSaveDomainRequest(domain, domainKey, tenantId, properties);
            LocatorService    proxy   = this.AcquireServiceProxy();

            GLSLogger.LoggingWrapper <SaveDomainResponse>(this, domain.ToString(), proxy.GetHashCode().ToString(), () => proxy.SaveDomain(this.requestIdentity, request));
            base.ReleaseServiceProxy(proxy);
        }
Exemple #13
0
 protected Area(ModelType a, LocatorService ls)
 {
     _model          = a;
     _playerLocator  = ls.PlayerLocator;
     _areaLocator    = ls.AreaLocator;
     _shipLocator    = ls.ShipLocator;
     _structures     = new Dictionary <int, IStructure>();
     _lastUpdateTime = TimeKeeper.MsSinceInitialization;
 }
Exemple #14
0
        public FindDomainsResult FindDomains(SmtpDomain[] domains, DomainProperty[] domainProperties, TenantProperty[] tenantProperties)
        {
            FindDomainsRequest  request  = LocatorServiceClientReader.ConstructFindDomainsRequest(domains, domainProperties, tenantProperties, this.glsReadFlag);
            LocatorService      proxy    = this.AcquireServiceProxy();
            FindDomainsResponse response = GLSLogger.LoggingWrapper <FindDomainsResponse>(this, domains[0].ToString(), proxy.GetHashCode().ToString(), () => proxy.FindDomains(this.requestIdentity, request));

            base.ReleaseServiceProxy(proxy);
            return(LocatorServiceClientReader.ConstructFindDomainsResult(response));
        }
Exemple #15
0
        public Player(PlayerModel p, LocatorService ls)
        {
            _areaLocator    = ls.AreaLocator;
            _shipLocator    = ls.ShipLocator;
            _accountLocator = ls.AccountLocator;
            _teamLocator    = ls.TeamLocator;

            _model = p;
        }
Exemple #16
0
        public bool TenantExists(Guid tenantId, Namespace[] ns)
        {
            FindTenantRequest  request            = LocatorServiceClientReader.ConstructTenantExistsRequest(tenantId, ns, this.glsReadFlag);
            LocatorService     proxy              = this.AcquireServiceProxy();
            FindTenantResponse findTenantResponse = GLSLogger.LoggingWrapper <FindTenantResponse>(this, tenantId.ToString(), proxy.GetHashCode().ToString(), () => proxy.FindTenant(this.requestIdentity, request));

            base.ReleaseServiceProxy(proxy);
            return(findTenantResponse.TenantInfo != null);
        }
 internal LocatorServiceClientAdapter(GlsCallerId glsCallerId, LocatorService serviceProxy)
 {
     this.requestIdentity = new RequestIdentity
     {
         CallerId     = glsCallerId.CallerIdString,
         TrackingGuid = glsCallerId.TrackingGuid
     };
     this.serviceProxyPool = new SingletonServiceProxyPool <LocatorService>(serviceProxy);
 }
Exemple #18
0
        public bool DomainExists(SmtpDomain domain, Namespace[] ns)
        {
            FindDomainRequest  request            = LocatorServiceClientReader.ConstructDomainExistsRequest(domain, ns, this.glsReadFlag);
            LocatorService     proxy              = this.AcquireServiceProxy();
            FindDomainResponse findDomainResponse = GLSLogger.LoggingWrapper <FindDomainResponse>(this, domain.ToString(), proxy.GetHashCode().ToString(), () => proxy.FindDomain(this.requestIdentity, request));

            base.ReleaseServiceProxy(proxy);
            return(findDomainResponse.DomainInfo != null);
        }
Exemple #19
0
        public Ship(ShipStats stats, LocatorService ls)
        {
            _model   = new ShipModelType();
            PosX     = 0;
            PosY     = 0;
            Rotation = 0;
            VelY     = 0;
            VelX     = 0;
            _weapons = new List <Weapon>();
            _model.MissileLauncherSlot = 0;
            _weapons.Add(new MissileLauncher(ProjectileTypes.AmbassadorMissile));



            TimeOfLastCollision = 0;
            TimeOfLastDamage    = 0;
            DoCombatUpdates     = false;

            HealthUpdatePeriod = 500;

            _model.PlayerID     = null;
            _simulatingPlayerID = null;
            IsNPC = false;


            _playerLocator = ls.PlayerLocator;
            _areaLocator   = ls.AreaLocator;
            _teamLocator   = ls.TeamLocator;


            _model.Modules = new List <Module>();
            StatBonuses    = new ShipBonusHandler();

            Debuffs = new DebuffHandler();

            switch (stats.ShieldType)
            {
            case ShieldTypes.QuickRegen:
                Shields = new QuickRegenShieldHandler(stats, StatBonuses, Debuffs);
                break;

            case ShieldTypes.SlowRegen:
                Shields = new SlowRegenShieldHandler(stats, StatBonuses, Debuffs);
                break;

            case ShieldTypes.NoRegen:
                Shields = new NoRegenShieldHandler(stats, StatBonuses, Debuffs);
                break;
            }
            ShipStats = stats;


            _model.Cargo = new CargoHandlerModel();
            Cargo        = new CargoHandler_ReadOnlyVM <CargoHandlerModel>(_model.Cargo);
            SetHealthAndShields(stats);
        }
 internal GlsAsyncResult(AsyncCallback callback, object asyncState, LocatorService serviceProxy, IAsyncResult internalAsyncResult) : base(callback, asyncState)
 {
     if (serviceProxy != null)
     {
         this.pooledProxy = new GlsAsyncResult.GlsServiceProxy(serviceProxy);
     }
     this.internalAsyncResult = internalAsyncResult;
     this.creationTime        = DateTime.UtcNow;
     this.isOfflineGls        = false;
 }
Exemple #21
0
        private void InitApp(ISQLite sqlitePath)
        {
            _container = LocatorService.Boot(sqlitePath);
            var init = _container.GetInstance <IInitDefaultDb>();

            Task.Run(() => init.LoadDefaultData());
            if (Device.RuntimePlatform == Device.UWP)
            {
                InitNavigation();
            }
        }
Exemple #22
0
        public Colony(ColonyModel c, LocatorService ls) : base(c, ls)
        {
            _model             = c;
            refineries         = new List <Refinery>();
            mines              = new List <MineStructure>();
            biodomes           = new List <Biodome>();
            powerPlants        = new List <PowerPlant>();
            _resourceSuppliers = new List <IResourceSupply>();

            _model.ResearchHandler.ResetBonuses();
        }
Exemple #23
0
        protected Area(int ID, LocatorService ls)
        {
            _model = new ModelType();
            Id     = ID;

            _playerLocator            = ls.PlayerLocator;
            _areaLocator              = ls.AreaLocator;
            _shipLocator              = ls.ShipLocator;
            _structures               = new Dictionary <int, IStructure>();
            _model.FloatySpaceObjects = new Dictionary <int, IFloatyAreaObject>();
            _lastUpdateTime           = TimeKeeper.MsSinceInitialization;
        }
        protected static void OnWebServiceRequestCompleted(IAsyncResult internalAR)
        {
            GlsAsyncState  glsAsyncState    = (GlsAsyncState)internalAR.AsyncState;
            AsyncCallback  clientCallback   = glsAsyncState.ClientCallback;
            object         clientAsyncState = glsAsyncState.ClientAsyncState;
            LocatorService serviceProxy     = glsAsyncState.ServiceProxy;

            if (clientCallback != null)
            {
                IAsyncResult ar = new GlsAsyncResult(clientCallback, clientAsyncState, serviceProxy, internalAR);
                clientCallback(ar);
            }
        }
Exemple #25
0
        public Planet(IArea parentArea, int ID, LocatorService ls)
            : base(ID, ls)
        {
            ParentAreaID = parentArea.Id;
            _teamLocator = ls.TeamLocator;
            _areaLocator = ls.AreaLocator;

            _shipCache          = new Dictionary <int, IShip>();
            _model.ShipIDs      = new HashSet <int>();
            _model.StructureIDs = new HashSet <int>();
            Scale         = 10;
            SecurityLevel = 0;
            Warpholes     = new List <Warphole>(1);
        }
        public bool PSystemsLoaded;//Signals that all PSystems have been loaded and the server is ready
        //TODO: Implement pause to object updating when additional systems need to be loaded while server is up

        public MasterServerMessageHandler(
            int mySlaveID,
            RedisServer redisServer,
            ConnectionManager connectionManager,
            LocatorService ls,
            AccountManager accountManager,
            LocalIDManager accountIdManager,
            IDatabaseManager databaseManager,
            GalaxyManager galaxyManager,
            LocalIDManager galaxyIDManager,
            PlayerManager playerManager,
            ShipManager shipManager,
            GalaxyRegistrationManager rm,
            LocalIDManager teamIDManager,
            MessageManager messageManager,
            GlobalTeamManager teamManager,
            WarpManager warpManager,
            LocalIDManager transactionIdManager,
            EventHandler <NetworkMessageContainer> routedMessageProcessor
            )
        {
            _connectionManager    = connectionManager;
            _accountManager       = accountManager;
            _accountIdManager     = accountIdManager;
            _databaseManager      = databaseManager;
            _galaxyIDManager      = galaxyIDManager;
            _galaxyManager        = galaxyManager;
            _teamIDManager        = teamIDManager;
            _playerManager        = playerManager;
            _shipManager          = shipManager;
            _registrationManager  = rm;
            _locatorService       = ls;
            _messageManager       = messageManager;
            _teamManager          = teamManager;
            _redisServer          = redisServer;
            _warpManager          = warpManager;
            _transactionIdManager = transactionIdManager;

            _mySlaveID = mySlaveID;

            _routedMessageProcessor = routedMessageProcessor;

            _redisServer.Subscribe(MessageTypes.Redis_LoginDataRequest, _handleLoginDataRequest);
            _redisServer.Subscribe(MessageTypes.Redis_ColonyDataPush, _handleColonyDataPush);
            _redisServer.Subscribe(MessageTypes.Redis_ClientHandoff, _handleHandoff);
            _redisServer.Subscribe(MessageTypes.Redis_StartUpdatingSystems, _handleMessageStartUpdatingSystems);
            _redisServer.Subscribe(MessageTypes.Redis_IDResponse, _handleMessageIDResponse);
            _redisServer.Subscribe(MessageTypes.Redis_AdminWarpPlayer, _handleAdminWarpPlayer);
        }
        public void LocateShipThrowException()
        {
            //arrange
            var _locatorService   = new LocatorService(_satelliteRepository.Object, _receivedMessageRepository.Object);
            var _receivedMessages = new List <ReceivedMessage>()
            {
                new ReceivedMessage()
                {
                    Distance = 112, SatelliteName = "sato", Message = new string[] { "este", "es", "un", "", "" }
                }
            };

            //assert
            Assert.ThrowsException <CantDeterminateLocationException>(() => _locatorService.GetLocation(_receivedMessages));
        }
Exemple #28
0
        protected override Player _instantiateObject(IDBObject pm, LocatorService ls)
        {
            PlayerModel model = pm as PlayerModel;

            if (model.PlayerType == PlayerTypes.Human)
            {
                return(new HumanPlayer(model, ls));
            }
            else
            {
                var p = new NPCPlayer(model, ls);
                p.MessageService = new RedisOutgoingMessageService(_redisServer, p);
                return(p);
            }
        }
Exemple #29
0
        public NPCPlayer(int playerID, string name, LocatorService ls)
        {
            _model = new PlayerModel();

            _model.Id = playerID;
            Username  = name;

            _areaLocator    = ls.AreaLocator;
            _shipLocator    = ls.ShipLocator;
            _accountLocator = ls.AccountLocator;
            _teamLocator    = ls.TeamLocator;

            _model.DefaultTeamID = ls.TeamManager.CreateNewTeam(this);
            _model.TeamIDs.Add((int)_model.DefaultTeamID);
            _model.PlayerType = PlayerTypes.NPC;
        }
Exemple #30
0
        public Planet(PlanetModel p, PlanetLayout layout, LocatorService ls)
            : base(p, ls)
        {
            Gravity     = p.Gravity;
            HasMoons    = p.HasMoons;
            IsColonized = p.IsColonized;
            //ColonyID = p.Colony == null? null : (int?)p.Colony.Id;
            ColonyID   = p.ColonyID;
            Layout     = layout;
            Mass       = p.Mass;
            PlanetType = p.PlanetType;
            Scale      = p.Scale;

            _shipCache = new Dictionary <int, IShip>();

            _teamLocator = ls.TeamLocator;
        }