refactor protos

This commit is contained in:
Darien Raymond committed 2016-10-12 18:43:55 +02:00
1 parent c1f91567ad
commit fc6a706166
44 files changed
+331 -313

No files matched your search

+3 -3
View File
@@ -22,11 +22,11 @@ func (this *VMessInboundHandler) generateCommand(request *protocol.RequestHeader
if user == nil {
return nil
}
account, _ := user.GetTypedAccount(&vmess.AccountPB{})
account, _ := user.GetTypedAccount(&vmess.Account{})
return &protocol.CommandSwitchAccount{
Port: inboundHandler.Port(),
ID: account.(*vmess.Account).ID.UUID(),
AlterIds: uint16(len(account.(*vmess.Account).AlterIDs)),
ID: account.(*vmess.InternalAccount).ID.UUID(),
AlterIds: uint16(len(account.(*vmess.InternalAccount).AlterIDs)),
Level: user.Level,
ValidMin: byte(availableMin),
}
+1 -1
View File
@@ -77,7 +77,7 @@ func (this *Config) UnmarshalJSON(data []byte) error {
if err := json.Unmarshal(rawData, user); err != nil {
return errors.New("VMess|Inbound: Invalid user: " + err.Error())
}
account := new(vmess.AccountPB)
account := new(vmess.Account)
if err := json.Unmarshal(rawData, account); err != nil {
return errors.New("VMess|Inbound: Invalid user: " + err.Error())
}
+1 -1
View File
@@ -53,7 +53,7 @@ func (this *userByEmail) Get(email string) (*protocol.User, bool) {
this.Lock()
user, found = this.cache[email]
if !found {
account := &vmess.AccountPB{
account := &vmess.Account{
Id: uuid.New().String(),
AlterId: uint32(this.defaultAlterIDs),
}