mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-16 01:56:55 +00:00
Remove relative imports, update main for ratelimiting
This commit is contained in:
parent
055386767f
commit
0da257197f
2 changed files with 7 additions and 6 deletions
|
@ -6,7 +6,8 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"../../server"
|
"github.com/FrankerFaceZ/FrankerFaceZ/socketserver/server"
|
||||||
|
"github.com/FrankerFaceZ/FrankerFaceZ/socketserver/server/rate"
|
||||||
"github.com/abiosoft/ishell"
|
"github.com/abiosoft/ishell"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
@ -33,7 +34,7 @@ func commandLineConsole() {
|
||||||
Command: "message",
|
Command: "message",
|
||||||
Arguments: args[0],
|
Arguments: args[0],
|
||||||
}
|
}
|
||||||
server.PublishToAll(msg)
|
server.PublishToAll(msg, rate.Unlimited())
|
||||||
return "Message sent.", nil
|
return "Message sent.", nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -52,9 +53,9 @@ func commandLineConsole() {
|
||||||
|
|
||||||
var count int
|
var count int
|
||||||
if target == "_ALL" {
|
if target == "_ALL" {
|
||||||
count = server.PublishToAll(msg)
|
count = server.PublishToAll(msg, rate.Unlimited())
|
||||||
} else {
|
} else {
|
||||||
count = server.PublishToChannel(target, msg)
|
count = server.PublishToChannel(target, msg, rate.Unlimited())
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("Published to %d clients", count), nil
|
return fmt.Sprintf("Published to %d clients", count), nil
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package main // import "bitbucket.org/stendec/frankerfacez/socketserver/cmd/ffzsocketserver"
|
package main // import "github.com/FrankerFaceZ/FrankerFaceZ/socketserver/cmd/ffzsocketserver"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
@ -9,7 +9,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"../../server"
|
"github.com/FrankerFaceZ/FrankerFaceZ/socketserver/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
import _ "net/http/pprof"
|
import _ "net/http/pprof"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue