Document accumulated interoperability findings and current source-backed design. Record build-specific visual results, matched acceleration policy, passing packaged behavior checks, and explicit native/ARM and strict visual acceptance limits. No complete 1:1 claim.
78 lines
10 KiB
Markdown
78 lines
10 KiB
Markdown
# TeamSpeak 6 client JSON server snapshots
|
||
|
||
## Source evidence
|
||
|
||
Read-only source: installed `C:/Users/Admin/AppData/Local/Programs/TeamSpeak/html/client_ui/main.js`, TeamSpeak 6.0.0.5163. Offsets are JavaScript string character offsets, not byte offsets.
|
||
|
||
- Snapshot service export `zS` (re-exported `zS3`): starts around 2425000; `createSnapshot` around 2426171. The view calls `applySnapshot` near 1787334; the actual service implementation follows `createSnapshot`.
|
||
- Schema version `0.0.1`, document type `teamspeak.server.snapshot`.
|
||
- Creation options: `catalogId="default"`, `catalogDescription="Server snapshot"`, `snapshotDescription`, `createdBy="Unknown"`; `includeServerSettings`, `includeChannels`, `includeServerGroups`, `includeServerGroupMembers`, `includeChannelGroups`, `includeIcons` all default false; optional string map `vars`.
|
||
- Document: `{type,schemaVersion,meta:{description,createdAt,createdBy,source:{serverVersion,platform}},vars,catalog:[{id,description,server?,channels?,serverGroups?,channelGroups?,icons?}]}`.
|
||
- Channels: recursive permanent-only tree with `name,topic,description,default,maxUsers,maxFamilyUsers,bannerGfxUrl,bannerMode,codec,quality,permissions,channels`. Permission records use symbolic `id`, integer `value`, optional `grant,skip,negate`; icon IDs are unsigned 32-bit JSON numbers.
|
||
- Server/channel groups: normal groups (`type=1`) sorted by sort ID then ID, `{name,permissions,default?,defaultChannelAdmin?,members?}`. Server group members are `{nickname,uid}`; the default server group does not enumerate members.
|
||
- Variables export replaces longest literal values first with `${key}`; import substitutes known keys and preserves unresolved placeholders.
|
||
- Icon JSON: `{id:string,data:base64-or-data-URL,mimeType:string}`. `collectIcons` calls the icon manager; `uploadIcons` maps old IDs to returned IDs before applying server/channel/group icon permissions. Built-in icons 0–1000 need no upload. Unmapped custom references must not silently become a target server's unrelated icon.
|
||
- Official apply order: icons, server settings, recursive channels, server groups, channel groups, default groups, member assignments. Name conflict modes: `skip`, `rename_new` (numbered suffix), `rename_existing` (`OLD name`, numbered suffix).
|
||
- `i_group_auto_update_max_value` is intentionally omitted on import. Official importer does not apply serialized `grant` separately.
|
||
- Official member assignment uses `requestServerGroupAssignByIds` with `{version:1,add:[{client_uid,vs_group_id}]}` for UID length >32, otherwise `{migration,vs_group_id}`. AstraCore recovered the native `vsgroupassignbyids json=...` constructor in installed TeamSpeak.dll at VA1814b8e7d (JSON key RIP VA182770354), and implements the typed `server_group_member_add_uid` bridge primitive. Snapshot import uses UID assignment directly; target servers that reject this modern command produce per-member partial failures, never false success.
|
||
- Icon manager module 66727 at 2316653 reads `/icons`, then resolves each icon through `GetIcon`. Classic storage real paths are `/icon_<id>`; HTTP/S3 real paths are `/icons/icon_<id>`.
|
||
- Official `uploadIconFile` at 2456817 uploads `/icons/icon_<randomString>` and reloads the list, selecting its last icon. TeamsPeach does not reproduce that race-prone last-item heuristic: it uses a content CRC32 filename, compares existing bytes on collision, awaits transfer completion, and maps the old JSON ID to that exact target ID.
|
||
|
||
## Implementation and integration contract
|
||
|
||
Files:
|
||
|
||
- `app/main/server-snapshot-codec.js`: JSON validation, source field mapping, variable substitution, ordinary server reads/mutations, hierarchical channel/group recreation and per-item results.
|
||
- `app/main/server-snapshots.js`: trusted-sender IPC, user-chosen paths, import tokens, connection pinning, icon temporary files/transfers, progress/cancellation.
|
||
- `app/renderer/js/server-snapshots.js`: `openServerSnapshots(connectionId)` entry; accessible dialog using existing `client-dialog` classes. The caller captures the viewed connection once.
|
||
|
||
Main registration:
|
||
|
||
```js
|
||
registerServerSnapshotsIpc({
|
||
ipcMain, trustedSender, dialog, getWindow, request, validConnectionId,
|
||
getConnection, subscribeCore, testOffscreen, tr,
|
||
});
|
||
```
|
||
|
||
`request(connectionId,command,args)` returns the raw bridge response `{ok,result|error}`. `getConnection(id)` returns the connection-manager entry. `subscribeCore(callback)` supplies `(connectionId,event)` and returns an unsubscribe function. Native operations are pinned to the exact entry, its session counter and its core object; mutations carry the `admin_context.generation`. Import tokens are additionally pinned to server UID/generation. Reconnecting never silently resumes on a new session.
|
||
|
||
Preload/IPC:
|
||
|
||
| Preload method | IPC | Arguments |
|
||
| --- | --- | --- |
|
||
| `snapshotExport` | `snapshots:export` | `(connectionId, creationOptions)` |
|
||
| `snapshotOpen` | `snapshots:open` | `(connectionId)` |
|
||
| `snapshotApply` | `snapshots:apply` | `(connectionId,{token,catalogId,conflictMode,vars,confirmation})` |
|
||
| `snapshotCancel` | `snapshots:cancel` | `(connectionId)` |
|
||
| `onSnapshotProgress` | `snapshots:progress` event | callback receives `{connectionId,mode,phase,identifier,current,total,errors}`; returns unsubscribe |
|
||
|
||
Open returns an opaque token, basename, metadata, variables, catalog summaries and the exact target server UID confirmation text, **not a path or arbitrary native command**. Apply requires the typed UID. Import documents remain in main; tokens expire after 30 minutes and are replaced when another file is opened for the same connection. No native dialog runs in offscreen mode. JSON files are bounded at 32 MiB, icons at 128 KiB, nesting/counts are bounded. SVG bytes remain opaque main-process file bytes and never become renderer DOM.
|
||
|
||
Native primitive contracts (owned by AstraCore):
|
||
|
||
- `admin_context {}` → `{generation,server_uid,permissions_catalog:[{id,name,description}]}`.
|
||
- `server_info`, `channel_list`, `server_group_list`, `channel_group_list` → `{rows:[wire fields]}`.
|
||
- `channel_info {channel_id}` → `{rows:[wire fields]}`, refreshing description.
|
||
- `server_group_perm_list {group_id}`, `channel_group_perm_list {group_id}`, `channel_perm_list {channel_id}`, `server_group_client_list {group_id}` → `{rows}`.
|
||
- `server_edit {generation,confirm:server_uid,properties:{wire_key:value}}` → server ack.
|
||
- `channel_create {generation,parent_id,properties}` → `{channel_id}`; `channel_edit {generation,channel_id,properties}` → ack.
|
||
- `group_add {generation,kind:'server'|'channel',name,type:1}` → `{group_id}`; `group_rename {generation,kind,group_id,name}` → ack.
|
||
- `group_set_permissions {generation,kind,group_id,permissions:[{id,value,negate,skip}]}`; `channel_set_permissions {generation,channel_id,permissions:[{id,value}]}` → ack.
|
||
- `server_group_member_add_uid {generation,group_id,uid}` → ack; native JSON chooses `migration` versus `client_uid` from UID length, with `vs_group_id` string.
|
||
- Main-only file primitives (AstraFiles): `file_list {channel_id:0,path:'/icons/'}` → `{entries:[{name,type,size,...}]}`. `file_download {channel_id:0,path:'/icons/icon_<u32>',dest_dir,subdirs:[],overwrite:false}` and `file_upload {channel_id:0,path:'/icons/icon_<u32>',source,overwrite:false}` return a queued `transfer_id`, not completion. Await flat `file_transfer` terminal `done|failed|cancelled` event. `file_cancel {transfer_id}` requests cancellation. The core handles classic storage path normalization; renderer generic file commands remain channel_id>0.
|
||
|
||
## Truthful outcomes and evidence boundaries
|
||
|
||
`ok` means IPC completed; it is **not** full operation success. `success` is true only with no omissions/failures. Partial results include `{partial,errors:[{type,identifier,message,code?}],created:{channels,serverGroups,channelGroups,icons,members,renamed}}`. Cancellation never claims rollback: completed server changes remain and the dialog says so. A failed create does not attach descendants to the wrong parent. A failed icon import does not apply its custom references. Name-conflict skips are explicit warnings and make the result partial.
|
||
|
||
Modern fields extend the older pinned declarations using installed TS6 source: server `sfuEndpoint` string (main.js@2372626, apply@2436342), `storageQuota` number (main.js@2372558, apply@2437810, UI unlimited −1/0xffffffff); channel `bannerGfxUrl` string and `bannerMode` enum 0/1/2 (apply@2440904/@2440961, UI@4087890). Native property table maps channel IDs 0x20/0x21 to `channel_banner_gfx_url`/`channel_banner_mode` (VA180cd22f0/180cd2330), server IDs 0x58/0x61 to `virtualserver_storage_quota`/`virtualserver_sfu_endpoint` (VA180cd623d/180cd650c). Generic flush constructors build `channeledit` (VA1814c687e) and `serveredit` (VA1814c7399), then append the serialized property payload through VA1822476c0. These fields are allowed and typed in native and IPC validators; this is static source/disassembly support, not live mutation proof. HTTP/S3 file transfer remains explicitly unsupported by the native transfer implementation, rather than silently using classic storage.
|
||
|
||
There is no `serversnapshotcreate`/`serversnapshotdeploy` native query and no modification of `core/src/snapshot.rs`. This is account-free connected-server administration only.
|
||
|
||
No build, tests, lint, live server mutation, native dialogs, audio, or UI launches were run for this slice. Integration verification remains with the main agent: codec round-trips, every partial-failure/cancellation boundary, stale-session dialogs, file transfer event correlation, source field mapping and imported icon remapping, followed by permitted end-to-end checks.
|
||
|
||
Deterministic test sources: `test/server-snapshot-codec.test.js` and `test/server-snapshots-main.test.js`. They use controlled core replies and temporary files with fake dialog callbacks; no real Electron window or server is opened. Coverage includes official JSON roundtrip, variables, hierarchy, icon/group/default/member mapping, partial errors, cancellation after an acknowledged mutation, stale generation/session refusal, early transfer-completion events, trusted-sender and offscreen refusal. These tests have not been executed in this slice.
|
||
|
||
Translations delivered as `local://snapshots-i18n.json` for AstraQA. AstraConnections owns registration/preload; AstraAdminUI owns the server-admin entry; AstraVisual owns `.server-snapshots`, `.snapshot-controls`, `.snapshot-section`, `.snapshot-errors` styling. Shared integration files were not edited by this slice.
|