1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00

Remove feature switch for not giving server time in reply

This commit is contained in:
Kane York 2016-04-20 13:45:59 -07:00
parent 74270245ab
commit d7ea9d610b

View file

@ -107,8 +107,6 @@ func callHandler(handler CommandHandler, conn *websocket.Conn, client *ClientInf
return handler(conn, client, cmsg) return handler(conn, client, cmsg)
} }
var lastVersionWithoutReplyWithServerTime = VersionFromString("ffz_3.5.78")
// C2SHello implements the `hello` C2S Command. // C2SHello implements the `hello` C2S Command.
// It calls SubscribeGlobal() and SubscribeDefaults() with the client, and fills out ClientInfo.Version and ClientInfo.ClientID. // 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) { func C2SHello(conn *websocket.Conn, client *ClientInfo, msg ClientMessage) (rmsg ClientMessage, err error) {
@ -130,19 +128,13 @@ func C2SHello(conn *websocket.Conn, client *ClientInfo, msg ClientMessage) (rmsg
SubscribeGlobal(client) SubscribeGlobal(client)
SubscribeDefaults(client) SubscribeDefaults(client)
if client.Version.After(&lastVersionWithoutReplyWithServerTime) { jsTime := float64(time.Now().UnixNano()/1000) / 1000
jsTime := float64(time.Now().UnixNano()/1000) / 1000 return ClientMessage{
return ClientMessage{ Arguments: []interface{}{
Arguments: []interface{}{ client.ClientID.String(),
client.ClientID.String(), jsTime,
jsTime, },
}, }, nil
}, nil
} else {
return ClientMessage{
Arguments: client.ClientID.String(),
}, nil
}
} }
func C2SPing(conn *websocket.Conn, client *ClientInfo, msg ClientMessage) (rmsg ClientMessage, err error) { func C2SPing(conn *websocket.Conn, client *ClientInfo, msg ClientMessage) (rmsg ClientMessage, err error) {