public async Task StartGameAsync(int gameId) { using (var adminService = new AdminServiceClient(new BasicHttpBinding(), new EndpointAddress(ConnectionData.Url))) { int sequenceNumber = SequenceNumber; var getGameDetailsReq = new StartGameReq { Auth = new ReqAuth { ClientName = ConnectionData.Username, TeamName = ConnectionData.TeamName, SessionId = _sessionId, SequenceNumber = sequenceNumber, AuthCode = GetAuthCode(string.Format("{0}:{1}:{2}:{3}{4}", ConnectionData.TeamName, ConnectionData.Username, _sessionId, sequenceNumber, ConnectionData.Password)), }, GameId = gameId, }; _stopwatch.Start(); var getGameDetailsResp = await adminService.StartGameAsync(getGameDetailsReq); _stopwatch.Stop(); LastCallTime = _stopwatch.ElapsedMilliseconds; _stopwatch.Reset(); if (getGameDetailsResp.Status != "OK") { throw new Exception(getGameDetailsResp.Message); } } }
private void StartGameImpl(StartGameReq req, StartGameResp resp) { Server.GameManager.StartGame(req.GameId, Server.TeamRegistry.GetTeam(req.Auth.TeamName)); }
public StartGameResp StartGame(StartGameReq req) { return(HandleServiceCall(req, new StartGameResp(), StartGameImpl)); }