mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Singleton from "../../../extensions/ngame/assets/ngame/util/Singleton";
|
||||
import { app } from "../App";
|
||||
import { GAction } from "../consts/GAction";
|
||||
import { GActionType, GUIChatMessage } from "../consts/GActionType";
|
||||
import { GActionType, GUIChatMessage, GUIChatMessageDTO } from "../consts/GActionType";
|
||||
import BaseData from "./BaseData";
|
||||
|
||||
//聊天数据
|
||||
@@ -10,18 +10,18 @@ export default class ChatData extends BaseData{
|
||||
static Event = "ChatData_Event_Message";
|
||||
|
||||
//世界消息列表
|
||||
datas:string[] = [];
|
||||
datas:GUIChatMessageDTO[] = [];
|
||||
|
||||
onInit() {
|
||||
//监听聊天消息
|
||||
app.socket.on(GAction.CHAT_RECEIVE_MESSAGE,this.onChatReceiveMessage,this,GActionType.GUIChatMessage);
|
||||
app.socket.on(GAction.CHAT_RECEIVE_MESSAGE,this.onChatReceiveMessage,this,GActionType.GUIChatMessageDTO);
|
||||
}
|
||||
|
||||
|
||||
//接受聊天消息
|
||||
onChatReceiveMessage(info:GUIChatMessage){
|
||||
onChatReceiveMessage(info:GUIChatMessageDTO){
|
||||
console.log(`ChatData - onChatReceiveMessage`,info.message);
|
||||
this.datas.push(info.message);
|
||||
this.datas.push(info);
|
||||
app.event.emit(ChatData.Event,info);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user