private chat ok
This commit is contained in:
parent
b7cd139ed1
commit
3dbd8ca66a
@ -361,8 +361,6 @@ class ChatHandler {
|
||||
const contentType = msg.contentType;
|
||||
const targetuid = msg.targetuid;
|
||||
const channelId = `privateChannel_${targetuid}`;
|
||||
|
||||
this.gcs.add(channelId, session.uid, session.get("sid"), function () {});
|
||||
this.gcs.pushMessage(
|
||||
"connector",
|
||||
"onChat",
|
||||
|
@ -13,6 +13,7 @@ var Handler = function (app) {
|
||||
this.gameapiUrl = this.app.get("gameapi").gameBaseURL;
|
||||
this.valid_entry_login = axios.create({baseURL:this.gameapiUrl});
|
||||
this.channelService = this.app.get("channelService");
|
||||
this.gcs = this.app.get("globalChannelService");
|
||||
};
|
||||
|
||||
/** @api {post} connector.entryHandler.entry entry 建立连接-登录-入口
|
||||
@ -81,6 +82,10 @@ Handler.prototype.entry = function (msg, session, next) {
|
||||
next(null, { code: 500, error: true });
|
||||
return;
|
||||
}
|
||||
|
||||
const channelId = `privateChannel_${uid}`;
|
||||
this.gcs.add(channelId, session.uid, session.get("sid"), function () {});
|
||||
|
||||
next(null, { code: 200, msg: "game server is ok." });
|
||||
});
|
||||
});
|
||||
@ -103,10 +108,15 @@ var onUserLeave = function (app, session, reason) {
|
||||
if (!session || !session.uid) {
|
||||
return;
|
||||
}
|
||||
|
||||
logger.debug(`onUserLeave ${session.id} : ${session.uid}`);
|
||||
const uid = session.uid;
|
||||
const sid = session.get("sid");
|
||||
const privateChannelId = `privateChannel_${uid}`;
|
||||
this.gcs.leave(privateChannelId, uid, sid);
|
||||
|
||||
const teamid = session.get("teamid");
|
||||
app.rpc.chat.chatRemote.kick(session, session.uid, session.get('sid'), teamid, null);
|
||||
app.rpc.chat.chatRemote.kick(session, uid, sid, teamid, null);
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user