예제 #1
0
        async Task IPlayerGrain.GameServerStarts(GameServerStartParams gameServerStartParams)
        {
            this.State.CurrentGame = gameServerStartParams;

            await this.State.WriteStateAsync();

            this.subscribers.Notify(_ => _.GameServerStarts(gameServerStartParams));
        }
예제 #2
0
        public static async Task <GameServerStartParams> GetAsync(ClientID clientId)
        {
            GameServerStartParams startParams = null;
            var gamer = await Gamer.ConstructorAsync(clientId, server => { startParams = server; });

            while (startParams == null)
            {
                await Task.Delay(TimeSpan.FromMilliseconds(50));
            }

            return(startParams);
        }
        async Task <GameServerStartParams> LaunchGameServerProcessAsync()
        {
            // start game server process here
            var gameServerParams = new GameServerStartParams
            {
                GameServerID = new GameServerID {
                    ID = this.GetPrimaryKey()
                }
            };

            gameServerParams.GameServerID.ID = Guid.Parse("9c02e618-bc51-4c41-ae8d-f6d0d2a913c8"); // TODO DELETE THIS LINE


            Trace.TraceInformation(string.Format("Create game server process for GameID {0}", gameServerParams.GameServerID));

            return(gameServerParams);
        }
예제 #4
0
 void IPlayerObserver.GameServerStarts(GameServerStartParams gameServerStartParams)
 {
     this.OnGameServerStarted(gameServerStartParams);
 }