mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-17 17:34:35 +01:00
Remove msg folder
This commit is contained in:
38
EpinelPS/LobbyServer/Archive/MessengerGet.cs
Normal file
38
EpinelPS/LobbyServer/Archive/MessengerGet.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using EpinelPS.Utils;
|
||||
using EpinelPS.StaticInfo;
|
||||
|
||||
namespace EpinelPS.LobbyServer.Archive
|
||||
{
|
||||
[PacketPath("/archive/messenger/get")]
|
||||
public class GetArchiveMessenger : LobbyMsgHandler
|
||||
{
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
// Read the request containing ArchiveMessengerGroupId
|
||||
var req = await ReadData<ReqGetArchiveMessenger>();
|
||||
var groupId = req.ArchiveMessengerGroupId;
|
||||
|
||||
// Initialize the response object
|
||||
var response = new ResGetArchiveMessenger();
|
||||
|
||||
// Get the relevant data from ArchiveMessengerConditionTable
|
||||
var gameData = GameData.Instance;
|
||||
|
||||
if (gameData.archiveMessengerConditionRecords.TryGetValue(groupId, out var conditionRecord))
|
||||
{
|
||||
foreach (var condition in conditionRecord.archive_messenger_condition_list)
|
||||
{
|
||||
// Add each condition as a NetArchiveMessage in the response
|
||||
response.ArchiveMessageList.Add(new NetArchiveMessage
|
||||
{
|
||||
ConditionId = condition.condition_id,
|
||||
MessageId = conditionRecord.tid // Correctly using tid as MessageId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Write the response back
|
||||
await WriteDataAsync(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user