mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-18 23:00:12 +00:00
dice.Roll()
This commit is contained in:
1 parent
d623b1809d
commit
37a9d8ef50
6 files changed
+23
-36
No files matched your search
+2
-6
@@ -1,7 +1,7 @@
|
||||
package vmess
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"github.com/v2ray/v2ray-core/common/dice"
|
||||
)
|
||||
|
||||
type UserLevel byte
|
||||
@@ -39,11 +39,7 @@ func (this *User) AnyValidID() *ID {
|
||||
if len(this.AlterIDs) == 0 {
|
||||
return this.ID
|
||||
}
|
||||
if len(this.AlterIDs) == 1 {
|
||||
return this.AlterIDs[0]
|
||||
}
|
||||
idx := rand.Intn(len(this.AlterIDs))
|
||||
return this.AlterIDs[idx]
|
||||
return this.AlterIDs[dice.Roll(len(this.AlterIDs))]
|
||||
}
|
||||
|
||||
type UserSettings struct {
|
||||
|
||||
Reference in new issue
Block a user