房间创建和进入相关逻辑和协议
This commit is contained in:
@@ -56,7 +56,7 @@ namespace Fantasy
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
RoleRouteId = default;
|
||||
UnitRouteId = default;
|
||||
RouteType = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2Common_EnterResponse>(this);
|
||||
@@ -64,7 +64,7 @@ namespace Fantasy
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.G2Common_EnterResponse; }
|
||||
[ProtoMember(1)]
|
||||
public long RoleRouteId { get; set; }
|
||||
public long UnitRouteId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public int RouteType { get; set; }
|
||||
[ProtoMember(3)]
|
||||
@@ -200,4 +200,57 @@ namespace Fantasy
|
||||
[ProtoMember(1)]
|
||||
public long ChannelId { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 请求进入房间
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class G2Map_EnterRoomRequest : AMessage, IRouteRequest, IProto
|
||||
{
|
||||
public static G2Map_EnterRoomRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2Map_EnterRoomRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
RoomCode = default;
|
||||
AccountId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2Map_EnterRoomRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Map2G_EnterRoomResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.G2Map_EnterRoomRequest; }
|
||||
[ProtoMember(1)]
|
||||
public string RoomCode { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long AccountId { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 请求进入房间响应
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Map2G_EnterRoomResponse : AMessage, IRouteResponse, IProto
|
||||
{
|
||||
public static Map2G_EnterRoomResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Map2G_EnterRoomResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
RoomCode = default;
|
||||
Units.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Map2G_EnterRoomResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.Map2G_EnterRoomResponse; }
|
||||
[ProtoMember(1)]
|
||||
public string RoomCode { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public List<MapUnitInfo> Units = new List<MapUnitInfo>();
|
||||
[ProtoMember(3)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user