1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-03 08:28:31 +00:00

Fix compile for new version of go-uuid

This commit is contained in:
Kane York 2020-01-31 21:22:28 -08:00
parent 1cb4128478
commit 8f96b0e3e3

View file

@ -139,13 +139,19 @@ func C2SHello(_ *websocket.Conn, client *ClientInfo, msg ClientMessage) (_ Clien
if clientIDStr, ok := ary[1].(string); ok {
clientID = uuid.FromStringOrNil(clientIDStr)
if clientID == uuid.Nil {
clientID = uuid.NewV4()
clientID, err = uuid.NewV4()
if err != nil {
panic(err) // randomness should not fail
}
}
} else if _, ok := ary[1].(bool); ok {
// opt out
clientID = AnonymousClientID
} else if ary[1] == nil {
clientID = uuid.NewV4()
clientID, err = uuid.NewV4()
if err != nil {
panic(err) // randomness should not fail
}
} else {
err = ErrExpectedTwoStrings
return