mirror of
https://github.com/rafi1212122/PemukulPaku
synced 2025-12-12 21:04:43 +01:00
CustomHead and Frame impl, with GetMainDataRsp fix
This commit is contained in:
@@ -102,6 +102,77 @@ namespace Common.Database
|
||||
}
|
||||
}
|
||||
|
||||
public AvatarDetailData ToDetailData(EquipmentScheme equipment)
|
||||
{
|
||||
Weapon? weapon = equipment.WeaponList.Where(x => x.UniqueId == WeaponUniqueId).FirstOrDefault();
|
||||
Stigmata? stigmata1 = equipment.StigmataList.Where(x => x.UniqueId == StigmataUniqueId1).FirstOrDefault();
|
||||
Stigmata? stigmata2 = equipment.StigmataList.Where(x => x.UniqueId == StigmataUniqueId2).FirstOrDefault();
|
||||
Stigmata? stigmata3 = equipment.StigmataList.Where(x => x.UniqueId == StigmataUniqueId3).FirstOrDefault();
|
||||
|
||||
AvatarDetailData detailData = new()
|
||||
{
|
||||
AvatarId = AvatarId,
|
||||
AvatarArtifact = AvatarArtifact,
|
||||
AvatarLevel = Level,
|
||||
AvatarStar = Star,
|
||||
AvatarSubStar = SubStar,
|
||||
DressId = DressId,
|
||||
};
|
||||
|
||||
if (weapon is not null)
|
||||
{
|
||||
detailData.Weapon = new()
|
||||
{
|
||||
Id = weapon.Id,
|
||||
Level = weapon.Level,
|
||||
UniqueId = weapon.UniqueId,
|
||||
SubWeaponId = weapon.SubWeaponId
|
||||
};
|
||||
}
|
||||
|
||||
if (stigmata1 is not null)
|
||||
{
|
||||
detailData.Stigmata1 = new()
|
||||
{
|
||||
Id = stigmata1.Id,
|
||||
Level = stigmata1.Level,
|
||||
UniqueId = stigmata1.UniqueId
|
||||
};
|
||||
detailData.Stigmata1.RuneLists.AddRange(stigmata1.RuneLists);
|
||||
}
|
||||
|
||||
if (stigmata2 is not null)
|
||||
{
|
||||
detailData.Stigmata2 = new()
|
||||
{
|
||||
Id = stigmata2.Id,
|
||||
Level = stigmata2.Level,
|
||||
UniqueId = stigmata2.UniqueId
|
||||
};
|
||||
detailData.Stigmata2.RuneLists.AddRange(stigmata2.RuneLists);
|
||||
}
|
||||
|
||||
if (stigmata3 is not null)
|
||||
{
|
||||
detailData.Stigmata3 = new()
|
||||
{
|
||||
Id = stigmata3.Id,
|
||||
Level = stigmata3.Level,
|
||||
UniqueId = stigmata3.UniqueId
|
||||
};
|
||||
detailData.Stigmata3.RuneLists.AddRange(stigmata3.RuneLists);
|
||||
}
|
||||
|
||||
detailData.SkillLists.AddRange(SkillLists.Select(x =>
|
||||
{
|
||||
AvatarSkillDetailData skillDetailData = new() { SkillId = x.SkillId };
|
||||
skillDetailData.SubSkillLists.AddRange(x.SubSkillLists.Select(x => new AvatarSubSkillDetailData() { IsMask = x.IsMask, Level = x.Level, SubSkillId = x.SubSkillId }));
|
||||
return skillDetailData;
|
||||
}));
|
||||
|
||||
return detailData;
|
||||
}
|
||||
|
||||
public void AddFragment(uint num) { Fragment += num; }
|
||||
|
||||
public void SetDress(uint dressId) { DressId = dressId; }
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace Common.Database
|
||||
WarshipFirstAvatarId = 101,
|
||||
WarshipSecondAvatarId = 0
|
||||
},
|
||||
CustomHeadId = 161001,
|
||||
FrameId = 200001,
|
||||
AssistantAvatarId = 101,
|
||||
BirthDate = 0,
|
||||
AbyssDynamicHard = 100,
|
||||
@@ -55,6 +57,12 @@ namespace Common.Database
|
||||
return user;
|
||||
}
|
||||
|
||||
public static UserScheme? FromUid(uint uid)
|
||||
{
|
||||
UserScheme? user = collection.AsQueryable().Where(d => d.Uid == uid).FirstOrDefault();
|
||||
return user;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||
@@ -70,6 +78,8 @@ namespace Common.Database
|
||||
public string SelfDesc { get; set; }
|
||||
public bool IsFirstLogin { get; set; }
|
||||
public string Token { get; set; }
|
||||
public int CustomHeadId { get; set; }
|
||||
public int FrameId { get; set; }
|
||||
public int WarshipId { get; set; }
|
||||
public WarshipAvatarData WarshipAvatar { get; set; }
|
||||
public int AssistantAvatarId { get; set; }
|
||||
|
||||
61
Common/Utils/ExcelReader/CustomHeadData.cs
Normal file
61
Common/Utils/ExcelReader/CustomHeadData.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Common.Utils.ExcelReader
|
||||
{
|
||||
public class CustomHeadData : BaseExcelReader<CustomHeadData, CustomHeadDataExcel>
|
||||
{
|
||||
public override string FileName { get { return "CustomHeadData.json"; } }
|
||||
}
|
||||
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||
public partial class CustomHeadDataExcel
|
||||
{
|
||||
[JsonProperty("indexID")]
|
||||
public int IndexId { get; set; }
|
||||
|
||||
[JsonProperty("Page")]
|
||||
public int Page { get; set; }
|
||||
|
||||
[JsonProperty("headTitle")]
|
||||
public string HeadTitle { get; set; }
|
||||
|
||||
[JsonProperty("headDescription")]
|
||||
public string HeadDescription { get; set; }
|
||||
|
||||
[JsonProperty("iconPath")]
|
||||
public string IconPath { get; set; }
|
||||
|
||||
[JsonProperty("imagePath")]
|
||||
public string ImagePath { get; set; }
|
||||
|
||||
[JsonProperty("Show")]
|
||||
public bool Show { get; set; }
|
||||
|
||||
[JsonProperty("HeadType")]
|
||||
public int HeadType { get; set; }
|
||||
|
||||
[JsonProperty("HeadParaInt")]
|
||||
public int HeadParaInt { get; set; }
|
||||
|
||||
[JsonProperty("TimeType")]
|
||||
public int TimeType { get; set; }
|
||||
|
||||
[JsonProperty("During")]
|
||||
public int During { get; set; }
|
||||
|
||||
[JsonProperty("EndTime")]
|
||||
public string EndTime { get; set; }
|
||||
|
||||
[JsonProperty("BgColorPath")]
|
||||
public string BgColorPath { get; set; }
|
||||
|
||||
[JsonProperty("rarity")]
|
||||
public int Rarity { get; set; }
|
||||
|
||||
[JsonProperty("DataImpl")]
|
||||
public object DataImpl { get; set; }
|
||||
|
||||
[JsonProperty("headID")]
|
||||
public int HeadId { get; set; }
|
||||
}
|
||||
}
|
||||
43
Common/Utils/ExcelReader/FrameData.cs
Normal file
43
Common/Utils/ExcelReader/FrameData.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Common.Utils.ExcelReader
|
||||
{
|
||||
public class FrameData : BaseExcelReader<FrameData, FrameDataExcel>
|
||||
{
|
||||
public override string FileName { get { return "FrameData.json"; } }
|
||||
}
|
||||
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||
public partial class FrameDataExcel
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public HashName Name { get; set; }
|
||||
|
||||
[JsonProperty("rarity")]
|
||||
public int Rarity { get; set; }
|
||||
|
||||
[JsonProperty("desc")]
|
||||
public HashName Desc { get; set; }
|
||||
|
||||
[JsonProperty("iconPath")]
|
||||
public string IconPath { get; set; }
|
||||
|
||||
[JsonProperty("imagePath")]
|
||||
public string ImagePath { get; set; }
|
||||
|
||||
[JsonProperty("isShow")]
|
||||
public bool IsShow { get; set; }
|
||||
|
||||
[JsonProperty("UIShowOrder")]
|
||||
public int UiShowOrder { get; set; }
|
||||
|
||||
[JsonProperty("Type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
[JsonProperty("DataImpl")]
|
||||
public object DataImpl { get; set; }
|
||||
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user