feat(config): 更新服务器配置字段注释并修复VIP标识逻辑

- 修改config.go中IsVip字段注释,明确其表示测试服状态
- 添加isdebug字段注释说明本地服标识
- 从.gitignore添加login-login-linux-amd64到忽略列表
- 移除已废弃的coolconfig.SetTest函数

fix(item_buy): 注释掉金币购买功能代码

- 将BuyGoldItem方法注释掉,暂时禁用金币购买商品功能
- 移除未使用的gconv导入包

fix(server): 修正调试模式判断条件

- 将server.go中的IsVip判断改为IsDebug,确保调试模式正确启用

refactor(item_service): 优化模型调用并添加VIP标识

- 修复ItemService.UPDATE方法中模型调用的一致性问题
- 添加is_vip字段到数据记录中用于区分服务器类型

feat(pet_service): 为宠物数据添加VIP标识

- 在宠物服务中为新捕捉的宠物添加IsVip字段设置

```
This commit is contained in:
2026-01-10 02:01:17 +08:00
parent e218d4602f
commit 4cd34f5009
10 changed files with 90 additions and 47 deletions

View File

@@ -6,8 +6,6 @@ import (
"blazing/logic/service/item"
"blazing/logic/service/player"
"github.com/gogf/gf/v2/util/gconv"
)
// 防止封包通过领取来获取道具
@@ -92,34 +90,34 @@ func (h Controller) BuyMultipleItems(data *item.BuyMultiInboundInfo, player *pla
// data: 包含金豆购买商品信息的输入数据
// player: 当前玩家对象
// 返回: 金豆购买结果和错误码
func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, player *player.Player) (result *item.S2C_GoldBuyProductInfo, err errorcode.ErrorCode) {
product, exists := xmlres.GoldProductMap[int(data.ProductID)]
if !exists {
return nil, errorcode.ErrorCodes.ErrSystemError
}
// func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, player *player.Player) (result *item.S2C_GoldBuyProductInfo, err errorcode.ErrorCode) {
// product, exists := xmlres.GoldProductMap[int(data.ProductID)]
// if !exists {
// return nil, errorcode.ErrorCodes.ErrSystemError
// }
useGold := uint32(data.Count) * uint32(gconv.Float64(product.Price)*100)
if !player.UseGold(useGold) {
return &item.S2C_GoldBuyProductInfo{
Gold: player.User.GetGold(uint(player.Info.UserID)),
PayGold: 0,
Reserved: 0,
}, errorcode.ErrorCodes.ErrXinDouInsufficient
}
// useGold := uint32(data.Count) * uint32(gconv.Float64(product.Price)*100)
// if !player.UseGold(useGold) {
// return &item.S2C_GoldBuyProductInfo{
// Gold: player.User.GetGold(uint(player.Info.UserID)),
// PayGold: 0,
// Reserved: 0,
// }, errorcode.ErrorCodes.ErrXinDouInsufficient
// }
addSuccess := player.ItemAdd(uint32(gconv.Uint32(product.ItemID)), uint32(data.Count))
if addSuccess {
player.User.UpdateGold(player.Info.UserID, -int64(useGold))
return &item.S2C_GoldBuyProductInfo{
Gold: player.User.GetGold(uint(player.Info.UserID)),
PayGold: useGold,
Reserved: 0,
}, 0
}
// addSuccess := player.ItemAdd(uint32(gconv.Uint32(product.ItemID)), uint32(data.Count))
// if addSuccess {
// player.User.UpdateGold(player.Info.UserID, -int64(useGold))
// return &item.S2C_GoldBuyProductInfo{
// Gold: player.User.GetGold(uint(player.Info.UserID)),
// PayGold: useGold,
// Reserved: 0,
// }, 0
// }
return &item.S2C_GoldBuyProductInfo{
Gold: player.User.GetGold(uint(player.Info.UserID)),
PayGold: 0,
Reserved: 0,
}, errorcode.ErrorCodes.ErrSystemError
}
// return &item.S2C_GoldBuyProductInfo{
// Gold: player.User.GetGold(uint(player.Info.UserID)),
// PayGold: 0,
// Reserved: 0,
// }, errorcode.ErrorCodes.ErrSystemError
// }