예제 #1
0
파일: ChatClient.cs 프로젝트: Buzigi/Chat
        public async static Task <Guid?> RespondToGameRequest(string userName, string contact, bool isAccepted)
        {
            try
            {
                Guid?gameId = null;
                await Task.Run(new Action(() => { gameId = proxy.AcceptGame(userName, contact, isAccepted);

                                                  if (isAccepted)
                                                  {
                                                      Report.log(DeviceToReport.Client_Proxy, LogLevel.Information, $"Game {gameId} was accepted");
                                                  }
                                                  else
                                                  {
                                                      Report.log(DeviceToReport.Client_Proxy, LogLevel.Information, $"Game {gameId} was not accepted");
                                                  } }));

                return(gameId);
            }
            catch (Exception e)
            {
                Report.log(DeviceToReport.Client_Proxy, LogLevel.Exception, $"Game was not opened");
                Report.log(DeviceToReport.Client_Proxy, LogLevel.Exception, e.Message);
                return(null);
            }
        }