mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-13 07:24:52 +01:00
Add all event and favorite item wallpapers
This commit is contained in:
@@ -28,7 +28,6 @@ namespace EpinelPS.Database
|
|||||||
public int Csn = 0;
|
public int Csn = 0;
|
||||||
public int Tid = 0;
|
public int Tid = 0;
|
||||||
public int CostumeId = 0;
|
public int CostumeId = 0;
|
||||||
|
|
||||||
public int Level = 1;
|
public int Level = 1;
|
||||||
public int UltimateLevel = 1;
|
public int UltimateLevel = 1;
|
||||||
public int Skill1Lvl = 1;
|
public int Skill1Lvl = 1;
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ namespace EpinelPS.StaticInfo
|
|||||||
private Dictionary<int, JukeboxThemeRecord> jukeboxThemeDataRecords;
|
private Dictionary<int, JukeboxThemeRecord> jukeboxThemeDataRecords;
|
||||||
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 byte[] Sha256Hash;
|
public byte[] Sha256Hash;
|
||||||
@@ -387,7 +389,13 @@ namespace EpinelPS.StaticInfo
|
|||||||
eventManagers.Add(obj.id, obj); // Use obj.id as the key and obj (the EventManager) as the value
|
eventManagers.Add(obj.id, obj); // Use obj.id as the key and obj (the EventManager) as the value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var lwptable = await LoadZip<LiveWallpaperTable>("LiveWallpaperTable.json", progress);
|
||||||
|
|
||||||
|
// Add the records to the dictionary
|
||||||
|
foreach (var obj in lwptable.records)
|
||||||
|
{
|
||||||
|
lwptablemgrs.Add(obj.id, obj); // Use obj.id as the key and obj (the LiveWallpaperRecord) as the value
|
||||||
|
}
|
||||||
// Load Jukebox data
|
// Load Jukebox data
|
||||||
await LoadJukeboxListData(progress);
|
await LoadJukeboxListData(progress);
|
||||||
await LoadJukeboxThemeData(progress);
|
await LoadJukeboxThemeData(progress);
|
||||||
|
|||||||
@@ -135,6 +135,7 @@
|
|||||||
public string corporation;
|
public string corporation;
|
||||||
public string grade_core_id;
|
public string grade_core_id;
|
||||||
public string name_code;
|
public string name_code;
|
||||||
|
public string grow_grade;
|
||||||
}
|
}
|
||||||
public class CharacterTable
|
public class CharacterTable
|
||||||
{
|
{
|
||||||
@@ -271,5 +272,15 @@
|
|||||||
{
|
{
|
||||||
public List<EventManager> records;
|
public List<EventManager> records;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class LiveWallpaperRecord
|
||||||
|
{
|
||||||
|
public int id;
|
||||||
|
public string livewallpaper_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LiveWallpaperTable
|
||||||
|
{
|
||||||
|
public List<LiveWallpaperRecord> records;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
43
EpinelPS/LobbyServer/Msgs/Character/UpgradeCore.cs
Normal file
43
EpinelPS/LobbyServer/Msgs/Character/UpgradeCore.cs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
using EpinelPS.Database;
|
||||||
|
using EpinelPS.Utils;
|
||||||
|
using EpinelPS.StaticInfo;
|
||||||
|
//this file is work in progress and currently its fucked
|
||||||
|
namespace EpinelPS.LobbyServer.Msgs.Character
|
||||||
|
{
|
||||||
|
[PacketPath("/character/coreupgrade")]
|
||||||
|
public class CoreUpgrade : LobbyMsgHandler
|
||||||
|
{
|
||||||
|
protected override async Task HandleAsync()
|
||||||
|
{
|
||||||
|
// Read the incoming request that contains the current CSN and ISN
|
||||||
|
var req = await ReadData<ReqCharacterCoreUpgrade>(); // Contains csn and isn (read-only)
|
||||||
|
var response = new ResCharacterCoreUpgrade();
|
||||||
|
|
||||||
|
// Get all character data from the game's character table
|
||||||
|
var fullchardata = GameData.Instance.characterTable.Values.ToList();
|
||||||
|
|
||||||
|
// Find the element with the current csn from the request
|
||||||
|
var currentCharacter = fullchardata.FirstOrDefault(c => c.id == req.Csn);
|
||||||
|
|
||||||
|
if (currentCharacter != null)
|
||||||
|
{
|
||||||
|
// Find a new CSN based on the `name_code` of the current character and `grade_core_id + 1`
|
||||||
|
var newCharacter = fullchardata.FirstOrDefault(c => c.name_code == currentCharacter.name_code && c.grade_core_id == currentCharacter.grade_core_id + 1);
|
||||||
|
|
||||||
|
if (newCharacter != null)
|
||||||
|
{
|
||||||
|
// Update the characterData with the new CSN
|
||||||
|
var characterData = new NetUserCharacterDefaultData
|
||||||
|
{
|
||||||
|
Csn = newCharacter.id
|
||||||
|
// Add any other required data here
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// Send the response back to the client
|
||||||
|
await WriteDataAsync(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,10 +25,9 @@ namespace EpinelPS.LobbyServer.Msgs.Gacha
|
|||||||
|
|
||||||
var entireallCharacterData = GameData.Instance.characterTable.Values.ToList();
|
var entireallCharacterData = GameData.Instance.characterTable.Values.ToList();
|
||||||
// Remove the .Values part since it's already a list.
|
// Remove the .Values part since it's already a list.
|
||||||
var allCharacterData = entireallCharacterData
|
// Group by name_code to treat same name_code as one character
|
||||||
.GroupBy(c => c.name_code) // Group by name_code to treat same name_code as one character
|
// Always add characters with grade_core_id == 11 and 103
|
||||||
.SelectMany(g => g.Where(c => c.grade_core_id == "11" || c.grade_core_id == "103" || c.grade_core_id == "201" || c.name_code == "3999")) // Always add characters with grade_core_id == 11 and 103
|
var allCharacterData = entireallCharacterData.GroupBy(c => c.name_code).SelectMany(g => g.Where(c => c.grade_core_id == "11" || c.grade_core_id == "103" || c.grade_core_id == "201" || c.name_code == "3999")).ToList();
|
||||||
.ToList();
|
|
||||||
|
|
||||||
// Separate characters by rarity categories
|
// Separate characters by rarity categories
|
||||||
var rCharacters = allCharacterData.Where(c => c.original_rare == "R").ToList();
|
var rCharacters = allCharacterData.Where(c => c.original_rare == "R").ToList();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using EpinelPS.Utils;
|
using EpinelPS.Utils;
|
||||||
|
using EpinelPS.StaticInfo;
|
||||||
namespace EpinelPS.LobbyServer.Msgs.User
|
namespace EpinelPS.LobbyServer.Msgs.User
|
||||||
{
|
{
|
||||||
[PacketPath("/user/getwallpaperinventory")]
|
[PacketPath("/user/getwallpaperinventory")]
|
||||||
@@ -9,8 +9,17 @@ namespace EpinelPS.LobbyServer.Msgs.User
|
|||||||
{
|
{
|
||||||
var req = await ReadData<ReqGetWallpaperInventory>();
|
var req = await ReadData<ReqGetWallpaperInventory>();
|
||||||
|
|
||||||
|
// Prepare the response
|
||||||
var r = new ResGetWallpaperInventory();
|
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);
|
await WriteDataAsync(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user