修改功能开启条件判断

This commit is contained in:
wh_zcy 2023-02-06 15:11:20 +08:00
parent aa91ee0b32
commit e31e0d1ae8
2 changed files with 26 additions and 17 deletions

View File

@ -10,7 +10,6 @@ import (
"go_dreamfactory/modules/user"
"go_dreamfactory/pb"
"strings"
"time"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
@ -313,14 +312,23 @@ func (ui *MainWindowImpl) createLoginWin(sid, sname string) {
return
}
go func() {
timer := time.NewTimer(10 * time.Second)
for {
timer.Reset(10 * time.Second)
<-timer.C
ui.pttService.Ping(sid, account.Text)
}
}()
// go func() {
// timer := time.NewTimer(10 * time.Second)
// for {
// if !timer.Stop() {
// select {
// case <-timer.C:
// default:
// }
// }
// timer.Reset(10 * time.Second)
// select {
// case <-timer.C:
// ui.pttService.Ping(sid, account.Text)
// continue
// }
// }
// }()
// reset main window title
subTitle := fmt.Sprintf("%s[%s]", sname, sid)
ui.w.SetTitle(fmt.Sprintf(common.APP_WIN_TITLE, subTitle, ui.app.Metadata().Version, ui.app.Metadata().Build, common.APP_NAME))

View File

@ -48,7 +48,7 @@ func (this *ModelSys) validCond(uid string, condData *cfg.GameOpencondData) stri
}
if user.Lv >= conf.Param {
flag = true
}else{
} else {
flag = false
}
case 2: //关卡ID
@ -66,10 +66,10 @@ func (this *ModelSys) validCond(uid string, condData *cfg.GameOpencondData) stri
if v, ok := ex.Mline[1]; ok {
if v >= conf.Param {
flag = true
}else{
} else {
flag = false
}
}else{
} else {
flag = false
}
@ -82,12 +82,13 @@ func (this *ModelSys) validCond(uid string, condData *cfg.GameOpencondData) stri
}
if i, ok := module.(comm.IWorldtask); ok {
d := i.GetMyWorldtask(uid)
if _, ok := d.LastTaskIds[conf.Param]; ok {
for _, v := range d.LastTaskIds {
if v.TaskId >= conf.Param {
flag = true
}else{
flag = false
continue
}
}else{
}
} else {
flag = false
}
}