Beispiel #1
0
 public virtual void DegradeParticipant(LadderParticipant participant, LadderDegradation degrade, int lastRank)
 {
     LadderDefinition ladderDefinition = participant.LadderInstance.LadderDefinition;
     int num = participant.Rank + degrade.DegradeAmount;
     if (num > lastRank)
     {
         num = lastRank;
     }
     else if (num <= 0)
     {
         GPG.Multiplayer.LadderService.LadderService.Error("An error occured determining degraded rank for participant {0} on ladder {1}", new object[] { participant.EntityID, participant.LadderInstanceID });
         return;
     }
     if (!new QuazalQuery("AdjustLadderParticipantTemp", new object[] { participant.LadderInstanceID, participant.EntityID }).ExecuteNonQuery())
     {
         GPG.Multiplayer.LadderService.LadderService.Error("An error occured on step 1 while degrading rank to {0} for participant {1} on ladder {2}", new object[] { num, participant.EntityID, participant.LadderInstanceID });
     }
     else if (!new QuazalQuery("DecrementLadderBetween", new object[] { participant.LadderInstanceID, participant.Rank, num }).ExecuteNonQuery())
     {
         GPG.Multiplayer.LadderService.LadderService.Error("An error occured on step 2 while degrading rank to {0} for participant {1} on ladder {2}", new object[] { num, participant.EntityID, participant.LadderInstanceID });
     }
     else if (!new QuazalQuery("AdjustLadderParticipant", new object[] { num, participant.LadderInstanceID, participant.EntityID }).ExecuteNonQuery())
     {
         GPG.Multiplayer.LadderService.LadderService.Error("An error occured on step 3 while degrading rank to {0} for participant {1} on ladder {2}", new object[] { num, participant.EntityID, participant.LadderInstanceID });
     }
     else
     {
         string str = string.Format("{0}(rank {1}) has sat idle on ladder: {2} for {3} days or longer. Per ladder rules, {0} is being degraded on the ladder by {4} positions moving from rank {1} to rank {5}.", new object[] { participant.EntityName, participant.Rank, participant.LadderInstance.Description, degrade.DegradeDayInterval, degrade.DegradeAmount, num });
         if (!new QuazalQuery("CreateLadderGameResult", new object[] { participant.EntityID, "NULL", "NULL", participant.LadderInstanceID, str, participant.Rank, num, DateTime.UtcNow }).ExecuteNonQuery())
         {
             GPG.Multiplayer.LadderService.LadderService.Error("Failed to record degrade audit record for player: {0}(rank {1})", new object[] { participant.EntityName, participant.Rank });
         }
     }
 }
 public override void DegradeParticipant(LadderParticipant participant, LadderDegradation degrade, int lastRank)
 {
     GPG.Multiplayer.LadderService.LadderService.Status("Degrading entity {0}({1}) with SuicideLadderReportResolver", new object[] { participant.EntityName, participant.Rank });
     base.DegradeParticipant(participant, degrade, lastRank);
     if (!new QuazalQuery("LeaveLadder", new object[] { participant.EntityID, participant.LadderInstanceID }).ExecuteNonQuery())
     {
         GPG.Multiplayer.LadderService.LadderService.Error("Failed to flag degraded participant: {0} on suicide ladder {1} for removal", new object[] { participant.EntityName, participant.LadderInstanceID });
     }
     if (!new QuazalQuery("RemoveFromSuicideLadder", new object[] { participant.EntityID, DateTime.UtcNow }).ExecuteNonQuery())
     {
         GPG.Multiplayer.LadderService.LadderService.Error("Failed to flag participant: {0} as removed from suicide ladder: {1}", new object[] { participant.EntityName, participant.LadderInstanceID });
     }
 }
 public DlgLadderHistory(LadderParticipant participant, bool showCommentTab)
 {
     this.InitializeComponent();
     this.mParticipant = participant;
     this.Text = string.Format(Loc.Get("<LOC>{0} - Ladder Activity History"), this.Participant.EntityName);
     LadderGameResult[] resultArray = new QuazalQuery("GetLadderParticipantHistory", new object[] { this.Participant.LadderInstanceID, this.Participant.EntityID }).GetObjects<LadderGameResult>().ToArray();
     this.gpgDataGridHistory.DataSource = resultArray;
     this.gvLadder.RefreshData();
     LadderParticipantComment[] commentArray = new QuazalQuery("GetLadderParticipantComments", new object[] { this.Participant.EntityID }).GetObjects<LadderParticipantComment>().ToArray();
     this.dataGridComments.DataSource = commentArray;
     this.gvComments.RefreshData();
     if (showCommentTab)
     {
         this.btnCommentsTab_Click(null, null);
     }
 }
Beispiel #4
0
 public FrmLadderView(LadderInstance ladder)
 {
     EventHandler handler = null;
     VGen0 method = null;
     this.components = null;
     this.mLadder = null;
     this.IsLadderParticipant = false;
     this.IsJoinPending = false;
     this.IsLeavePending = false;
     this.IsViewingChallengers = false;
     this.mSelectedParticipant = null;
     this.mCurrentPage = 0;
     this.mLastRating = -1;
     this.mCurrentDataSet = null;
     this.ToolstripSizeChanged = false;
     this.mCustomPaint = new List<ToolStripItem>();
     this.mLadder = ladder;
     this.InitializeComponent();
     base.MainForm.LadderGamePlayed += new EventHandler(this.MainForm_LadderGamePlayed);
     this.gpgLabelDates.Text = string.Format("{0} - {1}", this.Ladder.StartDate.ToShortDateString(), this.Ladder.EndDate.ToShortDateString());
     this.backLabelTitle.Text = this.Ladder.Description;
     this.gpgLabelRules.Text = this.Ladder.LadderDefinition.RulesDescription;
     this.gpgLabelDescription.Text = string.Format("{0}. {1}", this.Ladder.LadderDefinition.Name, this.Ladder.LadderDefinition.Description);
     this.Text = string.Format("<LOC>Ladder View - {0}", this.Ladder.LadderDefinition.Name);
     string data = "<LOC>Individual Ladder";
     if (this.Ladder.LadderDefinition.IsTeam)
     {
         data = "<LOC>Team Ladder";
     }
     else if (this.Ladder.LadderDefinition.IsClan)
     {
         data = "<LOC>Clan Ladder";
     }
     if (!this.AcceptingChallenges)
     {
         this.btnToggleMyChallenges.Image = SkinManager.GetImage(@"Dialog\LadderView\decline_challenges.png");
         this.btnToggleMyChallenges.ToolTipText = Loc.Get("<LOC>Declining Challenges");
     }
     else
     {
         this.btnToggleMyChallenges.Image = SkinManager.GetImage(@"Dialog\LadderView\accept_challenges.png");
         this.btnToggleMyChallenges.ToolTipText = Loc.Get("<LOC>Accepting Challenges");
     }
     this.gpgLabelType.Text = Loc.Get(data);
     if (handler == null)
     {
         handler = delegate (object o, EventArgs e) {
             this.backLabelTitle.Refresh();
             this.ResizePageLinks();
         };
     }
     base.SizeChanged += handler;
     this.IsLadderParticipant = new QuazalQuery("IsLadderParticipant", new object[] { User.Current.ID, this.Ladder.ID }).GetBool();
     this.IsJoinPending = new QuazalQuery("IsLadderJoinPending", new object[] { User.Current.ID, this.Ladder.ID }).GetBool();
     this.IsLeavePending = new QuazalQuery("IsLadderRemovePending", new object[] { User.Current.ID, this.Ladder.ID }).GetBool();
     if ((!base.Disposing && !base.IsDisposed) && base.IsHandleCreated)
     {
         if (method == null)
         {
             method = delegate {
                 if (this.IsJoinPending)
                 {
                     this.btnJoinLeave.ToolTipText = Loc.Get("<LOC>Join Pending");
                 }
                 else if (this.IsLeavePending)
                 {
                     this.btnJoinLeave.ToolTipText = Loc.Get("<LOC>Leave Pending");
                 }
                 else if (this.IsLadderParticipant)
                 {
                     this.btnJoinLeave.ToolTipText = Loc.Get("<LOC>Leave This Ladder");
                     this.btnJoinLeave.Image = this.btnJoinLeave.Image;
                 }
                 else
                 {
                     this.btnJoinLeave.ToolTipText = Loc.Get("<LOC>Join This Ladder");
                     this.btnJoinLeave.Image = this.btnJoinLeave.Image;
                 }
                 this.RefreshToolstrip();
             };
         }
         base.BeginInvoke(method);
     }
     this.RefreshDataSynchronous();
 }
Beispiel #5
0
 private void gvLadder_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
 {
     int[] selectedRows = this.gvLadder.GetSelectedRows();
     if (selectedRows.Length > 0)
     {
         this.mSelectedParticipant = this.gvLadder.GetRow(this.gvLadder.GetRowHandle(selectedRows[0])) as LadderParticipant;
         this.RefreshToolstrip();
     }
     else
     {
         this.mSelectedParticipant = null;
         this.RefreshToolstrip();
     }
 }