mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-06 06:10:54 +00:00
Fix compile for new version of go-uuid
This commit is contained in:
parent
1cb4128478
commit
8f96b0e3e3
1 changed files with 8 additions and 2 deletions
|
@ -139,13 +139,19 @@ func C2SHello(_ *websocket.Conn, client *ClientInfo, msg ClientMessage) (_ Clien
|
||||||
if clientIDStr, ok := ary[1].(string); ok {
|
if clientIDStr, ok := ary[1].(string); ok {
|
||||||
clientID = uuid.FromStringOrNil(clientIDStr)
|
clientID = uuid.FromStringOrNil(clientIDStr)
|
||||||
if clientID == uuid.Nil {
|
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 {
|
} else if _, ok := ary[1].(bool); ok {
|
||||||
// opt out
|
// opt out
|
||||||
clientID = AnonymousClientID
|
clientID = AnonymousClientID
|
||||||
} else if ary[1] == nil {
|
} else if ary[1] == nil {
|
||||||
clientID = uuid.NewV4()
|
clientID, err = uuid.NewV4()
|
||||||
|
if err != nil {
|
||||||
|
panic(err) // randomness should not fail
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
err = ErrExpectedTwoStrings
|
err = ErrExpectedTwoStrings
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue