1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00

Remove DebugHello

This commit is contained in:
Kane York 2017-09-15 13:45:17 -07:00
parent 9594bda74a
commit 7d5fee46bd

View file

@ -110,31 +110,20 @@ func callHandler(handler CommandHandler, conn *websocket.Conn, client *ClientInf
return handler(conn, client, cmsg)
}
var DebugHello = ""
// C2SHello implements the `hello` C2S Command.
// It calls SubscribeGlobal() and SubscribeDefaults() with the client, and fills out ClientInfo.Version and ClientInfo.ClientID.
func C2SHello(conn *websocket.Conn, client *ClientInfo, msg ClientMessage) (rmsg ClientMessage, err error) {
ary, ok := msg.Arguments.([]interface{})
if !ok {
if DebugHello != "" {
fmt.Println("Hello error: was not an array:", ary)
}
err = ErrExpectedTwoStrings
return
}
if len(ary) != 2 {
if DebugHello != "" {
fmt.Println("Hello error: array wrong length:", ary)
}
err = ErrExpectedTwoStrings
return
}
version, ok := ary[0].(string)
if !ok {
if DebugHello != "" {
fmt.Println("Hello error: version not a string:", ary)
}
err = ErrExpectedTwoStrings
return
}
@ -151,9 +140,6 @@ func C2SHello(conn *websocket.Conn, client *ClientInfo, msg ClientMessage) (rmsg
} else if ary[1] == nil {
clientID = uuid.NewV4()
} else {
if DebugHello != "" {
fmt.Println("Hello error: client id not acceptable:", ary)
}
err = ErrExpectedTwoStrings
return
}