修正singbox内核hy2用户列表问题

This commit is contained in:
wyx2685
2024-02-21 13:02:13 +09:00
parent 55b20f5550
commit 96b457d679
3 changed files with 8 additions and 6 deletions

View File

@@ -63,20 +63,22 @@ func (b *Sing) AddUsers(p *core.AddUsersParams) (added int, err error) {
us := make([]option.HysteriaUser, len(p.Users))
for i := range p.Users {
us[i] = option.HysteriaUser{
Name: string(p.Users[i].Id),
Name: p.Users[i].Uuid,
AuthString: p.Users[i].Uuid,
}
}
err = b.inbounds[p.Tag].(*inbound.Hysteria).AddUsers(us)
case "hysteria2":
us := make([]option.Hysteria2User, len(p.Users))
id := make([]int, len(p.Users))
for i := range p.Users {
us[i] = option.Hysteria2User{
Name: string(p.Users[i].Id),
Name: p.Users[i].Uuid,
Password: p.Users[i].Uuid,
}
id[i] = p.Users[i].Id
}
err = b.inbounds[p.Tag].(*inbound.Hysteria2).AddUsers(us)
err = b.inbounds[p.Tag].(*inbound.Hysteria2).AddUsers(us, id)
}
if err != nil {
return 0, err