From a1abccac4fddfa95c2618c025d3a4a294a648a2c Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Fri, 23 Sep 2022 12:09:19 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E7=BB=8F=E9=AA=8C=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/v2/FyneApp.toml | 4 +- cmd/v2/lib/common/utils.go | 25 +++-- cmd/v2/ui/about.go | 7 +- cmd/v2/ui/tool_gen.go | 75 +++++++++------ modules/user/model_user.go | 2 +- modules/user/module.go | 2 - pb/user_msg.pb.go | 184 +++++++++++++++++-------------------- 7 files changed, 157 insertions(+), 142 deletions(-) diff --git a/cmd/v2/FyneApp.toml b/cmd/v2/FyneApp.toml index 797d48dc4..07e5f7980 100644 --- a/cmd/v2/FyneApp.toml +++ b/cmd/v2/FyneApp.toml @@ -4,5 +4,5 @@ Website = "http://legu.cc" Icon = "app.png" Name = "RobotGUI" ID = "cc.legu.app" - Version = "1.0.7" - Build = 8 + Version = "1.0.8" + Build = 9 diff --git a/cmd/v2/lib/common/utils.go b/cmd/v2/lib/common/utils.go index ce9545385..4f6bf4c1d 100644 --- a/cmd/v2/lib/common/utils.go +++ b/cmd/v2/lib/common/utils.go @@ -3,7 +3,7 @@ package common import ( "bytes" "encoding/json" - "io/ioutil" + "io" "os" "path/filepath" "strings" @@ -72,20 +72,27 @@ func IsUpgrade(newVersion, oldVersion string) bool { return false } -func Copy(srcFile, destFile string) (int, error) { - input, err := ioutil.ReadFile(srcFile) +func Copy(src, dst string) (len int64, err error) { + + dstWriter, err := os.Create(dst) if err != nil { logrus.Error(err) - return 0, err + return } - - err = ioutil.WriteFile(destFile, input, 0644) + srcReader, err := os.Open(src) if err != nil { logrus.Error(err) - return 0, err + return } - - return len(input), nil + // Copy()函数其实是调用了 + // io包中私有函数copyBuffer() 默认缓冲区是32K + // 与Copy()函数功能一致的是CopyBuffer()可以设置缓冲区 + len, err = io.Copy(dstWriter, srcReader) + if err != nil { + logrus.Error(err) + return + } + return } func DeleteFile(filePath string) error { diff --git a/cmd/v2/ui/about.go b/cmd/v2/ui/about.go index 59ad21395..ee270ea33 100644 --- a/cmd/v2/ui/about.go +++ b/cmd/v2/ui/about.go @@ -13,7 +13,12 @@ type about struct { func newAbout() *about { var a about - content := widget.NewCard("", "", widget.NewRichTextFromMarkdown(common.APP_ABOUT_INFO)) + ver := toolWin.app.Metadata().Version + content := widget.NewCard("", "", widget.NewRichTextFromMarkdown( + ` + 梦工厂项目辅助工具GUI + @v`+ver, + )) a.aboutDialog = dialog.NewCustom(common.APP_ABOUT_TITLE, common.APP_ABOUT_CONFIRM, content, toolWin.w) return &a diff --git a/cmd/v2/ui/tool_gen.go b/cmd/v2/ui/tool_gen.go index 0d80a7f6c..d5e0b3d06 100644 --- a/cmd/v2/ui/tool_gen.go +++ b/cmd/v2/ui/tool_gen.go @@ -183,23 +183,18 @@ func (this *appGen) LazyInit(obs observer.Observer) error { defer func() { go_overrideBtn.Enable() }() - for _, v := range this.goList.selItemIds { + for _, v := range this.goList.cachedList.Items { // logrus.WithField("path1", filepath.Join(tmpDir.Text, "go", v)).Debug("copy go") // logrus.WithField("path2", filepath.Join(projectDir.Text, outputCodeDir.Text, v)).Debug("copy go") - _, err := common.Copy(filepath.Join(tmpDir.Text, "go", v), - filepath.Join(projectDir.Text, outputCodeDir.Text, v)) + _, err := common.Copy(filepath.Join(tmpDir.Text, "go", v.Text), + filepath.Join(projectDir.Text, outputCodeDir.Text, v.Text)) if err != nil { logrus.Error(err) return } - - if err := common.DeleteFile(filepath.Join(tmpDir.Text, "go", v)); err != nil { - logrus.Error(err) - return - } - - this.goList.deleteItem(v) + this.goList.deleteItem(v.Text) } + this.goList.changeFileCount() } //取消checked @@ -249,23 +244,18 @@ func (this *appGen) LazyInit(obs observer.Observer) error { defer func() { json_overrideBtn.Enable() }() - for _, v := range this.jsonList.selItemIds { + for _, v := range this.jsonList.cachedList.Items { // logrus.WithField("path1", filepath.Join(tmpDir.Text, "json", v)).Debug("copy json") // logrus.WithField("path2", filepath.Join(projectDir.Text, outputJsonDir.Text, v)).Debug("copy json") - _, err := common.Copy(filepath.Join(tmpDir.Text, "json", v), - filepath.Join(projectDir.Text, outputJsonDir.Text, v)) + _, err := common.Copy(filepath.Join(tmpDir.Text, "json", v.Text), + filepath.Join(projectDir.Text, outputJsonDir.Text, v.Text)) if err != nil { logrus.Error(err) return } - - if err := common.DeleteFile(filepath.Join(tmpDir.Text, "json", v)); err != nil { - logrus.Error(err) - return - } - - this.jsonList.deleteItem(v) + this.jsonList.deleteItem(v.Text) } + this.jsonList.changeFileCount() } //取消checked @@ -296,7 +286,7 @@ func (this *appGen) LazyInit(obs observer.Observer) error { list.selItemIds = append(list.selItemIds, v.Text) list.itemList.UpdateItem(i, widget.NewCheck(v.Text, nil)) } - list.titleLabel.SetText(fmt.Sprintf("(%d/%d)", len(list.selItemIds), list.fileTotal)) + list.changeFileCount() list.itemList.Refresh() } @@ -339,22 +329,49 @@ func (this *appGen) LazyInit(obs observer.Observer) error { return } - // 更新列表 - if genTypeText == "go" { + changeGo := func() { this.goList.changeItem(filepath.Join(tmpDir.Text, "go"), filepath.Join(projectDir.Text, outputCodeDir.Text)) this.goList.titleLabel.SetText(fmt.Sprintf("(%d/%d个)", len(this.goList.selItemIds), this.goList.fileTotal)) go_overrideBtn.Show() this.goList.titleLabel.Show() - } else if genTypeText == "json" { + } + + changeJson := func() { this.jsonList.changeItem(filepath.Join(tmpDir.Text, "json"), filepath.Join(projectDir.Text, outputJsonDir.Text)) this.jsonList.titleLabel.SetText(fmt.Sprintf("(%d/%d)", len(this.jsonList.selItemIds), this.jsonList.fileTotal)) json_overrideBtn.Show() this.jsonList.titleLabel.Show() } + + // 更新列表 + if genTypeText == "go" { + changeGo() + } else if genTypeText == "json" { + changeJson() + } else if genTypeText == "all" { + changeGo() + changeJson() + } } + //使用说明 + desBtn := widget.NewButtonWithIcon("", theme.QuestionIcon(), func() { + quesWin := fyne.CurrentApp().NewWindow("使用说明") + quesWin.SetContent(widget.NewRichTextFromMarkdown( + ` + 1. 先更新excel文件 + 2. 配置Luban(已做可忽略) + 3. 选择**生成类型**,单击生成 + 4. 选择要覆盖的文件 + `)) + quesWin.Resize(fyne.NewSize(350, 200)) + quesWin.SetFixedSize(true) + quesWin.CenterOnScreen() + quesWin.Show() + }) + // layout - left := container.NewVBox(form, container.NewHBox(&layout.Spacer{}, saveBtn, genBtn)) + left := container.NewVBox(form, container.NewHBox(&layout.Spacer{}, desBtn, saveBtn, genBtn)) right := container.NewGridWithColumns(2, container.NewBorder( container.NewHBox(go_allSelBtn, go_allCancelBtn, go_overrideBtn, widget.NewLabel("Go文件"), this.goList.titleLabel), @@ -434,12 +451,13 @@ func (f *fileList) addItem(val string) { func (f *fileList) deleteItem(name string) { for i, v := range f.cachedList.Items { if v.Text == name { + f.selItemIds = utils.DeleteString(f.selItemIds, v.Text) f.cachedList.Items = append(f.cachedList.Items[:i], f.cachedList.Items[i+1:]...) } } - f.itemList.Refresh() } +// 改变列表项目 func (f *fileList) changeItem(tmpDir, projectDir string) { f.fileTotal = 0 f.selItemIds = []string{} @@ -478,6 +496,11 @@ func (f *fileList) changeItem(tmpDir, projectDir string) { } } +// 刷新文件数 +func (f *fileList) changeFileCount() { + f.titleLabel.SetText(fmt.Sprintf("(%d/%d)", len(f.cachedList.Items), f.fileTotal)) +} + func (a *appGen) GetAppName() string { return common.TOOLBAR_GEN } diff --git a/modules/user/model_user.go b/modules/user/model_user.go index af4cdd590..c58b8e922 100644 --- a/modules/user/model_user.go +++ b/modules/user/model_user.go @@ -183,7 +183,7 @@ func (this *ModelUser) ChangeLevel(event interface{}, next func(event interface{ } this.module.modelUser.Change(ul.session.GetUserId(), update) ul.session.SendMsg(string(this.module.GetType()), UserSubTypeLvChangedPush, - &pb.UserChangedPush{Uid: ul.session.GetUserId(), Exp: ul.exp, Lv: ul.lv}) + &pb.UserLvChangedPush{Uid: ul.session.GetUserId(), Exp: ul.exp, Lv: ul.lv}) } } diff --git a/modules/user/module.go b/modules/user/module.go index 82a33232d..cc08df9e4 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -129,8 +129,6 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha change = &pb.UserResChangePush{ Gold: user.Gold, Exp: user.Exp, - Lv: user.Lv, - Vip: user.Vip, Diamond: user.Diamond, Friend: userEx.FriendPoint, } diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index eceee096f..d451663d0 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -571,8 +571,6 @@ type UserResChangePush struct { Gold int32 `protobuf:"varint,1,opt,name=gold,proto3" json:"gold" bson:"gold"` //金币 Exp int32 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp" bson:"exp"` //经验 - Lv int32 `protobuf:"varint,3,opt,name=lv,proto3" json:"lv" bson:"lv"` //等级 - Vip int32 `protobuf:"varint,4,opt,name=vip,proto3" json:"vip" bson:"vip"` // vip Diamond int32 `protobuf:"varint,5,opt,name=diamond,proto3" json:"diamond" bson:"diamond"` // 钻石 Friend int32 `protobuf:"varint,6,opt,name=friend,proto3" json:"friend" bson:"frined"` //友情点 } @@ -623,20 +621,6 @@ func (x *UserResChangePush) GetExp() int32 { return 0 } -func (x *UserResChangePush) GetLv() int32 { - if x != nil { - return x.Lv - } - return 0 -} - -func (x *UserResChangePush) GetVip() int32 { - if x != nil { - return x.Vip - } - return 0 -} - func (x *UserResChangePush) GetDiamond() int32 { if x != nil { return x.Diamond @@ -1211,7 +1195,7 @@ func (x *UserGetTujianResp) GetHeroids() []string { } //玩家等级经验变化推送 -type UserChangedPush struct { +type UserLvChangedPush struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1221,8 +1205,8 @@ type UserChangedPush struct { Lv int32 `protobuf:"varint,3,opt,name=lv,proto3" json:"lv"` } -func (x *UserChangedPush) Reset() { - *x = UserChangedPush{} +func (x *UserLvChangedPush) Reset() { + *x = UserLvChangedPush{} if protoimpl.UnsafeEnabled { mi := &file_user_user_msg_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1230,13 +1214,13 @@ func (x *UserChangedPush) Reset() { } } -func (x *UserChangedPush) String() string { +func (x *UserLvChangedPush) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserChangedPush) ProtoMessage() {} +func (*UserLvChangedPush) ProtoMessage() {} -func (x *UserChangedPush) ProtoReflect() protoreflect.Message { +func (x *UserLvChangedPush) ProtoReflect() protoreflect.Message { mi := &file_user_user_msg_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1248,26 +1232,26 @@ func (x *UserChangedPush) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserChangedPush.ProtoReflect.Descriptor instead. -func (*UserChangedPush) Descriptor() ([]byte, []int) { +// Deprecated: Use UserLvChangedPush.ProtoReflect.Descriptor instead. +func (*UserLvChangedPush) Descriptor() ([]byte, []int) { return file_user_user_msg_proto_rawDescGZIP(), []int{24} } -func (x *UserChangedPush) GetUid() string { +func (x *UserLvChangedPush) GetUid() string { if x != nil { return x.Uid } return "" } -func (x *UserChangedPush) GetExp() int32 { +func (x *UserLvChangedPush) GetExp() int32 { if x != nil { return x.Exp } return 0 } -func (x *UserChangedPush) GetLv() int32 { +func (x *UserLvChangedPush) GetLv() int32 { if x != nil { return x.Lv } @@ -1571,79 +1555,77 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, - 0x63, 0x22, 0x8d, 0x01, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, - 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, - 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x10, 0x0a, - 0x03, 0x76, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x69, 0x70, 0x12, - 0x18, 0x0a, 0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x22, 0x13, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x22, 0x3e, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, - 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x40, 0x0a, 0x14, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x28, - 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, - 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, + 0x63, 0x22, 0x6b, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, + 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x18, 0x0a, 0x07, + 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, + 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x13, + 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x22, 0x3e, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x22, 0x40, 0x0a, 0x14, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x07, 0x73, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, + 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, + 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x43, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x71, 0x22, 0x26, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x12, + 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x22, 0x24, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, + 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, + 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x50, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, + 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, + 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, + 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, + 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x68, + 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x47, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x76, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, + 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, + 0xe3, 0x01, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x04, 0x68, 0x61, 0x69, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x69, 0x72, 0x52, 0x04, + 0x68, 0x61, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x04, 0x65, 0x79, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x45, 0x79, 0x65, 0x73, 0x52, 0x04, 0x65, 0x79, 0x65, 0x73, 0x12, + 0x1c, 0x0a, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, + 0x2e, 0x4d, 0x6f, 0x75, 0x74, 0x68, 0x52, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x12, 0x19, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x42, 0x6f, + 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, + 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x43, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1f, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, + 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x26, 0x0a, 0x12, 0x55, + 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x22, 0x26, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, - 0x72, 0x69, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x25, - 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x71, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x24, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, - 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, - 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x50, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, - 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, - 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x73, - 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x45, 0x0a, 0x0f, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, - 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, - 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, - 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, - 0x22, 0xe3, 0x01, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, - 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, - 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x04, 0x68, 0x61, - 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x69, 0x72, 0x52, - 0x04, 0x68, 0x61, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x04, 0x65, 0x79, 0x65, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x45, 0x79, 0x65, 0x73, 0x52, 0x04, 0x65, 0x79, 0x65, 0x73, - 0x12, 0x1c, 0x0a, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x06, 0x2e, 0x4d, 0x6f, 0x75, 0x74, 0x68, 0x52, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x12, 0x19, - 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x42, - 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, - 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, - 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x06, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, - 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x26, 0x0a, 0x12, - 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x75, 0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -1684,7 +1666,7 @@ var file_user_user_msg_proto_goTypes = []interface{}{ (*UserModifynameResp)(nil), // 21: UserModifynameResp (*UserGetTujianReq)(nil), // 22: UserGetTujianReq (*UserGetTujianResp)(nil), // 23: UserGetTujianResp - (*UserChangedPush)(nil), // 24: UserChangedPush + (*UserLvChangedPush)(nil), // 24: UserLvChangedPush (*UserFigureReq)(nil), // 25: UserFigureReq (*UserFigureResp)(nil), // 26: UserFigureResp (*UserModifysignReq)(nil), // 27: UserModifysignReq @@ -2021,7 +2003,7 @@ func file_user_user_msg_proto_init() { } } file_user_user_msg_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserChangedPush); i { + switch v := v.(*UserLvChangedPush); i { case 0: return &v.state case 1: From ea768c5733017359d17057ddc20ab69b8ecb2d32 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Fri, 23 Sep 2022 13:39:50 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/v2/ui/toy_userinfo.go | 2 +- modules/user/api.go | 2 +- modules/user/module.go | 8 +- pb/chat_db.pb.go | 10 ++- pb/user_msg.pb.go | 170 +++++++++++++++++++------------------- 5 files changed, 98 insertions(+), 94 deletions(-) diff --git a/cmd/v2/ui/toy_userinfo.go b/cmd/v2/ui/toy_userinfo.go index 4d9f2cd29..70ca8232b 100644 --- a/cmd/v2/ui/toy_userinfo.go +++ b/cmd/v2/ui/toy_userinfo.go @@ -166,7 +166,7 @@ func (this *toyUserInfo) dataListener() { // listener gold if data.Msg.MainType == string(comm.ModuleUser) && data.Msg.SubType == "reschange" { - rsp := &pb.UserResChangePush{} + rsp := &pb.UserResChangedPush{} if !comm.ProtoUnmarshal(data.Msg, rsp) { logrus.Error("unmarshal err") return diff --git a/modules/user/api.go b/modules/user/api.go index 09040a34a..5b43580d2 100644 --- a/modules/user/api.go +++ b/modules/user/api.go @@ -18,7 +18,7 @@ const ( UserSubTypeVeriCode = "vericode" //验证码 UserSubTypeInitData = "initdata" //初始化用户 UserGetTujianResp = "gettujian" //获取图鉴信息 - UserSubTypeLvChangedPush = "lvChangedPush" //等级变化推送 + UserSubTypeLvChangedPush = "lvchanged" //等级变化推送 UserSubTypeModifyName = "modifyname" //修改名称 UserSubTypeFigure = "figure" //形象 UserSubTypeModifySign = "modifysign" // 修改签名 diff --git a/modules/user/module.go b/modules/user/module.go index cc08df9e4..3a6115fa4 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -107,7 +107,7 @@ func (this *User) QueryAttributeValue(uid string, attr string) (value int32) { return } -func (this *User) change(session comm.IUserSession, attr string, add int32) (change *pb.UserResChangePush, code pb.ErrorCode) { +func (this *User) change(session comm.IUserSession, attr string, add int32) (change *pb.UserResChangedPush, code pb.ErrorCode) { if add == 0 { log.Errorf("attr no changed,uid: %s attr: %s add: %d", session.GetUserId(), attr, add) code = pb.ErrorCode_ReqParameterError @@ -126,7 +126,7 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha return } - change = &pb.UserResChangePush{ + change = &pb.UserResChangedPush{ Gold: user.Gold, Exp: user.Exp, Diamond: user.Diamond, @@ -200,7 +200,7 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha //用户资源 func (this *User) AddAttributeValue(session comm.IUserSession, attr string, add int32, bPush bool) (code pb.ErrorCode) { - var _change *pb.UserResChangePush + var _change *pb.UserResChangedPush _change, code = this.change(session, attr, add) if code != pb.ErrorCode_Success { @@ -220,7 +220,7 @@ func (this *User) AddAttributeValue(session comm.IUserSession, attr string, add //用户资源 func (this *User) AddAttributeValues(session comm.IUserSession, attrs map[string]int32, bPush bool) (code pb.ErrorCode) { for key, add := range attrs { - var _change *pb.UserResChangePush + var _change *pb.UserResChangedPush _change, code = this.change(session, key, add) if code != pb.ErrorCode_Success { return diff --git a/pb/chat_db.pb.go b/pb/chat_db.pb.go index 7d01192b9..91241c9c6 100644 --- a/pb/chat_db.pb.go +++ b/pb/chat_db.pb.go @@ -84,6 +84,7 @@ const ( ChatType_Share ChatType = 2 //分享类型 ChatType_HeroShare ChatType = 3 //英雄分享 ChatType_EquipmentShare ChatType = 4 //装备分享 + ChatType_ItemShare ChatType = 5 //道具分享 ) // Enum value maps for ChatType. @@ -94,6 +95,7 @@ var ( 2: "Share", 3: "HeroShare", 4: "EquipmentShare", + 5: "ItemShare", } ChatType_value = map[string]int32{ "Text": 0, @@ -101,6 +103,7 @@ var ( "Share": 2, "HeroShare": 3, "EquipmentShare": 4, + "ItemShare": 5, } ) @@ -343,13 +346,14 @@ var file_chat_chat_db_proto_rawDesc = []byte{ 0x6c, 0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x10, 0x03, 0x12, 0x0a, 0x0a, - 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x10, 0x04, 0x2a, 0x53, 0x0a, 0x08, 0x43, 0x68, 0x61, + 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x10, 0x04, 0x2a, 0x62, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x71, - 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x04, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x04, 0x12, 0x0d, + 0x0a, 0x09, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x05, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index d451663d0..c82f5667c 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -564,7 +564,7 @@ func (x *UserCreateResp) GetIsSucc() bool { } // 玩家资源变更推送 -type UserResChangePush struct { +type UserResChangedPush struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -575,8 +575,8 @@ type UserResChangePush struct { Friend int32 `protobuf:"varint,6,opt,name=friend,proto3" json:"friend" bson:"frined"` //友情点 } -func (x *UserResChangePush) Reset() { - *x = UserResChangePush{} +func (x *UserResChangedPush) Reset() { + *x = UserResChangedPush{} if protoimpl.UnsafeEnabled { mi := &file_user_user_msg_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -584,13 +584,13 @@ func (x *UserResChangePush) Reset() { } } -func (x *UserResChangePush) String() string { +func (x *UserResChangedPush) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserResChangePush) ProtoMessage() {} +func (*UserResChangedPush) ProtoMessage() {} -func (x *UserResChangePush) ProtoReflect() protoreflect.Message { +func (x *UserResChangedPush) ProtoReflect() protoreflect.Message { mi := &file_user_user_msg_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -602,33 +602,33 @@ func (x *UserResChangePush) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserResChangePush.ProtoReflect.Descriptor instead. -func (*UserResChangePush) Descriptor() ([]byte, []int) { +// Deprecated: Use UserResChangedPush.ProtoReflect.Descriptor instead. +func (*UserResChangedPush) Descriptor() ([]byte, []int) { return file_user_user_msg_proto_rawDescGZIP(), []int{11} } -func (x *UserResChangePush) GetGold() int32 { +func (x *UserResChangedPush) GetGold() int32 { if x != nil { return x.Gold } return 0 } -func (x *UserResChangePush) GetExp() int32 { +func (x *UserResChangedPush) GetExp() int32 { if x != nil { return x.Exp } return 0 } -func (x *UserResChangePush) GetDiamond() int32 { +func (x *UserResChangedPush) GetDiamond() int32 { if x != nil { return x.Diamond } return 0 } -func (x *UserResChangePush) GetFriend() int32 { +func (x *UserResChangedPush) GetFriend() int32 { if x != nil { return x.Friend } @@ -1555,77 +1555,77 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, - 0x63, 0x22, 0x6b, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, - 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x18, 0x0a, 0x07, - 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, - 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x13, - 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x71, 0x22, 0x3e, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x55, - 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x22, 0x40, 0x0a, 0x14, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x07, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, - 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, - 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x43, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x71, 0x22, 0x26, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x12, - 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x22, 0x24, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, - 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, - 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x50, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, - 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, - 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, - 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x68, - 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x47, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x76, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, - 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, - 0xe3, 0x01, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, - 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x04, 0x68, 0x61, 0x69, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x69, 0x72, 0x52, 0x04, - 0x68, 0x61, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x04, 0x65, 0x79, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x45, 0x79, 0x65, 0x73, 0x52, 0x04, 0x65, 0x79, 0x65, 0x73, 0x12, - 0x1c, 0x0a, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, - 0x2e, 0x4d, 0x6f, 0x75, 0x74, 0x68, 0x52, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x12, 0x19, 0x0a, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x42, 0x6f, - 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x43, - 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, 0x67, - 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x1f, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, - 0x72, 0x65, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, - 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x26, 0x0a, 0x12, 0x55, - 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x63, 0x22, 0x6c, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, + 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x18, 0x0a, + 0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, + 0x13, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x22, 0x3e, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, + 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x22, 0x40, 0x0a, 0x14, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x07, + 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, + 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x71, 0x22, 0x26, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, + 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x25, 0x0a, 0x0f, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, + 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x22, 0x24, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, + 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x50, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, + 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, + 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, + 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, + 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x47, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4c, + 0x76, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, + 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, + 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, + 0x22, 0xe3, 0x01, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x04, 0x68, 0x61, + 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x69, 0x72, 0x52, + 0x04, 0x68, 0x61, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x04, 0x65, 0x79, 0x65, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x45, 0x79, 0x65, 0x73, 0x52, 0x04, 0x65, 0x79, 0x65, 0x73, + 0x12, 0x1c, 0x0a, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x06, 0x2e, 0x4d, 0x6f, 0x75, 0x74, 0x68, 0x52, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x12, 0x19, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x42, + 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, + 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, + 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x06, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, + 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x26, 0x0a, 0x12, + 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x75, 0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1653,7 +1653,7 @@ var file_user_user_msg_proto_goTypes = []interface{}{ (*UserLoadResp)(nil), // 8: UserLoadResp (*UserCreateReq)(nil), // 9: UserCreateReq (*UserCreateResp)(nil), // 10: UserCreateResp - (*UserResChangePush)(nil), // 11: UserResChangePush + (*UserResChangedPush)(nil), // 11: UserResChangedPush (*UserGetSettingReq)(nil), // 12: UserGetSettingReq (*UserGetSettingResp)(nil), // 13: UserGetSettingResp (*UserUpdateSettingReq)(nil), // 14: UserUpdateSettingReq @@ -1847,7 +1847,7 @@ func file_user_user_msg_proto_init() { } } file_user_user_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserResChangePush); i { + switch v := v.(*UserResChangedPush); i { case 0: return &v.state case 1: From 64d6876be9f3d7029d2576de9a070bfcab163df8 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Fri, 23 Sep 2022 13:46:20 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_rdtask.json | 2 +- bin/json/game_rdtaskcondi.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/json/game_rdtask.json b/bin/json/game_rdtask.json index 875c5a000..572809821 100644 --- a/bin/json/game_rdtask.json +++ b/bin/json/game_rdtask.json @@ -94,7 +94,7 @@ 101 ], "sidequest": [ - 2002, + 2033, 2004 ] }, diff --git a/bin/json/game_rdtaskcondi.json b/bin/json/game_rdtaskcondi.json index 247b86540..7259d4570 100644 --- a/bin/json/game_rdtaskcondi.json +++ b/bin/json/game_rdtaskcondi.json @@ -828,7 +828,7 @@ "datatype": 2, "type": 70, "inited": [], - "data1": 101, + "data1": 102, "data2": 0, "data3": 0, "data4": 0, From f3319fa98933e81a852ee354e48a7a0edce748f2 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Fri, 23 Sep 2022 14:39:29 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/v2/ui/tool_gen.go | 22 +++++++++++++--------- comm/imodule.go | 2 +- modules/linestory/api_dotask.go | 2 +- modules/linestory/api_start.go | 2 +- modules/pagoda/comp_configure.go | 22 ---------------------- modules/rtask/module.go | 4 ++-- sys/configure/structs/game.pagoda.go | 14 +++----------- 7 files changed, 21 insertions(+), 47 deletions(-) diff --git a/cmd/v2/ui/tool_gen.go b/cmd/v2/ui/tool_gen.go index d5e0b3d06..aa1c81f32 100644 --- a/cmd/v2/ui/tool_gen.go +++ b/cmd/v2/ui/tool_gen.go @@ -182,17 +182,18 @@ func (this *appGen) LazyInit(obs observer.Observer) error { go_overrideBtn.Disable() defer func() { go_overrideBtn.Enable() + this.goList.itemList.Refresh() }() - for _, v := range this.goList.cachedList.Items { + for _, v := range this.goList.selItemIds { // logrus.WithField("path1", filepath.Join(tmpDir.Text, "go", v)).Debug("copy go") // logrus.WithField("path2", filepath.Join(projectDir.Text, outputCodeDir.Text, v)).Debug("copy go") - _, err := common.Copy(filepath.Join(tmpDir.Text, "go", v.Text), - filepath.Join(projectDir.Text, outputCodeDir.Text, v.Text)) + _, err := common.Copy(filepath.Join(tmpDir.Text, "go", v), + filepath.Join(projectDir.Text, outputCodeDir.Text, v)) if err != nil { logrus.Error(err) return } - this.goList.deleteItem(v.Text) + this.goList.deleteItem(v) } this.goList.changeFileCount() } @@ -244,16 +245,16 @@ func (this *appGen) LazyInit(obs observer.Observer) error { defer func() { json_overrideBtn.Enable() }() - for _, v := range this.jsonList.cachedList.Items { + for _, v := range this.jsonList.selItemIds { // logrus.WithField("path1", filepath.Join(tmpDir.Text, "json", v)).Debug("copy json") // logrus.WithField("path2", filepath.Join(projectDir.Text, outputJsonDir.Text, v)).Debug("copy json") - _, err := common.Copy(filepath.Join(tmpDir.Text, "json", v.Text), - filepath.Join(projectDir.Text, outputJsonDir.Text, v.Text)) + _, err := common.Copy(filepath.Join(tmpDir.Text, "json", v), + filepath.Join(projectDir.Text, outputJsonDir.Text, v)) if err != nil { logrus.Error(err) return } - this.jsonList.deleteItem(v.Text) + this.jsonList.deleteItem(v) } this.jsonList.changeFileCount() } @@ -453,6 +454,9 @@ func (f *fileList) deleteItem(name string) { if v.Text == name { f.selItemIds = utils.DeleteString(f.selItemIds, v.Text) f.cachedList.Items = append(f.cachedList.Items[:i], f.cachedList.Items[i+1:]...) + if f.fileTotal > 0 { + f.fileTotal-- + } } } } @@ -498,7 +502,7 @@ func (f *fileList) changeItem(tmpDir, projectDir string) { // 刷新文件数 func (f *fileList) changeFileCount() { - f.titleLabel.SetText(fmt.Sprintf("(%d/%d)", len(f.cachedList.Items), f.fileTotal)) + f.titleLabel.SetText(fmt.Sprintf("(%d/%d)", len(f.selItemIds), f.fileTotal)) } func (a *appGen) GetAppName() string { diff --git a/comm/imodule.go b/comm/imodule.go index e56de0547..277fbc8fb 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -122,7 +122,7 @@ type ( // 随机任务 IRtask interface { // 条件校验 - CheckCondi(session IUserSession, condiId int32) (code pb.ErrorCode) + CheckCondi(uid string, condiId int32) (code pb.ErrorCode) //任务触发 SendToRtask(session IUserSession, rtaskType TaskType, params ...int32) (code pb.ErrorCode) // 初始化条件数据 diff --git a/modules/linestory/api_dotask.go b/modules/linestory/api_dotask.go index 8cf7c016a..2255ecc22 100644 --- a/modules/linestory/api_dotask.go +++ b/modules/linestory/api_dotask.go @@ -115,7 +115,7 @@ func (this *apiComp) Dotask(session comm.IUserSession, req *pb.LinestoryDotaskRe //校验子任务完成条件 if m, ok := module.(comm.IRtask); ok { for _, condiId := range stageConf.Cond { - if code = m.CheckCondi(session, condiId); code != pb.ErrorCode_Success { + if code = m.CheckCondi(session.GetUserId(), condiId); code != pb.ErrorCode_Success { return } } diff --git a/modules/linestory/api_start.go b/modules/linestory/api_start.go index a89dd45e6..c20235dca 100644 --- a/modules/linestory/api_start.go +++ b/modules/linestory/api_start.go @@ -43,7 +43,7 @@ func (this *apiComp) Dostart(session comm.IUserSession, req *pb.LinestoryStartRe if m, ok := module.(comm.IRtask); ok { // 校验限定条件 for _, condiId := range conf.Cond { - if code = m.CheckCondi(session, condiId); code != pb.ErrorCode_Success { + if code = m.CheckCondi(session.GetUserId(), condiId); code != pb.ErrorCode_Success { return } } diff --git a/modules/pagoda/comp_configure.go b/modules/pagoda/comp_configure.go index 355d3d369..29dd99a00 100644 --- a/modules/pagoda/comp_configure.go +++ b/modules/pagoda/comp_configure.go @@ -72,28 +72,6 @@ func (this *configureComp) GetConfigure(name string) (v interface{}, err error) return configure.GetConfigure(name) } -// 获取爬塔配置表数据 -func (this *configureComp) GetPagodaconfig(id int32) (data *cfg.GamePagodaData) { - if v, err := this.GetConfigure(game_pagoda); err != nil { - log.Errorf("get global conf err:%v", err) - return - } else { - var ( - configure *cfg.GamePagoda - ok bool - ) - if configure, ok = v.(*cfg.GamePagoda); !ok { - log.Errorf("%T no is *cfg.Game_pagodaData", v) - return - } - - if data, ok = configure.GetDataMap()[id]; ok { - return - } - } - return -} - // 爬塔奖励 func (this *configureComp) GetPagodaRewardconfig(id int32) (data *cfg.GamePagodaTaskRewardData) { if v, err := this.GetConfigure(game_pagodataskreward); err == nil { diff --git a/modules/rtask/module.go b/modules/rtask/module.go index e0747f286..ec58dd5b2 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -241,8 +241,8 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T } // 任务条件校验 -func (this *ModuleRtask) CheckCondi(session comm.IUserSession, condiId int32) (code pb.ErrorCode) { - if _, ok := this.modelRtask.checkCondi(session.GetUserId(), condiId); !ok { +func (this *ModuleRtask) CheckCondi(uid string, condiId int32) (code pb.ErrorCode) { + if _, ok := this.modelRtask.checkCondi(uid, condiId); !ok { code = pb.ErrorCode_RtaskCondiNoReach } return diff --git a/sys/configure/structs/game.pagoda.go b/sys/configure/structs/game.pagoda.go index 91003d398..a261f2336 100644 --- a/sys/configure/structs/game.pagoda.go +++ b/sys/configure/structs/game.pagoda.go @@ -9,34 +9,26 @@ package cfg type GamePagoda struct { - _dataMap map[int32]*GamePagodaData _dataList []*GamePagodaData } func NewGamePagoda(_buf []map[string]interface{}) (*GamePagoda, error) { _dataList := make([]*GamePagodaData, 0, len(_buf)) - dataMap := make(map[int32]*GamePagodaData) for _, _ele_ := range _buf { if _v, err2 := DeserializeGamePagodaData(_ele_); err2 != nil { return nil, err2 } else { _dataList = append(_dataList, _v) - dataMap[_v.Key] = _v } } - return &GamePagoda{_dataList:_dataList, _dataMap:dataMap}, nil -} - -func (table *GamePagoda) GetDataMap() map[int32]*GamePagodaData { - return table._dataMap + return &GamePagoda{_dataList:_dataList}, nil } func (table *GamePagoda) GetDataList() []*GamePagodaData { return table._dataList } -func (table *GamePagoda) Get(key int32) *GamePagodaData { - return table._dataMap[key] +func (table *GamePagoda) Get(index int) *GamePagodaData { + return table._dataList[index] } - From b35f18cf26708090e2a7f0a03dd92dca4047b952 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Fri, 23 Sep 2022 14:45:38 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=88=98=E6=96=97=E7=BB=93=E6=9D=9F=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/rtask/api_battlefinish.go | 75 +++++++++++++------------------ pb/rtask_msg.pb.go | 34 +++++++------- 2 files changed, 47 insertions(+), 62 deletions(-) diff --git a/modules/rtask/api_battlefinish.go b/modules/rtask/api_battlefinish.go index 86c7d476f..6bab88b70 100644 --- a/modules/rtask/api_battlefinish.go +++ b/modules/rtask/api_battlefinish.go @@ -20,63 +20,48 @@ func (this *apiComp) BattleFinish(session comm.IUserSession, req *pb.RtaskBattle return } - //校验战斗结果 - iBattle, err := this.moduleRtask.modelRtask.service.GetModule(comm.ModuleBattle) - if err != nil { - code = pb.ErrorCode_SystemError - return - } - - var isWin bool - if b, y := iBattle.(comm.IBattle); y { - if code, isWin = b.CheckBattleReport(session, req.Report); code != pb.ErrorCode_Success { + if req.IsWin { + // 获取玩家的任务 + rtask := &pb.DBRtask{} + if err := this.moduleRtask.modelRtask.Get(session.GetUserId(), rtask); err != nil { return } - if isWin { - // 获取玩家的任务 - rtask := &pb.DBRtask{} - if err := this.moduleRtask.modelRtask.Get(session.GetUserId(), rtask); err != nil { - return - } + // 获取当前任务配置 + conf := this.moduleRtask.configure.getRtaskById(req.RtaskId) + if conf == nil { + code = pb.ErrorCode_ConfigNoFound + log.Errorf("rdtask %v no found", req.RtaskId) + return + } - // 获取当前任务配置 - conf := this.moduleRtask.configure.getRtaskById(req.RtaskId) - if conf == nil { - code = pb.ErrorCode_ConfigNoFound - log.Errorf("rdtask %v no found", req.RtaskId) - return - } + var ( + frtaskArr *pb.FrtaskIds //完成的任务 + ok bool + ) - var ( - frtaskArr *pb.FrtaskIds //完成的任务 - ok bool - ) + if frtaskArr, ok = rtask.FrtaskIds[conf.Group]; !ok { + frtaskArr = &pb.FrtaskIds{} + } - if frtaskArr, ok = rtask.FrtaskIds[conf.Group]; !ok { - frtaskArr = &pb.FrtaskIds{} - } - - // 更新完成的任务 - frtaskArr.RtaskIds = append(frtaskArr.RtaskIds, req.RtaskId) - if rtask.FrtaskIds == nil { - rtask.FrtaskIds = make(map[int32]*pb.FrtaskIds) - } - rtask.FrtaskIds[conf.Group] = frtaskArr - update := map[string]interface{}{ - "frtaskIds": rtask.FrtaskIds, - } - if err := this.moduleRtask.modelRtask.Change(session.GetUserId(), update); err != nil { - code = pb.ErrorCode_SystemError - return - } + // 更新完成的任务 + frtaskArr.RtaskIds = append(frtaskArr.RtaskIds, req.RtaskId) + if rtask.FrtaskIds == nil { + rtask.FrtaskIds = make(map[int32]*pb.FrtaskIds) + } + rtask.FrtaskIds[conf.Group] = frtaskArr + update := map[string]interface{}{ + "frtaskIds": rtask.FrtaskIds, + } + if err := this.moduleRtask.modelRtask.Change(session.GetUserId(), update); err != nil { + code = pb.ErrorCode_SystemError + return } } if err := session.SendMsg(string(this.moduleRtask.GetType()), RtaskSubTypeBattleFinish, &pb.RtaskBattleFinishResp{ RtaskId: req.RtaskId, - IsWin: isWin, }); err != nil { code = pb.ErrorCode_SystemError } diff --git a/pb/rtask_msg.pb.go b/pb/rtask_msg.pb.go index 077259d1d..9a3a04546 100644 --- a/pb/rtask_msg.pb.go +++ b/pb/rtask_msg.pb.go @@ -622,6 +622,7 @@ type RtaskBattleFinishReq struct { unknownFields protoimpl.UnknownFields RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID + IsWin bool `protobuf:"varint,2,opt,name=isWin,proto3" json:"isWin"` //战斗结果 Report *BattleReport `protobuf:"bytes,4,opt,name=report,proto3" json:"report"` //战报 } @@ -664,6 +665,13 @@ func (x *RtaskBattleFinishReq) GetRtaskId() int32 { return 0 } +func (x *RtaskBattleFinishReq) GetIsWin() bool { + if x != nil { + return x.IsWin + } + return false +} + func (x *RtaskBattleFinishReq) GetReport() *BattleReport { if x != nil { return x.Report @@ -677,7 +685,6 @@ type RtaskBattleFinishResp struct { unknownFields protoimpl.UnknownFields RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID - IsWin bool `protobuf:"varint,2,opt,name=isWin,proto3" json:"isWin"` //战斗结果 } func (x *RtaskBattleFinishResp) Reset() { @@ -719,13 +726,6 @@ func (x *RtaskBattleFinishResp) GetRtaskId() int32 { return 0 } -func (x *RtaskBattleFinishResp) GetIsWin() bool { - if x != nil { - return x.IsWin - } - return false -} - //获取玩家任务记录 type RtaskGetrecordReq struct { state protoimpl.MessageState @@ -979,17 +979,17 @@ var file_rtask_rtask_msg_proto_rawDesc = []byte{ 0x22, 0x37, 0x0a, 0x14, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x57, 0x0a, 0x14, 0x52, 0x74, 0x61, + 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x6d, 0x0a, 0x14, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x22, 0x47, 0x0a, 0x15, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, - 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, - 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x57, 0x69, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x57, 0x69, 0x6e, 0x22, 0x13, 0x0a, 0x11, 0x52, + 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, + 0x73, 0x57, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x57, 0x69, + 0x6e, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x31, 0x0a, 0x15, 0x52, 0x74, 0x61, 0x73, + 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x22, 0x3c, 0x0a, 0x12, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, From 986bc3a397febc12f2014a044bb0d0b133bde032 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 23 Sep 2022 15:32:35 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E7=BE=81=E7=BB=8A=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/library/api_getlist.go | 13 +-- modules/library/api_getstoryreward.go | 4 + modules/library/comp_configure.go | 23 +++- modules/library/module.go | 38 +++++++ pb/chat_db.pb.go | 10 +- pb/library_db.pb.go | 16 +-- pb/rtask_msg.pb.go | 34 +++--- pb/user_msg.pb.go | 148 +++++++++++++++----------- 8 files changed, 177 insertions(+), 109 deletions(-) diff --git a/modules/library/api_getlist.go b/modules/library/api_getlist.go index 5ec155b04..f1ee0d830 100644 --- a/modules/library/api_getlist.go +++ b/modules/library/api_getlist.go @@ -8,24 +8,21 @@ import ( ) //参数校验 -func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.DBHero) (code pb.ErrorCode) { +func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.LibraryGetListReq) (code pb.ErrorCode) { return } -func (this *apiComp) GetList(session comm.IUserSession, req *pb.DBHero) (code pb.ErrorCode, data proto.Message) { +func (this *apiComp) GetList(session comm.IUserSession, req *pb.LibraryGetListReq) (code pb.ErrorCode, data proto.Message) { code = this.GetListCheck(session, req) if code != pb.ErrorCode_Success { return // 参数校验失败直接返回 } + rsp := &pb.LibraryGetListResp{} - // list, err := this.module.modelLibrary.getLibraryList(session.GetUserId()) - // if err != nil { - // code = pb.ErrorCode_DBError - // return - // } + rsp.Data = this.module.GetLibraryList(session.GetUserId()) + session.SendMsg(string(this.module.GetType()), LibraryGetListResp, rsp) - //session.SendMsg(string(this.module.GetType()), LibraryGetListResp, &pb.LibraryGetListResp{Data: list}) return } diff --git a/modules/library/api_getstoryreward.go b/modules/library/api_getstoryreward.go index b22c68617..21ec7d4eb 100644 --- a/modules/library/api_getstoryreward.go +++ b/modules/library/api_getstoryreward.go @@ -1,5 +1,9 @@ package library +/* +* 单个英雄剧情id 奖励 + */ + import ( "go_dreamfactory/comm" "go_dreamfactory/pb" diff --git a/modules/library/comp_configure.go b/modules/library/comp_configure.go index 59bfbd778..df5b197ee 100644 --- a/modules/library/comp_configure.go +++ b/modules/library/comp_configure.go @@ -9,7 +9,8 @@ import ( ) const ( - game_libraryhero = "game_libraryhero.json" + game_libraryhero = "game_libraryhero.json" + game_libraryfetter = "game_libraryfetter.json" ) ///配置管理基础组件 @@ -21,8 +22,11 @@ type configureComp struct { func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { err = this.MCompConfigure.Init(service, module, comp, options) - err = this.LoadConfigure(game_libraryhero, cfg.NewGameLibraryHero) - + //err = this.LoadConfigure(game_libraryhero, cfg.NewGameLibraryHero) + err = this.LoadMultiConfigure(map[string]interface{}{ + game_libraryhero: cfg.NewGameLibraryHero, + game_libraryfetter: cfg.NewGameLibraryFetter, + }) return } @@ -52,6 +56,17 @@ func (this *configureComp) GetLibraryHero(hid string) (data *cfg.GameLibraryHero } else { log.Errorf("get game_challenge conf err:%v", err) } - + return +} + +func (this *configureComp) GetLibraryFetter(fid int32) (data *cfg.GameLibraryFetterData) { + if v, err := this.GetConfigure(game_libraryfetter); err == nil { + if configure, ok := v.(*cfg.GameLibraryFetter); ok { + data = configure.Get(fid) + return + } + } else { + log.Errorf("get game_challenge conf err:%v", err) + } return } diff --git a/modules/library/module.go b/modules/library/module.go index 4666c2039..3a5094307 100644 --- a/modules/library/module.go +++ b/modules/library/module.go @@ -5,6 +5,8 @@ import ( "go_dreamfactory/lego/core" "go_dreamfactory/modules" "go_dreamfactory/pb" + + "go.mongodb.org/mongo-driver/bson/primitive" ) type Library struct { @@ -44,3 +46,39 @@ func (this *Library) ModifyLibraryData(uid string, data map[string]interface{}) } return } + +//英雄列表 +func (this *Library) GetLibraryList(uid string) []*pb.DBLibrary { + return this.modelLibrary.getLibraryList(uid) +} + +//通过羁绊id 创建多个羁绊信息 +func (this *Library) CreateLibrary(uid string, fids []int32, heroConfId string) (code pb.ErrorCode, objLibrary []*pb.DBLibrary) { + for _, fid := range fids { + obj := &pb.DBLibrary{ + Id: primitive.NewObjectID().Hex(), + Uid: uid, + Fid: fid, + Hero: map[string]int32{}, + Prize: false, + Fetterlv: 0, + } + + conf := this.configure.GetLibraryFetter(fid) + if conf == nil { + for _, v := range conf.Hid { + obj.Hero[v] = 0 + if v == heroConfId { + obj.Hero[heroConfId] = 1 + } + } + if err := this.modelLibrary.createLibrary(uid, obj); err != nil { + code = pb.ErrorCode_DBError + break + } + objLibrary = append(objLibrary, obj) + } + } + + return +} diff --git a/pb/chat_db.pb.go b/pb/chat_db.pb.go index 91241c9c6..7d01192b9 100644 --- a/pb/chat_db.pb.go +++ b/pb/chat_db.pb.go @@ -84,7 +84,6 @@ const ( ChatType_Share ChatType = 2 //分享类型 ChatType_HeroShare ChatType = 3 //英雄分享 ChatType_EquipmentShare ChatType = 4 //装备分享 - ChatType_ItemShare ChatType = 5 //道具分享 ) // Enum value maps for ChatType. @@ -95,7 +94,6 @@ var ( 2: "Share", 3: "HeroShare", 4: "EquipmentShare", - 5: "ItemShare", } ChatType_value = map[string]int32{ "Text": 0, @@ -103,7 +101,6 @@ var ( "Share": 2, "HeroShare": 3, "EquipmentShare": 4, - "ItemShare": 5, } ) @@ -346,14 +343,13 @@ var file_chat_chat_db_proto_rawDesc = []byte{ 0x6c, 0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x10, 0x03, 0x12, 0x0a, 0x0a, - 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x10, 0x04, 0x2a, 0x62, 0x0a, 0x08, 0x43, 0x68, 0x61, + 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x10, 0x04, 0x2a, 0x53, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x71, - 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x04, 0x12, 0x0d, - 0x0a, 0x09, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x05, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x04, 0x42, 0x06, + 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/library_db.pb.go b/pb/library_db.pb.go index 93dd5c8ac..35d3754d1 100644 --- a/pb/library_db.pb.go +++ b/pb/library_db.pb.go @@ -80,12 +80,12 @@ type DBLibrary struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID - Fid int32 `protobuf:"varint,3,opt,name=fid,proto3" json:"fid"` // 配置表id 羁绊id - Hero map[int32]int32 `protobuf:"bytes,4,rep,name=hero,proto3" json:"hero" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key: hid value: favorlv - Prize bool `protobuf:"varint,5,opt,name=prize,proto3" json:"prize"` //是否领奖 - Fetterlv int32 `protobuf:"varint,6,opt,name=fetterlv,proto3" json:"fetterlv"` // 当前羁绊等级 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID + Fid int32 `protobuf:"varint,3,opt,name=fid,proto3" json:"fid"` // 配置表id 羁绊id + Hero map[string]int32 `protobuf:"bytes,4,rep,name=hero,proto3" json:"hero" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key: hid value: favorlv + Prize bool `protobuf:"varint,5,opt,name=prize,proto3" json:"prize"` //是否领奖 + Fetterlv int32 `protobuf:"varint,6,opt,name=fetterlv,proto3" json:"fetterlv"` // 当前羁绊等级 } func (x *DBLibrary) Reset() { @@ -141,7 +141,7 @@ func (x *DBLibrary) GetFid() int32 { return 0 } -func (x *DBLibrary) GetHero() map[int32]int32 { +func (x *DBLibrary) GetHero() map[string]int32 { if x != nil { return x.Hero } @@ -180,7 +180,7 @@ var file_library_library_db_proto_rawDesc = []byte{ 0x08, 0x52, 0x05, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x65, 0x74, 0x74, 0x65, 0x72, 0x6c, 0x76, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x65, 0x74, 0x74, 0x65, 0x72, 0x6c, 0x76, 0x1a, 0x37, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, diff --git a/pb/rtask_msg.pb.go b/pb/rtask_msg.pb.go index 9a3a04546..077259d1d 100644 --- a/pb/rtask_msg.pb.go +++ b/pb/rtask_msg.pb.go @@ -622,7 +622,6 @@ type RtaskBattleFinishReq struct { unknownFields protoimpl.UnknownFields RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID - IsWin bool `protobuf:"varint,2,opt,name=isWin,proto3" json:"isWin"` //战斗结果 Report *BattleReport `protobuf:"bytes,4,opt,name=report,proto3" json:"report"` //战报 } @@ -665,13 +664,6 @@ func (x *RtaskBattleFinishReq) GetRtaskId() int32 { return 0 } -func (x *RtaskBattleFinishReq) GetIsWin() bool { - if x != nil { - return x.IsWin - } - return false -} - func (x *RtaskBattleFinishReq) GetReport() *BattleReport { if x != nil { return x.Report @@ -685,6 +677,7 @@ type RtaskBattleFinishResp struct { unknownFields protoimpl.UnknownFields RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID + IsWin bool `protobuf:"varint,2,opt,name=isWin,proto3" json:"isWin"` //战斗结果 } func (x *RtaskBattleFinishResp) Reset() { @@ -726,6 +719,13 @@ func (x *RtaskBattleFinishResp) GetRtaskId() int32 { return 0 } +func (x *RtaskBattleFinishResp) GetIsWin() bool { + if x != nil { + return x.IsWin + } + return false +} + //获取玩家任务记录 type RtaskGetrecordReq struct { state protoimpl.MessageState @@ -979,17 +979,17 @@ var file_rtask_rtask_msg_proto_rawDesc = []byte{ 0x22, 0x37, 0x0a, 0x14, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x6d, 0x0a, 0x14, 0x52, 0x74, 0x61, + 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x57, 0x0a, 0x14, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, - 0x73, 0x57, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x57, 0x69, - 0x6e, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x31, 0x0a, 0x15, 0x52, 0x74, 0x61, 0x73, - 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x52, + 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, + 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x22, 0x47, 0x0a, 0x15, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, + 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, + 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x57, 0x69, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x57, 0x69, 0x6e, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x22, 0x3c, 0x0a, 0x12, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index c82f5667c..eceee096f 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -564,19 +564,21 @@ func (x *UserCreateResp) GetIsSucc() bool { } // 玩家资源变更推送 -type UserResChangedPush struct { +type UserResChangePush struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Gold int32 `protobuf:"varint,1,opt,name=gold,proto3" json:"gold" bson:"gold"` //金币 Exp int32 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp" bson:"exp"` //经验 + Lv int32 `protobuf:"varint,3,opt,name=lv,proto3" json:"lv" bson:"lv"` //等级 + Vip int32 `protobuf:"varint,4,opt,name=vip,proto3" json:"vip" bson:"vip"` // vip Diamond int32 `protobuf:"varint,5,opt,name=diamond,proto3" json:"diamond" bson:"diamond"` // 钻石 Friend int32 `protobuf:"varint,6,opt,name=friend,proto3" json:"friend" bson:"frined"` //友情点 } -func (x *UserResChangedPush) Reset() { - *x = UserResChangedPush{} +func (x *UserResChangePush) Reset() { + *x = UserResChangePush{} if protoimpl.UnsafeEnabled { mi := &file_user_user_msg_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -584,13 +586,13 @@ func (x *UserResChangedPush) Reset() { } } -func (x *UserResChangedPush) String() string { +func (x *UserResChangePush) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserResChangedPush) ProtoMessage() {} +func (*UserResChangePush) ProtoMessage() {} -func (x *UserResChangedPush) ProtoReflect() protoreflect.Message { +func (x *UserResChangePush) ProtoReflect() protoreflect.Message { mi := &file_user_user_msg_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -602,33 +604,47 @@ func (x *UserResChangedPush) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserResChangedPush.ProtoReflect.Descriptor instead. -func (*UserResChangedPush) Descriptor() ([]byte, []int) { +// Deprecated: Use UserResChangePush.ProtoReflect.Descriptor instead. +func (*UserResChangePush) Descriptor() ([]byte, []int) { return file_user_user_msg_proto_rawDescGZIP(), []int{11} } -func (x *UserResChangedPush) GetGold() int32 { +func (x *UserResChangePush) GetGold() int32 { if x != nil { return x.Gold } return 0 } -func (x *UserResChangedPush) GetExp() int32 { +func (x *UserResChangePush) GetExp() int32 { if x != nil { return x.Exp } return 0 } -func (x *UserResChangedPush) GetDiamond() int32 { +func (x *UserResChangePush) GetLv() int32 { + if x != nil { + return x.Lv + } + return 0 +} + +func (x *UserResChangePush) GetVip() int32 { + if x != nil { + return x.Vip + } + return 0 +} + +func (x *UserResChangePush) GetDiamond() int32 { if x != nil { return x.Diamond } return 0 } -func (x *UserResChangedPush) GetFriend() int32 { +func (x *UserResChangePush) GetFriend() int32 { if x != nil { return x.Friend } @@ -1195,7 +1211,7 @@ func (x *UserGetTujianResp) GetHeroids() []string { } //玩家等级经验变化推送 -type UserLvChangedPush struct { +type UserChangedPush struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1205,8 +1221,8 @@ type UserLvChangedPush struct { Lv int32 `protobuf:"varint,3,opt,name=lv,proto3" json:"lv"` } -func (x *UserLvChangedPush) Reset() { - *x = UserLvChangedPush{} +func (x *UserChangedPush) Reset() { + *x = UserChangedPush{} if protoimpl.UnsafeEnabled { mi := &file_user_user_msg_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1214,13 +1230,13 @@ func (x *UserLvChangedPush) Reset() { } } -func (x *UserLvChangedPush) String() string { +func (x *UserChangedPush) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserLvChangedPush) ProtoMessage() {} +func (*UserChangedPush) ProtoMessage() {} -func (x *UserLvChangedPush) ProtoReflect() protoreflect.Message { +func (x *UserChangedPush) ProtoReflect() protoreflect.Message { mi := &file_user_user_msg_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1232,26 +1248,26 @@ func (x *UserLvChangedPush) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserLvChangedPush.ProtoReflect.Descriptor instead. -func (*UserLvChangedPush) Descriptor() ([]byte, []int) { +// Deprecated: Use UserChangedPush.ProtoReflect.Descriptor instead. +func (*UserChangedPush) Descriptor() ([]byte, []int) { return file_user_user_msg_proto_rawDescGZIP(), []int{24} } -func (x *UserLvChangedPush) GetUid() string { +func (x *UserChangedPush) GetUid() string { if x != nil { return x.Uid } return "" } -func (x *UserLvChangedPush) GetExp() int32 { +func (x *UserChangedPush) GetExp() int32 { if x != nil { return x.Exp } return 0 } -func (x *UserLvChangedPush) GetLv() int32 { +func (x *UserChangedPush) GetLv() int32 { if x != nil { return x.Lv } @@ -1555,47 +1571,49 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, - 0x63, 0x22, 0x6c, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, + 0x63, 0x22, 0x8d, 0x01, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, - 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x18, 0x0a, - 0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, - 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, - 0x13, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x71, 0x22, 0x3e, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x22, 0x40, 0x0a, 0x14, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x07, + 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, + 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x10, 0x0a, + 0x03, 0x76, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x69, 0x70, 0x12, + 0x18, 0x0a, 0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x22, 0x13, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x22, 0x3e, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, - 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x43, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x22, 0x26, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, - 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x25, 0x0a, 0x0f, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, - 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x22, 0x24, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, - 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, - 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x50, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, - 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, - 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, - 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, - 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, - 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x47, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4c, - 0x76, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x40, 0x0a, 0x14, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x28, + 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, + 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x75, 0x69, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x22, 0x26, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, + 0x72, 0x69, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x25, + 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x71, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x24, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, + 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, + 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x50, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, + 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, + 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x73, + 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x45, 0x0a, 0x0f, 0x55, 0x73, 0x65, + 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, @@ -1653,7 +1671,7 @@ var file_user_user_msg_proto_goTypes = []interface{}{ (*UserLoadResp)(nil), // 8: UserLoadResp (*UserCreateReq)(nil), // 9: UserCreateReq (*UserCreateResp)(nil), // 10: UserCreateResp - (*UserResChangedPush)(nil), // 11: UserResChangedPush + (*UserResChangePush)(nil), // 11: UserResChangePush (*UserGetSettingReq)(nil), // 12: UserGetSettingReq (*UserGetSettingResp)(nil), // 13: UserGetSettingResp (*UserUpdateSettingReq)(nil), // 14: UserUpdateSettingReq @@ -1666,7 +1684,7 @@ var file_user_user_msg_proto_goTypes = []interface{}{ (*UserModifynameResp)(nil), // 21: UserModifynameResp (*UserGetTujianReq)(nil), // 22: UserGetTujianReq (*UserGetTujianResp)(nil), // 23: UserGetTujianResp - (*UserLvChangedPush)(nil), // 24: UserLvChangedPush + (*UserChangedPush)(nil), // 24: UserChangedPush (*UserFigureReq)(nil), // 25: UserFigureReq (*UserFigureResp)(nil), // 26: UserFigureResp (*UserModifysignReq)(nil), // 27: UserModifysignReq @@ -1847,7 +1865,7 @@ func file_user_user_msg_proto_init() { } } file_user_user_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserResChangedPush); i { + switch v := v.(*UserResChangePush); i { case 0: return &v.state case 1: @@ -2003,7 +2021,7 @@ func file_user_user_msg_proto_init() { } } file_user_user_msg_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserLvChangedPush); i { + switch v := v.(*UserChangedPush); i { case 0: return &v.state case 1: From 423cb2d037d5f232bc71dd815ceefd081da5b140 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 23 Sep 2022 15:34:52 +0800 Subject: [PATCH 7/8] =?UTF-8?q?bp=20=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pb/chat_db.pb.go | 10 ++- pb/rtask_msg.pb.go | 34 +++++------ pb/user_msg.pb.go | 148 ++++++++++++++++++++------------------------- 3 files changed, 89 insertions(+), 103 deletions(-) diff --git a/pb/chat_db.pb.go b/pb/chat_db.pb.go index 7d01192b9..91241c9c6 100644 --- a/pb/chat_db.pb.go +++ b/pb/chat_db.pb.go @@ -84,6 +84,7 @@ const ( ChatType_Share ChatType = 2 //分享类型 ChatType_HeroShare ChatType = 3 //英雄分享 ChatType_EquipmentShare ChatType = 4 //装备分享 + ChatType_ItemShare ChatType = 5 //道具分享 ) // Enum value maps for ChatType. @@ -94,6 +95,7 @@ var ( 2: "Share", 3: "HeroShare", 4: "EquipmentShare", + 5: "ItemShare", } ChatType_value = map[string]int32{ "Text": 0, @@ -101,6 +103,7 @@ var ( "Share": 2, "HeroShare": 3, "EquipmentShare": 4, + "ItemShare": 5, } ) @@ -343,13 +346,14 @@ var file_chat_chat_db_proto_rawDesc = []byte{ 0x6c, 0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x10, 0x03, 0x12, 0x0a, 0x0a, - 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x10, 0x04, 0x2a, 0x53, 0x0a, 0x08, 0x43, 0x68, 0x61, + 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x10, 0x04, 0x2a, 0x62, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x71, - 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x04, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x04, 0x12, 0x0d, + 0x0a, 0x09, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x68, 0x61, 0x72, 0x65, 0x10, 0x05, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/rtask_msg.pb.go b/pb/rtask_msg.pb.go index 077259d1d..9a3a04546 100644 --- a/pb/rtask_msg.pb.go +++ b/pb/rtask_msg.pb.go @@ -622,6 +622,7 @@ type RtaskBattleFinishReq struct { unknownFields protoimpl.UnknownFields RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID + IsWin bool `protobuf:"varint,2,opt,name=isWin,proto3" json:"isWin"` //战斗结果 Report *BattleReport `protobuf:"bytes,4,opt,name=report,proto3" json:"report"` //战报 } @@ -664,6 +665,13 @@ func (x *RtaskBattleFinishReq) GetRtaskId() int32 { return 0 } +func (x *RtaskBattleFinishReq) GetIsWin() bool { + if x != nil { + return x.IsWin + } + return false +} + func (x *RtaskBattleFinishReq) GetReport() *BattleReport { if x != nil { return x.Report @@ -677,7 +685,6 @@ type RtaskBattleFinishResp struct { unknownFields protoimpl.UnknownFields RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"` //任务ID - IsWin bool `protobuf:"varint,2,opt,name=isWin,proto3" json:"isWin"` //战斗结果 } func (x *RtaskBattleFinishResp) Reset() { @@ -719,13 +726,6 @@ func (x *RtaskBattleFinishResp) GetRtaskId() int32 { return 0 } -func (x *RtaskBattleFinishResp) GetIsWin() bool { - if x != nil { - return x.IsWin - } - return false -} - //获取玩家任务记录 type RtaskGetrecordReq struct { state protoimpl.MessageState @@ -979,17 +979,17 @@ var file_rtask_rtask_msg_proto_rawDesc = []byte{ 0x22, 0x37, 0x0a, 0x14, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x57, 0x0a, 0x14, 0x52, 0x74, 0x61, + 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x6d, 0x0a, 0x14, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x22, 0x47, 0x0a, 0x15, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, - 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, - 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x57, 0x69, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x57, 0x69, 0x6e, 0x22, 0x13, 0x0a, 0x11, 0x52, + 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, + 0x73, 0x57, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x57, 0x69, + 0x6e, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x31, 0x0a, 0x15, 0x52, 0x74, 0x61, 0x73, + 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x22, 0x3c, 0x0a, 0x12, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x65, 0x74, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index eceee096f..c82f5667c 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -564,21 +564,19 @@ func (x *UserCreateResp) GetIsSucc() bool { } // 玩家资源变更推送 -type UserResChangePush struct { +type UserResChangedPush struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Gold int32 `protobuf:"varint,1,opt,name=gold,proto3" json:"gold" bson:"gold"` //金币 Exp int32 `protobuf:"varint,2,opt,name=exp,proto3" json:"exp" bson:"exp"` //经验 - Lv int32 `protobuf:"varint,3,opt,name=lv,proto3" json:"lv" bson:"lv"` //等级 - Vip int32 `protobuf:"varint,4,opt,name=vip,proto3" json:"vip" bson:"vip"` // vip Diamond int32 `protobuf:"varint,5,opt,name=diamond,proto3" json:"diamond" bson:"diamond"` // 钻石 Friend int32 `protobuf:"varint,6,opt,name=friend,proto3" json:"friend" bson:"frined"` //友情点 } -func (x *UserResChangePush) Reset() { - *x = UserResChangePush{} +func (x *UserResChangedPush) Reset() { + *x = UserResChangedPush{} if protoimpl.UnsafeEnabled { mi := &file_user_user_msg_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -586,13 +584,13 @@ func (x *UserResChangePush) Reset() { } } -func (x *UserResChangePush) String() string { +func (x *UserResChangedPush) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserResChangePush) ProtoMessage() {} +func (*UserResChangedPush) ProtoMessage() {} -func (x *UserResChangePush) ProtoReflect() protoreflect.Message { +func (x *UserResChangedPush) ProtoReflect() protoreflect.Message { mi := &file_user_user_msg_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -604,47 +602,33 @@ func (x *UserResChangePush) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserResChangePush.ProtoReflect.Descriptor instead. -func (*UserResChangePush) Descriptor() ([]byte, []int) { +// Deprecated: Use UserResChangedPush.ProtoReflect.Descriptor instead. +func (*UserResChangedPush) Descriptor() ([]byte, []int) { return file_user_user_msg_proto_rawDescGZIP(), []int{11} } -func (x *UserResChangePush) GetGold() int32 { +func (x *UserResChangedPush) GetGold() int32 { if x != nil { return x.Gold } return 0 } -func (x *UserResChangePush) GetExp() int32 { +func (x *UserResChangedPush) GetExp() int32 { if x != nil { return x.Exp } return 0 } -func (x *UserResChangePush) GetLv() int32 { - if x != nil { - return x.Lv - } - return 0 -} - -func (x *UserResChangePush) GetVip() int32 { - if x != nil { - return x.Vip - } - return 0 -} - -func (x *UserResChangePush) GetDiamond() int32 { +func (x *UserResChangedPush) GetDiamond() int32 { if x != nil { return x.Diamond } return 0 } -func (x *UserResChangePush) GetFriend() int32 { +func (x *UserResChangedPush) GetFriend() int32 { if x != nil { return x.Friend } @@ -1211,7 +1195,7 @@ func (x *UserGetTujianResp) GetHeroids() []string { } //玩家等级经验变化推送 -type UserChangedPush struct { +type UserLvChangedPush struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1221,8 +1205,8 @@ type UserChangedPush struct { Lv int32 `protobuf:"varint,3,opt,name=lv,proto3" json:"lv"` } -func (x *UserChangedPush) Reset() { - *x = UserChangedPush{} +func (x *UserLvChangedPush) Reset() { + *x = UserLvChangedPush{} if protoimpl.UnsafeEnabled { mi := &file_user_user_msg_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1230,13 +1214,13 @@ func (x *UserChangedPush) Reset() { } } -func (x *UserChangedPush) String() string { +func (x *UserLvChangedPush) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserChangedPush) ProtoMessage() {} +func (*UserLvChangedPush) ProtoMessage() {} -func (x *UserChangedPush) ProtoReflect() protoreflect.Message { +func (x *UserLvChangedPush) ProtoReflect() protoreflect.Message { mi := &file_user_user_msg_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1248,26 +1232,26 @@ func (x *UserChangedPush) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserChangedPush.ProtoReflect.Descriptor instead. -func (*UserChangedPush) Descriptor() ([]byte, []int) { +// Deprecated: Use UserLvChangedPush.ProtoReflect.Descriptor instead. +func (*UserLvChangedPush) Descriptor() ([]byte, []int) { return file_user_user_msg_proto_rawDescGZIP(), []int{24} } -func (x *UserChangedPush) GetUid() string { +func (x *UserLvChangedPush) GetUid() string { if x != nil { return x.Uid } return "" } -func (x *UserChangedPush) GetExp() int32 { +func (x *UserLvChangedPush) GetExp() int32 { if x != nil { return x.Exp } return 0 } -func (x *UserChangedPush) GetLv() int32 { +func (x *UserLvChangedPush) GetLv() int32 { if x != nil { return x.Lv } @@ -1571,49 +1555,47 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x28, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x49, 0x73, 0x53, 0x75, 0x63, - 0x63, 0x22, 0x8d, 0x01, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, + 0x63, 0x22, 0x6c, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x6f, 0x6c, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, - 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, - 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x10, 0x0a, - 0x03, 0x76, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x76, 0x69, 0x70, 0x12, - 0x18, 0x0a, 0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x22, 0x13, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x22, 0x3e, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, - 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, + 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x18, 0x0a, + 0x07, 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x64, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, + 0x13, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x22, 0x3e, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, + 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x22, 0x40, 0x0a, 0x14, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x40, 0x0a, 0x14, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x28, - 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, - 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x22, 0x26, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, - 0x72, 0x69, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x25, - 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x71, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x24, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, - 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, - 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x50, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, - 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, - 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x73, - 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x45, 0x0a, 0x0f, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, + 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x71, 0x22, 0x26, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, + 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x25, 0x0a, 0x0f, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, + 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x22, 0x24, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, + 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x50, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, + 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, + 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, + 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, + 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, + 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x47, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4c, + 0x76, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, @@ -1671,7 +1653,7 @@ var file_user_user_msg_proto_goTypes = []interface{}{ (*UserLoadResp)(nil), // 8: UserLoadResp (*UserCreateReq)(nil), // 9: UserCreateReq (*UserCreateResp)(nil), // 10: UserCreateResp - (*UserResChangePush)(nil), // 11: UserResChangePush + (*UserResChangedPush)(nil), // 11: UserResChangedPush (*UserGetSettingReq)(nil), // 12: UserGetSettingReq (*UserGetSettingResp)(nil), // 13: UserGetSettingResp (*UserUpdateSettingReq)(nil), // 14: UserUpdateSettingReq @@ -1684,7 +1666,7 @@ var file_user_user_msg_proto_goTypes = []interface{}{ (*UserModifynameResp)(nil), // 21: UserModifynameResp (*UserGetTujianReq)(nil), // 22: UserGetTujianReq (*UserGetTujianResp)(nil), // 23: UserGetTujianResp - (*UserChangedPush)(nil), // 24: UserChangedPush + (*UserLvChangedPush)(nil), // 24: UserLvChangedPush (*UserFigureReq)(nil), // 25: UserFigureReq (*UserFigureResp)(nil), // 26: UserFigureResp (*UserModifysignReq)(nil), // 27: UserModifysignReq @@ -1865,7 +1847,7 @@ func file_user_user_msg_proto_init() { } } file_user_user_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserResChangePush); i { + switch v := v.(*UserResChangedPush); i { case 0: return &v.state case 1: @@ -2021,7 +2003,7 @@ func file_user_user_msg_proto_init() { } } file_user_user_msg_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserChangedPush); i { + switch v := v.(*UserLvChangedPush); i { case 0: return &v.state case 1: From dd2705a6a9c50361e4606629f8247cb30fdadbc6 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 23 Sep 2022 16:36:52 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=88=98=E6=96=97=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=80=8F=E4=BC=A0=E5=9B=9E=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hunting/api_challenge.go | 15 ++---- modules/mainline/api_challenge.go | 17 +++---- modules/pagoda/api_challenge.go | 15 ++---- modules/viking/api_challenge.go | 15 ++---- pb/hunting_msg.pb.go | 79 +++++++++++++++++++------------ pb/mainline_msg.pb.go | 26 ++++++++-- pb/pagoda_msg.pb.go | 67 ++++++++++++++++---------- pb/viking_msg.pb.go | 77 ++++++++++++++++++------------ 8 files changed, 184 insertions(+), 127 deletions(-) diff --git a/modules/hunting/api_challenge.go b/modules/hunting/api_challenge.go index c268d23c8..07c10fd83 100644 --- a/modules/hunting/api_challenge.go +++ b/modules/hunting/api_challenge.go @@ -59,16 +59,11 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallen if code != pb.ErrorCode_Success { return } - session.SendMsg(string(this.module.GetType()), HuntingChallengeResp, &pb.VikingChallengeResp{Info: &pb.BattleInfo{ - Id: record.Id, - Title: record.Title, - Btype: record.Btype, - Ptype: record.Ptype, - RedCompId: record.RedCompId, - Redflist: record.Redflist, - BlueCompId: record.BlueCompId, - Buleflist: record.Buleflist, - }}) + session.SendMsg(string(this.module.GetType()), HuntingChallengeResp, &pb.HuntingChallengeResp{ + Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist}, + BossType: req.BossType, + Difficulty: req.Difficulty, + }) return } diff --git a/modules/mainline/api_challenge.go b/modules/mainline/api_challenge.go index 6c925f25b..6e7f8dbb1 100644 --- a/modules/mainline/api_challenge.go +++ b/modules/mainline/api_challenge.go @@ -51,7 +51,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{ Ptype: pb.PlayType_moonfantasy, - Title: node.Title, + Title: "", Leadpos: req.Leadpos, Teamids: req.Teamids, Mformat: node.FormatList, @@ -59,15 +59,10 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle if code != pb.ErrorCode_Success { return } - session.SendMsg(string(this.module.GetType()), MainlineChallengeResp, &pb.MainlineChallengeResp{Info: &pb.BattleInfo{ - Id: record.Id, - Title: record.Title, - Btype: record.Btype, - Ptype: record.Ptype, - RedCompId: record.RedCompId, - Redflist: record.Redflist, - BlueCompId: record.BlueCompId, - Buleflist: record.Buleflist, - }}) + session.SendMsg(string(this.module.GetType()), MainlineChallengeResp, &pb.MainlineChallengeResp{ + Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist}, + ChapterObj: req.ChapterObj, + MainlineId: req.GetMainlineId(), + }) return } diff --git a/modules/pagoda/api_challenge.go b/modules/pagoda/api_challenge.go index bc8003feb..fce5b16cd 100644 --- a/modules/pagoda/api_challenge.go +++ b/modules/pagoda/api_challenge.go @@ -66,15 +66,10 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng if code != pb.ErrorCode_Success { return } - session.SendMsg(string(this.module.GetType()), PagodaChallengeResp, &pb.PagodaChallengeResp{Info: &pb.BattleInfo{ - Id: record.Id, - Title: record.Title, - Btype: record.Btype, - Ptype: record.Ptype, - RedCompId: record.RedCompId, - Redflist: record.Redflist, - BlueCompId: record.BlueCompId, - Buleflist: record.Buleflist, - }}) + session.SendMsg(string(this.module.GetType()), PagodaChallengeResp, &pb.PagodaChallengeResp{ + Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist}, + LevelID: req.LevelID, + PagodaType: req.PagodaType, + }) return } diff --git a/modules/viking/api_challenge.go b/modules/viking/api_challenge.go index b5ae15a3a..35e14a005 100644 --- a/modules/viking/api_challenge.go +++ b/modules/viking/api_challenge.go @@ -59,15 +59,10 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng if code != pb.ErrorCode_Success { return } - session.SendMsg(string(this.module.GetType()), VikingChallengeResp, &pb.VikingChallengeResp{Info: &pb.BattleInfo{ - Id: record.Id, - Title: record.Title, - Btype: record.Btype, - Ptype: record.Ptype, - RedCompId: record.RedCompId, - Redflist: record.Redflist, - BlueCompId: record.BlueCompId, - Buleflist: record.Buleflist, - }}) + session.SendMsg(string(this.module.GetType()), VikingChallengeResp, &pb.VikingChallengeResp{ + Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist}, + BossType: req.BossType, + Difficulty: req.Difficulty, + }) return } diff --git a/pb/hunting_msg.pb.go b/pb/hunting_msg.pb.go index 2a0abfccd..bab5b0418 100644 --- a/pb/hunting_msg.pb.go +++ b/pb/hunting_msg.pb.go @@ -182,7 +182,9 @@ type HuntingChallengeResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + BossType int32 `protobuf:"varint,2,opt,name=bossType,proto3" json:"bossType"` // boos 类型 + Difficulty int32 `protobuf:"varint,3,opt,name=difficulty,proto3" json:"difficulty"` // 难度 } func (x *HuntingChallengeResp) Reset() { @@ -224,6 +226,20 @@ func (x *HuntingChallengeResp) GetInfo() *BattleInfo { return nil } +func (x *HuntingChallengeResp) GetBossType() int32 { + if x != nil { + return x.BossType + } + return 0 +} + +func (x *HuntingChallengeResp) GetDifficulty() int32 { + if x != nil { + return x.Difficulty + } + return 0 +} + type HuntingChallengeOverReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -554,37 +570,40 @@ var file_hunting_hunting_msg_proto_rawDesc = []byte{ 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, - 0x73, 0x22, 0x37, 0x0a, 0x14, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, + 0x73, 0x22, 0x73, 0x0a, 0x14, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x7c, 0x0a, 0x17, 0x48, 0x75, - 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, - 0x79, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x3a, 0x0a, 0x18, 0x48, 0x75, 0x6e, 0x74, - 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x22, 0x25, 0x0a, 0x0d, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, - 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x30, 0x0a, 0x0e, 0x48, - 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, - 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x48, 0x0a, - 0x12, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x3b, 0x0a, 0x13, 0x48, 0x75, 0x6e, 0x74, 0x69, - 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, - 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, - 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, + 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, + 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, + 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, + 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x7c, 0x0a, 0x17, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, + 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x25, 0x0a, + 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x22, 0x3a, 0x0a, 0x18, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x43, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x22, 0x25, 0x0a, 0x0d, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, + 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x30, 0x0a, 0x0e, 0x48, 0x75, 0x6e, 0x74, 0x69, + 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x48, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x48, 0x0a, 0x12, 0x48, 0x75, 0x6e, + 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x22, 0x3b, 0x0a, 0x13, 0x48, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, + 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x05, 0x72, 0x61, + 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x48, 0x75, + 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, + 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/mainline_msg.pb.go b/pb/mainline_msg.pb.go index 33116feea..bbd7216c4 100644 --- a/pb/mainline_msg.pb.go +++ b/pb/mainline_msg.pb.go @@ -279,7 +279,9 @@ type MainlineChallengeResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + ChapterObj string `protobuf:"bytes,2,opt,name=chapterObj,proto3" json:"chapterObj"` // 章节唯一对象id + MainlineId uint32 `protobuf:"varint,3,opt,name=mainlineId,proto3" json:"mainlineId"` // 小关ID } func (x *MainlineChallengeResp) Reset() { @@ -321,6 +323,20 @@ func (x *MainlineChallengeResp) GetInfo() *BattleInfo { return nil } +func (x *MainlineChallengeResp) GetChapterObj() string { + if x != nil { + return x.ChapterObj + } + return "" +} + +func (x *MainlineChallengeResp) GetMainlineId() uint32 { + if x != nil { + return x.MainlineId + } + return 0 +} + // 客户端通知服务器打赢了 type MainlineChallengeOverReq struct { state protoimpl.MessageState @@ -509,10 +525,14 @@ var file_mainline_mainline_msg_proto_rawDesc = []byte{ 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x22, - 0x38, 0x0a, 0x15, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, + 0x78, 0x0a, 0x15, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x4d, 0x61, + 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x68, 0x61, + 0x70, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, + 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x61, 0x69, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, + 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x4f, 0x62, 0x6a, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x70, diff --git a/pb/pagoda_msg.pb.go b/pb/pagoda_msg.pb.go index 2aeca7f32..b2aef9bb1 100644 --- a/pb/pagoda_msg.pb.go +++ b/pb/pagoda_msg.pb.go @@ -278,7 +278,9 @@ type PagodaChallengeResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + LevelID int32 `protobuf:"varint,2,opt,name=levelID,proto3" json:"levelID"` // 挑战层数 + PagodaType int32 `protobuf:"varint,3,opt,name=PagodaType,proto3" json:"PagodaType"` // 塔类型 } func (x *PagodaChallengeResp) Reset() { @@ -320,6 +322,20 @@ func (x *PagodaChallengeResp) GetInfo() *BattleInfo { return nil } +func (x *PagodaChallengeResp) GetLevelID() int32 { + if x != nil { + return x.LevelID + } + return 0 +} + +func (x *PagodaChallengeResp) GetPagodaType() int32 { + if x != nil { + return x.PagodaType + } + return 0 +} + // 客户端通知服务器打赢了 type PagodaChallengeOverReq struct { state protoimpl.MessageState @@ -560,31 +576,34 @@ var file_pagoda_pagoda_msg_proto_rawDesc = []byte{ 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, - 0x69, 0x64, 0x73, 0x22, 0x36, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, + 0x69, 0x64, 0x73, 0x22, 0x70, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x79, 0x0a, 0x16, 0x50, - 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x12, - 0x1e, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0a, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, - 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x38, 0x0a, 0x17, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, - 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x09, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x22, 0x45, 0x0a, 0x11, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x49, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x3b, 0x0a, 0x12, 0x50, 0x61, 0x67, 0x6f, 0x64, - 0x61, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, - 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, - 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x05, 0x72, - 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x50, 0x61, 0x67, 0x6f, 0x64, + 0x61, 0x54, 0x79, 0x70, 0x65, 0x22, 0x79, 0x0a, 0x16, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, + 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x61, 0x67, + 0x6f, 0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x50, + 0x61, 0x67, 0x6f, 0x64, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x22, 0x38, 0x0a, 0x17, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, + 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x61, + 0x67, 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x45, 0x0a, 0x11, 0x50, 0x61, + 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x18, 0x0a, 0x07, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x22, 0x3b, 0x0a, 0x12, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x6e, 0x6b, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, + 0x61, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, + 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/viking_msg.pb.go b/pb/viking_msg.pb.go index c23a7fea6..b417a98d1 100644 --- a/pb/viking_msg.pb.go +++ b/pb/viking_msg.pb.go @@ -182,7 +182,9 @@ type VikingChallengeResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + Info *BattleInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info"` + BossType int32 `protobuf:"varint,2,opt,name=bossType,proto3" json:"bossType"` // boos 类型 + Difficulty int32 `protobuf:"varint,3,opt,name=difficulty,proto3" json:"difficulty"` // 难度 } func (x *VikingChallengeResp) Reset() { @@ -224,6 +226,20 @@ func (x *VikingChallengeResp) GetInfo() *BattleInfo { return nil } +func (x *VikingChallengeResp) GetBossType() int32 { + if x != nil { + return x.BossType + } + return 0 +} + +func (x *VikingChallengeResp) GetDifficulty() int32 { + if x != nil { + return x.Difficulty + } + return 0 +} + type VikingChallengeOverReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -553,37 +569,40 @@ var file_viking_viking_msg_proto_rawDesc = []byte{ 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65, 0x61, 0x64, 0x70, 0x6f, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x22, 0x36, 0x0a, 0x13, 0x56, 0x69, 0x6b, + 0x52, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x69, 0x64, 0x73, 0x22, 0x72, 0x0a, 0x13, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, - 0x6f, 0x22, 0x7b, 0x0a, 0x16, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, - 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, - 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, - 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, - 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, - 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x38, - 0x0a, 0x17, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, - 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, - 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x24, 0x0a, 0x0c, 0x56, 0x69, 0x6b, 0x69, - 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2e, - 0x0a, 0x0d, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, - 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x47, - 0x0a, 0x11, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x39, 0x0a, 0x12, 0x56, 0x69, 0x6b, 0x69, 0x6e, - 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, - 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, - 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e, - 0x6b, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x7b, 0x0a, + 0x16, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, + 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x6f, 0x73, 0x73, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, + 0x6c, 0x74, 0x79, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x38, 0x0a, 0x17, 0x56, 0x69, + 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x24, 0x0a, 0x0c, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x42, 0x75, + 0x79, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2e, 0x0a, 0x0d, 0x56, 0x69, + 0x6b, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x56, 0x69, + 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x47, 0x0a, 0x11, 0x56, 0x69, + 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x22, 0x39, 0x0a, 0x12, 0x56, 0x69, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, + 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x05, 0x72, 0x61, 0x6e, + 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x56, 0x69, 0x6b, + 0x69, 0x6e, 0x67, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x42, 0x06, + 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (