22 lines
738 B
TypeScript
22 lines
738 B
TypeScript
import {Connection,IConnection} from "./Connection";
|
|
import EventPool from "./EventPool";
|
|
import Room, { IRoomOptions } from "./Room";
|
|
import WSTSProtocol from "./WSTSProtocol";
|
|
export default class WSTS {
|
|
public server! : Connection;
|
|
public WSTSProtocol! : WSTSProtocol;
|
|
public EventPooling! : EventPool;
|
|
public rooms : Map<string, Room> = new Map();
|
|
constructor(options: IConnection){
|
|
this.server = new Connection(options);
|
|
this.server.connect();
|
|
this.WSTSProtocol = new WSTSProtocol(this);
|
|
this.EventPooling = new EventPool(this);
|
|
}
|
|
public room(options: IRoomOptions)
|
|
{
|
|
let room = new Room(this);
|
|
room.setRoomOptions(options);
|
|
return room;
|
|
}
|
|
} |