```
feat(fight): 添加战斗准备完成广播消息 在 ReadyFight 方法中增加对所有玩家的广播,发送玩家准备完成的消息。 新增 S2C_2404 结构体用于通知客户端指定用户已准备完成, 若为野怪则 userID 设置为 0。 ```
This commit is contained in:
@@ -129,7 +129,10 @@ func (f *FightC) UseItem(c common.PlayerI, cacthid, itemid uint32) {
|
||||
|
||||
// ReadyFight 处理玩家战斗准备逻辑,当满足条件时启动战斗循环
|
||||
func (f *FightC) ReadyFight(c common.PlayerI) {
|
||||
f.Broadcast(func(ff *input.Input) {
|
||||
|
||||
ff.Player.SendPackCmd(2404, &info.S2C_2404{UserID: c.GetInfo().UserID})
|
||||
})
|
||||
// 2. 标记当前玩家已准备完成
|
||||
input := f.GetInputByPlayer(c, false)
|
||||
input.Finished = true
|
||||
|
||||
@@ -200,6 +200,10 @@ type FightUserInfo struct {
|
||||
// 使用[16]byte存储固定长度的字节数组
|
||||
Nick string `struc:"[16]byte"`
|
||||
}
|
||||
type S2C_2404 struct {
|
||||
// 用户ID(野怪为0),@UInt long
|
||||
UserID uint32 `fieldDesc:"userID 如果为野怪则为0" `
|
||||
}
|
||||
|
||||
// NoteReadyToFightInfo 战斗准备就绪消息结构体,NoteReadyToFightInfo
|
||||
type NoteReadyToFightInfo struct {
|
||||
|
||||
Reference in New Issue
Block a user