修改钓组相关协议

This commit is contained in:
2025-09-01 23:57:34 +08:00
parent 7cdad80c7a
commit 61d20b5729
16 changed files with 240 additions and 146 deletions

View File

@@ -155,6 +155,7 @@ namespace Fantasy
Currency.Clear();
Slots.Clear();
Skills.Clear();
Gears.Clear();
MapId = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<RoleInfo>(this);
@@ -177,6 +178,8 @@ namespace Fantasy
[ProtoMember(8)]
public List<SkillInfo> Skills = new List<SkillInfo>();
[ProtoMember(9)]
public List<GearInfo> Gears = new List<GearInfo>();
[ProtoMember(10)]
public int MapId { get; set; }
}
/// <summary>
@@ -382,4 +385,27 @@ namespace Fantasy
[ProtoMember(3)]
public int Exp { get; set; }
}
/// <summary>
/// 玩家当前使用钓组信息
/// </summary>
[ProtoContract]
public partial class GearInfo : AMessage, IProto
{
public static GearInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<GearInfo>();
}
public override void Dispose()
{
Rod = default;
Rigs.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<GearInfo>(this);
#endif
}
[ProtoMember(1)]
public long Rod { get; set; }
[ProtoMember(2)]
public List<long> Rigs = new List<long>();
}
}

View File

@@ -17,70 +17,6 @@ using Fantasy.Serialize;
namespace Fantasy
{
[ProtoContract]
public partial class UnitGearItemInfo : AMessage, IProto
{
public static UnitGearItemInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<UnitGearItemInfo>();
}
public override void Dispose()
{
Id = default;
ConfigId = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<UnitGearItemInfo>(this);
#endif
}
[ProtoMember(1)]
public long Id { get; set; }
[ProtoMember(2)]
public int ConfigId { get; set; }
}
[ProtoContract]
public partial class UnitGearInfo : AMessage, IProto
{
public static UnitGearInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<UnitGearInfo>();
}
public override void Dispose()
{
Rod = default;
Reel = default;
Bobber = default;
Hook = default;
Bait = default;
Lure = default;
Weight = default;
Line = default;
Leader = default;
Feeder = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<UnitGearInfo>(this);
#endif
}
[ProtoMember(1)]
public UnitGearItemInfo Rod { get; set; }
[ProtoMember(2)]
public UnitGearItemInfo Reel { get; set; }
[ProtoMember(3)]
public UnitGearItemInfo Bobber { get; set; }
[ProtoMember(4)]
public UnitGearItemInfo Hook { get; set; }
[ProtoMember(5)]
public UnitGearItemInfo Bait { get; set; }
[ProtoMember(6)]
public UnitGearItemInfo Lure { get; set; }
[ProtoMember(7)]
public UnitGearItemInfo Weight { get; set; }
[ProtoMember(8)]
public UnitGearItemInfo Line { get; set; }
[ProtoMember(9)]
public UnitGearItemInfo Leader { get; set; }
[ProtoMember(10)]
public UnitGearItemInfo Feeder { get; set; }
}
[ProtoContract]
public partial class Vector3Info : AMessage, IProto
{
@@ -205,7 +141,7 @@ namespace Fantasy
[ProtoMember(4)]
public UnitStateInfo State { get; set; }
[ProtoMember(5)]
public UnitGearInfo Gears { get; set; }
public GearInfo Gears { get; set; }
[ProtoMember(6)]
public UnitFishingInfo FishingInfo { get; set; }
[ProtoMember(7)]

View File

@@ -211,7 +211,7 @@ namespace Fantasy
[ProtoMember(1)]
public long Id { get; set; }
[ProtoMember(2)]
public UnitGearInfo Gears { get; set; }
public GearInfo Gears { get; set; }
}
/// <summary>
/// 玩家位置变化