refactor manager & add giveall command

- giveall only weapon for now
- move all item into SyncPlayer to prevent RspLogin too large
This commit is contained in:
Naruse
2026-04-27 14:33:25 +08:00
parent ac087f240b
commit 4bf3f0d715
15 changed files with 205 additions and 72 deletions

View File

@@ -22,7 +22,7 @@ public class CharacterInfo
public int Trust { get; set; }
public uint WeaponUniqueId { get; set; }
public uint SkinId { get; set; }
public ItemFlagEnum Flag { get; set; }
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; } = [];

View File

@@ -24,7 +24,8 @@ public class BaseGameItemInfo
public uint UniqueId { get; set; }
public ulong TemplateId { get; set; }
public uint ItemCount { get; set; }
public ItemFlagEnum Flag { get; set; }
public ItemTypeEnum ItemType { get; set; }
public ItemFlagEnum Flag { get; set; } = ItemFlagEnum.FLAG_READED;
public virtual Item ToProto()
{

View File

@@ -120,6 +120,7 @@ public class CommandTextCHS
public NoticeTextCHS Notice { get; } = new();
public HelpTextCHS Help { get; } = new();
public GirlTextCHS Girl { get; } = new();
public GiveAllTextCHS GiveAll { get; } = new();
}
#endregion
@@ -224,6 +225,18 @@ public class GirlTextCHS
public string UpdateLevel => "已将 {1} 个角色等级设置为 {0}";
}
/// <summary>
/// path: Game.Command.GiveAll
/// </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} 把武器给玩家!";
}
#endregion
#endregion

View File

@@ -120,6 +120,7 @@ public class CommandTextCHT
public NoticeTextCHT Notice { get; } = new();
public HelpTextCHT Help { get; } = new();
public GirlTextCHT Girl { get; } = new();
public GiveAllTextCHT GiveAll { get; } = new();
}
#endregion
@@ -224,6 +225,18 @@ public class GirlTextCHT
public string UpdateLevel => "已將 {1} 個角色等級設為 {0}";
}
/// <summary>
/// path: Game.Command.GiveAll
/// </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} 把武器給玩家!";
}
#endregion
#endregion

View File

@@ -82,6 +82,7 @@ public class CommandTextEN
public NoticeTextEN Notice { get; } = new();
public HelpTextEN Help { get; } = new();
public GirlTextEN Girl { get; } = new();
public GiveAllTextEN GiveAll { get; } = new();
}
#endregion
@@ -193,6 +194,18 @@ public class GirlTextEN
public string UpdateLevel => "Set {1} character(s) to level {0}!";
}
/// <summary>
/// path: Game.Command.GiveAll
/// </summary>
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!";
}
#endregion
#endregion