This commit is contained in:
meixiongfeng 2023-04-27 22:38:39 +08:00
commit 33753050ce
6 changed files with 74 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import (
"strings" "strings"
"fyne.io/fyne/v2" "fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -36,5 +37,18 @@ func (this *SysFuncListView) CreateView(t *model.TestCase) fyne.CanvasObject {
} }
logrus.WithFields(logrus.Fields{"mainType": t.MainType, "subType": t.SubType, "params": req}).Info("功能开启列表") logrus.WithFields(logrus.Fields{"mainType": t.MainType, "subType": t.SubType, "params": req}).Info("功能开启列表")
} }
return this.form
newBtn := widget.NewButton("新的", func() {
if err := service.GetPttService().SendToClient(
t.MainType,
"funcgetlist",
&pb.SysFuncGetListReq{Keys: []string{"pavilion_kick"}},
); err != nil {
logrus.Error(err)
return
}
})
c := container.NewBorder(newBtn, nil, nil, nil, this.form)
return c
} }

View File

@ -475,4 +475,10 @@ type (
// 声望升级 返回声望等级 // 声望升级 返回声望等级
Upgrade(session IUserSession, raceType int32, fv int32) (lv int32) Upgrade(session IUserSession, raceType int32, fv int32) (lv int32)
} }
// 关卡编辑器
ICombat interface {
// 获取关卡状态
GetLevelStatus(uid string, levelId int32) bool
}
) )

View File

@ -6,6 +6,7 @@ import (
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/event" "go_dreamfactory/lego/sys/event"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb"
) )
/* /*
@ -27,12 +28,12 @@ type Combat struct {
modelCombat *modelCombatComp modelCombat *modelCombatComp
} }
//模块名 // 模块名
func (this *Combat) GetType() core.M_Modules { func (this *Combat) GetType() core.M_Modules {
return comm.ModuleCombat return comm.ModuleCombat
} }
//模块初始化接口 注册用户创建角色事件 // 模块初始化接口 注册用户创建角色事件
func (this *Combat) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { func (this *Combat) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options) err = this.ModuleBase.Init(service, module, options)
this.service = service.(base.IRPCXService) this.service = service.(base.IRPCXService)
@ -50,7 +51,7 @@ func (this *Combat) Start() (err error) {
return return
} }
//装备组件 // 装备组件
func (this *Combat) OnInstallComp() { func (this *Combat) OnInstallComp() {
this.ModuleBase.OnInstallComp() this.ModuleBase.OnInstallComp()
this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp) this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp)
@ -58,7 +59,21 @@ func (this *Combat) OnInstallComp() {
this.configure = this.RegisterComp(new(configureComp)).(*configureComp) this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
} }
//Event------------------------------------------------------------------------------------------------------------ // Event------------------------------------------------------------------------------------------------------------
func (this *Combat) EventUserOffline(uid, sessionid string) { func (this *Combat) EventUserOffline(uid, sessionid string) {
this.modelCombat.delInfo(uid) this.modelCombat.delInfo(uid)
} }
func (this *Combat) GetLevelStatus(uid string, levelId int32) bool {
combat := &pb.DBCombatUser{}
if err := this.modelCombat.Get(uid, combat); err != nil {
return false
}
if combat != nil {
if v, ok := combat.Level[levelId]; ok {
return v.Pass
}
}
return false
}

View File

@ -2,6 +2,7 @@ package oldtimes
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
) )
@ -15,6 +16,25 @@ func (this *apiComp) Getall(session comm.IUserSession, req *pb.OldtimesGetallReq
rsp := &pb.OldtimesGetallResp{} rsp := &pb.OldtimesGetallResp{}
d := this.module.modelOldtimes.getDBOldtimes(uid) d := this.module.modelOldtimes.getDBOldtimes(uid)
if imodule, err := this.service.GetModule(comm.ModuleCombat); err == nil {
if combat, ok := imodule.(comm.ICombat); ok {
for _, chapter := range d.Chapters {
for _, level := range chapter.Levels {
conf := this.module.configure.getMaintaskCfgBy(level.Lid)
if conf != nil {
if combat.GetLevelStatus(uid, conf.Stageid) {
level.Status = int32(finish)
if err := this.module.modelOldtimes.updateOldtimes(uid, d); err != nil {
this.module.Error("oldtime更新失败",
log.Field{Key: "uid", Value: uid})
}
}
}
}
}
}
}
rsp.Data = d rsp.Data = d
session.SendMsg(string(this.module.GetType()), "getall", rsp) session.SendMsg(string(this.module.GetType()), "getall", rsp)
return return

View File

@ -41,6 +41,19 @@ func (this *configureComp) getMaintaskCfg() (data *cfg.GameLinestoryMainTask, er
return return
} }
func (this *configureComp) getMaintaskCfgBy(id int32) (data *cfg.GameLinestoryMainTaskData) {
glmt, err := this.getMaintaskCfg()
if err != nil {
return nil
}
if glmt != nil {
data = glmt.GetDataMap()[id]
return data
}
return data
}
func (this *configureComp) getTimelineCfg() (data *cfg.GameLinestoryTimeLine, err error) { func (this *configureComp) getTimelineCfg() (data *cfg.GameLinestoryTimeLine, err error) {
var ( var (
v interface{} v interface{}

View File

@ -82,7 +82,7 @@ type Chapter struct {
Cid int32 `protobuf:"varint,1,opt,name=cid,proto3" json:"cid" bson:"cid"` //章节ID Cid int32 `protobuf:"varint,1,opt,name=cid,proto3" json:"cid" bson:"cid"` //章节ID
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status" bson:"status"` //状态 0锁定 1已解锁 2进行中 3已完成 Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status" bson:"status"` //状态 0锁定 1已解锁 2进行中 3已完成
Received int32 `protobuf:"varint,3,opt,name=received,proto3" json:"received" bson:"received"` //奖励领取状态 Received int32 `protobuf:"varint,3,opt,name=received,proto3" json:"received" bson:"received"` //奖励领取状态0未领取 1已领取
Levels []*Level `protobuf:"bytes,4,rep,name=levels,proto3" json:"levels" bson:"levels"` //关卡 Levels []*Level `protobuf:"bytes,4,rep,name=levels,proto3" json:"levels" bson:"levels"` //关卡
} }