a692024b4e
The Profile now carries dict_versions (game variant -> current dictionary version), populated from the dictionary registry at the profileResponse choke point, so an installed PWA can preload the matching dawg per enabled variant off the existing cold-start profile request instead of adding a round-trip for a rare feature. Wire path: FBS DictVersion table + Profile.dict_versions (additive, backward-compatible trailing field) -> backend dto/registry -> gateway ProfileResp + FBS encoder -> client codec decode into a per-variant map on model.Profile. Empty in a degenerate no-dictionary deployment; the mock serves v1.3.0 for all three variants. Codec decode covered by a bite-tested round-trip unit test.
61 lines
2.1 KiB
TypeScript
61 lines
2.1 KiB
TypeScript
// automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
import * as flatbuffers from 'flatbuffers';
|
|
|
|
export class DictVersion {
|
|
bb: flatbuffers.ByteBuffer|null = null;
|
|
bb_pos = 0;
|
|
__init(i:number, bb:flatbuffers.ByteBuffer):DictVersion {
|
|
this.bb_pos = i;
|
|
this.bb = bb;
|
|
return this;
|
|
}
|
|
|
|
static getRootAsDictVersion(bb:flatbuffers.ByteBuffer, obj?:DictVersion):DictVersion {
|
|
return (obj || new DictVersion()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
}
|
|
|
|
static getSizePrefixedRootAsDictVersion(bb:flatbuffers.ByteBuffer, obj?:DictVersion):DictVersion {
|
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
return (obj || new DictVersion()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
}
|
|
|
|
variant():string|null
|
|
variant(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
variant(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 4);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
version():string|null
|
|
version(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
version(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
static startDictVersion(builder:flatbuffers.Builder) {
|
|
builder.startObject(2);
|
|
}
|
|
|
|
static addVariant(builder:flatbuffers.Builder, variantOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(0, variantOffset, 0);
|
|
}
|
|
|
|
static addVersion(builder:flatbuffers.Builder, versionOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(1, versionOffset, 0);
|
|
}
|
|
|
|
static endDictVersion(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
const offset = builder.endObject();
|
|
return offset;
|
|
}
|
|
|
|
static createDictVersion(builder:flatbuffers.Builder, variantOffset:flatbuffers.Offset, versionOffset:flatbuffers.Offset):flatbuffers.Offset {
|
|
DictVersion.startDictVersion(builder);
|
|
DictVersion.addVariant(builder, variantOffset);
|
|
DictVersion.addVersion(builder, versionOffset);
|
|
return DictVersion.endDictVersion(builder);
|
|
}
|
|
}
|