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:
parent
74270245ab
commit
d7ea9d610b
1 changed files with 7 additions and 15 deletions
|
@ -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,7 +128,6 @@ 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{}{
|
||||||
|
@ -138,11 +135,6 @@ func C2SHello(conn *websocket.Conn, client *ClientInfo, msg ClientMessage) (rmsg
|
||||||
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) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue