上传日常任务代码
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
|
lv *pb.DBCombatLevel
|
||||||
box *cfg.GameCombatBoxData
|
box *cfg.GameCombatBoxData
|
||||||
atns []*pb.UserAssets
|
atns []*pb.UserAssets
|
||||||
|
user *pb.DBUser
|
||||||
ok bool
|
ok bool
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
@ -71,7 +72,7 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (err
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
user, err := this.module.ModuleUser.GetUser(session.GetUserId())
|
user, err = this.module.ModuleUser.GetUser(session.GetUserId())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_DBError,
|
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)
|
reward := this.module.ModuleTools.GetGroupDataByLottery(box.Drop, user.Vip, user.Lv)
|
||||||
if len(reward) == 0 {
|
if len(reward) == 0 {
|
||||||
//if prop = this.module.configure.GetDropData(itemcf.BoxId); prop == nil {
|
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ConfigNoFound,
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||||
@ -90,7 +90,9 @@ func (this *apiComp) Drop(session comm.IUserSession, req *pb.CombatDropReq) (err
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.module.DispenseRes(session, reward, true)
|
if errdata = this.module.DispenseRes(session, reward, true); errdata != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
atns = make([]*pb.UserAssets, len(reward))
|
atns = make([]*pb.UserAssets, len(reward))
|
||||||
for i, v := range reward {
|
for i, v := range reward {
|
||||||
atns[i] = &pb.UserAssets{
|
atns[i] = &pb.UserAssets{
|
||||||
|
@ -61,7 +61,6 @@ func (this *Dailytask) OnInstallComp() {
|
|||||||
// 用户登录
|
// 用户登录
|
||||||
func (this *Dailytask) EventUserLogin(session comm.IUserSession) {
|
func (this *Dailytask) EventUserLogin(session comm.IUserSession) {
|
||||||
var (
|
var (
|
||||||
errdata *pb.ErrorData
|
|
||||||
isopen bool
|
isopen bool
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -69,8 +68,7 @@ func (this *Dailytask) EventUserLogin(session comm.IUserSession) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if isopen, errdata = this.ModuleSys.CheckOpenCondCfgById(session.GetUserId(), "annulartask"); isopen {
|
if isopen, _ = this.ModuleSys.CheckOpenCondCfgById(session.GetUserId(), "annulartask"); !isopen {
|
||||||
this.Errorln(errdata)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.refreshtask(session)
|
this.refreshtask(session)
|
||||||
|
@ -2,6 +2,7 @@ package sys
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -81,6 +82,21 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
|||||||
if len(change) > 0 {
|
if len(change) > 0 {
|
||||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||||
this.module.wtask.OpenCmdNotice(session, change...)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user