Cockatrice/webclient/src/websocket/instanceService/AuthenticationService.tsx
Joseph Chamish 1ddc9cc929
Structure change (#4220)
* Structure change

* Remove duplicate folders from previous structure

* Cleanup websocket protocol

* Updating from based off PR

* Fixup - remove wrong files during conflict and get the websocket working

* renaming tsx to ts

Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
2021-01-20 18:50:18 -05:00

23 lines
No EOL
511 B
TypeScript

import { StatusEnum } from "types";
import { webClient } from "websocket";
export default class AuthenticationService {
static connect(options) {
webClient.services.session.connectServer(options);
}
static disconnect() {
webClient.services.session.disconnectServer();
}
static isConnected(state) {
return state === StatusEnum.LOGGEDIN;
}
static isModerator(user) {
return user.userLevel >= webClient.pb.ServerInfo_User.UserLevelFlag.IsModerator;
}
static isAdmin() {
}
}