diff --git a/.gitignore b/.gitignore index 881174406..ec7dc1511 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ compile_commands.json .gdb_history cockatrice/resources/config/qtlogging.ini docs/ +.claude/settings.local.json diff --git a/webclient/integration/src/helpers/setup.ts b/webclient/integration/src/helpers/setup.ts index 715ed6731..70b0a6151 100644 --- a/webclient/integration/src/helpers/setup.ts +++ b/webclient/integration/src/helpers/setup.ts @@ -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, ); }); diff --git a/webclient/package-lock.json b/webclient/package-lock.json index f8bd07940..abb24c841 100644 --- a/webclient/package-lock.json +++ b/webclient/package-lock.json @@ -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", diff --git a/webclient/package.json b/webclient/package.json index 95bf1cd81..b56149fb3 100644 --- a/webclient/package.json +++ b/webclient/package.json @@ -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", diff --git a/webclient/src/api/clientConfig.ts b/webclient/src/api/clientConfig.ts index 74bc57f0a..dfac301c3 100644 --- a/webclient/src/api/clientConfig.ts +++ b/webclient/src/api/clientConfig.ts @@ -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 = { diff --git a/webclient/src/api/index.ts b/webclient/src/api/index.ts index 18bea8404..293d56124 100644 --- a/webclient/src/api/index.ts +++ b/webclient/src/api/index.ts @@ -1,2 +1,2 @@ export { createWebClientResponse } from './response'; -export { CLIENT_CONFIG, CLIENT_OPTIONS, PROTOCOL_VERSION } from './clientConfig'; +export { CLIENT_CONFIG, CLIENT_OPTIONS } from './clientConfig'; diff --git a/webclient/src/hooks/useWebClient.spec.tsx b/webclient/src/hooks/useWebClient.spec.tsx index 87901f7ab..e0e4aaa4a 100644 --- a/webclient/src/hooks/useWebClient.spec.tsx +++ b/webclient/src/hooks/useWebClient.spec.tsx @@ -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 }) { diff --git a/webclient/src/hooks/useWebClient.tsx b/webclient/src/hooks/useWebClient.tsx index c69776b40..574e5ef60 100644 --- a/webclient/src/hooks/useWebClient.tsx +++ b/webclient/src/hooks/useWebClient.tsx @@ -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 {children};