This commit is contained in:
2025-06-27 21:03:23 +08:00
parent 0f29dccec4
commit 54dc7ba173
5 changed files with 188 additions and 11 deletions

View File

@@ -17,16 +17,16 @@ func init() {
}
}
func (m *userManager) Add(cid int32, client *Client) {
func (m *userManager) Add(uid int32, client *Client) {
m.Lock()
defer m.Unlock()
m.userMap[cid] = client
m.userMap[uid] = client
}
func (m *userManager) Delete(cid int32) {
func (m *userManager) Delete(uid int32) {
m.Lock()
defer m.Unlock()
delete(m.userMap, cid)
delete(m.userMap, uid)
}
func (m *userManager) GetAll() map[int32]*Client {