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:
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 {
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue