mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
* 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>
23 lines
No EOL
511 B
TypeScript
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() {
|
|
|
|
}
|
|
} |