R6(c): drop dead opponent_moved scalars (seat/action/score/total)

These pre-R4 summary scalars on OpponentMovedEvent were redundant with the
move/game delta and read by nobody — the UI codec and mock take only
move/game/bag_len, and the gateway forwards the push payload verbatim. Removed
from scrabble.fbs, the notify emit (notify/events.go) and the round-trip test;
regenerated the FB Go + TS bindings. No prod data, so the wire-slot renumber is
free and there is no DB change.
This commit is contained in:
Ilia Denisov
2026-06-10 17:06:25 +02:00
parent c31ac7088c
commit 1079878654
5 changed files with 19 additions and 126 deletions
+1 -6
View File
@@ -510,14 +510,9 @@ table GameOverEvent {
// OpponentMovedEvent carries a move another seat just committed as a delta the client applies to
// its cached game without a refetch: move is the decoded play/pass/exchange (the same record
// game.history returns), game is the post-move summary (per-seat scores, to_move, move_count,
// status) and bag_len is the bag size after the draw. The leading seat/action/score/total scalars
// are the older summary, now redundant with move/game and kept only for wire back-compat.
// status) and bag_len is the bag size after the draw.
table OpponentMovedEvent {
game_id:string;
seat:int;
action:string;
score:int;
total:int;
move:MoveRecord;
game:GameView;
bag_len:int;
+8 -64
View File
@@ -49,52 +49,8 @@ func (rcv *OpponentMovedEvent) GameId() []byte {
return nil
}
func (rcv *OpponentMovedEvent) Seat() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *OpponentMovedEvent) MutateSeat(n int32) bool {
return rcv._tab.MutateInt32Slot(6, n)
}
func (rcv *OpponentMovedEvent) Action() []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
if o != 0 {
return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
return nil
}
func (rcv *OpponentMovedEvent) Score() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *OpponentMovedEvent) MutateScore(n int32) bool {
return rcv._tab.MutateInt32Slot(10, n)
}
func (rcv *OpponentMovedEvent) Total() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
return 0
}
func (rcv *OpponentMovedEvent) MutateTotal(n int32) bool {
return rcv._tab.MutateInt32Slot(12, n)
}
func (rcv *OpponentMovedEvent) Move(obj *MoveRecord) *MoveRecord {
o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
if o != 0 {
x := rcv._tab.Indirect(o + rcv._tab.Pos)
if obj == nil {
@@ -107,7 +63,7 @@ func (rcv *OpponentMovedEvent) Move(obj *MoveRecord) *MoveRecord {
}
func (rcv *OpponentMovedEvent) Game(obj *GameView) *GameView {
o := flatbuffers.UOffsetT(rcv._tab.Offset(16))
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
if o != 0 {
x := rcv._tab.Indirect(o + rcv._tab.Pos)
if obj == nil {
@@ -120,7 +76,7 @@ func (rcv *OpponentMovedEvent) Game(obj *GameView) *GameView {
}
func (rcv *OpponentMovedEvent) BagLen() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(18))
o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
if o != 0 {
return rcv._tab.GetInt32(o + rcv._tab.Pos)
}
@@ -128,35 +84,23 @@ func (rcv *OpponentMovedEvent) BagLen() int32 {
}
func (rcv *OpponentMovedEvent) MutateBagLen(n int32) bool {
return rcv._tab.MutateInt32Slot(18, n)
return rcv._tab.MutateInt32Slot(10, n)
}
func OpponentMovedEventStart(builder *flatbuffers.Builder) {
builder.StartObject(8)
builder.StartObject(4)
}
func OpponentMovedEventAddGameId(builder *flatbuffers.Builder, gameId flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(gameId), 0)
}
func OpponentMovedEventAddSeat(builder *flatbuffers.Builder, seat int32) {
builder.PrependInt32Slot(1, seat, 0)
}
func OpponentMovedEventAddAction(builder *flatbuffers.Builder, action flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(action), 0)
}
func OpponentMovedEventAddScore(builder *flatbuffers.Builder, score int32) {
builder.PrependInt32Slot(3, score, 0)
}
func OpponentMovedEventAddTotal(builder *flatbuffers.Builder, total int32) {
builder.PrependInt32Slot(4, total, 0)
}
func OpponentMovedEventAddMove(builder *flatbuffers.Builder, move flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(move), 0)
builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(move), 0)
}
func OpponentMovedEventAddGame(builder *flatbuffers.Builder, game flatbuffers.UOffsetT) {
builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(game), 0)
builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(game), 0)
}
func OpponentMovedEventAddBagLen(builder *flatbuffers.Builder, bagLen int32) {
builder.PrependInt32Slot(7, bagLen, 0)
builder.PrependInt32Slot(3, bagLen, 0)
}
func OpponentMovedEventEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()