Files
Fishing2Server/Entity/Generate/NetworkProtocol/GlobalData.cs
2025-08-11 16:29:23 +08:00

67 lines
1.7 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
{
[ProtoContract]
public partial class ChatUserInfo : AMessage, IProto
{
public static ChatUserInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<ChatUserInfo>();
}
public override void Dispose()
{
Id = default;
Name = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<ChatUserInfo>(this);
#endif
}
[ProtoMember(1)]
public long Id { get; set; }
[ProtoMember(2)]
public long Name { get; set; }
}
[ProtoContract]
public partial class ChatMessageInfo : AMessage, IProto
{
public static ChatMessageInfo Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<ChatMessageInfo>();
}
public override void Dispose()
{
Type = default;
Source = default;
Trigger = default;
Content = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<ChatMessageInfo>(this);
#endif
}
[ProtoMember(1)]
public int Type { get; set; }
[ProtoMember(2)]
public int Source { get; set; }
[ProtoMember(3)]
public ChatUserInfo Trigger { get; set; }
[ProtoMember(4)]
public string Content { get; set; }
}
}