进入和离开地图和房间协议合并

This commit is contained in:
2025-09-09 00:17:50 +08:00
parent ebb1a467c4
commit a2c5b61ba8
16 changed files with 228 additions and 287 deletions

View File

@@ -204,53 +204,59 @@ namespace Fantasy
/// 请求进入房间
/// </summary>
[ProtoContract]
public partial class G2Map_EnterRoomRequest : AMessage, IRouteRequest, IProto
public partial class G2Map_EnterMapRequest : AMessage, IRouteRequest, IProto
{
public static G2Map_EnterRoomRequest Create(Scene scene)
public static G2Map_EnterMapRequest Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<G2Map_EnterRoomRequest>();
return scene.MessagePoolComponent.Rent<G2Map_EnterMapRequest>();
}
public override void Dispose()
{
RoomCode = default;
AccountId = default;
MapId = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<G2Map_EnterRoomRequest>(this);
GetScene().MessagePoolComponent.Return<G2Map_EnterMapRequest>(this);
#endif
}
[ProtoIgnore]
public Map2G_EnterRoomResponse ResponseType { get; set; }
public uint OpCode() { return InnerOpcode.G2Map_EnterRoomRequest; }
public Map2G_EnterMapResponse ResponseType { get; set; }
public uint OpCode() { return InnerOpcode.G2Map_EnterMapRequest; }
[ProtoMember(1)]
public string RoomCode { get; set; }
[ProtoMember(2)]
public long AccountId { get; set; }
[ProtoMember(3)]
public int MapId { get; set; }
}
/// <summary>
/// 请求进入房间响应
/// </summary>
[ProtoContract]
public partial class Map2G_EnterRoomResponse : AMessage, IRouteResponse, IProto
public partial class Map2G_EnterMapResponse : AMessage, IRouteResponse, IProto
{
public static Map2G_EnterRoomResponse Create(Scene scene)
public static Map2G_EnterMapResponse Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<Map2G_EnterRoomResponse>();
return scene.MessagePoolComponent.Rent<Map2G_EnterMapResponse>();
}
public override void Dispose()
{
ErrorCode = default;
RoomCode = default;
MapId = default;
Units.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<Map2G_EnterRoomResponse>(this);
GetScene().MessagePoolComponent.Return<Map2G_EnterMapResponse>(this);
#endif
}
public uint OpCode() { return InnerOpcode.Map2G_EnterRoomResponse; }
public uint OpCode() { return InnerOpcode.Map2G_EnterMapResponse; }
[ProtoMember(1)]
public string RoomCode { get; set; }
[ProtoMember(2)]
public List<MapUnitInfo> Units = new List<MapUnitInfo>();
public int MapId { get; set; }
[ProtoMember(3)]
public List<MapUnitInfo> Units = new List<MapUnitInfo>();
[ProtoMember(4)]
public uint ErrorCode { get; set; }
}
/// <summary>