mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 12:40:11 +00:00
修复Sing内核trojan用户列表BUG、修复用户设备限制不生效
This commit is contained in:
@@ -57,7 +57,7 @@ func (c *Client) GetUserList() (UserList []UserInfo, err error) {
|
||||
c.userEtag = r.Header().Get("ETag")
|
||||
|
||||
var userinfos []UserInfo
|
||||
var localDeviceLimit int = 0
|
||||
var deviceLimit, localDeviceLimit int = 0, 0
|
||||
for _, user := range userList.Users {
|
||||
// If there is still device available, add the user
|
||||
if user.DeviceLimit > 0 && user.AliveIp > 0 {
|
||||
@@ -68,13 +68,14 @@ func (c *Client) GetUserList() (UserList []UserInfo, err error) {
|
||||
// If there are any available device.
|
||||
localDeviceLimit = user.DeviceLimit - user.AliveIp + lastOnline
|
||||
if localDeviceLimit > 0 {
|
||||
|
||||
deviceLimit = localDeviceLimit
|
||||
} else if lastOnline > 0 {
|
||||
|
||||
deviceLimit = lastOnline
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
user.DeviceLimit = deviceLimit
|
||||
userinfos = append(userinfos, user)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user