mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 21:13:55 -07:00
Update protocol and client features src
This commit is contained in:
parent
6006d6f2fa
commit
254410d025
8 changed files with 16 additions and 26 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -15,3 +15,4 @@ compile_commands.json
|
|||
.gdb_history
|
||||
cockatrice/resources/config/qtlogging.ini
|
||||
docs/
|
||||
.claude/settings.local.json
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
8
webclient/package-lock.json
generated
8
webclient/package-lock.json
generated
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
export { createWebClientResponse } from './response';
|
||||
export { CLIENT_CONFIG, CLIENT_OPTIONS, PROTOCOL_VERSION } from './clientConfig';
|
||||
export { CLIENT_CONFIG, CLIENT_OPTIONS } from './clientConfig';
|
||||
|
|
|
|||
|
|
@ -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 }) {
|
||||
|
|
|
|||
|
|
@ -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>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue