41a642ef97
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 13s
CI / ui (pull_request) Successful in 37s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m8s
Enrich the in-app live stream into a delta channel so the UI renders a move from the event without a follow-up game.state, and make the matchmaking poll a stream-down fallback. - pkg/fbs: trailing fields on opponent_moved (move+game+bag_len), your_turn (move_count), match_found (state), game_over (game), notify (account/invitation/state), MoveResult (rack+bag_len); regenerate Go + TS. - backend: notify owns the FB encoding (encode.go + payload.go input structs); game/lobby/social map their domain types in. emitMove builds the move delta; game.Service.InitialState feeds match_found/game_started the recipient's initial StateView; friends/invitations notify carry their account/invitation. The move-commit response (submit_play/pass/exchange/resign) returns the actor's refilled rack + bag size. - gateway: MoveResult transcode carries rack+bag_len. - ui: pure lib/gamedelta.ts reducer advances the per-game cache keyed on move_count (idempotent + gap-safe); app.svelte seeds the cache on match_found/game_started; Game.svelte applies the delta (commit/pass/exchange/resign drop their load()); NewGame polls only while app.streamAlive is false. - docs: ARCHITECTURE §10, FUNCTIONAL(+ru), backend/gateway/ui READMEs; PRERELEASE R4 marked done + Refinements.
76 lines
2.6 KiB
TypeScript
76 lines
2.6 KiB
TypeScript
// automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
import * as flatbuffers from 'flatbuffers';
|
|
|
|
import { AccountRef } from '../scrabblefb/account-ref.js';
|
|
import { Invitation } from '../scrabblefb/invitation.js';
|
|
import { StateView } from '../scrabblefb/state-view.js';
|
|
|
|
|
|
export class NotificationEvent {
|
|
bb: flatbuffers.ByteBuffer|null = null;
|
|
bb_pos = 0;
|
|
__init(i:number, bb:flatbuffers.ByteBuffer):NotificationEvent {
|
|
this.bb_pos = i;
|
|
this.bb = bb;
|
|
return this;
|
|
}
|
|
|
|
static getRootAsNotificationEvent(bb:flatbuffers.ByteBuffer, obj?:NotificationEvent):NotificationEvent {
|
|
return (obj || new NotificationEvent()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
}
|
|
|
|
static getSizePrefixedRootAsNotificationEvent(bb:flatbuffers.ByteBuffer, obj?:NotificationEvent):NotificationEvent {
|
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
return (obj || new NotificationEvent()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
}
|
|
|
|
kind():string|null
|
|
kind(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
kind(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;
|
|
}
|
|
|
|
account(obj?:AccountRef):AccountRef|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
return offset ? (obj || new AccountRef()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
|
}
|
|
|
|
invitation(obj?:Invitation):Invitation|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 8);
|
|
return offset ? (obj || new Invitation()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
|
}
|
|
|
|
state(obj?:StateView):StateView|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 10);
|
|
return offset ? (obj || new StateView()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
|
}
|
|
|
|
static startNotificationEvent(builder:flatbuffers.Builder) {
|
|
builder.startObject(4);
|
|
}
|
|
|
|
static addKind(builder:flatbuffers.Builder, kindOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(0, kindOffset, 0);
|
|
}
|
|
|
|
static addAccount(builder:flatbuffers.Builder, accountOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(1, accountOffset, 0);
|
|
}
|
|
|
|
static addInvitation(builder:flatbuffers.Builder, invitationOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(2, invitationOffset, 0);
|
|
}
|
|
|
|
static addState(builder:flatbuffers.Builder, stateOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(3, stateOffset, 0);
|
|
}
|
|
|
|
static endNotificationEvent(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
const offset = builder.endObject();
|
|
return offset;
|
|
}
|
|
|
|
}
|