mirror of
https://github.com/rafi1212122/PemukulPaku
synced 2025-12-12 19:24:34 +01:00
warship & nick change
This commit is contained in:
110
Common/Utils/ExcelReader/DressData.cs
Normal file
110
Common/Utils/ExcelReader/DressData.cs
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Common.Utils.ExcelReader
|
||||||
|
{
|
||||||
|
public class DressData : BaseExcelReader<DressData, DressDataExcel>
|
||||||
|
{
|
||||||
|
public override string FileName { get { return "DressData.json"; } }
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||||
|
public partial class DressDataExcel
|
||||||
|
{
|
||||||
|
[JsonProperty("name")]
|
||||||
|
public HashName Name { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("rarity")]
|
||||||
|
public int Rarity { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("avatarIDList")]
|
||||||
|
public int[] AvatarIdList { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("roleID")]
|
||||||
|
public int RoleId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("iconPath")]
|
||||||
|
public string IconPath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("dressType")]
|
||||||
|
public int DressType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("getWay")]
|
||||||
|
public HashName GetWay { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("desc")]
|
||||||
|
public HashName Desc { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("coin")]
|
||||||
|
public int Coin { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("dressResource")]
|
||||||
|
public string DressResource { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("cardPath")]
|
||||||
|
public string CardPath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("tachiePath")]
|
||||||
|
public string TachiePath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("avatarIconPath")]
|
||||||
|
public string AvatarIconPath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("avatarIconSidePath")]
|
||||||
|
public string AvatarIconSidePath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("imagePath")]
|
||||||
|
public string ImagePath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("LinkIDList")]
|
||||||
|
public int[] LinkIdList { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("avatarGachaFigure")]
|
||||||
|
public string AvatarGachaFigure { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("show")]
|
||||||
|
public int Show { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("PreviewStageID")]
|
||||||
|
public int PreviewStageId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("DressTagList")]
|
||||||
|
public int[] DressTagList { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("RechargeShowName")]
|
||||||
|
public HashName RechargeShowName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("RechargeShowAvatarName")]
|
||||||
|
public HashName RechargeShowAvatarName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("RechargeShowPicPath")]
|
||||||
|
public string RechargeShowPicPath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("ArtifactID")]
|
||||||
|
public int ArtifactId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("MVPVoicePattern")]
|
||||||
|
public string MvpVoicePattern { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("UISelectVoice")]
|
||||||
|
public string UiSelectVoice { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("UILevelupVoice")]
|
||||||
|
public string UiLevelupVoice { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("GachaMainDropDisplayConfig")]
|
||||||
|
public int[] GachaMainDropDisplayConfig { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("GachaGiftDropDisplayConfig")]
|
||||||
|
public object[] GachaGiftDropDisplayConfig { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("IsCollaboration")]
|
||||||
|
public bool IsCollaboration { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("DataImpl")]
|
||||||
|
public object DataImpl { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("dressID")]
|
||||||
|
public int DressId { get; set; }
|
||||||
|
}
|
||||||
|
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||||
|
}
|
||||||
41
Common/Utils/ExcelReader/EntryThemeItemData.cs
Normal file
41
Common/Utils/ExcelReader/EntryThemeItemData.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Common.Utils.ExcelReader
|
||||||
|
{
|
||||||
|
public class EntryThemeItemData : BaseExcelReader<EntryThemeItemData, EntryThemeItemDataExcel>
|
||||||
|
{
|
||||||
|
public override string FileName { get { return "EntryThemeItemData.json"; } }
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||||
|
public partial class EntryThemeItemDataExcel
|
||||||
|
{
|
||||||
|
[JsonProperty("UnlockType")]
|
||||||
|
public int UnlockType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("UnlockPartID")]
|
||||||
|
public int UnlockPartId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("Rarity")]
|
||||||
|
public int Rarity { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("ItemName")]
|
||||||
|
public string ItemName { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("ItemDesc")]
|
||||||
|
public string ItemDesc { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("iconPath")]
|
||||||
|
public string IconPath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("ImagePath")]
|
||||||
|
public string ImagePath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("DataImpl")]
|
||||||
|
public object DataImpl { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("ThemeItemID")]
|
||||||
|
public int ThemeItemId { get; set; }
|
||||||
|
}
|
||||||
|
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||||
|
}
|
||||||
137
Common/Utils/ExcelReader/MaterialData.cs
Normal file
137
Common/Utils/ExcelReader/MaterialData.cs
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Common.Utils.ExcelReader
|
||||||
|
{
|
||||||
|
public class MaterialData : BaseExcelReader<MaterialData, MaterialDataExcel>
|
||||||
|
{
|
||||||
|
public override string FileName { get { return "MaterialData.json"; } }
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||||
|
public partial class MaterialDataExcel
|
||||||
|
{
|
||||||
|
[JsonProperty("rarity")]
|
||||||
|
public int Rarity { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("maxRarity")]
|
||||||
|
public int MaxRarity { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("cost")]
|
||||||
|
public int Cost { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("maxLv")]
|
||||||
|
public int MaxLv { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("sellPriceBase_1")]
|
||||||
|
public int SellPriceBase1 { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("sellPriceAdd")]
|
||||||
|
public int SellPriceAdd { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("ServantExpProvide")]
|
||||||
|
public int ServantExpProvide { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("gearExpProvideBase")]
|
||||||
|
public int GearExpProvideBase { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("gearExpPorvideAdd")]
|
||||||
|
public int GearExpPorvideAdd { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("ItemType")]
|
||||||
|
public string ItemType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("useID")]
|
||||||
|
public int UseId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("BaseType")]
|
||||||
|
public int BaseType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("displayTitle")]
|
||||||
|
public HashName DisplayTitle { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("displayDescription")]
|
||||||
|
public HashName DisplayDescription { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("iconPath")]
|
||||||
|
public string IconPath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("imagePath")]
|
||||||
|
public string ImagePath { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("characterExpProvide")]
|
||||||
|
public int CharacterExpProvide { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("LinkIDList")]
|
||||||
|
public int[] LinkIdList { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("ShopUseList")]
|
||||||
|
public string[] ShopUseList { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("displayBGDescription")]
|
||||||
|
public HashName DisplayBgDescription { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("quantityLimit")]
|
||||||
|
public int QuantityLimit { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("SortID")]
|
||||||
|
public int SortId { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("AffixTrainType")]
|
||||||
|
public int AffixTrainType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("AffixRandomValueIncress")]
|
||||||
|
public int AffixRandomValueIncress { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("AffixTitleExp")]
|
||||||
|
public int AffixTitleExp { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("quickBuyType")]
|
||||||
|
public int QuickBuyType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("shopType")]
|
||||||
|
public int ShopType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("idShopGoods")]
|
||||||
|
public int IdShopGoods { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("quickBuyConfirm")]
|
||||||
|
public bool QuickBuyConfirm { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("hideInInventory")]
|
||||||
|
public bool HideInInventory { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("hideNumInTips")]
|
||||||
|
public bool HideNumInTips { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("SellPriceID_1")]
|
||||||
|
public int SellPriceId1 { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("costVitality")]
|
||||||
|
public int CostVitality { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("enableQuickSell")]
|
||||||
|
public bool EnableQuickSell { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("advSellBonusNum")]
|
||||||
|
public int AdvSellBonusNum { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("TagType")]
|
||||||
|
public int TagType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("GachaMainDropDisplayConfig")]
|
||||||
|
public object[] GachaMainDropDisplayConfig { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("GachaGiftDropDisplayConfig")]
|
||||||
|
public object[] GachaGiftDropDisplayConfig { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("alwaysShowPopUp")]
|
||||||
|
public bool AlwaysShowPopUp { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("DataImpl")]
|
||||||
|
public object DataImpl { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("ID")]
|
||||||
|
public int Id { get; set; }
|
||||||
|
}
|
||||||
|
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||||
|
}
|
||||||
59
GameServer/Handlers/GetWarshipDataReqHandler.cs
Normal file
59
GameServer/Handlers/GetWarshipDataReqHandler.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using Common.Resources.Proto;
|
||||||
|
|
||||||
|
namespace PemukulPaku.GameServer.Handlers
|
||||||
|
{
|
||||||
|
[PacketCmdId(CmdId.GetWarshipDataReq)]
|
||||||
|
internal class GetWarshipDataReqHandler : IPacketHandler
|
||||||
|
{
|
||||||
|
public void Handle(Session session, Packet packet)
|
||||||
|
{
|
||||||
|
GetWarshipDataRsp Rsp = new()
|
||||||
|
{
|
||||||
|
retcode = GetWarshipDataRsp.Retcode.Succ,
|
||||||
|
IsAll = true
|
||||||
|
};
|
||||||
|
|
||||||
|
List<WarshipThemeData> Warships = new()
|
||||||
|
{
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
WarshipId = 0,
|
||||||
|
BgmPlayMode = 0,
|
||||||
|
IsWeatherFixed = false,
|
||||||
|
WeatherIdx = 0
|
||||||
|
},
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
WarshipId = 400002,
|
||||||
|
BgmPlayMode = 0,
|
||||||
|
IsWeatherFixed = false,
|
||||||
|
WeatherIdx = 0
|
||||||
|
},
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
WarshipId = 400003,
|
||||||
|
BgmPlayMode = 0,
|
||||||
|
IsWeatherFixed = false,
|
||||||
|
WeatherIdx = 0
|
||||||
|
},
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
WarshipId = 400004,
|
||||||
|
BgmPlayMode = 0,
|
||||||
|
IsWeatherFixed = false,
|
||||||
|
WeatherIdx = 0
|
||||||
|
},
|
||||||
|
new()
|
||||||
|
{
|
||||||
|
WarshipId = 400006,
|
||||||
|
BgmPlayMode = 0,
|
||||||
|
IsWeatherFixed = false,
|
||||||
|
WeatherIdx = 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Rsp.WarshipLists.AddRange(Warships);
|
||||||
|
|
||||||
|
session.Send(Packet.FromProto(Rsp, CmdId.GetWarshipDataRsp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
GameServer/Handlers/GetWarshipItemDataReqHandler.cs
Normal file
21
GameServer/Handlers/GetWarshipItemDataReqHandler.cs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
using Common.Resources.Proto;
|
||||||
|
using Common.Utils.ExcelReader;
|
||||||
|
|
||||||
|
namespace PemukulPaku.GameServer.Handlers
|
||||||
|
{
|
||||||
|
[PacketCmdId(CmdId.GetWarshipItemDataReq)]
|
||||||
|
internal class GetWarshipItemDataReqHandler : IPacketHandler
|
||||||
|
{
|
||||||
|
public void Handle(Session session, Packet packet)
|
||||||
|
{
|
||||||
|
GetWarshipItemDataRsp Rsp = new()
|
||||||
|
{
|
||||||
|
retcode = GetWarshipItemDataRsp.Retcode.Succ,
|
||||||
|
IsAll = true,
|
||||||
|
WarshipItemIdLists = EntryThemeItemData.GetInstance().All.Select(theme => (uint)theme.ThemeItemId).ToArray()
|
||||||
|
};
|
||||||
|
|
||||||
|
session.Send(Packet.FromProto(Rsp, CmdId.GetWarshipItemDataRsp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
GameServer/Handlers/GetWarshipTrialDataReqHandler.cs
Normal file
25
GameServer/Handlers/GetWarshipTrialDataReqHandler.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using Common;
|
||||||
|
using Common.Resources.Proto;
|
||||||
|
|
||||||
|
namespace PemukulPaku.GameServer.Handlers
|
||||||
|
{
|
||||||
|
[PacketCmdId(CmdId.GetWarshipTrialDataReq)]
|
||||||
|
internal class GetWarshipTrialDataReqHandler : IPacketHandler
|
||||||
|
{
|
||||||
|
public void Handle(Session session, Packet packet)
|
||||||
|
{
|
||||||
|
GetWarshipTrialDataRsp Rsp = new()
|
||||||
|
{
|
||||||
|
retcode = GetWarshipTrialDataRsp.Retcode.Succ,
|
||||||
|
IsAll = true
|
||||||
|
};
|
||||||
|
Rsp.TrialWarshipLists.Add(new TrialWarship()
|
||||||
|
{
|
||||||
|
SampleId = 410002,
|
||||||
|
EndTime = (uint)Global.GetUnixInSeconds() + 400000
|
||||||
|
});
|
||||||
|
|
||||||
|
session.Send(Packet.FromProto(Rsp, CmdId.GetWarshipTrialDataRsp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
GameServer/Handlers/NicknameModifyReqHandler.cs
Normal file
18
GameServer/Handlers/NicknameModifyReqHandler.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using Common.Resources.Proto;
|
||||||
|
|
||||||
|
namespace PemukulPaku.GameServer.Handlers
|
||||||
|
{
|
||||||
|
[PacketCmdId(CmdId.NicknameModifyReq)]
|
||||||
|
internal class NicknameModifyReqHandler : IPacketHandler
|
||||||
|
{
|
||||||
|
public void Handle(Session session, Packet packet)
|
||||||
|
{
|
||||||
|
NicknameModifyReq Data = packet.GetDecodedBody<NicknameModifyReq>();
|
||||||
|
|
||||||
|
session.Player.User.Nick = Data.Nickname;
|
||||||
|
|
||||||
|
GetMainDataRsp MainDataRsp = new() { retcode = GetMainDataRsp.Retcode.Succ, Nickname = session.Player.User.Nick };
|
||||||
|
session.Send(Packet.FromProto(MainDataRsp, CmdId.GetMainDataRsp), Packet.FromProto(new NicknameModifyRsp() { retcode = NicknameModifyRsp.Retcode.Succ }, CmdId.NicknameModifyRsp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
24
GameServer/Handlers/SetWarshipReqHandler.cs
Normal file
24
GameServer/Handlers/SetWarshipReqHandler.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using Common.Resources.Proto;
|
||||||
|
|
||||||
|
namespace PemukulPaku.GameServer.Handlers
|
||||||
|
{
|
||||||
|
[PacketCmdId(CmdId.SetWarshipReq)]
|
||||||
|
internal class SetWarshipReqHandler : IPacketHandler
|
||||||
|
{
|
||||||
|
public void Handle(Session session, Packet packet)
|
||||||
|
{
|
||||||
|
SetWarshipReq Data = packet.GetDecodedBody<SetWarshipReq>();
|
||||||
|
|
||||||
|
session.Player.User.WarshipId = (int)Data.WarshipId;
|
||||||
|
|
||||||
|
GetMainDataRsp MainDataRsp = new()
|
||||||
|
{
|
||||||
|
retcode = GetMainDataRsp.Retcode.Succ,
|
||||||
|
WarshipTheme = new() { WarshipId = (uint)session.Player.User.WarshipId }
|
||||||
|
};
|
||||||
|
SetWarshipRsp Rsp = new() { retcode = SetWarshipRsp.Retcode.Succ };
|
||||||
|
|
||||||
|
session.Send(Packet.FromProto(MainDataRsp, CmdId.GetMainDataRsp), Packet.FromProto(Rsp, CmdId.SetWarshipRsp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user