From a09e4e40b8ab7952bc0b3225a648dd9c19d11b2a Mon Sep 17 00:00:00 2001 From: NorthLan <6995syu@163.com> Date: Wed, 27 Apr 2022 08:41:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A4=BC=E7=89=A9=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/msg_transfer/gift/msg_to_push.go | 1 + game/pb/mq/mq.pb.go | 102 ++++++++++++++++++++---- game/pb/mq/mq.proto | 16 +++- game/pb/push/Broadcast.cs | 109 +++++++++++++++++--------- game/pb/push/broadcast.pb.go | 59 ++++++++------ game/pb/push/broadcast.proto | 9 ++- 6 files changed, 210 insertions(+), 86 deletions(-) diff --git a/game/msg_transfer/gift/msg_to_push.go b/game/msg_transfer/gift/msg_to_push.go index 4dfb8f3..ff4818f 100644 --- a/game/msg_transfer/gift/msg_to_push.go +++ b/game/msg_transfer/gift/msg_to_push.go @@ -67,6 +67,7 @@ func (h *MsgToPushHandler) handleGift(data []byte, msgKey string) { h.ctx.RoomManager.PushToRoom(msgFromMq.LiveRoomId, "game.gift", &pushPb.Gift{ User: pbUser, GiftId: msgFromMq.GiftId, + Num: msgFromMq.Num, TotalCoin: msgFromMq.TotalCoin, }) logger.SLog.Debugf("队列礼物消息: %s 投喂 %s 价值 %d", msgFromMq.Uname, msgFromMq.GiftName, msgFromMq.TotalCoin) diff --git a/game/pb/mq/mq.pb.go b/game/pb/mq/mq.pb.go index 42465c4..879ca55 100644 --- a/game/pb/mq/mq.pb.go +++ b/game/pb/mq/mq.pb.go @@ -20,6 +20,58 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type Platform int32 + +const ( + Platform_bilibili Platform = 0 // B站 + Platform_huya Platform = 1 // 虎牙 + Platform_douyu Platform = 2 // 斗鱼 + Platform_douyin Platform = 3 // 抖音 +) + +// Enum value maps for Platform. +var ( + Platform_name = map[int32]string{ + 0: "bilibili", + 1: "huya", + 2: "douyu", + 3: "douyin", + } + Platform_value = map[string]int32{ + "bilibili": 0, + "huya": 1, + "douyu": 2, + "douyin": 3, + } +) + +func (x Platform) Enum() *Platform { + p := new(Platform) + *p = x + return p +} + +func (x Platform) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Platform) Descriptor() protoreflect.EnumDescriptor { + return file_mq_proto_enumTypes[0].Descriptor() +} + +func (Platform) Type() protoreflect.EnumType { + return &file_mq_proto_enumTypes[0] +} + +func (x Platform) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Platform.Descriptor instead. +func (Platform) EnumDescriptor() ([]byte, []int) { + return file_mq_proto_rawDescGZIP(), []int{0} +} + type MqDanmaku struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -116,10 +168,11 @@ type MqGift struct { LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"` Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"` - GiftId int32 `protobuf:"varint,5,opt,name=giftId,proto3" json:"giftId,omitempty"` - GiftName string `protobuf:"bytes,6,opt,name=giftName,proto3" json:"giftName,omitempty"` - TotalCoin int64 `protobuf:"varint,7,opt,name=totalCoin,proto3" json:"totalCoin,omitempty"` - SendTime int64 `protobuf:"varint,8,opt,name=sendTime,proto3" json:"sendTime,omitempty"` + GiftId int64 `protobuf:"varint,5,opt,name=giftId,proto3" json:"giftId,omitempty"` + Num int64 `protobuf:"varint,6,opt,name=num,proto3" json:"num,omitempty"` + GiftName string `protobuf:"bytes,7,opt,name=giftName,proto3" json:"giftName,omitempty"` + TotalCoin int64 `protobuf:"varint,8,opt,name=totalCoin,proto3" json:"totalCoin,omitempty"` + SendTime int64 `protobuf:"varint,9,opt,name=sendTime,proto3" json:"sendTime,omitempty"` } func (x *MqGift) Reset() { @@ -182,13 +235,20 @@ func (x *MqGift) GetUname() string { return "" } -func (x *MqGift) GetGiftId() int32 { +func (x *MqGift) GetGiftId() int64 { if x != nil { return x.GiftId } return 0 } +func (x *MqGift) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + func (x *MqGift) GetGiftName() string { if x != nil { return x.GiftName @@ -224,7 +284,7 @@ var file_mq_proto_rawDesc = []byte{ 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, - 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xda, 0x01, 0x0a, 0x06, 0x4d, 0x71, 0x47, 0x69, 0x66, + 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xec, 0x01, 0x0a, 0x06, 0x4d, 0x71, 0x47, 0x69, 0x66, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, @@ -232,14 +292,19 @@ var file_mq_proto_rawDesc = []byte{ 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, - 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, - 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, - 0x69, 0x6d, 0x65, 0x42, 0x07, 0x5a, 0x05, 0x2f, 0x70, 0x62, 0x4d, 0x71, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, + 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6e, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x2a, 0x39, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x12, 0x0c, 0x0a, 0x08, 0x62, 0x69, 0x6c, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x10, 0x00, 0x12, + 0x08, 0x0a, 0x04, 0x68, 0x75, 0x79, 0x61, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x64, 0x6f, 0x75, + 0x79, 0x75, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x10, 0x03, + 0x42, 0x07, 0x5a, 0x05, 0x2f, 0x70, 0x62, 0x4d, 0x71, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -254,10 +319,12 @@ func file_mq_proto_rawDescGZIP() []byte { return file_mq_proto_rawDescData } +var file_mq_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_mq_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_mq_proto_goTypes = []interface{}{ - (*MqDanmaku)(nil), // 0: pb.MqDanmaku - (*MqGift)(nil), // 1: pb.MqGift + (Platform)(0), // 0: pb.Platform + (*MqDanmaku)(nil), // 1: pb.MqDanmaku + (*MqGift)(nil), // 2: pb.MqGift } var file_mq_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -303,13 +370,14 @@ func file_mq_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_mq_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, GoTypes: file_mq_proto_goTypes, DependencyIndexes: file_mq_proto_depIdxs, + EnumInfos: file_mq_proto_enumTypes, MessageInfos: file_mq_proto_msgTypes, }.Build() File_mq_proto = out.File diff --git a/game/pb/mq/mq.proto b/game/pb/mq/mq.proto index fb888d1..f5a1b1a 100644 --- a/game/pb/mq/mq.proto +++ b/game/pb/mq/mq.proto @@ -4,6 +4,13 @@ package pb; option go_package = "/pbMq"; +enum Platform { + bilibili = 0; // B站 + huya = 1; // 虎牙 + douyu = 2; // 斗鱼 + douyin = 3; // 抖音 +} + message MqDanmaku { string platform = 1; int64 liveRoomId = 2; @@ -18,8 +25,9 @@ message MqGift { int64 liveRoomId = 2; int64 uid = 3; string uname = 4; - int32 giftId = 5; - string giftName = 6; - int64 totalCoin = 7; - int64 sendTime = 8; + int64 giftId = 5; + int64 num = 6; + string giftName = 7; + int64 totalCoin = 8; + int64 sendTime = 9; } \ No newline at end of file diff --git a/game/pb/push/Broadcast.cs b/game/pb/push/Broadcast.cs index e700605..ba7f301 100644 --- a/game/pb/push/Broadcast.cs +++ b/game/pb/push/Broadcast.cs @@ -29,14 +29,14 @@ namespace Pb { "GgoEdXNlchgBIAEoCzIMLnBiLlB1c2hVc2VyIjYKCkNyZWF0ZVVuaXQSGgoE", "dXNlchgBIAEoCzIMLnBiLlB1c2hVc2VyEgwKBHVuaXQYAiABKAkiMAoETW92", "ZRIaCgR1c2VyGAEgASgLMgwucGIuUHVzaFVzZXISDAoEbGluZRgCIAEoCSIm", - "CghPdXRicmVhaxIaCgR1c2VyGAEgASgLMgwucGIuUHVzaFVzZXIiaQoER2lm", - "dBIaCgR1c2VyGAEgASgLMgwucGIuUHVzaFVzZXISDgoGZ2lmdElkGAIgASgF", - "EhAKCGdpZnROYW1lGAMgASgJEhEKCXRvdGFsQ29pbhgEIAEoAxIQCghzZW5k", - "VGltZRgFIAEoAyIhCgNXYWkSGgoEdXNlchgBIAEoCzIMLnBiLlB1c2hVc2Vy", - "IjgKDEJ1aWxkaW5nTW9kZRIaCgR1c2VyGAEgASgLMgwucGIuUHVzaFVzZXIS", - "DAoEbW9kZRgCIAEoCSI5CgpEYW5tYWt1TXNnEhoKBHVzZXIYASABKAsyDC5w", - "Yi5QdXNoVXNlchIPCgdjb250ZW50GAIgASgJQglaBy9wYlB1c2hiBnByb3Rv", - "Mw==")); + "CghPdXRicmVhaxIaCgR1c2VyGAEgASgLMgwucGIuUHVzaFVzZXIidgoER2lm", + "dBIaCgR1c2VyGAEgASgLMgwucGIuUHVzaFVzZXISDgoGZ2lmdElkGAIgASgD", + "EgsKA251bRgDIAEoAxIQCghnaWZ0TmFtZRgEIAEoCRIRCgl0b3RhbENvaW4Y", + "BSABKAMSEAoIc2VuZFRpbWUYBiABKAMiIQoDV2FpEhoKBHVzZXIYASABKAsy", + "DC5wYi5QdXNoVXNlciI4CgxCdWlsZGluZ01vZGUSGgoEdXNlchgBIAEoCzIM", + "LnBiLlB1c2hVc2VyEgwKBG1vZGUYAiABKAkiOQoKRGFubWFrdU1zZxIaCgR1", + "c2VyGAEgASgLMgwucGIuUHVzaFVzZXISDwoHY29udGVudBgCIAEoCUIJWgcv", + "cGJQdXNoYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -45,7 +45,7 @@ namespace Pb { new pbr::GeneratedClrTypeInfo(typeof(global::Pb.CreateUnit), global::Pb.CreateUnit.Parser, new[]{ "User", "Unit" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Move), global::Pb.Move.Parser, new[]{ "User", "Line" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Outbreak), global::Pb.Outbreak.Parser, new[]{ "User" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Gift), global::Pb.Gift.Parser, new[]{ "User", "GiftId", "GiftName", "TotalCoin", "SendTime" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Gift), global::Pb.Gift.Parser, new[]{ "User", "GiftId", "Num", "GiftName", "TotalCoin", "SendTime" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Wai), global::Pb.Wai.Parser, new[]{ "User" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Pb.BuildingMode), global::Pb.BuildingMode.Parser, new[]{ "User", "Mode" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Pb.DanmakuMsg), global::Pb.DanmakuMsg.Parser, new[]{ "User", "Content" }, null, null, null, null) @@ -1235,6 +1235,7 @@ namespace Pb { public Gift(Gift other) : this() { user_ = other.user_ != null ? other.user_.Clone() : null; giftId_ = other.giftId_; + num_ = other.num_; giftName_ = other.giftName_; totalCoin_ = other.totalCoin_; sendTime_ = other.sendTime_; @@ -1261,18 +1262,30 @@ namespace Pb { /// Field number for the "giftId" field. public const int GiftIdFieldNumber = 2; - private int giftId_; + private long giftId_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int GiftId { + public long GiftId { get { return giftId_; } set { giftId_ = value; } } + /// Field number for the "num" field. + public const int NumFieldNumber = 3; + private long num_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Num { + get { return num_; } + set { + num_ = value; + } + } + /// Field number for the "giftName" field. - public const int GiftNameFieldNumber = 3; + public const int GiftNameFieldNumber = 4; private string giftName_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -1284,7 +1297,7 @@ namespace Pb { } /// Field number for the "totalCoin" field. - public const int TotalCoinFieldNumber = 4; + public const int TotalCoinFieldNumber = 5; private long totalCoin_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -1296,7 +1309,7 @@ namespace Pb { } /// Field number for the "sendTime" field. - public const int SendTimeFieldNumber = 5; + public const int SendTimeFieldNumber = 6; private long sendTime_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -1324,6 +1337,7 @@ namespace Pb { } if (!object.Equals(User, other.User)) return false; if (GiftId != other.GiftId) return false; + if (Num != other.Num) return false; if (GiftName != other.GiftName) return false; if (TotalCoin != other.TotalCoin) return false; if (SendTime != other.SendTime) return false; @@ -1335,7 +1349,8 @@ namespace Pb { public override int GetHashCode() { int hash = 1; if (user_ != null) hash ^= User.GetHashCode(); - if (GiftId != 0) hash ^= GiftId.GetHashCode(); + if (GiftId != 0L) hash ^= GiftId.GetHashCode(); + if (Num != 0L) hash ^= Num.GetHashCode(); if (GiftName.Length != 0) hash ^= GiftName.GetHashCode(); if (TotalCoin != 0L) hash ^= TotalCoin.GetHashCode(); if (SendTime != 0L) hash ^= SendTime.GetHashCode(); @@ -1361,20 +1376,24 @@ namespace Pb { output.WriteRawTag(10); output.WriteMessage(User); } - if (GiftId != 0) { + if (GiftId != 0L) { output.WriteRawTag(16); - output.WriteInt32(GiftId); + output.WriteInt64(GiftId); + } + if (Num != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Num); } if (GiftName.Length != 0) { - output.WriteRawTag(26); + output.WriteRawTag(34); output.WriteString(GiftName); } if (TotalCoin != 0L) { - output.WriteRawTag(32); + output.WriteRawTag(40); output.WriteInt64(TotalCoin); } if (SendTime != 0L) { - output.WriteRawTag(40); + output.WriteRawTag(48); output.WriteInt64(SendTime); } if (_unknownFields != null) { @@ -1391,20 +1410,24 @@ namespace Pb { output.WriteRawTag(10); output.WriteMessage(User); } - if (GiftId != 0) { + if (GiftId != 0L) { output.WriteRawTag(16); - output.WriteInt32(GiftId); + output.WriteInt64(GiftId); + } + if (Num != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Num); } if (GiftName.Length != 0) { - output.WriteRawTag(26); + output.WriteRawTag(34); output.WriteString(GiftName); } if (TotalCoin != 0L) { - output.WriteRawTag(32); + output.WriteRawTag(40); output.WriteInt64(TotalCoin); } if (SendTime != 0L) { - output.WriteRawTag(40); + output.WriteRawTag(48); output.WriteInt64(SendTime); } if (_unknownFields != null) { @@ -1420,8 +1443,11 @@ namespace Pb { if (user_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(User); } - if (GiftId != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(GiftId); + if (GiftId != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(GiftId); + } + if (Num != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Num); } if (GiftName.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(GiftName); @@ -1450,9 +1476,12 @@ namespace Pb { } User.MergeFrom(other.User); } - if (other.GiftId != 0) { + if (other.GiftId != 0L) { GiftId = other.GiftId; } + if (other.Num != 0L) { + Num = other.Num; + } if (other.GiftName.Length != 0) { GiftName = other.GiftName; } @@ -1485,18 +1514,22 @@ namespace Pb { break; } case 16: { - GiftId = input.ReadInt32(); + GiftId = input.ReadInt64(); break; } - case 26: { + case 24: { + Num = input.ReadInt64(); + break; + } + case 34: { GiftName = input.ReadString(); break; } - case 32: { + case 40: { TotalCoin = input.ReadInt64(); break; } - case 40: { + case 48: { SendTime = input.ReadInt64(); break; } @@ -1523,18 +1556,22 @@ namespace Pb { break; } case 16: { - GiftId = input.ReadInt32(); + GiftId = input.ReadInt64(); break; } - case 26: { + case 24: { + Num = input.ReadInt64(); + break; + } + case 34: { GiftName = input.ReadString(); break; } - case 32: { + case 40: { TotalCoin = input.ReadInt64(); break; } - case 40: { + case 48: { SendTime = input.ReadInt64(); break; } diff --git a/game/pb/push/broadcast.pb.go b/game/pb/push/broadcast.pb.go index 27d988f..482deba 100644 --- a/game/pb/push/broadcast.pb.go +++ b/game/pb/push/broadcast.pb.go @@ -293,10 +293,11 @@ type Gift struct { unknownFields protoimpl.UnknownFields User *PushUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - GiftId int32 `protobuf:"varint,2,opt,name=giftId,proto3" json:"giftId,omitempty"` - GiftName string `protobuf:"bytes,3,opt,name=giftName,proto3" json:"giftName,omitempty"` - TotalCoin int64 `protobuf:"varint,4,opt,name=totalCoin,proto3" json:"totalCoin,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=sendTime,proto3" json:"sendTime,omitempty"` + GiftId int64 `protobuf:"varint,2,opt,name=giftId,proto3" json:"giftId,omitempty"` + Num int64 `protobuf:"varint,3,opt,name=num,proto3" json:"num,omitempty"` + GiftName string `protobuf:"bytes,4,opt,name=giftName,proto3" json:"giftName,omitempty"` + TotalCoin int64 `protobuf:"varint,5,opt,name=totalCoin,proto3" json:"totalCoin,omitempty"` + SendTime int64 `protobuf:"varint,6,opt,name=sendTime,proto3" json:"sendTime,omitempty"` } func (x *Gift) Reset() { @@ -338,13 +339,20 @@ func (x *Gift) GetUser() *PushUser { return nil } -func (x *Gift) GetGiftId() int32 { +func (x *Gift) GetGiftId() int64 { if x != nil { return x.GiftId } return 0 } +func (x *Gift) GetNum() int64 { + if x != nil { + return x.Num + } + return 0 +} + func (x *Gift) GetGiftName() string { if x != nil { return x.GiftName @@ -546,29 +554,30 @@ var file_broadcast_proto_rawDesc = []byte{ 0x65, 0x22, 0x2c, 0x0a, 0x08, 0x4f, 0x75, 0x74, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x12, 0x20, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, - 0x96, 0x01, 0x0a, 0x04, 0x47, 0x69, 0x66, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0xa8, 0x01, 0x0a, 0x04, 0x47, 0x69, 0x66, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, - 0x66, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, - 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, - 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, - 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x27, 0x0a, 0x03, 0x57, 0x61, 0x69, 0x12, - 0x20, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x70, 0x62, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x22, 0x44, 0x0a, 0x0c, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, - 0x65, 0x12, 0x20, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x66, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, + 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1a, + 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x27, 0x0a, 0x03, 0x57, 0x61, + 0x69, 0x12, 0x20, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x48, 0x0a, 0x0a, 0x44, 0x61, 0x6e, 0x6d, 0x61, - 0x6b, 0x75, 0x4d, 0x73, 0x67, 0x12, 0x20, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x42, 0x09, 0x5a, 0x07, 0x2f, 0x70, 0x62, 0x50, 0x75, 0x73, 0x68, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x65, 0x72, 0x22, 0x44, 0x0a, 0x0c, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x4d, + 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x48, 0x0a, 0x0a, 0x44, 0x61, 0x6e, + 0x6d, 0x61, 0x6b, 0x75, 0x4d, 0x73, 0x67, 0x12, 0x20, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x42, 0x09, 0x5a, 0x07, 0x2f, 0x70, 0x62, 0x50, 0x75, 0x73, 0x68, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/game/pb/push/broadcast.proto b/game/pb/push/broadcast.proto index b9b725b..506b94f 100644 --- a/game/pb/push/broadcast.proto +++ b/game/pb/push/broadcast.proto @@ -30,10 +30,11 @@ message Outbreak{ message Gift{ PushUser user = 1; - int32 giftId = 2; - string giftName = 3; - int64 totalCoin = 4; - int64 sendTime = 5; + int64 giftId = 2; + int64 num = 3; + string giftName = 4; + int64 totalCoin = 5; + int64 sendTime = 6; } message Wai{