mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Webatrice: KnownHosts component (#4456)
* refactor dexie services for future schema updates Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
37879c4255
commit
6ce346af4a
54 changed files with 1381 additions and 1291 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { ServerStatus, StatusEnum } from 'types';
|
||||
import { ServerStatus, StatusEnum, WebSocketConnectOptions } from 'types';
|
||||
|
||||
import { ProtobufService } from './services/ProtobufService';
|
||||
import { WebSocketOptions, WebSocketService } from './services/WebSocketService';
|
||||
import { WebSocketService } from './services/WebSocketService';
|
||||
|
||||
import { RoomPersistence, SessionPersistence } from './persistence';
|
||||
|
||||
|
|
@ -30,11 +30,12 @@ export class WebClient {
|
|||
]
|
||||
};
|
||||
|
||||
public options: WebSocketOptions = {
|
||||
public options: WebSocketConnectOptions = {
|
||||
host: '',
|
||||
port: '',
|
||||
user: '',
|
||||
pass: '',
|
||||
userName: '',
|
||||
password: '',
|
||||
hashedPassword: '',
|
||||
newPassword: '',
|
||||
email: '',
|
||||
clientid: null,
|
||||
|
|
@ -43,6 +44,8 @@ export class WebClient {
|
|||
keepalive: 5000
|
||||
};
|
||||
|
||||
public connectionAttemptMade = false;
|
||||
|
||||
constructor() {
|
||||
this.socket.message$.subscribe((message: MessageEvent) => {
|
||||
this.protobuf.handleMessageEvent(message);
|
||||
|
|
@ -55,7 +58,8 @@ export class WebClient {
|
|||
console.log(this);
|
||||
}
|
||||
|
||||
public connect(options: WebSocketOptions) {
|
||||
public connect(options: WebSocketConnectOptions) {
|
||||
this.connectionAttemptMade = true;
|
||||
this.options = { ...this.options, ...options };
|
||||
this.socket.connect(this.options);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue