diff --git a/web.go b/web.go index 50bb4f0..a478e04 100644 --- a/web.go +++ b/web.go @@ -53,7 +53,12 @@ func GetWebAddress(user *gumble.User) { if client_token[user.Name] != "" { token_client[client_token[user.Name]] = "" } - client_token[user.Name] = randSeq(10) + // dealing with collisions + var firstLoop = true + for !firstLoop && token_client[client_token[user.Name]] == "" { + client_token[user.Name] = randSeq(10) + firstLoop = false + } token_client[client_token[user.Name]] = user.Name dj.SendPrivateMessage(user, fmt.Sprintf(WEB_ADDRESS, getIP(), client_token[user.Name], getIP(), client_token[user.Name])) }