mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
pc terminal can login at same time
This commit is contained in:
parent
9a82dd356c
commit
ed5b215bbb
@ -147,6 +147,11 @@ func (ws *WServer) MultiTerminalLoginCheckerWithLock(uid string, platformID int,
|
||||
defer rwLock.Unlock()
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName(), " rpc args: ", uid, platformID, token)
|
||||
switch config.Config.MultiLoginPolicy {
|
||||
case constant.PCAndOther:
|
||||
if constant.PlatformNameToClass(constant.PlatformIDToName(platformID)) == constant.TerminalPC {
|
||||
return
|
||||
}
|
||||
fallthrough
|
||||
case constant.AllLoginButSameTermKick:
|
||||
if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn]
|
||||
if oldConn, ok := oldConnMap[platformID]; ok {
|
||||
@ -197,6 +202,11 @@ func (ws *WServer) MultiTerminalLoginCheckerWithLock(uid string, platformID int,
|
||||
|
||||
func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int, newConn *UserConn, token string, operationID string) {
|
||||
switch config.Config.MultiLoginPolicy {
|
||||
case constant.PCAndOther:
|
||||
if constant.PlatformNameToClass(constant.PlatformIDToName(platformID)) == constant.TerminalPC {
|
||||
return
|
||||
}
|
||||
fallthrough
|
||||
case constant.AllLoginButSameTermKick:
|
||||
if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn]
|
||||
if oldConn, ok := oldConnMap[platformID]; ok {
|
||||
|
@ -140,6 +140,8 @@ const (
|
||||
WebAndOther = 3
|
||||
//The PC side is mutually exclusive, and the mobile side is mutually exclusive, but the web side can be online at the same time
|
||||
PcMobileAndWeb = 4
|
||||
//The PC terminal can be online at the same time,but other terminal only one of the endpoints can login
|
||||
PCAndOther = 5
|
||||
|
||||
OnlineStatus = "online"
|
||||
OfflineStatus = "offline"
|
||||
|
Loading…
x
Reference in New Issue
Block a user