261 lines
7.4 KiB
C#
261 lines
7.4 KiB
C#
using ProtoBuf;
|
|
|
|
using System.Collections.Generic;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using Fantasy;
|
|
using Fantasy.Network.Interface;
|
|
using Fantasy.Serialize;
|
|
// ReSharper disable InconsistentNaming
|
|
// ReSharper disable RedundantUsingDirective
|
|
// ReSharper disable RedundantOverriddenMember
|
|
// ReSharper disable PartialTypeWithSinglePart
|
|
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
|
// ReSharper disable MemberCanBePrivate.Global
|
|
// ReSharper disable CheckNamespace
|
|
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
|
|
#pragma warning disable CS8618
|
|
|
|
namespace Fantasy
|
|
{
|
|
/// <summary>
|
|
/// 用户进入地图
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class Map2C_RoleEnterRoomNotify : AMessage, ICustomRouteMessage, IProto
|
|
{
|
|
public static Map2C_RoleEnterRoomNotify Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<Map2C_RoleEnterRoomNotify>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
Info = default;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<Map2C_RoleEnterRoomNotify>(this);
|
|
#endif
|
|
}
|
|
public uint OpCode() { return OuterOpcode.Map2C_RoleEnterRoomNotify; }
|
|
[ProtoIgnore]
|
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
|
[ProtoMember(1)]
|
|
public MapUnitInfo Info { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 用户离开地图
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class Map2C_RoleExitRoomNotify : AMessage, ICustomRouteMessage, IProto
|
|
{
|
|
public static Map2C_RoleExitRoomNotify Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<Map2C_RoleExitRoomNotify>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
Id = default;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<Map2C_RoleExitRoomNotify>(this);
|
|
#endif
|
|
}
|
|
public uint OpCode() { return OuterOpcode.Map2C_RoleExitRoomNotify; }
|
|
[ProtoIgnore]
|
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
|
[ProtoMember(1)]
|
|
public long Id { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 玩家状态变化同步
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class Map2C_RoleStateNotify : AMessage, ICustomRouteMessage, IProto
|
|
{
|
|
public static Map2C_RoleStateNotify Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<Map2C_RoleStateNotify>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
Id = default;
|
|
State = default;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<Map2C_RoleStateNotify>(this);
|
|
#endif
|
|
}
|
|
public uint OpCode() { return OuterOpcode.Map2C_RoleStateNotify; }
|
|
[ProtoIgnore]
|
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
|
[ProtoMember(1)]
|
|
public long Id { get; set; }
|
|
[ProtoMember(2)]
|
|
public UnitStateInfo State { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 玩家钓组变化
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class Map2C_RoleGearChangeNotify : AMessage, ICustomRouteMessage, IProto
|
|
{
|
|
public static Map2C_RoleGearChangeNotify Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<Map2C_RoleGearChangeNotify>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
Id = default;
|
|
Gears.Clear();
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<Map2C_RoleGearChangeNotify>(this);
|
|
#endif
|
|
}
|
|
public uint OpCode() { return OuterOpcode.Map2C_RoleGearChangeNotify; }
|
|
[ProtoIgnore]
|
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
|
[ProtoMember(1)]
|
|
public long Id { get; set; }
|
|
[ProtoMember(2)]
|
|
public List<GearInfo> Gears = new List<GearInfo>();
|
|
}
|
|
[ProtoContract]
|
|
public partial class Map2C_RolePropertyChangeNotify : AMessage, ICustomRouteMessage, IProto
|
|
{
|
|
public static Map2C_RolePropertyChangeNotify Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<Map2C_RolePropertyChangeNotify>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
Propertys.Clear();
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<Map2C_RolePropertyChangeNotify>(this);
|
|
#endif
|
|
}
|
|
public uint OpCode() { return OuterOpcode.Map2C_RolePropertyChangeNotify; }
|
|
[ProtoIgnore]
|
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
|
[ProtoMember(1)]
|
|
public List<KeyValueInt32> Propertys = new List<KeyValueInt32>();
|
|
}
|
|
[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, ICustomRouteMessage, IProto
|
|
{
|
|
public static Map2C_MoveNotify Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<Map2C_MoveNotify>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
Id = 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 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; }
|
|
}
|
|
}
|