private void HostStarting(IHost host) { host.AddSceneTemplate(GAMEFINDER_TEMPLATE, (ISceneHost scene) => { scene.AddGameFinder(new Stormancer.Server.GameFinder.GameFinderConfig("default", builder => { builder.Register <SampleGameFindingResolver>().As <IGameFinderResolver>().InstancePerRequest(); builder.Register <SampleGameFinder>().As <IGameFinder>(); builder.Register <SampleGameFinderDataExtractor>().As <IGameFinderDataExtractor>(); })); }); host.AddSceneTemplate(GAMESESSION_TEMPLATE, (ISceneHost scene) => { scene.AddGameSession(); }); }
private void OnHostStarting(IHost host) { host.AddSceneTemplate("matchmaker", scene => { scene.AddProcedure("match.find",async ctx => { var managementClientFactory = scene.DependencyResolver.Resolve<Management.ManagementClientAccessor>(); var client = await managementClientFactory.GetApplicationClient(); var playersInfo = ctx.RemotePeer.GetUserData<PlayerInfos>(); // var isPlayer = ctx.ReadObject<bool>(); var token = await client.CreateConnectionToken(Constants.GAME_NAME, playersInfo); ctx.SendValue(new FindMatchResult { Token = token }); }); }); }
private void HostStarted(IHost host) { host.AddSceneTemplate("matchmaker-template", matchmakingScene => { if (_matchmakingService == null) { throw new InvalidOperationException("There may only be one matchamking scene."); } _matchmakingService = _factory.CreateMatchmakingService(); _matchmakingService.Init(matchmakingScene); matchmakingScene.AddProcedure("matchmaking.request", _matchmakingService.FindMatch); }); }
private void HostStarting(IHost host) { host.AddSceneTemplate("authenticator", AuthenticatorSceneFactory); }
private void HostStarting(IHost host) { host.AddSceneTemplate("authenticator", AuthenticatorSceneFactory); host.DependencyResolver.Register<UserManagementConfig>(_config); host.DependencyResolver.Register<IUserService, UserService>(); }
private void HostStarting(IHost host) { host.AddSceneTemplate("locator", scene => { scene.AddLocator(); }); }
private void HostStarting(IHost host) { host.AddSceneTemplate(SCENE_TEMPLATE, AuthenticatorSceneFactory); }