mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 14:44:15 +00:00
refactor protos
This commit is contained in:
44 files changed
+331
-313
No files matched your search
@@ -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),
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user