Update protocol and client features src

This commit is contained in:
seavor 2026-05-07 18:18:38 -05:00
parent 6006d6f2fa
commit 254410d025
8 changed files with 16 additions and 26 deletions

View file

@ -19,12 +19,13 @@ import { afterEach, beforeEach, vi } from 'vitest';
import { ServerDispatch, RoomsDispatch, GameDispatch } from '@app/store';
import { Data } from '@app/types';
import { PROTOCOL_VERSION } from 'sockatrice';
import { WebClient, setPendingOptions } from '@app/websocket';
import { WebsocketTypes } from '@app/websocket/types';
import {
CLIENT_CONFIG,
CLIENT_OPTIONS,
PROTOCOL_VERSION,
createWebClientResponse,
} from '@app/api';
@ -205,7 +206,6 @@ beforeEach(() => {
createWebClientResponse(),
CLIENT_CONFIG,
CLIENT_OPTIONS,
PROTOCOL_VERSION,
);
});

View file

@ -35,7 +35,7 @@
"react-virtualized-auto-sizer": "^2.0.3",
"react-window": "^2.2.7",
"rxjs": "^7.5.4",
"sockatrice": "https://github.com/seavor/Sockatrice/releases/download/v2.1.3/sockatrice-2.1.3.tgz"
"sockatrice": "https://github.com/seavor/Sockatrice/releases/download/v2.2.0/sockatrice-2.2.0.tgz"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
@ -5373,9 +5373,9 @@
"license": "ISC"
},
"node_modules/sockatrice": {
"version": "2.1.3",
"resolved": "https://github.com/seavor/Sockatrice/releases/download/v2.1.3/sockatrice-2.1.3.tgz",
"integrity": "sha512-xywXolumrums59NteojtdmVKfjF8Ah71ewseczecZBqSmNAQ6zhM9enhmukWLvgQJr0rh7o1RDX5m+54kct+vA==",
"version": "2.2.0",
"resolved": "https://github.com/seavor/Sockatrice/releases/download/v2.2.0/sockatrice-2.2.0.tgz",
"integrity": "sha512-OMM+aLDLObGOCWLm+ME9ph+Zb65ELLi3jCDA1E5i4Uh+dRJgH9O/ulLjptjSYiQcQHZp0VoF980TBa93j0belQ==",
"license": "GPL-2.0-or-later",
"dependencies": {
"@bufbuild/protobuf": "^2.11.0",

View file

@ -60,7 +60,7 @@
"react-virtualized-auto-sizer": "^2.0.3",
"react-window": "^2.2.7",
"rxjs": "^7.5.4",
"sockatrice": "https://github.com/seavor/Sockatrice/releases/download/v2.1.3/sockatrice-2.1.3.tgz"
"sockatrice": "https://github.com/seavor/Sockatrice/releases/download/v2.2.0/sockatrice-2.2.0.tgz"
},
"devDependencies": {
"@eslint/js": "^10.0.1",

View file

@ -1,24 +1,16 @@
import { SOCKATRICE_FEATURES } from 'sockatrice';
import type { WebsocketTypes } from '@app/websocket/types';
export const PROTOCOL_VERSION = 14;
const APP_FEATURES = [
'2.7.0_min_version',
'2.8.0_min_version',
] as const;
export const CLIENT_CONFIG: WebsocketTypes.ClientConfig = {
clientid: 'webatrice',
clientver: 'webclient-1.0 (2019-10-31)',
clientfeatures: [
'client_id',
'client_ver',
'feature_set',
'room_chat_history',
'client_warnings',
'forgot_password',
'idle_client',
'mod_log_lookup',
'user_ban_history',
'websocket',
'2.7.0_min_version',
'2.8.0_min_version',
],
clientfeatures: [...SOCKATRICE_FEATURES, ...APP_FEATURES],
};
export const CLIENT_OPTIONS: WebsocketTypes.ClientOptions = {

View file

@ -1,2 +1,2 @@
export { createWebClientResponse } from './response';
export { CLIENT_CONFIG, CLIENT_OPTIONS, PROTOCOL_VERSION } from './clientConfig';
export { CLIENT_CONFIG, CLIENT_OPTIONS } from './clientConfig';

View file

@ -10,7 +10,6 @@ vi.mock('@app/api', () => ({
createWebClientResponse: vi.fn(() => 'response'),
CLIENT_CONFIG: { clientid: 'test', clientver: 'test', clientfeatures: [] },
CLIENT_OPTIONS: { autojoinrooms: false, keepalive: 5000 },
PROTOCOL_VERSION: 14,
}));
function Wrapper({ children }: { children: ReactNode }) {

View file

@ -3,7 +3,6 @@ import { WebClient } from '@app/websocket';
import {
CLIENT_CONFIG,
CLIENT_OPTIONS,
PROTOCOL_VERSION,
createWebClientResponse,
} from '@app/api';
@ -15,7 +14,6 @@ export function WebClientProvider({ children }: { children: ReactNode }) {
createWebClientResponse(),
CLIENT_CONFIG,
CLIENT_OPTIONS,
PROTOCOL_VERSION,
));
return <WebClientContext value={client}>{children}</WebClientContext>;