예제 #1
0
        private void HandleClientCreateGame(ClientCreateGameSessionMessage message)
        {
            var clientToCreateSession = _clientManager.GetClientById(message.ClientId);

            if (clientToCreateSession == null)
            {
                return;
            }

            var startParameters = new GameSessionStartParameters
            {
                MatchTime      = message.MatchTime,
                MatchesToWin   = message.MatchesToWin,
                SessionName    = message.GameName,
                LevelAssetPath = "levels/Rookie.xml"
            };

            if (!_sessionPool.ActivateSession(clientToCreateSession, startParameters))
            {
                Tracer.PrintWarning(string.Format("Could not create Session for client {0}.", message.ClientId));
            }
        }