private string getTokenForReason(ReportUserReason reason) { if (reasonsToTokens.ContainsKey((int)reason)) { return(reasonsToTokens[(int)reason]); } Log.LogErrorFormatted(this, "Did not find a token for reason {0}", reason); return(null); }
public string GetTextForReason(ReportUserReason reason) { string tokenForReason = getTokenForReason(reason); if (!string.IsNullOrEmpty(tokenForReason)) { return(Service.Get <Localizer>().GetTokenTranslation(tokenForReason)); } return(null); }
public void OnCategoryButtonClicked(ReportUserReason reason) { this.reason = reason; Tweener.Open(); Localizer localizer = Service.Get <Localizer>(); string tokenForReason = getTokenForReason(reason); ReasonText.text = localizer.GetTokenTranslationFormatted("GlobalUI.ReportingBans.ReasonText", tokenForReason); ConfirmationText.text = localizer.GetTokenTranslation("GlobalUI.ReportingBans.ConfirmDescriptionText"); }
public void ReportUser(IFriend user, ReportUserReason reportUserReason, Action <IReportUserResult> callback) { string userId = null; IInternalFriend internalFriend = friends.FirstOrDefault((IInternalFriend f) => f.Id == user.Id); if (internalFriend != null) { userId = internalFriend.Swid; } ReportUser(userId, reportUserReason, callback); }
private void ReportUser(string userId, ReportUserReason reportUserReason, Action <IReportUserResult> callback) { if (userId == null) { logger.Critical("Can not report this user as we do not know their ID!"); callback(new ReportUserResult(success: false)); return; } UserReporter.Report(logger, mixWebCallFactory, userId, reportUserReason, delegate { callback(new ReportUserResult(success: true)); }, delegate { callback(new ReportUserResult(success: false)); }); }
public void ReportUser(IFriend user, ReportUserReason reason, Action <IReportUserResult> callback) { throw new NotImplementedException(); }
public static void Report(AbstractLogger logger, IMixWebCallFactory mixWebCallFactory, string userId, ReportUserReason reason, Action successCallback, Action failureCallback) { try { ReportPlayerRequest reportPlayerRequest = new ReportPlayerRequest(); reportPlayerRequest.ReportedUserId = userId; reportPlayerRequest.Reason = reason.ToString(); ReportPlayerRequest request = reportPlayerRequest; IWebCall <ReportPlayerRequest, BaseResponse> webCall = mixWebCallFactory.ModerationReportPlayerPut(request); webCall.OnResponse += delegate { successCallback(); }; webCall.OnError += delegate { failureCallback(); }; webCall.Execute(); } catch (Exception ex) { logger.Critical("Unhandled exception: " + ex); failureCallback(); } }