forked from SoDOff-Project/sodoff
revert rank up message due to buggy achievement store
This commit is contained in:
parent
feb0291dc6
commit
3cde6f07ae
@ -121,11 +121,6 @@ public class ProfileController : Controller {
|
||||
|
||||
if (achievementPoints != null) { playerxp = achievementPoints.Value; pointType = (AchievementPointTypes)achievementPoints.Type; }
|
||||
|
||||
int rank = 0;
|
||||
rank = achievementStore.GetRankFromXP(playerxp, pointType);
|
||||
|
||||
if (viking.GameVersion >= ClientVersion.WoJS) rank += 1; // keep sod compatibility
|
||||
|
||||
// Build the AvatarDisplayData
|
||||
AvatarDisplayData avatar = new AvatarDisplayData {
|
||||
AvatarData = avatarData,
|
||||
@ -154,7 +149,7 @@ public class ProfileController : Controller {
|
||||
SubscriptionID = -3, // placeholder
|
||||
IsActive = true, // placeholder
|
||||
},
|
||||
RankID = rank,
|
||||
RankID = 0,
|
||||
AchievementInfo = null, // placeholder
|
||||
Achievements = new UserAchievementInfo[] {
|
||||
achievementService.CreateUserAchievementInfo(viking, AchievementPointTypes.PlayerXP),
|
||||
|
@ -107,18 +107,6 @@ namespace sodoff.Services {
|
||||
Amount = value
|
||||
};
|
||||
|
||||
if(viking.GameVersion <= ClientVersion.WoJS && xpPoints.Type == (int)AchievementPointTypes.PlayerXP)
|
||||
{
|
||||
int initialRank = achievementStore.GetRankFromXP(initialPoints, AchievementPointTypes.PlayerXP);
|
||||
int newRank = achievementStore.GetRankFromXP(xpPoints.Value, AchievementPointTypes.PlayerXP);
|
||||
// wojs shows level up screen when a message of type rank is posted to their message board
|
||||
if(newRank > initialRank)
|
||||
{
|
||||
// player leveled up, post message
|
||||
messagingService.AddMessageToViking(null, viking, MessageType.Data, MessageTypeID.Rank, MessageLevel.WhiteList, "[[Line3]]=[[Congratulations Jumpee, You Leveled Up!]][[Prefab]]=[[RS_DATA/PfLevelUpRoom.unity3d/PfLevelUpRoom]]", "[[Line3]]=[[Congratulations Jumpee, You Leveled Up!]][[Prefab]]=[[RS_DATA/PfLevelUpRoom.unity3d/PfLevelUpRoom]]", "[[Line3]]=[[Congratulations Jumpee, You Leveled Up!]][[Prefab]]=[[RS_DATA/PfLevelUpRoom.unity3d/PfLevelUpRoom]]", isPrivate: true);
|
||||
}
|
||||
}
|
||||
|
||||
return achievementReward;
|
||||
}
|
||||
return null;
|
||||
|
@ -61,8 +61,7 @@ namespace sodoff.Services {
|
||||
}
|
||||
|
||||
public int GetRankFromXP(int? xpPoints, AchievementPointTypes type) {
|
||||
if (xpPoints <= 20) return ranks[type].Count(r => r.Value <= xpPoints);
|
||||
else return ranks[type].Count(r => r.Value <= xpPoints) - 1; // i've given up
|
||||
return ranks[type].Count(r => r.Value <= xpPoints);
|
||||
}
|
||||
|
||||
public AchievementReward[]? GetAchievementRewardsById(int achievementID) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user