This commit is contained in:
laodaming 2023-09-05 10:00:01 +08:00
parent 3f9672af6f
commit a395d1972e
2 changed files with 9 additions and 0 deletions

View File

@ -316,6 +316,9 @@ func ConsumeUserPoolData(ctx context.Context) {
// 获取mapUserConnPool唯一id
func getmapUserConnPoolUniqueId(userId, guestId int64) (uniqueId string) {
if userId > 0 {
guestId = 0
}
return fmt.Sprintf("%d_%d", userId, guestId)
}
@ -348,6 +351,9 @@ func (l *DataTransferLogic) checkAuth(r *http.Request) (isAuth bool, userInfo *a
if err != nil {
return false, nil
}
if userInfo.UserId > 0 {
userInfo.GuestId = 0
}
//白板用户
return true, userInfo
}

View File

@ -75,5 +75,8 @@ func (r *reuseConnProcessor) allocationMessage(w *wsConnectItem, data []byte) {
// 获取用户拼接部分(复用标识用到)
func getUserJoinPart(userId, guestId int64, userAgent string) string {
if userId > 0 {
guestId = 0
}
return fmt.Sprintf("|_%d_%d_|_%s_|", userId, guestId, userAgent)
}