Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
41622f696e
@ -6,7 +6,7 @@ import (
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
// 参数校验
|
||||
func (this *apiComp) DailyBuyCheck(session comm.IUserSession, req *pb.PayDailyBuyReq) (errdata *pb.ErrorData) {
|
||||
if req.Id == 0 {
|
||||
errdata = &pb.ErrorData{
|
||||
@ -18,7 +18,7 @@ func (this *apiComp) DailyBuyCheck(session comm.IUserSession, req *pb.PayDailyBu
|
||||
return
|
||||
}
|
||||
|
||||
///获取系统公告
|
||||
// /获取系统公告
|
||||
func (this *apiComp) DailyBuy(session comm.IUserSession, req *pb.PayDailyBuyReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
info *pb.DBPayDaily
|
||||
@ -46,7 +46,7 @@ func (this *apiComp) DailyBuy(session comm.IUserSession, req *pb.PayDailyBuyReq)
|
||||
return
|
||||
}
|
||||
if info.Items[conf.Id] != nil {
|
||||
if info.Items[conf.Id].Buyunm <= 0 {
|
||||
if conf.BuyNum >= 0 && info.Items[conf.Id].Buyunm >= conf.BuyNum {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_PayBuyNumNotEnough,
|
||||
Title: pb.ErrorCode_PayBuyNumNotEnough.ToString(),
|
||||
|
@ -8,19 +8,19 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
// 参数校验
|
||||
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.PayInfoReq) (errdata *pb.ErrorData) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
///获取系统公告
|
||||
// /获取系统公告
|
||||
func (this *apiComp) Info(session comm.IUserSession, req *pb.PayInfoReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
info *pb.DBPayDaily
|
||||
goods []*cfg.GamePayPackageData
|
||||
conf *cfg.GamePayPackageData
|
||||
err error
|
||||
// conf *cfg.GamePayPackageData
|
||||
err error
|
||||
)
|
||||
if errdata = this.InfoCheck(session, req); errdata != nil {
|
||||
return
|
||||
@ -53,7 +53,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.PayInfoReq) (errdat
|
||||
|
||||
for _, v := range info.Items {
|
||||
if configure.Now().Sub(time.Unix(v.Lastrefresh, 0)).Hours() > 24 {
|
||||
if conf, err = this.module.configure.getPayPackageData(v.Id); err != nil {
|
||||
if _, err = this.module.configure.getPayPackageData(v.Id); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
@ -61,7 +61,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.PayInfoReq) (errdat
|
||||
}
|
||||
return
|
||||
}
|
||||
v.Buyunm = conf.BuyNum
|
||||
v.Buyunm = 0
|
||||
v.Lastrefresh = configure.Now().Unix()
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ const (
|
||||
game_playerinfor_overview = "game_playerinfor_overview.json" //皮肤配置表
|
||||
)
|
||||
|
||||
///配置管理基础组件
|
||||
// /配置管理基础组件
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
module *User
|
||||
@ -29,7 +29,7 @@ type configureComp struct {
|
||||
_pInforoverview map[string]*cfg.GamePlayerInfor_overviewData
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
// 组件初始化接口
|
||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||
this.module = module.(*User)
|
||||
@ -184,13 +184,11 @@ func (this *configureComp) GetPlayerOverview(id string, sex int32) (configure *c
|
||||
key string
|
||||
ok bool
|
||||
)
|
||||
sex += 1
|
||||
key = fmt.Sprintf("%s%d", id, sex)
|
||||
if configure, ok = this._pInforoverview[key]; !ok {
|
||||
err = comm.NewNotFoundConfErr("用户模块", game_playerinfor_overview, key)
|
||||
this.module.Errorf("err:%v", err)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -453,14 +453,26 @@ func (this *Worldtask) AcceptCaravanTask(session comm.IUserSession, groupId int3
|
||||
mytask.CurrentTasks = make(map[int32]*pb.Worldtasks)
|
||||
}
|
||||
|
||||
if v, ok1 := mytask.CurrentTasks[curTaskConf.Group]; ok1 {
|
||||
v.TaskMap[task.TaskId] = &pb.Worldtask{
|
||||
TaskId: task.TaskId,
|
||||
TaskType: curTaskConf.Des,
|
||||
NpcStatus: 1,
|
||||
if _, ok1 := mytask.CurrentTasks[curTaskConf.Group]; !ok1 {
|
||||
mytask.CurrentTasks[curTaskConf.Group] = &pb.Worldtasks{
|
||||
TaskMap: make(map[int32]*pb.Worldtask),
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
mytask.CurrentTasks[curTaskConf.Group].TaskMap[task.TaskId] = &pb.Worldtask{
|
||||
TaskId: task.TaskId,
|
||||
TaskType: curTaskConf.Des,
|
||||
NpcStatus: 1,
|
||||
}
|
||||
if err = this.ModuleBuried.ActiveCondition(uid, curTaskConf.Completetask...); err != nil {
|
||||
log.Errorf("调用接口错误:%s", err.Error())
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ExternalModule,
|
||||
Title: pb.ErrorCode_ExternalModule.String(),
|
||||
Message: fmt.Sprintf("ModuleBuried.ActiveCondition err:%s", err.Error()),
|
||||
}
|
||||
return
|
||||
}
|
||||
if task.Conds, err = this.ModuleBuried.CheckCondition(uid, curTaskConf.Completetask...); err != nil {
|
||||
log.Errorf("调用接口错误:%s", err.Error())
|
||||
errdata = &pb.ErrorData{
|
||||
|
Loading…
Reference in New Issue
Block a user