fix:修复1v1游戏登录IM问题
fix:修复公聊新消息过滤器问题
This commit is contained in:
@@ -2,6 +2,7 @@ package com.chwl.app.game.core
|
|||||||
|
|
||||||
import com.chwl.app.public_chat.core.ChatRoomClient
|
import com.chwl.app.public_chat.core.ChatRoomClient
|
||||||
import com.chwl.app.public_chat.core.ChatRoomClientManager
|
import com.chwl.app.public_chat.core.ChatRoomClientManager
|
||||||
|
import com.chwl.core.manager.IMNetEaseManager
|
||||||
import com.chwl.core.support.listener.ListenerOwner
|
import com.chwl.core.support.listener.ListenerOwner
|
||||||
import com.chwl.core.support.listener.ListenerStore
|
import com.chwl.core.support.listener.ListenerStore
|
||||||
import com.chwl.core.support.listener.SafeListenerOwner
|
import com.chwl.core.support.listener.SafeListenerOwner
|
||||||
@@ -71,6 +72,7 @@ class GameIMEngineAbility(private val listenerOwner: ListenerOwner<GameIMEngineA
|
|||||||
|
|
||||||
private fun exitRoom() {
|
private fun exitRoom() {
|
||||||
logD("exitRoom() id:${chatRoomClient?.sessionId}")
|
logD("exitRoom() id:${chatRoomClient?.sessionId}")
|
||||||
|
IMNetEaseManager.gameChatRoomId = null
|
||||||
chatRoomClient?.onCleared()
|
chatRoomClient?.onCleared()
|
||||||
chatRoomClient = null
|
chatRoomClient = null
|
||||||
}
|
}
|
||||||
@@ -102,6 +104,7 @@ class GameIMEngineAbility(private val listenerOwner: ListenerOwner<GameIMEngineA
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun enterChatRoom(client: ChatRoomClient) {
|
private fun enterChatRoom(client: ChatRoomClient) {
|
||||||
|
IMNetEaseManager.gameChatRoomId = client.sessionId
|
||||||
addDisposable(client.enterChatRoom().subscribe({
|
addDisposable(client.enterChatRoom().subscribe({
|
||||||
}, {
|
}, {
|
||||||
}))
|
}))
|
||||||
|
@@ -141,7 +141,7 @@ open class ChatRoomClient(val sessionId: String) : ICleared, ILog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun exitChatRoom() {
|
fun exitChatRoom() {
|
||||||
logD("exitChatRoom()")
|
logD("exitChatRoom() sessionId:$sessionId")
|
||||||
NIMChatRoomSDK.getChatRoomService().exitChatRoom(sessionId)
|
NIMChatRoomSDK.getChatRoomService().exitChatRoom(sessionId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -267,7 +267,7 @@ public class PublicChatRoomMessageListPanel {
|
|||||||
List<ChatRoomMessage> addedListItems = new ArrayList<>(messages.size());
|
List<ChatRoomMessage> addedListItems = new ArrayList<>(messages.size());
|
||||||
for (ChatRoomMessage message : messages) {
|
for (ChatRoomMessage message : messages) {
|
||||||
|
|
||||||
if (isMyMessage(message) && !filterMessage(message)) {
|
if (isMyMessage(message) && filterMessage(message)) {
|
||||||
items.add(message);
|
items.add(message);
|
||||||
addedListItems.add(message);
|
addedListItems.add(message);
|
||||||
needRefresh = true;
|
needRefresh = true;
|
||||||
@@ -375,10 +375,10 @@ public class PublicChatRoomMessageListPanel {
|
|||||||
if (message.getMsgType() == MsgTypeEnum.custom && message.getAttachment() instanceof HeadlineChangedAttachment) {
|
if (message.getMsgType() == MsgTypeEnum.custom && message.getAttachment() instanceof HeadlineChangedAttachment) {
|
||||||
HeadlineBean data = ((HeadlineChangedAttachment) message.getAttachment()).getHeadlineData();
|
HeadlineBean data = ((HeadlineChangedAttachment) message.getAttachment()).getHeadlineData();
|
||||||
if (data == null || !data.isValid()) {
|
if (data == null || !data.isValid()) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -238,6 +238,10 @@ public final class IMNetEaseManager {
|
|||||||
// 用于网络重连的判断
|
// 用于网络重连的判断
|
||||||
private boolean isNetBroken = false;
|
private boolean isNetBroken = false;
|
||||||
|
|
||||||
|
// 临时方案:解决1V1游戏房被filterAnotherChatRoomInternal误杀问题
|
||||||
|
@Deprecated()
|
||||||
|
public static String gameChatRoomId;
|
||||||
|
|
||||||
private IMNetEaseManager() {
|
private IMNetEaseManager() {
|
||||||
roomProcessor = PublishProcessor.create();
|
roomProcessor = PublishProcessor.create();
|
||||||
relationShipProcessor = PublishProcessor.create();
|
relationShipProcessor = PublishProcessor.create();
|
||||||
@@ -620,6 +624,9 @@ public final class IMNetEaseManager {
|
|||||||
if (Objects.equals(sessionId, String.valueOf(PublicChatHallDataManager.get().getPublicChatHallId()))) {
|
if (Objects.equals(sessionId, String.valueOf(PublicChatHallDataManager.get().getPublicChatHallId()))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (Objects.equals(sessionId, gameChatRoomId)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (Objects.equals(sessionId, InitialModel.get().getPublicChatSessionId())) {
|
if (Objects.equals(sessionId, InitialModel.get().getPublicChatSessionId())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user