|
@@ -1,23 +1,24 @@
|
|
|
-import { pubClient } from "../connection/redis.js";
|
|
|
-import { ROLES, CODEMEG, EVENT, FROMTYPE } from "../enum/index.js";
|
|
|
-
|
|
|
-import { logger } from "../core/logger.js";
|
|
|
-import { getSig } from "../core/getSig.js";
|
|
|
-
|
|
|
-export class BasicController {
|
|
|
- constructor(io, socket, pubClient) {
|
|
|
- this.io = io;
|
|
|
- this.socket = socket;
|
|
|
- this.redisCli = pubClient;
|
|
|
- this.logger = logger;
|
|
|
- this.getSig = getSig;
|
|
|
- }
|
|
|
-
|
|
|
- isHoster = (role) => {
|
|
|
- return String(role).toLowerCase() === ROLES.LEADER;
|
|
|
- };
|
|
|
- issAssistant = (role) => {
|
|
|
- return String(role).toLowerCase() === ROLES.ASSISTANT;
|
|
|
- };
|
|
|
- run() {}
|
|
|
-}
|
|
|
+import { pubClient, subClient } from "../connection/redis.js";
|
|
|
+import { ROLES, CODEMEG, EVENT, FROMTYPE } from "../enum/index.js";
|
|
|
+
|
|
|
+import { logger } from "../core/logger.js";
|
|
|
+import { getSig } from "../core/getSig.js";
|
|
|
+
|
|
|
+export class BasicController {
|
|
|
+ constructor(io, socket, pubClient) {
|
|
|
+ this.io = io;
|
|
|
+ this.socket = socket;
|
|
|
+ this.redisCli = pubClient;
|
|
|
+ this.redisSubClient = subClient;
|
|
|
+ this.logger = logger;
|
|
|
+ this.getSig = getSig;
|
|
|
+ }
|
|
|
+
|
|
|
+ isHoster = (role) => {
|
|
|
+ return String(role).toLowerCase() === ROLES.LEADER;
|
|
|
+ };
|
|
|
+ issAssistant = (role) => {
|
|
|
+ return String(role).toLowerCase() === ROLES.ASSISTANT;
|
|
|
+ };
|
|
|
+ run() {}
|
|
|
+}
|