Merge remote-tracking branch 'origin/main' into work-for-linux

This commit is contained in:
cs8425
2026-04-29 22:38:36 +08:00
41 changed files with 1606 additions and 110 deletions

View File

@@ -60,6 +60,7 @@ public class ServerOption
public string FallbackLanguage { get; set; } = "EN";
public string[] DefaultPermissions { get; set; } = ["Admin"];
public ServerProfile ServerProfile { get; set; } = new();
public bool EnableGmMenu { get; set; } = true;
public bool AutoCreateUser { get; set; } = true;
public bool SavePersonalDebugFile { get; set; } = false;
public bool AutoSendResponseWhenNoHandler { get; set; } = true;

View File

@@ -0,0 +1,34 @@
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
[ResourceEntity("break.json")]
public class BreakExcel : ExcelResource
{
[JsonProperty("ID")] public int Id { get; set; }
[JsonProperty("Items1")] public List<List<int>> Items1 { get; set; } = [];
[JsonProperty("Items2")] public List<List<int>> Items2 { get; set; } = [];
[JsonProperty("Items3")] public List<List<int>> Items3 { get; set; } = [];
[JsonProperty("Items4")] public List<List<int>> Items4 { get; set; } = [];
[JsonProperty("Items5")] public List<List<int>> Items5 { get; set; } = [];
[JsonProperty("Items6")] public List<List<int>> Items6 { get; set; } = [];
public List<List<int>> GetItems(uint breakLevel) => breakLevel switch
{
1 => Items1,
2 => Items2,
3 => Items3,
4 => Items4,
5 => Items5,
6 => Items6,
_ => []
};
public override uint GetId() => (uint)Id;
public override void Loaded()
{
GameData.BreakData[Id] = this;
}
}

View File

@@ -0,0 +1,24 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace MikuSB.Data.Excel;
[ResourceEntity("call_item.json")]
public class CallItemExcel : ExcelResource
{
public uint Genre { get; set; }
public uint Detail { get; set; }
public uint Particular { get; set; }
public uint Level { get; set; }
public string I18n { get; set; } = "";
public override uint GetId()
{
return (uint)I18n.GetHashCode();
}
public override void Loaded()
{
GameData.CallItemData.Add(GetId(), this);
}
}

View File

@@ -0,0 +1,27 @@
using Newtonsoft.Json;
namespace MikuSB.Data.Excel;
[ResourceEntity("card_skin_parts.json")]
public class CardSkinPartsExcel : ExcelResource
{
public uint Genre { get; set; }
public uint Detail { get; set; }
public uint Particular { get; set; }
public uint Level { get; set; }
public uint Icon { get; set; }
public int AppearID { get; set; }
[JsonProperty("profile")] public List<List<int>> CardSkinID { get; set; } = [];
public string I18n { get; set; } = "";
[JsonIgnore] public ulong TemplateId { get; set; }
public override uint GetId()
{
return (uint)I18n.GetHashCode();
}
public override void Loaded()
{
TemplateId = GameResourceTemplateId.FromGdpl(Genre, Detail, Particular, Level);
GameData.CardSkinPartsData.Add(Icon, this);
}
}

View File

@@ -0,0 +1,14 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("daily_level.json")]
public class DailyLevelExcel : ExcelResource
{
public uint ID { get; set; }
public override uint GetId() => ID;
public override void Loaded()
{
GameData.DailyLevelData.Add(ID, this);
}
}

View File

@@ -0,0 +1,22 @@
namespace MikuSB.Data.Excel;
[ResourceEntity("profile.json")]
public class ProfileExcel : ExcelResource
{
public uint Genre { get; set; }
public uint Detail { get; set; }
public uint Particular { get; set; }
public uint Level { get; set; }
public string I18n { get; set; } = "";
public string LuaType { get; set; } = "";
public override uint GetId()
{
return (uint)I18n.GetHashCode();
}
public override void Loaded()
{
GameData.ProfileData.Add(GetId(), this);
}
}

View File

@@ -0,0 +1,24 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace MikuSB.Data.Excel;
[ResourceEntity("weapon_skin.json")]
public class WeaponSkinExcel : ExcelResource
{
public uint Genre { get; set; }
public uint Detail { get; set; }
public uint Particular { get; set; }
public uint Level { get; set; }
public string I18n { get; set; } = "";
public override uint GetId()
{
return (uint)I18n.GetHashCode();
}
public override void Loaded()
{
GameData.WeaponSkinData.Add(GetId(), this);
}
}

View File

@@ -16,9 +16,15 @@ public static class GameData
public static Dictionary<uint, ArItemExcel> ArItemData { get; private set; } = [];
public static Dictionary<uint, ManifestationExcel> ManifestationData { get; private set; } = [];
public static Dictionary<uint, Rogue3DDifficultExcel> Rogue3DDifficultData { get; private set; } = [];
public static Dictionary<int, BreakExcel> BreakData { get; private set; } = [];
public static Dictionary<uint, SpineExcel> SpineData { get; private set; } = [];
public static Dictionary<uint, NodeConditionExcel> NodeConditionData { get; private set; } = [];
public static List<SupportCardExcel> SupportCardData { get; private set; } = [];
public static Dictionary<uint, WeaponSkinExcel> WeaponSkinData { get; private set; } = [];
public static Dictionary<uint, DailyLevelExcel> DailyLevelData { get; private set; } = [];
public static Dictionary<uint, ProfileExcel> ProfileData { get; private set; } = [];
public static Dictionary<uint, CardSkinPartsExcel> CardSkinPartsData { get; private set; } = [];
public static Dictionary<uint, CallItemExcel> CallItemData { get; private set; } = [];
}
public static class GameResourceTemplateId

View File

@@ -23,13 +23,14 @@ public class CharacterInfo
public int Trust { get; set; }
public uint WeaponUniqueId { get; set; }
public uint SkinId { get; set; }
public uint WeaponSkinId { get; set; }
public uint SupportTeamIndex { get; set; } = 1;
public ItemFlagEnum Flag { get; set; } = ItemFlagEnum.FLAG_READED;
public uint Expiration { get; set; }
[SugarColumn(IsJson = true)] public List<uint> UnlockedSkin { get; set; } = [];
[SugarColumn(IsJson = true)] public List<uint> Spines { get; set; } = [];
[SugarColumn(IsJson = true)] public List<uint> Affixs { get; set; } = [];
// Key = EqSlot (= support card Detail), Value = support card UniqueId
[SugarColumn(IsJson = true)] public Dictionary<uint, uint> SupportSlots { get; set; } = [];
[SugarColumn(IsJson = true)] public Dictionary<uint, uint> SupportSlots { get; set; } = []; // Key = EqSlot (= support card Detail), Value = support card UniqueId
public long Timestamp { get; set; }
public uint Count { get; set; } = 1;
@@ -55,8 +56,10 @@ public class CharacterInfo
proto.Enhance.Spines.AddRange(Spines.Select(x => (ulong)x));
proto.Enhance.Affixs.AddRange(Affixs);
proto.Slots[4] = WeaponUniqueId;
proto.Slots[5] = SkinId;
proto.Slots[(uint)ItemCardSlotTypeEnum.SLOT_WEAPON] = WeaponUniqueId;
proto.Slots[(uint)ItemCardSlotTypeEnum.SLOT_SKIN] = SkinId;
proto.Slots[(uint)ItemCardSlotTypeEnum.SLOT_WEAPON_SKIN] = WeaponSkinId;
proto.Slots[(uint)ItemCardSlotTypeEnum.SLOT_SUPPORTERINDEX] = SupportTeamIndex;
foreach (var (slot, uid) in SupportSlots)
proto.Slots[slot] = uid;

View File

@@ -17,6 +17,12 @@ public class InventoryData : BaseDatabaseDataHelper
[SugarColumn(IsJson = true)]
public Dictionary<uint, GameSkinInfo> Skins { get; set; } = []; // Key: UniqueId
[SugarColumn(IsJson = true)]
public Dictionary<uint, GameSupportCardInfo> SupportCards { get; set; } = []; // Key: UniqueId
[SugarColumn(IsJson = true)]
public Dictionary<uint, uint> SkinTypesBySkinId { get; set; } = []; // Key: nSkinId, Value: client nType
}
public class BaseGameItemInfo
@@ -50,6 +56,7 @@ public abstract class GrowableItemInfo : BaseGameItemInfo
public new uint Level { get; set; }
public new uint Exp { get; set; }
public uint Break { get; set; }
public uint Evolue { get; set; }
public uint EquipAvatarId { get; set; }
}
@@ -67,13 +74,16 @@ public class GameWeaponInfo : GrowableItemInfo
{
Level = Level,
Exp = Exp,
Break = Break
Break = Break,
Evolue = Evolue
}
};
return proto;
}
}public class GameSkinInfo : BaseGameItemInfo
}
public class GameSkinInfo : BaseGameItemInfo
{
[SugarColumn(IsJson = true)] public Dictionary<uint, ulong> PartSlots { get; set; } = [];
public uint SkinType { get; set; }
public override Item ToProto()
{
@@ -84,7 +94,31 @@ public class GameWeaponInfo : GrowableItemInfo
Count = ItemCount,
Flag = (uint)Flag,
};
proto.Slots[11] = SkinType;
proto.Slots[(uint)ItemSkinSlotTypeEnum.SLOT_CARD_SKIL_TYPE] = Math.Min(SkinType, 1);
foreach (var (slot, uid) in PartSlots) proto.Slots[slot] = uid;
return proto;
}
}
}
public class GameSupportCardInfo : BaseGameItemInfo
{
public uint AffixId { get; set; }
public override Item ToProto()
{
var proto = new Item
{
Id = UniqueId,
Template = TemplateId,
Count = ItemCount,
Flag = (uint)Flag,
Enhance = new Enhance
{
Level = Level,
Exp = Exp
}
};
proto.Slots[(uint)ItemSupportCardSlotTypeEnum.SLOT_AFFIXINDEX] = AffixId;
return proto;
}
}

View File

@@ -1,13 +0,0 @@
namespace MikuSB.Enums.Item;
public enum ItemFlagEnum
{
FLAG_USE = 1,// 使用中
FLAG_LOCK = 2,// 锁定中
FLAG_READED = 4,// 道具已查看
FLAG_LEAVE = 8,// 角色大招后离场
FLAG_WEAPON_DEFAULT = 16,// 武器显示原始样式
FLAG_WEAPON_AUDIO = 32,// 武器消音器音效
FLAG_ROLE_LIKE = 64,// 心选角色
}

View File

@@ -25,4 +25,56 @@ public enum ItemTypeEnum
TYPE_MAIN_SCENE = 21, //主界面场景道具
TYPE_AR = 24, //AR道具
TYPE_CALL = 25, //电话陪伴道具
}
public enum ItemCardSlotTypeEnum
{
SLOT_SUPPORTERCARD1 = 1, // 后勤卡
SLOT_SUPPORTERCARD2 = 2, // 后勤卡
SLOT_SUPPORTERCARD3 = 3, // 后勤卡
SLOT_WEAPON = 4, // 武器
SLOT_SKIN = 5, // 时装
SLOT_WEAPON_SKIN = 6, // 武器时装
SLOT_SUPPORTERINDEX = 7, // 当前使用的后勤组
SLOT_SUPPORTERCARD4 = 8, // 后勤卡
SLOT_SUPPORTERCARD5 = 9, // 后勤卡
SLOT_SUPPORTERCARD6 = 10, // 后勤卡
SLOT_SUPPORTERCARD7 = 11, // 后勤卡
SLOT_SUPPORTERCARD8 = 12, // 后勤卡
SLOT_SUPPORTERCARD9 = 13, // 后勤卡
}
public enum ItemSkinPartSlotTypeEnum
{
SLOT_SkinPartSlot1 = 1,
SLOT_SkinPartSlot2 = 2,
SLOT_SkinPartSlot3 = 3,
SLOT_SkinPartSlot4 = 4,
SLOT_SkinPartSlot5 = 5,
SLOT_SkinPartSlot6 = 6,
SLOT_SkinPartSlot7 = 7,
SLOT_SkinPartSlot8 = 8,
SLOT_SkinPartSlot9 = 9,
SLOT_SkinPartSlot10 = 10,
}
public enum ItemSkinSlotTypeEnum
{
SLOT_CARD_SKIL_TYPE = 11
}
public enum ItemSupportCardSlotTypeEnum
{
SLOT_AFFIXINDEX = 1 // 可洗练的初始词缀索引
}
public enum ItemFlagEnum
{
FLAG_USE = 1, // 使用中
FLAG_LOCK = 2, // 锁定中
FLAG_READED = 4, // 道具已查看
FLAG_LEAVE = 8, // 角色大招后离场
FLAG_WEAPON_DEFAULT = 16, // 武器显示原始样式
FLAG_WEAPON_AUDIO = 32, // 武器消音器音效
FLAG_ROLE_LIKE = 64, // 心选角色
}

View File

@@ -0,0 +1,24 @@
namespace MikuSB.Enums.Player;
public enum ProfileShowItemTypeEnum
{
SHOWITEM_CARD1 = 1, //第1个展示卡
SHOWITEM_CARD2 = 2, //第2个展示卡
SHOWITEM_CARD3 = 3, //第3个展示卡
SHOWITEM_GIRL = 4, //看板娘
SHOWITEM_FACE = 5, //头像
SHOWITEM_FRAME = 6, //头像框
SHOWITEM_CARD4 = 7, //第4个展示卡
SHOWITEM_CARD5 = 8, //第5个展示卡
SHOWITEM_SKIN1 = 9, //第1个展示皮肤
SHOWITEM_SKIN2 = 10, //第2个展示皮肤
SHOWITEM_SKIN3 = 11, //第3个展示皮肤
SHOWITEM_SKIN4 = 12, //第4个展示皮肤
SHOWITEM_SKIN5 = 13, //第5个展示皮肤
SHOWITEM_BADGE1 = 14, //第一个展示勋章
SHOWITEM_BADGE2 = 15, //第二个展示勋章
SHOWITEM_BADGE3 = 16, //第三个展示勋章
SHOWITEM_COVER = 17, //展示封面
SHOWITEM_NAMECARD = 18, //展示名片
SHOWITEM_BUBBLE = 19, //聊天气泡
}

View File

@@ -35,6 +35,12 @@ public class ServerTextCHS
/// </summary>
public class WordTextCHS
{
public string CallItem => "召唤道具";
public string SkinPart => "皮肤部件";
public string Profile => "个人资料";
public string WeaponSkin => "武器皮肤";
public string SupportCard => "支援卡";
public string Weapon => "武器";
public string Rank => "星魂";
public string Avatar => "角色";
public string Material => "材料";
@@ -121,6 +127,7 @@ public class CommandTextCHS
public HelpTextCHS Help { get; } = new();
public GirlTextCHS Girl { get; } = new();
public GiveAllTextCHS GiveAll { get; } = new();
public DebugTextCHS Debug { get; } = new();
}
#endregion
@@ -218,11 +225,13 @@ public class GirlTextCHS
public string Usage =>
"用法: /girl add <detail/-1> -p<particular> -l<level> -s<star>\n" +
"用法: /girl level <guid/-1> <level>";
"用法: /girl level <guid/-1> <level>\n" +
"用法: /girl neuronic <guid/-1> <level>";
public string NotFound => "角色不存在!";
public string Added => "已为玩家添加 {0} 个角色!";
public string UpdateLevel => "已将 {1} 个角色等级设置为 {0}";
public string UpdateNeuronicLevel => "已将 {1} 个角色的神经元等级设置为 {0}";
}
/// <summary>
@@ -230,11 +239,31 @@ public class GirlTextCHS
/// </summary>
public class GiveAllTextCHS
{
public string Desc => "给玩家所有物品\n" +
"备注: -1 表全部";
public string Usage => "用法: /giveall weapon <detail/-1> -p<particular> -l<level>";
public string WeaponNotFound => "找不到武器!";
public string WeaponAdded => "已添加 {0} 把武器给玩家!";
public string Desc => "给玩家所有物品\n" +
"注意:-1 表全部";
public string Usage => "用法/giveall weapon <detail/-1> -p<特定> -l<等級>\n" +
"用法:/giveall weaponskin <detail/-1> -p<特定>\n" +
"用法:/giveall card <detail/-1> -p<特定> -l<等級>" +
"用法:/giveall profile <detail/-1> -g<类型> -p<特定> -l<等级>" +
"用法:/giveall skinpart <detail/-1> -g<類型> -p<特定> -l<等級>" +
"用法:/giveall call <detail/-1> -g<類型> -p<特定> -l<等級>";
public string NotFound => "未找到 {0}";
public string GiveAllItems => "已向玩家添加 {0} 个 {1}";
}
/// <summary>
/// path: Game.Command.Debug
/// </summary>
public class DebugTextCHS
{
public string Desc => "调试包输出开关";
public string Usage => "用法: /debug [on|off|simple|detail|file]";
public string Enabled => "已启用调试包输出。";
public string Disabled => "已禁用调试包输出。";
public string SimpleEnabled => "已启用简单调试包输出。";
public string DetailEnabled => "已启用详细调试包输出。";
public string FileEnabled => "个人调试文件输出已启用。";
public string FileDisabled => "个人调试文件输出已禁用。";
}
#endregion

View File

@@ -35,6 +35,12 @@ public class ServerTextCHT
/// </summary>
public class WordTextCHT
{
public string CallItem => "召喚道具";
public string SkinPart => "外觀部件";
public string Profile => "個人資料";
public string WeaponSkin => "武器外觀";
public string SupportCard => "支援卡";
public string Weapon => "武器";
public string Rank => "星魂";
public string Avatar => "角色";
public string Material => "材料";
@@ -121,6 +127,7 @@ public class CommandTextCHT
public HelpTextCHT Help { get; } = new();
public GirlTextCHT Girl { get; } = new();
public GiveAllTextCHT GiveAll { get; } = new();
public DebugTextCHT Debug { get; } = new();
}
#endregion
@@ -218,11 +225,13 @@ public class GirlTextCHT
public string Usage =>
"用法: /girl add <detail/-1> -p<particular> -l<level> -s<star>\n" +
"用法: /girl level <guid/-1> <level>";
"用法: /girl level <guid/-1> <level>\n" +
"用法: /girl neuronic <guid/-1> <level>";
public string NotFound => "角色不存在!";
public string Added => "已為玩家新增 {0} 個角色!";
public string UpdateLevel => "已將 {1} 個角色等級設為 {0}";
public string UpdateNeuronicLevel => "已將 {1} 個角色的神經元等級設置為 {0}";
}
/// <summary>
@@ -230,11 +239,31 @@ public class GirlTextCHT
/// </summary>
public class GiveAllTextCHT
{
public string Desc => "給玩家所有物品\n" +
"備註: -1 表全部";
public string Usage => "用法: /giveall weapon <detail/-1> -p<particular> -l<level>";
public string WeaponNotFound => "找不到武器!";
public string WeaponAdded => "已添加 {0} 把武器給玩家!";
public string Desc => "給玩家所有物品\n" +
"注意:-1 表全部";
public string Usage => "用法/giveall weapon <detail/-1> -p<特定> -l<等級>\n" +
"用法:/giveall weaponskin <detail/-1> -p<特定>\n" +
"用法:/giveall card <detail/-1> -p<特定> -l<等級>" +
"用法:/giveall profile <detail/-1> -g<類型> -p<特定> -l<等級>" +
"用法:/giveall skinpart <detail/-1> -g<類型> -p<特定> -l<等級>" +
"用法:/giveall call <detail/-1> -g<類型> -p<特定> -l<等級>";
public string NotFound => "未找到 {0}";
public string GiveAllItems => "已向玩家添加 {0} 個 {1}";
}
/// <summary>
/// path: Game.Command.Debug
/// </summary>
public class DebugTextCHT
{
public string Desc => "切換調試封包輸出";
public string Usage => "用法: /debug [on|off|simple|detail|file]";
public string Enabled => "已啟用調試封包輸出。";
public string Disabled => "已停用調試封包輸出。";
public string SimpleEnabled => "已啟用簡易調試封包輸出。";
public string DetailEnabled => "已啟用詳細調試封包輸出。";
public string FileEnabled => "個人調試檔案輸出已啟用。";
public string FileDisabled => "個人調試檔案輸出已停用。";
}
#endregion

View File

@@ -35,10 +35,13 @@ public class ServerTextEN
/// </summary>
public class WordTextEN
{
public string Star => "Star";
public string CallItem => "Call Item";
public string SkinPart => "Skin Part";
public string Profile => "Profile";
public string WeaponSkin => "Weapon Skin";
public string Valk => "Valkyrie";
public string Material => "Material";
public string Stigmata => "Stigmata";
public string SupportCard => "Support Card";
public string Weapon => "Weapon";
public string Banner => "Gacha";
public string Activity => "Activity";
@@ -83,6 +86,7 @@ public class CommandTextEN
public HelpTextEN Help { get; } = new();
public GirlTextEN Girl { get; } = new();
public GiveAllTextEN GiveAll { get; } = new();
public DebugTextEN Debug { get; } = new();
}
#endregion
@@ -187,11 +191,13 @@ public class GirlTextEN
public string Usage =>
"Usage: /girl add <detail/-1> -p<particular> -l<level> -s<star>\n" +
"Usage: /girl level <guid/-1> <level>";
"Usage: /girl level <guid/-1> <level>\n" +
"Usage: /girl neuronic <guid/-1> <level>";
public string NotFound => "Character not found!";
public string Added => "Granted {0} character(s) to player!";
public string UpdateLevel => "Set {1} character(s) to level {0}!";
public string UpdateNeuronicLevel => "Set {1} character(s) Neuronic to level {0}!";
}
/// <summary>
@@ -201,9 +207,29 @@ public class GiveAllTextEN
{
public string Desc => "Give all items to player\n"+
"Note: -1 means all";
public string Usage => "Usage: /giveall weapon <detail/-1> -p<particular> -l<level>";
public string WeaponNotFound => "Weapon not found!";
public string WeaponAdded => "Added {0} weapon(s) to player!";
public string Usage => "Usage: /giveall weapon <detail/-1> -p<particular> -l<level>\n" +
"Usage: /giveall weaponskin <detail/-1> -p<particular>\n" +
"Usage: /giveall card <detail/-1> -p<particular> -l<level>" +
"Usage: /giveall profile <detail/-1> -g<genre> -p<particular> -l<level>" +
"Usage: /giveall skinpart <detail/-1> -g<genre> -p<particular> -l<level>" +
"Usage: /giveall call <detail/-1> -g<genre> -p<particular> -l<level>";
public string NotFound => "{0} not found!";
public string GiveAllItems => "Added {0} {1} to player!";
}
/// <summary>
/// path: Game.Command.Debug
/// </summary>
public class DebugTextEN
{
public string Desc => "Toggle debug packet output";
public string Usage => "Usage: /debug [on|off|simple|detail|file]";
public string Enabled => "Debug packet output enabled.";
public string Disabled => "Debug packet output disabled.";
public string SimpleEnabled => "Simple debug packet output enabled.";
public string DetailEnabled => "Detailed debug packet output enabled.";
public string FileEnabled => "Personal debug file output enabled.";
public string FileDisabled => "Personal debug file output disabled.";
}
#endregion