Files
galaxy-game/ui/frontend/src/proto/galaxy/fbs/diplomail/sent-response.ts
T
Ilia Denisov fed282f2d2
Tests · UI / test (push) Has been cancelled
Tests · Go / test (pull_request) Successful in 2m4s
Tests · Go / test (push) Successful in 2m5s
Tests · Integration / integration (pull_request) Successful in 1m54s
Tests · UI / test (pull_request) Successful in 2m50s
Phase 28 (Step 2): FBS schemas + message-type constants for mail
Adds the wire schema for the eight `user.games.mail.*` ConnectRPC
commands together with the shared payload types (`MailMessage`,
`MailRecipientState`, `MailBroadcastReceipt`). Send-request tables
carry the optional `recipient_race_name` introduced in Step 1.

Drops:

- `pkg/schema/fbs/diplomail.fbs` — schema sources;
- `pkg/schema/fbs/diplomail/*.go` — generated Go bindings (flatc
  `--go --go-module-name galaxy/schema/fbs`);
- `pkg/model/diplomail/diplomail.go` — message-type catalog used by
  the gateway router;
- `ui/frontend/src/proto/galaxy/fbs/diplomail/*.ts` — generated TS
  bindings consumed by the upcoming UI client wrapper;
- `ui/Makefile` `FBS_INPUTS` extended to pick the new schema up on
  the next `make -C ui fbs-ts` run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 22:21:23 +02:00

95 lines
3.0 KiB
TypeScript

// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers';
import { MailMessage, MailMessageT } from '../diplomail/mail-message.js';
export class SentResponse implements flatbuffers.IUnpackableObject<SentResponseT> {
bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):SentResponse {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsSentResponse(bb:flatbuffers.ByteBuffer, obj?:SentResponse):SentResponse {
return (obj || new SentResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsSentResponse(bb:flatbuffers.ByteBuffer, obj?:SentResponse):SentResponse {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new SentResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
items(index: number, obj?:MailMessage):MailMessage|null {
const offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? (obj || new MailMessage()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
}
itemsLength():number {
const offset = this.bb!.__offset(this.bb_pos, 4);
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}
static startSentResponse(builder:flatbuffers.Builder) {
builder.startObject(1);
}
static addItems(builder:flatbuffers.Builder, itemsOffset:flatbuffers.Offset) {
builder.addFieldOffset(0, itemsOffset, 0);
}
static createItemsVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
builder.startVector(4, data.length, 4);
for (let i = data.length - 1; i >= 0; i--) {
builder.addOffset(data[i]!);
}
return builder.endVector();
}
static startItemsVector(builder:flatbuffers.Builder, numElems:number) {
builder.startVector(4, numElems, 4);
}
static endSentResponse(builder:flatbuffers.Builder):flatbuffers.Offset {
const offset = builder.endObject();
return offset;
}
static createSentResponse(builder:flatbuffers.Builder, itemsOffset:flatbuffers.Offset):flatbuffers.Offset {
SentResponse.startSentResponse(builder);
SentResponse.addItems(builder, itemsOffset);
return SentResponse.endSentResponse(builder);
}
unpack(): SentResponseT {
return new SentResponseT(
this.bb!.createObjList<MailMessage, MailMessageT>(this.items.bind(this), this.itemsLength())
);
}
unpackTo(_o: SentResponseT): void {
_o.items = this.bb!.createObjList<MailMessage, MailMessageT>(this.items.bind(this), this.itemsLength());
}
}
export class SentResponseT implements flatbuffers.IGeneratedObject {
constructor(
public items: (MailMessageT)[] = []
){}
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
const items = SentResponse.createItemsVector(builder, builder.createObjectOffsetList(this.items));
return SentResponse.createSentResponse(builder,
items
);
}
}