角色控制和房间进入推送
This commit is contained in:
@@ -189,7 +189,7 @@ namespace Fantasy
|
||||
[ProtoMember(1)]
|
||||
public int MapId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long RoomId { get; set; }
|
||||
public string RoomId { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Map2C_EnterMapResponse : AMessage, ICustomRouteResponse, IProto
|
||||
|
||||
@@ -41,6 +41,26 @@ namespace Fantasy
|
||||
public float z { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Vector2Info : AMessage, IProto
|
||||
{
|
||||
public static Vector2Info Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Vector2Info>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
x = default;
|
||||
y = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Vector2Info>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoMember(1)]
|
||||
public float x { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public float y { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class QuaternionInfo : AMessage, IProto
|
||||
{
|
||||
public static QuaternionInfo Create(Scene scene)
|
||||
@@ -123,7 +143,8 @@ namespace Fantasy
|
||||
{
|
||||
Id = default;
|
||||
RoleInfo = default;
|
||||
Location = default;
|
||||
Position = default;
|
||||
Rotation = default;
|
||||
State = default;
|
||||
Gears = default;
|
||||
FishingInfo = default;
|
||||
@@ -137,34 +158,16 @@ namespace Fantasy
|
||||
[ProtoMember(2)]
|
||||
public RoleSimpleInfo RoleInfo { get; set; }
|
||||
[ProtoMember(3)]
|
||||
public MapUnitPositionInfo Location { get; set; }
|
||||
public Vector3Info Position { get; set; }
|
||||
[ProtoMember(4)]
|
||||
public UnitStateInfo State { get; set; }
|
||||
public Vector3Info Rotation { get; set; }
|
||||
[ProtoMember(5)]
|
||||
public GearInfo Gears { get; set; }
|
||||
public UnitStateInfo State { get; set; }
|
||||
[ProtoMember(6)]
|
||||
public UnitFishingInfo FishingInfo { get; set; }
|
||||
public GearInfo Gears { get; set; }
|
||||
[ProtoMember(7)]
|
||||
public UnitFishingInfo FishingInfo { get; set; }
|
||||
[ProtoMember(8)]
|
||||
public List<KeyValueInt32> KV = new List<KeyValueInt32>();
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class MapUnitPositionInfo : AMessage, IProto
|
||||
{
|
||||
public static MapUnitPositionInfo Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<MapUnitPositionInfo>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Position = default;
|
||||
Rotation = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<MapUnitPositionInfo>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoMember(1)]
|
||||
public Vector3Info Position { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public QuaternionInfo Rotation { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace Fantasy
|
||||
{
|
||||
ErrorCode = default;
|
||||
RoleInfo = default;
|
||||
RoomId = default;
|
||||
RoomCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Game2C_GetRoleInfoResponse>(this);
|
||||
#endif
|
||||
@@ -168,7 +168,7 @@ namespace Fantasy
|
||||
[ProtoMember(1)]
|
||||
public RoleInfo RoleInfo { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long RoomId { get; set; }
|
||||
public string RoomCode { get; set; }
|
||||
[ProtoMember(3)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
|
||||
@@ -18,45 +18,46 @@ namespace Fantasy
|
||||
public const uint G2C_RepeatLogin = 134227729;
|
||||
public const uint C2Game_GetRoleInfoRequest = 2281711379;
|
||||
public const uint Game2C_GetRoleInfoResponse = 2415929107;
|
||||
public const uint C2Map_EnterRoomRequest = 2281711380;
|
||||
public const uint Map2C_EnterRoomResponse = 2415929108;
|
||||
public const uint C2Map_Move = 2147493650;
|
||||
public const uint Map2C_RoleEnterMapNotify = 2147493651;
|
||||
public const uint Map2C_RoleExitMapNotify = 2147493652;
|
||||
public const uint Map2C_RoleStateNotify = 2147493653;
|
||||
public const uint Map2C_RoleGearStateNotify = 2147493654;
|
||||
public const uint Map2C_RoleGearChangeNotify = 2147493655;
|
||||
public const uint C2S_GetConversationsRequest = 2281711381;
|
||||
public const uint S2C_GetConversationsResponse = 2415929109;
|
||||
public const uint C2S_SendMailRequest = 2281711382;
|
||||
public const uint S2C_SendMailResponse = 2415929110;
|
||||
public const uint C2S_DeleteMailRequest = 2281711383;
|
||||
public const uint S2C_DeleteMailResponse = 2415929111;
|
||||
public const uint S2C_HaveMail = 2147493656;
|
||||
public const uint S2C_MailState = 2147493657;
|
||||
public const uint C2S_CreateChannelRequest = 2281711384;
|
||||
public const uint S2C_CreateChannelResponse = 2415929112;
|
||||
public const uint C2S_JoinChannelRequest = 2281711385;
|
||||
public const uint S2C_JoinChannelResponse = 2415929113;
|
||||
public const uint C2S_SendMessageRequest = 2281711386;
|
||||
public const uint S2C_SendMessageResponse = 2415929114;
|
||||
public const uint S2C_Message = 2147493658;
|
||||
public const uint C2S_CreateClubRequest = 2281711387;
|
||||
public const uint S2C_CreateClubResponse = 2415929115;
|
||||
public const uint C2S_GetClubInfoRequest = 2281711388;
|
||||
public const uint S2C_GetClubInfoResponse = 2415929116;
|
||||
public const uint C2S_GetMemberListRequest = 2281711389;
|
||||
public const uint S2C_GetMemberListResponse = 2415929117;
|
||||
public const uint C2S_GetClubListRequest = 2281711390;
|
||||
public const uint S2C_GetClubListResponse = 2415929118;
|
||||
public const uint C2S_JoinClubRequest = 2281711391;
|
||||
public const uint S2C_JoinClubResponse = 2415929119;
|
||||
public const uint C2S_LeaveClubRequest = 2281711392;
|
||||
public const uint S2C_LeaveClubResponse = 2415929120;
|
||||
public const uint C2S_DissolveClubRequest = 2281711393;
|
||||
public const uint S2C_DissolveClubResponse = 2415929121;
|
||||
public const uint C2S_DisposeJoinRequest = 2281711394;
|
||||
public const uint S2C_DisposeJoinResponse = 2415929122;
|
||||
public const uint S2C_ClubChange = 2147493659;
|
||||
public const uint Map2C_RoleEnterRoomNotify = 2147493650;
|
||||
public const uint Map2C_RoleExitRoomNotify = 2147493651;
|
||||
public const uint Map2C_RoleStateNotify = 2147493652;
|
||||
public const uint Map2C_RoleGearStateNotify = 2147493653;
|
||||
public const uint Map2C_RoleGearChangeNotify = 2147493654;
|
||||
public const uint C2Map_Move = 2147493655;
|
||||
public const uint C2Map_Look = 2147493656;
|
||||
public const uint Map2C_MoveNotify = 2147493657;
|
||||
public const uint Map2C_LookeNotify = 2147493658;
|
||||
public const uint C2S_GetConversationsRequest = 2281711380;
|
||||
public const uint S2C_GetConversationsResponse = 2415929108;
|
||||
public const uint C2S_SendMailRequest = 2281711381;
|
||||
public const uint S2C_SendMailResponse = 2415929109;
|
||||
public const uint C2S_DeleteMailRequest = 2281711382;
|
||||
public const uint S2C_DeleteMailResponse = 2415929110;
|
||||
public const uint S2C_HaveMail = 2147493659;
|
||||
public const uint S2C_MailState = 2147493660;
|
||||
public const uint C2S_CreateChannelRequest = 2281711383;
|
||||
public const uint S2C_CreateChannelResponse = 2415929111;
|
||||
public const uint C2S_JoinChannelRequest = 2281711384;
|
||||
public const uint S2C_JoinChannelResponse = 2415929112;
|
||||
public const uint C2S_SendMessageRequest = 2281711385;
|
||||
public const uint S2C_SendMessageResponse = 2415929113;
|
||||
public const uint S2C_Message = 2147493661;
|
||||
public const uint C2S_CreateClubRequest = 2281711386;
|
||||
public const uint S2C_CreateClubResponse = 2415929114;
|
||||
public const uint C2S_GetClubInfoRequest = 2281711387;
|
||||
public const uint S2C_GetClubInfoResponse = 2415929115;
|
||||
public const uint C2S_GetMemberListRequest = 2281711388;
|
||||
public const uint S2C_GetMemberListResponse = 2415929116;
|
||||
public const uint C2S_GetClubListRequest = 2281711389;
|
||||
public const uint S2C_GetClubListResponse = 2415929117;
|
||||
public const uint C2S_JoinClubRequest = 2281711390;
|
||||
public const uint S2C_JoinClubResponse = 2415929118;
|
||||
public const uint C2S_LeaveClubRequest = 2281711391;
|
||||
public const uint S2C_LeaveClubResponse = 2415929119;
|
||||
public const uint C2S_DissolveClubRequest = 2281711392;
|
||||
public const uint S2C_DissolveClubResponse = 2415929120;
|
||||
public const uint C2S_DisposeJoinRequest = 2281711393;
|
||||
public const uint S2C_DisposeJoinResponse = 2415929121;
|
||||
public const uint S2C_ClubChange = 2147493662;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,96 +17,24 @@ using Fantasy.Serialize;
|
||||
|
||||
namespace Fantasy
|
||||
{
|
||||
[ProtoContract]
|
||||
public partial class C2Map_EnterRoomRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Map_EnterRoomRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Map_EnterRoomRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
MapId = default;
|
||||
Password = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Map_EnterRoomRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Map2C_EnterRoomResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2Map_EnterRoomRequest; }
|
||||
[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_EnterRoomResponse : AMessage, ICustomRouteResponse, IProto
|
||||
{
|
||||
public static Map2C_EnterRoomResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Map2C_EnterRoomResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
MapId = default;
|
||||
RoomId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Map2C_EnterRoomResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Map2C_EnterRoomResponse; }
|
||||
[ProtoMember(1)]
|
||||
public int MapId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long RoomId { get; set; }
|
||||
[ProtoMember(3)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2Map_Move : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static C2Map_Move Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Map_Move>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Location = default;
|
||||
IsStop = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Map_Move>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.C2Map_Move; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
public MapUnitPositionInfo Location { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public bool IsStop { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 用户进入地图
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Map2C_RoleEnterMapNotify : AMessage, ICustomRouteMessage, IProto
|
||||
public partial class Map2C_RoleEnterRoomNotify : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static Map2C_RoleEnterMapNotify Create(Scene scene)
|
||||
public static Map2C_RoleEnterRoomNotify Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Map2C_RoleEnterMapNotify>();
|
||||
return scene.MessagePoolComponent.Rent<Map2C_RoleEnterRoomNotify>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Info = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Map2C_RoleEnterMapNotify>(this);
|
||||
GetScene().MessagePoolComponent.Return<Map2C_RoleEnterRoomNotify>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Map2C_RoleEnterMapNotify; }
|
||||
public uint OpCode() { return OuterOpcode.Map2C_RoleEnterRoomNotify; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
@@ -116,20 +44,20 @@ namespace Fantasy
|
||||
/// 用户离开地图
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Map2C_RoleExitMapNotify : AMessage, ICustomRouteMessage, IProto
|
||||
public partial class Map2C_RoleExitRoomNotify : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static Map2C_RoleExitMapNotify Create(Scene scene)
|
||||
public static Map2C_RoleExitRoomNotify Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Map2C_RoleExitMapNotify>();
|
||||
return scene.MessagePoolComponent.Rent<Map2C_RoleExitRoomNotify>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Id = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Map2C_RoleExitMapNotify>(this);
|
||||
GetScene().MessagePoolComponent.Return<Map2C_RoleExitRoomNotify>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Map2C_RoleExitMapNotify; }
|
||||
public uint OpCode() { return OuterOpcode.Map2C_RoleExitRoomNotify; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
@@ -213,11 +141,66 @@ namespace Fantasy
|
||||
[ProtoMember(2)]
|
||||
public GearInfo Gears { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2Map_Move : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static C2Map_Move Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Map_Move>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Position = default;
|
||||
Rotation = default;
|
||||
Direction = default;
|
||||
IsStop = default;
|
||||
Timestamp = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Map_Move>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.C2Map_Move; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
public Vector3Info Position { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public Vector3Info Rotation { get; set; }
|
||||
[ProtoMember(3)]
|
||||
public Vector3Info Direction { get; set; }
|
||||
[ProtoMember(4)]
|
||||
public bool IsStop { get; set; }
|
||||
[ProtoMember(5)]
|
||||
public long Timestamp { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2Map_Look : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static C2Map_Look Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Map_Look>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Rotation = default;
|
||||
Timestamp = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Map_Look>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.C2Map_Look; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
public Vector3Info Rotation { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long Timestamp { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 玩家位置变化
|
||||
/// 玩家移动推送
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Map2C_MoveNotify : AMessage, IProto
|
||||
public partial class Map2C_MoveNotify : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static Map2C_MoveNotify Create(Scene scene)
|
||||
{
|
||||
@@ -226,14 +209,58 @@ namespace Fantasy
|
||||
public override void Dispose()
|
||||
{
|
||||
Id = default;
|
||||
Location = default;
|
||||
Position = default;
|
||||
Rotation = default;
|
||||
Direction = default;
|
||||
IsStop = default;
|
||||
Timestamp = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Map2C_MoveNotify>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Map2C_MoveNotify; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
public long Id { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public MapUnitPositionInfo Location { get; set; }
|
||||
public Vector3Info Position { get; set; }
|
||||
[ProtoMember(3)]
|
||||
public Vector3Info Rotation { get; set; }
|
||||
[ProtoMember(4)]
|
||||
public Vector3Info Direction { get; set; }
|
||||
[ProtoMember(5)]
|
||||
public bool IsStop { get; set; }
|
||||
[ProtoMember(6)]
|
||||
public long Timestamp { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 玩家旋转推送
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Map2C_LookeNotify : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static Map2C_LookeNotify Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Map2C_LookeNotify>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Id = default;
|
||||
Rotation = default;
|
||||
Timestamp = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Map2C_LookeNotify>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Map2C_LookeNotify; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
public long Id { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public Vector3Info Rotation { get; set; }
|
||||
[ProtoMember(3)]
|
||||
public long Timestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,6 @@ public class RoomManageComponent : Entity
|
||||
|
||||
public readonly PriorityQueue<int, int> FreeIds = new();
|
||||
public readonly HashSet<int> InUseID = new();
|
||||
|
||||
public string TestRoomCode;
|
||||
}
|
||||
@@ -16,12 +16,17 @@ public class MapUnit : Entity
|
||||
/// <summary>
|
||||
/// 旋转
|
||||
/// </summary>
|
||||
public float4 Rotation;
|
||||
public float3 Rotation;
|
||||
|
||||
/// <summary>
|
||||
/// 当前所在地图id
|
||||
/// </summary>
|
||||
public int MapId;
|
||||
|
||||
/// <summary>
|
||||
/// 当前所在的房间id
|
||||
/// </summary>
|
||||
public long RoomId;
|
||||
|
||||
public long GateRouteId;
|
||||
}
|
||||
Reference in New Issue
Block a user