From 71e9d0da217f96e9d02e6cb080a591841fab4c80 Mon Sep 17 00:00:00 2001 From: xiaohang Date: Fri, 15 Sep 2023 18:06:10 +0800 Subject: [PATCH] =?UTF-8?q?proto=E6=96=87=E4=BB=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=BF=83=E8=B7=B3=E5=8C=85=E3=80=81?= =?UTF-8?q?playerEnter=E6=B7=BB=E5=8A=A0AppId=E5=92=8CToken=E7=AD=89?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/NetworkGen/Messages.cs | 35 ++++++++++++++++++++++++++++++ Runtime/ServerProto/messages.proto | 10 +++++++++ 2 files changed, 45 insertions(+) diff --git a/Runtime/NetworkGen/Messages.cs b/Runtime/NetworkGen/Messages.cs index 82cd908..3f7c664 100644 --- a/Runtime/NetworkGen/Messages.cs +++ b/Runtime/NetworkGen/Messages.cs @@ -72,6 +72,15 @@ namespace Dof public bool ShouldSerializePlayerLeave() => __pbn__actual.Is(6); public void ResetPlayerLeave() => global::ProtoBuf.DiscriminatedUnionObject.Reset(ref __pbn__actual, 6); + [global::ProtoBuf.ProtoMember(21, Name = @"heartbeat")] + public Heartbeat Heartbeat + { + get => __pbn__actual.Is(21) ? ((Heartbeat)__pbn__actual.Object) : default; + set => __pbn__actual = new global::ProtoBuf.DiscriminatedUnionObject(21, value); + } + public bool ShouldSerializeHeartbeat() => __pbn__actual.Is(21); + public void ResetHeartbeat() => global::ProtoBuf.DiscriminatedUnionObject.Reset(ref __pbn__actual, 21); + } [global::ProtoBuf.ProtoContract()] @@ -153,6 +162,14 @@ namespace Dof [global::System.ComponentModel.DefaultValue("")] public string Country { get; set; } = ""; + [global::ProtoBuf.ProtoMember(5, Name = @"app_id")] + [global::System.ComponentModel.DefaultValue("")] + public string AppId { get; set; } = ""; + + [global::ProtoBuf.ProtoMember(6, Name = @"token")] + [global::System.ComponentModel.DefaultValue("")] + public string Token { get; set; } = ""; + } [global::ProtoBuf.ProtoContract()] @@ -249,6 +266,9 @@ namespace Dof [global::ProtoBuf.ProtoMember(3, Name = @"point_id")] public int PointId { get; set; } + [global::ProtoBuf.ProtoMember(4, Name = @"combo")] + public float Combo { get; set; } + } [global::ProtoBuf.ProtoContract()] @@ -277,6 +297,9 @@ namespace Dof [global::ProtoBuf.ProtoMember(1, Name = @"cid")] public long Cid { get; set; } + [global::ProtoBuf.ProtoMember(2, Name = @"time_spent")] + public float TimeSpent { get; set; } + } [global::ProtoBuf.ProtoContract()] @@ -319,6 +342,18 @@ namespace Dof } + [global::ProtoBuf.ProtoContract()] + public partial class Heartbeat : global::ProtoBuf.IExtensible + { + private global::ProtoBuf.IExtension __pbn__extensionData; + global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) + => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); + + [global::ProtoBuf.ProtoMember(1, Name = @"timestamp")] + public long Timestamp { get; set; } + + } + } #pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 diff --git a/Runtime/ServerProto/messages.proto b/Runtime/ServerProto/messages.proto index 245333c..658de79 100644 --- a/Runtime/ServerProto/messages.proto +++ b/Runtime/ServerProto/messages.proto @@ -11,6 +11,8 @@ message ClientMessage { LevelEnd level_end = 4; AllLevelEnd all_level_end = 5; PlayerLeave player_leave = 6; + + Heartbeat heartbeat = 21; } } @@ -31,6 +33,8 @@ message PlayerEnter { string uid = 2; string nick_name = 3; string country = 4; + string app_id = 5; + string token = 6; } message LevelResource { @@ -62,6 +66,7 @@ message PointFound { int64 cid = 1; string level = 2; int32 point_id = 3; + float combo = 4; } message LevelEnd { @@ -71,6 +76,7 @@ message LevelEnd { message AllLevelEnd { int64 cid = 1; + float time_spent = 2; } message GameScore { @@ -84,4 +90,8 @@ message GameFinish { message PlayerLeave { int64 cid = 1; +} + +message Heartbeat { + int64 timestamp = 1; } \ No newline at end of file