feat(game): race exit warnings in the turn report (#12)
Surface the inactivity-removal countdown the rules promise but the engine never reported. A race within five turns of being auto-removed for inactivity gets a personal warning in its own report; every race within three turns is listed publicly to all participants. - model: Report.PersonalExitWarning + RacesLeavingSoon ([]RaceExitNotice) - fbs: RaceExitNotice table + Report.personal_exit_warning / races_leaving_soon (regenerated Go + TS bindings) - transcoder: encode/decode both fields - engine: ReportExitWarnings fills the recipient's TTL (1..5) and lists other non-extinct races with TTL 1..3, excluding the recipient itself - ui: danger-styled personal banner + "races leaving soon" section (hidden when empty), wired into the report view, EN/RU i18n - docs: rules.txt report-section list, FUNCTIONAL.md 6.4 + RU mirror Voluntary quit and idle timeout share the TTL countdown and are not distinguished, per the agreed scope.
This commit is contained in:
@@ -489,8 +489,40 @@ func (rcv *Report) UnidentifiedGroupLength() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *Report) PersonalExitWarning() uint32 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(56))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetUint32(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *Report) MutatePersonalExitWarning(n uint32) bool {
|
||||
return rcv._tab.MutateUint32Slot(56, n)
|
||||
}
|
||||
|
||||
func (rcv *Report) RacesLeavingSoon(obj *RaceExitNotice, j int) bool {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(58))
|
||||
if o != 0 {
|
||||
x := rcv._tab.Vector(o)
|
||||
x += flatbuffers.UOffsetT(j) * 4
|
||||
x = rcv._tab.Indirect(x)
|
||||
obj.Init(rcv._tab.Bytes, x)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (rcv *Report) RacesLeavingSoonLength() int {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(58))
|
||||
if o != 0 {
|
||||
return rcv._tab.VectorLen(o)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func ReportStart(builder *flatbuffers.Builder) {
|
||||
builder.StartObject(26)
|
||||
builder.StartObject(28)
|
||||
}
|
||||
func ReportAddVersion(builder *flatbuffers.Builder, version uint64) {
|
||||
builder.PrependUint64Slot(0, version, 0)
|
||||
@@ -624,6 +656,15 @@ func ReportAddUnidentifiedGroup(builder *flatbuffers.Builder, unidentifiedGroup
|
||||
func ReportStartUnidentifiedGroupVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
|
||||
return builder.StartVector(4, numElems, 4)
|
||||
}
|
||||
func ReportAddPersonalExitWarning(builder *flatbuffers.Builder, personalExitWarning uint32) {
|
||||
builder.PrependUint32Slot(26, personalExitWarning, 0)
|
||||
}
|
||||
func ReportAddRacesLeavingSoon(builder *flatbuffers.Builder, racesLeavingSoon flatbuffers.UOffsetT) {
|
||||
builder.PrependUOffsetTSlot(27, flatbuffers.UOffsetT(racesLeavingSoon), 0)
|
||||
}
|
||||
func ReportStartRacesLeavingSoonVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
|
||||
return builder.StartVector(4, numElems, 4)
|
||||
}
|
||||
func ReportEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
||||
return builder.EndObject()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user