Skip to content

Commit 9b584ab

Browse files
committed
[增加]1. 增加HTTP消息包基类
1 parent cf541b7 commit 9b584ab

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using GameFrameX.Runtime;
2+
using Newtonsoft.Json;
3+
#if ENABLE_GAME_FRAME_X_PROTOBUF
4+
using ProtoBuf;
5+
#endif
6+
7+
namespace GameFrameX.Network.Runtime
8+
{
9+
/// <summary>
10+
/// HTTP消息包装基类
11+
/// </summary>
12+
#if ENABLE_GAME_FRAME_X_PROTOBUF
13+
[ProtoContract]
14+
#endif
15+
public class MessageHttpObject
16+
{
17+
/// <summary>
18+
/// 消息ID
19+
/// </summary>
20+
#if ENABLE_GAME_FRAME_X_PROTOBUF
21+
[ProtoMember(1)]
22+
#endif
23+
public int Id { get; set; }
24+
25+
/// <summary>
26+
/// 消息序列号
27+
/// </summary>
28+
#if ENABLE_GAME_FRAME_X_PROTOBUF
29+
[ProtoMember(2)]
30+
#endif
31+
public int UniqueId { get; set; }
32+
33+
[JsonIgnore]
34+
#if ENABLE_GAME_FRAME_X_PROTOBUF
35+
[ProtoMember(3)]
36+
#endif
37+
public byte[] Body { get; set; }
38+
39+
public override string ToString()
40+
{
41+
return Utility.Json.ToJson(this);
42+
}
43+
}
44+
}

Runtime/Network/Base/MessageHttpObject.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)