This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
||||||
"github.com/jinzhu/copier"
|
"github.com/jinzhu/copier"
|
||||||
"golang.org/x/time/rate"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// 向其他人广播,不含自己
|
// 向其他人广播,不含自己
|
||||||
@@ -86,14 +85,14 @@ func (s *Space) GetInfo(c common.PlayerI) []info.SimpleInfo {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var limiter = rate.NewLimiter(rate.Limit(10), 5)
|
// var limiter = rate.NewLimiter(rate.Limit(10), 5)
|
||||||
|
|
||||||
func (s *Space) Walk(c common.PlayerI, info *info.WalkOutInfo) {
|
func (s *Space) Walk(c common.PlayerI, info *info.WalkOutInfo) {
|
||||||
// cool.Limiter.Take()
|
// cool.Limiter.Take()
|
||||||
//r := cool.Limiter.Get("Broadcast"+gconv.String(mapid), rate.Limit(10), 5)
|
//r := cool.Limiter.Get("Broadcast"+gconv.String(mapid), rate.Limit(10), 5)
|
||||||
if !limiter.Allow() {
|
// if !limiter.Allow() {
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
s.Broadcast(c, 2101, info)
|
s.Broadcast(c, 2101, info)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user