mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
refactor web socket layer
This commit is contained in:
parent
19f5eefdd2
commit
141f0e59f5
124 changed files with 927 additions and 853 deletions
|
|
@ -2,8 +2,8 @@ import { AccountActivationParams } from 'store';
|
|||
import { StatusEnum, WebSocketConnectOptions } from 'types';
|
||||
|
||||
import { create } from '@bufbuild/protobuf';
|
||||
import { CLIENT_CONFIG } from '../../config';
|
||||
import webClient from '../../WebClient';
|
||||
import { BackendService } from '../../services/BackendService';
|
||||
import { Command_Activate_ext, Command_ActivateSchema } from 'generated/proto/session_commands_pb';
|
||||
import { SessionPersistence } from '../../persistence';
|
||||
import { Response_ResponseCode } from 'generated/proto/response_pb';
|
||||
|
|
@ -13,8 +13,8 @@ import { disconnect, login, updateStatus } from './';
|
|||
export function activate(options: WebSocketConnectOptions, password?: string, passwordSalt?: string): void {
|
||||
const { userName, token } = options as unknown as AccountActivationParams;
|
||||
|
||||
BackendService.sendSessionCommand(Command_Activate_ext, create(Command_ActivateSchema, {
|
||||
...webClient.clientConfig,
|
||||
webClient.protobuf.sendSessionCommand(Command_Activate_ext, create(Command_ActivateSchema, {
|
||||
...CLIENT_CONFIG,
|
||||
userName,
|
||||
token,
|
||||
}), {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue