fix[修复-游戏房消息问题]
This commit is contained in:
@@ -53,6 +53,15 @@ public class SudGameSocketImEvent extends BaseModel {
|
||||
private String method;
|
||||
@SerializedName("equipment")
|
||||
private String equipment;
|
||||
private String time;
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
|
||||
@@ -433,6 +433,8 @@ public class GameSwMicManager {
|
||||
});
|
||||
}
|
||||
|
||||
String lastTime = "";
|
||||
|
||||
/**
|
||||
* 处理游戏房Im消息
|
||||
*/
|
||||
@@ -441,6 +443,11 @@ public class GameSwMicManager {
|
||||
List<SudGameSocketImEvent.MsgDTO> msgDTOS = socketImModel.getMsg();
|
||||
if (msgDTOS.isEmpty()) return;
|
||||
SudGameSocketImEvent.MsgDTO msgDTO = msgDTOS.get(0);
|
||||
|
||||
if(lastTime.equals(msgDTO.getTime())){
|
||||
return;
|
||||
}
|
||||
lastTime = msgDTO.getTime();
|
||||
//正常文字消息
|
||||
if (TextUtils.equals(msgDTO.getMethod(), "SendMsg")) {
|
||||
getView().insertItem(new SudGameChatImModel().setWelcomMessage(false).setNickname(msgDTO.getUname()).setTextMessage(msgDTO.getCt()));
|
||||
@@ -498,6 +505,7 @@ public class GameSwMicManager {
|
||||
String contentJson = ((TextMessage) message.getContent()).getContent();
|
||||
Log.e("wewe", contentJson);
|
||||
SudGameSocketImEvent sudGameSocketImEvent = new Gson().fromJson(contentJson, SudGameSocketImEvent.class);
|
||||
sudGameSocketImEvent.getMsg().get(0).setTime("11");
|
||||
processingMessage(sudGameSocketImEvent);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user