Files
galaxy-game/ui/frontend/src/proto/galaxy/fbs/diplomail/mail-recipient-state.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

107 lines
3.4 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';
export class MailRecipientState implements flatbuffers.IUnpackableObject<MailRecipientStateT> {
bb: flatbuffers.ByteBuffer|null = null;
bb_pos = 0;
__init(i:number, bb:flatbuffers.ByteBuffer):MailRecipientState {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsMailRecipientState(bb:flatbuffers.ByteBuffer, obj?:MailRecipientState):MailRecipientState {
return (obj || new MailRecipientState()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsMailRecipientState(bb:flatbuffers.ByteBuffer, obj?:MailRecipientState):MailRecipientState {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new MailRecipientState()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
messageId():string|null
messageId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
messageId(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;
}
readAtMs():bigint {
const offset = this.bb!.__offset(this.bb_pos, 6);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}
deletedAtMs():bigint {
const offset = this.bb!.__offset(this.bb_pos, 8);
return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}
static startMailRecipientState(builder:flatbuffers.Builder) {
builder.startObject(3);
}
static addMessageId(builder:flatbuffers.Builder, messageIdOffset:flatbuffers.Offset) {
builder.addFieldOffset(0, messageIdOffset, 0);
}
static addReadAtMs(builder:flatbuffers.Builder, readAtMs:bigint) {
builder.addFieldInt64(1, readAtMs, BigInt('0'));
}
static addDeletedAtMs(builder:flatbuffers.Builder, deletedAtMs:bigint) {
builder.addFieldInt64(2, deletedAtMs, BigInt('0'));
}
static endMailRecipientState(builder:flatbuffers.Builder):flatbuffers.Offset {
const offset = builder.endObject();
return offset;
}
static createMailRecipientState(builder:flatbuffers.Builder, messageIdOffset:flatbuffers.Offset, readAtMs:bigint, deletedAtMs:bigint):flatbuffers.Offset {
MailRecipientState.startMailRecipientState(builder);
MailRecipientState.addMessageId(builder, messageIdOffset);
MailRecipientState.addReadAtMs(builder, readAtMs);
MailRecipientState.addDeletedAtMs(builder, deletedAtMs);
return MailRecipientState.endMailRecipientState(builder);
}
unpack(): MailRecipientStateT {
return new MailRecipientStateT(
this.messageId(),
this.readAtMs(),
this.deletedAtMs()
);
}
unpackTo(_o: MailRecipientStateT): void {
_o.messageId = this.messageId();
_o.readAtMs = this.readAtMs();
_o.deletedAtMs = this.deletedAtMs();
}
}
export class MailRecipientStateT implements flatbuffers.IGeneratedObject {
constructor(
public messageId: string|Uint8Array|null = null,
public readAtMs: bigint = BigInt('0'),
public deletedAtMs: bigint = BigInt('0')
){}
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
const messageId = (this.messageId !== null ? builder.createString(this.messageId!) : 0);
return MailRecipientState.createMailRecipientState(builder,
messageId,
this.readAtMs,
this.deletedAtMs
);
}
}