From dac702a58a5d95c97d37ad536d5ed2750b33104f Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 28 Dec 2022 11:13:06 +0800 Subject: [PATCH] =?UTF-8?q?bingo=E6=94=AF=E6=8C=81=E6=94=B9=E7=8E=A9?= =?UTF-8?q?=E5=AE=B6=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/v2/FyneApp.toml | 4 ++-- cmd/v2/ui/views/bingoview.go | 2 +- modules/gm/module.go | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/cmd/v2/FyneApp.toml b/cmd/v2/FyneApp.toml index 57d737750..1e39ea0ea 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.2.2" - Build = 29 + Version = "1.2.3" + Build = 31 diff --git a/cmd/v2/ui/views/bingoview.go b/cmd/v2/ui/views/bingoview.go index 77effa410..59cf6819a 100644 --- a/cmd/v2/ui/views/bingoview.go +++ b/cmd/v2/ui/views/bingoview.go @@ -46,7 +46,7 @@ func (this *BingoView) CreateView(t *model.TestCase) fyne.CanvasObject { aSel = &widget.Select{} gridContainer = container.NewGridWithColumns(3, aSel, tEntry, nEntry) - aSel.Options = []string{"选择", "attr", "item", "hero", "equi", "mapid", "pataid", "alltask", "worldtask", "sociatyexp", "sociatyactivity", "allgrowtask"} + aSel.Options = []string{"选择", "attr", "item", "hero", "equi", "mapid", "pataid", "alltask", "worldtask", "sociatyexp", "sociatyactivity", "allgrowtask","userlv"} aSel.SetSelected("选择") aSel.OnChanged = func(s string) { if s == "attr" { diff --git a/modules/gm/module.go b/modules/gm/module.go index 82938fb79..6f75987b3 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -342,6 +342,24 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC log.Field{Key: "param", Value: datas[0]}, log.Field{Key: "res", Value: res}, ) + } else if len(datas) == 2 && (datas[0] == "userlv") { // 玩家等级 + module1, err := this.service.GetModule(comm.ModuleUser) + if err != nil { + return + } + num, err := strconv.Atoi(datas[1]) + if err != nil { + code = pb.ErrorCode_ReqParameterError + return + } + if err = module1.(comm.IUser).BingoSetUserLv(session, int32(num)); err == nil { + code = pb.ErrorCode_Success + } + this.Debug("使用bingo命令:uid = %s ", + log.Field{Key: "uid", Value: session.GetUserId()}, + log.Field{Key: "0", Value: datas[0]}, + log.Field{Key: "N", Value: int32(num)}, + ) } }