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