11import { DatabaseDriver } from './database-driver' ;
22import { MongoDatabase } from "./mongo" ;
3+ import { Logger } from "../log/logger" ;
34
45/**
56 * Class that controls the key/value data store.
@@ -13,8 +14,8 @@ export class Database implements DatabaseDriver {
1314 /**
1415 * Create a new Mongo database instance.
1516 */
16- constructor ( private options : any ) {
17- this . driver = new MongoDatabase ( this . options ) ;
17+ constructor ( private options : any , protected log : Logger ) {
18+ this . driver = new MongoDatabase ( this . options , this . log ) ;
1819 }
1920
2021
@@ -45,4 +46,16 @@ export class Database implements DatabaseDriver {
4546 removeInactive ( channel : string , member : any ) : Promise < any > {
4647 return this . driver . removeInactive ( channel , member ) ;
4748 }
49+
50+ removeInactiveSocketsInThisServer ( collection : string , sockets : any ) : Promise < any > {
51+ return this . driver . removeInactiveSocketsInThisServer ( collection , sockets ) ;
52+ }
53+
54+ setUserInServer ( collection : string , user : any ) : void {
55+ return this . driver . setUserInServer ( collection , user ) ;
56+ } ;
57+
58+ delUserInServerBySocketId ( collection : string , socket_id : any ) : void {
59+ return this . driver . delUserInServerBySocketId ( collection , socket_id ) ;
60+ }
4861}
0 commit comments