コード例 #1
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplication server,
                              IShamanLogger logger, IMatchMaker matchMaker, IServerActualizer serverActualizer, IMatchMakerServerInfoProvider serverInfoProvider, IBundleLoader bundleLoader)
        {
            serverActualizer.Start(Convert.ToInt32(Configuration["LauncherSettings:ActualizationIntervalMs"]));

            base.ConfigureMm(app, env, server, logger, matchMaker, serverInfoProvider, bundleLoader);
        }
コード例 #2
0
 internal MainServiceImpl(PlayerAuth auth, IDB db, SingleThreadScheduler in_memory_worker, IMatchMaker match_maker)
 {
     this.db               = db;
     this.auth             = auth;
     this.in_memory_worker = in_memory_worker;
     this.match_maker      = match_maker;
 }
コード例 #3
0
        public MmApplication(
            IShamanLogger logger,
            IApplicationConfig config,
            ISerializer serializer,
            ISocketFactory socketFactory,
            IMatchMaker matchMaker,
            IRequestSender requestSender,
            ITaskSchedulerFactory taskSchedulerFactory,
            IPacketSender packetSender,
            IShamanMessageSenderFactory messageSenderFactory,
            IMatchMakerServerInfoProvider serverProvider,
            IRoomManager roomManager, IMatchMakingGroupsManager matchMakingGroupManager, IPlayersManager playersManager, IMmMetrics mmMetrics, IProtectionManager protectionManager) : base(logger, config, serializer,
                                                                                                                                                                                            socketFactory, taskSchedulerFactory, requestSender, mmMetrics, protectionManager)
        {
            _packetSender            = packetSender;
            _messageSenderFactory    = messageSenderFactory;
            _serverProvider          = serverProvider;
            _roomManager             = roomManager;
            _matchMakingGroupManager = matchMakingGroupManager;
            _playersManager          = playersManager;
            _matchMaker = matchMaker;
            _id         = Guid.NewGuid();

            Logger?.Debug($"MmApplication constructor called. Id = {_id}");
        }
コード例 #4
0
        internal void TryCreateArenaForPlayersAsync(IMatchMaker match_maker, List <Player> buffer)
        {
            if (is_disposing())
            {
                return;
            }

            Task.Run(async() =>
            {
                var attempt = new CreateArenaAttempt();
                foreach (var player in buffer)
                {
                    attempt.PlayerInfo.Add(new ArenaServer.PlayerInfo
                    {
                        AuthToken = GuidOps.ToByteString(Guid.NewGuid()),
                        BasicInfo = player.BasicPlayerInfo()
                    });
                }

                foreach (var arena in hosts)
                {
                    if (await arena.TryCreateArenaForPlayers(buffer, attempt))
                    {
                        return;
                    }
                }

                match_maker.AddPlayers(buffer);
            });
        }
コード例 #5
0
        public GameSimulationManager(IMatchMaker matchMaker, IGameSimulation gameSimulation)
        {
            Contract.Assert(matchMaker != null, "matchMaker!=null");
            Contract.Assert(gameSimulation != null, "gameSimulation!=null");

            _matchMaker     = matchMaker;
            _gameSimulation = gameSimulation;
        }
コード例 #6
0
 public SecretSantaManager(
     IContactRepository contactsRepo,
     IMatchMaker <Contact> matchMaker,
     ISecretSantaNotifier <Contact> notifier)
 {
     this.contactsRepo = contactsRepo;
     this.matchMaker   = matchMaker;
     this.notifier     = notifier;
 }
コード例 #7
0
 public void Initialize(IMatchMaker matchMaker, IShamanMessageSender packetSender, IRoomManager roomManager, IMatchMakingGroupsManager matchMakingGroupsManager,
                        string authSecret)
 {
     _matchMaker               = matchMaker;
     _messageSender            = packetSender;
     _authSecret               = authSecret;
     _roomManager              = roomManager;
     _matchMakingGroupsManager = matchMakingGroupsManager;
 }
コード例 #8
0
 public MasterHub(IMasterRepo masterRepo, ILobbyManager lobbyManager,
                  ISessionRepo sessionRepo, IRoomManager roomManager, IMatchMaker matchMaker,
                  ILogger <MasterHub> logger)
 {
     _masterRepo   = masterRepo;
     _lobbyManager = lobbyManager;
     _sessionRepo  = sessionRepo;
     _roomManager  = roomManager;
     _matchMaker   = matchMaker;
     _logger       = logger;
 }
コード例 #9
0
ファイル: PlayerGrain.cs プロジェクト: kimsama/orleans.demo
        public async Task <Guid> QuickMatch()
        {
            // Find an available room first
            IMatchMaker match  = GrainFactory.GetGrain <IMatchMaker>(0);
            Guid        roomId = await match.QuickMatch(this.GetPrimaryKeyLong());

            IGameRoom room = GrainFactory.GetGrain <IGameRoom>(roomId);
            await room.Subscribe(this);

            return(roomId);
        }
コード例 #10
0
        /// <summary>
        /// MM related middleware configuration
        /// </summary>
        /// <param name="app"></param>
        /// <param name="env"></param>
        /// <param name="server"></param>
        /// <param name="logger"></param>
        /// <param name="matchMaker"></param>
        /// <param name="serverInfoProvider"></param>
        /// <param name="bundleLoader"></param>
        public void ConfigureMm(IApplicationBuilder app, IHostingEnvironment env, IApplication server,
                                IShamanLogger logger, IMatchMaker matchMaker, IMatchMakerServerInfoProvider serverInfoProvider, IBundleLoader bundleLoader)
        {
            //load bundle
            bundleLoader.LoadBundle().Wait();

            //resolve main bundle type and configure it
            //in case of matchmaker we can load bundle during this stage
            var resolver = bundleLoader.LoadTypeFromBundle <IMmResolver>();

            RoomPropertiesProvider.RoomPropertiesProviderImplementation = resolver.GetRoomPropertiesProvider();
            resolver.Configure(matchMaker);

            //start game server info provider - gathers info about game servers connected to this matchmaker
            serverInfoProvider.Start();

            base.ConfigureCommon(app, env, server, logger);
        }
コード例 #11
0
 public TournamentController(IMatchMaker matchMaker)
 {
     _matchMaker = matchMaker;
     Config      = TournamentConfiguration.Default;
 }
コード例 #12
0
 public MatchSimulator(IMatchMaker matchMaker, TimeSimulatorTickInfo tickInfo)
 {
     _matchMaker = matchMaker;
     _tickInfo   = tickInfo;
 }
コード例 #13
0
 public void PerTestSetup()
 {
     _matchMaker = Substitute.For <IMatchMaker>();
     _tournament = new TournamentController(_matchMaker);
 }
コード例 #14
0
 public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplication server,
                       IShamanLogger logger, IMatchMaker matchMaker, IMatchMakerServerInfoProvider serverInfoProvider, IBundleLoader bundleLoader)
 {
     base.ConfigureMm(app, env, server, logger, matchMaker, serverInfoProvider, bundleLoader);
 }