From 3cd3155d1a48fda36642bcf3f3c31ca4eb792467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Wed, 20 May 2026 17:37:02 +0800 Subject: [PATCH] Simplify comments and section headers in oidb.ts Remove long legacy/explanatory comment blocks and ASCII-art dividers, replacing them with shorter, consistent section headers (e.g. "Oidb.0xFD4_1 Friend list", "Oidb.0xFE5_2 Group list"). Trim redundant commentary about OidbBase/OidbBaseMeta while keeping all type/interface definitions unchanged. This cleans up the file for readability without altering the public types or runtime behavior. --- .../src/bridge/proto/proton/oidb-action.ts | 3 -- packages/core/src/bridge/proto/proton/oidb.ts | 31 +++---------------- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/packages/core/src/bridge/proto/proton/oidb-action.ts b/packages/core/src/bridge/proto/proton/oidb-action.ts index 40e2bc4a..4e070b06 100644 --- a/packages/core/src/bridge/proto/proton/oidb-action.ts +++ b/packages/core/src/bridge/proto/proton/oidb-action.ts @@ -1,6 +1,3 @@ -// Proton (compile-time) form of bridge/proto/oidb-action.ts. -// One-to-one mirror; legacy `*Schema` constants stay alongside for back-compat. - import type { pb, pb_repeated, int_32, uint_32, uint_64, bool, bytes } from '@snowluma/proton'; // --- 0x1253_1: Mute group member --- diff --git a/packages/core/src/bridge/proto/proton/oidb.ts b/packages/core/src/bridge/proto/proton/oidb.ts index 43fc14a6..9747a903 100644 --- a/packages/core/src/bridge/proto/proton/oidb.ts +++ b/packages/core/src/bridge/proto/proton/oidb.ts @@ -1,19 +1,5 @@ -// Proton (compile-time) form of bridge/proto/oidb.ts. -// -// The legacy file exports a `makeOidbBaseSchema(body)` factory that builds the -// OidbSvcTrpcTcpBase envelope at runtime; here that wrapper is expressed -// once as the generic `OidbBase` interface. Every existing -// `makeOidbBaseSchema(InnerSchema)` call site becomes `OidbBase` -// at the type level, and the proton plugin monomorphizes the codec -// per-instantiation at build time. -// -// `OidbBaseMeta` is the envelope-only view used by fire-and-check calls -// that want to peek at the error code without decoding the body. - import type { pb, pb_repeated, int_32, uint_32, uint_64, bytes } from '@snowluma/proton'; -// ── OidbSvcTrpcTcpBase wrapper ────────────────────────────────────── - export interface OidbProperty { key?: pb<1, string>; value?: pb<2, bytes>; @@ -29,11 +15,6 @@ export interface OidbBase { reserved?: pb<12, int_32>; } -/** - * Envelope-only view used by fire-and-check calls — proto3 wire format - * silently skips unknown fields, so decoding any OidbBase message with - * this shape returns just the metadata and ignores the inner body. - */ export interface OidbBaseMeta { command?: pb<1, uint_32>; subCommand?: pb<2, uint_32>; @@ -42,8 +23,7 @@ export interface OidbBaseMeta { reserved?: pb<12, int_32>; } -// ── Friend list (0xFD4_1) ─────────────────────────────────────────── - +// Oidb.0xFD4_1 Friend list export interface OidbFriendProperty { code?: pb<1, uint_32>; value?: pb<2, string>; @@ -78,8 +58,7 @@ export interface OidbSvcTrpcTcp0xFD4_1Response { groups?: pb_repeated<102, OidbFriendProperty>; } -// ── Group list (0xFE5_2) ──────────────────────────────────────────── - +// Oidb.0xFE5_2 Group list export interface OidbSvcTrpcTcp0xFE5_2Member { uid?: pb<2, string>; } @@ -109,8 +88,7 @@ export interface OidbSvcTrpcTcp0xFE5_2Response { groups?: pb_repeated<2, OidbSvcTrpcTcp0xFE5_2Group>; } -// ── Group member list (0xFE7_3) ───────────────────────────────────── - +// Oidb.0xFE7_3 Group member list export interface OidbSvcTrpcTcp0xFE7_3Uin { uid?: pb<2, string>; uin?: pb<4, uint_32>; @@ -146,8 +124,7 @@ export interface OidbSvcTrpcTcp0xFE7_3Response { token?: pb<15, string>; } -// ── Group request (0x10C0) ────────────────────────────────────────── - +// OIDB.0x10C0 Group Request export interface OidbSvcTrpcTcp0x10C0ResponseUser { uid?: pb<1, string>; name?: pb<2, string>;