ad group logic except somes

This commit is contained in:
GitProtogen
2026-03-23 14:24:53 +01:00
parent 9693e9ee88
commit c679b18f39
6 changed files with 191 additions and 13 deletions
+16 -2
View File
@@ -22,11 +22,11 @@ func CacheGetClientById(id uint32) (*Client, error) {
return client, nil
}
func CacheSetClient(id uint32, client *Client) {
func CacheSetClient(client *Client) {
mu.Lock()
defer mu.Unlock()
CacheClients[id] = client
CacheClients[client.Id] = client
}
func CacheDeleteClient(id uint32) {
@@ -35,3 +35,17 @@ func CacheDeleteClient(id uint32) {
delete(CacheClients, id)
}
func CacheSetGroup() {}
func CacheGetGroup(id uint32) (*Group, error) {
mu.RLock()
defer mu.RUnlock()
group, ok := Groups[id]
if !ok {
return nil, fmt.Errorf("group %d not found", id)
}
return group, nil
}