This commit is contained in:
2025-08-25 23:56:13 +08:00
parent 8c3be0a5bb
commit e0665aae01
15 changed files with 211 additions and 105 deletions

View File

@@ -18,18 +18,18 @@ using Fantasy.Serialize;
namespace Fantasy
{
[ProtoContract]
public partial class RoleGearItemInfo : AMessage, IProto
public partial class UnitGearItemInfo : AMessage, IProto
{
public static RoleGearItemInfo Create(Scene scene)
public static UnitGearItemInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<RoleGearItemInfo>();
return scene.MessagePoolComponent.Rent<UnitGearItemInfo>();
}
public override void Dispose()
{
Id = default;
ConfigId = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<RoleGearItemInfo>(this);
GetScene().MessagePoolComponent.Return<UnitGearItemInfo>(this);
#endif
}
[ProtoMember(1)]
@@ -38,11 +38,11 @@ namespace Fantasy
public int ConfigId { get; set; }
}
[ProtoContract]
public partial class RoleGearInfo : AMessage, IProto
public partial class UnitGearInfo : AMessage, IProto
{
public static RoleGearInfo Create(Scene scene)
public static UnitGearInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<RoleGearInfo>();
return scene.MessagePoolComponent.Rent<UnitGearInfo>();
}
public override void Dispose()
{
@@ -57,29 +57,29 @@ namespace Fantasy
Leader = default;
Feeder = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<RoleGearInfo>(this);
GetScene().MessagePoolComponent.Return<UnitGearInfo>(this);
#endif
}
[ProtoMember(1)]
public RoleGearItemInfo Rod { get; set; }
public UnitGearItemInfo Rod { get; set; }
[ProtoMember(2)]
public RoleGearItemInfo Reel { get; set; }
public UnitGearItemInfo Reel { get; set; }
[ProtoMember(3)]
public RoleGearItemInfo Bobber { get; set; }
public UnitGearItemInfo Bobber { get; set; }
[ProtoMember(4)]
public RoleGearItemInfo Hook { get; set; }
public UnitGearItemInfo Hook { get; set; }
[ProtoMember(5)]
public RoleGearItemInfo Bait { get; set; }
public UnitGearItemInfo Bait { get; set; }
[ProtoMember(6)]
public RoleGearItemInfo Lure { get; set; }
public UnitGearItemInfo Lure { get; set; }
[ProtoMember(7)]
public RoleGearItemInfo Weight { get; set; }
public UnitGearItemInfo Weight { get; set; }
[ProtoMember(8)]
public RoleGearItemInfo Line { get; set; }
public UnitGearItemInfo Line { get; set; }
[ProtoMember(9)]
public RoleGearItemInfo Leader { get; set; }
public UnitGearItemInfo Leader { get; set; }
[ProtoMember(10)]
public RoleGearItemInfo Feeder { get; set; }
public UnitGearItemInfo Feeder { get; set; }
}
[ProtoContract]
public partial class Vector3Info : AMessage, IProto
@@ -131,11 +131,11 @@ namespace Fantasy
public float w { get; set; }
}
[ProtoContract]
public partial class RoleFishingInfo : AMessage, IProto
public partial class UnitFishingInfo : AMessage, IProto
{
public static RoleFishingInfo Create(Scene scene)
public static UnitFishingInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<RoleFishingInfo>();
return scene.MessagePoolComponent.Rent<UnitFishingInfo>();
}
public override void Dispose()
{
@@ -144,7 +144,7 @@ namespace Fantasy
OpenLight = default;
RodSetting = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<RoleFishingInfo>(this);
GetScene().MessagePoolComponent.Return<UnitFishingInfo>(this);
#endif
}
[ProtoMember(1)]
@@ -157,18 +157,18 @@ namespace Fantasy
public int RodSetting { get; set; }
}
[ProtoContract]
public partial class RoleStateInfo : AMessage, IProto
public partial class UnitStateInfo : AMessage, IProto
{
public static RoleStateInfo Create(Scene scene)
public static UnitStateInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<RoleStateInfo>();
return scene.MessagePoolComponent.Rent<UnitStateInfo>();
}
public override void Dispose()
{
State = default;
Args.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<RoleStateInfo>(this);
GetScene().MessagePoolComponent.Return<UnitStateInfo>(this);
#endif
}
[ProtoMember(1)]
@@ -177,11 +177,11 @@ namespace Fantasy
public List<string> Args = new List<string>();
}
[ProtoContract]
public partial class MapRoleInfo : AMessage, IProto
public partial class MapUnitInfo : AMessage, IProto
{
public static MapRoleInfo Create(Scene scene)
public static MapUnitInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<MapRoleInfo>();
return scene.MessagePoolComponent.Rent<MapUnitInfo>();
}
public override void Dispose()
{
@@ -191,8 +191,9 @@ namespace Fantasy
State = default;
Gears = default;
FishingInfo = default;
KV.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<MapRoleInfo>(this);
GetScene().MessagePoolComponent.Return<MapUnitInfo>(this);
#endif
}
[ProtoMember(1)]
@@ -200,27 +201,29 @@ namespace Fantasy
[ProtoMember(2)]
public RoleSimpleInfo RoleInfo { get; set; }
[ProtoMember(3)]
public MapRolePositionInfo Location { get; set; }
public MapUnitPositionInfo Location { get; set; }
[ProtoMember(4)]
public RoleStateInfo State { get; set; }
public UnitStateInfo State { get; set; }
[ProtoMember(5)]
public RoleGearInfo Gears { get; set; }
public UnitGearInfo Gears { get; set; }
[ProtoMember(6)]
public RoleFishingInfo FishingInfo { get; set; }
public UnitFishingInfo FishingInfo { get; set; }
[ProtoMember(7)]
public List<KeyValueInt32> KV = new List<KeyValueInt32>();
}
[ProtoContract]
public partial class MapRolePositionInfo : AMessage, IProto
public partial class MapUnitPositionInfo : AMessage, IProto
{
public static MapRolePositionInfo Create(Scene scene)
public static MapUnitPositionInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<MapRolePositionInfo>();
return scene.MessagePoolComponent.Rent<MapUnitPositionInfo>();
}
public override void Dispose()
{
Position = default;
Rotation = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<MapRolePositionInfo>(this);
GetScene().MessagePoolComponent.Return<MapUnitPositionInfo>(this);
#endif
}
[ProtoMember(1)]
@@ -229,24 +232,52 @@ namespace Fantasy
public QuaternionInfo Rotation { get; set; }
}
[ProtoContract]
public partial class Map2C_CreateMapResponse : AMessage, ICustomRouteResponse, IProto
public partial class C2Map_CreateRoomRequest : AMessage, ICustomRouteRequest, IProto
{
public static Map2C_CreateMapResponse Create(Scene scene)
public static C2Map_CreateRoomRequest Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<Map2C_CreateMapResponse>();
return scene.MessagePoolComponent.Rent<C2Map_CreateRoomRequest>();
}
public override void Dispose()
{
MapId = default;
Password = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2Map_CreateRoomRequest>(this);
#endif
}
[ProtoIgnore]
public Map2C_CreateRoomResponse ResponseType { get; set; }
public uint OpCode() { return OuterOpcode.C2Map_CreateRoomRequest; }
[ProtoIgnore]
public int RouteType => Fantasy.RouteType.MapRoute;
[ProtoMember(1)]
public int MapId { get; set; }
[ProtoMember(2)]
public string Password { get; set; }
}
[ProtoContract]
public partial class Map2C_CreateRoomResponse : AMessage, ICustomRouteResponse, IProto
{
public static Map2C_CreateRoomResponse Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<Map2C_CreateRoomResponse>();
}
public override void Dispose()
{
ErrorCode = default;
Roles.Clear();
MapId = default;
RoomId = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<Map2C_CreateMapResponse>(this);
GetScene().MessagePoolComponent.Return<Map2C_CreateRoomResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.Map2C_CreateMapResponse; }
public uint OpCode() { return OuterOpcode.Map2C_CreateRoomResponse; }
[ProtoMember(1)]
public List<MapRoleInfo> Roles = new List<MapRoleInfo>();
public int MapId { get; set; }
[ProtoMember(2)]
public long RoomId { get; set; }
[ProtoMember(3)]
public uint ErrorCode { get; set; }
}
[ProtoContract]
@@ -285,14 +316,17 @@ namespace Fantasy
{
ErrorCode = default;
Roles.Clear();
MapId = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<Map2C_EnterMapResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.Map2C_EnterMapResponse; }
[ProtoMember(1)]
public List<MapRoleInfo> Roles = new List<MapRoleInfo>();
public List<MapUnitInfo> Roles = new List<MapUnitInfo>();
[ProtoMember(2)]
public long MapId { get; set; }
[ProtoMember(3)]
public uint ErrorCode { get; set; }
}
[ProtoContract]
@@ -314,7 +348,7 @@ namespace Fantasy
[ProtoIgnore]
public int RouteType => Fantasy.RouteType.MapRoute;
[ProtoMember(1)]
public MapRolePositionInfo Location { get; set; }
public MapUnitPositionInfo Location { get; set; }
[ProtoMember(2)]
public bool IsStop { get; set; }
}
@@ -339,7 +373,7 @@ namespace Fantasy
[ProtoIgnore]
public int RouteType => Fantasy.RouteType.MapRoute;
[ProtoMember(1)]
public MapRoleInfo Info { get; set; }
public MapUnitInfo Info { get; set; }
}
/// <summary>
/// 用户离开地图
@@ -388,7 +422,7 @@ namespace Fantasy
[ProtoMember(1)]
public long Id { get; set; }
[ProtoMember(2)]
public RoleStateInfo State { get; set; }
public UnitStateInfo State { get; set; }
}
/// <summary>
/// 玩家钓组状态变化
@@ -414,7 +448,7 @@ namespace Fantasy
[ProtoMember(1)]
public long Id { get; set; }
[ProtoMember(2)]
public RoleFishingInfo State { get; set; }
public UnitFishingInfo State { get; set; }
}
/// <summary>
/// 玩家钓组变化
@@ -440,7 +474,7 @@ namespace Fantasy
[ProtoMember(1)]
public long Id { get; set; }
[ProtoMember(2)]
public RoleGearInfo Gears { get; set; }
public UnitGearInfo Gears { get; set; }
}
/// <summary>
/// 玩家位置变化
@@ -463,6 +497,6 @@ namespace Fantasy
[ProtoMember(1)]
public long Id { get; set; }
[ProtoMember(2)]
public MapRolePositionInfo Location { get; set; }
public MapUnitPositionInfo Location { get; set; }
}
}