mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-16 08:54:47 +01:00
26 lines
801 B
C#
26 lines
801 B
C#
using EpinelPS.Utils;
|
|
using EpinelPS.Data; // For GameData access
|
|
|
|
namespace EpinelPS.LobbyServer.LobbyUser
|
|
{
|
|
[PacketPath("/lobby/usertitle/get")]
|
|
public class GetUserTitle : LobbyMsgHandler
|
|
{
|
|
protected override async Task HandleAsync()
|
|
{
|
|
ReqGetUserTitleList req = await ReadData<ReqGetUserTitleList>();
|
|
ResGetUserTitleList r = new();
|
|
|
|
// Access GameData and get all UserTitle IDs
|
|
Dictionary<int, UserTitleRecord> userTitleRecords = GameData.Instance.userTitleRecords;
|
|
|
|
foreach (int titleId in userTitleRecords.Keys)
|
|
{
|
|
r.UserTitleList.Add(new ResGetUserTitleList.Types.NetUserTitle() { UserTitleId = titleId });
|
|
}
|
|
|
|
await WriteDataAsync(r);
|
|
}
|
|
}
|
|
}
|