* Add files via upload

* Add files via upload

* Add files via upload
This commit is contained in:
User958568
2025-09-14 18:50:49 +03:00
committed by GitHub
parent 2e4310edf1
commit 793e55f9de
12 changed files with 417 additions and 17 deletions

View File

@@ -229,6 +229,19 @@ namespace EpinelPS.Data
[LoadRecord("FavoriteItemQuestStageTable.json", "id")]
public readonly Dictionary<int, FavoriteItemQuestStageRecord> FavoriteItemQuestStageTable = [];
// Tables related to PlaySoda Arcade's event.
[LoadRecord("EventPlaySodaManagerTable.json", "id")]
public readonly Dictionary<int, EventPlaySodaManagerRecord> EventPlaySodaManagerTable = [];
[LoadRecord("EventPlaySodaStoryModeTable.json", "id")]
public readonly Dictionary<int, EventPlaySodaStoryModeRecord> EventPlaySodaStoryModeTable = [];
[LoadRecord("EventPlaySodaChallengeModeTable.json", "id")]
public readonly Dictionary<int, EventPlaySodaChallengeModeRecord> EventPlaySodaChallengeModeTable = [];
[LoadRecord("EventPlaySodaPointRewardTable.json", "id")]
public readonly Dictionary<int, EventPlaySodaPointRewardRecord> EventPlaySodaPointRewardTable = [];
static async Task<GameData> BuildAsync()
{

View File

@@ -1090,4 +1090,89 @@ namespace EpinelPS.Data
public int spawn_condition_favoriteitem_quest_stage_id;
public int enter_condition_favoriteitem_quest_stage_id;
}
[MemoryPackable]
public partial class EventPlaySodaManagerRecord
{
public int id;
public int event_id;
public int daily_reward_id;
public int challenge_group_id;
public int play_helptip_id;
public int story_group_id;
public int total_point_reward_group_id;
public int ingame_pause_second;
public MiniGameSystemType minigame_type;
public string ui_prefab_keyword = "";
}
public enum MiniGameSystemType
{
Normal,
Archive,
Arcade
}
[MemoryPackable]
public partial class EventPlaySodaStoryModeRecord
{
public int id;
public int group_id;
public int stage_data_id;
public int stage_helptip_id;
public string stage_image = "";
public int order;
public EventDungeonOpenCondition open_condition_type;
public int open_condition_value;
public string game_title = "";
public EventPlaySodaGameType game_type;
public string short_name = "";
public int clear_reward_id;
public string enter_scenario = "";
public string exit_scenario = "";
}
[MemoryPackable]
public partial class EventPlaySodaChallengeModeRecord
{
public int id;
public int group_id;
public int stage_data_id;
public int stage_helptip_id;
public string stage_image = "";
public int order;
public EventDungeonOpenCondition open_condition_type;
public int open_condition_value;
public string game_title = "";
public string game_title_en = "";
public EventPlaySodaGameType game_type;
public string game_mode_resource = "";
}
public enum EventPlaySodaGameType
{
Running = 2001,
Smash = 2002,
CatchCoin = 2003,
StackUp = 2004,
Climbing = 2005
}
public enum EventDungeonOpenCondition
{
None,
EventDungeonStageClear,
EventDay
}
[MemoryPackable]
public partial class EventPlaySodaPointRewardRecord
{
public int id;
public int group_id;
public int point_value;
public EventPlaySodaGameType game_type;
public int step;
public int reward_id;
}
}

View File

@@ -0,0 +1,25 @@
using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/arcade/play-soda/challenge/enter")]
public class GetChallengeEnter : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var request = await ReadData<ReqEnterArcadePlaySodaChallengeStage>();
var user = GetUser();
ResEnterArcadePlaySodaChallengeStage response = new()
{
UserMaxScore = user.ArcadePlaySodaInfoList.First(i => i.ChallengeStageId == request.ChallengeStageId).UserRank
};
await WriteDataAsync(response);
JsonDb.Save();
}
}
}

View File

@@ -0,0 +1,39 @@
using EpinelPS.Data;
using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/arcade/play-soda/challenge/finish/catchcoin")]
public class GetChallengeFinishCatchCoin : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var request = await ReadData<ReqFinishArcadePlaySodaCatchCoinChallenge>();
var user = GetUser();
var challengeStageId = GameData.Instance.EventPlaySodaChallengeModeTable.First(i => i.Value.game_type == EventPlaySodaGameType.CatchCoin).Key;
var arcadePlaySodaInfo = user.ArcadePlaySodaInfoList.First(i => i.ChallengeStageId == challengeStageId);
if (arcadePlaySodaInfo.UserRank < request.Score)
{
arcadePlaySodaInfo.UserRank = request.Score;
}
arcadePlaySodaInfo.AccumulatedScore += request.Score;
var pointValues = GetChallengeObtainPointReward.GetPointValues(arcadePlaySodaInfo.ChallengeStageId);
if (pointValues.Length > arcadePlaySodaInfo.LastRewardStep && arcadePlaySodaInfo.AccumulatedScore >= pointValues[arcadePlaySodaInfo.LastRewardStep])
{
arcadePlaySodaInfo.CanReceivePointReward = true;
}
await WriteDataAsync(new ResFinishArcadePlaySodaCatchCoinChallenge());
JsonDb.Save();
}
}
}

View File

@@ -0,0 +1,39 @@
using EpinelPS.Data;
using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/arcade/play-soda/challenge/finish/climbing")]
public class GetChallengeFinishClimbing : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var request = await ReadData<ReqFinishArcadePlaySodaClimbingChallenge>();
var user = GetUser();
var challengeStageId = GameData.Instance.EventPlaySodaChallengeModeTable.First(i => i.Value.game_type == EventPlaySodaGameType.Climbing).Key;
var arcadePlaySodaInfo = user.ArcadePlaySodaInfoList.First(i => i.ChallengeStageId == challengeStageId);
if (arcadePlaySodaInfo.UserRank < request.Score)
{
arcadePlaySodaInfo.UserRank = request.Score;
}
arcadePlaySodaInfo.AccumulatedScore += request.Score;
var pointValues = GetChallengeObtainPointReward.GetPointValues(arcadePlaySodaInfo.ChallengeStageId);
if (pointValues.Length > arcadePlaySodaInfo.LastRewardStep && arcadePlaySodaInfo.AccumulatedScore >= pointValues[arcadePlaySodaInfo.LastRewardStep])
{
arcadePlaySodaInfo.CanReceivePointReward = true;
}
await WriteDataAsync(new ResFinishArcadePlaySodaClimbingChallenge());
JsonDb.Save();
}
}
}

View File

@@ -0,0 +1,39 @@
using EpinelPS.Data;
using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/arcade/play-soda/challenge/finish/running")]
public class GetChallengeFinishRunning : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var request = await ReadData<ReqFinishArcadePlaySodaRunningChallenge>();
var user = GetUser();
var challengeStageId = GameData.Instance.EventPlaySodaChallengeModeTable.First(i => i.Value.game_type == EventPlaySodaGameType.Running).Key;
var arcadePlaySodaInfo = user.ArcadePlaySodaInfoList.First(i => i.ChallengeStageId == challengeStageId);
if (arcadePlaySodaInfo.UserRank < request.Score)
{
arcadePlaySodaInfo.UserRank = request.Score;
}
arcadePlaySodaInfo.AccumulatedScore += request.Score;
var pointValues = GetChallengeObtainPointReward.GetPointValues(arcadePlaySodaInfo.ChallengeStageId);
if (pointValues.Length > arcadePlaySodaInfo.LastRewardStep && arcadePlaySodaInfo.AccumulatedScore >= pointValues[arcadePlaySodaInfo.LastRewardStep])
{
arcadePlaySodaInfo.CanReceivePointReward = true;
}
await WriteDataAsync(new ResFinishArcadePlaySodaRunningChallenge());
JsonDb.Save();
}
}
}

View File

@@ -0,0 +1,39 @@
using EpinelPS.Data;
using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/arcade/play-soda/challenge/finish/smash")]
public class GetChallengeFinishSmash : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var request = await ReadData<ReqFinishArcadePlaySodaSmashChallenge>();
var user = GetUser();
var challengeStageId = GameData.Instance.EventPlaySodaChallengeModeTable.First(i => i.Value.game_type == EventPlaySodaGameType.Smash).Key;
var arcadePlaySodaInfo = user.ArcadePlaySodaInfoList.First(i => i.ChallengeStageId == challengeStageId);
if (arcadePlaySodaInfo.UserRank < request.Score)
{
arcadePlaySodaInfo.UserRank = request.Score;
}
arcadePlaySodaInfo.AccumulatedScore += request.Score;
var pointValues = GetChallengeObtainPointReward.GetPointValues(arcadePlaySodaInfo.ChallengeStageId);
if (pointValues.Length > arcadePlaySodaInfo.LastRewardStep && arcadePlaySodaInfo.AccumulatedScore >= pointValues[arcadePlaySodaInfo.LastRewardStep])
{
arcadePlaySodaInfo.CanReceivePointReward = true;
}
await WriteDataAsync(new ResFinishArcadePlaySodaSmashChallenge());
JsonDb.Save();
}
}
}

View File

@@ -0,0 +1,39 @@
using EpinelPS.Data;
using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/arcade/play-soda/challenge/finish/stackup")]
public class GetChallengeFinishStackUp : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var request = await ReadData<ReqFinishArcadePlaySodaStackUpChallenge>();
var user = GetUser();
var challengeStageId = GameData.Instance.EventPlaySodaChallengeModeTable.First(i => i.Value.game_type == EventPlaySodaGameType.StackUp).Key;
var arcadePlaySodaInfo = user.ArcadePlaySodaInfoList.First(i => i.ChallengeStageId == challengeStageId);
if (arcadePlaySodaInfo.UserRank < request.Score)
{
arcadePlaySodaInfo.UserRank = request.Score;
}
arcadePlaySodaInfo.AccumulatedScore += request.Score;
var pointValues = GetChallengeObtainPointReward.GetPointValues(arcadePlaySodaInfo.ChallengeStageId);
if (pointValues.Length > arcadePlaySodaInfo.LastRewardStep && arcadePlaySodaInfo.AccumulatedScore >= pointValues[arcadePlaySodaInfo.LastRewardStep])
{
arcadePlaySodaInfo.CanReceivePointReward = true;
}
await WriteDataAsync(new ResFinishArcadePlaySodaStackUpChallenge());
JsonDb.Save();
}
}
}

View File

@@ -1,17 +1,33 @@
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/event/minigame/playsoda/challenge/getinfo")]
public class GetChallengeInfo : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
ReqGetPlaySodaChallengeModeInfo req = await ReadData<ReqGetPlaySodaChallengeModeInfo>();
ResGetPlaySodaChallengeModeInfo response = new();
// TODO
await WriteDataAsync(response);
}
}
}
using EpinelPS.Data;
using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/arcade/play-soda/challenge/info")]
public class GetChallengeInfo : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var request = await ReadData<ReqGetArcadePlaySodaChallengeModeInfo>();
var user = GetUser();
ResGetArcadePlaySodaChallengeModeInfo response = new() { WholeUser = LobbyHandler.CreateWholeUserDataFromDbUser(user) };
for (int i = 0; i < GameData.Instance.EventPlaySodaChallengeModeTable.Count; i++)
{
if (user.ArcadePlaySodaInfoList.Count < GameData.Instance.EventPlaySodaChallengeModeTable.Count)
{
user.ArcadePlaySodaInfoList.Add(new() { AccumulatedScore = 0, CanReceivePointReward = false, ChallengeStageId = GameData.Instance.EventPlaySodaChallengeModeTable.Keys.ElementAt(i), LastRewardStep = 0, IsInGuild = false, UserRank = 0, UserMaxScoreInUnion = 0 /* TODO UNIONS */ });
}
response.ArcadePlaySodaEachGameInfoList.Add(user.ArcadePlaySodaInfoList[i]);
}
await WriteDataAsync(response);
JsonDb.Save();
}
}
}

View File

@@ -0,0 +1,50 @@
using EpinelPS.Data;
using EpinelPS.Database;
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/arcade/play-soda/challenge/obtain-point-reward")]
public class GetChallengeObtainPointReward : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var request = await ReadData<ReqObtainArcadePlaySodaPointReward>();
var user = GetUser();
var arcadePlaySodaInfo = user.ArcadePlaySodaInfoList.First(i => i.ChallengeStageId == request.ChallengeStageId);
arcadePlaySodaInfo.CanReceivePointReward = false;
List<NetRewardData> rewards = [];
var pointValues = GetPointValues(arcadePlaySodaInfo.ChallengeStageId);
while (pointValues.Length > arcadePlaySodaInfo.LastRewardStep && arcadePlaySodaInfo.AccumulatedScore >= pointValues[arcadePlaySodaInfo.LastRewardStep])
{
arcadePlaySodaInfo.LastRewardStep++;
rewards.Add(RewardUtils.RegisterRewardsForUser(user, GameData.Instance.EventPlaySodaPointRewardTable.First(r => (int)r.Value.game_type == arcadePlaySodaInfo.ChallengeStageId && r.Value.step == arcadePlaySodaInfo.LastRewardStep && r.Value.point_value == pointValues[arcadePlaySodaInfo.LastRewardStep - 1]).Value.reward_id));
}
await WriteDataAsync(new ResObtainArcadePlaySodaPointReward() { LastRewardStep = arcadePlaySodaInfo.LastRewardStep, Reward = NetUtils.MergeRewards(rewards, user) });
JsonDb.Save();
}
public static int[] GetPointValues(int challengeStageId)
{
var s = (int)EventPlaySodaGameType.Smash;
if (challengeStageId == (int)EventPlaySodaGameType.CatchCoin)
{
return [300000, 600000, 1000000];
}
else if (challengeStageId == (int)EventPlaySodaGameType.Smash)
{
return [120000, 240000, 400000];
}
return [360000, 720000, 1200000];
}
}
}

View File

@@ -0,0 +1,15 @@
using EpinelPS.Utils;
namespace EpinelPS.LobbyServer.Minigame.PlaySoda
{
[PacketPath("/arcade/enterlog")]
public class GetEnterArcadeLog : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var request = await ReadData<ReqEnterArcadeLog>();
await WriteDataAsync(new ResEnterArcadeLog());
}
}
}

View File

@@ -102,6 +102,7 @@ public class User
// Event data
public Dictionary<int, EventData> EventInfo = [];
public MogMinigameInfo MogInfo = new();
public List<NetPlaySodaEachGameInfo> ArcadePlaySodaInfoList = [];
public TriggerModel AddTrigger(TriggerType type, int value, int conditionId = 0)
{