Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
c78a491c56
@ -329,5 +329,37 @@
|
|||||||
"n": 100
|
"n": 100
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": 7,
|
||||||
|
"recruitment_type": [],
|
||||||
|
"star3w": 940,
|
||||||
|
"star4w": 52,
|
||||||
|
"star5w": 8,
|
||||||
|
"protect": 100,
|
||||||
|
"p3pool": "pro_pool70003",
|
||||||
|
"p4pool": "pro_pool70004",
|
||||||
|
"p5pool": "pro_pool70005",
|
||||||
|
"n3pool": "base_pool70003",
|
||||||
|
"n4pool": "base_pool70004",
|
||||||
|
"n5pool": "base_pool70005",
|
||||||
|
"baodi4": 10,
|
||||||
|
"baidi5": 100,
|
||||||
|
"etime": -1,
|
||||||
|
"permission": 1,
|
||||||
|
"consumeA": [
|
||||||
|
{
|
||||||
|
"a": "item",
|
||||||
|
"t": "10000024",
|
||||||
|
"n": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"consumeB": [
|
||||||
|
{
|
||||||
|
"a": "item",
|
||||||
|
"t": "10000024",
|
||||||
|
"n": 10
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -231,48 +231,7 @@
|
|||||||
"t": "18000004",
|
"t": "18000004",
|
||||||
"n": 1
|
"n": 1
|
||||||
},
|
},
|
||||||
"Arena_buy": [
|
"Arena_buy": 1001,
|
||||||
{
|
|
||||||
"a": "attr",
|
|
||||||
"t": "diamond",
|
|
||||||
"n": 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"a": "attr",
|
|
||||||
"t": "diamond",
|
|
||||||
"n": 200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"a": "attr",
|
|
||||||
"t": "diamond",
|
|
||||||
"n": 400
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"a": "attr",
|
|
||||||
"t": "diamond",
|
|
||||||
"n": 600
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"a": "attr",
|
|
||||||
"t": "diamond",
|
|
||||||
"n": 800
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"a": "attr",
|
|
||||||
"t": "diamond",
|
|
||||||
"n": 1000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"a": "attr",
|
|
||||||
"t": "diamond",
|
|
||||||
"n": 1200
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"a": "attr",
|
|
||||||
"t": "diamond",
|
|
||||||
"n": 1400
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"VikingExpedition_RecoveryTime": 144,
|
"VikingExpedition_RecoveryTime": 144,
|
||||||
"cops_RecoveryTime": 300,
|
"cops_RecoveryTime": 300,
|
||||||
"cops_InitialNum": 60,
|
"cops_InitialNum": 60,
|
||||||
|
@ -89,5 +89,18 @@
|
|||||||
"n": 250
|
"n": 250
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 8,
|
||||||
|
"pricegroupId": 1001,
|
||||||
|
"purchasemin": 11,
|
||||||
|
"purchasemax": -1,
|
||||||
|
"cost": [
|
||||||
|
{
|
||||||
|
"a": "attr",
|
||||||
|
"t": "diamond",
|
||||||
|
"n": 250
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -905,7 +905,3 @@ const (
|
|||||||
SmithyToolsSkill4 = 4 // 每日顾客数量提升至{0}人
|
SmithyToolsSkill4 = 4 // 每日顾客数量提升至{0}人
|
||||||
SmithyToolsSkill5 = 5 // 顾客购买装备数量上限提高至{0}件
|
SmithyToolsSkill5 = 5 // 顾客购买装备数量上限提高至{0}件
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
ArenaBuyType = 1001 // 价格组ID
|
|
||||||
)
|
|
||||||
|
@ -49,8 +49,8 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.module.modelArena.recoverTicket(session, info)
|
this.module.modelArena.recoverTicket(session, info)
|
||||||
|
pricekey := this.module.ModuleTools.GetGlobalConf().ArenaBuy
|
||||||
if maxbuy, err = this.module.ModuleTools.GetPriceGroupLen(comm.ArenaBuyType); err != nil {
|
if maxbuy, err = this.module.ModuleTools.GetPriceGroupLen(pricekey); err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ConfigNoFound,
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
Title: pb.ErrorCode_CacheReadError.ToString(),
|
Title: pb.ErrorCode_CacheReadError.ToString(),
|
||||||
@ -68,7 +68,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if res, err := this.module.ModuleTools.GetPriceGroupCost(comm.ArenaBuyType, info.Buynum+i+1); len(res) > 0 {
|
if res, err := this.module.ModuleTools.GetPriceGroupCost(pricekey, info.Buynum+i+1); len(res) > 0 {
|
||||||
need = append(need, res...)
|
need = append(need, res...)
|
||||||
} else {
|
} else {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
|
@ -33,7 +33,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.PayInfoReq) (errdat
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if goods, err = this.module.configure.getPayPackageDatas(); err != nil {
|
if goods, err = this.module.configure.getPayPackageDatas(1); 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(),
|
||||||
|
@ -47,7 +47,7 @@ func (this *configureComp) getGameRecharge(id string) (result *cfg.GameRechargeD
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取手动加入频道 任务限制
|
// 获取手动加入频道 任务限制
|
||||||
func (this *configureComp) getPayPackageDatas() (result []*cfg.GamePayPackageData, err error) {
|
func (this *configureComp) getPayPackageDatas(ptype int32) (result []*cfg.GamePayPackageData, err error) {
|
||||||
var (
|
var (
|
||||||
v interface{}
|
v interface{}
|
||||||
)
|
)
|
||||||
@ -55,7 +55,12 @@ func (this *configureComp) getPayPackageDatas() (result []*cfg.GamePayPackageDat
|
|||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
result = v.(*cfg.GamePayPackage).GetDataList()
|
result = make([]*cfg.GamePayPackageData, 0)
|
||||||
|
for _, v := range v.(*cfg.GamePayPackage).GetDataList() {
|
||||||
|
if v.Type == ptype {
|
||||||
|
result = append(result, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -616,7 +616,7 @@ func (this *MCompConfigure) GetPriceGroupCost(pricegroupId int32, purchase int32
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, v := range this._price[pricegroupId] {
|
for _, v := range this._price[pricegroupId] {
|
||||||
if v.Purchasemin <= purchase && purchase <= v.Purchasemax {
|
if v.Purchasemin <= purchase && (purchase <= v.Purchasemax || v.Purchasemax == -1) {
|
||||||
res = v.Cost
|
res = v.Cost
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -628,8 +628,12 @@ func (this *MCompConfigure) GetPriceGroupLen(pricegroupId int32) (count int32, e
|
|||||||
if _, ok := this._price[pricegroupId]; !ok {
|
if _, ok := this._price[pricegroupId]; !ok {
|
||||||
err = comm.NewNotFoundConfErr("tools", game_price, pricegroupId)
|
err = comm.NewNotFoundConfErr("tools", game_price, pricegroupId)
|
||||||
}
|
}
|
||||||
count = int32(len(this._price[pricegroupId]))
|
count = 0
|
||||||
|
for _, v := range this._price[pricegroupId] {
|
||||||
|
if count < v.Purchasemax {
|
||||||
|
count = v.Purchasemax
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ type configureComp struct {
|
|||||||
modules.MCompConfigure
|
modules.MCompConfigure
|
||||||
module *Warorder
|
module *Warorder
|
||||||
lock sync.RWMutex
|
lock sync.RWMutex
|
||||||
|
product map[string]int32 //商品id
|
||||||
order map[int32][]*cfg.GamePassCheckData //战令
|
order map[int32][]*cfg.GamePassCheckData //战令
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,6 +28,12 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *configureComp) getproduct() map[string]int32 {
|
||||||
|
this.lock.RLock()
|
||||||
|
defer this.lock.RUnlock()
|
||||||
|
return this.product
|
||||||
|
}
|
||||||
|
|
||||||
// 读取任务配置表
|
// 读取任务配置表
|
||||||
func (this *configureComp) getPassCheckCfg() (data *cfg.GamePassCheck, err error) {
|
func (this *configureComp) getPassCheckCfg() (data *cfg.GamePassCheck, err error) {
|
||||||
var (
|
var (
|
||||||
@ -51,8 +58,12 @@ func (this *configureComp) updateconfigure() {
|
|||||||
this.module.Error("世界任务配置表异常!")
|
this.module.Error("世界任务配置表异常!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
productConf := make(map[string]int32)
|
||||||
orderConf := make(map[int32][]*cfg.GamePassCheckData)
|
orderConf := make(map[int32][]*cfg.GamePassCheckData)
|
||||||
for _, v := range gwt.GetDataList() {
|
for _, v := range gwt.GetDataList() {
|
||||||
|
if _, ok := productConf[v.PayId]; !ok {
|
||||||
|
productConf[v.PayId] = v.PasscheckType
|
||||||
|
}
|
||||||
if _, ok := orderConf[v.PasscheckType]; !ok {
|
if _, ok := orderConf[v.PasscheckType]; !ok {
|
||||||
orderConf[v.PasscheckType] = make([]*cfg.GamePassCheckData, 0)
|
orderConf[v.PasscheckType] = make([]*cfg.GamePassCheckData, 0)
|
||||||
}
|
}
|
||||||
@ -60,6 +71,7 @@ func (this *configureComp) updateconfigure() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.lock.Lock()
|
this.lock.Lock()
|
||||||
|
this.product = productConf
|
||||||
this.order = orderConf
|
this.order = orderConf
|
||||||
this.lock.Unlock()
|
this.lock.Unlock()
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package warorder
|
package warorder
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
@ -46,6 +47,44 @@ func (this *Warorder) OnInstallComp() {
|
|||||||
|
|
||||||
// 发货
|
// 发货
|
||||||
func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) {
|
func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) {
|
||||||
|
var (
|
||||||
|
product map[string]int32 //商品id
|
||||||
|
warorders *pb.DBWarorders
|
||||||
|
info *pb.Warorder
|
||||||
|
wtype int32
|
||||||
|
err error
|
||||||
|
ok bool
|
||||||
|
)
|
||||||
|
product = this.configure.getproduct()
|
||||||
|
|
||||||
|
if _, ok = product[pid]; !ok {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
|
Title: pb.ErrorCode_ConfigNoFound.String(),
|
||||||
|
Message: fmt.Sprintf("no found pid:%s", pid),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wtype = product[pid]
|
||||||
|
if warorders, err = this.modelWarorder.getUserWarorders(session.GetUserId()); err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_DBError,
|
||||||
|
Title: pb.ErrorCode_DBError.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if info, ok = warorders.Items[wtype]; !ok {
|
||||||
|
info = &pb.Warorder{
|
||||||
|
Vip: false,
|
||||||
|
Free: make([]int32, 0),
|
||||||
|
Pay: make([]int32, 0),
|
||||||
|
Progress: 0,
|
||||||
|
}
|
||||||
|
warorders.Items[wtype] = info
|
||||||
|
}
|
||||||
|
info.Vip = true
|
||||||
|
this.modelWarorder.updateUserWarorders(session.GetUserId(), warorders)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ type GameGlobalData struct {
|
|||||||
ArenaTicketMax int32
|
ArenaTicketMax int32
|
||||||
ArenaTicketRecoveryTime int32
|
ArenaTicketRecoveryTime int32
|
||||||
ArenaTicketCos *Gameatn
|
ArenaTicketCos *Gameatn
|
||||||
ArenaBuy []*Gameatn
|
ArenaBuy int32
|
||||||
VikingExpeditionRecoveryTime int32
|
VikingExpeditionRecoveryTime int32
|
||||||
CopsRecoveryTime int32
|
CopsRecoveryTime int32
|
||||||
CopsInitialNum int32
|
CopsInitialNum int32
|
||||||
@ -503,20 +503,7 @@ func (_v *GameGlobalData)Deserialize(_buf map[string]interface{}) (err error) {
|
|||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ArenaTicket_max"].(float64); !_ok_ { err = errors.New("ArenaTicket_max error"); return }; _v.ArenaTicketMax = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ArenaTicket_max"].(float64); !_ok_ { err = errors.New("ArenaTicket_max error"); return }; _v.ArenaTicketMax = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ArenaTicket_RecoveryTime"].(float64); !_ok_ { err = errors.New("ArenaTicket_RecoveryTime error"); return }; _v.ArenaTicketRecoveryTime = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ArenaTicket_RecoveryTime"].(float64); !_ok_ { err = errors.New("ArenaTicket_RecoveryTime error"); return }; _v.ArenaTicketRecoveryTime = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["ArenaTicket_cos"].(map[string]interface{}); !_ok_ { err = errors.New("ArenaTicket_cos error"); return }; if _v.ArenaTicketCos, err = DeserializeGameatn(_x_); err != nil { return } }
|
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["ArenaTicket_cos"].(map[string]interface{}); !_ok_ { err = errors.New("ArenaTicket_cos error"); return }; if _v.ArenaTicketCos, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||||
{
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Arena_buy"].(float64); !_ok_ { err = errors.New("Arena_buy error"); return }; _v.ArenaBuy = int32(_tempNum_) }
|
||||||
var _arr_ []interface{}
|
|
||||||
var _ok_ bool
|
|
||||||
if _arr_, _ok_ = _buf["Arena_buy"].([]interface{}); !_ok_ { err = errors.New("Arena_buy error"); return }
|
|
||||||
|
|
||||||
_v.ArenaBuy = make([]*Gameatn, 0, len(_arr_))
|
|
||||||
|
|
||||||
for _, _e_ := range _arr_ {
|
|
||||||
var _list_v_ *Gameatn
|
|
||||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
|
|
||||||
_v.ArenaBuy = append(_v.ArenaBuy, _list_v_)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["VikingExpedition_RecoveryTime"].(float64); !_ok_ { err = errors.New("VikingExpedition_RecoveryTime error"); return }; _v.VikingExpeditionRecoveryTime = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["VikingExpedition_RecoveryTime"].(float64); !_ok_ { err = errors.New("VikingExpedition_RecoveryTime error"); return }; _v.VikingExpeditionRecoveryTime = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["cops_RecoveryTime"].(float64); !_ok_ { err = errors.New("cops_RecoveryTime error"); return }; _v.CopsRecoveryTime = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["cops_RecoveryTime"].(float64); !_ok_ { err = errors.New("cops_RecoveryTime error"); return }; _v.CopsRecoveryTime = int32(_tempNum_) }
|
||||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["cops_InitialNum"].(float64); !_ok_ { err = errors.New("cops_InitialNum error"); return }; _v.CopsInitialNum = int32(_tempNum_) }
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["cops_InitialNum"].(float64); !_ok_ { err = errors.New("cops_InitialNum error"); return }; _v.CopsInitialNum = int32(_tempNum_) }
|
||||||
|
Loading…
Reference in New Issue
Block a user