bingo支持改玩家等级

This commit is contained in:
wh_zcy 2022-12-28 11:13:06 +08:00
parent 2bfc1edce5
commit dac702a58a
3 changed files with 21 additions and 3 deletions

View File

@ -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

View File

@ -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" {

View File

@ -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)},
)
}
}