mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-16 09:26:21 -05:00
rename server spec user
This commit is contained in:
parent
c5f09c64a2
commit
922e761bef
@ -62,7 +62,7 @@ func NewServerSpec(newAccount NewAccountFactory, dest v2net.Destination, valid V
|
||||
|
||||
func NewServerSpecFromPB(newAccount NewAccountFactory, spec ServerSpecPB) *ServerSpec {
|
||||
dest := v2net.TCPDestination(spec.Address.AsAddress(), v2net.Port(spec.Port))
|
||||
return NewServerSpec(newAccount, dest, AlwaysValid(), spec.Users...)
|
||||
return NewServerSpec(newAccount, dest, AlwaysValid(), spec.User...)
|
||||
}
|
||||
|
||||
func (this *ServerSpec) Destination() v2net.Destination {
|
||||
|
@ -34,7 +34,7 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
type ServerSpecPB struct {
|
||||
Address *com_v2ray_core_common_net.AddressPB `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"`
|
||||
Port uint32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"`
|
||||
Users []*User `protobuf:"bytes,3,rep,name=users" json:"users,omitempty"`
|
||||
User []*User `protobuf:"bytes,3,rep,name=user" json:"user,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ServerSpecPB) Reset() { *m = ServerSpecPB{} }
|
||||
@ -49,9 +49,9 @@ func (m *ServerSpecPB) GetAddress() *com_v2ray_core_common_net.AddressPB {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ServerSpecPB) GetUsers() []*User {
|
||||
func (m *ServerSpecPB) GetUser() []*User {
|
||||
if m != nil {
|
||||
return m.Users
|
||||
return m.User
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -63,19 +63,18 @@ func init() {
|
||||
func init() { proto.RegisterFile("v2ray.com/core/common/protocol/server_spec.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 209 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x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 0x3f, 0x78, 0xf7, 0xc8, 0x43, 0x42, 0x3a, 0xf9, 0x71, 0x99, 0xfd, 0xaf,
|
||||
0xf3, 0xa8, 0x9e, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xde, 0x92, 0x28, 0x40, 0x5b, 0x01, 0x00,
|
||||
0x00,
|
||||
// 207 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x8e, 0x31, 0x4b, 0xc7, 0x30,
|
||||
0x14, 0xc4, 0x89, 0x2d, 0x2a, 0x51, 0x97, 0x4c, 0xa5, 0x83, 0x14, 0x11, 0xac, 0xcb, 0x8b, 0xd4,
|
||||
0xc5, 0x49, 0xb0, 0x9f, 0xa0, 0xb4, 0xb8, 0xb8, 0x48, 0x4d, 0xdf, 0x66, 0xfa, 0xc2, 0x4b, 0x2c,
|
||||
0xf8, 0x5d, 0xfc, 0xb0, 0x62, 0x62, 0xb6, 0xf2, 0xff, 0x6f, 0xc7, 0x71, 0xbf, 0xbb, 0x93, 0x0f,
|
||||
0x5b, 0xc7, 0xf3, 0x37, 0x18, 0xb2, 0xda, 0x10, 0xa3, 0x36, 0x64, 0x2d, 0xad, 0xda, 0x31, 0x05,
|
||||
0x32, 0xf4, 0xa9, 0x3d, 0xf2, 0x86, 0xfc, 0xee, 0x1d, 0x1a, 0x88, 0xa6, 0xba, 0x36, 0x64, 0x21,
|
||||
0x53, 0x8c, 0x90, 0x08, 0xc8, 0x44, 0x7d, 0xb7, 0xdf, 0xb8, 0x62, 0xd0, 0xf3, 0xb2, 0x30, 0x7a,
|
||||
0x9f, 0xb2, 0xf5, 0xfd, 0x91, 0xe9, 0x2f, 0x8f, 0x9c, 0xa2, 0x37, 0x3f, 0x42, 0x5e, 0x4e, 0xf1,
|
||||
0xc9, 0xe4, 0xd0, 0x0c, 0xbd, 0x7a, 0x96, 0x67, 0xff, 0x65, 0x95, 0x68, 0x44, 0x7b, 0xd1, 0xdd,
|
||||
0xc2, 0xfe, 0xad, 0x15, 0x03, 0xbc, 0xa4, 0xe4, 0xd0, 0x8f, 0x19, 0x52, 0x4a, 0x96, 0x8e, 0x38,
|
||||
0x54, 0x27, 0x8d, 0x68, 0xaf, 0xc6, 0xa8, 0xd5, 0x93, 0x2c, 0xff, 0x26, 0xab, 0xa2, 0x29, 0x0e,
|
||||
0x14, 0xe6, 0x7b, 0xf0, 0xea, 0x91, 0xc7, 0x48, 0xf4, 0xf2, 0xed, 0x3c, 0xdb, 0x1f, 0xa7, 0x51,
|
||||
0x3d, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x38, 0x55, 0xf5, 0x59, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ option go_package = "protocol";
|
||||
message ServerSpecPB {
|
||||
com.v2ray.core.common.net.AddressPB address = 1;
|
||||
uint32 port = 2;
|
||||
repeated com.v2ray.core.common.protocol.User users = 3;
|
||||
repeated com.v2ray.core.common.protocol.User user = 3;
|
||||
}
|
@ -58,7 +58,7 @@ func (this *ClientConfig) UnmarshalJSON(data []byte) error {
|
||||
return err
|
||||
}
|
||||
user.Account = anyAccount
|
||||
server.Users = append(server.Users, user)
|
||||
server.User = append(server.User, user)
|
||||
}
|
||||
this.Server[idx] = server
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ func (this *Config) UnmarshalJSON(data []byte) error {
|
||||
return common.ErrBadConfiguration
|
||||
}
|
||||
user.Account = anyAccount
|
||||
spec.Users = append(spec.Users, user)
|
||||
spec.User = append(spec.User, user)
|
||||
}
|
||||
serverSpecs[idx] = spec
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user