Files
EpinelPS/EpinelPS/LobbyServer/Msgs/User/GetWallpaperInventory.cs
2024-09-15 22:36:41 +02:00

27 lines
948 B
C#

using EpinelPS.Utils;
using EpinelPS.StaticInfo;
namespace EpinelPS.LobbyServer.Msgs.User
{
[PacketPath("/user/getwallpaperinventory")]
public class GetWallpaperInventory : LobbyMsgHandler
{
protected override async Task HandleAsync()
{
var req = await ReadData<ReqGetWallpaperInventory>();
// Prepare the response
var r = new ResGetWallpaperInventory();
// Fetch all the wallpaper IDs from the LiveWallpaperTable,
// excluding records where livewallpaper_type is "SkillCutScene"
var wallpaperIds = GameData.Instance.lwptablemgrs.Where(w => w.Value.livewallpaper_type != "SkillCutScene").Select(w => w.Key).ToList();
// Add the filtered wallpaper IDs to the LivewallpaperIds field
r.LivewallpaperIds.AddRange(wallpaperIds);
// Send the response back
await WriteDataAsync(r);
}
}
}