增加地图广播限制速率

This commit is contained in:
1
2025-11-09 06:50:12 +00:00
parent de3fb29407
commit 742bcd8a3f
6 changed files with 39 additions and 11 deletions

View File

@@ -53,7 +53,7 @@ func (h *Controller) MapList(data *maps.ListMapPlayerInboundInfo, c *player.Play
result1 := maps.NewOutInfo()
copier.CopyWithOption(result1, player.GetInfo(), copier.Option{DeepCopy: true})
result.Player = append(result.Player, *result1)
result.Player=LastFourElements(result.Player)
result.Player = LastFourElements(result.Player)
})
c.Canmon = true //可以刷怪
@@ -66,5 +66,5 @@ func LastFourElements[T any](s []T) []T {
return s
}
// 切片长度大于4时返回最后4个元素从n-4索引到末尾
return s[n-4:]
}
return s[n-30:]
}