地图相关协议提交
This commit is contained in:
@@ -20,10 +20,16 @@ namespace NBF.Fishing2
|
|||||||
{
|
{
|
||||||
var roomResponse = (Map2C_CreateRoomResponse)await Net.Call(new C2Map_CreateRoomRequest()
|
var roomResponse = (Map2C_CreateRoomResponse)await Net.Call(new C2Map_CreateRoomRequest()
|
||||||
{
|
{
|
||||||
MapId = response.MapId,
|
MapId = response.MapId
|
||||||
Password = "123456"
|
|
||||||
});
|
});
|
||||||
Log.Info($"创建房间返回={roomResponse.MapId} Code={roomResponse.RoomCode} 房间玩家数量={roomResponse.Units.Count}");
|
Log.Info($"创建房间返回 Code={roomResponse.RoomCode} 房间玩家数量={roomResponse.Units.Count}");
|
||||||
|
|
||||||
|
//执行进入房间
|
||||||
|
var roomResponse2 = (G2C_EnterRoomResponse)await Net.Call(new C2G_EnterRoomRequest()
|
||||||
|
{
|
||||||
|
RoomCode = roomResponse.RoomCode
|
||||||
|
});
|
||||||
|
Log.Info($"进入房间返回 Code={roomResponse2.RoomCode} 房间玩家数量={roomResponse2.Units.Count}");
|
||||||
}
|
}
|
||||||
|
|
||||||
await FTask.CompletedTask;
|
await FTask.CompletedTask;
|
||||||
|
|||||||
@@ -111,6 +111,53 @@ namespace NBC
|
|||||||
[ProtoMember(3)]
|
[ProtoMember(3)]
|
||||||
public uint ErrorCode { get; set; }
|
public uint ErrorCode { get; set; }
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 请求网关离开房间
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class C2G_ExitRoomRequest : AMessage, IRequest, IProto
|
||||||
|
{
|
||||||
|
public static C2G_ExitRoomRequest Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<C2G_ExitRoomRequest>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
RoomCode = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<C2G_ExitRoomRequest>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoIgnore]
|
||||||
|
public G2C_ExitRoomResponse ResponseType { get; set; }
|
||||||
|
public uint OpCode() { return OuterOpcode.C2G_ExitRoomRequest; }
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public string RoomCode { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 请求网关进入离开响应
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class G2C_ExitRoomResponse : AMessage, IResponse, IProto
|
||||||
|
{
|
||||||
|
public static G2C_ExitRoomResponse Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<G2C_ExitRoomResponse>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
ErrorCode = default;
|
||||||
|
RoomCode = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<G2C_ExitRoomResponse>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.G2C_ExitRoomResponse; }
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public string RoomCode { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public uint ErrorCode { get; set; }
|
||||||
|
}
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public partial class C2Map_EnterMapRequest : AMessage, ICustomRouteRequest, IProto
|
public partial class C2Map_EnterMapRequest : AMessage, ICustomRouteRequest, IProto
|
||||||
{
|
{
|
||||||
@@ -146,15 +193,12 @@ namespace NBC
|
|||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
ErrorCode = default;
|
ErrorCode = default;
|
||||||
MapId = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
GetScene().MessagePoolComponent.Return<Map2C_EnterMapResponse>(this);
|
GetScene().MessagePoolComponent.Return<Map2C_EnterMapResponse>(this);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
public uint OpCode() { return OuterOpcode.Map2C_EnterMapResponse; }
|
public uint OpCode() { return OuterOpcode.Map2C_EnterMapResponse; }
|
||||||
[ProtoMember(1)]
|
[ProtoMember(1)]
|
||||||
public int MapId { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public uint ErrorCode { get; set; }
|
public uint ErrorCode { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,30 @@ namespace NBC
|
|||||||
}
|
}
|
||||||
public uint OpCode() { return OuterOpcode.G2C_RepeatLogin; }
|
public uint OpCode() { return OuterOpcode.G2C_RepeatLogin; }
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 通知客户端切换地图
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class G2C_ChangeMap : AMessage, IMessage, IProto
|
||||||
|
{
|
||||||
|
public static G2C_ChangeMap Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<G2C_ChangeMap>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
MapId = default;
|
||||||
|
Node = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<G2C_ChangeMap>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.G2C_ChangeMap; }
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public int MapId { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public int Node { get; set; }
|
||||||
|
}
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public partial class C2Game_GetRoleInfoRequest : AMessage, ICustomRouteRequest, IProto
|
public partial class C2Game_GetRoleInfoRequest : AMessage, ICustomRouteRequest, IProto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,13 +6,16 @@ namespace Fantasy
|
|||||||
public const uint Map2C_CreateRoomResponse = 2415929105;
|
public const uint Map2C_CreateRoomResponse = 2415929105;
|
||||||
public const uint C2G_EnterRoomRequest = 268445457;
|
public const uint C2G_EnterRoomRequest = 268445457;
|
||||||
public const uint G2C_EnterRoomResponse = 402663185;
|
public const uint G2C_EnterRoomResponse = 402663185;
|
||||||
|
public const uint C2G_ExitRoomRequest = 268445458;
|
||||||
|
public const uint G2C_ExitRoomResponse = 402663186;
|
||||||
public const uint C2Map_EnterMapRequest = 2281711378;
|
public const uint C2Map_EnterMapRequest = 2281711378;
|
||||||
public const uint Map2C_EnterMapResponse = 2415929106;
|
public const uint Map2C_EnterMapResponse = 2415929106;
|
||||||
public const uint C2A_LoginRequest = 268445458;
|
public const uint C2A_LoginRequest = 268445459;
|
||||||
public const uint A2C_LoginResponse = 402663186;
|
public const uint A2C_LoginResponse = 402663187;
|
||||||
public const uint C2G_LoginRequest = 268445459;
|
public const uint C2G_LoginRequest = 268445460;
|
||||||
public const uint G2C_LoginResponse = 402663187;
|
public const uint G2C_LoginResponse = 402663188;
|
||||||
public const uint G2C_RepeatLogin = 134227729;
|
public const uint G2C_RepeatLogin = 134227729;
|
||||||
|
public const uint G2C_ChangeMap = 134227730;
|
||||||
public const uint C2Game_GetRoleInfoRequest = 2281711379;
|
public const uint C2Game_GetRoleInfoRequest = 2281711379;
|
||||||
public const uint Game2C_GetRoleInfoResponse = 2415929107;
|
public const uint Game2C_GetRoleInfoResponse = 2415929107;
|
||||||
public const uint C2Map_EnterRoomRequest = 2281711380;
|
public const uint C2Map_EnterRoomRequest = 2281711380;
|
||||||
|
|||||||
Reference in New Issue
Block a user