feat(broadcast): 添加全服广播功能并完善相关逻辑

新增 Broadcast 结构体及 Server 的 Broadcast 方法,用于实现全服广播消息,
并在 RPC 客户端中增加对应接口。同时在 fight 模块中添加聊天信息结构体和处理逻辑。

refactor(pet_skill): 优化宠物技能设置逻辑

修复宠物技能替换判断条件错误的问题,并调整相关逻辑顺序以提高代码可读性与健壮性。

feat(chat): 实现战斗内聊天功能

新增战斗中的聊天指令结构体 ChatInfo 和对应的控制器方法 FightChat,
支持玩家在战斗中发送聊天消息。

refactor(item_buy): 调整金币购买道具的扣费方式

将原直接比较金币数量改为调用
This commit is contained in:
2025-11-25 16:36:55 +08:00
parent 40d72790ff
commit 3e1887c7b8
17 changed files with 115 additions and 30 deletions

View File

@@ -58,7 +58,7 @@ func (h Controller) BuyMItem(data *item.BuyMultiInboundInfo, c *player.Player) (
func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, c *player.Player) (result *item.S2C_GoldBuyProductInfo, err errorcode.ErrorCode) {
r := xmlres.GoldProductMap[int(data.ProductID)]
if uint32(data.Count)*uint32(gconv.Uint32(r.Price)) > c.Info.GoldBean {
if !c.UseGold(uint32(data.Count) * uint32(gconv.Uint32(r.Price))) {
return nil, errorcode.ErrorCodes.ErrSystemError
}
c.ItemAdd(model.ItemInfo{ItemId: uint32(gconv.Uint32(r.ItemID)), ItemCnt: uint32(data.Count)})
@@ -69,6 +69,7 @@ func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, c *player.Playe
PayGold: uint32(data.Count) * uint32(gconv.Uint32(r.Price)),
Reserved: 0,
}
return
}