fix(core): update

This commit is contained in:
2019-08-13 13:04:49 +02:00
parent 1baf1c318c
commit 33fe6bcd41
3 changed files with 90 additions and 79 deletions

View File

@ -89,7 +89,7 @@ export class Universe {
// add the role to smartsocket
this.smartsocket.addSocketRoles([ClientRole]);
const SubscriptionSocketFunction = new plugins.smartsocket.SocketFunction({
const socketFunctionSubscription = new plugins.smartsocket.SocketFunction({
allowedRoles: [ClientRole], // there is only one client role, Authentication happens on another level
funcName: 'channelSubscription',
funcDef: async (
@ -111,7 +111,7 @@ export class Universe {
}
});
const ProcessMessageSocketFunction = new plugins.smartsocket.SocketFunction({
const socketFunctionProcessMessage = new plugins.smartsocket.SocketFunction({
allowedRoles: [ClientRole], // there is only one client role, Authentication happens on another level
funcName: 'processMessage',
funcDef: async (dataArg: interfaces.IUniverseMessage, socketConnectionArg) => {
@ -141,6 +141,10 @@ export class Universe {
}
});
// add socket functions
this.smartsocket.addSocketFunction(socketFunctionSubscription);
this.smartsocket.addSocketFunction(socketFunctionProcessMessage);
// add smartsocket to the running smartexpress app
this.smartsocket.setExternalServer('smartexpress', this.smartexpressServer as any);
// start everything