mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-12 15:04:36 +01:00
Match behavior of official server (part 2)
This commit is contained in:
@@ -30,13 +30,6 @@ namespace EpinelPS.LobbyServer.ContentsOpen
|
||||
user.ContentsOpenUnlocked.Add(19, new(true, true));
|
||||
JsonDb.Save();
|
||||
}
|
||||
response.ContentsOpenUnlockInfoList.Add(new NetContentsOpenUnlockInfo()
|
||||
{
|
||||
ContentsOpenTableId = 3,
|
||||
IsUnlockButtonPlayed = true,
|
||||
IsUnlockPopupPlayed = true,
|
||||
});
|
||||
|
||||
|
||||
foreach (var item in user.ContentsOpenUnlocked)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace EpinelPS.LobbyServer
|
||||
|
||||
var response = new ResGetGachaData();
|
||||
|
||||
// TODO: should not return anything when not completed chatper 2
|
||||
|
||||
// Adding a default GachaType if the tutorial is done
|
||||
if (user.GachaTutorialPlayCount > 0)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,8 @@ namespace EpinelPS.LobbyServer.Stage
|
||||
{
|
||||
foreach (var stages in fields.Value.CompletedStages)
|
||||
{
|
||||
response.ClearedStageIds.Add(stages);
|
||||
if (req.StageIds.Contains(stages))
|
||||
response.ClearedStageIds.Add(stages);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,11 +54,25 @@ namespace EpinelPS.LobbyServer.Stage
|
||||
}
|
||||
}
|
||||
|
||||
var oldLevel = user.userPointData.UserLevel;
|
||||
|
||||
if (rewardData != null)
|
||||
response.StageClearReward = RewardUtils.RegisterRewardsForUser(user, rewardData);
|
||||
else
|
||||
Console.WriteLine("rewardId is null for stage " + StageId);
|
||||
response.Reward = response.StageClearReward;
|
||||
|
||||
response.ScenarioReward = new NetRewardData(){PassPoint = new()};
|
||||
if (user.userPointData.UserLevel != oldLevel)
|
||||
{
|
||||
response.UserLevelUpReward = new NetRewardData();
|
||||
response.UserLevelUpReward.Currency.Add(new NetCurrencyData()
|
||||
{
|
||||
Type = (int)CurrencyType.FreeCash,
|
||||
Value = 30 * (user.userPointData.UserLevel - oldLevel),
|
||||
FinalValue = user.GetCurrencyVal(CurrencyType.FreeCash)
|
||||
});
|
||||
}
|
||||
|
||||
if (clearedStage.stage_category == "Normal" || clearedStage.stage_category == "Boss" || clearedStage.stage_category == "Hard")
|
||||
{
|
||||
@@ -121,7 +135,7 @@ namespace EpinelPS.LobbyServer.Stage
|
||||
if (quest != null)
|
||||
user.SetQuest(quest.id, false);
|
||||
|
||||
if (clearedStageId == 6000003)
|
||||
if (clearedStageId == 6001004)
|
||||
{
|
||||
// TODO: Is this the right place to copy over default characters?
|
||||
// TODO: What is CSN and TID? Also need to add names for these
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace EpinelPS.Utils
|
||||
public static NetRewardData RegisterRewardsForUser(Database.User user, RewardTableRecord rewardData)
|
||||
{
|
||||
NetRewardData ret = new();
|
||||
ret.PassPoint = new();
|
||||
if (rewardData.rewards == null) return ret;
|
||||
|
||||
if (rewardData.user_exp != 0)
|
||||
@@ -25,10 +26,15 @@ namespace EpinelPS.Utils
|
||||
Console.WriteLine("Unknown user level value for xp " + newXp);
|
||||
}
|
||||
|
||||
bool leveled = false;
|
||||
int newGems = 0;
|
||||
|
||||
|
||||
while (newXp >= newLevelExp)
|
||||
{
|
||||
leveled = true;
|
||||
newLevel++;
|
||||
newGems += 30;
|
||||
newXp -= oldXpData.Item2;
|
||||
if (user.Currency.ContainsKey(CurrencyType.FreeCash))
|
||||
user.Currency[CurrencyType.FreeCash] += 30;
|
||||
@@ -51,8 +57,7 @@ namespace EpinelPS.Utils
|
||||
CurrentExp = newXp,
|
||||
CurrentLv = newLevel,
|
||||
|
||||
GainExp = rewardData.user_exp,
|
||||
Csn = 123,
|
||||
GainExp = rewardData.user_exp
|
||||
};
|
||||
user.userPointData.ExperiencePoint = newXp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user