From ca468e6d8c1d8961dae30b6466c23b89501505a1 Mon Sep 17 00:00:00 2001 From: NorthLan <6995syu@163.com> Date: Thu, 19 May 2022 00:56:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4-=E6=B8=B8=E6=88=8F=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E5=AF=B9=E5=BA=94=E5=85=B3=E7=B3=BB=EF=BC=8C=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=91=BD=E4=BB=A4=E5=A4=84=E7=90=86=E5=8D=8F=E7=A8=8B?= =?UTF-8?q?=EF=BC=88=E9=81=BF=E5=85=8D=E9=A1=BA=E5=BA=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=89=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=87=A0=E4=B8=AA=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E6=96=87=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config-dev.yml | 2 + config.yml | 2 + config/Config.go | 1 + game/common.go | 6 + game/live_logic/logic.go | 4 +- game/pb/common/Common.cs | 344 ++++++++++++++++- game/pb/common/common.pb.go | 185 ++++++--- game/pb/common/common.proto | 8 + game/pb/game/zhg/Rank.cs | 750 +++++++++++++++++++++++++++++++++++- game/pb/game/zhg/rank.pb.go | 295 ++++++++++++-- game/pb/game/zhg/rank.proto | 17 + pkg/cmd/cmd_parser.go | 3 +- pkg/cmd/cmd_parser_test.go | 8 +- 13 files changed, 1525 insertions(+), 100 deletions(-) diff --git a/config-dev.yml b/config-dev.yml index 88af197..6a2df8f 100644 --- a/config-dev.yml +++ b/config-dev.yml @@ -16,6 +16,8 @@ Kafka: Topic: "gift-dev" ConsumerGroup: "giftToPush-dev" Game: + ModeDict: + 8722013: 0 Common: Commands: [ "q", "查询", "打卡", "签到" ] Zhg: diff --git a/config.yml b/config.yml index 078b7c8..7b3f374 100644 --- a/config.yml +++ b/config.yml @@ -16,6 +16,8 @@ Kafka: Topic: "gift" ConsumerGroup: "giftToPush" Game: + ModeDict: + 8722013: 0 Common: Commands: [ "q", "查询", "打卡", "签到" ] Zhg: diff --git a/config/Config.go b/config/Config.go index d18ebb2..66635d2 100644 --- a/config/Config.go +++ b/config/Config.go @@ -38,6 +38,7 @@ type ( Gift Kafka } Game struct { + ModeDict map[int64]int32 // 直播间对应模式(临时) // 通用模式 Common struct { Commands []string diff --git a/game/common.go b/game/common.go index e7140c8..380fce9 100644 --- a/game/common.go +++ b/game/common.go @@ -1,6 +1,7 @@ package game import ( + "dcg/config" pbRoom "dcg/game/pb/room" "errors" ) @@ -23,6 +24,11 @@ func CacheGameType(roomId int64, gameType pbRoom.GameType) { func GameTypeByLiveRoomId(roomId int64) (pbRoom.GameType, error) { if gameType, ok := LivePair[roomId]; ok { return gameType, nil + } else { + modeCfg := config.Config.Game.ModeDict + if gtInt, ok := modeCfg[roomId]; ok { + return pbRoom.GameType(gtInt), nil + } } return defaultGameType, errors.New("该直播间未加入游戏房间") } diff --git a/game/live_logic/logic.go b/game/live_logic/logic.go index 7e3424d..843151a 100644 --- a/game/live_logic/logic.go +++ b/game/live_logic/logic.go @@ -55,7 +55,7 @@ func (l *LiveGameLogic) HandleDanmaku(pushCommonMsg bool, user *pbCommon.PbUser, cmdStruct := l.CmdParser.Parse(dm.Content) if cmdStruct.IsCMD { for _, c := range cmdStruct.Arr { - go l.handleCMD(dm.LiveRoomId, c, user) + l.handleCMD(dm.LiveRoomId, c, user) } } else if pushCommonMsg { room, err := logic.GameLogic.RoomManager.RoomByLiveRoomId(dm.LiveRoomId) @@ -80,5 +80,5 @@ func (l *LiveGameLogic) HandleGift(roomId int64, user *pbCommon.PbUser, gift *pb if l.GiftHandler == nil { return } - go l.GiftHandler(roomId, user, gift) + l.GiftHandler(roomId, user, gift) } diff --git a/game/pb/common/Common.cs b/game/pb/common/Common.cs index c5b4155..eb6b659 100644 --- a/game/pb/common/Common.cs +++ b/game/pb/common/Common.cs @@ -35,13 +35,15 @@ namespace Pb.Common { "bnRlZ3JhbBgFIAEoAyJ3CgpDaGVja0luTXNnEh8KBHVzZXIYASABKAsyES5w", "Yi5jb21tb24uUGJVc2VyEg8KB3N1Y2Nlc3MYAiABKAgSCwoDbXNnGAMgASgJ", "EhYKDmludGVncmFsQ2hhbmdlGAQgASgDEhIKCmlzQ3JpdGljYWwYBSABKAgi", - "LwoMVXNlclF1ZXJ5TXNnEh8KBHVzZXIYASABKAsyES5wYi5jb21tb24uUGJV", - "c2VyIj4KCkRhbm1ha3VNc2cSHwoEdXNlchgBIAEoCzIRLnBiLmNvbW1vbi5Q", - "YlVzZXISDwoHY29udGVudBgCIAEoCSJ4CgdHaWZ0TXNnEh8KBHVzZXIYASAB", - "KAsyES5wYi5jb21tb24uUGJVc2VyEg4KBmdpZnRJZBgCIAEoAxILCgNudW0Y", - "AyABKAMSEAoIZ2lmdE5hbWUYBCABKAkSDQoFcHJpY2UYBSABKAMSDgoGaXNQ", - "YWlkGAYgASgIQh1aG2RjZy9nYW1lL3BiL2NvbW1vbjtwYkNvbW1vbmIGcHJv", - "dG8z")); + "ZwoOU3RhcnRlclBhY2tNc2cSHwoEdXNlchgBIAEoCzIRLnBiLmNvbW1vbi5Q", + "YlVzZXISDwoHc3VjY2VzcxgCIAEoCBILCgNtc2cYAyABKAkSFgoOaW50ZWdy", + "YWxDaGFuZ2UYBCABKAMiLwoMVXNlclF1ZXJ5TXNnEh8KBHVzZXIYASABKAsy", + "ES5wYi5jb21tb24uUGJVc2VyIj4KCkRhbm1ha3VNc2cSHwoEdXNlchgBIAEo", + "CzIRLnBiLmNvbW1vbi5QYlVzZXISDwoHY29udGVudBgCIAEoCSJ4CgdHaWZ0", + "TXNnEh8KBHVzZXIYASABKAsyES5wYi5jb21tb24uUGJVc2VyEg4KBmdpZnRJ", + "ZBgCIAEoAxILCgNudW0YAyABKAMSEAoIZ2lmdE5hbWUYBCABKAkSDQoFcHJp", + "Y2UYBSABKAMSDgoGaXNQYWlkGAYgASgIQh1aG2RjZy9nYW1lL3BiL2NvbW1v", + "bjtwYkNvbW1vbmIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -50,6 +52,7 @@ namespace Pb.Common { new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Common.ChangeUserIntegralReq), global::Pb.Common.ChangeUserIntegralReq.Parser, new[]{ "UserId", "Change" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Common.ChangeUserIntegralResp), global::Pb.Common.ChangeUserIntegralResp.Parser, new[]{ "Success", "Msg", "UserId", "Change", "Integral" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Common.CheckInMsg), global::Pb.Common.CheckInMsg.Parser, new[]{ "User", "Success", "Msg", "IntegralChange", "IsCritical" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Common.StarterPackMsg), global::Pb.Common.StarterPackMsg.Parser, new[]{ "User", "Success", "Msg", "IntegralChange" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Common.UserQueryMsg), global::Pb.Common.UserQueryMsg.Parser, new[]{ "User" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Common.DanmakuMsg), global::Pb.Common.DanmakuMsg.Parser, new[]{ "User", "Content" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Common.GiftMsg), global::Pb.Common.GiftMsg.Parser, new[]{ "User", "GiftId", "Num", "GiftName", "Price", "IsPaid" }, null, null, null, null) @@ -1649,6 +1652,327 @@ namespace Pb.Common { } + /// + /// StarterPackMsg 新手礼包 push -> user.starterPack 命令(新手礼包) + /// + public sealed partial class StarterPackMsg : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StarterPackMsg()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Pb.Common.CommonReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StarterPackMsg() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StarterPackMsg(StarterPackMsg other) : this() { + user_ = other.user_ != null ? other.user_.Clone() : null; + success_ = other.success_; + msg_ = other.msg_; + integralChange_ = other.integralChange_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StarterPackMsg Clone() { + return new StarterPackMsg(this); + } + + /// Field number for the "user" field. + public const int UserFieldNumber = 1; + private global::Pb.Common.PbUser user_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Pb.Common.PbUser User { + get { return user_; } + set { + user_ = value; + } + } + + /// Field number for the "success" field. + public const int SuccessFieldNumber = 2; + private bool success_; + /// + /// 领取成功与否 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Success { + get { return success_; } + set { + success_ = value; + } + } + + /// Field number for the "msg" field. + public const int MsgFieldNumber = 3; + private string msg_ = ""; + /// + /// 领取消息: [成功无msg | 已经领过礼包了] + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Msg { + get { return msg_; } + set { + msg_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "integralChange" field. + public const int IntegralChangeFieldNumber = 4; + private long integralChange_; + /// + /// 积分变动 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long IntegralChange { + get { return integralChange_; } + set { + integralChange_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StarterPackMsg); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StarterPackMsg other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(User, other.User)) return false; + if (Success != other.Success) return false; + if (Msg != other.Msg) return false; + if (IntegralChange != other.IntegralChange) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (user_ != null) hash ^= User.GetHashCode(); + if (Success != false) hash ^= Success.GetHashCode(); + if (Msg.Length != 0) hash ^= Msg.GetHashCode(); + if (IntegralChange != 0L) hash ^= IntegralChange.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (user_ != null) { + output.WriteRawTag(10); + output.WriteMessage(User); + } + if (Success != false) { + output.WriteRawTag(16); + output.WriteBool(Success); + } + if (Msg.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Msg); + } + if (IntegralChange != 0L) { + output.WriteRawTag(32); + output.WriteInt64(IntegralChange); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (user_ != null) { + output.WriteRawTag(10); + output.WriteMessage(User); + } + if (Success != false) { + output.WriteRawTag(16); + output.WriteBool(Success); + } + if (Msg.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Msg); + } + if (IntegralChange != 0L) { + output.WriteRawTag(32); + output.WriteInt64(IntegralChange); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (user_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(User); + } + if (Success != false) { + size += 1 + 1; + } + if (Msg.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Msg); + } + if (IntegralChange != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(IntegralChange); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StarterPackMsg other) { + if (other == null) { + return; + } + if (other.user_ != null) { + if (user_ == null) { + User = new global::Pb.Common.PbUser(); + } + User.MergeFrom(other.User); + } + if (other.Success != false) { + Success = other.Success; + } + if (other.Msg.Length != 0) { + Msg = other.Msg; + } + if (other.IntegralChange != 0L) { + IntegralChange = other.IntegralChange; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (user_ == null) { + User = new global::Pb.Common.PbUser(); + } + input.ReadMessage(User); + break; + } + case 16: { + Success = input.ReadBool(); + break; + } + case 26: { + Msg = input.ReadString(); + break; + } + case 32: { + IntegralChange = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (user_ == null) { + User = new global::Pb.Common.PbUser(); + } + input.ReadMessage(User); + break; + } + case 16: { + Success = input.ReadBool(); + break; + } + case 26: { + Msg = input.ReadString(); + break; + } + case 32: { + IntegralChange = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + /// /// QueryIntegralMsg 用户查询信息通知 push -> user.query /// @@ -1666,7 +1990,7 @@ namespace Pb.Common { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.Common.CommonReflection.Descriptor.MessageTypes[5]; } + get { return global::Pb.Common.CommonReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1867,7 +2191,7 @@ namespace Pb.Common { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.Common.CommonReflection.Descriptor.MessageTypes[6]; } + get { return global::Pb.Common.CommonReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2105,7 +2429,7 @@ namespace Pb.Common { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.Common.CommonReflection.Descriptor.MessageTypes[7]; } + get { return global::Pb.Common.CommonReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] diff --git a/game/pb/common/common.pb.go b/game/pb/common/common.pb.go index dd36175..596be4e 100644 --- a/game/pb/common/common.pb.go +++ b/game/pb/common/common.pb.go @@ -380,6 +380,78 @@ func (x *CheckInMsg) GetIsCritical() bool { return false } +// StarterPackMsg 新手礼包 push -> user.starterPack 命令(新手礼包) +type StarterPackMsg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User *PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + Success bool `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"` // 领取成功与否 + Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` // 领取消息: [成功无msg | 已经领过礼包了] + IntegralChange int64 `protobuf:"varint,4,opt,name=integralChange,proto3" json:"integralChange,omitempty"` // 积分变动 +} + +func (x *StarterPackMsg) Reset() { + *x = StarterPackMsg{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StarterPackMsg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StarterPackMsg) ProtoMessage() {} + +func (x *StarterPackMsg) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StarterPackMsg.ProtoReflect.Descriptor instead. +func (*StarterPackMsg) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{5} +} + +func (x *StarterPackMsg) GetUser() *PbUser { + if x != nil { + return x.User + } + return nil +} + +func (x *StarterPackMsg) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *StarterPackMsg) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *StarterPackMsg) GetIntegralChange() int64 { + if x != nil { + return x.IntegralChange + } + return 0 +} + // QueryIntegralMsg 用户查询信息通知 push -> user.query type UserQueryMsg struct { state protoimpl.MessageState @@ -392,7 +464,7 @@ type UserQueryMsg struct { func (x *UserQueryMsg) Reset() { *x = UserQueryMsg{} if protoimpl.UnsafeEnabled { - mi := &file_common_common_proto_msgTypes[5] + mi := &file_common_common_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -405,7 +477,7 @@ func (x *UserQueryMsg) String() string { func (*UserQueryMsg) ProtoMessage() {} func (x *UserQueryMsg) ProtoReflect() protoreflect.Message { - mi := &file_common_common_proto_msgTypes[5] + mi := &file_common_common_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -418,7 +490,7 @@ func (x *UserQueryMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use UserQueryMsg.ProtoReflect.Descriptor instead. func (*UserQueryMsg) Descriptor() ([]byte, []int) { - return file_common_common_proto_rawDescGZIP(), []int{5} + return file_common_common_proto_rawDescGZIP(), []int{6} } func (x *UserQueryMsg) GetUser() *PbUser { @@ -441,7 +513,7 @@ type DanmakuMsg struct { func (x *DanmakuMsg) Reset() { *x = DanmakuMsg{} if protoimpl.UnsafeEnabled { - mi := &file_common_common_proto_msgTypes[6] + mi := &file_common_common_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -454,7 +526,7 @@ func (x *DanmakuMsg) String() string { func (*DanmakuMsg) ProtoMessage() {} func (x *DanmakuMsg) ProtoReflect() protoreflect.Message { - mi := &file_common_common_proto_msgTypes[6] + mi := &file_common_common_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -467,7 +539,7 @@ func (x *DanmakuMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use DanmakuMsg.ProtoReflect.Descriptor instead. func (*DanmakuMsg) Descriptor() ([]byte, []int) { - return file_common_common_proto_rawDescGZIP(), []int{6} + return file_common_common_proto_rawDescGZIP(), []int{7} } func (x *DanmakuMsg) GetUser() *PbUser { @@ -501,7 +573,7 @@ type GiftMsg struct { func (x *GiftMsg) Reset() { *x = GiftMsg{} if protoimpl.UnsafeEnabled { - mi := &file_common_common_proto_msgTypes[7] + mi := &file_common_common_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -514,7 +586,7 @@ func (x *GiftMsg) String() string { func (*GiftMsg) ProtoMessage() {} func (x *GiftMsg) ProtoReflect() protoreflect.Message { - mi := &file_common_common_proto_msgTypes[7] + mi := &file_common_common_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -527,7 +599,7 @@ func (x *GiftMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use GiftMsg.ProtoReflect.Descriptor instead. func (*GiftMsg) Descriptor() ([]byte, []int) { - return file_common_common_proto_rawDescGZIP(), []int{7} + return file_common_common_proto_rawDescGZIP(), []int{8} } func (x *GiftMsg) GetUser() *PbUser { @@ -617,28 +689,37 @@ var file_common_common_proto_rawDesc = []byte{ 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x43, 0x72, 0x69, - 0x74, 0x69, 0x63, 0x61, 0x6c, 0x22, 0x35, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x74, 0x69, 0x63, 0x61, 0x6c, 0x22, 0x8b, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, + 0x72, 0x50, 0x61, 0x63, 0x6b, 0x4d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x26, 0x0a, 0x0e, 0x69, + 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x22, 0x35, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x4d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x62, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x4d, 0x0a, 0x0a, 0x44, 0x61, + 0x6e, 0x6d, 0x61, 0x6b, 0x75, 0x4d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x50, 0x62, 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, 0x22, 0xa4, 0x01, 0x0a, 0x07, 0x47, 0x69, + 0x66, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x4d, 0x0a, 0x0a, - 0x44, 0x61, 0x6e, 0x6d, 0x61, 0x6b, 0x75, 0x4d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x62, 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, 0x22, 0xa4, 0x01, 0x0a, 0x07, - 0x47, 0x69, 0x66, 0x74, 0x4d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x50, 0x62, 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, 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, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, - 0x50, 0x61, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, 0x61, - 0x69, 0x64, 0x42, 0x1d, 0x5a, 0x1b, 0x64, 0x63, 0x67, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, - 0x62, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3b, 0x70, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x50, 0x62, 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, 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, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x50, 0x61, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x50, 0x61, 0x69, 0x64, + 0x42, 0x1d, 0x5a, 0x1b, 0x64, 0x63, 0x67, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x62, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3b, 0x70, 0x62, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -653,28 +734,30 @@ func file_common_common_proto_rawDescGZIP() []byte { return file_common_common_proto_rawDescData } -var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_common_common_proto_goTypes = []interface{}{ (*PbUser)(nil), // 0: pb.common.PbUser (*UserIntegralChanged)(nil), // 1: pb.common.UserIntegralChanged (*ChangeUserIntegralReq)(nil), // 2: pb.common.ChangeUserIntegralReq (*ChangeUserIntegralResp)(nil), // 3: pb.common.ChangeUserIntegralResp (*CheckInMsg)(nil), // 4: pb.common.CheckInMsg - (*UserQueryMsg)(nil), // 5: pb.common.UserQueryMsg - (*DanmakuMsg)(nil), // 6: pb.common.DanmakuMsg - (*GiftMsg)(nil), // 7: pb.common.GiftMsg + (*StarterPackMsg)(nil), // 5: pb.common.StarterPackMsg + (*UserQueryMsg)(nil), // 6: pb.common.UserQueryMsg + (*DanmakuMsg)(nil), // 7: pb.common.DanmakuMsg + (*GiftMsg)(nil), // 8: pb.common.GiftMsg } var file_common_common_proto_depIdxs = []int32{ 0, // 0: pb.common.UserIntegralChanged.user:type_name -> pb.common.PbUser 0, // 1: pb.common.CheckInMsg.user:type_name -> pb.common.PbUser - 0, // 2: pb.common.UserQueryMsg.user:type_name -> pb.common.PbUser - 0, // 3: pb.common.DanmakuMsg.user:type_name -> pb.common.PbUser - 0, // 4: pb.common.GiftMsg.user:type_name -> pb.common.PbUser - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 0, // 2: pb.common.StarterPackMsg.user:type_name -> pb.common.PbUser + 0, // 3: pb.common.UserQueryMsg.user:type_name -> pb.common.PbUser + 0, // 4: pb.common.DanmakuMsg.user:type_name -> pb.common.PbUser + 0, // 5: pb.common.GiftMsg.user:type_name -> pb.common.PbUser + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_common_common_proto_init() } @@ -744,7 +827,7 @@ func file_common_common_proto_init() { } } file_common_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserQueryMsg); i { + switch v := v.(*StarterPackMsg); i { case 0: return &v.state case 1: @@ -756,7 +839,7 @@ func file_common_common_proto_init() { } } file_common_common_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DanmakuMsg); i { + switch v := v.(*UserQueryMsg); i { case 0: return &v.state case 1: @@ -768,6 +851,18 @@ func file_common_common_proto_init() { } } file_common_common_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DanmakuMsg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GiftMsg); i { case 0: return &v.state @@ -786,7 +881,7 @@ func file_common_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_common_common_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/game/pb/common/common.proto b/game/pb/common/common.proto index 5916789..7b330d4 100644 --- a/game/pb/common/common.proto +++ b/game/pb/common/common.proto @@ -44,6 +44,14 @@ message CheckInMsg { bool isCritical = 5; // 是否发生了打卡积分奖励暴击 } +// StarterPackMsg 新手礼包 push -> user.starterPack 命令(新手礼包) +message StarterPackMsg { + pb.common.PbUser user = 1; + bool success = 2; // 领取成功与否 + string msg = 3; // 领取消息: [成功无msg | 已经领过礼包了] + int64 integralChange = 4; // 积分变动 +} + // QueryIntegralMsg 用户查询信息通知 push -> user.query message UserQueryMsg { pb.common.PbUser user = 1; diff --git a/game/pb/game/zhg/Rank.cs b/game/pb/game/zhg/Rank.cs index 3b0aae1..1dd8a5c 100644 --- a/game/pb/game/zhg/Rank.cs +++ b/game/pb/game/zhg/Rank.cs @@ -28,17 +28,25 @@ namespace Pb.Game.Zhg { "cGUYASABKAUSDAoEdG9wThgCIAEoBSKMAQoLUmFua1B2cFJlc3ASDAoEdHlw", "ZRgBIAEoBRIsCgVpdGVtcxgCIAMoCzIdLnBiLmdhbWUuemhnLlJhbmtQdnBS", "ZXNwLkl0ZW0aQQoESXRlbRILCgN1aWQYASABKAMSDQoFdW5hbWUYAiABKAkS", - "DQoFc2NvcmUYAyABKAMSDgoGYXZhdGFyGAQgASgJKsIBCghSYW5rVHlwZRIL", - "CgdVbmtub3duEAASCgoGRGFtYWdlEAESDAoIRGVEYW1hZ2UQAhILCgdHZW5l", - "cmFsEAMSDQoJRGVHZW5lcmFsEAQSDAoIS2lsbFVuaXQQBRIOCgpEZUtpbGxV", - "bml0EAYSDgoKS2lsbFBsYXllchAHEhAKDERlS2lsbFBsYXllchAIEgcKA1dp", - "bhAJEggKBExvc3QQChIOCgpGaXJzdEJsb29kEAsSEAoMRGVGaXJzdEJsb29k", - "EAxCIFoeZGNnL2dhbWUvcGIvZ2FtZS96aGc7cGJHYW1lWmhnYgZwcm90bzM=")); + "DQoFc2NvcmUYAyABKAMSDgoGYXZhdGFyGAQgASgJIuIBChNSYW5rUnZwU3Vi", + "bWl0UmVzdWx0EjQKBWl0ZW1zGAEgAygLMiUucGIuZ2FtZS56aGcuUmFua1J2", + "cFN1Ym1pdFJlc3VsdC5JdGVtGkUKBlJld2FyZBILCgN1aWQYASABKAMSDQoF", + "dW5hbWUYAiABKAkSEAoIaW50ZWdyYWwYAyABKAMSDQoFdGl0bGUYBCABKAMa", + "TgoESXRlbRIMCgR0eXBlGAEgASgFEjgKB3Jld2FyZHMYAiADKAsyJy5wYi5n", + "YW1lLnpoZy5SYW5rUnZwU3VibWl0UmVzdWx0LlJld2FyZCrCAQoIUmFua1R5", + "cGUSCwoHVW5rbm93bhAAEgoKBkRhbWFnZRABEgwKCERlRGFtYWdlEAISCwoH", + "R2VuZXJhbBADEg0KCURlR2VuZXJhbBAEEgwKCEtpbGxVbml0EAUSDgoKRGVL", + "aWxsVW5pdBAGEg4KCktpbGxQbGF5ZXIQBxIQCgxEZUtpbGxQbGF5ZXIQCBIH", + "CgNXaW4QCRIICgRMb3N0EAoSDgoKRmlyc3RCbG9vZBALEhAKDERlRmlyc3RC", + "bG9vZBAMQiBaHmRjZy9nYW1lL3BiL2dhbWUvemhnO3BiR2FtZVpoZ2IGcHJv", + "dG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Pb.Game.Zhg.RankType), }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Game.Zhg.RankPvpReq), global::Pb.Game.Zhg.RankPvpReq.Parser, new[]{ "Type", "TopN" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Game.Zhg.RankPvpResp), global::Pb.Game.Zhg.RankPvpResp.Parser, new[]{ "Type", "Items" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Game.Zhg.RankPvpResp.Types.Item), global::Pb.Game.Zhg.RankPvpResp.Types.Item.Parser, new[]{ "Uid", "Uname", "Score", "Avatar" }, null, null, null, null)}) + new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Game.Zhg.RankPvpResp), global::Pb.Game.Zhg.RankPvpResp.Parser, new[]{ "Type", "Items" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Game.Zhg.RankPvpResp.Types.Item), global::Pb.Game.Zhg.RankPvpResp.Types.Item.Parser, new[]{ "Uid", "Uname", "Score", "Avatar" }, null, null, null, null)}), + new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Game.Zhg.RankRvpSubmitResult), global::Pb.Game.Zhg.RankRvpSubmitResult.Parser, new[]{ "Items" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Game.Zhg.RankRvpSubmitResult.Types.Reward), global::Pb.Game.Zhg.RankRvpSubmitResult.Types.Reward.Parser, new[]{ "Uid", "Uname", "Integral", "Title" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Pb.Game.Zhg.RankRvpSubmitResult.Types.Item), global::Pb.Game.Zhg.RankRvpSubmitResult.Types.Item.Parser, new[]{ "Type", "Rewards" }, null, null, null, null)}) })); } #endregion @@ -867,6 +875,734 @@ namespace Pb.Game.Zhg { } + /// + /// RankRvpSubmitResult 排行榜结算 push -> rank.submit 命令(排行榜结算) + /// + public sealed partial class RankRvpSubmitResult : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RankRvpSubmitResult()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Pb.Game.Zhg.RankReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RankRvpSubmitResult() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RankRvpSubmitResult(RankRvpSubmitResult other) : this() { + items_ = other.items_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RankRvpSubmitResult Clone() { + return new RankRvpSubmitResult(this); + } + + /// Field number for the "items" field. + public const int ItemsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_items_codec + = pb::FieldCodec.ForMessage(10, global::Pb.Game.Zhg.RankRvpSubmitResult.Types.Item.Parser); + private readonly pbc::RepeatedField items_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Items { + get { return items_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RankRvpSubmitResult); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RankRvpSubmitResult other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!items_.Equals(other.items_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= items_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + items_.WriteTo(output, _repeated_items_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + items_.WriteTo(ref output, _repeated_items_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += items_.CalculateSize(_repeated_items_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RankRvpSubmitResult other) { + if (other == null) { + return; + } + items_.Add(other.items_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + items_.AddEntriesFrom(input, _repeated_items_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + items_.AddEntriesFrom(ref input, _repeated_items_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the RankRvpSubmitResult message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + /// + /// Reward 具体奖励 + /// + public sealed partial class Reward : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Reward()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Pb.Game.Zhg.RankRvpSubmitResult.Descriptor.NestedTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Reward() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Reward(Reward other) : this() { + uid_ = other.uid_; + uname_ = other.uname_; + integral_ = other.integral_; + title_ = other.title_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Reward Clone() { + return new Reward(this); + } + + /// Field number for the "uid" field. + public const int UidFieldNumber = 1; + private long uid_; + /// + /// 用户ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Uid { + get { return uid_; } + set { + uid_ = value; + } + } + + /// Field number for the "uname" field. + public const int UnameFieldNumber = 2; + private string uname_ = ""; + /// + /// 用户名称 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Uname { + get { return uname_; } + set { + uname_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "integral" field. + public const int IntegralFieldNumber = 3; + private long integral_; + /// + /// 积分奖励 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Integral { + get { return integral_; } + set { + integral_ = value; + } + } + + /// Field number for the "title" field. + public const int TitleFieldNumber = 4; + private long title_; + /// + /// 称号奖励(称号ID列表) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Title { + get { return title_; } + set { + title_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Reward); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Reward other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Uid != other.Uid) return false; + if (Uname != other.Uname) return false; + if (Integral != other.Integral) return false; + if (Title != other.Title) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Uid != 0L) hash ^= Uid.GetHashCode(); + if (Uname.Length != 0) hash ^= Uname.GetHashCode(); + if (Integral != 0L) hash ^= Integral.GetHashCode(); + if (Title != 0L) hash ^= Title.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Uid != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Uid); + } + if (Uname.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Uname); + } + if (Integral != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Integral); + } + if (Title != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Title); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Uid != 0L) { + output.WriteRawTag(8); + output.WriteInt64(Uid); + } + if (Uname.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Uname); + } + if (Integral != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Integral); + } + if (Title != 0L) { + output.WriteRawTag(32); + output.WriteInt64(Title); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Uid != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Uid); + } + if (Uname.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Uname); + } + if (Integral != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Integral); + } + if (Title != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Title); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Reward other) { + if (other == null) { + return; + } + if (other.Uid != 0L) { + Uid = other.Uid; + } + if (other.Uname.Length != 0) { + Uname = other.Uname; + } + if (other.Integral != 0L) { + Integral = other.Integral; + } + if (other.Title != 0L) { + Title = other.Title; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Uid = input.ReadInt64(); + break; + } + case 18: { + Uname = input.ReadString(); + break; + } + case 24: { + Integral = input.ReadInt64(); + break; + } + case 32: { + Title = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Uid = input.ReadInt64(); + break; + } + case 18: { + Uname = input.ReadString(); + break; + } + case 24: { + Integral = input.ReadInt64(); + break; + } + case 32: { + Title = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + + /// + /// Item 奖励项 + /// + public sealed partial class Item : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Item()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Pb.Game.Zhg.RankRvpSubmitResult.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Item() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Item(Item other) : this() { + type_ = other.type_; + rewards_ = other.rewards_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Item Clone() { + return new Item(this); + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 1; + private int type_; + /// + /// 榜单类型 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Type { + get { return type_; } + set { + type_ = value; + } + } + + /// Field number for the "rewards" field. + public const int RewardsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_rewards_codec + = pb::FieldCodec.ForMessage(18, global::Pb.Game.Zhg.RankRvpSubmitResult.Types.Reward.Parser); + private readonly pbc::RepeatedField rewards_ = new pbc::RepeatedField(); + /// + /// 奖励项 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Rewards { + get { return rewards_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Item); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Item other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Type != other.Type) return false; + if(!rewards_.Equals(other.rewards_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Type != 0) hash ^= Type.GetHashCode(); + hash ^= rewards_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Type != 0) { + output.WriteRawTag(8); + output.WriteInt32(Type); + } + rewards_.WriteTo(output, _repeated_rewards_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Type != 0) { + output.WriteRawTag(8); + output.WriteInt32(Type); + } + rewards_.WriteTo(ref output, _repeated_rewards_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Type != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Type); + } + size += rewards_.CalculateSize(_repeated_rewards_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Item other) { + if (other == null) { + return; + } + if (other.Type != 0) { + Type = other.Type; + } + rewards_.Add(other.rewards_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Type = input.ReadInt32(); + break; + } + case 18: { + rewards_.AddEntriesFrom(input, _repeated_rewards_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Type = input.ReadInt32(); + break; + } + case 18: { + rewards_.AddEntriesFrom(ref input, _repeated_rewards_codec); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + #endregion } diff --git a/game/pb/game/zhg/rank.pb.go b/game/pb/game/zhg/rank.pb.go index 32a15f3..246ecb9 100644 --- a/game/pb/game/zhg/rank.pb.go +++ b/game/pb/game/zhg/rank.pb.go @@ -211,6 +211,54 @@ func (x *RankPvpResp) GetItems() []*RankPvpResp_Item { return nil } +// RankRvpSubmitResult 排行榜结算 push -> rank.submit 命令(排行榜结算) +type RankRvpSubmitResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*RankRvpSubmitResult_Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *RankRvpSubmitResult) Reset() { + *x = RankRvpSubmitResult{} + if protoimpl.UnsafeEnabled { + mi := &file_game_zhg_rank_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankRvpSubmitResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankRvpSubmitResult) ProtoMessage() {} + +func (x *RankRvpSubmitResult) ProtoReflect() protoreflect.Message { + mi := &file_game_zhg_rank_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RankRvpSubmitResult.ProtoReflect.Descriptor instead. +func (*RankRvpSubmitResult) Descriptor() ([]byte, []int) { + return file_game_zhg_rank_proto_rawDescGZIP(), []int{2} +} + +func (x *RankRvpSubmitResult) GetItems() []*RankRvpSubmitResult_Item { + if x != nil { + return x.Items + } + return nil +} + type RankPvpResp_Item struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -225,7 +273,7 @@ type RankPvpResp_Item struct { func (x *RankPvpResp_Item) Reset() { *x = RankPvpResp_Item{} if protoimpl.UnsafeEnabled { - mi := &file_game_zhg_rank_proto_msgTypes[2] + mi := &file_game_zhg_rank_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -238,7 +286,7 @@ func (x *RankPvpResp_Item) String() string { func (*RankPvpResp_Item) ProtoMessage() {} func (x *RankPvpResp_Item) ProtoReflect() protoreflect.Message { - mi := &file_game_zhg_rank_proto_msgTypes[2] + mi := &file_game_zhg_rank_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -282,6 +330,134 @@ func (x *RankPvpResp_Item) GetAvatar() string { return "" } +// Reward 具体奖励 +type RankRvpSubmitResult_Reward struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID + Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` // 用户名称 + Integral int64 `protobuf:"varint,3,opt,name=integral,proto3" json:"integral,omitempty"` // 积分奖励 + Title int64 `protobuf:"varint,4,opt,name=title,proto3" json:"title,omitempty"` // 称号奖励(称号ID列表) +} + +func (x *RankRvpSubmitResult_Reward) Reset() { + *x = RankRvpSubmitResult_Reward{} + if protoimpl.UnsafeEnabled { + mi := &file_game_zhg_rank_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankRvpSubmitResult_Reward) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankRvpSubmitResult_Reward) ProtoMessage() {} + +func (x *RankRvpSubmitResult_Reward) ProtoReflect() protoreflect.Message { + mi := &file_game_zhg_rank_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RankRvpSubmitResult_Reward.ProtoReflect.Descriptor instead. +func (*RankRvpSubmitResult_Reward) Descriptor() ([]byte, []int) { + return file_game_zhg_rank_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *RankRvpSubmitResult_Reward) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *RankRvpSubmitResult_Reward) GetUname() string { + if x != nil { + return x.Uname + } + return "" +} + +func (x *RankRvpSubmitResult_Reward) GetIntegral() int64 { + if x != nil { + return x.Integral + } + return 0 +} + +func (x *RankRvpSubmitResult_Reward) GetTitle() int64 { + if x != nil { + return x.Title + } + return 0 +} + +// Item 奖励项 +type RankRvpSubmitResult_Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // 榜单类型 + Rewards []*RankRvpSubmitResult_Reward `protobuf:"bytes,2,rep,name=rewards,proto3" json:"rewards,omitempty"` // 奖励项 +} + +func (x *RankRvpSubmitResult_Item) Reset() { + *x = RankRvpSubmitResult_Item{} + if protoimpl.UnsafeEnabled { + mi := &file_game_zhg_rank_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankRvpSubmitResult_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankRvpSubmitResult_Item) ProtoMessage() {} + +func (x *RankRvpSubmitResult_Item) ProtoReflect() protoreflect.Message { + mi := &file_game_zhg_rank_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RankRvpSubmitResult_Item.ProtoReflect.Descriptor instead. +func (*RankRvpSubmitResult_Item) Descriptor() ([]byte, []int) { + return file_game_zhg_rank_proto_rawDescGZIP(), []int{2, 1} +} + +func (x *RankRvpSubmitResult_Item) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *RankRvpSubmitResult_Item) GetRewards() []*RankRvpSubmitResult_Reward { + if x != nil { + return x.Rewards + } + return nil +} + var File_game_zhg_rank_proto protoreflect.FileDescriptor var file_game_zhg_rank_proto_rawDesc = []byte{ @@ -301,22 +477,40 @@ var file_game_zhg_rank_proto_rawDesc = []byte{ 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x2a, - 0xc2, 0x01, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, - 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x61, 0x6d, - 0x61, 0x67, 0x65, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x65, 0x44, 0x61, 0x6d, 0x61, 0x67, - 0x65, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x10, 0x03, - 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x10, 0x04, 0x12, - 0x0c, 0x0a, 0x08, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x10, 0x05, 0x12, 0x0e, 0x0a, - 0x0a, 0x44, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x10, 0x06, 0x12, 0x0e, 0x0a, - 0x0a, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x07, 0x12, 0x10, 0x0a, - 0x0c, 0x44, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x08, 0x12, - 0x07, 0x0a, 0x03, 0x57, 0x69, 0x6e, 0x10, 0x09, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x6f, 0x73, 0x74, - 0x10, 0x0a, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, 0x64, - 0x10, 0x0b, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x65, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, - 0x6f, 0x64, 0x10, 0x0c, 0x42, 0x20, 0x5a, 0x1e, 0x64, 0x63, 0x67, 0x2f, 0x67, 0x61, 0x6d, 0x65, - 0x2f, 0x70, 0x62, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x7a, 0x68, 0x67, 0x3b, 0x70, 0x62, 0x47, - 0x61, 0x6d, 0x65, 0x5a, 0x68, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, + 0x95, 0x02, 0x0a, 0x13, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x67, 0x61, 0x6d, 0x65, + 0x2e, 0x7a, 0x68, 0x67, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x62, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x1a, 0x5d, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x2e, + 0x7a, 0x68, 0x67, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x76, 0x70, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x07, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2a, 0xc2, 0x01, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, + 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x10, 0x01, 0x12, 0x0c, 0x0a, + 0x08, 0x44, 0x65, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x65, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x4b, 0x69, 0x6c, 0x6c, 0x55, + 0x6e, 0x69, 0x74, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x55, + 0x6e, 0x69, 0x74, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x10, 0x07, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x65, 0x4b, 0x69, 0x6c, 0x6c, 0x50, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x08, 0x12, 0x07, 0x0a, 0x03, 0x57, 0x69, 0x6e, 0x10, 0x09, + 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x6f, 0x73, 0x74, 0x10, 0x0a, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x69, + 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x10, 0x0b, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x65, + 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x10, 0x0c, 0x42, 0x20, 0x5a, 0x1e, + 0x64, 0x63, 0x67, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x62, 0x2f, 0x67, 0x61, 0x6d, 0x65, + 0x2f, 0x7a, 0x68, 0x67, 0x3b, 0x70, 0x62, 0x47, 0x61, 0x6d, 0x65, 0x5a, 0x68, 0x67, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -332,20 +526,25 @@ func file_game_zhg_rank_proto_rawDescGZIP() []byte { } var file_game_zhg_rank_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_game_zhg_rank_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_game_zhg_rank_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_game_zhg_rank_proto_goTypes = []interface{}{ - (RankType)(0), // 0: pb.game.zhg.RankType - (*RankPvpReq)(nil), // 1: pb.game.zhg.RankPvpReq - (*RankPvpResp)(nil), // 2: pb.game.zhg.RankPvpResp - (*RankPvpResp_Item)(nil), // 3: pb.game.zhg.RankPvpResp.Item + (RankType)(0), // 0: pb.game.zhg.RankType + (*RankPvpReq)(nil), // 1: pb.game.zhg.RankPvpReq + (*RankPvpResp)(nil), // 2: pb.game.zhg.RankPvpResp + (*RankRvpSubmitResult)(nil), // 3: pb.game.zhg.RankRvpSubmitResult + (*RankPvpResp_Item)(nil), // 4: pb.game.zhg.RankPvpResp.Item + (*RankRvpSubmitResult_Reward)(nil), // 5: pb.game.zhg.RankRvpSubmitResult.Reward + (*RankRvpSubmitResult_Item)(nil), // 6: pb.game.zhg.RankRvpSubmitResult.Item } var file_game_zhg_rank_proto_depIdxs = []int32{ - 3, // 0: pb.game.zhg.RankPvpResp.items:type_name -> pb.game.zhg.RankPvpResp.Item - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 4, // 0: pb.game.zhg.RankPvpResp.items:type_name -> pb.game.zhg.RankPvpResp.Item + 6, // 1: pb.game.zhg.RankRvpSubmitResult.items:type_name -> pb.game.zhg.RankRvpSubmitResult.Item + 5, // 2: pb.game.zhg.RankRvpSubmitResult.Item.rewards:type_name -> pb.game.zhg.RankRvpSubmitResult.Reward + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_game_zhg_rank_proto_init() } @@ -379,6 +578,18 @@ func file_game_zhg_rank_proto_init() { } } file_game_zhg_rank_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankRvpSubmitResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_game_zhg_rank_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RankPvpResp_Item); i { case 0: return &v.state @@ -390,6 +601,30 @@ func file_game_zhg_rank_proto_init() { return nil } } + file_game_zhg_rank_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankRvpSubmitResult_Reward); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_game_zhg_rank_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankRvpSubmitResult_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -397,7 +632,7 @@ func file_game_zhg_rank_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_game_zhg_rank_proto_rawDesc, NumEnums: 1, - NumMessages: 3, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/game/pb/game/zhg/rank.proto b/game/pb/game/zhg/rank.proto index c69f914..f1b2191 100644 --- a/game/pb/game/zhg/rank.proto +++ b/game/pb/game/zhg/rank.proto @@ -36,4 +36,21 @@ message RankPvpResp { } int32 type = 1; // rank类型 repeated Item items = 2; // rank数据 +} + +// RankRvpSubmitResult 排行榜结算 push -> rank.submit 命令(排行榜结算) +message RankRvpSubmitResult { + // Reward 具体奖励 + message Reward { + int64 uid = 1; // 用户ID + string uname = 2; // 用户名称 + int64 integral = 3; // 积分奖励 + int64 title = 4; // 称号奖励(称号ID列表) + } + // Item 奖励项 + message Item { + int32 type = 1; // 榜单类型 + repeated Reward rewards = 2; // 奖励项 + } + repeated Item items = 1; } \ No newline at end of file diff --git a/pkg/cmd/cmd_parser.go b/pkg/cmd/cmd_parser.go index cb09d97..d11f6dc 100644 --- a/pkg/cmd/cmd_parser.go +++ b/pkg/cmd/cmd_parser.go @@ -71,8 +71,7 @@ func (p *Parser) Parse(content string) *CMD { var matchedCmdArr []string if p.distinct && isCMD { matchedCmdArr = make([]string, 0, len(matchedKeys)) - for i := len(matchedKeys) - 1; i >= 0; i-- { - s := matchedKeys[i] + for _, s := range matchedKeys { sRune := []rune(s) if _, ok := arrMap[sRune[0]]; !ok { arrMap[sRune[0]] = struct{}{} diff --git a/pkg/cmd/cmd_parser_test.go b/pkg/cmd/cmd_parser_test.go index eee7671..7b1e093 100644 --- a/pkg/cmd/cmd_parser_test.go +++ b/pkg/cmd/cmd_parser_test.go @@ -28,7 +28,7 @@ func TestParse(t *testing.T) { "c2", } - p := NewCMDParser([]string{"j", "c1", "c2", "c3", "c4", "b1", "b2", "b3", "s", "b2", "b3", "w", "m1", "m2", "m3", "加入", "加入游戏"}) + p := NewCMDParser(true, "j", "c1", "c2", "c3", "c4", "b1", "b2", "b3", "s", "b2", "b3", "w", "m1", "m2", "m3", "加入", "加入游戏") for _, content := range contents { cmdStruct := p.Parse(content) @@ -38,13 +38,13 @@ func TestParse(t *testing.T) { } func TestA(t *testing.T) { - p := NewCMDParser([]string{"j", "j1", "j2", "j3"}) - c := p.Parse("j2j2jjjjja") + p := NewCMDParser(false, "j", "j1", "j2", "j3", "结算1", "结算12") + c := p.Parse("结算1") fmt.Println(c) } func BenchmarkCmd(b *testing.B) { - p := NewCMDParser([]string{"j", "c1", "c2", "c3", "c4", "b1", "b2", "b3", "s", "b2", "b3", "w", "m1", "m2", "m3", "加入", "加入游戏"}) + p := NewCMDParser(false, "j", "c1", "c2", "c3", "c4", "b1", "b2", "b3", "s", "b2", "b3", "w", "m1", "m2", "m3", "加入", "加入游戏") content := "jc2m2b1s" b.ResetTimer()