上传日常任务代码
This commit is contained in:
parent
a2773d3524
commit
898822736d
@ -20,6 +20,7 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (err
|
||||
lv *pb.DBCombatLevel
|
||||
box *cfg.GameCombatBoxData
|
||||
atns []*pb.UserAssets
|
||||
user *pb.DBUser
|
||||
ok bool
|
||||
err error
|
||||
)
|
||||
@ -71,7 +72,7 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (err
|
||||
}
|
||||
return
|
||||
}
|
||||
user, err := this.module.ModuleUser.GetUser(session.GetUserId())
|
||||
user, err = this.module.ModuleUser.GetUser(session.GetUserId())
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
@ -82,7 +83,6 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (err
|
||||
}
|
||||
reward := this.module.ModuleTools.GetGroupDataByLottery(box.Drop, user.Vip, user.Lv)
|
||||
if len(reward) == 0 {
|
||||
//if prop = this.module.configure.GetDropData(itemcf.BoxId); prop == nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
@ -90,7 +90,9 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (err
|
||||
}
|
||||
return
|
||||
}
|
||||
this.module.DispenseRes(session, reward, true)
|
||||
if errdata = this.module.DispenseRes(session, reward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
atns = make([]*pb.UserAssets, len(reward))
|
||||
for i, v := range reward {
|
||||
atns[i] = &pb.UserAssets{
|
||||
|
@ -61,16 +61,14 @@ func (this *Dailytask) OnInstallComp() {
|
||||
// 用户登录
|
||||
func (this *Dailytask) EventUserLogin(session comm.IUserSession) {
|
||||
var (
|
||||
errdata *pb.ErrorData
|
||||
isopen bool
|
||||
isopen bool
|
||||
)
|
||||
|
||||
if db.IsCross() { //跨服不支持
|
||||
return
|
||||
}
|
||||
|
||||
if isopen, errdata = this.ModuleSys.CheckOpenCondCfgById(session.GetUserId(), "annulartask"); isopen {
|
||||
this.Errorln(errdata)
|
||||
if isopen, _ = this.ModuleSys.CheckOpenCondCfgById(session.GetUserId(), "annulartask"); !isopen {
|
||||
return
|
||||
}
|
||||
this.refreshtask(session)
|
||||
|
@ -2,6 +2,7 @@ package sys
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
@ -81,6 +82,21 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
||||
if len(change) > 0 {
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.wtask.OpenCmdNotice(session, change...)
|
||||
//手动激活通知模块
|
||||
for _, m := range change {
|
||||
opencfg, _ := this.module.configure.GetOpenCondCfgById(m)
|
||||
for _, v := range opencfg.Notify {
|
||||
i, err := this.service.GetModule(core.M_Modules(v))
|
||||
if err != nil {
|
||||
this.module.Errorln(err)
|
||||
continue
|
||||
}
|
||||
if ic, ok := i.(comm.IOpenCmdNotice); ok {
|
||||
ic.OpenCmdNotice(session, m)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
@ -948,6 +948,7 @@ func (this *User) BingoSetUserLv(session comm.IUserSession, lv int32) error {
|
||||
)
|
||||
}
|
||||
}
|
||||
this.ModuleSys.CheckOpenCond(session, comm.OpencondTypePlatlv, lv)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user