Add some stuff

This commit is contained in:
SELEKCJONER
2024-11-17 22:49:45 +01:00
parent f1e6899fc9
commit 34ce89446e
6 changed files with 46 additions and 26 deletions

View File

@@ -46,7 +46,7 @@ namespace EpinelPS.StaticInfo
public Dictionary<int, GachaType> gachaTypes = new Dictionary<int, GachaType>(); // Fixed initialization public Dictionary<int, GachaType> gachaTypes = new Dictionary<int, GachaType>(); // Fixed initialization
public Dictionary<int, EventManager> eventManagers = new Dictionary<int, EventManager>(); public Dictionary<int, EventManager> eventManagers = new Dictionary<int, EventManager>();
public Dictionary<int, LiveWallpaperRecord> lwptablemgrs = new Dictionary<int, LiveWallpaperRecord>(); // Fixed initialization public Dictionary<int, LiveWallpaperRecord> lwptablemgrs = new Dictionary<int, LiveWallpaperRecord>(); // Fixed initialization
private Dictionary<int, AlbumResourceRecord> albumResourceRecords = new Dictionary<int, AlbumResourceRecord>(); public Dictionary<int, AlbumResourceRecord> albumResourceRecords = new Dictionary<int, AlbumResourceRecord>();
public Dictionary<int, UserFrameTableRecord> userFrameTable = new Dictionary<int, UserFrameTableRecord>(); public Dictionary<int, UserFrameTableRecord> userFrameTable = new Dictionary<int, UserFrameTableRecord>();
public Dictionary<int, ArchiveRecordManagerRecord> archiveRecordManagerTable = new Dictionary<int, ArchiveRecordManagerRecord>(); public Dictionary<int, ArchiveRecordManagerRecord> archiveRecordManagerTable = new Dictionary<int, ArchiveRecordManagerRecord>();
public Dictionary<int, ArchiveEventStoryRecord> archiveEventStoryRecords = new Dictionary<int, ArchiveEventStoryRecord>(); public Dictionary<int, ArchiveEventStoryRecord> archiveEventStoryRecords = new Dictionary<int, ArchiveEventStoryRecord>();

View File

@@ -7,9 +7,12 @@ namespace EpinelPS.LobbyServer.Msgs.Event
{ {
protected override async Task HandleAsync() protected override async Task HandleAsync()
{ {
var req = await ReadData<ReqGetEventMissionClear>(); var req = await ReadData<ReqGetEventMissionClear>(); //has EventIdList
var response = new ResGetEventMissionClear(); var response = new ResGetEventMissionClear();
// response.ResGetEventMissionClear.Add(new NetEventMissionClearData(EventId = 0, EventMissionId = 0 , CreatedAt = 0));
// TODO // TODO
await WriteDataAsync(response); await WriteDataAsync(response);
} }

View File

@@ -1,5 +1,8 @@
using EpinelPS.Database; using EpinelPS.Database;
using EpinelPS.Utils; using EpinelPS.Utils;
using EpinelPS.StaticInfo; // For GameData access
using System.Linq;
using System.Threading.Tasks;
namespace EpinelPS.LobbyServer.Msgs.Event namespace EpinelPS.LobbyServer.Msgs.Event
{ {
@@ -8,19 +11,16 @@ namespace EpinelPS.LobbyServer.Msgs.Event
{ {
protected override async Task HandleAsync() protected override async Task HandleAsync()
{ {
var req = await ReadData<ReqGetEventScenarioData>(); var req = await ReadData<ReqGetEventScenarioData>();
var user = GetUser();
// Access GameData instance
var gameData = GameData.Instance;
// Create a response object
var response = new ResGetEventScenarioData(); var response = new ResGetEventScenarioData();
if (user.EventInfo.ContainsKey(req.EventId))
{ // Get all scenario_group_id values from albumResourceRecords starting with "event_"
var evt = user.EventInfo[req.EventId]; response.ScenarioIdList.Add(gameData.albumResourceRecords.Values.Where(record => record.scenario_group_id.StartsWith("event_")).Select(record => record.scenario_group_id).ToList());
response.ScenarioIdList.AddRange(evt.CompletedScenarios);
}
else
{
user.EventInfo.Add(req.EventId, new EventData());
}
await WriteDataAsync(response); await WriteDataAsync(response);
} }

View File

@@ -62,6 +62,19 @@ namespace EpinelPS.LobbyServer.Msgs.Event
EventSystemType = 1 EventSystemType = 1
}, },
JoinAt = 0 JoinAt = 0
});
response.EventWithJoinData.Add(new NetEventWithJoinData()
{
EventData = new NetEventData()
{
Id = 70070,
EventSystemType = 6,
EventVisibleDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(7)).Ticks,
EventStartDate = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1)).Ticks,
EventEndDate = DateTime.Now.AddDays(20).Ticks,
EventDisableDate = DateTime.Now.AddDays(20).Ticks
},
JoinAt = 0
}); });
await WriteDataAsync(response); await WriteDataAsync(response);

View File

@@ -9,7 +9,7 @@ namespace EpinelPS.LobbyServer.Msgs.Event.Mission
{ {
var req = await ReadData<ReqGetEventMissionClearList>(); var req = await ReadData<ReqGetEventMissionClearList>();
var response = new ResGetEventMissionClearList(); var response = new ResGetEventMissionClearList(); //field ResGetEventMissionClearMap data type NestEventMissionClear field NestEventMissionClear data type NetEventMissionClearData fields EventId EventMissionId CreatedAt
// TOOD // TOOD

View File

@@ -1,9 +1,5 @@
using EpinelPS.Utils; using EpinelPS.Utils;
using System; using EpinelPS.Database;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EpinelPS.LobbyServer.Msgs.Event.StoryEvent namespace EpinelPS.LobbyServer.Msgs.Event.StoryEvent
{ {
@@ -13,14 +9,22 @@ namespace EpinelPS.LobbyServer.Msgs.Event.StoryEvent
protected override async Task HandleAsync() protected override async Task HandleAsync()
{ {
var req = await ReadData<ReqStoryDungeonEventData>(); var req = await ReadData<ReqStoryDungeonEventData>();
var user = GetUser(); var evid = req.EventId;
var user = GetUser();
var eventData = user.EventInfo[evid];
var response = new ResStoryDungeonEventData();
response.RemainTicket = 5;
var response = new ResStoryDungeonEventData() response.TeamData = new NetUserTeamData()
{
LastContentsTeamNumber = 1,
Type = 20
};
response.LastClearedEventStageList.Add(new NetLastClearedEventStageData()
{ {
TeamData = new NetUserTeamData(), DifficultyId = eventData.Diff,
RemainTicket = 10, StageId = eventData.LastStage
}; });
// TOOD // TOOD
await WriteDataAsync(response); await WriteDataAsync(response);