This commit is contained in:
@@ -97,16 +97,23 @@ func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, player *player.
|
||||
if pro == nil {
|
||||
return nil, errorcode.ErrorCodes.ErrTooManyProducts
|
||||
}
|
||||
|
||||
if pro.QuotaType != 0 {
|
||||
if data.Count > int64(pro.QuotaLimit) {
|
||||
return nil, errorcode.ErrorCodes.ErrExceedStock
|
||||
}
|
||||
if player.Service.GoldLog.Cheak(pro.QuotaLimit-uint32(data.Count), data.ProductID, pro.QuotaType-1) {
|
||||
config := service.NewTalkConfigService().GetCache(int(data.ProductID))
|
||||
if config != nil {
|
||||
_, is := player.Service.Talk.Cheak(0, int(data.ProductID))
|
||||
if !is {
|
||||
return nil, errorcode.ErrorCodes.ErrExceedStock
|
||||
}
|
||||
}
|
||||
|
||||
// if pro.QuotaType != 0 {
|
||||
// if data.Count > int64(pro.QuotaLimit) {
|
||||
// return nil, errorcode.ErrorCodes.ErrExceedStock
|
||||
// }
|
||||
// if player.Service.Talk.Cheak(0, int(data.ProductID)) {
|
||||
// return nil, errorcode.ErrorCodes.ErrExceedStock
|
||||
// }
|
||||
// }
|
||||
|
||||
var usegold uint64
|
||||
var addSuccess bool
|
||||
switch data.Type {
|
||||
@@ -142,7 +149,7 @@ func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, player *player.
|
||||
case 1:
|
||||
player.User.UpdateGold(player.Info.UserID, -int64(usegold))
|
||||
//购买成功,执行记录
|
||||
player.Service.GoldLog.Log(uint32(pro.ProductID), uint32(data.Count))
|
||||
player.Service.Talk.Update(int(pro.ProductID), int(data.Count))
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,6 @@ func (h Controller) GetTalkCategory(data *item.TalkCateInboundInfo, c *player.Pl
|
||||
|
||||
}
|
||||
}
|
||||
c.Service.Talk.Update(int(data.ID))
|
||||
c.Service.Talk.Update(int(data.ID), 1)
|
||||
return result, 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user