Example #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 });
     }
 }