mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3deccaae00 |
@@ -45,6 +45,10 @@ func (h *Hysteria2) DelUsers(users []panel.UserInfo, tag string, _ *panel.NodeIn
|
||||
var wg sync.WaitGroup
|
||||
for _, user := range users {
|
||||
wg.Add(1)
|
||||
if v, ok := h.Hy2nodes[tag].TrafficLogger.(*HookServer).Counter.Load(tag); ok {
|
||||
c := v.(*counter.TrafficCounter)
|
||||
c.Delete(user.Uuid)
|
||||
}
|
||||
go func(u panel.UserInfo) {
|
||||
defer wg.Done()
|
||||
h.Auth.mutex.Lock()
|
||||
@@ -76,6 +80,10 @@ func (h *Hysteria2) GetUserTrafficSlice(tag string, reset bool) ([]panel.UserTra
|
||||
traffic.UpCounter.Store(0)
|
||||
traffic.DownCounter.Store(0)
|
||||
}
|
||||
if h.Auth.usersMap[uuid] == 0 {
|
||||
c.Delete(uuid)
|
||||
return true
|
||||
}
|
||||
trafficSlice = append(trafficSlice, panel.UserTraffic{
|
||||
UID: h.Auth.usersMap[uuid],
|
||||
Upload: up,
|
||||
|
||||
@@ -151,6 +151,10 @@ func (b *Sing) GetUserTrafficSlice(tag string, reset bool) ([]panel.UserTraffic,
|
||||
traffic.UpCounter.Store(0)
|
||||
traffic.DownCounter.Store(0)
|
||||
}
|
||||
if b.users.uidMap[uuid] == 0 {
|
||||
c.Delete(uuid)
|
||||
return true
|
||||
}
|
||||
trafficSlice = append(trafficSlice, panel.UserTraffic{
|
||||
UID: b.users.uidMap[uuid],
|
||||
Upload: up,
|
||||
@@ -199,6 +203,10 @@ func (b *Sing) DelUsers(users []panel.UserInfo, tag string, info *panel.NodeInfo
|
||||
b.users.mapLock.Lock()
|
||||
defer b.users.mapLock.Unlock()
|
||||
for i := range users {
|
||||
if v, ok := b.hookServer.counter.Load(tag); ok {
|
||||
c := v.(*counter.TrafficCounter)
|
||||
c.Delete(users[i].Uuid)
|
||||
}
|
||||
delete(b.users.uidMap, users[i].Uuid)
|
||||
uuids[i] = users[i].Uuid
|
||||
}
|
||||
|
||||
@@ -73,6 +73,10 @@ func (x *Xray) GetUserTrafficSlice(tag string, reset bool) ([]panel.UserTraffic,
|
||||
traffic.UpCounter.Store(0)
|
||||
traffic.DownCounter.Store(0)
|
||||
}
|
||||
if x.users.uidMap[email] == 0 {
|
||||
c.Delete(email)
|
||||
return true
|
||||
}
|
||||
trafficSlice = append(trafficSlice, panel.UserTraffic{
|
||||
UID: x.users.uidMap[email],
|
||||
Upload: up,
|
||||
|
||||
Reference in New Issue
Block a user