public MainInitializer(IAllianceInitializer allianceInitializer, IMapGInitializer mapGInitializer, IAuthUsersInitializer authUsersInitializer, IGameUserService gameUserService, INpcInitializer npcInitializer, IUserInitializer userInitializer, IUserNameSercherPkCache userNameSercherPkCache, IUserLocalStorageCache userCache, IUserRepository userRepo, IAllianceService allianceService, IChannelService channelService, IDbProvider provider) { _allianceInitializer = allianceInitializer; _mapGInitializer = mapGInitializer; _authUsersInitializer = authUsersInitializer; _gameUserService = gameUserService; _npcInitializer = npcInitializer; _userInitializer = userInitializer; _userNameSercherPkCache = userNameSercherPkCache; _userCache = userCache; _userRepo = userRepo; _allianceService = allianceService; _provider = provider; _channelService = (ChannelService)channelService; _admUser = MainUserRepository.GetAdminUser(); _textUser = MainUserRepository.GetTextureUser(); _demoUser = MainUserRepository.GetUser(MainUserRepository.DemoUserName); }
public JournalOutService(IGDetailPlanetService gDetailPlanetService, IGGeometryPlanetService geometryPlanetService, ISystemService systemService, IUTaskService uTaskService, IUReportService uReportService, IUSpyService uSpyService, IMothershipService mothershipService, ISpriteImages spriteImages, ISynchronizer synchronizer, IMapAdressService mapAdressService, IUMotherJumpService motherJumpService, IGameUserService gameUserService, IStoreService storeService, ILocalizerService localizer) { _gDetailPlanetService = gDetailPlanetService; _geometryPlanetService = geometryPlanetService; _systemService = systemService; _uTaskService = uTaskService; _uReportService = uReportService; _uSpyService = uSpyService; _mothershipService = mothershipService; _spriteImages = spriteImages; _synchronizer = synchronizer; _mapAdressService = mapAdressService; _motherJumpService = motherJumpService; _gameUserService = gameUserService; _storeService = storeService; _localizer = localizer; }
public AllianceInitializer(IAllianceService allianceService, IGameUserService gameUserService, IGDetailPlanetService gDetailPlanetService) { _allianceService = allianceService; _gameUserService = gameUserService; _gDetailPlanetService = gDetailPlanetService; }
public CommandCenter(IMothershipService mothershipService, IGDetailPlanetService gDetailPlanetService, ISynchronizer synchronizer, IStoreService storeService, IGameUserService gameUserService, IUMotherJumpService motherJumpService, ITurels turels) : base(mothershipService, gDetailPlanetService, synchronizer, storeService, gameUserService, motherJumpService) { _turels = turels; }
public UserRattingItem RatingGetUser(IDbConnection connection, IGameUserService gu, int userId) { var user = gu.GetGameUser(connection, userId); var top = gu.GetTopPosition(connection, user.Id, user.PvpPoint); return(new UserRattingItem(user, top)); }
public UserController(UserManager <User> userManager, SignInManager <User> signInManager, IGameUserService gameUserService, IGameService gameService, ICommentService commentService) { _userManager = userManager; _signInManager = signInManager; _gameUserService = gameUserService; _gameService = gameService; _commentService = commentService; }
public UserInitializer(IGameUserService gameUserService, IMothershipService mothershipService, IStoreService storeService, IAllianceService allianceService, IChannelService channelService) { _gameUserService = gameUserService; _mothershipService = mothershipService; _storeService = storeService; _allianceService = allianceService; _channelService = (ChannelService)channelService; }
public NpcInitializer(IAllianceService allianceService, IGameUserService gameUserService, IMothershipService mothershipService, IChannelService channelService, IDbProvider dbProvider) { _allianceService = allianceService; _gameUserService = gameUserService; _mothershipService = mothershipService; _dbProvider = dbProvider; _channelService = (ChannelService)channelService; }
public MapInfoService(IGameTypeService gameTypeService, IGGalaxyService galaxyService, IAllianceService allianceService, IGGeometryPlanetService geometryPlanetService, IGameUserService gameUserService, ILocalizerService localizer) { _gameTypeService = gameTypeService; _galaxyService = galaxyService; _allianceService = allianceService; _geometryPlanetService = geometryPlanetService; _gameUserService = gameUserService; _localizer = localizer; }
public Shipyard(IMothershipService mothershipService, IGDetailPlanetService gDetailPlanetService, ISynchronizer synchronizer, IStoreService storeService, IGameUserService gameUserService, IUMotherJumpService motherJumpService, ISpaceShipyard spaceShipyard) : base(mothershipService, gDetailPlanetService, synchronizer, storeService, gameUserService, motherJumpService) { _spaceShipyard = spaceShipyard; }
public Laboratory(IMothershipService mothershipService, IGDetailPlanetService gDetailPlanetService, ISynchronizer synchronizer, IStoreService storeService, IGameUserService gameUserService, IUMotherJumpService motherJumpService, ILaboratoryBuild laboratoryBuild) : base(mothershipService, gDetailPlanetService, synchronizer, storeService, gameUserService, motherJumpService) { _laboratoryBuild = laboratoryBuild; }
protected BuildCollection(IMothershipService mothershipService, IGDetailPlanetService gDetailPlanetService, ISynchronizer synchronizer, IStoreService storeService, IGameUserService gameUserService, IUMotherJumpService motherJumpService) { _mothershipService = mothershipService; _gDetailPlanetService = gDetailPlanetService; _synchronizer = synchronizer; _storeService = storeService; _gameUserService = gameUserService; _motherJumpService = motherJumpService; }
public HomeController(IGameService gameService, IIconService iconService, IQuizCategoryService quizCategoryService, IOfferService offerService, IGameUserService gameUserService, IQuestionService questionService, IAnswerService answerService, IQuizHistoryService quizHistoryService, IQuizSummaryService quizSummaryService, IConfiguration configuration) { _gameService = gameService; _iconService = iconService; _quizCategoryService = quizCategoryService; _offerService = offerService; _gameUserService = gameUserService; _questionService = questionService; _answerService = answerService; _quizHistoryService = quizHistoryService; _quizSummaryService = quizSummaryService; _configuration = configuration; }
public MapInfoService(IGSectorsService gSectorsService, IMoonService moonService, ISystemService systemService, IGDetailPlanetService gDetailPlanetService, IGameTypeService gameTypeService, IGGalaxyService galaxyService, IAllianceService allianceService, IGGeometryPlanetService geometryPlanetService, IGameUserService gameUserService, ILocalizerService localizer) { _gSectorsService = gSectorsService; _moonService = moonService; _systemService = systemService; _gDetailPlanetService = gDetailPlanetService; _gameTypeService = gameTypeService; _galaxyService = galaxyService; _allianceService = allianceService; _geometryPlanetService = geometryPlanetService; _gameUserService = gameUserService; _localizer = localizer; }
public static void Initailze( HttpConfiguration configuration ) { var configPath = ConfigurationManager.AppSettings["DataPath"] ?? "Data"; var dataRoot = Path.Combine( HostingEnvironment.ApplicationPhysicalPath, configPath ); UserService = new JsonUserService( dataRoot ); DataService = new JsonDataService( dataRoot ); MessageService = new TextFileMessageService( dataRoot ); var typeResolver = new HttpRuntimeTypeResolver( configuration.Services.GetAssembliesResolver() ); var rules = StarveGameRules.CreateInstance( typeResolver ); GameHost.Initialize( rules, DataService, MessageService ); configuration.Services.Replace( typeof( IContentNegotiator ), new JsonContentNegotiator() ); configuration.Formatters.JsonFormatter.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Utc; }
public TaskRunner(IServiceProvider svp) { _svp = svp; _uTaskService = _svp.GetService <IUTaskService>(); _uReportService = _svp.GetService <IUReportService>(); _gDetailPlanetService = _svp.GetService <IGDetailPlanetService>(); _gameUserService = _svp.GetService <IGameUserService>(); _storeService = _svp.GetService <IStoreService>(); _allianceService = _svp.GetService <IAllianceService>(); _motherRunner = _svp.GetService <IMotherRunner>(); _confederationService = _svp.GetService <IConfederationService>(); _mothershipService = _svp.GetService <IMothershipService>(); _motherJumpService = _svp.GetService <IUMotherJumpService>(); _planetRunner = _svp.GetService <IPlanetRunner>(); _demonLog = _svp.GetService <IDemonAzureLogItem>(); _dbProvider = _svp.GetService <IDbProvider>(); }
public EstateOwnService(IShipyard shipyard, ILaboratory laboratory, IIndustrialComplex industrialComplex, ICommandCenter commandCenter, ISynchronizer synchronizer, IMothershipService mothershipService, IUMotherJumpService motherJumpService, IGameUserService gameUserService, IStoreService storeService, IGDetailPlanetService detailPlanetService, ILocalizerService localizer) { _shipyard = shipyard; _laboratory = laboratory; _industrialComplex = industrialComplex; _commandCenter = commandCenter; _synchronizer = synchronizer; _mothershipService = mothershipService; _motherJumpService = motherJumpService; _gameUserService = gameUserService; _storeService = storeService; _detailPlanetService = detailPlanetService; _localizer = localizer; }
public TestController(IUserSessionService userSessionService, IKernel kernel) : base(userSessionService) { #region b1 try { _commandCenter = kernel.Get <ICommandCenter>(); _injectMessages.Add("ICommandCenter", _commandCenter.Test()); } catch (Exception e) { _injectMessages.Add("exeption ICommandCenter", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _gameUserService = kernel.Get <IGameUserService>(); _injectMessages.Add("IGameUserService", _gameUserService.Test()); } catch (Exception e) { _injectMessages.Add("exeption IUserChestHelper", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } #endregion #region b2 try { _gDetailPlanetService = kernel.Get <IGDetailPlanetService>(); _injectMessages.Add("IGDetailPlanetService", _gDetailPlanetService.Test()); } catch (Exception e) { _injectMessages.Add("exeption IGDetailPlanetService", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _industrialComplex = kernel.Get <IIndustrialComplex>(); _injectMessages.Add("IIndustrialComplex", _industrialComplex.Test()); } catch (Exception e) { _injectMessages.Add("exeption IIndustrialComplex", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _motherFactory = kernel.Get <IMotherFactory>(); _injectMessages.Add("IMotherFactory", _motherFactory.Test()); } catch (Exception e) { _injectMessages.Add("exeption IMotherFactory", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _mothershipService = kernel.Get <IMothershipService>(); _injectMessages.Add("IMothershipService", _mothershipService.Test()); } catch (Exception e) { _injectMessages.Add("exeption IMothershipService", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } #endregion #region b3 try { _planetFactory = kernel.Get <IPlanetFactory>(); _injectMessages.Add("IPlanetFactory", _planetFactory.Test()); } catch (Exception e) { _injectMessages.Add("exeption IPlanetFactory", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _shipyard = kernel.Get <IShipyard>(); _injectMessages.Add("IShipyard", _shipyard.Test()); } catch (Exception e) { _injectMessages.Add("exeption IShipyard", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _storage = kernel.Get <IStorage>(); _injectMessages.Add("IStorage", _storage.Test()); } catch (Exception e) { _injectMessages.Add("exeption IStorage", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } #endregion #region b4 try { _storageResourcesService = kernel.Get <IStorageResourcesService>(); _injectMessages.Add("IStorageResourcesService", _storageResourcesService.Test()); } catch (Exception e) { _injectMessages.Add("exeption IStorageResourcesService", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _synchronizer = kernel.Get <ISynchronizer>(); _injectMessages.Add("ISynchronizer", _synchronizer.Test()); } catch (Exception e) { _injectMessages.Add("exeption ISynchronizer", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _gSectorsService = kernel.Get <IGSectorsService>(); _injectMessages.Add("IGSectorsService", _gSectorsService.Test()); } catch (Exception e) { _injectMessages.Add("exeption IGSectorsService", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _systemService = kernel.Get <ISystemService>(); _injectMessages.Add("ISystemService", _systemService.Test()); } catch (Exception e) { _injectMessages.Add("exeption ISystemService", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } #endregion #region b5 try { _mapAdressService = kernel.Get <IMapAdressService>(); _injectMessages.Add("IMapAdressService", _mapAdressService.Test()); } catch (Exception e) { _injectMessages.Add("exeption IMapAdressService", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } #endregion #region b6 try { _npcInitializer = kernel.Get <INpcInitializer>(); _injectMessages.Add("INpcInitializer", _npcInitializer.Test()); } catch (Exception e) { _injectMessages.Add("exeption INpcInitializer", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _mapGInitializer = kernel.Get <IMapGInitializer>(); _injectMessages.Add("IMapGInitializer", _mapGInitializer.Test()); } catch (Exception e) { _injectMessages.Add("exeption IMapGInitializer", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _mainInitializer = kernel.Get <IMainInitializer>(); _injectMessages.Add("IMainInitializer", _mainInitializer.Test()); } catch (Exception e) { _injectMessages.Add("exeption IMainInitializer", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } #endregion #region b7 try { _authUsersInitializer = kernel.Get <IAuthUsersInitializer>(); _injectMessages.Add("IAuthUsersInitializer", _authUsersInitializer.Test()); } catch (Exception e) { _injectMessages.Add("exeption IAuthUsersInitializer", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } try { _allianceService = kernel.Get <IAllianceService>(); _injectMessages.Add("IAllianceService", _allianceService.Test()); } catch (Exception e) { _injectMessages.Add("exeption IAllianceService", e.Message); throw new Exception(_injectMessages.ToSerealizeString()); } #endregion }
public GameController(IServiceProvider serviceProvider, IGameUserService gameUserService, UserManager <ApplicationUser> userManager) : base(serviceProvider) { _gameUserService = gameUserService; _userManager = userManager; _gameRunner = _svp.GetService <IGameRunner>(); }
public List <UserRattingItem> RatingGetNextPage(IDbConnection connection, IGameUserService gu, int skip) { var users = gu.GetTopPvpUsers(connection, skip, TabUserRating.PER_PAGE); return(TabUserRating.CreateUserList(users, skip)); }
public IAllianceRatingOut SetAllianceRating(IDbConnection connection, AllianceDataModel allianceDataModel, bool setButtons, IGameUserService gameUserService) { var alliance = new AllianceRatingOut(allianceDataModel); alliance.Pilots = _aUserCache.LocalOperation(connection, col => { return(col.Count(i => i.AllianceId == allianceDataModel.Id)); }); alliance.ControlledPlanet = _planetDetailCache.LocalOperation(connection, col => { return(col.Count(i => i.AllianceId == allianceDataModel.Id)); }); alliance.LeaderImg = gameUserService.GetUserAvatar(connection, allianceDataModel.CreatorId); if (setButtons) { alliance.SetComplexButtonView(); } return(alliance); }
public MainGameHub(IServiceProvider svp) { #region Main _svp = svp; _hubCache = _svp.GetService <IMainGameHubLocalStorageCache>(); #endregion #region Main User _gameUserService = _svp.GetService <IGameUserService>(); _allianceService = _svp.GetService <IAllianceService>(); _channelService = (ChannelService)_svp.GetService <IChannelService>(); _mothershipService = _svp.GetService <IMothershipService>(); _motherJumpService = _svp.GetService <IUMotherJumpService>(); _storeService = _svp.GetService <IStoreService>(); #endregion #region World _gameTypeService = _svp.GetService <IGameTypeService>(); _gGeometryPlanetService = _svp.GetService <IGGeometryPlanetService>(); _gDetailPlanetService = _svp.GetService <IGDetailPlanetService>(); _gSectorsService = _svp.GetService <IGSectorsService>(); _mapInfoService = _svp.GetService <IMapInfoService>(); _systemService = _svp.GetService <ISystemService>(); _worldService = _svp.GetService <IWorldService>(); _gUserBookmarkService = (GUserBookmarkService)_svp.GetService <IGUserBookmarkService>(); #endregion #region builds //collections _commandCenter = _svp.GetService <ICommandCenter>(); _industrialComplex = _svp.GetService <IIndustrialComplex>(); _laboratory = _svp.GetService <ILaboratory>(); _shipyard = _svp.GetService <IShipyard>(); //items _energyConverter = _svp.GetService <IEnergyConverter>(); _extractionModule = _svp.GetService <IExtractionModule>(); _extractionModule = _svp.GetService <IExtractionModule>(); _spaceShipyard = _svp.GetService <ISpaceShipyard>(); _storage = _svp.GetService <IStorage>(); _turels = _svp.GetService <ITurels>(); //common _unit = _svp.GetService <IUnit>(); _storageResources = _svp.GetService <IStorageResourcesService>(); _transferResourceService = _svp.GetService <ITransferResourceService>(); #endregion #region Global User _estateOwnService = _svp.GetService <IEstateOwnService>(); _synchronizer = _svp.GetService <ISynchronizer>(); _estateListService = _svp.GetService <IEstateListService>(); _journalOutService = _svp.GetService <IJournalOutService>(); _gameRunner = _svp.GetService <IGameRunner>(); _dbProvider = _svp.GetService <IDbProvider>(); #endregion #region Confederation _confederationService = _svp.GetService <IConfederationService>(); #endregion }
private AllianceMembers _getAllianceMembers(IDbConnection connection, int userId, int userAllianceId, IGameUserService gameUserService) { var allianceMembers = new AllianceMembers(); var allianceUsers = GetAllianceUsers(connection, userAllianceId); var members = new List <AllianceMember>(); foreach (var a in allianceUsers) { var user = gameUserService.GetGameUser(connection, a.UserId); var member = new AllianceMember { AllianceUserId = a.Id, UserId = a.UserId, UserName = user.Nickname, OnlineStatus = user.IsOnline, UserPvp = user.PvpPoint, Role = new AllianceRole(a.RoleId) }; members.Add(member); } allianceMembers.CurrentUserRoleName = members.Where(i => i.UserId == userId).Select(i => i.Role.RoleName).First(); allianceMembers.Members = members; allianceMembers.SetComplexButtonView(); return(allianceMembers); }
public IPlanshetViewData Initial(IDbConnection connection, AllianceUserDataModel currentAllianceUser, IGameUserService profileService) { var userId = currentAllianceUser.UserId; var allianceId = currentAllianceUser.AllianceId; var allianses = GetAlliancesByRating(connection, i => i); var allianceRattings = new List <IAllianceRatingOut>(); foreach (var i in allianses) { allianceRattings.Add(SetAllianceRating(connection, i, true, profileService)); } var dataSerch = new TabAllianceSerchOut { Collection = allianceRattings }; dataSerch.AddAlianceButtons(allianceId); var userAlliance = _getMyAllianceFromRattingTab(connection, dataSerch.Collection, userId, allianceId, profileService); var role = AllianceRoleHelper.GetByRoleId(currentAllianceUser.RoleId); userAlliance.AllianceTechesOut = GetAllianceTechesOut(connection, userAlliance.Id, role); var manageAlliance = _getManageTab(connection, currentAllianceUser, role); var tabs = AllianceOut.InitialTabs(dataSerch, userAlliance, manageAlliance, _localizer); return(tabs); }
private TabMyAllianceOut _getMyAllianceFromRattingTab(IDbConnection connection, IEnumerable <IAllianceRatingOut> alliances, int userId, int userAllianceId, IGameUserService gameUserService) { var ma = alliances.FirstOrDefault(i => i.Id == userAllianceId) ?? SetAllianceRating(connection, GetAllianceById(connection, userAllianceId, i => i), true, gameUserService); if (ma == null) { throw new ArgumentNullException(nameof(ma), Error.AllianceNotExist); } var myAlliance = new TabMyAllianceOut((AllianceRatingOut)ma); //ma.ShallowConvert(myAlliance); myAlliance.AddButtons(userAllianceId, 1); myAlliance.AllianceMembers = _getAllianceMembers(connection, userId, userAllianceId, gameUserService); if (userAllianceId == (int)NpcAllianceId.Confederation) { myAlliance.AllianceUserRequests = GetRequestsAllianceForMyAlliance(connection, userId); } return(myAlliance); }
public AccountController(IGameUserService gameUserService, UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager) { this.gameUserService = gameUserService; this.userManager = userManager; this.signInManager = signInManager; }
public UserApiController(IServiceProvider serviceProvider) : base(serviceProvider) { _gameUserService = serviceProvider.GetService <IGameUserService>(); _storeService = serviceProvider.GetService <IStoreService>(); }
public AuthAuthUsersInitializer(IGameUserService gameUserService, IAuthDbInitializer dbInitializer) { _gameUserService = gameUserService; _dbInitializer = dbInitializer; }
public IndustrialComplex(IMothershipService mothershipService, IGDetailPlanetService gDetailPlanetService, ISynchronizer synchronizer, IStoreService storeService, IGameUserService gameUserService, IUMotherJumpService motherJumpService, IStorage storage, IExtractionModule extractionModule, IEnergyConverter energyConverter) : base( mothershipService, gDetailPlanetService, synchronizer, storeService, gameUserService, motherJumpService) { _storage = storage; _extractionModule = extractionModule; _energyConverter = energyConverter; }
internal static UserDataModel GetGameUser(this ConnectionUser connectionUser, IDbConnection connection, IGameUserService gameUserService) { return(gameUserService.GetGameUser(connection, connectionUser.UserId)); }
public IPlanshetViewData InitialPlanshetConfederation(IDbConnection connection, IGameUserService gu) { _checkAndRunVoteState(connection, 0, false); var officerOut = GetOfficers(connection, true); TabOfficer tabOficers = null; TabElection tabElection = null; if (officerOut != null) { tabOficers = new TabOfficer(officerOut); tabElection = GetTabElection(connection, true); } else { // нет инициализации нет голосования нет офицеров tabOficers = new TabOfficer(); tabElection = new TabElection(false, new List <CandidatOut>(), 0); tabElection.SetTimes(StartRegistrationTime, StartVoteTime, EndVoteTime); } var users = gu.GetTopPvpUsers(connection, 0, TabUserRating.PER_PAGE); var rating = new TabUserRating(users, 0); return(ConfederationPlanshetOut.InitialTabs(tabOficers, rating, tabElection, _svp.GetService <ILocalizerService>())); }