1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-06 01:05:35 -05:00

rename VMessAccount to vmess.Account

This commit is contained in:
v2ray
2016-07-25 17:36:24 +02:00
parent 2049759640
commit 2034d54bab
17 changed files with 288 additions and 274 deletions

View File

@@ -1,30 +1,5 @@
package protocol
import (
"github.com/v2ray/v2ray-core/common/dice"
)
type Account interface {
Equals(Account) bool
}
type VMessAccount struct {
ID *ID
AlterIDs []*ID
}
func (this *VMessAccount) AnyValidID() *ID {
if len(this.AlterIDs) == 0 {
return this.ID
}
return this.AlterIDs[dice.Roll(len(this.AlterIDs))]
}
func (this *VMessAccount) Equals(account Account) bool {
vmessAccount, ok := account.(*VMessAccount)
if !ok {
return false
}
// TODO: handle AlterIds difference
return this.ID.Equals(vmessAccount.ID)
}