|
|
@ -377,8 +377,12 @@ func (ws *WServer) delUserConn(conn *UserConn) {
|
|
|
|
platform = k
|
|
|
|
platform = k
|
|
|
|
uid = v
|
|
|
|
uid = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if oldConnMap, ok := ws.wsUserToConn[uid]; ok {
|
|
|
|
if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // only recycle self conn
|
|
|
|
delete(oldConnMap, platform)
|
|
|
|
if oldconn, okMap := oldConnMap[platform]; okMap {
|
|
|
|
|
|
|
|
if oldconn == conn {
|
|
|
|
|
|
|
|
delete(oldConnMap, platform)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
ws.wsUserToConn[uid] = oldConnMap
|
|
|
|
ws.wsUserToConn[uid] = oldConnMap
|
|
|
|
if len(oldConnMap) == 0 {
|
|
|
|
if len(oldConnMap) == 0 {
|
|
|
|
delete(ws.wsUserToConn, uid)
|
|
|
|
delete(ws.wsUserToConn, uid)
|
|
|
|