1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-12 17:10:54 +00:00

Add ratelimits to publishing

This commit is contained in:
Kane York 2017-02-02 22:59:17 -08:00
parent b84bd1d4a2
commit 50e295c834
10 changed files with 260 additions and 103 deletions

View file

@ -130,38 +130,6 @@ func RemoveFromSliceS(ary *[]string, val string) bool {
return true
}
func AddToSliceC(ary *[]chan<- ClientMessage, val chan<- ClientMessage) bool {
slice := *ary
for _, v := range slice {
if v == val {
return false
}
}
slice = append(slice, val)
*ary = slice
return true
}
func RemoveFromSliceC(ary *[]chan<- ClientMessage, val chan<- ClientMessage) bool {
slice := *ary
var idx int = -1
for i, v := range slice {
if v == val {
idx = i
break
}
}
if idx == -1 {
return false
}
slice[idx] = slice[len(slice)-1]
slice = slice[:len(slice)-1]
*ary = slice
return true
}
func AddToSliceCl(ary *[]*ClientInfo, val *ClientInfo) bool {
slice := *ary
for _, v := range slice {