mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-15 17:46:55 +00:00
fix marshalling emote usage, log non-hello first messages
This commit is contained in:
parent
9f1c369fdb
commit
59ba6d52f6
2 changed files with 7 additions and 1 deletions
|
@ -287,7 +287,12 @@ func DoSendAggregateData() {
|
||||||
reportForm.Set("follows", string(followJson))
|
reportForm.Set("follows", string(followJson))
|
||||||
}
|
}
|
||||||
|
|
||||||
emoteJson, err := json.Marshal(emoteUsage)
|
strEmoteUsage := make(map[string]map[string]int)
|
||||||
|
for emoteId, usageByChannel := range emoteUsage {
|
||||||
|
strEmoteId := strconv.Itoa(emoteId)
|
||||||
|
strEmoteUsage[strEmoteId] = usageByChannel
|
||||||
|
}
|
||||||
|
emoteJson, err := json.Marshal(strEmoteUsage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -199,6 +199,7 @@ RunLoop:
|
||||||
|
|
||||||
case msg := <-clientChan:
|
case msg := <-clientChan:
|
||||||
if client.Version == "" && msg.Command != HelloCommand {
|
if client.Version == "" && msg.Command != HelloCommand {
|
||||||
|
log.Println("error - first message wasn't hello from", conn.RemoteAddr(), "-", msg)
|
||||||
CloseConnection(conn, &websocket.CloseError{
|
CloseConnection(conn, &websocket.CloseError{
|
||||||
Text: "Error - the first message sent must be a 'hello'",
|
Text: "Error - the first message sent must be a 'hello'",
|
||||||
Code: websocket.ClosePolicyViolation,
|
Code: websocket.ClosePolicyViolation,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue