From c256f6b3df1ca692670eed7b3b5cc29ad2401415 Mon Sep 17 00:00:00 2001 From: NorthLan <6995syu@163.com> Date: Wed, 4 May 2022 00:26:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=AE=B0=E5=BD=95|=E6=8E=92=E8=A1=8C=E6=A6=9C,=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/user_center/pb/user_center.pb.go | 818 +++++++++++- app/user_center/pb/user_center.proto | 64 + app/user_center/pb/user_center_grpc.pb.go | 220 +++ app/user_center/usercenter/user_center.go | 55 +- config-dev.yml | 34 + config.yml | 4 +- game/logic/init.go | 52 + game/logic/rank/rank.go | 58 + game/{ => logic}/room/manager.go | 4 + game/logic/statistics/stat_pvp.go | 100 ++ game/msg_transfer/danmaku/msg_to_push.go | 21 +- game/msg_transfer/gift/msg_to_push.go | 7 +- game/pb/notify/notify.proto | 46 - game/pb/push/Broadcast.cs | 145 +- game/pb/push/broadcast.pb.go | 121 +- game/pb/push/broadcast.proto | 2 +- game/pb/rank/Rank.cs | 827 ++++++++++++ game/pb/rank/gen.bat | 2 + game/pb/rank/rank.pb.go | 380 ++++++ game/pb/rank/rank.proto | 31 + game/pb/stat/Stat.cs | 1482 +++++++++++++++++++++ game/pb/stat/gen.bat | 2 + game/pb/stat/stat.pb.go | 507 +++++++ game/pb/stat/stat.proto | 41 + game/svc/service_context.go | 23 +- main.go | 5 +- 26 files changed, 4801 insertions(+), 250 deletions(-) create mode 100644 config-dev.yml create mode 100644 game/logic/init.go create mode 100644 game/logic/rank/rank.go rename game/{ => logic}/room/manager.go (97%) create mode 100644 game/logic/statistics/stat_pvp.go delete mode 100644 game/pb/notify/notify.proto create mode 100644 game/pb/rank/Rank.cs create mode 100644 game/pb/rank/gen.bat create mode 100644 game/pb/rank/rank.pb.go create mode 100644 game/pb/rank/rank.proto create mode 100644 game/pb/stat/Stat.cs create mode 100644 game/pb/stat/gen.bat create mode 100644 game/pb/stat/stat.pb.go create mode 100644 game/pb/stat/stat.proto diff --git a/app/user_center/pb/user_center.pb.go b/app/user_center/pb/user_center.pb.go index e4d140c..224c6c7 100644 --- a/app/user_center/pb/user_center.pb.go +++ b/app/user_center/pb/user_center.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 +// protoc-gen-go v1.27.1 // protoc v3.19.4 // source: user_center.proto @@ -117,6 +117,44 @@ func (x *User) GetPInfo() string { return "" } +type Empty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[1] + 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 Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{1} +} + // req type PlatformUserReq struct { state protoimpl.MessageState @@ -130,7 +168,7 @@ type PlatformUserReq struct { func (x *PlatformUserReq) Reset() { *x = PlatformUserReq{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[1] + mi := &file_user_center_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -143,7 +181,7 @@ func (x *PlatformUserReq) String() string { func (*PlatformUserReq) ProtoMessage() {} func (x *PlatformUserReq) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[1] + mi := &file_user_center_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -156,7 +194,7 @@ func (x *PlatformUserReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PlatformUserReq.ProtoReflect.Descriptor instead. func (*PlatformUserReq) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{1} + return file_user_center_proto_rawDescGZIP(), []int{2} } func (x *PlatformUserReq) GetPlatform() string { @@ -184,7 +222,7 @@ type PlatformUserResp struct { func (x *PlatformUserResp) Reset() { *x = PlatformUserResp{} if protoimpl.UnsafeEnabled { - mi := &file_user_center_proto_msgTypes[2] + mi := &file_user_center_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -197,7 +235,7 @@ func (x *PlatformUserResp) String() string { func (*PlatformUserResp) ProtoMessage() {} func (x *PlatformUserResp) ProtoReflect() protoreflect.Message { - mi := &file_user_center_proto_msgTypes[2] + mi := &file_user_center_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -210,7 +248,7 @@ func (x *PlatformUserResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PlatformUserResp.ProtoReflect.Descriptor instead. func (*PlatformUserResp) Descriptor() ([]byte, []int) { - return file_user_center_proto_rawDescGZIP(), []int{2} + return file_user_center_proto_rawDescGZIP(), []int{3} } func (x *PlatformUserResp) GetUser() *User { @@ -220,6 +258,516 @@ func (x *PlatformUserResp) GetUser() *User { return nil } +// 通知-PvP伤害 statistics.pvp.damage +type StatPvPDamageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 造成伤害的用户ID + TargetUid *int64 `protobuf:"varint,2,opt,name=targetUid,proto3,oneof" json:"targetUid,omitempty"` // 目标用户ID(可能是基地,不一定有) + Damage float32 `protobuf:"fixed32,3,opt,name=damage,proto3" json:"damage,omitempty"` // 伤害量 +} + +func (x *StatPvPDamageReq) Reset() { + *x = StatPvPDamageReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPDamageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPDamageReq) ProtoMessage() {} + +func (x *StatPvPDamageReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_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 StatPvPDamageReq.ProtoReflect.Descriptor instead. +func (*StatPvPDamageReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{4} +} + +func (x *StatPvPDamageReq) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *StatPvPDamageReq) GetTargetUid() int64 { + if x != nil && x.TargetUid != nil { + return *x.TargetUid + } + return 0 +} + +func (x *StatPvPDamageReq) GetDamage() float32 { + if x != nil { + return x.Damage + } + return 0 +} + +// 通知-PvP击杀单位 statistics.pvp.killunit +type StatPvPKillUnitReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID + TargetUid *int64 `protobuf:"varint,2,opt,name=targetUid,proto3,oneof" json:"targetUid,omitempty"` // 目标用户 + Attacker string `protobuf:"bytes,3,opt,name=attacker,proto3" json:"attacker,omitempty"` // 造成击杀东西(building:兵营 U0001:xxx兵 S0001: 技能) + Victim string `protobuf:"bytes,4,opt,name=victim,proto3" json:"victim,omitempty"` // 被击杀的东西(U0001:xxx兵) +} + +func (x *StatPvPKillUnitReq) Reset() { + *x = StatPvPKillUnitReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPKillUnitReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPKillUnitReq) ProtoMessage() {} + +func (x *StatPvPKillUnitReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_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 StatPvPKillUnitReq.ProtoReflect.Descriptor instead. +func (*StatPvPKillUnitReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{5} +} + +func (x *StatPvPKillUnitReq) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *StatPvPKillUnitReq) GetTargetUid() int64 { + if x != nil && x.TargetUid != nil { + return *x.TargetUid + } + return 0 +} + +func (x *StatPvPKillUnitReq) GetAttacker() string { + if x != nil { + return x.Attacker + } + return "" +} + +func (x *StatPvPKillUnitReq) GetVictim() string { + if x != nil { + return x.Victim + } + return "" +} + +// 通知-PvP杀兵营(人) statistics.pvp.kill +type StatPvPKillReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID + TargetUid int64 `protobuf:"varint,2,opt,name=targetUid,proto3" json:"targetUid,omitempty"` // 目标用户 + IsGeneral bool `protobuf:"varint,3,opt,name=isGeneral,proto3" json:"isGeneral,omitempty"` // targetUid是否名将 +} + +func (x *StatPvPKillReq) Reset() { + *x = StatPvPKillReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPKillReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPKillReq) ProtoMessage() {} + +func (x *StatPvPKillReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[6] + 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 StatPvPKillReq.ProtoReflect.Descriptor instead. +func (*StatPvPKillReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{6} +} + +func (x *StatPvPKillReq) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *StatPvPKillReq) GetTargetUid() int64 { + if x != nil { + return x.TargetUid + } + return 0 +} + +func (x *StatPvPKillReq) GetIsGeneral() bool { + if x != nil { + return x.IsGeneral + } + return false +} + +// 通知-PvP一血 statistics.pvp.first +type StatPvPFirstBloodReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID + Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` // 1-拿到一血 2-被破一血 +} + +func (x *StatPvPFirstBloodReq) Reset() { + *x = StatPvPFirstBloodReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPFirstBloodReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPFirstBloodReq) ProtoMessage() {} + +func (x *StatPvPFirstBloodReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[7] + 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 StatPvPFirstBloodReq.ProtoReflect.Descriptor instead. +func (*StatPvPFirstBloodReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{7} +} + +func (x *StatPvPFirstBloodReq) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *StatPvPFirstBloodReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +// 通知-PvP战报 statistics.pvp.report +type StatPvPReportReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WinCamp int32 `protobuf:"varint,1,opt,name=winCamp,proto3" json:"winCamp,omitempty"` // 获胜阵营 1-蓝 2-红 + GeneralUid int64 `protobuf:"varint,2,opt,name=generalUid,proto3" json:"generalUid,omitempty"` // 名将UID + WinUids []int64 `protobuf:"varint,3,rep,packed,name=winUids,proto3" json:"winUids,omitempty"` // 战胜方玩家列表 + LostUids []int64 `protobuf:"varint,4,rep,packed,name=lostUids,proto3" json:"lostUids,omitempty"` // 战败方玩家列表 +} + +func (x *StatPvPReportReq) Reset() { + *x = StatPvPReportReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPReportReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPReportReq) ProtoMessage() {} + +func (x *StatPvPReportReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[8] + 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 StatPvPReportReq.ProtoReflect.Descriptor instead. +func (*StatPvPReportReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{8} +} + +func (x *StatPvPReportReq) GetWinCamp() int32 { + if x != nil { + return x.WinCamp + } + return 0 +} + +func (x *StatPvPReportReq) GetGeneralUid() int64 { + if x != nil { + return x.GeneralUid + } + return 0 +} + +func (x *StatPvPReportReq) GetWinUids() []int64 { + if x != nil { + return x.WinUids + } + return nil +} + +func (x *StatPvPReportReq) GetLostUids() []int64 { + if x != nil { + return x.LostUids + } + return nil +} + +// rank +type RankPvpReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // rank类型 + TopN int32 `protobuf:"varint,2,opt,name=topN,proto3" json:"topN,omitempty"` // TopN +} + +func (x *RankPvpReq) Reset() { + *x = RankPvpReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankPvpReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankPvpReq) ProtoMessage() {} + +func (x *RankPvpReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[9] + 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 RankPvpReq.ProtoReflect.Descriptor instead. +func (*RankPvpReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{9} +} + +func (x *RankPvpReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *RankPvpReq) GetTopN() int32 { + if x != nil { + return x.TopN + } + return 0 +} + +type RankPvpResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // rank类型 + Items []*RankPvpResp_Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // rank数据 +} + +func (x *RankPvpResp) Reset() { + *x = RankPvpResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankPvpResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankPvpResp) ProtoMessage() {} + +func (x *RankPvpResp) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[10] + 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 RankPvpResp.ProtoReflect.Descriptor instead. +func (*RankPvpResp) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{10} +} + +func (x *RankPvpResp) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *RankPvpResp) GetItems() []*RankPvpResp_Item { + if x != nil { + return x.Items + } + return nil +} + +type RankPvpResp_Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` + Score int64 `protobuf:"varint,3,opt,name=score,proto3" json:"score,omitempty"` + Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` +} + +func (x *RankPvpResp_Item) Reset() { + *x = RankPvpResp_Item{} + if protoimpl.UnsafeEnabled { + mi := &file_user_center_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankPvpResp_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankPvpResp_Item) ProtoMessage() {} + +func (x *RankPvpResp_Item) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[11] + 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 RankPvpResp_Item.ProtoReflect.Descriptor instead. +func (*RankPvpResp_Item) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *RankPvpResp_Item) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *RankPvpResp_Item) GetUname() string { + if x != nil { + return x.Uname + } + return "" +} + +func (x *RankPvpResp_Item) GetScore() int64 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *RankPvpResp_Item) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + var File_user_center_proto protoreflect.FileDescriptor var file_user_center_proto_rawDesc = []byte{ @@ -235,20 +783,88 @@ var file_user_center_proto_rawDesc = []byte{ 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, - 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x41, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 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, 0x12, 0x0a, 0x04, 0x70, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x22, 0x30, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0x4f, 0x0a, 0x0a, 0x75, 0x73, 0x65, - 0x72, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x14, 0x72, 0x65, 0x74, 0x72, 0x69, - 0x65, 0x76, 0x65, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x41, 0x0a, + 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 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, 0x12, 0x0a, 0x04, + 0x70, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, + 0x22, 0x30, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x22, 0x6d, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x44, 0x61, 0x6d, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x09, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x61, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x64, 0x61, 0x6d, + 0x61, 0x67, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, + 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x12, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, 0x6c, + 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x09, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, + 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, + 0x08, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x61, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x69, 0x63, + 0x74, 0x69, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x69, 0x63, 0x74, 0x69, + 0x6d, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x22, + 0x5e, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, 0x6c, 0x6c, 0x52, 0x65, + 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x22, + 0x3c, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, + 0x6c, 0x6f, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x82, 0x01, + 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, + 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70, 0x12, 0x1e, 0x0a, 0x0a, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, + 0x77, 0x69, 0x6e, 0x55, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x77, + 0x69, 0x6e, 0x55, 0x69, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x73, 0x74, 0x55, 0x69, + 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x6f, 0x73, 0x74, 0x55, 0x69, + 0x64, 0x73, 0x22, 0x34, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x71, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x22, 0xab, 0x01, 0x0a, 0x0b, 0x52, 0x61, 0x6e, + 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, + 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x5c, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, + 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, 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, 0x32, 0xfd, 0x02, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x43, + 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x14, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, + 0x65, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x12, 0x13, 0x2e, + 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, + 0x50, 0x76, 0x70, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, + 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x0f, 0x73, 0x74, + 0x61, 0x74, 0x50, 0x76, 0x70, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x16, 0x2e, + 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, + 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x12, 0x2c, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x50, 0x76, 0x70, 0x4b, 0x69, 0x6c, 0x6c, 0x12, + 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, 0x6c, 0x6c, + 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x38, + 0x0a, 0x11, 0x73, 0x74, 0x61, 0x74, 0x50, 0x76, 0x70, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, + 0x6f, 0x6f, 0x64, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, + 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x09, 0x2e, + 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x30, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, + 0x50, 0x76, 0x70, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x2a, 0x0a, 0x07, 0x72, 0x61, + 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x12, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, + 0x76, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, + 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -263,21 +879,43 @@ func file_user_center_proto_rawDescGZIP() []byte { return file_user_center_proto_rawDescData } -var file_user_center_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_user_center_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_user_center_proto_goTypes = []interface{}{ - (*User)(nil), // 0: pb.User - (*PlatformUserReq)(nil), // 1: pb.PlatformUserReq - (*PlatformUserResp)(nil), // 2: pb.PlatformUserResp + (*User)(nil), // 0: pb.User + (*Empty)(nil), // 1: pb.Empty + (*PlatformUserReq)(nil), // 2: pb.PlatformUserReq + (*PlatformUserResp)(nil), // 3: pb.PlatformUserResp + (*StatPvPDamageReq)(nil), // 4: pb.StatPvPDamageReq + (*StatPvPKillUnitReq)(nil), // 5: pb.StatPvPKillUnitReq + (*StatPvPKillReq)(nil), // 6: pb.StatPvPKillReq + (*StatPvPFirstBloodReq)(nil), // 7: pb.StatPvPFirstBloodReq + (*StatPvPReportReq)(nil), // 8: pb.StatPvPReportReq + (*RankPvpReq)(nil), // 9: pb.RankPvpReq + (*RankPvpResp)(nil), // 10: pb.RankPvpResp + (*RankPvpResp_Item)(nil), // 11: pb.RankPvpResp.Item } var file_user_center_proto_depIdxs = []int32{ - 0, // 0: pb.PlatformUserResp.user:type_name -> pb.User - 1, // 1: pb.userCenter.retrievePlatformUser:input_type -> pb.PlatformUserReq - 2, // 2: pb.userCenter.retrievePlatformUser:output_type -> pb.PlatformUserResp - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] 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 + 0, // 0: pb.PlatformUserResp.user:type_name -> pb.User + 11, // 1: pb.RankPvpResp.items:type_name -> pb.RankPvpResp.Item + 2, // 2: pb.userCenter.retrievePlatformUser:input_type -> pb.PlatformUserReq + 4, // 3: pb.userCenter.statPvpDamage:input_type -> pb.StatPvPDamageReq + 5, // 4: pb.userCenter.statPvpKillUnit:input_type -> pb.StatPvPKillUnitReq + 6, // 5: pb.userCenter.statPvpKill:input_type -> pb.StatPvPKillReq + 7, // 6: pb.userCenter.statPvpFirstBlood:input_type -> pb.StatPvPFirstBloodReq + 8, // 7: pb.userCenter.statPvpReport:input_type -> pb.StatPvPReportReq + 9, // 8: pb.userCenter.rankPvp:input_type -> pb.RankPvpReq + 3, // 9: pb.userCenter.retrievePlatformUser:output_type -> pb.PlatformUserResp + 1, // 10: pb.userCenter.statPvpDamage:output_type -> pb.Empty + 1, // 11: pb.userCenter.statPvpKillUnit:output_type -> pb.Empty + 1, // 12: pb.userCenter.statPvpKill:output_type -> pb.Empty + 1, // 13: pb.userCenter.statPvpFirstBlood:output_type -> pb.Empty + 1, // 14: pb.userCenter.statPvpReport:output_type -> pb.Empty + 10, // 15: pb.userCenter.rankPvp:output_type -> pb.RankPvpResp + 9, // [9:16] is the sub-list for method output_type + 2, // [2:9] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_user_center_proto_init() } @@ -299,7 +937,7 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlatformUserReq); i { + switch v := v.(*Empty); i { case 0: return &v.state case 1: @@ -311,6 +949,18 @@ func file_user_center_proto_init() { } } file_user_center_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlatformUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PlatformUserResp); i { case 0: return &v.state @@ -322,14 +972,112 @@ func file_user_center_proto_init() { return nil } } + file_user_center_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPDamageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPKillUnitReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPKillReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPFirstBloodReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPReportReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_center_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpResp_Item); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } + file_user_center_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_user_center_proto_msgTypes[5].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_center_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/app/user_center/pb/user_center.proto b/app/user_center/pb/user_center.proto index 2ffe8a0..465f618 100644 --- a/app/user_center/pb/user_center.proto +++ b/app/user_center/pb/user_center.proto @@ -16,6 +16,8 @@ message User { string pInfo = 7; } +message Empty {} + // req message PlatformUserReq { string platform = 1; @@ -26,8 +28,70 @@ message PlatformUserResp { User user = 1; } +// 通知-PvP伤害 statistics.pvp.damage +message StatPvPDamageReq { + int64 uid = 1; // 造成伤害的用户ID + optional int64 targetUid = 2; // 目标用户ID(可能是基地,不一定有) + float damage = 3; // 伤害量 +} + +// 通知-PvP击杀单位 statistics.pvp.killunit +message StatPvPKillUnitReq { + int64 uid = 1; // 用户ID + optional int64 targetUid = 2; // 目标用户 + string attacker = 3; // 造成击杀东西(building:兵营 U0001:xxx兵 S0001: 技能) + string victim = 4; // 被击杀的东西(U0001:xxx兵) +} + +// 通知-PvP杀兵营(人) statistics.pvp.kill +message StatPvPKillReq { + int64 uid = 1; // 用户ID + int64 targetUid = 2; // 目标用户 + bool isGeneral = 3; // targetUid是否名将 +} + +// 通知-PvP一血 statistics.pvp.first +message StatPvPFirstBloodReq { + int64 uid = 1; // 用户ID + int32 type = 2; // 1-拿到一血 2-被破一血 +} + +// 通知-PvP战报 statistics.pvp.report +message StatPvPReportReq { + int32 winCamp = 1; // 获胜阵营 1-蓝 2-红 + int64 generalUid = 2; // 名将UID + repeated int64 winUids = 3; // 战胜方玩家列表 + repeated int64 lostUids = 4; // 战败方玩家列表 +} + +// rank +message RankPvpReq { + int32 type = 1; // rank类型 + int32 topN = 2; // TopN +} + +message RankPvpResp { + message Item { + int64 uid = 1; + string uname = 2; + int64 score = 3; + string avatar = 4; + } + int32 type = 1; // rank类型 + repeated Item items = 2; // rank数据 +} service userCenter { // user rpc retrievePlatformUser(PlatformUserReq) returns (PlatformUserResp); + + // statistics + rpc statPvpDamage(StatPvPDamageReq) returns (Empty); + rpc statPvpKillUnit(StatPvPKillUnitReq) returns (Empty); + rpc statPvpKill(StatPvPKillReq) returns (Empty); + rpc statPvpFirstBlood(StatPvPFirstBloodReq) returns (Empty); + rpc statPvpReport(StatPvPReportReq) returns (Empty); + + // rank + rpc rankPvp(RankPvpReq) returns(RankPvpResp); } \ No newline at end of file diff --git a/app/user_center/pb/user_center_grpc.pb.go b/app/user_center/pb/user_center_grpc.pb.go index d21481f..35dd5b7 100644 --- a/app/user_center/pb/user_center_grpc.pb.go +++ b/app/user_center/pb/user_center_grpc.pb.go @@ -24,6 +24,14 @@ const _ = grpc.SupportPackageIsVersion7 type UserCenterClient interface { // user RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error) + // statistics + StatPvpDamage(ctx context.Context, in *StatPvPDamageReq, opts ...grpc.CallOption) (*Empty, error) + StatPvpKillUnit(ctx context.Context, in *StatPvPKillUnitReq, opts ...grpc.CallOption) (*Empty, error) + StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) + StatPvpFirstBlood(ctx context.Context, in *StatPvPFirstBloodReq, opts ...grpc.CallOption) (*Empty, error) + StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*Empty, error) + // rank + RankPvp(ctx context.Context, in *RankPvpReq, opts ...grpc.CallOption) (*RankPvpResp, error) } type userCenterClient struct { @@ -43,12 +51,74 @@ func (c *userCenterClient) RetrievePlatformUser(ctx context.Context, in *Platfor return out, nil } +func (c *userCenterClient) StatPvpDamage(ctx context.Context, in *StatPvPDamageReq, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpDamage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userCenterClient) StatPvpKillUnit(ctx context.Context, in *StatPvPKillUnitReq, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpKillUnit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userCenterClient) StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpKill", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userCenterClient) StatPvpFirstBlood(ctx context.Context, in *StatPvPFirstBloodReq, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpFirstBlood", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userCenterClient) StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.userCenter/statPvpReport", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userCenterClient) RankPvp(ctx context.Context, in *RankPvpReq, opts ...grpc.CallOption) (*RankPvpResp, error) { + out := new(RankPvpResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/rankPvp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // UserCenterServer is the server API for UserCenter service. // All implementations must embed UnimplementedUserCenterServer // for forward compatibility type UserCenterServer interface { // user RetrievePlatformUser(context.Context, *PlatformUserReq) (*PlatformUserResp, error) + // statistics + StatPvpDamage(context.Context, *StatPvPDamageReq) (*Empty, error) + StatPvpKillUnit(context.Context, *StatPvPKillUnitReq) (*Empty, error) + StatPvpKill(context.Context, *StatPvPKillReq) (*Empty, error) + StatPvpFirstBlood(context.Context, *StatPvPFirstBloodReq) (*Empty, error) + StatPvpReport(context.Context, *StatPvPReportReq) (*Empty, error) + // rank + RankPvp(context.Context, *RankPvpReq) (*RankPvpResp, error) mustEmbedUnimplementedUserCenterServer() } @@ -59,6 +129,24 @@ type UnimplementedUserCenterServer struct { func (UnimplementedUserCenterServer) RetrievePlatformUser(context.Context, *PlatformUserReq) (*PlatformUserResp, error) { return nil, status.Errorf(codes.Unimplemented, "method RetrievePlatformUser not implemented") } +func (UnimplementedUserCenterServer) StatPvpDamage(context.Context, *StatPvPDamageReq) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method StatPvpDamage not implemented") +} +func (UnimplementedUserCenterServer) StatPvpKillUnit(context.Context, *StatPvPKillUnitReq) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method StatPvpKillUnit not implemented") +} +func (UnimplementedUserCenterServer) StatPvpKill(context.Context, *StatPvPKillReq) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method StatPvpKill not implemented") +} +func (UnimplementedUserCenterServer) StatPvpFirstBlood(context.Context, *StatPvPFirstBloodReq) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method StatPvpFirstBlood not implemented") +} +func (UnimplementedUserCenterServer) StatPvpReport(context.Context, *StatPvPReportReq) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method StatPvpReport not implemented") +} +func (UnimplementedUserCenterServer) RankPvp(context.Context, *RankPvpReq) (*RankPvpResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RankPvp not implemented") +} func (UnimplementedUserCenterServer) mustEmbedUnimplementedUserCenterServer() {} // UnsafeUserCenterServer may be embedded to opt out of forward compatibility for this service. @@ -90,6 +178,114 @@ func _UserCenter_RetrievePlatformUser_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _UserCenter_StatPvpDamage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatPvPDamageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserCenterServer).StatPvpDamage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/statPvpDamage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).StatPvpDamage(ctx, req.(*StatPvPDamageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserCenter_StatPvpKillUnit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatPvPKillUnitReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserCenterServer).StatPvpKillUnit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/statPvpKillUnit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).StatPvpKillUnit(ctx, req.(*StatPvPKillUnitReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserCenter_StatPvpKill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatPvPKillReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserCenterServer).StatPvpKill(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/statPvpKill", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).StatPvpKill(ctx, req.(*StatPvPKillReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserCenter_StatPvpFirstBlood_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatPvPFirstBloodReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserCenterServer).StatPvpFirstBlood(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/statPvpFirstBlood", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).StatPvpFirstBlood(ctx, req.(*StatPvPFirstBloodReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserCenter_StatPvpReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatPvPReportReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserCenterServer).StatPvpReport(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/statPvpReport", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).StatPvpReport(ctx, req.(*StatPvPReportReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserCenter_RankPvp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RankPvpReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserCenterServer).RankPvp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.userCenter/rankPvp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserCenterServer).RankPvp(ctx, req.(*RankPvpReq)) + } + return interceptor(ctx, in, info, handler) +} + // UserCenter_ServiceDesc is the grpc.ServiceDesc for UserCenter service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -101,6 +297,30 @@ var UserCenter_ServiceDesc = grpc.ServiceDesc{ MethodName: "retrievePlatformUser", Handler: _UserCenter_RetrievePlatformUser_Handler, }, + { + MethodName: "statPvpDamage", + Handler: _UserCenter_StatPvpDamage_Handler, + }, + { + MethodName: "statPvpKillUnit", + Handler: _UserCenter_StatPvpKillUnit_Handler, + }, + { + MethodName: "statPvpKill", + Handler: _UserCenter_StatPvpKill_Handler, + }, + { + MethodName: "statPvpFirstBlood", + Handler: _UserCenter_StatPvpFirstBlood_Handler, + }, + { + MethodName: "statPvpReport", + Handler: _UserCenter_StatPvpReport_Handler, + }, + { + MethodName: "rankPvp", + Handler: _UserCenter_RankPvp_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "user_center.proto", diff --git a/app/user_center/usercenter/user_center.go b/app/user_center/usercenter/user_center.go index cca3391..354c063 100644 --- a/app/user_center/usercenter/user_center.go +++ b/app/user_center/usercenter/user_center.go @@ -13,13 +13,30 @@ import ( ) type ( - PlatformUserReq = pb.PlatformUserReq - PlatformUserResp = pb.PlatformUserResp - User = pb.User + Empty = pb.Empty + PlatformUserReq = pb.PlatformUserReq + PlatformUserResp = pb.PlatformUserResp + RankPvpReq = pb.RankPvpReq + RankPvpResp = pb.RankPvpResp + RankPvpResp_Item = pb.RankPvpResp_Item + StatPvPDamageReq = pb.StatPvPDamageReq + StatPvPFirstBloodReq = pb.StatPvPFirstBloodReq + StatPvPKillReq = pb.StatPvPKillReq + StatPvPKillUnitReq = pb.StatPvPKillUnitReq + StatPvPReportReq = pb.StatPvPReportReq + User = pb.User UserCenter interface { // user RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error) + // statistics + StatPvpDamage(ctx context.Context, in *StatPvPDamageReq, opts ...grpc.CallOption) (*Empty, error) + StatPvpKillUnit(ctx context.Context, in *StatPvPKillUnitReq, opts ...grpc.CallOption) (*Empty, error) + StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) + StatPvpFirstBlood(ctx context.Context, in *StatPvPFirstBloodReq, opts ...grpc.CallOption) (*Empty, error) + StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*Empty, error) + // rank + RankPvp(ctx context.Context, in *RankPvpReq, opts ...grpc.CallOption) (*RankPvpResp, error) } defaultUserCenter struct { @@ -38,3 +55,35 @@ func (m *defaultUserCenter) RetrievePlatformUser(ctx context.Context, in *Platfo client := pb.NewUserCenterClient(m.cli.Conn()) return client.RetrievePlatformUser(ctx, in, opts...) } + +// statistics +func (m *defaultUserCenter) StatPvpDamage(ctx context.Context, in *StatPvPDamageReq, opts ...grpc.CallOption) (*Empty, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.StatPvpDamage(ctx, in, opts...) +} + +func (m *defaultUserCenter) StatPvpKillUnit(ctx context.Context, in *StatPvPKillUnitReq, opts ...grpc.CallOption) (*Empty, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.StatPvpKillUnit(ctx, in, opts...) +} + +func (m *defaultUserCenter) StatPvpKill(ctx context.Context, in *StatPvPKillReq, opts ...grpc.CallOption) (*Empty, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.StatPvpKill(ctx, in, opts...) +} + +func (m *defaultUserCenter) StatPvpFirstBlood(ctx context.Context, in *StatPvPFirstBloodReq, opts ...grpc.CallOption) (*Empty, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.StatPvpFirstBlood(ctx, in, opts...) +} + +func (m *defaultUserCenter) StatPvpReport(ctx context.Context, in *StatPvPReportReq, opts ...grpc.CallOption) (*Empty, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.StatPvpReport(ctx, in, opts...) +} + +// rank +func (m *defaultUserCenter) RankPvp(ctx context.Context, in *RankPvpReq, opts ...grpc.CallOption) (*RankPvpResp, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.RankPvp(ctx, in, opts...) +} diff --git a/config-dev.yml b/config-dev.yml new file mode 100644 index 0000000..262fd58 --- /dev/null +++ b/config-dev.yml @@ -0,0 +1,34 @@ +Server: + Debug: false + Listen: 0.0.0.0:8888 +Command: + Keys: [ "j", "加入", "加入游戏", "s", "w", "我在哪", "c1", "c2", "c3", "c4", "r1", "r2", "r3", "m1", "m2", "m3" ] +UserCenterRpc: + Etcd: + Hosts: + - 127.0.0.1:2379 + Key: usercenter.rpc.dev +Kafka: + Danmaku: + Addr: [ "127.0.0.1:9093" ] + Topic: "danmaku" + Gift: + Addr: [ "127.0.0.1:9093" ] + Topic: "gift" +ConsumerGroupId: + GiftToPush: "giftToPush-Dev" + MsgToPush: "msgToPush-Dev" +Log: + Console: + Level: debug + Format: console + File: + Enabled: false + Level: info + Format: json + Path: ./logs + Filename: dcg.log + FileMaxSize: 10 # 10mb + FileMaxBackups: 30 # + MaxAge: 7 # 保留7天 + Compress: true # 压缩日志 \ No newline at end of file diff --git a/config.yml b/config.yml index 667a319..f5666f2 100644 --- a/config.yml +++ b/config.yml @@ -20,10 +20,10 @@ ConsumerGroupId: MsgToPush: "msgToPush" Log: Console: - Level: debug + Level: warn Format: console File: - Enabled: false + Enabled: true Level: info Format: json Path: ./logs diff --git a/game/logic/init.go b/game/logic/init.go new file mode 100644 index 0000000..9fb00dc --- /dev/null +++ b/game/logic/init.go @@ -0,0 +1,52 @@ +package logic + +import ( + "dcg/game/logic/rank" + "dcg/game/logic/room" + "dcg/game/logic/statistics" + "dcg/game/svc" + "git.noahlan.cn/northlan/ngs/component" + "strings" +) + +var GameLogic *Logics + +type Logics struct { + Services *component.Components + + RoomManager *room.Manager + StatisticsPvP *statistics.PvP + Rank *rank.Rank +} + +func Init(svcCtx *svc.ServiceContext) { + services := &component.Components{} + + roomManager := room.NewRoomManager() + services.Register(roomManager, + component.WithName(roomManager.CMD()), + component.WithNameFunc(func(s string) string { + return strings.ToLower(s) + })) + + statisticsPvP := statistics.NewStatisticsPvP(svcCtx) + services.Register(statisticsPvP, + component.WithName(statisticsPvP.CMD()), + component.WithNameFunc(func(s string) string { + return statisticsPvP.Prefix() + "." + strings.ToLower(s) + })) + + rk := rank.NewRank(svcCtx) + services.Register(rk, + component.WithName(rk.CMD()), + component.WithNameFunc(func(s string) string { + return strings.ToLower(s) + })) + + GameLogic = &Logics{ + Services: services, + RoomManager: roomManager, + StatisticsPvP: statisticsPvP, + Rank: rk, + } +} diff --git a/game/logic/rank/rank.go b/game/logic/rank/rank.go new file mode 100644 index 0000000..c2ce5a5 --- /dev/null +++ b/game/logic/rank/rank.go @@ -0,0 +1,58 @@ +package rank + +import ( + "dcg/app/user_center/usercenter" + pbRank "dcg/game/pb/rank" + "dcg/game/svc" + "git.noahlan.cn/northlan/ngs/component" + "git.noahlan.cn/northlan/ngs/session" +) + +type Rank struct { + component.Base + svcCtx *svc.ServiceContext +} + +func NewRank(svcCtx *svc.ServiceContext) *Rank { + return &Rank{ + svcCtx: svcCtx, + } +} + +func (p *Rank) Init() { +} + +func (p *Rank) Shutdown() { +} + +func (p *Rank) CMD() string { + return "rank" +} + +func (p *Rank) Prefix() string { + return "" +} + +// Pvp pvp排行榜获取 +func (p *Rank) Pvp(s *session.Session, msg *pbRank.RankPvpReq) error { + result, err := p.svcCtx.UserCenterRpc.RankPvp(p.svcCtx.Ctx, &usercenter.RankPvpReq{ + Type: msg.Type, + TopN: msg.TopN, + }) + if err != nil { + return err + } + items := make([]*pbRank.RankPvpResp_Item, 0, len(result.Items)) + for _, item := range result.Items { + items = append(items, &pbRank.RankPvpResp_Item{ + Uid: item.Uid, + Uname: item.Uname, + Score: item.Score, + Avatar: item.Avatar, + }) + } + return s.Response(&pbRank.RankPvpResp{ + Type: result.Type, + Items: items, + }) +} diff --git a/game/room/manager.go b/game/logic/room/manager.go similarity index 97% rename from game/room/manager.go rename to game/logic/room/manager.go index aa17f51..2cb0e20 100644 --- a/game/room/manager.go +++ b/game/logic/room/manager.go @@ -33,6 +33,10 @@ func NewRoomManager() *Manager { } } +func (m *Manager) CMD() string { + return "room" +} + func (m *Manager) Init() { } diff --git a/game/logic/statistics/stat_pvp.go b/game/logic/statistics/stat_pvp.go new file mode 100644 index 0000000..6be4667 --- /dev/null +++ b/game/logic/statistics/stat_pvp.go @@ -0,0 +1,100 @@ +package statistics + +import ( + "dcg/app/user_center/usercenter" + pbStat "dcg/game/pb/stat" + "dcg/game/svc" + "git.noahlan.cn/northlan/ngs/component" + "git.noahlan.cn/northlan/ngs/session" +) + +type PvP struct { + component.Base + svcCtx *svc.ServiceContext +} + +func NewStatisticsPvP(svcCtx *svc.ServiceContext) *PvP { + return &PvP{ + svcCtx: svcCtx, + } +} + +func (p *PvP) CMD() string { + return "statistics" +} + +func (p *PvP) Prefix() string { + return "pvp" +} + +func (p *PvP) Init() { +} + +func (p *PvP) Shutdown() { +} + +// Damage 伤害记录 +func (p *PvP) Damage(s *session.Session, msg *pbStat.StatPvPDamage) error { + _, err := p.svcCtx.UserCenterRpc.StatPvpDamage(p.svcCtx.Ctx, &usercenter.StatPvPDamageReq{ + Uid: msg.Uid, + TargetUid: msg.TargetUid, + Damage: msg.Damage, + }) + if err != nil { + return err + } + return nil +} + +// KillUnit 击杀单位 +func (p *PvP) KillUnit(s *session.Session, msg *pbStat.StatPvPKillUnit) error { + _, err := p.svcCtx.UserCenterRpc.StatPvpKillUnit(p.svcCtx.Ctx, &usercenter.StatPvPKillUnitReq{ + Uid: msg.Uid, + TargetUid: msg.TargetUid, + Attacker: msg.Attacker, + Victim: msg.Victim, + }) + if err != nil { + return err + } + return nil +} + +// Kill 击杀玩家 +func (p *PvP) Kill(s *session.Session, msg *pbStat.StatPvPKill) error { + _, err := p.svcCtx.UserCenterRpc.StatPvpKill(p.svcCtx.Ctx, &usercenter.StatPvPKillReq{ + Uid: msg.Uid, + TargetUid: msg.TargetUid, + IsGeneral: msg.IsGeneral, + }) + if err != nil { + return err + } + return nil +} + +// First 一血 +func (p *PvP) First(s *session.Session, msg *pbStat.StatPvPFirstBlood) error { + _, err := p.svcCtx.UserCenterRpc.StatPvpFirstBlood(p.svcCtx.Ctx, &usercenter.StatPvPFirstBloodReq{ + Uid: msg.Uid, + Type: msg.Type, + }) + if err != nil { + return err + } + return nil +} + +// Report 战报 +func (p *PvP) Report(s *session.Session, msg *pbStat.StatPvPReport) error { + _, err := p.svcCtx.UserCenterRpc.StatPvpReport(p.svcCtx.Ctx, &usercenter.StatPvPReportReq{ + WinCamp: msg.WinCamp, + GeneralUid: msg.GeneralUid, + WinUids: msg.WinUids, + LostUids: msg.LostUids, + }) + if err != nil { + return err + } + return nil +} diff --git a/game/msg_transfer/danmaku/msg_to_push.go b/game/msg_transfer/danmaku/msg_to_push.go index 2742dd4..f360e76 100644 --- a/game/msg_transfer/danmaku/msg_to_push.go +++ b/game/msg_transfer/danmaku/msg_to_push.go @@ -2,9 +2,10 @@ package danmaku import ( "context" - "dcg/app/user_center/pb" + "dcg/app/user_center/usercenter" "dcg/config" "dcg/game/command" + "dcg/game/logic" pbMq "dcg/game/pb/mq" pushPb "dcg/game/pb/push" "dcg/game/svc" @@ -57,11 +58,11 @@ func (h *MsgToPushHandler) Init(svc *svc.ServiceContext) { } func (h *MsgToPushHandler) handleJoinGame(roomId int64, _ string, user *pushPb.PushUser) { - h.svc.RoomManager.PushToRoom(roomId, "game.join", &pushPb.JoinGame{User: user}) + logic.GameLogic.RoomManager.PushToRoom(roomId, "game.join", &pushPb.JoinGame{User: user}) } func (h *MsgToPushHandler) handleOutbreak(roomId int64, _ string, user *pushPb.PushUser) { - h.svc.RoomManager.PushToRoom(roomId, "game.outbreak", &pushPb.Outbreak{User: user}) + logic.GameLogic.RoomManager.PushToRoom(roomId, "game.outbreak", &pushPb.Outbreak{User: user}) } func (h *MsgToPushHandler) handleCreateUnit(roomId int64, cmd string, user *pushPb.PushUser) { @@ -69,7 +70,7 @@ func (h *MsgToPushHandler) handleCreateUnit(roomId int64, cmd string, user *push return } unit := cmd[1] - h.svc.RoomManager.PushToRoom(roomId, "game.createUnit", &pushPb.CreateUnit{ + logic.GameLogic.RoomManager.PushToRoom(roomId, "game.createUnit", &pushPb.CreateUnit{ User: user, Unit: string(unit), }) @@ -80,14 +81,14 @@ func (h *MsgToPushHandler) handleMove(roomId int64, cmd string, user *pushPb.Pus return } line := cmd[1] - h.svc.RoomManager.PushToRoom(roomId, "game.move", &pushPb.Move{ + logic.GameLogic.RoomManager.PushToRoom(roomId, "game.move", &pushPb.Move{ User: user, Line: string(line), }) } func (h *MsgToPushHandler) handleWai(roomId int64, _ string, user *pushPb.PushUser) { - h.svc.RoomManager.PushToRoom(roomId, "game.wai", &pushPb.Wai{User: user}) + logic.GameLogic.RoomManager.PushToRoom(roomId, "game.wai", &pushPb.Wai{User: user}) } func (h *MsgToPushHandler) handleMode(roomId int64, cmd string, user *pushPb.PushUser) { @@ -95,13 +96,13 @@ func (h *MsgToPushHandler) handleMode(roomId int64, cmd string, user *pushPb.Pus return } line := cmd[1] - h.svc.RoomManager.PushToRoom(roomId, "game.mode", &pushPb.BuildingMode{ + logic.GameLogic.RoomManager.PushToRoom(roomId, "game.mode", &pushPb.BuildingMode{ User: user, Mode: string(line), }) } -func (h *MsgToPushHandler) handleDanmaku(data []byte, msgKey string) { +func (h *MsgToPushHandler) handleDanmaku(data []byte, _ string) { // danmaku msg proto var msgFromMq pbMq.MqDanmaku if err := proto.Unmarshal(data, &msgFromMq); err != nil { @@ -114,7 +115,7 @@ func (h *MsgToPushHandler) handleDanmaku(data []byte, msgKey string) { Uname: msgFromMq.Uname, } - rpcUser, err := h.svc.UserCenterRpc.RetrievePlatformUser(context.Background(), &pb.PlatformUserReq{ + rpcUser, err := h.svc.UserCenterRpc.RetrievePlatformUser(context.Background(), &usercenter.PlatformUserReq{ Platform: msgFromMq.Platform, PUid: strconv.FormatInt(msgFromMq.Uid, 10), }) @@ -132,7 +133,7 @@ func (h *MsgToPushHandler) handleDanmaku(data []byte, msgKey string) { } } else { // 发送正常的非命令弹幕消息 - h.svc.RoomManager.PushToRoom(msgFromMq.LiveRoomId, "live.danmaku", &pushPb.DanmakuMsg{ + logic.GameLogic.RoomManager.PushToRoom(msgFromMq.LiveRoomId, "live.danmaku", &pushPb.DanmakuMsg{ User: pbUser, Content: msgFromMq.Content, }) diff --git a/game/msg_transfer/gift/msg_to_push.go b/game/msg_transfer/gift/msg_to_push.go index 7e2ace7..dc4e8d7 100644 --- a/game/msg_transfer/gift/msg_to_push.go +++ b/game/msg_transfer/gift/msg_to_push.go @@ -2,8 +2,9 @@ package gift import ( "context" - "dcg/app/user_center/pb" + "dcg/app/user_center/usercenter" "dcg/config" + "dcg/game/logic" pbMq "dcg/game/pb/mq" pushPb "dcg/game/pb/push" "dcg/game/svc" @@ -54,7 +55,7 @@ func (h *MsgToPushHandler) handleGift(data []byte, msgKey string) { UId: msgFromMq.Uid, Uname: msgFromMq.Uname, } - rpcUser, err := h.ctx.UserCenterRpc.RetrievePlatformUser(context.Background(), &pb.PlatformUserReq{ + rpcUser, err := h.ctx.UserCenterRpc.RetrievePlatformUser(context.Background(), &usercenter.PlatformUserReq{ Platform: msgFromMq.Platform, PUid: strconv.FormatInt(msgFromMq.Uid, 10), }) @@ -65,7 +66,7 @@ func (h *MsgToPushHandler) handleGift(data []byte, msgKey string) { logger.SLog.Error("rpc获取用户信息失败", err) } - h.ctx.RoomManager.PushToRoom(msgFromMq.LiveRoomId, "game.gift", &pushPb.Gift{ + logic.GameLogic.RoomManager.PushToRoom(msgFromMq.LiveRoomId, "game.gift", &pushPb.Gift{ User: pbUser, GiftId: msgFromMq.GiftId, Num: msgFromMq.Num, diff --git a/game/pb/notify/notify.proto b/game/pb/notify/notify.proto deleted file mode 100644 index 807d284..0000000 --- a/game/pb/notify/notify.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; - -package pb; - -option go_package = "/pbNotify"; - -// 通知-PvP伤害 -message NotifyPvPDamage { - int64 uid = 1; // 造成伤害的用户ID - int64 targetUid = 2; // 目标用户ID - float damage = 3; // 造成的伤害量 - int32 type = 4; // 造成伤害类型 1-兵种造成伤害 2-技能伤害 - string unit = 5; // 造成伤害的兵种 - string skill = 6; // 造成伤害的技能 -} - -// 通知-PvP击杀单位 -message NotifyPvPKillUnit { - int64 uid = 1; // 用户ID - int64 targetUid = 2; // 目标用户 - string unit = 3; // 击杀单位种类 player:玩家 U0001-xx兵 -} - -message NotifyPvPKill { - int64 uid = 1; // 用户ID - int64 targetUid = 2; // 目标用户 -} - -// 通知-PvP一血 -message NotifyPvPFirstBlood { - int64 uid = 1; // 用户ID - int32 type = 2; // 1-拿到一血 2-被破一血 -} - -// 通知-PvP战报 -message NotifyPvPReport { - message Report { - int64 uid = 1; // 用户ID - string uname = 2; // 用户名 - int64 score = 3; // 分数 - int64 damage = 4; // 伤害 - } - int32 winCamp = 1; // 获胜阵营 1-蓝 2-红 - repeated Report winReport = 2; // 战胜方上榜数据 - repeated Report lostReport = 3; // 战败方上榜数据 -} \ No newline at end of file diff --git a/game/pb/push/Broadcast.cs b/game/pb/push/Broadcast.cs index ba7f301..f11e4c0 100644 --- a/game/pb/push/Broadcast.cs +++ b/game/pb/push/Broadcast.cs @@ -9,7 +9,7 @@ using pb = global::Google.Protobuf; using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; -namespace Pb { +namespace PbClient { /// Holder for reflection information generated from broadcast.proto public static partial class BroadcastReflection { @@ -24,31 +24,32 @@ namespace Pb { static BroadcastReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cg9icm9hZGNhc3QucHJvdG8SAnBiIjYKCFB1c2hVc2VyEgsKA3VJZBgBIAEo", - "AxINCgV1bmFtZRgCIAEoCRIOCgZhdmF0YXIYAyABKAkiJgoISm9pbkdhbWUS", - "GgoEdXNlchgBIAEoCzIMLnBiLlB1c2hVc2VyIjYKCkNyZWF0ZVVuaXQSGgoE", - "dXNlchgBIAEoCzIMLnBiLlB1c2hVc2VyEgwKBHVuaXQYAiABKAkiMAoETW92", - "ZRIaCgR1c2VyGAEgASgLMgwucGIuUHVzaFVzZXISDAoEbGluZRgCIAEoCSIm", - "CghPdXRicmVhaxIaCgR1c2VyGAEgASgLMgwucGIuUHVzaFVzZXIidgoER2lm", - "dBIaCgR1c2VyGAEgASgLMgwucGIuUHVzaFVzZXISDgoGZ2lmdElkGAIgASgD", - "EgsKA251bRgDIAEoAxIQCghnaWZ0TmFtZRgEIAEoCRIRCgl0b3RhbENvaW4Y", - "BSABKAMSEAoIc2VuZFRpbWUYBiABKAMiIQoDV2FpEhoKBHVzZXIYASABKAsy", - "DC5wYi5QdXNoVXNlciI4CgxCdWlsZGluZ01vZGUSGgoEdXNlchgBIAEoCzIM", - "LnBiLlB1c2hVc2VyEgwKBG1vZGUYAiABKAkiOQoKRGFubWFrdU1zZxIaCgR1", - "c2VyGAEgASgLMgwucGIuUHVzaFVzZXISDwoHY29udGVudBgCIAEoCUIJWgcv", - "cGJQdXNoYgZwcm90bzM=")); + "Cg9icm9hZGNhc3QucHJvdG8SCHBiQ2xpZW50IjYKCFB1c2hVc2VyEgsKA3VJ", + "ZBgBIAEoAxINCgV1bmFtZRgCIAEoCRIOCgZhdmF0YXIYAyABKAkiLAoISm9p", + "bkdhbWUSIAoEdXNlchgBIAEoCzISLnBiQ2xpZW50LlB1c2hVc2VyIjwKCkNy", + "ZWF0ZVVuaXQSIAoEdXNlchgBIAEoCzISLnBiQ2xpZW50LlB1c2hVc2VyEgwK", + "BHVuaXQYAiABKAkiNgoETW92ZRIgCgR1c2VyGAEgASgLMhIucGJDbGllbnQu", + "UHVzaFVzZXISDAoEbGluZRgCIAEoCSIsCghPdXRicmVhaxIgCgR1c2VyGAEg", + "ASgLMhIucGJDbGllbnQuUHVzaFVzZXIifAoER2lmdBIgCgR1c2VyGAEgASgL", + "MhIucGJDbGllbnQuUHVzaFVzZXISDgoGZ2lmdElkGAIgASgDEgsKA251bRgD", + "IAEoAxIQCghnaWZ0TmFtZRgEIAEoCRIRCgl0b3RhbENvaW4YBSABKAMSEAoI", + "c2VuZFRpbWUYBiABKAMiJwoDV2FpEiAKBHVzZXIYASABKAsyEi5wYkNsaWVu", + "dC5QdXNoVXNlciI+CgxCdWlsZGluZ01vZGUSIAoEdXNlchgBIAEoCzISLnBi", + "Q2xpZW50LlB1c2hVc2VyEgwKBG1vZGUYAiABKAkiPwoKRGFubWFrdU1zZxIg", + "CgR1c2VyGAEgASgLMhIucGJDbGllbnQuUHVzaFVzZXISDwoHY29udGVudBgC", + "IAEoCUIJWgcvcGJQdXNoYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Pb.PushUser), global::Pb.PushUser.Parser, new[]{ "UId", "Uname", "Avatar" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Pb.JoinGame), global::Pb.JoinGame.Parser, new[]{ "User" }, null, null, null, null), - 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", "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) + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.PushUser), global::PbClient.PushUser.Parser, new[]{ "UId", "Uname", "Avatar" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.JoinGame), global::PbClient.JoinGame.Parser, new[]{ "User" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.CreateUnit), global::PbClient.CreateUnit.Parser, new[]{ "User", "Unit" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.Move), global::PbClient.Move.Parser, new[]{ "User", "Line" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.Outbreak), global::PbClient.Outbreak.Parser, new[]{ "User" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.Gift), global::PbClient.Gift.Parser, new[]{ "User", "GiftId", "Num", "GiftName", "TotalCoin", "SendTime" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.Wai), global::PbClient.Wai.Parser, new[]{ "User" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.BuildingMode), global::PbClient.BuildingMode.Parser, new[]{ "User", "Mode" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.DanmakuMsg), global::PbClient.DanmakuMsg.Parser, new[]{ "User", "Content" }, null, null, null, null) })); } #endregion @@ -69,7 +70,7 @@ namespace Pb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.BroadcastReflection.Descriptor.MessageTypes[0]; } + get { return global::PbClient.BroadcastReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -341,7 +342,7 @@ namespace Pb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.BroadcastReflection.Descriptor.MessageTypes[1]; } + get { return global::PbClient.BroadcastReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -373,10 +374,10 @@ namespace Pb { /// Field number for the "user" field. public const int UserFieldNumber = 1; - private global::Pb.PushUser user_; + private global::PbClient.PushUser user_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Pb.PushUser User { + public global::PbClient.PushUser User { get { return user_; } set { user_ = value; @@ -470,7 +471,7 @@ namespace Pb { } if (other.user_ != null) { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } User.MergeFrom(other.User); } @@ -491,7 +492,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -513,7 +514,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -539,7 +540,7 @@ namespace Pb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.BroadcastReflection.Descriptor.MessageTypes[2]; } + get { return global::PbClient.BroadcastReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -572,10 +573,10 @@ namespace Pb { /// Field number for the "user" field. public const int UserFieldNumber = 1; - private global::Pb.PushUser user_; + private global::PbClient.PushUser user_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Pb.PushUser User { + public global::PbClient.PushUser User { get { return user_; } set { user_ = value; @@ -697,7 +698,7 @@ namespace Pb { } if (other.user_ != null) { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } User.MergeFrom(other.User); } @@ -721,7 +722,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -747,7 +748,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -777,7 +778,7 @@ namespace Pb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.BroadcastReflection.Descriptor.MessageTypes[3]; } + get { return global::PbClient.BroadcastReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -810,10 +811,10 @@ namespace Pb { /// Field number for the "user" field. public const int UserFieldNumber = 1; - private global::Pb.PushUser user_; + private global::PbClient.PushUser user_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Pb.PushUser User { + public global::PbClient.PushUser User { get { return user_; } set { user_ = value; @@ -935,7 +936,7 @@ namespace Pb { } if (other.user_ != null) { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } User.MergeFrom(other.User); } @@ -959,7 +960,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -985,7 +986,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -1015,7 +1016,7 @@ namespace Pb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.BroadcastReflection.Descriptor.MessageTypes[4]; } + get { return global::PbClient.BroadcastReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1047,10 +1048,10 @@ namespace Pb { /// Field number for the "user" field. public const int UserFieldNumber = 1; - private global::Pb.PushUser user_; + private global::PbClient.PushUser user_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Pb.PushUser User { + public global::PbClient.PushUser User { get { return user_; } set { user_ = value; @@ -1144,7 +1145,7 @@ namespace Pb { } if (other.user_ != null) { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } User.MergeFrom(other.User); } @@ -1165,7 +1166,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -1187,7 +1188,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -1213,7 +1214,7 @@ namespace Pb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.BroadcastReflection.Descriptor.MessageTypes[5]; } + get { return global::PbClient.BroadcastReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1250,10 +1251,10 @@ namespace Pb { /// Field number for the "user" field. public const int UserFieldNumber = 1; - private global::Pb.PushUser user_; + private global::PbClient.PushUser user_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Pb.PushUser User { + public global::PbClient.PushUser User { get { return user_; } set { user_ = value; @@ -1472,7 +1473,7 @@ namespace Pb { } if (other.user_ != null) { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } User.MergeFrom(other.User); } @@ -1508,7 +1509,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -1550,7 +1551,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -1596,7 +1597,7 @@ namespace Pb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.BroadcastReflection.Descriptor.MessageTypes[6]; } + get { return global::PbClient.BroadcastReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1628,10 +1629,10 @@ namespace Pb { /// Field number for the "user" field. public const int UserFieldNumber = 1; - private global::Pb.PushUser user_; + private global::PbClient.PushUser user_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Pb.PushUser User { + public global::PbClient.PushUser User { get { return user_; } set { user_ = value; @@ -1725,7 +1726,7 @@ namespace Pb { } if (other.user_ != null) { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } User.MergeFrom(other.User); } @@ -1746,7 +1747,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -1768,7 +1769,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -1794,7 +1795,7 @@ namespace Pb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.BroadcastReflection.Descriptor.MessageTypes[7]; } + get { return global::PbClient.BroadcastReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1827,10 +1828,10 @@ namespace Pb { /// Field number for the "user" field. public const int UserFieldNumber = 1; - private global::Pb.PushUser user_; + private global::PbClient.PushUser user_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Pb.PushUser User { + public global::PbClient.PushUser User { get { return user_; } set { user_ = value; @@ -1949,7 +1950,7 @@ namespace Pb { } if (other.user_ != null) { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } User.MergeFrom(other.User); } @@ -1973,7 +1974,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -1999,7 +2000,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -2029,7 +2030,7 @@ namespace Pb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Pb.BroadcastReflection.Descriptor.MessageTypes[8]; } + get { return global::PbClient.BroadcastReflection.Descriptor.MessageTypes[8]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -2062,10 +2063,10 @@ namespace Pb { /// Field number for the "user" field. public const int UserFieldNumber = 1; - private global::Pb.PushUser user_; + private global::PbClient.PushUser user_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Pb.PushUser User { + public global::PbClient.PushUser User { get { return user_; } set { user_ = value; @@ -2184,7 +2185,7 @@ namespace Pb { } if (other.user_ != null) { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } User.MergeFrom(other.User); } @@ -2208,7 +2209,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; @@ -2234,7 +2235,7 @@ namespace Pb { break; case 10: { if (user_ == null) { - User = new global::Pb.PushUser(); + User = new global::PbClient.PushUser(); } input.ReadMessage(User); break; diff --git a/game/pb/push/broadcast.pb.go b/game/pb/push/broadcast.pb.go index 482deba..ac68e4c 100644 --- a/game/pb/push/broadcast.pb.go +++ b/game/pb/push/broadcast.pb.go @@ -535,49 +535,52 @@ var File_broadcast_proto protoreflect.FileDescriptor var file_broadcast_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x62, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x4a, 0x0a, 0x08, 0x50, 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, - 0x75, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, - 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, - 0x72, 0x22, 0x2c, 0x0a, 0x08, 0x4a, 0x6f, 0x69, 0x6e, 0x47, 0x61, 0x6d, 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, 0x22, - 0x42, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 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, - 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, - 0x6e, 0x69, 0x74, 0x22, 0x3c, 0x0a, 0x04, 0x4d, 0x6f, 0x76, 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, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, - 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, - 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, 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, 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, + 0x6f, 0x12, 0x08, 0x70, 0x62, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x22, 0x4a, 0x0a, 0x08, 0x50, + 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x32, 0x0a, 0x08, 0x4a, 0x6f, 0x69, 0x6e, 0x47, + 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x75, 0x73, + 0x68, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x48, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x6e, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x75, 0x6e, 0x69, 0x74, 0x22, 0x42, 0x0a, 0x04, 0x4d, 0x6f, 0x76, 0x65, 0x12, 0x26, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x32, 0x0a, 0x08, 0x4f, 0x75, 0x74, + 0x62, 0x72, 0x65, 0x61, 0x6b, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x50, + 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xae, 0x01, + 0x0a, 0x04, 0x47, 0x69, 0x66, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 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, 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, 0x2d, + 0x0a, 0x03, 0x57, 0x61, 0x69, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x50, + 0x75, 0x73, 0x68, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x4a, 0x0a, + 0x0c, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x26, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 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, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x4e, 0x0a, 0x0a, 0x44, 0x61, 0x6e, + 0x6d, 0x61, 0x6b, 0x75, 0x4d, 0x73, 0x67, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 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 ( @@ -594,25 +597,25 @@ func file_broadcast_proto_rawDescGZIP() []byte { var file_broadcast_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_broadcast_proto_goTypes = []interface{}{ - (*PushUser)(nil), // 0: pb.PushUser - (*JoinGame)(nil), // 1: pb.JoinGame - (*CreateUnit)(nil), // 2: pb.CreateUnit - (*Move)(nil), // 3: pb.Move - (*Outbreak)(nil), // 4: pb.Outbreak - (*Gift)(nil), // 5: pb.Gift - (*Wai)(nil), // 6: pb.Wai - (*BuildingMode)(nil), // 7: pb.BuildingMode - (*DanmakuMsg)(nil), // 8: pb.DanmakuMsg + (*PushUser)(nil), // 0: pbClient.PushUser + (*JoinGame)(nil), // 1: pbClient.JoinGame + (*CreateUnit)(nil), // 2: pbClient.CreateUnit + (*Move)(nil), // 3: pbClient.Move + (*Outbreak)(nil), // 4: pbClient.Outbreak + (*Gift)(nil), // 5: pbClient.Gift + (*Wai)(nil), // 6: pbClient.Wai + (*BuildingMode)(nil), // 7: pbClient.BuildingMode + (*DanmakuMsg)(nil), // 8: pbClient.DanmakuMsg } var file_broadcast_proto_depIdxs = []int32{ - 0, // 0: pb.JoinGame.user:type_name -> pb.PushUser - 0, // 1: pb.CreateUnit.user:type_name -> pb.PushUser - 0, // 2: pb.Move.user:type_name -> pb.PushUser - 0, // 3: pb.Outbreak.user:type_name -> pb.PushUser - 0, // 4: pb.Gift.user:type_name -> pb.PushUser - 0, // 5: pb.Wai.user:type_name -> pb.PushUser - 0, // 6: pb.BuildingMode.user:type_name -> pb.PushUser - 0, // 7: pb.DanmakuMsg.user:type_name -> pb.PushUser + 0, // 0: pbClient.JoinGame.user:type_name -> pbClient.PushUser + 0, // 1: pbClient.CreateUnit.user:type_name -> pbClient.PushUser + 0, // 2: pbClient.Move.user:type_name -> pbClient.PushUser + 0, // 3: pbClient.Outbreak.user:type_name -> pbClient.PushUser + 0, // 4: pbClient.Gift.user:type_name -> pbClient.PushUser + 0, // 5: pbClient.Wai.user:type_name -> pbClient.PushUser + 0, // 6: pbClient.BuildingMode.user:type_name -> pbClient.PushUser + 0, // 7: pbClient.DanmakuMsg.user:type_name -> pbClient.PushUser 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name diff --git a/game/pb/push/broadcast.proto b/game/pb/push/broadcast.proto index 506b94f..dd7acec 100644 --- a/game/pb/push/broadcast.proto +++ b/game/pb/push/broadcast.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package pb; +package pbClient; option go_package = "/pbPush"; diff --git a/game/pb/rank/Rank.cs b/game/pb/rank/Rank.cs new file mode 100644 index 0000000..e7bcfcc --- /dev/null +++ b/game/pb/rank/Rank.cs @@ -0,0 +1,827 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: rank.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace PbClient { + + /// Holder for reflection information generated from rank.proto + public static partial class RankReflection { + + #region Descriptor + /// File descriptor for rank.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static RankReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgpyYW5rLnByb3RvEghwYkNsaWVudCIoCgpSYW5rUHZwUmVxEgwKBHR5cGUY", + "ASABKAUSDAoEdG9wThgCIAEoBSKJAQoLUmFua1B2cFJlc3ASDAoEdHlwZRgB", + "IAEoBRIpCgVpdGVtcxgCIAMoCzIaLnBiQ2xpZW50LlJhbmtQdnBSZXNwLkl0", + "ZW0aQQoESXRlbRILCgN1aWQYASABKAMSDQoFdW5hbWUYAiABKAkSDQoFc2Nv", + "cmUYAyABKAMSDgoGYXZhdGFyGAQgASgJKk4KCFJhbmtUeXBlEgsKB1Vua25v", + "d24QABIKCgZEYW1hZ2UQARILCgdHZW5lcmFsEAISDAoIS2lsbFVuaXQQAxIO", + "CgpLaWxsUGxheWVyEARCCVoHL3BiUmFua2IGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::PbClient.RankType), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.RankPvpReq), global::PbClient.RankPvpReq.Parser, new[]{ "Type", "TopN" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.RankPvpResp), global::PbClient.RankPvpResp.Parser, new[]{ "Type", "Items" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.RankPvpResp.Types.Item), global::PbClient.RankPvpResp.Types.Item.Parser, new[]{ "Uid", "Uname", "Score", "Avatar" }, null, null, null, null)}) + })); + } + #endregion + + } + #region Enums + public enum RankType { + [pbr::OriginalName("Unknown")] Unknown = 0, + [pbr::OriginalName("Damage")] Damage = 1, + [pbr::OriginalName("General")] General = 2, + [pbr::OriginalName("KillUnit")] KillUnit = 3, + [pbr::OriginalName("KillPlayer")] KillPlayer = 4, + } + + #endregion + + #region Messages + /// + /// RankPvpReq 获取排行榜 request > rank.pvp + /// + public sealed partial class RankPvpReq : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RankPvpReq()); + 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::PbClient.RankReflection.Descriptor.MessageTypes[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 RankPvpReq() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RankPvpReq(RankPvpReq other) : this() { + type_ = other.type_; + topN_ = other.topN_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RankPvpReq Clone() { + return new RankPvpReq(this); + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 1; + private int type_; + /// + /// rank类型 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Type { + get { return type_; } + set { + type_ = value; + } + } + + /// Field number for the "topN" field. + public const int TopNFieldNumber = 2; + private int topN_; + /// + /// TopN + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TopN { + get { return topN_; } + set { + topN_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as RankPvpReq); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RankPvpReq other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Type != other.Type) return false; + if (TopN != other.TopN) 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(); + if (TopN != 0) hash ^= TopN.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); + } + if (TopN != 0) { + output.WriteRawTag(16); + output.WriteInt32(TopN); + } + 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); + } + if (TopN != 0) { + output.WriteRawTag(16); + output.WriteInt32(TopN); + } + 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); + } + if (TopN != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TopN); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(RankPvpReq other) { + if (other == null) { + return; + } + if (other.Type != 0) { + Type = other.Type; + } + if (other.TopN != 0) { + TopN = other.TopN; + } + _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 16: { + TopN = input.ReadInt32(); + 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 16: { + TopN = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + /// RankPvpResp 排行榜数据 response > rank.pvp + /// + public sealed partial class RankPvpResp : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RankPvpResp()); + 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::PbClient.RankReflection.Descriptor.MessageTypes[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 RankPvpResp() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RankPvpResp(RankPvpResp other) : this() { + type_ = other.type_; + items_ = other.items_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public RankPvpResp Clone() { + return new RankPvpResp(this); + } + + /// Field number for the "type" field. + public const int TypeFieldNumber = 1; + private int type_; + /// + /// rank类型 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Type { + get { return type_; } + set { + type_ = value; + } + } + + /// Field number for the "items" field. + public const int ItemsFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_items_codec + = pb::FieldCodec.ForMessage(18, global::PbClient.RankPvpResp.Types.Item.Parser); + private readonly pbc::RepeatedField items_ = new pbc::RepeatedField(); + /// + /// rank数据 + /// + [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 RankPvpResp); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(RankPvpResp other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Type != other.Type) return false; + 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; + if (Type != 0) hash ^= Type.GetHashCode(); + 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 + if (Type != 0) { + output.WriteRawTag(8); + output.WriteInt32(Type); + } + 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) { + if (Type != 0) { + output.WriteRawTag(8); + output.WriteInt32(Type); + } + 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; + if (Type != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Type); + } + 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(RankPvpResp other) { + if (other == null) { + return; + } + if (other.Type != 0) { + Type = other.Type; + } + 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 8: { + Type = input.ReadInt32(); + break; + } + case 18: { + 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 8: { + Type = input.ReadInt32(); + break; + } + case 18: { + items_.AddEntriesFrom(ref input, _repeated_items_codec); + break; + } + } + } + } + #endif + + #region Nested types + /// Container for nested types declared in the RankPvpResp message type. + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static partial class Types { + 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::PbClient.RankPvpResp.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 Item() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Item(Item other) : this() { + uid_ = other.uid_; + uname_ = other.uname_; + score_ = other.score_; + avatar_ = other.avatar_; + _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 "uid" field. + public const int UidFieldNumber = 1; + private long uid_; + [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 "score" field. + public const int ScoreFieldNumber = 3; + private long score_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long Score { + get { return score_; } + set { + score_ = value; + } + } + + /// Field number for the "avatar" field. + public const int AvatarFieldNumber = 4; + private string avatar_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Avatar { + get { return avatar_; } + set { + avatar_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [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 (Uid != other.Uid) return false; + if (Uname != other.Uname) return false; + if (Score != other.Score) return false; + if (Avatar != other.Avatar) 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 (Score != 0L) hash ^= Score.GetHashCode(); + if (Avatar.Length != 0) hash ^= Avatar.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 (Score != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Score); + } + if (Avatar.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Avatar); + } + 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 (Score != 0L) { + output.WriteRawTag(24); + output.WriteInt64(Score); + } + if (Avatar.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Avatar); + } + 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 (Score != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(Score); + } + if (Avatar.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Avatar); + } + 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.Uid != 0L) { + Uid = other.Uid; + } + if (other.Uname.Length != 0) { + Uname = other.Uname; + } + if (other.Score != 0L) { + Score = other.Score; + } + if (other.Avatar.Length != 0) { + Avatar = other.Avatar; + } + _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: { + Score = input.ReadInt64(); + break; + } + case 34: { + Avatar = input.ReadString(); + 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: { + Score = input.ReadInt64(); + break; + } + case 34: { + Avatar = input.ReadString(); + break; + } + } + } + } + #endif + + } + + } + #endregion + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/game/pb/rank/gen.bat b/game/pb/rank/gen.bat new file mode 100644 index 0000000..f379068 --- /dev/null +++ b/game/pb/rank/gen.bat @@ -0,0 +1,2 @@ +protoc --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_opt=require_unimplemented_servers=false --go_out=. --go-grpc_out=. --proto_path=. *.proto +protoc --csharp_out=. --proto_path=. *.proto \ No newline at end of file diff --git a/game/pb/rank/rank.pb.go b/game/pb/rank/rank.pb.go new file mode 100644 index 0000000..65212a9 --- /dev/null +++ b/game/pb/rank/rank.pb.go @@ -0,0 +1,380 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.19.4 +// source: rank.proto + +package pbRank + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RankType int32 + +const ( + RankType_Unknown RankType = 0 + RankType_Damage RankType = 1 + RankType_General RankType = 2 + RankType_KillUnit RankType = 3 + RankType_KillPlayer RankType = 4 +) + +// Enum value maps for RankType. +var ( + RankType_name = map[int32]string{ + 0: "Unknown", + 1: "Damage", + 2: "General", + 3: "KillUnit", + 4: "KillPlayer", + } + RankType_value = map[string]int32{ + "Unknown": 0, + "Damage": 1, + "General": 2, + "KillUnit": 3, + "KillPlayer": 4, + } +) + +func (x RankType) Enum() *RankType { + p := new(RankType) + *p = x + return p +} + +func (x RankType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RankType) Descriptor() protoreflect.EnumDescriptor { + return file_rank_proto_enumTypes[0].Descriptor() +} + +func (RankType) Type() protoreflect.EnumType { + return &file_rank_proto_enumTypes[0] +} + +func (x RankType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RankType.Descriptor instead. +func (RankType) EnumDescriptor() ([]byte, []int) { + return file_rank_proto_rawDescGZIP(), []int{0} +} + +// RankPvpReq 获取排行榜 request > rank.pvp +type RankPvpReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // rank类型 + TopN int32 `protobuf:"varint,2,opt,name=topN,proto3" json:"topN,omitempty"` // TopN +} + +func (x *RankPvpReq) Reset() { + *x = RankPvpReq{} + if protoimpl.UnsafeEnabled { + mi := &file_rank_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankPvpReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankPvpReq) ProtoMessage() {} + +func (x *RankPvpReq) ProtoReflect() protoreflect.Message { + mi := &file_rank_proto_msgTypes[0] + 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 RankPvpReq.ProtoReflect.Descriptor instead. +func (*RankPvpReq) Descriptor() ([]byte, []int) { + return file_rank_proto_rawDescGZIP(), []int{0} +} + +func (x *RankPvpReq) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *RankPvpReq) GetTopN() int32 { + if x != nil { + return x.TopN + } + return 0 +} + +// RankPvpResp 排行榜数据 response > rank.pvp +type RankPvpResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // rank类型 + Items []*RankPvpResp_Item `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // rank数据 +} + +func (x *RankPvpResp) Reset() { + *x = RankPvpResp{} + if protoimpl.UnsafeEnabled { + mi := &file_rank_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankPvpResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankPvpResp) ProtoMessage() {} + +func (x *RankPvpResp) ProtoReflect() protoreflect.Message { + mi := &file_rank_proto_msgTypes[1] + 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 RankPvpResp.ProtoReflect.Descriptor instead. +func (*RankPvpResp) Descriptor() ([]byte, []int) { + return file_rank_proto_rawDescGZIP(), []int{1} +} + +func (x *RankPvpResp) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *RankPvpResp) GetItems() []*RankPvpResp_Item { + if x != nil { + return x.Items + } + return nil +} + +type RankPvpResp_Item struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname,omitempty"` + Score int64 `protobuf:"varint,3,opt,name=score,proto3" json:"score,omitempty"` + Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` +} + +func (x *RankPvpResp_Item) Reset() { + *x = RankPvpResp_Item{} + if protoimpl.UnsafeEnabled { + mi := &file_rank_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankPvpResp_Item) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RankPvpResp_Item) ProtoMessage() {} + +func (x *RankPvpResp_Item) ProtoReflect() protoreflect.Message { + mi := &file_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 RankPvpResp_Item.ProtoReflect.Descriptor instead. +func (*RankPvpResp_Item) Descriptor() ([]byte, []int) { + return file_rank_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *RankPvpResp_Item) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *RankPvpResp_Item) GetUname() string { + if x != nil { + return x.Uname + } + return "" +} + +func (x *RankPvpResp_Item) GetScore() int64 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *RankPvpResp_Item) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +var File_rank_proto protoreflect.FileDescriptor + +var file_rank_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x70, 0x62, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x22, 0x34, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, + 0x70, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x70, 0x4e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4e, 0x22, 0xb1, 0x01, 0x0a, + 0x0b, 0x52, 0x61, 0x6e, 0x6b, 0x50, 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x30, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x70, 0x62, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x50, + 0x76, 0x70, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x1a, 0x5c, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 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, 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, 0x4e, 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, 0x0b, 0x0a, 0x07, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, + 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x4b, 0x69, 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x10, 0x03, + 0x12, 0x0e, 0x0a, 0x0a, 0x4b, 0x69, 0x6c, 0x6c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x04, + 0x42, 0x09, 0x5a, 0x07, 0x2f, 0x70, 0x62, 0x52, 0x61, 0x6e, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_rank_proto_rawDescOnce sync.Once + file_rank_proto_rawDescData = file_rank_proto_rawDesc +) + +func file_rank_proto_rawDescGZIP() []byte { + file_rank_proto_rawDescOnce.Do(func() { + file_rank_proto_rawDescData = protoimpl.X.CompressGZIP(file_rank_proto_rawDescData) + }) + return file_rank_proto_rawDescData +} + +var file_rank_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_rank_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_rank_proto_goTypes = []interface{}{ + (RankType)(0), // 0: pbClient.RankType + (*RankPvpReq)(nil), // 1: pbClient.RankPvpReq + (*RankPvpResp)(nil), // 2: pbClient.RankPvpResp + (*RankPvpResp_Item)(nil), // 3: pbClient.RankPvpResp.Item +} +var file_rank_proto_depIdxs = []int32{ + 3, // 0: pbClient.RankPvpResp.items:type_name -> pbClient.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 +} + +func init() { file_rank_proto_init() } +func file_rank_proto_init() { + if File_rank_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rank_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rank_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rank_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankPvpResp_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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rank_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rank_proto_goTypes, + DependencyIndexes: file_rank_proto_depIdxs, + EnumInfos: file_rank_proto_enumTypes, + MessageInfos: file_rank_proto_msgTypes, + }.Build() + File_rank_proto = out.File + file_rank_proto_rawDesc = nil + file_rank_proto_goTypes = nil + file_rank_proto_depIdxs = nil +} diff --git a/game/pb/rank/rank.proto b/game/pb/rank/rank.proto new file mode 100644 index 0000000..df8441c --- /dev/null +++ b/game/pb/rank/rank.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package pbClient; + +option go_package = "/pbRank"; + +enum RankType { + Unknown = 0; + Damage = 1; + General = 2; + KillUnit = 3; + KillPlayer = 4; +} + +// RankPvpReq 获取排行榜 request > rank.pvp +message RankPvpReq { + int32 type = 1; // rank类型 + int32 topN = 2; // TopN +} + +// RankPvpResp 排行榜数据 response > rank.pvp +message RankPvpResp { + message Item { + int64 uid = 1; + string uname = 2; + int64 score = 3; + string avatar = 4; + } + int32 type = 1; // rank类型 + repeated Item items = 2; // rank数据 +} \ No newline at end of file diff --git a/game/pb/stat/Stat.cs b/game/pb/stat/Stat.cs new file mode 100644 index 0000000..aa45ef7 --- /dev/null +++ b/game/pb/stat/Stat.cs @@ -0,0 +1,1482 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: stat.proto +// +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace PbClient { + + /// Holder for reflection information generated from stat.proto + public static partial class StatReflection { + + #region Descriptor + /// File descriptor for stat.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static StatReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgpzdGF0LnByb3RvEghwYkNsaWVudCJSCg1TdGF0UHZQRGFtYWdlEgsKA3Vp", + "ZBgBIAEoAxIWCgl0YXJnZXRVaWQYAiABKANIAIgBARIOCgZkYW1hZ2UYAyAB", + "KAJCDAoKX3RhcmdldFVpZCJmCg9TdGF0UHZQS2lsbFVuaXQSCwoDdWlkGAEg", + "ASgDEhYKCXRhcmdldFVpZBgCIAEoA0gAiAEBEhAKCGF0dGFja2VyGAMgASgJ", + "Eg4KBnZpY3RpbRgEIAEoCUIMCgpfdGFyZ2V0VWlkIkAKC1N0YXRQdlBLaWxs", + "EgsKA3VpZBgBIAEoAxIRCgl0YXJnZXRVaWQYAiABKAMSEQoJaXNHZW5lcmFs", + "GAMgASgIIi4KEVN0YXRQdlBGaXJzdEJsb29kEgsKA3VpZBgBIAEoAxIMCgR0", + "eXBlGAIgASgFIlcKDVN0YXRQdlBSZXBvcnQSDwoHd2luQ2FtcBgBIAEoBRIS", + "CgpnZW5lcmFsVWlkGAIgASgDEg8KB3dpblVpZHMYAyADKAMSEAoIbG9zdFVp", + "ZHMYBCADKANCCVoHL3BiU3RhdGIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.StatPvPDamage), global::PbClient.StatPvPDamage.Parser, new[]{ "Uid", "TargetUid", "Damage" }, new[]{ "TargetUid" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.StatPvPKillUnit), global::PbClient.StatPvPKillUnit.Parser, new[]{ "Uid", "TargetUid", "Attacker", "Victim" }, new[]{ "TargetUid" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.StatPvPKill), global::PbClient.StatPvPKill.Parser, new[]{ "Uid", "TargetUid", "IsGeneral" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.StatPvPFirstBlood), global::PbClient.StatPvPFirstBlood.Parser, new[]{ "Uid", "Type" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::PbClient.StatPvPReport), global::PbClient.StatPvPReport.Parser, new[]{ "WinCamp", "GeneralUid", "WinUids", "LostUids" }, null, null, null, null) + })); + } + #endregion + + } + #region Messages + /// + /// 通知-PvP伤害 statistics.pvp.damage + /// + public sealed partial class StatPvPDamage : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StatPvPDamage()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [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::PbClient.StatReflection.Descriptor.MessageTypes[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 StatPvPDamage() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatPvPDamage(StatPvPDamage other) : this() { + _hasBits0 = other._hasBits0; + uid_ = other.uid_; + targetUid_ = other.targetUid_; + damage_ = other.damage_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatPvPDamage Clone() { + return new StatPvPDamage(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 "targetUid" field. + public const int TargetUidFieldNumber = 2; + private long targetUid_; + /// + /// 目标用户ID(可能是基地,不一定有) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TargetUid { + get { if ((_hasBits0 & 1) != 0) { return targetUid_; } else { return 0L; } } + set { + _hasBits0 |= 1; + targetUid_ = value; + } + } + /// Gets whether the "targetUid" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTargetUid { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "targetUid" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTargetUid() { + _hasBits0 &= ~1; + } + + /// Field number for the "damage" field. + public const int DamageFieldNumber = 3; + private float damage_; + /// + /// 伤害量 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public float Damage { + get { return damage_; } + set { + damage_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StatPvPDamage); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StatPvPDamage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Uid != other.Uid) return false; + if (TargetUid != other.TargetUid) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Damage, other.Damage)) 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 (HasTargetUid) hash ^= TargetUid.GetHashCode(); + if (Damage != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Damage); + 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 (HasTargetUid) { + output.WriteRawTag(16); + output.WriteInt64(TargetUid); + } + if (Damage != 0F) { + output.WriteRawTag(29); + output.WriteFloat(Damage); + } + 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 (HasTargetUid) { + output.WriteRawTag(16); + output.WriteInt64(TargetUid); + } + if (Damage != 0F) { + output.WriteRawTag(29); + output.WriteFloat(Damage); + } + 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 (HasTargetUid) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TargetUid); + } + if (Damage != 0F) { + size += 1 + 4; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StatPvPDamage other) { + if (other == null) { + return; + } + if (other.Uid != 0L) { + Uid = other.Uid; + } + if (other.HasTargetUid) { + TargetUid = other.TargetUid; + } + if (other.Damage != 0F) { + Damage = other.Damage; + } + _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 16: { + TargetUid = input.ReadInt64(); + break; + } + case 29: { + Damage = input.ReadFloat(); + 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 16: { + TargetUid = input.ReadInt64(); + break; + } + case 29: { + Damage = input.ReadFloat(); + break; + } + } + } + } + #endif + + } + + /// + /// 通知-PvP击杀单位 statistics.pvp.killunit + /// + public sealed partial class StatPvPKillUnit : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StatPvPKillUnit()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [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::PbClient.StatReflection.Descriptor.MessageTypes[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 StatPvPKillUnit() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatPvPKillUnit(StatPvPKillUnit other) : this() { + _hasBits0 = other._hasBits0; + uid_ = other.uid_; + targetUid_ = other.targetUid_; + attacker_ = other.attacker_; + victim_ = other.victim_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatPvPKillUnit Clone() { + return new StatPvPKillUnit(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 "targetUid" field. + public const int TargetUidFieldNumber = 2; + private long targetUid_; + /// + /// 目标用户 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TargetUid { + get { if ((_hasBits0 & 1) != 0) { return targetUid_; } else { return 0L; } } + set { + _hasBits0 |= 1; + targetUid_ = value; + } + } + /// Gets whether the "targetUid" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasTargetUid { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "targetUid" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearTargetUid() { + _hasBits0 &= ~1; + } + + /// Field number for the "attacker" field. + public const int AttackerFieldNumber = 3; + private string attacker_ = ""; + /// + /// 造成击杀东西(building:兵营 U0001:xxx兵 S0001: 技能) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Attacker { + get { return attacker_; } + set { + attacker_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "victim" field. + public const int VictimFieldNumber = 4; + private string victim_ = ""; + /// + /// 被击杀的东西(U0001:xxx兵) + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Victim { + get { return victim_; } + set { + victim_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StatPvPKillUnit); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StatPvPKillUnit other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Uid != other.Uid) return false; + if (TargetUid != other.TargetUid) return false; + if (Attacker != other.Attacker) return false; + if (Victim != other.Victim) 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 (HasTargetUid) hash ^= TargetUid.GetHashCode(); + if (Attacker.Length != 0) hash ^= Attacker.GetHashCode(); + if (Victim.Length != 0) hash ^= Victim.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 (HasTargetUid) { + output.WriteRawTag(16); + output.WriteInt64(TargetUid); + } + if (Attacker.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Attacker); + } + if (Victim.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Victim); + } + 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 (HasTargetUid) { + output.WriteRawTag(16); + output.WriteInt64(TargetUid); + } + if (Attacker.Length != 0) { + output.WriteRawTag(26); + output.WriteString(Attacker); + } + if (Victim.Length != 0) { + output.WriteRawTag(34); + output.WriteString(Victim); + } + 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 (HasTargetUid) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TargetUid); + } + if (Attacker.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Attacker); + } + if (Victim.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Victim); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StatPvPKillUnit other) { + if (other == null) { + return; + } + if (other.Uid != 0L) { + Uid = other.Uid; + } + if (other.HasTargetUid) { + TargetUid = other.TargetUid; + } + if (other.Attacker.Length != 0) { + Attacker = other.Attacker; + } + if (other.Victim.Length != 0) { + Victim = other.Victim; + } + _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 16: { + TargetUid = input.ReadInt64(); + break; + } + case 26: { + Attacker = input.ReadString(); + break; + } + case 34: { + Victim = input.ReadString(); + 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 16: { + TargetUid = input.ReadInt64(); + break; + } + case 26: { + Attacker = input.ReadString(); + break; + } + case 34: { + Victim = input.ReadString(); + break; + } + } + } + } + #endif + + } + + /// + /// 通知-PvP杀兵营(人) statistics.pvp.kill + /// + public sealed partial class StatPvPKill : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StatPvPKill()); + 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::PbClient.StatReflection.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 StatPvPKill() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatPvPKill(StatPvPKill other) : this() { + uid_ = other.uid_; + targetUid_ = other.targetUid_; + isGeneral_ = other.isGeneral_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatPvPKill Clone() { + return new StatPvPKill(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 "targetUid" field. + public const int TargetUidFieldNumber = 2; + private long targetUid_; + /// + /// 目标用户 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long TargetUid { + get { return targetUid_; } + set { + targetUid_ = value; + } + } + + /// Field number for the "isGeneral" field. + public const int IsGeneralFieldNumber = 3; + private bool isGeneral_; + /// + /// targetUid是否名将 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IsGeneral { + get { return isGeneral_; } + set { + isGeneral_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StatPvPKill); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StatPvPKill other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Uid != other.Uid) return false; + if (TargetUid != other.TargetUid) return false; + if (IsGeneral != other.IsGeneral) 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 (TargetUid != 0L) hash ^= TargetUid.GetHashCode(); + if (IsGeneral != false) hash ^= IsGeneral.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 (TargetUid != 0L) { + output.WriteRawTag(16); + output.WriteInt64(TargetUid); + } + if (IsGeneral != false) { + output.WriteRawTag(24); + output.WriteBool(IsGeneral); + } + 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 (TargetUid != 0L) { + output.WriteRawTag(16); + output.WriteInt64(TargetUid); + } + if (IsGeneral != false) { + output.WriteRawTag(24); + output.WriteBool(IsGeneral); + } + 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 (TargetUid != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(TargetUid); + } + if (IsGeneral != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StatPvPKill other) { + if (other == null) { + return; + } + if (other.Uid != 0L) { + Uid = other.Uid; + } + if (other.TargetUid != 0L) { + TargetUid = other.TargetUid; + } + if (other.IsGeneral != false) { + IsGeneral = other.IsGeneral; + } + _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 16: { + TargetUid = input.ReadInt64(); + break; + } + case 24: { + IsGeneral = input.ReadBool(); + 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 16: { + TargetUid = input.ReadInt64(); + break; + } + case 24: { + IsGeneral = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + /// + /// 通知-PvP一血 statistics.pvp.first + /// + public sealed partial class StatPvPFirstBlood : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StatPvPFirstBlood()); + 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::PbClient.StatReflection.Descriptor.MessageTypes[3]; } + } + + [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 StatPvPFirstBlood() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatPvPFirstBlood(StatPvPFirstBlood other) : this() { + uid_ = other.uid_; + type_ = other.type_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatPvPFirstBlood Clone() { + return new StatPvPFirstBlood(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 "type" field. + public const int TypeFieldNumber = 2; + private int type_; + /// + /// 1-拿到一血 2-被破一血 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Type { + get { return type_; } + set { + type_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StatPvPFirstBlood); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StatPvPFirstBlood other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Uid != other.Uid) return false; + if (Type != other.Type) 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 (Type != 0) hash ^= Type.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 (Type != 0) { + output.WriteRawTag(16); + output.WriteInt32(Type); + } + 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 (Type != 0) { + output.WriteRawTag(16); + output.WriteInt32(Type); + } + 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 (Type != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Type); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StatPvPFirstBlood other) { + if (other == null) { + return; + } + if (other.Uid != 0L) { + Uid = other.Uid; + } + if (other.Type != 0) { + Type = other.Type; + } + _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 16: { + Type = input.ReadInt32(); + 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 16: { + Type = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + /// 通知-PvP战报 statistics.pvp.report + /// + public sealed partial class StatPvPReport : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StatPvPReport()); + 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::PbClient.StatReflection.Descriptor.MessageTypes[4]; } + } + + [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 StatPvPReport() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatPvPReport(StatPvPReport other) : this() { + winCamp_ = other.winCamp_; + generalUid_ = other.generalUid_; + winUids_ = other.winUids_.Clone(); + lostUids_ = other.lostUids_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public StatPvPReport Clone() { + return new StatPvPReport(this); + } + + /// Field number for the "winCamp" field. + public const int WinCampFieldNumber = 1; + private int winCamp_; + /// + /// 获胜阵营 1-蓝 2-红 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int WinCamp { + get { return winCamp_; } + set { + winCamp_ = value; + } + } + + /// Field number for the "generalUid" field. + public const int GeneralUidFieldNumber = 2; + private long generalUid_; + /// + /// 名将UID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public long GeneralUid { + get { return generalUid_; } + set { + generalUid_ = value; + } + } + + /// Field number for the "winUids" field. + public const int WinUidsFieldNumber = 3; + private static readonly pb::FieldCodec _repeated_winUids_codec + = pb::FieldCodec.ForInt64(26); + private readonly pbc::RepeatedField winUids_ = new pbc::RepeatedField(); + /// + /// 战胜方玩家列表 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField WinUids { + get { return winUids_; } + } + + /// Field number for the "lostUids" field. + public const int LostUidsFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_lostUids_codec + = pb::FieldCodec.ForInt64(34); + private readonly pbc::RepeatedField lostUids_ = new pbc::RepeatedField(); + /// + /// 战败方玩家列表 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField LostUids { + get { return lostUids_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as StatPvPReport); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(StatPvPReport other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (WinCamp != other.WinCamp) return false; + if (GeneralUid != other.GeneralUid) return false; + if(!winUids_.Equals(other.winUids_)) return false; + if(!lostUids_.Equals(other.lostUids_)) 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 (WinCamp != 0) hash ^= WinCamp.GetHashCode(); + if (GeneralUid != 0L) hash ^= GeneralUid.GetHashCode(); + hash ^= winUids_.GetHashCode(); + hash ^= lostUids_.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 (WinCamp != 0) { + output.WriteRawTag(8); + output.WriteInt32(WinCamp); + } + if (GeneralUid != 0L) { + output.WriteRawTag(16); + output.WriteInt64(GeneralUid); + } + winUids_.WriteTo(output, _repeated_winUids_codec); + lostUids_.WriteTo(output, _repeated_lostUids_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 (WinCamp != 0) { + output.WriteRawTag(8); + output.WriteInt32(WinCamp); + } + if (GeneralUid != 0L) { + output.WriteRawTag(16); + output.WriteInt64(GeneralUid); + } + winUids_.WriteTo(ref output, _repeated_winUids_codec); + lostUids_.WriteTo(ref output, _repeated_lostUids_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 (WinCamp != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(WinCamp); + } + if (GeneralUid != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(GeneralUid); + } + size += winUids_.CalculateSize(_repeated_winUids_codec); + size += lostUids_.CalculateSize(_repeated_lostUids_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(StatPvPReport other) { + if (other == null) { + return; + } + if (other.WinCamp != 0) { + WinCamp = other.WinCamp; + } + if (other.GeneralUid != 0L) { + GeneralUid = other.GeneralUid; + } + winUids_.Add(other.winUids_); + lostUids_.Add(other.lostUids_); + _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: { + WinCamp = input.ReadInt32(); + break; + } + case 16: { + GeneralUid = input.ReadInt64(); + break; + } + case 26: + case 24: { + winUids_.AddEntriesFrom(input, _repeated_winUids_codec); + break; + } + case 34: + case 32: { + lostUids_.AddEntriesFrom(input, _repeated_lostUids_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: { + WinCamp = input.ReadInt32(); + break; + } + case 16: { + GeneralUid = input.ReadInt64(); + break; + } + case 26: + case 24: { + winUids_.AddEntriesFrom(ref input, _repeated_winUids_codec); + break; + } + case 34: + case 32: { + lostUids_.AddEntriesFrom(ref input, _repeated_lostUids_codec); + break; + } + } + } + } + #endif + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/game/pb/stat/gen.bat b/game/pb/stat/gen.bat new file mode 100644 index 0000000..f379068 --- /dev/null +++ b/game/pb/stat/gen.bat @@ -0,0 +1,2 @@ +protoc --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_opt=require_unimplemented_servers=false --go_out=. --go-grpc_out=. --proto_path=. *.proto +protoc --csharp_out=. --proto_path=. *.proto \ No newline at end of file diff --git a/game/pb/stat/stat.pb.go b/game/pb/stat/stat.pb.go new file mode 100644 index 0000000..e5e1500 --- /dev/null +++ b/game/pb/stat/stat.pb.go @@ -0,0 +1,507 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.19.4 +// source: stat.proto + +package pbStat + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 通知-PvP伤害 statistics.pvp.damage +type StatPvPDamage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 造成伤害的用户ID + TargetUid *int64 `protobuf:"varint,2,opt,name=targetUid,proto3,oneof" json:"targetUid,omitempty"` // 目标用户ID(可能是基地,不一定有) + Damage float32 `protobuf:"fixed32,3,opt,name=damage,proto3" json:"damage,omitempty"` // 伤害量 +} + +func (x *StatPvPDamage) Reset() { + *x = StatPvPDamage{} + if protoimpl.UnsafeEnabled { + mi := &file_stat_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPDamage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPDamage) ProtoMessage() {} + +func (x *StatPvPDamage) ProtoReflect() protoreflect.Message { + mi := &file_stat_proto_msgTypes[0] + 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 StatPvPDamage.ProtoReflect.Descriptor instead. +func (*StatPvPDamage) Descriptor() ([]byte, []int) { + return file_stat_proto_rawDescGZIP(), []int{0} +} + +func (x *StatPvPDamage) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *StatPvPDamage) GetTargetUid() int64 { + if x != nil && x.TargetUid != nil { + return *x.TargetUid + } + return 0 +} + +func (x *StatPvPDamage) GetDamage() float32 { + if x != nil { + return x.Damage + } + return 0 +} + +// 通知-PvP击杀单位 statistics.pvp.killunit +type StatPvPKillUnit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID + TargetUid *int64 `protobuf:"varint,2,opt,name=targetUid,proto3,oneof" json:"targetUid,omitempty"` // 目标用户 + Attacker string `protobuf:"bytes,3,opt,name=attacker,proto3" json:"attacker,omitempty"` // 造成击杀东西(building:兵营 U0001:xxx兵 S0001: 技能) + Victim string `protobuf:"bytes,4,opt,name=victim,proto3" json:"victim,omitempty"` // 被击杀的东西(U0001:xxx兵) +} + +func (x *StatPvPKillUnit) Reset() { + *x = StatPvPKillUnit{} + if protoimpl.UnsafeEnabled { + mi := &file_stat_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPKillUnit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPKillUnit) ProtoMessage() {} + +func (x *StatPvPKillUnit) ProtoReflect() protoreflect.Message { + mi := &file_stat_proto_msgTypes[1] + 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 StatPvPKillUnit.ProtoReflect.Descriptor instead. +func (*StatPvPKillUnit) Descriptor() ([]byte, []int) { + return file_stat_proto_rawDescGZIP(), []int{1} +} + +func (x *StatPvPKillUnit) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *StatPvPKillUnit) GetTargetUid() int64 { + if x != nil && x.TargetUid != nil { + return *x.TargetUid + } + return 0 +} + +func (x *StatPvPKillUnit) GetAttacker() string { + if x != nil { + return x.Attacker + } + return "" +} + +func (x *StatPvPKillUnit) GetVictim() string { + if x != nil { + return x.Victim + } + return "" +} + +// 通知-PvP杀兵营(人) statistics.pvp.kill +type StatPvPKill struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID + TargetUid int64 `protobuf:"varint,2,opt,name=targetUid,proto3" json:"targetUid,omitempty"` // 目标用户 + IsGeneral bool `protobuf:"varint,3,opt,name=isGeneral,proto3" json:"isGeneral,omitempty"` // targetUid是否名将 +} + +func (x *StatPvPKill) Reset() { + *x = StatPvPKill{} + if protoimpl.UnsafeEnabled { + mi := &file_stat_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPKill) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPKill) ProtoMessage() {} + +func (x *StatPvPKill) ProtoReflect() protoreflect.Message { + mi := &file_stat_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 StatPvPKill.ProtoReflect.Descriptor instead. +func (*StatPvPKill) Descriptor() ([]byte, []int) { + return file_stat_proto_rawDescGZIP(), []int{2} +} + +func (x *StatPvPKill) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *StatPvPKill) GetTargetUid() int64 { + if x != nil { + return x.TargetUid + } + return 0 +} + +func (x *StatPvPKill) GetIsGeneral() bool { + if x != nil { + return x.IsGeneral + } + return false +} + +// 通知-PvP一血 statistics.pvp.first +type StatPvPFirstBlood struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // 用户ID + Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"` // 1-拿到一血 2-被破一血 +} + +func (x *StatPvPFirstBlood) Reset() { + *x = StatPvPFirstBlood{} + if protoimpl.UnsafeEnabled { + mi := &file_stat_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPFirstBlood) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPFirstBlood) ProtoMessage() {} + +func (x *StatPvPFirstBlood) ProtoReflect() protoreflect.Message { + mi := &file_stat_proto_msgTypes[3] + 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 StatPvPFirstBlood.ProtoReflect.Descriptor instead. +func (*StatPvPFirstBlood) Descriptor() ([]byte, []int) { + return file_stat_proto_rawDescGZIP(), []int{3} +} + +func (x *StatPvPFirstBlood) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *StatPvPFirstBlood) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +// 通知-PvP战报 statistics.pvp.report +type StatPvPReport struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WinCamp int32 `protobuf:"varint,1,opt,name=winCamp,proto3" json:"winCamp,omitempty"` // 获胜阵营 1-蓝 2-红 + GeneralUid int64 `protobuf:"varint,2,opt,name=generalUid,proto3" json:"generalUid,omitempty"` // 名将UID + WinUids []int64 `protobuf:"varint,3,rep,packed,name=winUids,proto3" json:"winUids,omitempty"` // 战胜方玩家列表 + LostUids []int64 `protobuf:"varint,4,rep,packed,name=lostUids,proto3" json:"lostUids,omitempty"` // 战败方玩家列表 +} + +func (x *StatPvPReport) Reset() { + *x = StatPvPReport{} + if protoimpl.UnsafeEnabled { + mi := &file_stat_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatPvPReport) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPvPReport) ProtoMessage() {} + +func (x *StatPvPReport) ProtoReflect() protoreflect.Message { + mi := &file_stat_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 StatPvPReport.ProtoReflect.Descriptor instead. +func (*StatPvPReport) Descriptor() ([]byte, []int) { + return file_stat_proto_rawDescGZIP(), []int{4} +} + +func (x *StatPvPReport) GetWinCamp() int32 { + if x != nil { + return x.WinCamp + } + return 0 +} + +func (x *StatPvPReport) GetGeneralUid() int64 { + if x != nil { + return x.GeneralUid + } + return 0 +} + +func (x *StatPvPReport) GetWinUids() []int64 { + if x != nil { + return x.WinUids + } + return nil +} + +func (x *StatPvPReport) GetLostUids() []int64 { + if x != nil { + return x.LostUids + } + return nil +} + +var File_stat_proto protoreflect.FileDescriptor + +var file_stat_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x70, 0x62, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x22, 0x6a, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, + 0x50, 0x44, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x09, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x09, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, + 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x64, 0x61, + 0x6d, 0x61, 0x67, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, + 0x69, 0x64, 0x22, 0x88, 0x01, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, + 0x6c, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x09, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x61, + 0x74, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, + 0x74, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x69, 0x63, 0x74, 0x69, + 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6d, 0x42, + 0x0c, 0x0a, 0x0a, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x22, 0x5b, 0x0a, + 0x0b, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, 0x4b, 0x69, 0x6c, 0x6c, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x55, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, + 0x69, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x69, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x22, 0x39, 0x0a, 0x11, 0x53, 0x74, + 0x61, 0x74, 0x50, 0x76, 0x50, 0x46, 0x69, 0x72, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x6f, 0x64, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x7f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x50, 0x76, 0x50, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x43, 0x61, 0x6d, 0x70, + 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x55, 0x69, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x6e, 0x55, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x03, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x55, 0x69, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, + 0x73, 0x74, 0x55, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x6f, + 0x73, 0x74, 0x55, 0x69, 0x64, 0x73, 0x42, 0x09, 0x5a, 0x07, 0x2f, 0x70, 0x62, 0x53, 0x74, 0x61, + 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_stat_proto_rawDescOnce sync.Once + file_stat_proto_rawDescData = file_stat_proto_rawDesc +) + +func file_stat_proto_rawDescGZIP() []byte { + file_stat_proto_rawDescOnce.Do(func() { + file_stat_proto_rawDescData = protoimpl.X.CompressGZIP(file_stat_proto_rawDescData) + }) + return file_stat_proto_rawDescData +} + +var file_stat_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_stat_proto_goTypes = []interface{}{ + (*StatPvPDamage)(nil), // 0: pbClient.StatPvPDamage + (*StatPvPKillUnit)(nil), // 1: pbClient.StatPvPKillUnit + (*StatPvPKill)(nil), // 2: pbClient.StatPvPKill + (*StatPvPFirstBlood)(nil), // 3: pbClient.StatPvPFirstBlood + (*StatPvPReport)(nil), // 4: pbClient.StatPvPReport +} +var file_stat_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_stat_proto_init() } +func file_stat_proto_init() { + if File_stat_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_stat_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPDamage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stat_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPKillUnit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stat_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPKill); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stat_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPFirstBlood); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stat_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatPvPReport); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_stat_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_stat_proto_msgTypes[1].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_stat_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_stat_proto_goTypes, + DependencyIndexes: file_stat_proto_depIdxs, + MessageInfos: file_stat_proto_msgTypes, + }.Build() + File_stat_proto = out.File + file_stat_proto_rawDesc = nil + file_stat_proto_goTypes = nil + file_stat_proto_depIdxs = nil +} diff --git a/game/pb/stat/stat.proto b/game/pb/stat/stat.proto new file mode 100644 index 0000000..6229ba7 --- /dev/null +++ b/game/pb/stat/stat.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package pbClient; + +option go_package = "/pbStat"; + +// 通知-PvP伤害 statistics.pvp.damage +message StatPvPDamage { + int64 uid = 1; // 造成伤害的用户ID + optional int64 targetUid = 2; // 目标用户ID(可能是基地,不一定有) + float damage = 3; // 伤害量 +} + +// 通知-PvP击杀单位 statistics.pvp.killunit +message StatPvPKillUnit { + int64 uid = 1; // 用户ID + optional int64 targetUid = 2; // 目标用户 + string attacker = 3; // 造成击杀东西(building:兵营 U0001:xxx兵 S0001: 技能) + string victim = 4; // 被击杀的东西(U0001:xxx兵) +} + +// 通知-PvP杀兵营(人) statistics.pvp.kill +message StatPvPKill { + int64 uid = 1; // 用户ID + int64 targetUid = 2; // 目标用户 + bool isGeneral = 3; // targetUid是否名将 +} + +// 通知-PvP一血 statistics.pvp.first +message StatPvPFirstBlood { + int64 uid = 1; // 用户ID + int32 type = 2; // 1-拿到一血 2-被破一血 +} + +// 通知-PvP战报 statistics.pvp.report +message StatPvPReport { + int32 winCamp = 1; // 获胜阵营 1-蓝 2-红 + int64 generalUid = 2; // 名将UID + repeated int64 winUids = 3; // 战胜方玩家列表 + repeated int64 lostUids = 4; // 战败方玩家列表 +} \ No newline at end of file diff --git a/game/svc/service_context.go b/game/svc/service_context.go index 23f8a0e..58030a1 100644 --- a/game/svc/service_context.go +++ b/game/svc/service_context.go @@ -1,35 +1,22 @@ package svc import ( + "context" "dcg/app/user_center/usercenter" "dcg/config" - "dcg/game/room" - "git.noahlan.cn/northlan/ngs/component" "github.com/zeromicro/go-zero/zrpc" - "strings" ) type ServiceContext struct { - Services *component.Components - RoomManager *room.Manager - + Ctx context.Context UserCenterRpc usercenter.UserCenter } func NewServiceContext() *ServiceContext { - services := &component.Components{} - - roomManager := room.NewRoomManager() - services.Register(roomManager, - component.WithName("room"), - component.WithNameFunc(func(s string) string { - return strings.ToLower(s) - })) - - return &ServiceContext{ - Services: services, - RoomManager: roomManager, + svc := &ServiceContext{ + Ctx: context.Background(), // rpc UserCenterRpc: usercenter.NewUserCenter(zrpc.MustNewClient(config.Config.UserCenterRpc)), } + return svc } diff --git a/main.go b/main.go index 7dc897f..54392c8 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "dcg/config" + "dcg/game/logic" "dcg/game/msg_transfer" "dcg/game/svc" "flag" @@ -22,11 +23,13 @@ func main() { ctx := svc.NewServiceContext() + logic.Init(ctx) + msg_transfer.Init(ctx) msg_transfer.Run() opts := make([]ngs.Option, 0) - opts = append(opts, ngs.WithComponents(ctx.Services)) + opts = append(opts, ngs.WithComponents(logic.GameLogic.Services)) opts = append(opts, ngs.WithSerializer(protobuf.NewSerializer())) if config.Config.Server.Debug { ngs.WithDebugMode()