Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
817aa065e6
@ -294,6 +294,11 @@ const (
|
||||
|
||||
)
|
||||
|
||||
//红点枚举
|
||||
type ReddotType int32
|
||||
|
||||
const ()
|
||||
|
||||
type TaskType int32
|
||||
|
||||
// 日常任务事件类型
|
||||
|
@ -113,7 +113,7 @@ type (
|
||||
//创建装备
|
||||
NewEquipment(uid, cid string) (code pb.ErrorCode, equip *pb.DB_Equipment)
|
||||
//添加装备
|
||||
AddEquipment(equip *pb.DB_Equipment) (code pb.ErrorCode)
|
||||
AddEquipment(session IUserSession, equip *pb.DB_Equipment) (code pb.ErrorCode)
|
||||
}
|
||||
IMainline interface {
|
||||
// 修改章节信息
|
||||
|
@ -146,7 +146,7 @@ func (this *Equipment) NewEquipment(uid, cid string) (code pb.ErrorCode, equip *
|
||||
}
|
||||
|
||||
//创建新的装备
|
||||
func (this *Equipment) AddEquipment(equip *pb.DB_Equipment) (code pb.ErrorCode) {
|
||||
func (this *Equipment) AddEquipment(session comm.IUserSession, equip *pb.DB_Equipment) (code pb.ErrorCode) {
|
||||
var (
|
||||
err error
|
||||
)
|
||||
@ -154,6 +154,7 @@ func (this *Equipment) AddEquipment(equip *pb.DB_Equipment) (code pb.ErrorCode)
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
this.equipmentsChangePush(session, []*pb.DB_Equipment{equip})
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -59,9 +59,6 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (code pb
|
||||
}
|
||||
}
|
||||
|
||||
if code = this.module.ConsumeRes(session, need, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
switch req.ShopType {
|
||||
case pb.ShopType_GoldShop:
|
||||
filed = "goldShop"
|
||||
@ -94,13 +91,16 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (code pb
|
||||
return
|
||||
}
|
||||
record.Buy[req.GoodsId] += req.BuyNum
|
||||
if code = this.module.ConsumeRes(session, need, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{filed: record})
|
||||
if !conf.Preview {
|
||||
if code = this.module.DispenseRes(session, give, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if code = this.module.equip.AddEquipment(record.Preview[req.GoodsId]); code == pb.ErrorCode_Success {
|
||||
if code = this.module.equip.AddEquipment(session, record.Preview[req.GoodsId]); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user