内存同步数据版的共斗框架
This commit is contained in:
@@ -44,7 +44,7 @@ export class EntryHandler {
|
||||
}
|
||||
}
|
||||
// duplicate log in
|
||||
if (!!sessionService.getByUid(uid)) {
|
||||
if (!!sessionService.getByUid(role.roleId)) {
|
||||
console.log('uid not found');
|
||||
return {
|
||||
code: 500,
|
||||
@@ -52,11 +52,13 @@ export class EntryHandler {
|
||||
};
|
||||
}
|
||||
|
||||
await session.abind(uid);
|
||||
await session.abind(role.roleId);
|
||||
session.set('rid', rid);
|
||||
session.set('uid', user.uid);
|
||||
session.set('uid', role.roleId);
|
||||
session.set('roleId', role.roleId);
|
||||
session.set('roleName', role.roleName);
|
||||
session.set('sid', self.app.get('serverId'));
|
||||
session.push('sid', () => {});
|
||||
session.push('roleId', () => {});
|
||||
session.push('roleName', () => {});
|
||||
session.push('rid', function (err) {
|
||||
@@ -67,7 +69,7 @@ export class EntryHandler {
|
||||
session.on('closed', this.onUserLeave.bind(this));
|
||||
|
||||
// put user into channel
|
||||
let users = await self.app.rpc.chat.chatRemote.add.route(session)(uid, self.app.get('serverId'), rid, true);
|
||||
let users = await self.app.rpc.chat.chatRemote.add.route(session)(role.roleId, self.app.get('serverId'), rid, true);
|
||||
let heros = await Hero.findByRole(role.roleId);
|
||||
let equips = await Equip.findbyRole(role.roleId);
|
||||
role['heros'] = heros;
|
||||
|
||||
Reference in New Issue
Block a user