13be7c3d9a
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 23s
CI / ui (pull_request) Successful in 1m12s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m53s
Interstitial video after a confirmed play or a hint, VK-only, offline banner-only. The gate is client-mirrored: the backend puts the config cooldowns (global 5m / vs_ai 30m / hint 1m) and a suppressed flag (the no-ads / no_banner gate, same as the banner) on Profile.ads via adsFor; the client self-gates on a per-kind last-shown time in localStorage, with the VITE_ADS_STUB contour "ad fired" toast. Never fires after a pass, exchange or resign. maybeShowInterstitial + vkShowInterstitial; the codec and gateway transcode carry the ads block. Also retires the deprecated accounts.hint_balance / paid_account domain usage (expand-contract, code only — the columns stay for a later DROP so image rollback stays DB-safe): drop the Account fields and their scan, the dead account.SpendHint, account.GrantHints and the admin grant-hints action; the in-game hint display now comes wholly from the payments hint benefit. Banner eligibility and account merge no longer read the legacy flags. Tests: ads.test.ts (the client-mirrored gate), the codec ads round-trip, the gateway ads transcode test, and a profile ads-config integration test (cooldowns + suppressed under no-ads / no_banner). Docs: PAYMENTS §10 (+ru) interstitial, the decision amends, backend README, the plan.
250 lines
8.6 KiB
TypeScript
250 lines
8.6 KiB
TypeScript
// automatically generated by the FlatBuffers compiler, do not modify
|
|
|
|
import * as flatbuffers from 'flatbuffers';
|
|
|
|
import { AdsInfo } from '../scrabblefb/ads-info.js';
|
|
import { BannerInfo } from '../scrabblefb/banner-info.js';
|
|
import { DictVersion } from '../scrabblefb/dict-version.js';
|
|
|
|
|
|
export class Profile {
|
|
bb: flatbuffers.ByteBuffer|null = null;
|
|
bb_pos = 0;
|
|
__init(i:number, bb:flatbuffers.ByteBuffer):Profile {
|
|
this.bb_pos = i;
|
|
this.bb = bb;
|
|
return this;
|
|
}
|
|
|
|
static getRootAsProfile(bb:flatbuffers.ByteBuffer, obj?:Profile):Profile {
|
|
return (obj || new Profile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
}
|
|
|
|
static getSizePrefixedRootAsProfile(bb:flatbuffers.ByteBuffer, obj?:Profile):Profile {
|
|
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
return (obj || new Profile()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
}
|
|
|
|
userId():string|null
|
|
userId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
userId(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;
|
|
}
|
|
|
|
displayName():string|null
|
|
displayName(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
displayName(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
preferredLanguage():string|null
|
|
preferredLanguage(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
preferredLanguage(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 8);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
timeZone():string|null
|
|
timeZone(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
timeZone(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 10);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
hintBalance():number {
|
|
const offset = this.bb!.__offset(this.bb_pos, 12);
|
|
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
|
}
|
|
|
|
blockChat():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 14);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
}
|
|
|
|
blockFriendRequests():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 16);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
}
|
|
|
|
isGuest():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 18);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
}
|
|
|
|
awayStart():string|null
|
|
awayStart(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
awayStart(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 20);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
awayEnd():string|null
|
|
awayEnd(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
awayEnd(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 22);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
notificationsInAppOnly():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 24);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : true;
|
|
}
|
|
|
|
banner(obj?:BannerInfo):BannerInfo|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 26);
|
|
return offset ? (obj || new BannerInfo()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
|
}
|
|
|
|
variantPreferences(index: number):string
|
|
variantPreferences(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
|
variantPreferences(index: number,optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 28);
|
|
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
|
}
|
|
|
|
variantPreferencesLength():number {
|
|
const offset = this.bb!.__offset(this.bb_pos, 28);
|
|
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
}
|
|
|
|
email():string|null
|
|
email(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
email(optionalEncoding?:any):string|Uint8Array|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 30);
|
|
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
}
|
|
|
|
telegramLinked():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 32);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
}
|
|
|
|
vkLinked():boolean {
|
|
const offset = this.bb!.__offset(this.bb_pos, 34);
|
|
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
}
|
|
|
|
dictVersions(index: number, obj?:DictVersion):DictVersion|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 36);
|
|
return offset ? (obj || new DictVersion()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
|
}
|
|
|
|
dictVersionsLength():number {
|
|
const offset = this.bb!.__offset(this.bb_pos, 36);
|
|
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
}
|
|
|
|
ads(obj?:AdsInfo):AdsInfo|null {
|
|
const offset = this.bb!.__offset(this.bb_pos, 38);
|
|
return offset ? (obj || new AdsInfo()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
|
}
|
|
|
|
static startProfile(builder:flatbuffers.Builder) {
|
|
builder.startObject(18);
|
|
}
|
|
|
|
static addUserId(builder:flatbuffers.Builder, userIdOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(0, userIdOffset, 0);
|
|
}
|
|
|
|
static addDisplayName(builder:flatbuffers.Builder, displayNameOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(1, displayNameOffset, 0);
|
|
}
|
|
|
|
static addPreferredLanguage(builder:flatbuffers.Builder, preferredLanguageOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(2, preferredLanguageOffset, 0);
|
|
}
|
|
|
|
static addTimeZone(builder:flatbuffers.Builder, timeZoneOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(3, timeZoneOffset, 0);
|
|
}
|
|
|
|
static addHintBalance(builder:flatbuffers.Builder, hintBalance:number) {
|
|
builder.addFieldInt32(4, hintBalance, 0);
|
|
}
|
|
|
|
static addBlockChat(builder:flatbuffers.Builder, blockChat:boolean) {
|
|
builder.addFieldInt8(5, +blockChat, +false);
|
|
}
|
|
|
|
static addBlockFriendRequests(builder:flatbuffers.Builder, blockFriendRequests:boolean) {
|
|
builder.addFieldInt8(6, +blockFriendRequests, +false);
|
|
}
|
|
|
|
static addIsGuest(builder:flatbuffers.Builder, isGuest:boolean) {
|
|
builder.addFieldInt8(7, +isGuest, +false);
|
|
}
|
|
|
|
static addAwayStart(builder:flatbuffers.Builder, awayStartOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(8, awayStartOffset, 0);
|
|
}
|
|
|
|
static addAwayEnd(builder:flatbuffers.Builder, awayEndOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(9, awayEndOffset, 0);
|
|
}
|
|
|
|
static addNotificationsInAppOnly(builder:flatbuffers.Builder, notificationsInAppOnly:boolean) {
|
|
builder.addFieldInt8(10, +notificationsInAppOnly, +true);
|
|
}
|
|
|
|
static addBanner(builder:flatbuffers.Builder, bannerOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(11, bannerOffset, 0);
|
|
}
|
|
|
|
static addVariantPreferences(builder:flatbuffers.Builder, variantPreferencesOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(12, variantPreferencesOffset, 0);
|
|
}
|
|
|
|
static createVariantPreferencesVector(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 startVariantPreferencesVector(builder:flatbuffers.Builder, numElems:number) {
|
|
builder.startVector(4, numElems, 4);
|
|
}
|
|
|
|
static addEmail(builder:flatbuffers.Builder, emailOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(13, emailOffset, 0);
|
|
}
|
|
|
|
static addTelegramLinked(builder:flatbuffers.Builder, telegramLinked:boolean) {
|
|
builder.addFieldInt8(14, +telegramLinked, +false);
|
|
}
|
|
|
|
static addVkLinked(builder:flatbuffers.Builder, vkLinked:boolean) {
|
|
builder.addFieldInt8(15, +vkLinked, +false);
|
|
}
|
|
|
|
static addDictVersions(builder:flatbuffers.Builder, dictVersionsOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(16, dictVersionsOffset, 0);
|
|
}
|
|
|
|
static createDictVersionsVector(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 startDictVersionsVector(builder:flatbuffers.Builder, numElems:number) {
|
|
builder.startVector(4, numElems, 4);
|
|
}
|
|
|
|
static addAds(builder:flatbuffers.Builder, adsOffset:flatbuffers.Offset) {
|
|
builder.addFieldOffset(17, adsOffset, 0);
|
|
}
|
|
|
|
static endProfile(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
const offset = builder.endObject();
|
|
return offset;
|
|
}
|
|
|
|
}
|