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

server spec

This commit is contained in:
v2ray
2016-07-24 23:22:46 +02:00
parent 03af6e6856
commit 7dfa852677
3 changed files with 181 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import (
)
type Account interface {
Equals(Account) bool
}
type VMessAccount struct {
@@ -18,3 +19,12 @@ func (this *VMessAccount) AnyValidID() *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)
}