diff --git a/check/check.go b/check/check.go index e8362551..4cc6936b 100644 --- a/check/check.go +++ b/check/check.go @@ -13,6 +13,7 @@ import ( "github.com/paralin/modlock/boards" "github.com/paralin/modlock/metrics" + "github.com/paralin/modlock/persist" "github.com/paralin/modlock/sandbox" "github.com/paralin/modlock/settings" "github.com/paralin/modlock/src/wasm" @@ -68,6 +69,9 @@ func Mod(ctx context.Context, dist fs.FS) (*wasm.Manifest, error) { if err := boards.Validate(m); err != nil { return nil, err } + if err := persist.Validate(m); err != nil { + return nil, err + } // Run a module; an interpreted mod's runtime is Modlock's own. switch { diff --git a/cmd/modlock/persist.go b/cmd/modlock/persist.go new file mode 100644 index 00000000..1acb93f9 --- /dev/null +++ b/cmd/modlock/persist.go @@ -0,0 +1,122 @@ +package main + +import ( + "context" + "os" + "path/filepath" + "sync" + + "github.com/paralin/modlock/persist" + "github.com/paralin/modlock/project" + "github.com/paralin/modlock/src/host_app/control" + "github.com/paralin/modlock/src/wasm" + "github.com/pkg/errors" +) + +// persistDir is the directory a local session keeps the records of the mod +// slug built at path in: the project's own when the build is a project's, +// otherwise one in Modlock's configuration directory. Empty keeps them for +// the session only. +func persistDir(path, slug string) string { + if fixtures := projectFixtures(path); fixtures != "" { + return filepath.Join(filepath.Dir(fixtures), persist.Dir) + } + if config := configPath("persist"); config != "" && slug != "" { + return filepath.Join(config, slug) + } + return "" +} + +// localPersist answers the persist calls of a local server's mods from files +// on this computer, so a mod's records survive a restart of the session. It +// learns which player is in each slot from the host's events. Persist is +// always answered here, even when the session forwards other services: the +// host names only a slot, so a forwarded call could not say whose record it +// reaches. +type localPersist struct { + // mods are the mods that declare persist record types, by slug. + mods map[string]*persistMod + // mu guards slots. + mu sync.Mutex + // slots are the players in the server, by slot. + slots map[int32]uint64 +} + +// persistMod is one mod's declared record types and the store of its records. +type persistMod struct { + manifest *wasm.Manifest + store *persist.Store +} + +// newLocalPersist returns the local persist service of the mods built at +// dirs, printing where each mod's records are kept. +func newLocalPersist(out *printer, dirs []string) (*localPersist, error) { + local := &localPersist{mods: map[string]*persistMod{}, slots: map[int32]uint64{}} + for _, dir := range dirs { + manifest, err := project.ReadManifest(dir) + if err != nil { + return nil, err + } + if len(manifest.GetPersist()) == 0 { + continue + } + slug := manifest.GetSlug() + records := persistDir(dir, slug) + if records == "" { + if records, err = os.MkdirTemp("", "modlock-persist-"); err != nil { + return nil, err + } + } + store, err := persist.Open(records) + if err != nil { + return nil, err + } + local.mods[slug] = &persistMod{manifest: manifest, store: store} + out.mark("·", dim, slug+": service persist: kept in "+records) + } + return local, nil +} + +// declares reports whether the mod slug keeps records here. +func (l *localPersist) declares(slug string) bool { + return l.mods[slug] != nil +} + +// follow notes the players who join and leave, then passes event to events. +func (l *localPersist) follow(events func(*control.HostEvent)) func(*control.HostEvent) { + return func(event *control.HostEvent) { + if joined := event.GetJoined(); joined != nil { + l.mu.Lock() + l.slots[joined.GetSlot()] = joined.GetSteamId() + l.mu.Unlock() + } + if left := event.GetLeft(); left != nil { + l.mu.Lock() + delete(l.slots, left.GetSlot()) + l.mu.Unlock() + } + events(event) + } +} + +// player returns the SteamID64 of the player in slot; a bot has none. +func (l *localPersist) player(slot int32) (uint64, bool) { + l.mu.Lock() + defer l.mu.Unlock() + steamID := l.slots[slot] + return steamID, steamID != 0 +} + +// answer answers the persist calls of the mods that keep records here and +// passes every other forwarded call to next, which may be nil. +func (l *localPersist) answer(next func(context.Context, *control.ServiceCall) ([]byte, error)) func(context.Context, *control.ServiceCall) ([]byte, error) { + return func(ctx context.Context, call *control.ServiceCall) ([]byte, error) { + if mod := l.mods[call.GetMod()]; mod != nil && call.GetService() == persist.Service { + return persist.Answer(mod.store, mod.manifest, l.player, call.GetMethod(), call.GetPayload()) + } + if next == nil { + return nil, errors.New("this session forwards no services") + } + return next(ctx, call) + } +} diff --git a/cmd/modlock/persist_test.go b/cmd/modlock/persist_test.go new file mode 100644 index 00000000..3b6f718d --- /dev/null +++ b/cmd/modlock/persist_test.go @@ -0,0 +1,90 @@ +package main + +import ( + "context" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/paralin/modlock/src/host_app/control" + persistpb "github.com/paralin/modlock/src/wasm/persist" +) + +// TestLocalPersist answers a game session's persist calls from the project's +// files for the player the host says is in each slot, even when the session +// forwards its other services, and keeps the records past the session. +func TestLocalPersist(t *testing.T) { + // A project declares a record type and another service. + dir := t.TempDir() + build := filepath.Join(dir, "build") + manifest := `{"slug":"prophunt","services":[{"name":"persist"},{"name":"example.drills.v1"}],` + + `"persist":[{"name":"stats","writers":"WRITERS_SERVERS","fields":{"roundsWon":{"kind":"KIND_COUNT"}}}]}` + for _, file := range []string{filepath.Join(dir, "mod.json"), filepath.Join(build, "mod.json")} { + if err := os.MkdirAll(filepath.Dir(file), 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(file, []byte(manifest), 0o644); err != nil { + t.Fatal(err) + } + } + + // The fixtures forward persist to this computer, the rest to the origin. + records, err := newLocalPersist(&printer{brief: true}, []string{build}) + if err != nil { + t.Fatal(err) + } + path := filepath.Join(t.TempDir(), "fixtures.pb") + if _, err := writeFixtures(&printer{brief: true}, []string{build}, path, "http://127.0.0.1:9", records); err != nil { + t.Fatal(err) + } + data, _ := os.ReadFile(path) + fixtures := &control.Fixtures{} + if err := fixtures.UnmarshalVT(data); err != nil { + t.Fatal(err) + } + var targets []string + for _, forward := range fixtures.GetForwards() { + targets = append(targets, forward.GetService()+" "+forward.GetTarget()) + } + if strings.Join(targets, ", ") != "persist this computer, example.drills.v1 http://127.0.0.1:9" { + t.Fatalf("forwards %v", targets) + } + + // A player joins slot 2 and a bot slot 3. + events := records.follow(func(*control.HostEvent) {}) + events(&control.HostEvent{Body: &control.HostEvent_Joined{Joined: &control.PlayerJoined{Slot: 2, SteamId: 76561197960265729}}}) + events(&control.HostEvent{Body: &control.HostEvent_Joined{Joined: &control.PlayerJoined{Slot: 3}}}) + var passed []string + answer := records.answer(func(_ context.Context, call *control.ServiceCall) ([]byte, error) { + passed = append(passed, call.GetService()) + return nil, nil + }) + update := func(slot int32) error { + payload, _ := (&persistpb.UpdateRequest{Player: slot, Type: "stats", UpdateKey: "round-1", Ops: []*persistpb.Op{{Field: "roundsWon", Op: &persistpb.Op_Add{Add: 1}}}}).MarshalVT() + _, err := answer(t.Context(), &control.ServiceCall{Mod: "prophunt", Service: "persist", Method: "Update", Payload: payload}) + return err + } + + // The player's update lands in the project's file; the bot's is refused. + if err := update(2); err != nil { + t.Fatal(err) + } + if _, err := os.Stat(filepath.Join(dir, ".modlock", "persist", "76561197960265729.json")); err != nil { + t.Fatal(err) + } + if err := update(3); err == nil || !strings.Contains(err.Error(), "no player is in slot 3") { + t.Fatalf("bot: %v", err) + } + + // After the player leaves, the slot is empty again. + events(&control.HostEvent{Body: &control.HostEvent_Left{Left: &control.PlayerLeft{Slot: 2}}}) + if err := update(2); err == nil { + t.Fatal("a left player's slot still reaches their record") + } + + // Other services go to the forwarder. + if _, err := answer(t.Context(), &control.ServiceCall{Mod: "prophunt", Service: "example.drills.v1"}); err != nil || len(passed) != 1 { + t.Fatalf("forwarded %v %v", passed, err) + } +} diff --git a/cmd/modlock/play.go b/cmd/modlock/play.go index 13751d83..90f3b70a 100644 --- a/cmd/modlock/play.go +++ b/cmd/modlock/play.go @@ -13,6 +13,7 @@ import ( "github.com/aperturerobotics/cli" modcli "github.com/paralin/modlock/cli" "github.com/paralin/modlock/js" + "github.com/paralin/modlock/persist" "github.com/paralin/modlock/project" modpublish "github.com/paralin/modlock/publish" "github.com/paralin/modlock/sandbox" @@ -194,6 +195,7 @@ func startSession(c *cli.Context, out *printer, mods []string, logPath string) ( }, Events: events, Fixtures: projectFixtures, + Persist: persistDir, }), nil } @@ -238,8 +240,14 @@ func startServer(c *cli.Context, out *printer, events func(*control.HostEvent), } // Hand the host the projects' service fixtures, or the services to // forward, naming who answers each service the mods call. + // Persist is answered here from the projects' files, whatever else is + // forwarded. forward := strings.TrimSuffix(c.String("forward-services"), "/") - fixtures, err := writeFixtures(out, mods, filepath.Join(filepath.Dir(logPath), "fixtures.pb"), forward) + records, err := newLocalPersist(out, mods) + if err != nil { + return nil, err + } + fixtures, err := writeFixtures(out, mods, filepath.Join(filepath.Dir(logPath), "fixtures.pb"), forward, records) if err != nil { return nil, err } @@ -247,6 +255,8 @@ func startServer(c *cli.Context, out *printer, events func(*control.HostEvent), if err != nil { return nil, err } + answer = records.answer(answer) + events = records.follow(events) running, err := session.Start(c.Context, session.Config{ Version: Version, Mods: mods, @@ -280,10 +290,10 @@ func startServer(c *cli.Context, out *printer, events func(*control.HostEvent), // writeFixtures writes the service fixtures of the projects whose builds are // mods to path, as the host's --fixtures file, and prints which answers each -// service a mod names: a fixture or nobody. It returns path, or empty when no -// mod has a fixture. The host refuses to start a mod whose needed service -// nobody provides. -func writeFixtures(out *printer, mods []string, path, forward string) (string, error) { +// service a mod names: a fixture, the local persist store or nobody. It +// returns path, or empty when no mod has a fixture. The host refuses to start +// a mod whose needed service nobody provides. +func writeFixtures(out *printer, mods []string, path, forward string, records *localPersist) (string, error) { // Read each named service's fixture from its mod's project, or forward // every service to the origin forward names. fixtures := &control.Fixtures{} @@ -295,6 +305,10 @@ func writeFixtures(out *printer, mods []string, path, forward string) (string, e slug := manifest.GetSlug() for _, service := range manifest.GetServices() { name := service.GetName() + if name == persist.Service && records.declares(slug) { + fixtures.Forwards = append(fixtures.Forwards, &control.Forward{Mod: slug, Service: name, Target: "this computer"}) + continue + } if forward != "" { out.mark("·", dim, slug+": service "+name+": forwarded to "+forward) fixtures.Forwards = append(fixtures.Forwards, &control.Forward{Mod: slug, Service: name, Target: forward}) diff --git a/cmd/modlock/play_test.go b/cmd/modlock/play_test.go index f5d0b5bb..f9ed84d4 100644 --- a/cmd/modlock/play_test.go +++ b/cmd/modlock/play_test.go @@ -39,7 +39,7 @@ func TestWriteFixtures(t *testing.T) { // Write the host's file, keeping what the session prints. path := filepath.Join(t.TempDir(), "fixtures.pb") printed, written := capture(t, func() (string, error) { - return writeFixtures(&printer{}, []string{build}, path, "") + return writeFixtures(&printer{}, []string{build}, path, "", &localPersist{}) }) if written != path { t.Fatalf("wrote %q, want %q", written, path) @@ -81,7 +81,7 @@ func TestWriteFixtures(t *testing.T) { } // A built mod outside a project, with no fixture, writes no file. - none, err := writeFixtures(&printer{brief: true}, []string{dir}, filepath.Join(t.TempDir(), "none.pb"), "") + none, err := writeFixtures(&printer{brief: true}, []string{dir}, filepath.Join(t.TempDir(), "none.pb"), "", &localPersist{}) if err != nil || none != "" { t.Fatalf("a mod without fixtures wrote %q, %v", none, err) } @@ -89,7 +89,7 @@ func TestWriteFixtures(t *testing.T) { // A forward origin forwards every service the mod names, fixture or not. forwarded := filepath.Join(t.TempDir(), "forwarded.pb") printed, _ = capture(t, func() (string, error) { - return writeFixtures(&printer{}, []string{build}, forwarded, "http://127.0.0.1:9") + return writeFixtures(&printer{}, []string{build}, forwarded, "http://127.0.0.1:9", &localPersist{}) }) data, err = os.ReadFile(forwarded) if err != nil { diff --git a/docs/content/guides/players.mdx b/docs/content/guides/players.mdx index d9003aba..76d968f6 100644 --- a/docs/content/guides/players.mdx +++ b/docs/content/guides/players.mdx @@ -342,6 +342,7 @@ Python spells each call in `snake_case`, and Go capitalizes it. | `player.addMetric(name, value, label?)` | Add to the player's total of a metric. | | `reportScore(player, board, value, options?)`, `reportMatch(board, places, options?)` | Report a score or a match's places to a board. | | `readBoard(board, read?)` | Read a page of a board, such as its top five. | +| `persist.get(player, type)`, `persist.getMany(players, type)`, `persist.update(player, type, changes, options?, done?)` | Read or change the player's record of a [persist](/reference/manifest#persist) type. | | `player.handoff(text)`, `handedOff()` | Hand the player's state to the next build, and read it back. | | `player.watchMovement(true)` | Add the hero's movement, landings and wall jumps to each frame. | | `playCamera(player, options)`, `cameraPulse`, `cameraShake` | Play curves on the camera, TypeScript only; see [Camera moves](/guides/camera). | diff --git a/docs/content/reference/manifest.mdx b/docs/content/reference/manifest.mdx index 56d460d6..4db66904 100644 --- a/docs/content/reference/manifest.mdx +++ b/docs/content/reference/manifest.mdx @@ -30,6 +30,7 @@ required fields: | `settings` | | [Choices](/reference/manifest#settings) each player makes about the mod. | | `metrics` | | Running [totals](/reference/manifest#metrics) for each player, which the mod adds to. | | `boards` | | [Rankings](/reference/manifest#boards) the mod reports scores to. | +| `persist` | | [Records](/reference/manifest#persist) the mod keeps for each player across sessions, such as stats or unlocks. | | `services` | | [Services](/reference/manifest#services) the mod calls, each needed or optional. | | `freeForAll` | | `true` starts the mod in [free-for-all](/guides/toolkit#play-free-for-all). | @@ -248,6 +249,63 @@ scores, decides who may report and how far it trusts each server. Under `modlock dev`, where no such service runs, the host checks each score against its board and logs it, and the mod logs any score the host does not accept. +## Persist + +```json +"services": [{ "name": "persist" }], +"persist": [ + { + "name": "stats", + "writers": "WRITERS_SERVERS", + "fields": { + "roundsWon": { "kind": "KIND_COUNT" }, + "longestHide": { "kind": "KIND_MAX" }, + "title": { "kind": "KIND_STRING", "maxBytes": 32 }, + "unlocks": { "kind": "KIND_TAGS" } + } + } +] +``` + +A mod keeps one record of each declared type for each player, up to 8 types, +and names the `persist` service. Each type has up to 32 fields, and a record +holds up to 8 KB. Keep `mod.json` under 256 KiB: Hyperline refuses every +persist call against a release whose `mod.json` is larger, though the release +still publishes. + +| Kind | Holds | Changes | +| ------------- | ---------------------------------------------------------------- | -------------------------- | +| `KIND_COUNT` | A whole number from zero up. | `add`, `set` | +| `KIND_NUMBER` | Any number. | `add`, `max`, `min`, `set` | +| `KIND_MAX` | The highest number it was given. | `max` | +| `KIND_STRING` | Text of up to `maxBytes` bytes: 64 unless declared, at most 256. | `set` | +| `KIND_TAGS` | Up to 256 sorted tags of up to 32 bytes. | `insert`, `remove` | + +`writers` is who may change a type's records: `WRITERS_SERVERS` takes changes +only from a game server the host trusts, for values that carry its trust; +`WRITERS_PLAYERS` also takes the player's own choices. + +`persist.get(player, 'stats')` answers `loading` until the record arrives a +frame or more later, then `loaded` with the record, or `unavailable` with why; +a record never written loads empty. `persist.update(player, 'stats', { +roundsWon: { add: 1 }, longestHide: { max: 41 } }, { key: roundId })` sends up +to 32 changes the host applies all or none. Changes merge rather than replace, +so two servers that update one player at once both land; of two `set`s the +later wins. A `key` of up to 64 bytes makes a resent update count once: the +host keeps each record's last 64 keys. An update with an `add` needs a key and +is refused without one. An update the host answers as taking too long may +still have been kept: send it again with the same key, and do not act as if +nothing was written. A change outside its kind's rules, an undeclared +field, a field whose stored value is of another kind than mod.json now +declares, or a record past its bound is refused whole, and the record is +unchanged. + +`modlock play` keeps the records itself, in the sandbox and in the game, one +file per player in the project's `.modlock/persist/`, so they survive a +restart. In the game it learns the player in each slot as they join, and +refuses a bot's record. It answers persist itself even with +`--forward-services`. + ## Services Name each service the mod calls in `mod.json`; a service is needed unless it diff --git a/docs/content/start/examples.mdx b/docs/content/start/examples.mdx index 6fe9cb80..7f4d7914 100644 --- a/docs/content/start/examples.mdx +++ b/docs/content/start/examples.mdx @@ -19,6 +19,7 @@ run `modlock dev` to play it. | [`inventory`](https://github.com/paralin/modlock/tree/master/examples/inventory) | A drag inventory in the mod's own layout, script and style sheet. | | [`bounty`](https://github.com/paralin/modlock/tree/master/examples/bounty) | A Luau free-for-all: a bounty marker, damage hooks, flares, bots. | | [`race`](https://github.com/paralin/modlock/tree/master/examples/race) | A Go checkpoint race: a marked course, laps, resets, unit tests. | +| [`prop-stats`](https://github.com/paralin/modlock/tree/master/examples/prop-stats) | A player's stats and unlocks kept across sessions with persist. | | [`hello-luau`](https://github.com/paralin/modlock/tree/master/examples/hello-luau) | The smallest mod in Luau. | | [`hello-python`](https://github.com/paralin/modlock/tree/master/examples/hello-python) | The smallest mod in Python. | | [`hello-go`](https://github.com/paralin/modlock/tree/master/examples/hello-go) | The smallest mod in Go. | diff --git a/examples/prop-stats/.gitignore b/examples/prop-stats/.gitignore new file mode 100644 index 00000000..fe3133d1 --- /dev/null +++ b/examples/prop-stats/.gitignore @@ -0,0 +1,3 @@ +/build/ +/node_modules/ +/.modlock/ diff --git a/examples/prop-stats/main.ts b/examples/prop-stats/main.ts new file mode 100644 index 00000000..4e080045 --- /dev/null +++ b/examples/prop-stats/main.ts @@ -0,0 +1,77 @@ +// prop-stats keeps a prop hunt player's stats across sessions in the stats +// record mod.json declares under persist. It reads each player's record when +// they join and logs it once it arrives; /win ends a round the player won, +// with how many seconds they stayed hidden, counting the win, keeping the +// longest hide and unlocking the cone prop at three wins. +import { + command, + log, + onFrame, + onPlayerJoin, + persist, + type PersistRecord, + type Player, + toast, +} from 'modlock' + +/** waiting holds the players whose record the mod has asked for and not logged. */ +const waiting = new Set() + +/** round numbers the rounds this session ends, so a resent update counts once. */ +let round = 0 + +/** describe writes a record's stats as one line. */ +function describe(record: PersistRecord): string { + const unlocks = (record.unlocks as readonly string[] | undefined) ?? [] + return `roundsWon=${String(record.roundsWon ?? 0)} longestHide=${String(record.longestHide ?? 0)} unlocks=[${unlocks.join(',')}]` +} + +// Read the record on join; it arrives a frame or more later. +onPlayerJoin(({ connection }) => { + persist.get(connection.player, 'stats') + waiting.add(connection.player) +}) + +// Log each record once it arrives. +onFrame(() => { + for (const player of waiting) { + const read = persist.get(player, 'stats') + if (read.state === 'loading') continue + waiting.delete(player) + if (read.state === 'unavailable') { + log(`player ${player.slot} stats unavailable: ${read.error}`) + continue + } + log(`player ${player.slot} stats read: ${describe(read.record)}`) + } +}) + +// End a round the player won, after hiding for the given seconds. +command('win', (player, args) => { + const hidden = Number(args) || 0 + round++ + const key = `${Date.now()}-${round}` + persist.update( + player, + 'stats', + { roundsWon: { add: 1 }, longestHide: { max: hidden } }, + { key }, + (record, error) => { + if (!record) { + toast(player, `Your win was not saved: ${error}`) + return + } + log(`player ${player.slot} stats written: ${describe(record)}`) + if (Number(record.roundsWon ?? 0) >= 3) { + persist.update( + player, + 'stats', + { unlocks: { insert: 'cone' } }, + { + key: `${key}-cone`, + }, + ) + } + }, + ) +}) diff --git a/examples/prop-stats/mod.json b/examples/prop-stats/mod.json new file mode 100644 index 00000000..377baa7a --- /dev/null +++ b/examples/prop-stats/mod.json @@ -0,0 +1,18 @@ +{ + "slug": "prop-stats", + "name": "Prop Stats", + "version": "0.1.0", + "language": "LANGUAGE_TYPESCRIPT", + "services": [{ "name": "persist" }], + "persist": [ + { + "name": "stats", + "writers": "WRITERS_SERVERS", + "fields": { + "roundsWon": { "kind": "KIND_COUNT" }, + "longestHide": { "kind": "KIND_MAX" }, + "unlocks": { "kind": "KIND_TAGS" } + } + } + ] +} diff --git a/examples/prop-stats/tsconfig.json b/examples/prop-stats/tsconfig.json new file mode 100644 index 00000000..8040e185 --- /dev/null +++ b/examples/prop-stats/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "es2023", + "module": "esnext", + "moduleResolution": "bundler", + "lib": ["es2023"], + "types": [], + "jsx": "react-jsx", + "jsxImportSource": "modlock", + "strict": true, + "noEmit": true, + "paths": { + "modlock": ["../../js/src/index.ts"], + "modlock/jsx-runtime": ["../../js/src/index.ts"] + } + }, + "include": ["**/*", "../../js/src/globals.d.ts"], + "exclude": ["build", "node_modules"] +} diff --git a/js/src/index.ts b/js/src/index.ts index 108ef861..ceb8e2e2 100644 --- a/js/src/index.ts +++ b/js/src/index.ts @@ -40,19 +40,19 @@ import { type PlayerJoinedEvent, type PlayerLeftEvent, serveMod, - type ServiceFailure, - startServiceCall, } from './host.gen.js' import { serveEvents } from './host.js' import { Cast, type Want } from './cast.js' import { connection, keepPlayers } from './players.js' import { advancePuppets } from './puppet.js' import { settleRestore } from './restore.js' +import { endServiceCall } from './service-later.js' import { advance, after } from './timer.js' import { change, press, tick } from './ui.js' export * as vector from './vector.js' export { Buttons, Layers } from './bits.js' +export { callServiceLater, type ServiceDone } from './service-later.js' export { after, every, sequence, type Timer } from './timer.js' export { type CameraMove, @@ -152,6 +152,16 @@ export { export { type HeroSnapshot, restoreHero } from './restore.js' export { type ReplayedHit, replayDamage } from './replayed-damage.js' export { type CatalogEntry, Dropper, dropperButtons } from './dropper.js' +export { + persist, + type PersistChange, + type PersistChanges, + type PersistDone, + type PersistOptions, + type PersistRead, + type PersistRecord, + type PersistValue, +} from './persist.js' export { type BoardPage, type BoardRead, @@ -237,47 +247,6 @@ export function serve(service: string, handler: Service): void { services.set(service, { handler }) } -/** - * ServiceDone ends one callServiceLater: with the reply, or without one and - * with the error and the failure that says why. - */ -export type ServiceDone = ( - reply: Uint8Array | undefined, - error?: string, - failure?: ServiceFailure, -) => void - -/** - * callServiceLater calls method of a service the host provides and returns at - * once; done runs in a later frame with the answer, or with an error when - * the service refused, the call waited past timeoutMilliseconds or nobody - * provides the service. Zero waits the host's longest, 30 seconds. done runs - * once while the mod runs; calls still waiting when the mod stops end with - * it. - */ -export function callServiceLater( - service: string, - method: string, - payload: Uint8Array, - done: ServiceDone, - timeoutMilliseconds = 0, -): void { - // A call the host refuses to start ends in the next frame as well, so done - // never runs before this returns. - const call = startServiceCall(service, method, payload, timeoutMilliseconds) - if (call === undefined) { - after(0, () => - done( - undefined, - `the host did not start the call to ${service}`, - 'unavailable', - ), - ) - return - } - waiting.set(call, done) -} - /** * command calls handler when a player types /name in chat or their client * sends the console command name to the server. The handler runs with the @@ -691,9 +660,6 @@ const commands = new Map< /** services maps each service the mod serves to its handler. */ const services = new Map() -/** waiting maps each started service call's number to the function its end runs. */ -const waiting = new Map() - // Each list runs in registration order. const starts: ((args: readonly string[]) => void)[] = [] const frames: ((frame: FrameEvent) => void)[] = [] @@ -818,19 +784,7 @@ const handlers: ModHandlers = { }, serviceReplied(event) { - // Each call ends once; a number the mod no longer waits for is ignored. - const done = waiting.get(event.call) - if (!done) { - return - } - waiting.delete(event.call) - - // A failure ends the call without a reply. - if (event.failure && event.failure !== 'none') { - done(undefined, event.error, event.failure) - return - } - done(event.payload) + endServiceCall(event) }, // scriptc types an unannotated method that returns literals of different diff --git a/js/src/persist.ts b/js/src/persist.ts new file mode 100644 index 00000000..235d2601 --- /dev/null +++ b/js/src/persist.ts @@ -0,0 +1,296 @@ +// Persist keeps records for each player across sessions, such as a player's +// stats or unlocks, in the record types a mod declares in mod.json under +// persist, over the host's persist service. A read starts with the host and +// answers loading until the record arrives a frame or more later; an update +// sends field changes the host applies whole, so two servers that update one +// player at once both land. +// +// const stats = persist.get(player, 'stats') +// if (stats.state === 'loaded') log('rounds won', stats.record.roundsWon ?? 0) +// persist.update(player, 'stats', { roundsWon: { add: 1 } }, { key: roundId }) + +import * as persistPb from '../../src/wasm/persist/persist.pb.js' +import { callServiceLater } from './service-later.js' +import { log, type Player } from './host.gen.js' + +/** service names the host service that keeps records. */ +const service = 'persist' + +/** PersistValue is one field's value: a number, a string or a tags field's members. */ +export type PersistValue = number | string | readonly string[] + +/** PersistRecord is one player's record: each field written so far, by name. */ +export type PersistRecord = Readonly> + +/** + * PersistRead is what persist.get knows of a record: loading until the host + * answers, then loaded, or unavailable with why, such as a host that keeps + * no records. + */ +export type PersistRead = + | { readonly state: 'loading' } + | { readonly state: 'loaded'; readonly record: PersistRecord } + | { readonly state: 'unavailable'; readonly error: string } + +/** + * PersistChange is one change to one field: add to a count or number, max + * or min a number, set a count, number or string, insert or remove a tag. + */ +export type PersistChange = + | { readonly add: number } + | { readonly max: number } + | { readonly min: number } + | { readonly set: number | string } + | { readonly insert: string } + | { readonly remove: string } + +/** PersistChanges names the changes of one update by field, one or several each. */ +export type PersistChanges = Readonly< + Record +> + +/** PersistOptions describe one update. */ +export interface PersistOptions { + /** + * key identifies the change, such as a round, so a resent update counts + * once. An update that adds needs one. + */ + key?: string + /** record selects the record; leave it unset, as hosts keep one record of each type for now. */ + record?: string +} + +/** + * PersistDone ends one update: with the record after it, and whether its key + * made it a repeat the host left out, or with the error that refused it. + */ +export type PersistDone = ( + record: PersistRecord | undefined, + error?: string, + repeated?: boolean, +) => void + +/** Entry is what the mod knows of one player's record of one type. */ +interface Entry { + read: PersistRead + /** started numbers the last request started for the record. */ + started: number + /** applied numbers the request whose answer read holds. */ + applied: number +} + +/** + * entries holds each player's records by type. A Player is a new object when + * a new connection takes the slot, so a record never passes to the next + * player in a slot. + */ +const entries = new WeakMap>() + +/** requests numbers the requests the mod started, in order. */ +let requests = 0 + +/** entry returns the record of type for player, made empty when the mod knows none. */ +function entry(player: Player, type: string): Entry { + // Find the player's records, then the type's, making each when missing. + let records = entries.get(player) + if (!records) { + records = new Map() + entries.set(player, records) + } + let known = records.get(type) + if (!known) { + known = { read: { state: 'loading' }, started: 0, applied: 0 } + records.set(type, known) + } + return known +} + +/** + * settle keeps an answer to the request numbered request, unless the answer + * to a later one already arrived. + */ +function settle(known: Entry, request: number, read: PersistRead): void { + if (request < known.applied) return + known.applied = request + known.read = read +} + +/** start numbers a new request for known. */ +function start(known: Entry): number { + known.started = ++requests + return known.started +} + +/** load asks the host for player's record of type. */ +function load(player: Player, type: string, known: Entry): void { + const request = start(known) + callServiceLater( + service, + 'Get', + persistPb.GetRequest.toBinary({ player: player.slot, type }), + (reply, error) => { + if (reply === undefined) { + settle(known, request, unavailable(type, error)) + return + } + const answer = persistPb.GetReply.fromBinary(reply) + settle(known, request, { state: 'loaded', record: decode(answer.record) }) + }, + ) +} + +/** unavailable is the read of a record the host did not answer, logged once. */ +function unavailable(type: string, error: string | undefined): PersistRead { + const why = error || 'the host answered nothing' + log(`persist ${type}: ${why}`) + return { state: 'unavailable', error: why } +} + +export const persist = { + /** + * get returns player's record of type, a record type the manifest + * declares. The first get starts the read and answers loading; a later + * get answers what the host sent. A record never written loads empty. + */ + get(player: Player, type: string): PersistRead { + const known = entry(player, type) + if (known.started === 0) load(player, type, known) + return known.read + }, + + /** + * getMany starts reading the record of type for each of players, up to + * 16, in one call, such as everyone in a lobby at join. persist.get then + * answers each. + */ + getMany(players: readonly Player[], type: string): void { + const pending = players.map((player) => { + const known = entry(player, type) + return { player, known, request: start(known) } + }) + callServiceLater( + service, + 'GetMany', + persistPb.GetManyRequest.toBinary({ + players: players.map((player) => player.slot), + type, + }), + (reply, error) => { + if (reply === undefined) { + const read = unavailable(type, error) + for (const p of pending) settle(p.known, p.request, read) + return + } + const records = new Map( + (persistPb.GetManyReply.fromBinary(reply).records ?? []).map((r) => [ + r.player ?? 0, + decode(r.record), + ]), + ) + for (const p of pending) { + settle(p.known, p.request, { + state: 'loaded', + record: records.get(p.player.slot) ?? {}, + }) + } + }, + ) + }, + + /** + * update changes player's record of type by changes, which the host + * applies all or none. With a key, an update the host already took is left + * out, so resending after a lost answer counts once. An update with an add + * and no key is refused without being sent, since a resend would count it + * twice. An update the host answers as taking too long may still have been + * kept: send it again with the same key, and do not act as if nothing was + * written. persist.get answers the changed record once the host has + * answered, and done runs then. + */ + update( + player: Player, + type: string, + changes: PersistChanges, + options: PersistOptions = {}, + done?: PersistDone, + ): void { + // An add needs a key, as the host requires. + const ops = encode(changes) + if (!options.key && ops.some((op) => op.op?.case === 'add')) { + const why = + 'a persist update that adds needs an update key, so a resend counts once' + log(`persist ${type} update: ${why}`) + done?.(undefined, why) + return + } + const known = entry(player, type) + const request = start(known) + callServiceLater( + service, + 'Update', + persistPb.UpdateRequest.toBinary({ + player: player.slot, + type, + key: options.record, + ops, + updateKey: options.key, + }), + (reply, error) => { + // A refused update leaves the record as get last read it. + if (reply === undefined) { + const why = error || 'the host answered nothing' + log(`persist ${type} update: ${why}`) + done?.(undefined, why) + return + } + const answer = persistPb.UpdateReply.fromBinary(reply) + const record = decode(answer.record) + settle(known, request, { state: 'loaded', record }) + done?.(record, undefined, answer.repeated ?? false) + }, + ) + }, + + /** refresh reads player's record of type again, such as after unavailable. */ + refresh(player: Player, type: string): void { + load(player, type, entry(player, type)) + }, +} + +/** encode converts changes to the host's operations, in field order. */ +function encode(changes: PersistChanges): persistPb.Op[] { + const ops: persistPb.Op[] = [] + for (const [field, change] of Object.entries(changes)) { + const list: readonly PersistChange[] = Array.isArray(change) + ? change + : [change as PersistChange] + for (const one of list) ops.push({ field, op: operation(one) }) + } + return ops +} + +/** operation converts one change to an operation. */ +function operation(change: PersistChange): persistPb.Op['op'] { + // Each change names one operation; a set holds a number or text. + if ('add' in change) return { case: 'add', value: change.add } + if ('max' in change) return { case: 'max', value: change.max } + if ('min' in change) return { case: 'min', value: change.min } + if ('insert' in change) return { case: 'insert', value: change.insert } + if ('remove' in change) return { case: 'remove', value: change.remove } + const value: persistPb.Value['value'] = + typeof change.set === 'string' + ? { case: 'text', value: change.set } + : { case: 'number', value: change.set } + return { case: 'set', value: { value } } +} + +/** decode converts a record the host sent to a PersistRecord. */ +function decode(record: persistPb.Record | undefined): PersistRecord { + const fields: Record = {} + for (const [name, value] of Object.entries(record?.fields ?? {})) { + const v = value.value + if (v?.case === 'number' || v?.case === 'text') fields[name] = v.value + if (v?.case === 'tags') fields[name] = v.value.members ?? [] + } + return fields +} diff --git a/js/src/service-later.ts b/js/src/service-later.ts new file mode 100644 index 00000000..7f07a199 --- /dev/null +++ b/js/src/service-later.ts @@ -0,0 +1,70 @@ +// A started service call ends in a later frame, with the ServiceReplied event +// carrying its number. + +import { + type ServiceFailure, + type ServiceRepliedEvent, + startServiceCall, +} from './host.gen.js' +import { after } from './timer.js' + +/** waiting maps each started service call's number to the function its end runs. */ +const waiting = new Map() + +/** + * ServiceDone ends one callServiceLater: with the reply, or without one and + * with the error and the failure that says why. + */ +export type ServiceDone = ( + reply: Uint8Array | undefined, + error?: string, + failure?: ServiceFailure, +) => void + +/** + * callServiceLater calls method of a service the host provides and returns at + * once; done runs in a later frame with the answer, or with an error when + * the service refused, the call waited past timeoutMilliseconds or nobody + * provides the service. Zero waits the host's longest, 30 seconds. done runs + * once while the mod runs; calls still waiting when the mod stops end with + * it. + */ +export function callServiceLater( + service: string, + method: string, + payload: Uint8Array, + done: ServiceDone, + timeoutMilliseconds = 0, +): void { + // A call the host refuses to start ends in the next frame as well, so done + // never runs before this returns. + const call = startServiceCall(service, method, payload, timeoutMilliseconds) + if (call === undefined) { + after(0, () => + done( + undefined, + `the host did not start the call to ${service}`, + 'unavailable', + ), + ) + return + } + waiting.set(call, done) +} + +/** endServiceCall ends the started call event names, once. */ +export function endServiceCall(event: ServiceRepliedEvent): void { + // Each call ends once; a number the mod no longer waits for is ignored. + const done = waiting.get(event.call) + if (!done) { + return + } + waiting.delete(event.call) + + // A failure ends the call without a reply. + if (event.failure && event.failure !== 'none') { + done(undefined, event.error, event.failure) + return + } + done(event.payload) +} diff --git a/js/test/persist.test.ts b/js/test/persist.test.ts new file mode 100644 index 00000000..8f1afb64 --- /dev/null +++ b/js/test/persist.test.ts @@ -0,0 +1,235 @@ +import { expect, test } from 'bun:test' + +import { + GetManyReply, + GetManyRequest, + GetReply, + GetRequest, + UpdateReply, + UpdateRequest, +} from '../../src/wasm/persist/persist.pb.js' +import { + Call, + Reply, + ServiceCallStarted, + ServiceFailure, + ServiceRepliedEvent, + StartServiceCallRequest, +} from '../../src/wasm/wasm.pb.js' +import { Player } from '../src/host.gen.js' +import { bind, deliver as dispatch } from '../src/host.js' +import { persist } from '../src/index.js' + +/** started holds the calls the mod started, numbered from one. */ +const started: { service: string; method: string; payload: Uint8Array }[] = [] + +bind((bytes) => { + const sent = Call.fromBinary(bytes) + if (sent.method !== 'StartServiceCall') { + return Reply.toBinary({}) + } + const request = StartServiceCallRequest.fromBinary( + sent.request ?? new Uint8Array(), + ) + started.push({ + service: request.service ?? '', + method: request.method ?? '', + payload: request.payload ?? new Uint8Array(), + }) + const call = BigInt(started.length) + return Reply.toBinary({ response: ServiceCallStarted.toBinary({ call }) }) +}) + +/** replied ends the started call numbered call, as the host does. */ +function replied( + call: number, + event: Omit[0], 'call'>, +): void { + const reply = Reply.fromBinary( + dispatch( + Call.toBinary({ + method: 'ServiceReplied', + request: ServiceRepliedEvent.toBinary({ call: BigInt(call), ...event }), + }), + ), + ) + expect(reply.error ?? '').toBe('') +} + +/** number is a record value holding n. */ +function number(n: number) { + return { value: { case: 'number' as const, value: n } } +} + +test('a record loads once, then answers what the host sent', () => { + // The first get starts one read and answers loading; a second waits on it. + const player = Player.of(2) + expect(persist.get(player, 'stats')).toEqual({ state: 'loading' }) + expect(persist.get(player, 'stats')).toEqual({ state: 'loading' }) + const at = started.length + expect(started[at - 1]!.service).toBe('persist') + expect(started[at - 1]!.method).toBe('Get') + expect(GetRequest.fromBinary(started[at - 1]!.payload)).toEqual({ + player: 2, + type: 'stats', + }) + + // The answer arrives in a later frame. + replied(at, { + payload: GetReply.toBinary({ + record: { + fields: { + roundsWon: number(4), + unlocks: { value: { case: 'tags', value: { members: ['hat'] } } }, + }, + }, + }), + }) + expect(persist.get(player, 'stats')).toEqual({ + state: 'loaded', + record: { roundsWon: 4, unlocks: ['hat'] }, + }) + expect(started.length).toBe(at) +}) + +test('an update sends its changes and keeps the record the host answers', () => { + // The changes go in field order, a list of them in its order. + const player = Player.of(5) + const ended: string[] = [] + persist.update( + player, + 'stats', + { + roundsWon: { add: 1 }, + best: { max: 31.5 }, + title: { set: 'hider' }, + unlocks: [{ insert: 'cone' }, { remove: 'hat' }], + }, + { key: 'round-9' }, + (record, error, repeated) => + ended.push( + error ?? + `${Object.keys(record ?? {}).join(',')} ${String(record?.roundsWon)} ${repeated}`, + ), + ) + const update = started.length + const request = UpdateRequest.fromBinary(started[update - 1]!.payload) + expect(started[update - 1]!.method).toBe('Update') + expect([request.player, request.type, request.updateKey]).toEqual([ + 5, + 'stats', + 'round-9', + ]) + expect(request.ops).toEqual([ + { field: 'roundsWon', op: { case: 'add', value: 1 } }, + { field: 'best', op: { case: 'max', value: 31.5 } }, + { + field: 'title', + op: { case: 'set', value: { value: { case: 'text', value: 'hider' } } }, + }, + { field: 'unlocks', op: { case: 'insert', value: 'cone' } }, + { field: 'unlocks', op: { case: 'remove', value: 'hat' } }, + ]) + + // The answer becomes the record get answers. + replied(update, { + payload: UpdateReply.toBinary({ + record: { fields: { roundsWon: number(1) } }, + repeated: true, + }), + }) + expect(ended).toEqual(['roundsWon 1 true']) + expect(persist.get(player, 'stats')).toEqual({ + state: 'loaded', + record: { roundsWon: 1 }, + }) +}) + +test('an answer to an earlier read does not replace a later update', () => { + // A read starts, then an update, and the update's answer arrives first. + const player = Player.of(6) + persist.get(player, 'stats') + const read = started.length + persist.update(player, 'stats', { roundsWon: { add: 1 } }, { key: 'round-1' }) + const update = started.length + replied(update, { + payload: UpdateReply.toBinary({ + record: { fields: { roundsWon: number(8) } }, + }), + }) + replied(read, { + payload: GetReply.toBinary({ + record: { fields: { roundsWon: number(7) } }, + }), + }) + expect(persist.get(player, 'stats')).toEqual({ + state: 'loaded', + record: { roundsWon: 8 }, + }) +}) + +test('a refused read is unavailable, and refresh reads again', () => { + const player = Player.of(7) + persist.get(player, 'stats') + replied(started.length, { + failure: ServiceFailure.UNAVAILABLE, + error: 'nobody provides persist', + }) + expect(persist.get(player, 'stats')).toEqual({ + state: 'unavailable', + error: 'nobody provides persist', + }) + persist.refresh(player, 'stats') + replied(started.length, { payload: GetReply.toBinary({}) }) + expect(persist.get(player, 'stats')).toEqual({ state: 'loaded', record: {} }) +}) + +test('getMany fills each player, and a new player in a slot reads anew', () => { + // One call reads both players. + const first = Player.of(8) + const second = Player.of(9) + persist.getMany([first, second], 'stats') + const many = started.length + expect(GetManyRequest.fromBinary(started[many - 1]!.payload)).toEqual({ + players: [8, 9], + type: 'stats', + }) + replied(many, { + payload: GetManyReply.toBinary({ + records: [ + { player: 8, record: { fields: { roundsWon: number(2) } } }, + { player: 9, record: {} }, + ], + }), + }) + expect(persist.get(first, 'stats')).toEqual({ + state: 'loaded', + record: { roundsWon: 2 }, + }) + expect(persist.get(second, 'stats')).toEqual({ state: 'loaded', record: {} }) + + // A player who takes slot 8 next is a new Player, whose record loads. + Player.release(8) + expect(persist.get(Player.of(8), 'stats')).toEqual({ state: 'loading' }) +}) + +test('an update that adds without a key is refused and not sent', () => { + const player = Player.of(8) + const at = started.length + const ended: string[] = [] + persist.update( + player, + 'stats', + { title: { set: 'hider' }, roundsWon: { add: 1 } }, + {}, + (record, error) => ended.push(`${record === undefined} ${error}`), + ) + expect(started.length).toBe(at) + expect(ended).toEqual([ + 'true a persist update that adds needs an update key, so a resend counts once', + ]) + + // A keyless update without an add is sent. + persist.update(player, 'stats', { title: { set: 'hider' } }) + expect(started.length).toBe(at + 1) +}) diff --git a/mod/persist.go b/mod/persist.go new file mode 100644 index 00000000..e3440ab7 --- /dev/null +++ b/mod/persist.go @@ -0,0 +1,112 @@ +package mod + +import ( + persistpb "github.com/paralin/modlock/src/wasm/persist" +) + +// persistService names the host service that keeps players' records. +const persistService = "persist" + +// PersistRecord is one player's record of a type the manifest declares under +// persist: each field written so far, by name. +type PersistRecord = persistpb.Record + +// PersistOp is one change to one field of a record. +type PersistOp = persistpb.Op + +// PersistAdd adds n to a count or number field; a count takes only a whole +// number from zero up. +func PersistAdd(field string, n float64) *PersistOp { + return &PersistOp{Field: field, Op: &persistpb.Op_Add{Add: n}} +} + +// PersistMax raises a number or max field to n when n is higher. +func PersistMax(field string, n float64) *PersistOp { + return &PersistOp{Field: field, Op: &persistpb.Op_Max{Max: n}} +} + +// PersistMin lowers a number field to n when n is lower. +func PersistMin(field string, n float64) *PersistOp { + return &PersistOp{Field: field, Op: &persistpb.Op_Min{Min: n}} +} + +// PersistSetNumber sets a count or number field to n. +func PersistSetNumber(field string, n float64) *PersistOp { + return &PersistOp{Field: field, Op: &persistpb.Op_Set{Set: &persistpb.Value{Value: &persistpb.Value_Number{Number: n}}}} +} + +// PersistSetText sets a string field to text. +func PersistSetText(field, text string) *PersistOp { + return &PersistOp{Field: field, Op: &persistpb.Op_Set{Set: &persistpb.Value{Value: &persistpb.Value_Text{Text: text}}}} +} + +// PersistInsert adds tag to a tags field. +func PersistInsert(field, tag string) *PersistOp { + return &PersistOp{Field: field, Op: &persistpb.Op_Insert{Insert: tag}} +} + +// PersistRemove takes tag from a tags field. +func PersistRemove(field, tag string) *PersistOp { + return &PersistOp{Field: field, Op: &persistpb.Op_Remove{Remove: tag}} +} + +// GetRecord reads the player's record of recordType over the host's persist +// service; done runs in a later frame with the record, empty for one never +// written, or the error that refused the read. +func (p Player) GetRecord(recordType string, done func(*PersistRecord, error)) { + data, err := (&persistpb.GetRequest{Player: p.Slot(), Type: recordType}).MarshalVT() + if err != nil { + done(nil, err) + return + } + CallServiceLater(persistService, "Get", data, 0, func(reply []byte, err error) { + if err != nil { + done(nil, err) + return + } + answer := &persistpb.GetReply{} + if err := answer.UnmarshalVT(reply); err != nil { + done(nil, err) + return + } + done(recordOf(answer.GetRecord()), nil) + }) +} + +// UpdateRecord changes the player's record of recordType by ops, which the +// host applies all or none, so two servers that update one record at once +// both land. With a key, such as a round's, an update the host already took +// is left out and done hears repeated. An update with a PersistAdd needs a +// key, since a resend without one would count twice; the host refuses it +// otherwise. done runs in a later frame and may be nil. +func (p Player) UpdateRecord(recordType string, ops []*PersistOp, key string, done func(record *PersistRecord, repeated bool, err error)) { + if done == nil { + done = func(*PersistRecord, bool, error) {} + } + data, err := (&persistpb.UpdateRequest{Player: p.Slot(), Type: recordType, Ops: ops, UpdateKey: key}).MarshalVT() + if err != nil { + done(nil, false, err) + return + } + CallServiceLater(persistService, "Update", data, 0, func(reply []byte, err error) { + if err != nil { + Log("persist ", recordType, " update: ", err) + done(nil, false, err) + return + } + answer := &persistpb.UpdateReply{} + if err := answer.UnmarshalVT(reply); err != nil { + done(nil, false, err) + return + } + done(recordOf(answer.GetRecord()), answer.GetRepeated(), nil) + }) +} + +// recordOf returns record, or an empty one. +func recordOf(record *PersistRecord) *PersistRecord { + if record == nil { + return &PersistRecord{} + } + return record +} diff --git a/persist/persist.go b/persist/persist.go new file mode 100644 index 00000000..9e2427c6 --- /dev/null +++ b/persist/persist.go @@ -0,0 +1,354 @@ +// Package persist holds the rules for the records a mod keeps for each +// player through the host's persist service: which record types a manifest +// may declare, and how an update's field operations change a record. A host +// that serves the service applies updates with Apply, so every host agrees +// on what an update does and what it refuses. +package persist + +import ( + "fmt" + "math" + "regexp" + "slices" + "strconv" + + "github.com/paralin/modlock/src/wasm" + persistpb "github.com/paralin/modlock/src/wasm/persist" + "github.com/pkg/errors" +) + +// Service is the name mods call the persist service by. +const Service = "persist" + +const ( + // TypeLimit bounds the record types one mod declares. + TypeLimit = 8 + // FieldLimit bounds the fields of one record type. + FieldLimit = 32 + // RecordBytes bounds one record's encoded values. + RecordBytes = 8 << 10 + // OpLimit bounds the operations of one update. + OpLimit = 32 + // ManyLimit bounds the players one GetMany reads. + ManyLimit = 16 + // RecentKeys is how many update keys a record remembers. + RecentKeys = 64 + // UpdateKeyBytes bounds one update key. + UpdateKeyBytes = 64 + // TagLimit bounds the members of one tags field. + TagLimit = 256 + // TagBytes bounds one tag. + TagBytes = 32 + // StringBytes is a string field's bound when it declares none. + StringBytes = 64 + // StringLimit bounds what a string field may declare. + StringLimit = 256 +) + +// namePattern matches a record type or field name. +var namePattern = regexp.MustCompile(`^[A-Za-z][A-Za-z0-9_]{0,31}$`) + +// Refusal is the error of a call a host refuses: the call broke a rule of +// its record type or a bound, and the record is unchanged. Its text tells +// the mod's author which. +type Refusal string + +// Error returns the refusal's text. +func (r Refusal) Error() string { return string(r) } + +// refuse returns a Refusal of the formatted text. +func refuse(format string, args ...any) error { + return Refusal(fmt.Sprintf(format, args...)) +} + +// Find returns the record type named name that manifest declares, or nil. +func Find(manifest *wasm.Manifest, name string) *persistpb.RecordType { + for _, recordType := range manifest.GetPersist() { + if recordType.GetName() == name { + return recordType + } + } + return nil +} + +// Validate checks the record types manifest declares, and that it names the +// persist service exactly when it declares record types. +func Validate(manifest *wasm.Manifest) error { + // Check the service and the types go together. + types := manifest.GetPersist() + named := slices.ContainsFunc(manifest.GetServices(), func(s *wasm.Service) bool { return s.GetName() == Service }) + switch { + case named && len(types) == 0: + return errors.New("mod.json names the persist service but declares no persist record types") + case !named && len(types) != 0: + return errors.New(`mod.json declares persist record types, so it also names {"name": "persist"} in services`) + } + + // Check each type. + if len(types) > TypeLimit { + return errors.Errorf("mod.json declares more than %d persist record types", TypeLimit) + } + for i, recordType := range types { + if err := validate(recordType); err != nil { + return err + } + if slices.ContainsFunc(types[:i], func(t *persistpb.RecordType) bool { return t.GetName() == recordType.GetName() }) { + return errors.Errorf("mod.json declares persist record type %q twice", recordType.GetName()) + } + } + return nil +} + +// validate checks one declared record type. +func validate(recordType *persistpb.RecordType) error { + // Check the name and the writers. + name := recordType.GetName() + if !namePattern.MatchString(name) { + return errors.Errorf("persist record type %q name must be up to 32 letters, digits and underscores, starting with a letter", name) + } + switch recordType.GetWriters() { + case persistpb.Writers_WRITERS_SERVERS, persistpb.Writers_WRITERS_PLAYERS: + default: + return errors.Errorf("persist record type %q writers must be WRITERS_SERVERS or WRITERS_PLAYERS", name) + } + + // Check each field. + fields := recordType.GetFields() + if len(fields) == 0 || len(fields) > FieldLimit { + return errors.Errorf("persist record type %q declares 1 to %d fields", name, FieldLimit) + } + for field, declared := range fields { + if !namePattern.MatchString(field) { + return errors.Errorf("persist record type %q field %q name must be up to 32 letters, digits and underscores, starting with a letter", name, field) + } + kind := declared.GetKind() + if _, ok := persistpb.Field_Kind_name[int32(kind)]; !ok || kind == persistpb.Field_KIND_UNKNOWN { + return errors.Errorf("persist record type %q field %q kind must be KIND_COUNT, KIND_NUMBER, KIND_MAX, KIND_STRING or KIND_TAGS", name, field) + } + if declared.GetMaxBytes() != 0 && (kind != persistpb.Field_KIND_STRING || declared.GetMaxBytes() > StringLimit) { + return errors.Errorf("persist record type %q field %q maxBytes is for a KIND_STRING field, up to %d", name, field, StringLimit) + } + } + return nil +} + +// CheckKey refuses a record key: each player has one record of each type +// until hosts set a bound for keyed records. +func CheckKey(key string) error { + if key != "" { + return refuse("persist records take no key yet; leave key empty") + } + return nil +} + +// Apply returns stored, a record of recordType as a host keeps it or nil for +// one never written, changed by ops. An update whose key is among the +// record's recent keys is left out, and Apply reports it repeated with the +// record unchanged. It refuses the whole update, changing nothing, when an op +// breaks its field's rules or the result passes a bound. stored is not +// modified. +func Apply(recordType *persistpb.RecordType, stored *persistpb.StoredRecord, ops []*persistpb.Op, updateKey string) (*persistpb.StoredRecord, bool, error) { + // Check the update's bounds and its key. + if len(ops) == 0 || len(ops) > OpLimit { + return nil, false, refuse("a persist update makes 1 to %d changes", OpLimit) + } + if len(updateKey) > UpdateKeyBytes { + return nil, false, refuse("a persist update key is up to %d bytes", UpdateKeyBytes) + } + if updateKey == "" && hasAdd(ops) { + return nil, false, refuse("a persist update that adds needs an update key, so a resend counts once") + } + next := stored.CloneVT() + if next == nil { + next = &persistpb.StoredRecord{} + } + if updateKey != "" && slices.Contains(next.GetRecentKeys(), updateKey) { + return next, true, nil + } + if next.Record == nil { + next.Record = &persistpb.Record{} + } + if next.Record.Fields == nil { + next.Record.Fields = map[string]*persistpb.Value{} + } + if next.Kinds == nil { + next.Kinds = map[string]persistpb.Field_Kind{} + } + + // Apply each op to its field. + for _, op := range ops { + declared := recordType.GetFields()[op.GetField()] + if declared == nil { + return nil, false, refuse("persist record type %s declares no field %q", recordType.GetName(), op.GetField()) + } + value, err := applyOp(declared, next.Kinds[op.GetField()], next.Record.Fields[op.GetField()], op) + if err != nil { + return nil, false, err + } + next.Record.Fields[op.GetField()] = value + next.Kinds[op.GetField()] = declared.GetKind() + } + + // Check the result's size, and remember the key. + if size := next.Record.SizeVT(); size > RecordBytes { + return nil, false, refuse("a persist record is up to %d bytes; this update makes it %d", RecordBytes, size) + } + if updateKey != "" { + next.RecentKeys = append(next.RecentKeys, updateKey) + if extra := len(next.RecentKeys) - RecentKeys; extra > 0 { + next.RecentKeys = slices.Delete(next.RecentKeys, 0, extra) + } + } + next.Version++ + return next, false, nil +} + +// hasAdd reports whether any of ops adds to a field. Every other op leaves +// the same record when applied twice. +func hasAdd(ops []*persistpb.Op) bool { + for _, op := range ops { + if _, ok := op.GetOp().(*persistpb.Op_Add); ok { + return true + } + } + return false +} + +// holds reports whether value, as stored by a field of kind wrote, may be +// changed by a field of kind: only when the kinds are the same, so a best +// score kept by a max is never added to by a count. A value with no recorded +// kind is held by no field. +func holds(kind, wrote persistpb.Field_Kind, value *persistpb.Value) bool { + if wrote != kind { + return false + } + switch value.GetValue().(type) { + case *persistpb.Value_Number: + return kind == persistpb.Field_KIND_COUNT || kind == persistpb.Field_KIND_NUMBER || kind == persistpb.Field_KIND_MAX + case *persistpb.Value_Text: + return kind == persistpb.Field_KIND_STRING + case *persistpb.Value_Tags: + return kind == persistpb.Field_KIND_TAGS + } + return false +} + +// applyOp returns value, a field's current value or nil, changed by op. wrote +// is the kind of the field that stored value. It refuses an op on a value of +// another kind than the field's, such as a best score an earlier build kept +// with a max in a field this build counts, rather than read the value as the +// new kind. +func applyOp(field *persistpb.Field, wrote persistpb.Field_Kind, value *persistpb.Value, op *persistpb.Op) (*persistpb.Value, error) { + name := op.GetField() + if value.GetValue() != nil && !holds(field.GetKind(), wrote, value) { + return nil, refuse("persist field %s holds a value of another kind than this release's %s, kept by an earlier release; the record is unchanged", name, kindName(field.GetKind())) + } + number := func(v float64) (*persistpb.Value, error) { + if math.IsNaN(v) || math.IsInf(v, 0) { + return nil, refuse("persist field %s takes a finite number", name) + } + if field.GetKind() == persistpb.Field_KIND_COUNT && (v < 0 || v != math.Trunc(v)) { + return nil, refuse("persist field %s counts whole numbers from zero up", name) + } + return &persistpb.Value{Value: &persistpb.Value_Number{Number: v}}, nil + } + current := value.GetNumber() + kind := field.GetKind() + switch o := op.GetOp().(type) { + case *persistpb.Op_Add: + if kind == persistpb.Field_KIND_COUNT || kind == persistpb.Field_KIND_NUMBER { + if kind == persistpb.Field_KIND_COUNT && (o.Add < 0 || o.Add != math.Trunc(o.Add)) { + return nil, refuse("persist field %s adds whole numbers from zero up", name) + } + return number(current + o.Add) + } + case *persistpb.Op_Max: + if kind == persistpb.Field_KIND_NUMBER || kind == persistpb.Field_KIND_MAX { + if value.GetValue() == nil || o.Max > current { + return number(o.Max) + } + return value, nil + } + case *persistpb.Op_Min: + if kind == persistpb.Field_KIND_NUMBER { + if value.GetValue() == nil || o.Min < current { + return number(o.Min) + } + return value, nil + } + case *persistpb.Op_Set: + switch set := o.Set.GetValue().(type) { + case *persistpb.Value_Number: + if kind == persistpb.Field_KIND_COUNT || kind == persistpb.Field_KIND_NUMBER { + return number(set.Number) + } + case *persistpb.Value_Text: + if kind == persistpb.Field_KIND_STRING { + limit := int(field.GetMaxBytes()) + if limit == 0 { + limit = StringBytes + } + if len(set.Text) > limit { + return nil, refuse("persist field %s holds up to %d bytes", name, limit) + } + return &persistpb.Value{Value: &persistpb.Value_Text{Text: set.Text}}, nil + } + } + case *persistpb.Op_Insert: + if kind == persistpb.Field_KIND_TAGS { + if len(o.Insert) == 0 || len(o.Insert) > TagBytes { + return nil, refuse("persist field %s takes tags of 1 to %d bytes", name, TagBytes) + } + members := slices.Clone(value.GetTags().GetMembers()) + at, found := slices.BinarySearch(members, o.Insert) + if !found { + if len(members) >= TagLimit { + return nil, refuse("persist field %s holds up to %d tags", name, TagLimit) + } + members = slices.Insert(members, at, o.Insert) + } + return &persistpb.Value{Value: &persistpb.Value_Tags{Tags: &persistpb.Tags{Members: members}}}, nil + } + case *persistpb.Op_Remove: + if kind == persistpb.Field_KIND_TAGS { + members := slices.Clone(value.GetTags().GetMembers()) + if at, found := slices.BinarySearch(members, o.Remove); found { + members = slices.Delete(members, at, at+1) + } + return &persistpb.Value{Value: &persistpb.Value_Tags{Tags: &persistpb.Tags{Members: members}}}, nil + } + default: + return nil, refuse("persist field %s: the change names no operation", name) + } + return nil, refuse("persist field %s, a %s, cannot take %s", name, kindName(kind), opName(op)) +} + +// kindName is a field kind as mod.json writes it. +func kindName(kind persistpb.Field_Kind) string { + if name, ok := persistpb.Field_Kind_name[int32(kind)]; ok { + return name + } + return strconv.Itoa(int(kind)) +} + +// opName is the name of op's operation. +func opName(op *persistpb.Op) string { + switch op.GetOp().(type) { + case *persistpb.Op_Add: + return "add" + case *persistpb.Op_Max: + return "max" + case *persistpb.Op_Min: + return "min" + case *persistpb.Op_Set: + if op.GetSet().GetValue() == nil { + return "an empty set" + } + return "this set" + case *persistpb.Op_Insert: + return "insert" + case *persistpb.Op_Remove: + return "remove" + } + return "this change" +} diff --git a/persist/persist_test.go b/persist/persist_test.go new file mode 100644 index 00000000..144bbddc --- /dev/null +++ b/persist/persist_test.go @@ -0,0 +1,409 @@ +package persist + +import ( + "errors" + "os" + "path/filepath" + "strconv" + "strings" + "sync" + "testing" + + "github.com/paralin/modlock/src/wasm" + persistpb "github.com/paralin/modlock/src/wasm/persist" +) + +// stats is the record type the tests keep: a prop hunt mod's player stats. +var stats = &persistpb.RecordType{ + Name: "stats", + Writers: persistpb.Writers_WRITERS_SERVERS, + Fields: map[string]*persistpb.Field{ + "roundsWon": {Kind: persistpb.Field_KIND_COUNT}, + "score": {Kind: persistpb.Field_KIND_NUMBER}, + "bestHide": {Kind: persistpb.Field_KIND_MAX}, + "title": {Kind: persistpb.Field_KIND_STRING, MaxBytes: 8}, + "unlocks": {Kind: persistpb.Field_KIND_TAGS}, + }, +} + +// manifest declares stats and the persist service. +func manifest() *wasm.Manifest { + return &wasm.Manifest{ + Slug: "prophunt", + Services: []*wasm.Service{{Name: Service}}, + Persist: []*persistpb.RecordType{stats}, + } +} + +func add(field string, n float64) *persistpb.Op { + return &persistpb.Op{Field: field, Op: &persistpb.Op_Add{Add: n}} +} + +func setText(field, text string) *persistpb.Op { + return &persistpb.Op{Field: field, Op: &persistpb.Op_Set{Set: &persistpb.Value{Value: &persistpb.Value_Text{Text: text}}}} +} + +func insert(field, tag string) *persistpb.Op { + return &persistpb.Op{Field: field, Op: &persistpb.Op_Insert{Insert: tag}} +} + +// refused fails t unless err is a Refusal containing text. +func refused(t *testing.T, err error, text string) { + t.Helper() + var refusal Refusal + if !errors.As(err, &refusal) || !strings.Contains(err.Error(), text) { + t.Fatalf("want a refusal naming %q, got %v", text, err) + } +} + +func TestValidate(t *testing.T) { + if err := Validate(manifest()); err != nil { + t.Fatal(err) + } + cases := map[string]func(*wasm.Manifest){ + "no persist service": func(m *wasm.Manifest) { m.Services = nil }, + "no record types": func(m *wasm.Manifest) { m.Persist = nil }, + "twice": func(m *wasm.Manifest) { + m.Persist = append(m.Persist, stats) + }, + "name": func(m *wasm.Manifest) { + m.Persist = []*persistpb.RecordType{{Name: "9lives", Writers: persistpb.Writers_WRITERS_SERVERS, Fields: stats.Fields}} + }, + "writers": func(m *wasm.Manifest) { + m.Persist = []*persistpb.RecordType{{Name: "stats", Fields: stats.Fields}} + }, + "no fields": func(m *wasm.Manifest) { + m.Persist = []*persistpb.RecordType{{Name: "stats", Writers: persistpb.Writers_WRITERS_SERVERS}} + }, + "kind": func(m *wasm.Manifest) { + m.Persist = []*persistpb.RecordType{{Name: "stats", Writers: persistpb.Writers_WRITERS_SERVERS, Fields: map[string]*persistpb.Field{"a": {}}}} + }, + "maxBytes on a count": func(m *wasm.Manifest) { + m.Persist = []*persistpb.RecordType{{Name: "stats", Writers: persistpb.Writers_WRITERS_SERVERS, Fields: map[string]*persistpb.Field{"a": {Kind: persistpb.Field_KIND_COUNT, MaxBytes: 4}}}} + }, + } + for name, change := range cases { + m := manifest() + change(m) + if Validate(m) == nil { + t.Errorf("%s: want an error", name) + } + } + m := manifest() + for i := range TypeLimit { + m.Persist = append(m.Persist, &persistpb.RecordType{Name: "t" + strconv.Itoa(i), Writers: persistpb.Writers_WRITERS_SERVERS, Fields: stats.Fields}) + } + if Validate(m) == nil { + t.Error("too many types: want an error") + } +} + +func TestApplyRules(t *testing.T) { + // Each kind takes its own operations. + next, repeated, err := Apply(stats, nil, []*persistpb.Op{ + add("roundsWon", 2), + add("score", -1.5), + {Field: "bestHide", Op: &persistpb.Op_Max{Max: 30}}, + {Field: "bestHide", Op: &persistpb.Op_Max{Max: 12}}, + setText("title", "hider"), + insert("unlocks", "cone"), + insert("unlocks", "barrel"), + insert("unlocks", "cone"), + }, "round-1") + if err != nil || repeated { + t.Fatal(err, repeated) + } + fields := next.GetRecord().GetFields() + if fields["roundsWon"].GetNumber() != 2 || fields["score"].GetNumber() != -1.5 || fields["bestHide"].GetNumber() != 30 { + t.Fatalf("numbers: %v", fields) + } + if fields["title"].GetText() != "hider" || strings.Join(fields["unlocks"].GetTags().GetMembers(), ",") != "barrel,cone" { + t.Fatalf("text and tags: %v", fields) + } + if next.GetVersion() != 1 || len(next.GetRecentKeys()) != 1 { + t.Fatalf("version %d keys %v", next.GetVersion(), next.GetRecentKeys()) + } + + // Each wrong operation is refused and the record is left as it was. + wrong := map[string]*persistpb.Op{ + "cannot take max": {Field: "roundsWon", Op: &persistpb.Op_Max{Max: 3}}, + "from zero up": add("roundsWon", -1), + "cannot take add": add("bestHide", 1), + "holds up to 8": setText("title", "far too long"), + "declares no field": add("kills", 1), + "cannot take insert": insert("title", "x"), + "takes tags of 1": insert("unlocks", ""), + "names no operation": {Field: "score"}, + } + for text, op := range wrong { + _, _, err := Apply(stats, next, []*persistpb.Op{add("roundsWon", 1), op}, "round-2") + refused(t, err, text) + } + if next.GetRecord().GetFields()["roundsWon"].GetNumber() != 2 { + t.Fatal("a refused update changed the record it was given") + } +} + +func TestApplyKeys(t *testing.T) { + // An add without a key is refused, since a resend would count it twice; + // other changes need none. + _, _, err := Apply(stats, nil, []*persistpb.Op{setText("title", "hider"), add("roundsWon", 1)}, "") + refused(t, err, "adds needs an update key") + if _, _, err := Apply(stats, nil, []*persistpb.Op{setText("title", "hider"), insert("unlocks", "cone")}, ""); err != nil { + t.Fatal("a keyless update without an add was refused", err) + } + + // A key seen among the recent keys is left out. + next, _, err := Apply(stats, nil, []*persistpb.Op{add("roundsWon", 1)}, "round-1") + if err != nil { + t.Fatal(err) + } + again, repeated, err := Apply(stats, next, []*persistpb.Op{add("roundsWon", 1)}, "round-1") + if err != nil || !repeated || again.GetRecord().GetFields()["roundsWon"].GetNumber() != 1 || again.GetVersion() != 1 { + t.Fatalf("repeat: %v %v %v", again, repeated, err) + } + + // Only the last RecentKeys are kept, so the oldest key counts again. + for i := 2; i <= RecentKeys+1; i++ { + if next, _, err = Apply(stats, next, []*persistpb.Op{add("roundsWon", 1)}, "round-"+strconv.Itoa(i)); err != nil { + t.Fatal(err) + } + } + if len(next.GetRecentKeys()) != RecentKeys || next.GetRecentKeys()[0] != "round-2" { + t.Fatalf("keys: %d, first %s", len(next.GetRecentKeys()), next.GetRecentKeys()[0]) + } + if _, repeated, _ := Apply(stats, next, []*persistpb.Op{add("roundsWon", 1)}, "round-1"); repeated { + t.Fatal("a key past the recent ones is still a repeat") + } +} + +// TestApplyKinds refuses, changing nothing, an op on a value an earlier build +// stored as another kind than the field's now, and keeps applying ops to +// values of the field's kind. +func TestApplyKinds(t *testing.T) { + // An earlier build counted title and kept unlocks as text. + stored := &persistpb.StoredRecord{Record: &persistpb.Record{Fields: map[string]*persistpb.Value{ + "title": {Value: &persistpb.Value_Number{Number: 3}}, + "unlocks": {Value: &persistpb.Value_Text{Text: "cone"}}, + "roundsWon": {Value: &persistpb.Value_Number{Number: 2}}, + }}, Kinds: map[string]persistpb.Field_Kind{ + "title": persistpb.Field_KIND_COUNT, + "unlocks": persistpb.Field_KIND_STRING, + "roundsWon": persistpb.Field_KIND_COUNT, + }} + _, _, err := Apply(stats, stored, []*persistpb.Op{setText("title", "hider")}, "") + refused(t, err, "another kind than this release's KIND_STRING") + _, _, err = Apply(stats, stored, []*persistpb.Op{insert("unlocks", "hat")}, "") + refused(t, err, "another kind than this release's KIND_TAGS") + if stored.GetRecord().GetFields()["title"].GetNumber() != 3 { + t.Fatal("a refused update changed the record it was given") + } + + // A field whose value is of its kind still takes its ops. + next, _, err := Apply(stats, stored, []*persistpb.Op{add("roundsWon", 1)}, "round-1") + if err != nil || next.GetRecord().GetFields()["roundsWon"].GetNumber() != 3 { + t.Fatal(next, err) + } +} + +// TestApplyNumberKinds refuses an op on a number stored by a field of another +// of the three number kinds, for each pair both ways, so a count never adds +// to a best score a max kept. A number of the same kind takes the op, and a +// number with no recorded kind takes none. +func TestApplyNumberKinds(t *testing.T) { + // opFor is an op each kind takes. + opFor := map[persistpb.Field_Kind]*persistpb.Op{ + persistpb.Field_KIND_COUNT: add("f", 1), + persistpb.Field_KIND_NUMBER: add("f", 1), + persistpb.Field_KIND_MAX: {Field: "f", Op: &persistpb.Op_Max{Max: 100}}, + } + kinds := []persistpb.Field_Kind{persistpb.Field_KIND_COUNT, persistpb.Field_KIND_NUMBER, persistpb.Field_KIND_MAX} + stored := func(wrote persistpb.Field_Kind) *persistpb.StoredRecord { + return &persistpb.StoredRecord{ + Record: &persistpb.Record{Fields: map[string]*persistpb.Value{"f": {Value: &persistpb.Value_Number{Number: 40}}}}, + Kinds: map[string]persistpb.Field_Kind{"f": wrote}, + } + } + typeOf := func(kind persistpb.Field_Kind) *persistpb.RecordType { + return &persistpb.RecordType{Name: "t", Writers: persistpb.Writers_WRITERS_SERVERS, Fields: map[string]*persistpb.Field{"f": {Kind: kind}}} + } + for _, wrote := range kinds { + for _, now := range kinds { + was := stored(wrote) + next, _, err := Apply(typeOf(now), was, []*persistpb.Op{opFor[now]}, "k") + if wrote == now { + if err != nil || next.GetKinds()["f"] != now { + t.Fatalf("%s on its own kind: %v %v", kindName(now), next, err) + } + continue + } + if err == nil || !strings.Contains(err.Error(), "another kind") || next != nil { + t.Fatalf("%s on a number a %s stored: %v %v", kindName(now), kindName(wrote), next, err) + } + if was.GetRecord().GetFields()["f"].GetNumber() != 40 { + t.Fatalf("%s on a %s changed the stored value", kindName(now), kindName(wrote)) + } + } + } + + // A number with no recorded kind is held by no field. + _, _, err := Apply(typeOf(persistpb.Field_KIND_COUNT), stored(persistpb.Field_KIND_UNKNOWN), []*persistpb.Op{add("f", 1)}, "k") + refused(t, err, "another kind") + + // A first write records the field's kind. + next, _, err := Apply(stats, nil, []*persistpb.Op{add("roundsWon", 1), {Field: "bestHide", Op: &persistpb.Op_Max{Max: 3}}}, "k") + if err != nil || next.GetKinds()["roundsWon"] != persistpb.Field_KIND_COUNT || next.GetKinds()["bestHide"] != persistpb.Field_KIND_MAX { + t.Fatal("a first write's kinds", next.GetKinds(), err) + } +} + +func TestApplyLimits(t *testing.T) { + // Too many ops, a long key, too many tags and too large a record. + ops := make([]*persistpb.Op, OpLimit+1) + for i := range ops { + ops[i] = add("roundsWon", 1) + } + _, _, err := Apply(stats, nil, ops, "") + refused(t, err, "1 to 32 changes") + _, _, err = Apply(stats, nil, ops[:0], "") + refused(t, err, "1 to 32 changes") + _, _, err = Apply(stats, nil, ops[:1], strings.Repeat("k", UpdateKeyBytes+1)) + refused(t, err, "key is up to 64 bytes") + + var next *persistpb.StoredRecord + for i := range TagLimit { + if next, _, err = Apply(stats, next, []*persistpb.Op{insert("unlocks", strconv.Itoa(i))}, ""); err != nil { + t.Fatal(err) + } + } + _, _, err = Apply(stats, next, []*persistpb.Op{insert("unlocks", "one-more")}, "") + refused(t, err, "up to 256 tags") + + // Long tags fill a record past RecordBytes before the tag bound: 256 + // tags of 32 bytes take more than 8 KB, so the record's bound binds. + next, err = nil, nil + for i := 0; err == nil; i++ { + if i == TagLimit { + t.Fatal("256 long tags fit in one record") + } + tag := strings.Repeat("x", TagBytes-4) + strconv.Itoa(1000+i) + var applied *persistpb.StoredRecord + if applied, _, err = Apply(stats, next, []*persistpb.Op{insert("unlocks", tag)}, ""); err == nil { + next = applied + } + } + refused(t, err, "a persist record is up to 8192 bytes") + if next.GetRecord().SizeVT() > RecordBytes { + t.Fatal("a kept record passed the bound") + } +} + +func TestStoreSurvivesRestart(t *testing.T) { + // A record written by one store reads back from a new one on the files. + dir := t.TempDir() + if _, _, err := newStore(dir).Update(76561197960265728, stats, []*persistpb.Op{add("roundsWon", 3)}, "round-1"); err != nil { + t.Fatal(err) + } + restarted := newStore(dir) + record, err := restarted.Get(76561197960265728, stats) + if err != nil || record.GetFields()["roundsWon"].GetNumber() != 3 { + t.Fatalf("after restart: %v %v", record, err) + } + + // The recent keys survive too, so a resend after the restart counts once. + _, repeated, err := restarted.Update(76561197960265728, stats, []*persistpb.Op{add("roundsWon", 3)}, "round-1") + if err != nil || !repeated { + t.Fatalf("resent after restart: %v %v", repeated, err) + } + + // Another player's record is their own, and no temp file is left. + record, err = restarted.Get(76561197960265729, stats) + if err != nil || len(record.GetFields()) != 0 { + t.Fatalf("other player: %v %v", record, err) + } + entries, _ := os.ReadDir(dir) + if len(entries) != 1 || entries[0].Name() != "76561197960265728.json" { + t.Fatalf("files: %v", entries) + } +} + +func TestStoreRefusesLargeFile(t *testing.T) { + dir := t.TempDir() + if err := os.WriteFile(filepath.Join(dir, "1.json"), make([]byte, FileBytes+1), 0o644); err != nil { + t.Fatal(err) + } + if _, err := newStore(dir).Get(1, stats); err == nil || !strings.Contains(err.Error(), "past the") { + t.Fatalf("want the bound, got %v", err) + } +} + +// TestTwoWritersBothLand is the conflict of two servers that update one +// player's record at once: every add lands, and a set's later write wins. +func TestTwoWritersBothLand(t *testing.T) { + store := newStore(t.TempDir()) + const each = 50 + var wg sync.WaitGroup + for server := range 2 { + wg.Go(func() { + for i := range each { + key := "server-" + strconv.Itoa(server) + "-round-" + strconv.Itoa(i) + if _, _, err := store.Update(7, stats, []*persistpb.Op{add("roundsWon", 1), insert("unlocks", key)}, key); err != nil { + t.Error(err) + } + } + }) + } + wg.Wait() + record, err := store.Get(7, stats) + if err != nil { + t.Fatal(err) + } + if got := record.GetFields()["roundsWon"].GetNumber(); got != 2*each { + t.Fatalf("roundsWon %v, want %d", got, 2*each) + } + if got := len(record.GetFields()["unlocks"].GetTags().GetMembers()); got != 2*each { + t.Fatalf("unlocks %d, want %d", got, 2*each) + } +} + +func TestAnswer(t *testing.T) { + store := newStore(t.TempDir()) + m := manifest() + players := func(slot int32) (uint64, bool) { return 100 + uint64(slot), slot < 4 } + call := func(method string, request interface{ MarshalVT() ([]byte, error) }) ([]byte, error) { + payload, _ := request.MarshalVT() + return Answer(store, m, players, method, payload) + } + + // An update and a read reach the player in the slot. + data, err := call("Update", &persistpb.UpdateRequest{Player: 1, Type: "stats", Ops: []*persistpb.Op{add("roundsWon", 1)}, UpdateKey: "r1"}) + if err != nil { + t.Fatal(err) + } + updated := &persistpb.UpdateReply{} + if err := updated.UnmarshalVT(data); err != nil || updated.GetRecord().GetFields()["roundsWon"].GetNumber() != 1 { + t.Fatalf("update: %v %v", updated, err) + } + data, err = call("GetMany", &persistpb.GetManyRequest{Players: []int32{1, 2}, Type: "stats"}) + if err != nil { + t.Fatal(err) + } + many := &persistpb.GetManyReply{} + if err := many.UnmarshalVT(data); err != nil || len(many.GetRecords()) != 2 || many.GetRecords()[0].GetRecord().GetFields()["roundsWon"].GetNumber() != 1 || len(many.GetRecords()[1].GetRecord().GetFields()) != 0 { + t.Fatalf("getMany: %v %v", many, err) + } + + // Each call outside the rules is refused. + _, err = call("Get", &persistpb.GetRequest{Player: 1, Type: "settings"}) + refused(t, err, "declares no persist record type") + _, err = call("Get", &persistpb.GetRequest{Player: 1, Type: "stats", Key: "alt"}) + refused(t, err, "take no key") + _, err = call("Get", &persistpb.GetRequest{Player: 9, Type: "stats"}) + refused(t, err, "no player is in slot 9") + _, err = call("GetMany", &persistpb.GetManyRequest{Players: make([]int32, ManyLimit+1), Type: "stats"}) + refused(t, err, "up to 16 players") + _, err = Answer(store, m, players, "Get", []byte{0xff}) + refused(t, err, "malformed") + _, err = Answer(store, m, players, "Delete", nil) + refused(t, err, "no method Delete") +} diff --git a/persist/store.go b/persist/store.go new file mode 100644 index 00000000..86033fc7 --- /dev/null +++ b/persist/store.go @@ -0,0 +1,313 @@ +package persist + +import ( + "fmt" + "io" + "os" + "path/filepath" + "strconv" + "sync" + + "github.com/paralin/modlock/internal/filelock" + "github.com/paralin/modlock/src/wasm" + persistpb "github.com/paralin/modlock/src/wasm/persist" + "github.com/pkg/errors" +) + +// Dir is the directory of a mod project that a local host keeps the mod's +// records in, one file per player. +const Dir = ".modlock/persist" + +// FileBytes bounds one player's file: every type's record at its bound with +// its recent keys, and room for the names around them. +const FileBytes = TypeLimit*(RecordBytes+RecentKeys*(UpdateKeyBytes+2)) + 16<<10 + +// LockFile is the file in a store's directory that the one process keeping +// its records holds locked, and HolderFile names that process, so a second +// host started on the same records is refused with the first one's name. +const ( + LockFile = "lock" + HolderFile = "holder" +) + +// holderBytes bounds what a refused Open reads of HolderFile. +const holderBytes = 512 + +// Store keeps one mod's records in a directory, one file per player, so +// they survive a restart of the host. Each update reads the player's file, +// applies its ops and replaces the file whole, one update at a time, so two +// updates of one record at once both land. +type Store struct { + // dir holds the files. + dir string + // mu orders the updates, so each reads the file the last one wrote. + mu sync.Mutex +} + +// opened are the stores this process holds the lock of, by directory, and +// their lock files. A store stays open, and its directory locked, until the +// process exits, so a rebuilt mod keeps writing through the store its first +// build opened. +var opened = struct { + sync.Mutex + stores map[string]*Store + locks []*os.File +}{stores: map[string]*Store{}} + +// Open returns the store of the records kept in dir, creating dir, and holds +// dir's lock until this process exits. Within one process each directory has +// one store. It refuses a directory another process holds, naming that +// process, so two hosts never write one mod's records at once. +func Open(dir string) (*Store, error) { + // Return this process's store of dir if it has one. + abs, err := filepath.Abs(dir) + if err != nil { + return nil, err + } + opened.Lock() + defer opened.Unlock() + if store := opened.stores[abs]; store != nil { + return store, nil + } + + // Lock the directory, or name the process that holds it. + if err := os.MkdirAll(abs, 0o755); err != nil { + return nil, err + } + held, err := filelock.Lock(filepath.Join(abs, LockFile), true, false) + if errors.Is(err, filelock.ErrLocked) { + return nil, errors.Errorf("another modlock keeps these records in %s: %s; stop it, then start this one again", abs, holder(abs)) + } + if err != nil { + return nil, errors.Wrapf(err, "lock %s", abs) + } + + // Name this process for the next one by its ID and program name, never + // its arguments, which may carry a path or a token, and keep the lock for + // its life. Only the next modlock of the same user reads the name. + // A file an older modlock left keeps its mode through the write, so set + // the mode too. + name := fmt.Sprintf("process %d, %s", os.Getpid(), filepath.Base(os.Args[0])) + path := filepath.Join(abs, HolderFile) + if err := os.WriteFile(path, []byte(name), 0o600); err != nil { + _ = held.Close() + return nil, err + } + if err := os.Chmod(path, 0o600); err != nil { + _ = held.Close() + return nil, err + } + store := &Store{dir: abs} + opened.stores[abs] = store + opened.locks = append(opened.locks, held) + return store, nil +} + +// holder returns the name of the process holding dir's lock, as it wrote it. +func holder(dir string) string { + f, err := os.Open(filepath.Join(dir, HolderFile)) + if err != nil { + return "a process that has not named itself" + } + defer f.Close() + data, _ := io.ReadAll(io.LimitReader(f, holderBytes)) + if len(data) == 0 { + return "a process that has not named itself" + } + return string(data) +} + +// newStore returns a store of the records kept in dir without its lock, for +// tests that stand in for one host. +func newStore(dir string) *Store { + return &Store{dir: dir} +} + +// Dir returns the directory the store keeps its files in. +func (s *Store) Dir() string { + return s.dir +} + +// path is the file of the player steamID. +func (s *Store) path(steamID uint64) string { + return filepath.Join(s.dir, strconv.FormatUint(steamID, 10)+".json") +} + +// read returns the file of the player steamID, empty when none is kept. A +// file past FileBytes is refused rather than read. +func (s *Store) read(steamID uint64) (*persistpb.PlayerFile, error) { + // Read the file within its bound. + path := s.path(steamID) + info, err := os.Stat(path) + if errors.Is(err, os.ErrNotExist) { + return &persistpb.PlayerFile{SteamId: steamID}, nil + } + if err != nil { + return nil, err + } + if info.Size() > FileBytes { + return nil, errors.Errorf("%s is %d bytes, past the %d a player's records may take", path, info.Size(), FileBytes) + } + data, err := os.ReadFile(path) + if err != nil { + return nil, err + } + + // Parse it as the store wrote it. + file := &persistpb.PlayerFile{} + if err := file.UnmarshalJSON(data); err != nil { + return nil, errors.Wrapf(err, "parse %s", path) + } + file.SteamId = steamID + return file, nil +} + +// Get returns the player steamID's record of recordType, empty for one never +// written. +func (s *Store) Get(steamID uint64, recordType *persistpb.RecordType) (*persistpb.Record, error) { + file, err := s.read(steamID) + if err != nil { + return nil, err + } + return recordOf(file.GetRecords()[recordType.GetName()]), nil +} + +// Update applies ops to the player steamID's record of recordType, as Apply +// does, and keeps the result. It returns the record after the update and +// whether the update's key made it a repeat. +func (s *Store) Update(steamID uint64, recordType *persistpb.RecordType, ops []*persistpb.Op, updateKey string) (*persistpb.Record, bool, error) { + // Read the player's file and apply the update to its record. + s.mu.Lock() + defer s.mu.Unlock() + file, err := s.read(steamID) + if err != nil { + return nil, false, err + } + name := recordType.GetName() + next, repeated, err := Apply(recordType, file.GetRecords()[name], ops, updateKey) + if err != nil || repeated { + return recordOf(next), repeated, err + } + + // Replace the file whole, so a crash leaves the old file or the new. + if file.Records == nil { + file.Records = map[string]*persistpb.StoredRecord{} + } + file.Records[name] = next + data, err := file.MarshalJSON() + if err != nil { + return nil, false, err + } + return recordOf(next), false, s.write(s.path(steamID), data) +} + +// write replaces path with data through a file beside it. +func (s *Store) write(path string, data []byte) error { + if err := os.MkdirAll(s.dir, 0o755); err != nil { + return err + } + temp, err := os.CreateTemp(s.dir, ".update-*") + if err != nil { + return err + } + defer os.Remove(temp.Name()) + if _, err := temp.Write(data); err != nil { + _ = temp.Close() + return err + } + if err := temp.Sync(); err != nil { + _ = temp.Close() + return err + } + if err := temp.Close(); err != nil { + return err + } + return os.Rename(temp.Name(), path) +} + +// recordOf returns stored's record, or an empty one. +func recordOf(stored *persistpb.StoredRecord) *persistpb.Record { + if record := stored.GetRecord(); record != nil { + return record + } + return &persistpb.Record{} +} + +// Players resolves a server slot to the SteamID64 of the player in it, and +// reports false for an empty slot. +type Players func(slot int32) (uint64, bool) + +// Answer answers one call of the persist service from the mod manifest +// describes: its record types, its players and the store of its records. It +// returns the reply's bytes, or a Refusal for a call that breaks a rule or a +// bound. +func Answer(store *Store, manifest *wasm.Manifest, players Players, method string, payload []byte) ([]byte, error) { + // Find the record type and player a call reaches. + reach := func(typeName, key string, slot int32) (*persistpb.RecordType, uint64, error) { + recordType := Find(manifest, typeName) + if recordType == nil { + return nil, 0, refuse("mod.json declares no persist record type %q", typeName) + } + if err := CheckKey(key); err != nil { + return nil, 0, err + } + steamID, ok := players(slot) + if !ok { + return nil, 0, refuse("no player is in slot %d", slot) + } + return recordType, steamID, nil + } + + switch method { + case "Get": + request := &persistpb.GetRequest{} + if err := request.UnmarshalVT(payload); err != nil { + return nil, refuse("the persist Get request is malformed") + } + recordType, steamID, err := reach(request.GetType(), request.GetKey(), request.GetPlayer()) + if err != nil { + return nil, err + } + record, err := store.Get(steamID, recordType) + if err != nil { + return nil, err + } + return (&persistpb.GetReply{Record: record}).MarshalVT() + case "GetMany": + request := &persistpb.GetManyRequest{} + if err := request.UnmarshalVT(payload); err != nil { + return nil, refuse("the persist GetMany request is malformed") + } + if len(request.GetPlayers()) > ManyLimit { + return nil, refuse("a persist GetMany reads up to %d players", ManyLimit) + } + reply := &persistpb.GetManyReply{} + for _, slot := range request.GetPlayers() { + recordType, steamID, err := reach(request.GetType(), "", slot) + if err != nil { + return nil, err + } + record, err := store.Get(steamID, recordType) + if err != nil { + return nil, err + } + reply.Records = append(reply.Records, &persistpb.PlayerRecord{Player: slot, Record: record}) + } + return reply.MarshalVT() + case "Update": + request := &persistpb.UpdateRequest{} + if err := request.UnmarshalVT(payload); err != nil { + return nil, refuse("the persist Update request is malformed") + } + recordType, steamID, err := reach(request.GetType(), request.GetKey(), request.GetPlayer()) + if err != nil { + return nil, err + } + record, repeated, err := store.Update(steamID, recordType, request.GetOps(), request.GetUpdateKey()) + if err != nil { + return nil, err + } + return (&persistpb.UpdateReply{Record: record, Repeated: repeated}).MarshalVT() + } + return nil, refuse("the persist service has no method %s", method) +} diff --git a/persist/store_lock_test.go b/persist/store_lock_test.go new file mode 100644 index 00000000..39c7fd1d --- /dev/null +++ b/persist/store_lock_test.go @@ -0,0 +1,97 @@ +package persist + +import ( + "bufio" + "os" + "os/exec" + "path/filepath" + "strconv" + "strings" + "testing" + + persistpb "github.com/paralin/modlock/src/wasm/persist" +) + +// holdEnv names the directory a helper process opens and holds. +const holdEnv = "MODLOCK_PERSIST_TEST_HOLD" + +// TestHoldStoreHelper is the first host when holdEnv is set: it opens the +// store, says so, and holds it until its input closes. +func TestHoldStoreHelper(t *testing.T) { + dir := os.Getenv(holdEnv) + if dir == "" { + t.Skip("run by TestSecondHostRefused") + } + if _, err := Open(dir); err != nil { + t.Fatal(err) + } + os.Stdout.WriteString("held\n") + _, _ = bufio.NewReader(os.Stdin).ReadString('\n') +} + +// TestSecondHostRefused starts a first host in another process and checks +// that a second cannot open the same records, that its error names the +// first by process ID and program name only, that the holder file is the +// owner's alone, and that the records open once the first exits. +func TestSecondHostRefused(t *testing.T) { + // Start the first host and wait until it holds the store. + // An older modlock left a world-readable holder file with its arguments. + dir := t.TempDir() + if err := os.WriteFile(filepath.Join(dir, HolderFile), []byte("process 1, modlock play -test.run=old"), 0o644); err != nil { + t.Fatal(err) + } + first := exec.Command(os.Args[0], "-test.run=^TestHoldStoreHelper$", "-test.count=1") + first.Env = append(os.Environ(), holdEnv+"="+dir) + stdin, err := first.StdinPipe() + if err != nil { + t.Fatal(err) + } + stdout, err := first.StdoutPipe() + if err != nil { + t.Fatal(err) + } + if err := first.Start(); err != nil { + t.Fatal(err) + } + defer func() { _ = first.Process.Kill(); _ = first.Wait() }() + line, err := bufio.NewReader(stdout).ReadString('\n') + if err != nil || line != "held\n" { + t.Fatalf("first host: %q %v", line, err) + } + + // The second is refused and told which process holds the records, by its + // process ID and program name, never its arguments, and the holder file + // is the owner's alone. + _, err = Open(dir) + pid := "process " + strconv.Itoa(first.Process.Pid) + program := filepath.Base(os.Args[0]) + if err == nil || !strings.Contains(err.Error(), "another modlock keeps these records") || !strings.Contains(err.Error(), pid+", "+program) || strings.Contains(err.Error(), "-test.run") { + t.Fatalf("second host: got %v, want a refusal naming %s and %s without arguments", err, pid, program) + } + held, err := os.ReadFile(filepath.Join(dir, HolderFile)) + if err != nil || string(held) != pid+", "+program { + t.Fatalf("holder file: %q %v, want %q", held, err, pid+", "+program) + } + if info, err := os.Stat(filepath.Join(dir, HolderFile)); err != nil || info.Mode().Perm() != 0o600 { + t.Fatalf("holder file mode: %v %v, want 0600", info.Mode().Perm(), err) + } + + // Once the first exits, the records open and take an update. + _ = stdin.Close() + if err := first.Wait(); err != nil { + t.Fatalf("first host exit: %v", err) + } + store, err := Open(dir) + if err != nil { + t.Fatalf("after the first exits: %v", err) + } + if _, _, err := store.Update(76561197960265728, stats, []*persistpb.Op{add("roundsWon", 1)}, "round-1"); err != nil { + t.Fatal(err) + } + + // Within one process, opening the records again returns the same store. + again, err := Open(dir) + if err != nil || again != store { + t.Fatalf("second open in one process: %p %v, want %p", again, err, store) + } +} diff --git a/project/build.go b/project/build.go index e9d72831..815157ac 100644 --- a/project/build.go +++ b/project/build.go @@ -10,11 +10,12 @@ import ( "path/filepath" "time" + "github.com/paralin/modlock/boards" "github.com/paralin/modlock/check" "github.com/paralin/modlock/internal/filelock" "github.com/paralin/modlock/internal/fileretry" - "github.com/paralin/modlock/boards" "github.com/paralin/modlock/metrics" + "github.com/paralin/modlock/persist" "github.com/paralin/modlock/settings" "github.com/paralin/modlock/src/wasm" "github.com/pkg/errors" @@ -69,6 +70,9 @@ func (p *Project) Build(ctx context.Context, output io.Writer, mode Mode) error if err := boards.Validate(p.Manifest); err != nil { return err } + if err := persist.Validate(p.Manifest); err != nil { + return err + } if err := p.shipMap(); err != nil { return err } diff --git a/sandbox/build.go b/sandbox/build.go index b941d901..a166799f 100644 --- a/sandbox/build.go +++ b/sandbox/build.go @@ -3,6 +3,7 @@ package sandbox import ( "io/fs" + "github.com/paralin/modlock/persist" "github.com/paralin/modlock/src/wasm" "github.com/pkg/errors" ) @@ -25,6 +26,9 @@ type Build struct { // fixtures answer the services the manifest names that have a fixture, // by service name. fixtures map[string]*fixture + // records keeps the records of the persist service, when the manifest + // declares record types. + records *persist.Store } // ReadBuild reads the built mod in dist through its manifest. diff --git a/sandbox/config.go b/sandbox/config.go index 89e2508c..79697120 100644 --- a/sandbox/config.go +++ b/sandbox/config.go @@ -34,4 +34,8 @@ type Config struct { // path, or empty when it has none; see FixtureDir. Nil gives no mod // fixtures. Fixtures func(path string) string + // Persist returns the directory that keeps the records of the built mod + // at path, the mod slug, through the persist service, or empty to keep + // them for the session only. Nil keeps every mod's for the session only. + Persist func(path, slug string) string } diff --git a/sandbox/persist_test.go b/sandbox/persist_test.go new file mode 100644 index 00000000..d332b9ca --- /dev/null +++ b/sandbox/persist_test.go @@ -0,0 +1,80 @@ +package sandbox + +import ( + "slices" + "strings" + "testing" + + "github.com/paralin/modlock/persist" + "github.com/paralin/modlock/src/host_app/control" + "github.com/paralin/modlock/src/wasm" + persistpb "github.com/paralin/modlock/src/wasm/persist" +) + +// TestPersistService keeps the sandbox player's records in the directory +// the config names, answers started calls from them in the next frame, and +// reads them back in a new sandbox on the same directory, as after a +// restart. A call for a slot with no player is refused. +func TestPersistService(t *testing.T) { + dir := t.TempDir() + manifest := &wasm.Manifest{ + Slug: "prophunt", + Services: []*wasm.Service{{Name: persist.Service}}, + Persist: []*persistpb.RecordType{{ + Name: "stats", + Writers: persistpb.Writers_WRITERS_SERVERS, + Fields: map[string]*persistpb.Field{"roundsWon": {Kind: persistpb.Field_KIND_COUNT}}, + }}, + } + start := func() (*Sandbox, *Build, []string) { + var logged []string + s := &Sandbox{config: Config{ + Persist: func(path, slug string) string { return dir }, + Events: func(event *control.HostEvent) { logged = append(logged, event.GetLog().GetText()) }, + }} + build := &Build{Manifest: manifest} + if err := s.provide("build", build); err != nil { + t.Fatal(err) + } + return s, build, logged + } + call := func(s *Sandbox, build *Build, method string, request interface{ MarshalVT() ([]byte, error) }) *wasm.ServiceRepliedEvent { + payload, _ := request.MarshalVT() + started, _ := (&wasm.StartServiceCallRequest{Service: persist.Service, Method: method, Payload: payload}).MarshalVT() + calls := &serviceCalls{} + if reply := s.answer(build, calls, &wasm.Call{Method: "StartServiceCall", Request: started}); reply.GetError() != "" { + t.Fatalf("start %s: %s", method, reply.GetError()) + } + if len(calls.ended) != 1 { + t.Fatalf("%s ended %d times", method, len(calls.ended)) + } + return calls.ended[0] + } + + // The first sandbox names where it keeps the records and takes an update. + s, build, logged := start() + if want := "service persist: the sandbox, kept in " + dir; !slices.Equal(logged, []string{want}) { + t.Fatalf("logged %q, want %q", logged, want) + } + ended := call(s, build, "Update", &persistpb.UpdateRequest{ + Player: 0, Type: "stats", UpdateKey: "round-1", + Ops: []*persistpb.Op{{Field: "roundsWon", Op: &persistpb.Op_Add{Add: 1}}}, + }) + if ended.GetError() != "" { + t.Fatal(ended.GetError()) + } + + // A new sandbox on the directory reads the record back. + s, build, _ = start() + ended = call(s, build, "Get", &persistpb.GetRequest{Player: 0, Type: "stats"}) + got := &persistpb.GetReply{} + if err := got.UnmarshalVT(ended.GetPayload()); err != nil || got.GetRecord().GetFields()["roundsWon"].GetNumber() != 1 { + t.Fatalf("after restart: %v %v %s", got, err, ended.GetError()) + } + + // Slot 3 holds nobody in the sandbox. + ended = call(s, build, "Get", &persistpb.GetRequest{Player: 3, Type: "stats"}) + if ended.GetFailure() != wasm.ServiceFailure_SERVICE_FAILURE_REFUSED || !strings.Contains(ended.GetError(), "no player is in slot 3") { + t.Fatalf("slot 3: %v", ended) + } +} diff --git a/sandbox/services.go b/sandbox/services.go index da75d9ab..1848e6c5 100644 --- a/sandbox/services.go +++ b/sandbox/services.go @@ -8,6 +8,7 @@ import ( "path/filepath" "strconv" + "github.com/paralin/modlock/persist" "github.com/paralin/modlock/src/wasm" "github.com/pkg/errors" ) @@ -37,6 +38,28 @@ func (s *Sandbox) provide(path string, build *Build) error { dir = s.config.Fixtures(path) } + // Keep the records of the persist service in the mod's directory, or for + // the session when it has none. + if len(build.Manifest.GetPersist()) != 0 { + dir := "" + if s.config.Persist != nil { + dir = s.config.Persist(path, mod) + } + if dir == "" { + temp, err := os.MkdirTemp("", "modlock-persist-") + if err != nil { + return err + } + dir = temp + } + records, err := persist.Open(dir) + if err != nil { + return err + } + build.records = records + s.log(mod, "service "+persist.Service+": the sandbox, kept in "+dir) + } + // Name each service's provider: the sandbox itself, a fixture or nobody. var missing error for _, service := range build.Manifest.GetServices() { @@ -47,6 +70,7 @@ func (s *Sandbox) provide(path string, build *Build) error { return err case provider == nil && name == scoresService: s.log(mod, "service "+name+": the sandbox") + case provider == nil && name == persist.Service && build.records != nil: case provider != nil: s.log(mod, "service "+name+": fixture "+provider.path) if build.fixtures == nil { @@ -129,6 +153,22 @@ func (f *fixture) answer(call *wasm.ServiceCall) *wasm.Reply { return &wasm.Reply{Response: response} } +// persist answers the persist service from build's records, for the +// sandbox's one player in slot 0. A refused call is logged, so the mod's +// author sees why. +func (s *Sandbox) persist(build *Build, call *wasm.ServiceCall) *wasm.Reply { + players := func(slot int32) (uint64, bool) { + return player.GetSteamId(), slot == player.GetPlayer() + } + response, err := persist.Answer(build.records, build.Manifest, players, call.GetMethod(), call.GetPayload()) + if err != nil { + s.log(build.Manifest.GetSlug(), "persist "+call.GetMethod()+": "+err.Error()) + return &wasm.Reply{Error: err.Error()} + } + reply, _ := (&wasm.ServiceReply{Payload: response}).MarshalVT() + return &wasm.Reply{Response: reply} +} + // maxServiceCalls bounds the calls a mod starts between frames, as the host // does. const maxServiceCalls = 256 @@ -149,6 +189,9 @@ func (s *Sandbox) callService(build *Build, request *wasm.ServiceCall) *wasm.Rep if request.GetService() == scoresService { return s.scores(build.Manifest, request) } + if request.GetService() == persist.Service && build.records != nil { + return s.persist(build, request) + } if provider := build.fixtures[request.GetService()]; provider != nil { return provider.answer(request) } diff --git a/src/wasm/manifest.pb.cc b/src/wasm/manifest.pb.cc index 709316a1..79505824 100644 --- a/src/wasm/manifest.pb.cc +++ b/src/wasm/manifest.pb.cc @@ -195,6 +195,7 @@ inline constexpr Manifest::Impl_::Impl_( metrics_{}, boards_{}, services_{}, + persist_{}, slug_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), @@ -248,7 +249,7 @@ const ::uint32_t protodesc_cold) = { 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_._has_bits_), - 18, // hasbit index offset + 19, // hasbit index offset PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.slug_), PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.name_), PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.version_), @@ -264,21 +265,23 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.content_addon_), PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.boards_), PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.services_), - 5, + PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.persist_), 6, 7, - 12, - 13, 8, + 13, + 14, 9, - 11, + 10, + 12, 0, 1, 2, - 14, - 10, + 15, + 11, 3, 4, + 5, 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::modlock::wasm::Service, _impl_._has_bits_), 5, // hasbit index offset @@ -341,13 +344,13 @@ const ::uint32_t static const ::_pbi::MigrationSchema schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { {0, sizeof(::modlock::wasm::Manifest)}, - {33, sizeof(::modlock::wasm::Service)}, - {40, sizeof(::modlock::wasm::Movement)}, - {47, sizeof(::modlock::wasm::Definition_PropertiesEntry_DoNotUse)}, - {54, sizeof(::modlock::wasm::Definition_FieldsEntry_DoNotUse)}, - {61, sizeof(::modlock::wasm::Definition_CopyFieldsEntry_DoNotUse)}, - {68, sizeof(::modlock::wasm::Definition_TextFieldsEntry_DoNotUse)}, - {75, sizeof(::modlock::wasm::Definition)}, + {35, sizeof(::modlock::wasm::Service)}, + {42, sizeof(::modlock::wasm::Movement)}, + {49, sizeof(::modlock::wasm::Definition_PropertiesEntry_DoNotUse)}, + {56, sizeof(::modlock::wasm::Definition_FieldsEntry_DoNotUse)}, + {63, sizeof(::modlock::wasm::Definition_CopyFieldsEntry_DoNotUse)}, + {70, sizeof(::modlock::wasm::Definition_TextFieldsEntry_DoNotUse)}, + {77, sizeof(::modlock::wasm::Definition)}, }; static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { &::modlock::wasm::_Manifest_default_instance_._instance, @@ -364,54 +367,58 @@ const char descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwa "\n2github.com/paralin/modlock/src/wasm/ma" "nifest.proto\022\014modlock.wasm\0329github.com/p" "aralin/modlock/src/wasm/metrics/metrics." - "proto\0327github.com/paralin/modlock/src/wa" - "sm/scores/scores.proto\032;github.com/paral" - "in/modlock/src/wasm/settings/settings.pr" - "oto\"\356\005\n\010Manifest\022\014\n\004slug\030\001 \001(\t\022\014\n\004name\030\002" - " \001(\t\022\017\n\007version\030\003 \001(\t\0221\n\010language\030\004 \001(\0162" - "\037.modlock.wasm.Manifest.Language\022/\n\007runt" - "ime\030\005 \001(\0162\036.modlock.wasm.Manifest.Runtim" - "e\022\r\n\005entry\030\006 \001(\t\022\013\n\003map\030\007 \001(\t\022(\n\010movemen" - "t\030\010 \001(\0132\026.modlock.wasm.Movement\022-\n\013defin" - "itions\030\t \003(\0132\030.modlock.wasm.Definition\0220" - "\n\010settings\030\n \003(\0132\036.modlock.wasm.settings" - ".Setting\022-\n\007metrics\030\013 \003(\0132\034.modlock.wasm" - ".metrics.Metric\022\024\n\014free_for_all\030\014 \001(\010\022\025\n" - "\rcontent_addon\030\r \001(\t\022*\n\006boards\030\016 \003(\0132\032.m" - "odlock.wasm.scores.Board\022\'\n\010services\030\017 \003" - "(\0132\025.modlock.wasm.Service\"k\n\007Runtime\022\023\n\017" - "RUNTIME_UNKNOWN\020\000\022\020\n\014RUNTIME_WASM\020\001\022\023\n\017R" - "UNTIME_QUICKJS\020\002\022\020\n\014RUNTIME_LUAU\020\003\022\022\n\016RU" - "NTIME_PYTHON\020\004\"\213\001\n\010Language\022\024\n\020LANGUAGE_" - "UNKNOWN\020\000\022\017\n\013LANGUAGE_GO\020\001\022\027\n\023LANGUAGE_T" - "YPESCRIPT\020\002\022\027\n\023LANGUAGE_JAVASCRIPT\020\003\022\021\n\r" - "LANGUAGE_LUAU\020\004\022\023\n\017LANGUAGE_PYTHON\020\005\")\n\007" - "Service\022\014\n\004name\030\001 \001(\t\022\020\n\010optional\030\002 \001(\010\"" - "\222\001\n\010Movement\022+\n\005model\030\001 \001(\0162\034.modlock.wa" - "sm.Movement.Model\022\r\n\005scale\030\002 \001(\002\"/\n\005Mode" - "l\022\020\n\014MODEL_NATIVE\020\000\022\024\n\020MODEL_QUAKEWORLD\020" - "\001J\004\010\003\020\004R\023unpredicted_buttons\"\360\004\n\nDefinit" - "ion\022+\n\004file\030\001 \001(\0162\035.modlock.wasm.Definit" - "ion.File\022\r\n\005entry\030\002 \001(\t\022<\n\nproperties\030\003 " - "\003(\0132(.modlock.wasm.Definition.Properties" - "Entry\0224\n\006fields\030\004 \003(\0132$.modlock.wasm.Def" - "inition.FieldsEntry\022=\n\013copy_fields\030\005 \003(\013" - "2(.modlock.wasm.Definition.CopyFieldsEnt" - "ry\022=\n\013text_fields\030\006 \003(\0132(.modlock.wasm.D" - "efinition.TextFieldsEntry\0321\n\017PropertiesE" - "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\002:\0028\001\032-\n\013" - "FieldsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\002:" - "\0028\001\0321\n\017CopyFieldsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" - "alue\030\002 \001(\t:\0028\001\0321\n\017TextFieldsEntry\022\013\n\003key" - "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"l\n\004File\022\022\n\016FIL" - "E_ABILITIES\020\000\022\017\n\013FILE_HEROES\020\001\022\027\n\023FILE_B" - "OT_DIFFICULTY\020\002\022\022\n\016FILE_NPC_UNITS\020\003\022\022\n\016F" - "ILE_MODIFIERS\020\004B*Z(github.com/paralin/mo" - "dlock/src/wasm;wasmb\006proto3" + "proto\0329github.com/paralin/modlock/src/wa" + "sm/persist/persist.proto\0327github.com/par" + "alin/modlock/src/wasm/scores/scores.prot" + "o\032;github.com/paralin/modlock/src/wasm/s" + "ettings/settings.proto\"\241\006\n\010Manifest\022\014\n\004s" + "lug\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022\017\n\007version\030\003 \001(\t" + "\0221\n\010language\030\004 \001(\0162\037.modlock.wasm.Manife" + "st.Language\022/\n\007runtime\030\005 \001(\0162\036.modlock.w" + "asm.Manifest.Runtime\022\r\n\005entry\030\006 \001(\t\022\013\n\003m" + "ap\030\007 \001(\t\022(\n\010movement\030\010 \001(\0132\026.modlock.was" + "m.Movement\022-\n\013definitions\030\t \003(\0132\030.modloc" + "k.wasm.Definition\0220\n\010settings\030\n \003(\0132\036.mo" + "dlock.wasm.settings.Setting\022-\n\007metrics\030\013" + " \003(\0132\034.modlock.wasm.metrics.Metric\022\024\n\014fr" + "ee_for_all\030\014 \001(\010\022\025\n\rcontent_addon\030\r \001(\t\022" + "*\n\006boards\030\016 \003(\0132\032.modlock.wasm.scores.Bo" + "ard\022\'\n\010services\030\017 \003(\0132\025.modlock.wasm.Ser" + "vice\0221\n\007persist\030\020 \003(\0132 .modlock.wasm.per" + "sist.RecordType\"k\n\007Runtime\022\023\n\017RUNTIME_UN" + "KNOWN\020\000\022\020\n\014RUNTIME_WASM\020\001\022\023\n\017RUNTIME_QUI" + "CKJS\020\002\022\020\n\014RUNTIME_LUAU\020\003\022\022\n\016RUNTIME_PYTH" + "ON\020\004\"\213\001\n\010Language\022\024\n\020LANGUAGE_UNKNOWN\020\000\022" + "\017\n\013LANGUAGE_GO\020\001\022\027\n\023LANGUAGE_TYPESCRIPT\020" + "\002\022\027\n\023LANGUAGE_JAVASCRIPT\020\003\022\021\n\rLANGUAGE_L" + "UAU\020\004\022\023\n\017LANGUAGE_PYTHON\020\005\")\n\007Service\022\014\n" + "\004name\030\001 \001(\t\022\020\n\010optional\030\002 \001(\010\"\222\001\n\010Moveme" + "nt\022+\n\005model\030\001 \001(\0162\034.modlock.wasm.Movemen" + "t.Model\022\r\n\005scale\030\002 \001(\002\"/\n\005Model\022\020\n\014MODEL" + "_NATIVE\020\000\022\024\n\020MODEL_QUAKEWORLD\020\001J\004\010\003\020\004R\023u" + "npredicted_buttons\"\360\004\n\nDefinition\022+\n\004fil" + "e\030\001 \001(\0162\035.modlock.wasm.Definition.File\022\r" + "\n\005entry\030\002 \001(\t\022<\n\nproperties\030\003 \003(\0132(.modl" + "ock.wasm.Definition.PropertiesEntry\0224\n\006f" + "ields\030\004 \003(\0132$.modlock.wasm.Definition.Fi" + "eldsEntry\022=\n\013copy_fields\030\005 \003(\0132(.modlock" + ".wasm.Definition.CopyFieldsEntry\022=\n\013text" + "_fields\030\006 \003(\0132(.modlock.wasm.Definition." + "TextFieldsEntry\0321\n\017PropertiesEntry\022\013\n\003ke" + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\002:\0028\001\032-\n\013FieldsEntr" + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\002:\0028\001\0321\n\017Cop" + "yFieldsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + ":\0028\001\0321\n\017TextFieldsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + "value\030\002 \001(\t:\0028\001\"l\n\004File\022\022\n\016FILE_ABILITIE" + "S\020\000\022\017\n\013FILE_HEROES\020\001\022\027\n\023FILE_BOT_DIFFICU" + "LTY\020\002\022\022\n\016FILE_NPC_UNITS\020\003\022\022\n\016FILE_MODIFI" + "ERS\020\004B*Z(github.com/paralin/modlock/src/" + "wasm;wasmb\006proto3" }; static const ::_pbi::DescriptorTable* PROTOBUF_NONNULL const - descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmanifest_2eproto_deps[3] = { + descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmanifest_2eproto_deps[4] = { &::descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmetrics_2fmetrics_2eproto, + &::descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, &::descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fscores_2fscores_2eproto, &::descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fsettings_2fsettings_2eproto, }; @@ -419,12 +426,12 @@ static ::absl::once_flag descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmanifest_2eproto = { false, false, - 1867, + 1977, descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmanifest_2eproto, "github.com/paralin/modlock/src/wasm/manifest.proto", &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmanifest_2eproto_once, descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmanifest_2eproto_deps, - 3, + 4, 8, schemas, file_default_instances, @@ -486,6 +493,12 @@ void Manifest::clear_boards() { ClearHasBitForRepeated(_impl_._has_bits_[0], 0x00000008U); } +void Manifest::clear_persist() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.persist_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000020U); +} Manifest::Manifest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) #if defined(PROTOBUF_CUSTOM_VTABLE) : ::google::protobuf::Message(arena, Manifest_class_data_.base()) { @@ -506,6 +519,7 @@ PROTOBUF_NDEBUG_INLINE Manifest::Impl_::Impl_( metrics_{visibility, arena, from.metrics_}, boards_{visibility, arena, from.boards_}, services_{visibility, arena, from.services_}, + persist_{visibility, arena, from.persist_}, slug_(arena, from.slug_), name_(arena, from.name_), version_(arena, from.version_), @@ -527,7 +541,7 @@ Manifest::Manifest( from._internal_metadata_); new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); ::uint32_t cached_has_bits = _impl_._has_bits_[0]; - _impl_.movement_ = (CheckHasBit(cached_has_bits, 0x00000800U)) + _impl_.movement_ = (CheckHasBit(cached_has_bits, 0x00001000U)) ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.movement_) : nullptr; ::memcpy(reinterpret_cast(&_impl_) + @@ -549,6 +563,7 @@ PROTOBUF_NDEBUG_INLINE Manifest::Impl_::Impl_( metrics_{visibility, arena}, boards_{visibility, arena}, services_{visibility, arena}, + persist_{visibility, arena}, slug_(arena), name_(arena), version_(arena), @@ -613,6 +628,10 @@ constexpr auto Manifest::InternalNewImpl_() { decltype(Manifest::_impl_.services_):: InternalGetArenaOffset( ::google::protobuf::Message::internal_visibility()), + PROTOBUF_FIELD_OFFSET(Manifest, _impl_.persist_) + + decltype(Manifest::_impl_.persist_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), }); if (arena_bits.has_value()) { return ::google::protobuf::internal::MessageCreator::CopyInit( @@ -657,17 +676,17 @@ Manifest::GetClassData() const { return Manifest_class_data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<4, 15, 6, 74, 2> +const ::_pbi::TcParseTable<4, 16, 7, 82, 2> Manifest::_table_ = { { PROTOBUF_FIELD_OFFSET(Manifest, _impl_._has_bits_), 0, // no _extensions_ - 15, 120, // max_field_number, fast_idx_mask + 16, 120, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294934528, // skipmap + 4294901760, // skipmap offsetof(decltype(_table_), field_entries), - 15, // num_field_entries - 6, // num_aux_entries + 16, // num_field_entries + 7, // num_aux_entries offsetof(decltype(_table_), aux_entries), Manifest_class_data_.base(), nullptr, // post_loop_handler @@ -676,38 +695,41 @@ Manifest::_table_ = { ::_pbi::TcParser::GetTable<::modlock::wasm::Manifest>(), // to_prefetch #endif // PROTOBUF_PREFETCH_PARSE_TABLE }, {{ - {::_pbi::TcParser::MiniParse, {}}, + // repeated .modlock.wasm.persist.RecordType persist = 16; + {::_pbi::TcParser::FastMtR2, + {386, 5, 6, + PROTOBUF_FIELD_OFFSET(Manifest, _impl_.persist_)}}, // string slug = 1; {::_pbi::TcParser::FastUS1, - {10, 5, 0, + {10, 6, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.slug_)}}, // string name = 2; {::_pbi::TcParser::FastUS1, - {18, 6, 0, + {18, 7, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.name_)}}, // string version = 3; {::_pbi::TcParser::FastUS1, - {26, 7, 0, + {26, 8, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.version_)}}, // .modlock.wasm.Manifest.Language language = 4; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Manifest, _impl_.language_), 12>(), - {32, 12, 0, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Manifest, _impl_.language_), 13>(), + {32, 13, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.language_)}}, // .modlock.wasm.Manifest.Runtime runtime = 5; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Manifest, _impl_.runtime_), 13>(), - {40, 13, 0, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Manifest, _impl_.runtime_), 14>(), + {40, 14, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.runtime_)}}, // string entry = 6; {::_pbi::TcParser::FastUS1, - {50, 8, 0, + {50, 9, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.entry_)}}, // string map = 7; {::_pbi::TcParser::FastUS1, - {58, 9, 0, + {58, 10, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.map_)}}, // .modlock.wasm.Movement movement = 8; {::_pbi::TcParser::FastMtS1, - {66, 11, 0, + {66, 12, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.movement_)}}, // repeated .modlock.wasm.Definition definitions = 9; {::_pbi::TcParser::FastMtR1, @@ -722,12 +744,12 @@ Manifest::_table_ = { {90, 2, 3, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.metrics_)}}, // bool free_for_all = 12; - {::_pbi::TcParser::SingularVarintNoZag1(), - {96, 14, 0, + {::_pbi::TcParser::SingularVarintNoZag1(), + {96, 15, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.free_for_all_)}}, // string content_addon = 13; {::_pbi::TcParser::FastUS1, - {106, 10, 0, + {106, 11, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.content_addon_)}}, // repeated .modlock.wasm.scores.Board boards = 14; {::_pbi::TcParser::FastMtR1, @@ -741,21 +763,21 @@ Manifest::_table_ = { 65535, 65535 }}, {{ // string slug = 1; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.slug_), _Internal::kHasBitsOffset + 5, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.slug_), _Internal::kHasBitsOffset + 6, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string name = 2; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.name_), _Internal::kHasBitsOffset + 6, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.name_), _Internal::kHasBitsOffset + 7, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string version = 3; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.version_), _Internal::kHasBitsOffset + 7, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.version_), _Internal::kHasBitsOffset + 8, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .modlock.wasm.Manifest.Language language = 4; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.language_), _Internal::kHasBitsOffset + 12, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.language_), _Internal::kHasBitsOffset + 13, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, // .modlock.wasm.Manifest.Runtime runtime = 5; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.runtime_), _Internal::kHasBitsOffset + 13, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.runtime_), _Internal::kHasBitsOffset + 14, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, // string entry = 6; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.entry_), _Internal::kHasBitsOffset + 8, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.entry_), _Internal::kHasBitsOffset + 9, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string map = 7; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.map_), _Internal::kHasBitsOffset + 9, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.map_), _Internal::kHasBitsOffset + 10, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .modlock.wasm.Movement movement = 8; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.movement_), _Internal::kHasBitsOffset + 11, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.movement_), _Internal::kHasBitsOffset + 12, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .modlock.wasm.Definition definitions = 9; {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.definitions_), _Internal::kHasBitsOffset + 0, 1, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .modlock.wasm.settings.Setting settings = 10; @@ -763,13 +785,15 @@ Manifest::_table_ = { // repeated .modlock.wasm.metrics.Metric metrics = 11; {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.metrics_), _Internal::kHasBitsOffset + 2, 3, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, // bool free_for_all = 12; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.free_for_all_), _Internal::kHasBitsOffset + 14, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.free_for_all_), _Internal::kHasBitsOffset + 15, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // string content_addon = 13; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.content_addon_), _Internal::kHasBitsOffset + 10, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.content_addon_), _Internal::kHasBitsOffset + 11, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // repeated .modlock.wasm.scores.Board boards = 14; {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.boards_), _Internal::kHasBitsOffset + 3, 4, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, // repeated .modlock.wasm.Service services = 15; {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.services_), _Internal::kHasBitsOffset + 4, 5, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + // repeated .modlock.wasm.persist.RecordType persist = 16; + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.persist_), _Internal::kHasBitsOffset + 5, 6, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ {::_pbi::TcParser::GetTable<::modlock::wasm::Movement>()}, @@ -778,9 +802,10 @@ Manifest::_table_ = { {::_pbi::TcParser::GetTable<::modlock::wasm::metrics::Metric>()}, {::_pbi::TcParser::GetTable<::modlock::wasm::scores::Board>()}, {::_pbi::TcParser::GetTable<::modlock::wasm::Service>()}, + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::RecordType>()}, }}, {{ - "\25\4\4\7\0\0\5\3\0\0\0\0\0\15\0\0" + "\25\4\4\7\0\0\5\3\0\0\0\0\0\15\0\0\0\0\0\0\0\0\0\0" "modlock.wasm.Manifest" "slug" "name" @@ -814,32 +839,35 @@ PROTOBUF_NOINLINE void Manifest::Clear() { if (CheckHasBitForRepeated(cached_has_bits, 0x00000010U)) { _impl_.services_.Clear(); } - if (CheckHasBit(cached_has_bits, 0x00000020U)) { - _impl_.slug_.ClearNonDefaultToEmpty(); + if (CheckHasBitForRepeated(cached_has_bits, 0x00000020U)) { + _impl_.persist_.Clear(); } if (CheckHasBit(cached_has_bits, 0x00000040U)) { - _impl_.name_.ClearNonDefaultToEmpty(); + _impl_.slug_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000080U)) { - _impl_.version_.ClearNonDefaultToEmpty(); + _impl_.name_.ClearNonDefaultToEmpty(); } } - if (BatchCheckHasBit(cached_has_bits, 0x00000f00U)) { + if (BatchCheckHasBit(cached_has_bits, 0x00001f00U)) { if (CheckHasBit(cached_has_bits, 0x00000100U)) { - _impl_.entry_.ClearNonDefaultToEmpty(); + _impl_.version_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000200U)) { - _impl_.map_.ClearNonDefaultToEmpty(); + _impl_.entry_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000400U)) { - _impl_.content_addon_.ClearNonDefaultToEmpty(); + _impl_.map_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000800U)) { + _impl_.content_addon_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00001000U)) { ABSL_DCHECK(_impl_.movement_ != nullptr); _impl_.movement_->Clear(); } } - if (BatchCheckHasBit(cached_has_bits, 0x00007000U)) { + if (BatchCheckHasBit(cached_has_bits, 0x0000e000U)) { ::memset(&_impl_.language_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.free_for_all_) - reinterpret_cast(&_impl_.language_)) + sizeof(_impl_.free_for_all_)); @@ -868,7 +896,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[0]; // string slug = 1; - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (!this_._internal_slug().empty()) { const ::std::string& _s = this_._internal_slug(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -878,7 +906,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // string name = 2; - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (!this_._internal_name().empty()) { const ::std::string& _s = this_._internal_name(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -888,7 +916,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // string version = 3; - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (!this_._internal_version().empty()) { const ::std::string& _s = this_._internal_version(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -898,7 +926,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // .modlock.wasm.Manifest.Language language = 4; - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (this_._internal_language() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( @@ -907,7 +935,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // .modlock.wasm.Manifest.Runtime runtime = 5; - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (this_._internal_runtime() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( @@ -916,7 +944,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // string entry = 6; - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (!this_._internal_entry().empty()) { const ::std::string& _s = this_._internal_entry(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -926,7 +954,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // string map = 7; - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (!this_._internal_map().empty()) { const ::std::string& _s = this_._internal_map(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -936,7 +964,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // .modlock.wasm.Movement movement = 8; - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 8, *this_._impl_.movement_, this_._impl_.movement_->GetCachedSize(), target, stream); @@ -982,7 +1010,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // bool free_for_all = 12; - if (CheckHasBit(cached_has_bits, 0x00004000U)) { + if (CheckHasBit(cached_has_bits, 0x00008000U)) { if (this_._internal_free_for_all() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -991,7 +1019,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // string content_addon = 13; - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { if (!this_._internal_content_addon().empty()) { const ::std::string& _s = this_._internal_content_addon(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -1026,6 +1054,19 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } } + // repeated .modlock.wasm.persist.RecordType persist = 16; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000020U)) { + for (unsigned i = 0, n = static_cast( + this_._internal_persist_size()); + i < n; i++) { + const auto& repfield = this_._internal_persist().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 16, repfield, repfield.GetCachedSize(), + target, stream); + } + } + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -1087,71 +1128,78 @@ ::size_t Manifest::ByteSizeLong() const { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } } + // repeated .modlock.wasm.persist.RecordType persist = 16; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000020U)) { + total_size += 2UL * this_._internal_persist_size(); + for (const auto& msg : this_._internal_persist()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + } // string slug = 1; - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (!this_._internal_slug().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_slug()); } } // string name = 2; - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (!this_._internal_name().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_name()); } } + } + if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { // string version = 3; - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (!this_._internal_version().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_version()); } } - } - if (BatchCheckHasBit(cached_has_bits, 0x00007f00U)) { // string entry = 6; - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (!this_._internal_entry().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_entry()); } } // string map = 7; - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (!this_._internal_map().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_map()); } } // string content_addon = 13; - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { if (!this_._internal_content_addon().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_content_addon()); } } // .modlock.wasm.Movement movement = 8; - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.movement_); } // .modlock.wasm.Manifest.Language language = 4; - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (this_._internal_language() != 0) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this_._internal_language()); } } // .modlock.wasm.Manifest.Runtime runtime = 5; - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (this_._internal_runtime() != 0) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this_._internal_runtime()); } } // bool free_for_all = 12; - if (CheckHasBit(cached_has_bits, 0x00004000U)) { + if (CheckHasBit(cached_has_bits, 0x00008000U)) { if (this_._internal_free_for_all() != 0) { total_size += 2; } @@ -1202,7 +1250,12 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, ::google::protobuf::MessageLite::internal_visibility(), arena, from._internal_services()); } - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBitForRepeated(cached_has_bits, 0x00000020U)) { + _this->_internal_mutable_persist()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_persist()); + } + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (!from._internal_slug().empty()) { _this->_internal_set_slug(from._internal_slug()); } else { @@ -1211,7 +1264,7 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (!from._internal_name().empty()) { _this->_internal_set_name(from._internal_name()); } else { @@ -1220,7 +1273,9 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + } + if (BatchCheckHasBit(cached_has_bits, 0x0000ff00U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (!from._internal_version().empty()) { _this->_internal_set_version(from._internal_version()); } else { @@ -1229,9 +1284,7 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - } - if (BatchCheckHasBit(cached_has_bits, 0x00007f00U)) { - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (!from._internal_entry().empty()) { _this->_internal_set_entry(from._internal_entry()); } else { @@ -1240,7 +1293,7 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (!from._internal_map().empty()) { _this->_internal_set_map(from._internal_map()); } else { @@ -1249,7 +1302,7 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { if (!from._internal_content_addon().empty()) { _this->_internal_set_content_addon(from._internal_content_addon()); } else { @@ -1258,7 +1311,7 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { ABSL_DCHECK(from._impl_.movement_ != nullptr); if (_this->_impl_.movement_ == nullptr) { _this->_impl_.movement_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.movement_); @@ -1266,17 +1319,17 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.movement_->MergeFrom(*from._impl_.movement_); } } - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (from._internal_language() != 0) { _this->_impl_.language_ = from._impl_.language_; } } - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (from._internal_runtime() != 0) { _this->_impl_.runtime_ = from._impl_.runtime_; } } - if (CheckHasBit(cached_has_bits, 0x00004000U)) { + if (CheckHasBit(cached_has_bits, 0x00008000U)) { if (from._internal_free_for_all() != 0) { _this->_impl_.free_for_all_ = from._impl_.free_for_all_; } @@ -1306,6 +1359,7 @@ void Manifest::InternalSwap(Manifest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) _impl_.metrics_.InternalSwap(&other->_impl_.metrics_); _impl_.boards_.InternalSwap(&other->_impl_.boards_); _impl_.services_.InternalSwap(&other->_impl_.services_); + _impl_.persist_.InternalSwap(&other->_impl_.persist_); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.slug_, &other->_impl_.slug_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_, &other->_impl_.name_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.version_, &other->_impl_.version_, arena); diff --git a/src/wasm/manifest.pb.go b/src/wasm/manifest.pb.go index 5c84dae2..55cf261a 100644 --- a/src/wasm/manifest.pb.go +++ b/src/wasm/manifest.pb.go @@ -15,6 +15,7 @@ import ( protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite" json "github.com/aperturerobotics/protobuf-go-lite/json" metrics "github.com/paralin/modlock/src/wasm/metrics" + persist "github.com/paralin/modlock/src/wasm/persist" scores "github.com/paralin/modlock/src/wasm/scores" settings "github.com/paralin/modlock/src/wasm/settings" ) @@ -261,6 +262,9 @@ type Manifest struct { // it needs has no provider, and starts it without an optional one, whose // calls then fail. Services []*Service `protobuf:"bytes,15,rep,name=services,proto3" json:"services,omitempty"` + // Persist are the record types the mod keeps for each player through the + // host's persist service, such as stats or unlocks, up to 8. + Persist []*persist.RecordType `protobuf:"bytes,16,rep,name=persist,proto3" json:"persist,omitempty"` } func (x *Manifest) Reset() { @@ -374,6 +378,13 @@ func (x *Manifest) GetServices() []*Service { return nil } +func (x *Manifest) GetPersist() []*persist.RecordType { + if x != nil { + return x.Persist + } + return nil +} + // Service names one service a mod calls. type Service struct { unknownFields []byte @@ -638,6 +649,7 @@ func (m *Manifest) CloneVT() *Manifest { r.Metrics = protobuf_go_lite.CloneVTSlice(m.Metrics) r.Boards = protobuf_go_lite.CloneVTSlice(m.Boards) r.Services = protobuf_go_lite.CloneVTSlice(m.Services) + r.Persist = protobuf_go_lite.CloneVTSlice(m.Persist) if len(m.unknownFields) > 0 { r.unknownFields = slices.Clone(m.unknownFields) } @@ -754,6 +766,9 @@ func (this *Manifest) EqualVT(that *Manifest) bool { if !protobuf_go_lite.EqualVTSliceImplicit(this.Services, that.Services, func() *Service { return &Service{} }) { return false } + if !protobuf_go_lite.EqualVTSliceImplicit(this.Persist, that.Persist, func() *persist.RecordType { return &persist.RecordType{} }) { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -1039,6 +1054,17 @@ func (x *Manifest) MarshalProtoJSON(s *json.MarshalState) { } s.WriteArrayEnd() } + if len(x.Persist) > 0 || s.HasField("persist") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("persist") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Persist { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("persist")) + } + s.WriteArrayEnd() + } s.WriteObjectEnd() } @@ -1180,6 +1206,24 @@ func (x *Manifest) UnmarshalProtoJSON(s *json.UnmarshalState) { } x.Services = append(x.Services, v) }) + case "persist": + s.AddField("persist") + if s.ReadNil() { + x.Persist = nil + return + } + s.ReadArray(func() { + if s.ReadNil() { + x.Persist = append(x.Persist, nil) + return + } + v := &persist.RecordType{} + v.UnmarshalProtoJSON(s.WithField("persist", false)) + if s.Err() != nil { + return + } + x.Persist = append(x.Persist, v) + }) } }) } @@ -1740,6 +1784,20 @@ func (m *Manifest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.unknownFields != nil { i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) } + if len(m.Persist) > 0 { + for iNdEx := len(m.Persist) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Persist[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + } if len(m.Services) > 0 { for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { size, err := m.Services[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) @@ -2083,6 +2141,10 @@ func (m *Manifest) SizeVT() (n int) { l = e.SizeVT() n += protobuf_go_lite.SizeMessage(1, l) } + for _, e := range m.Persist { + l = e.SizeVT() + n += protobuf_go_lite.SizeMessage(2, l) + } n += len(m.unknownFields) return n } @@ -2258,6 +2320,18 @@ func (x *Manifest) MarshalProtoText() string { } protobuf_go_lite.TextWriteListEnd(&sb) } + if len(x.Persist) > 0 { + protobuf_go_lite.TextWriteListStart(&sb, initialLen, "persist") + for i, v := range x.Persist { + protobuf_go_lite.TextWriteListSeparator(&sb, i) + if v == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &persist.RecordType{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, v) + } + } + protobuf_go_lite.TextWriteListEnd(&sb) + } return protobuf_go_lite.TextFinishMessage(&sb) } @@ -2635,6 +2709,19 @@ func (m *Manifest) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Persist", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + m.Persist = append(m.Persist, &persist.RecordType{}) + if err := m.Persist[len(m.Persist)-1].UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) diff --git a/src/wasm/manifest.pb.h b/src/wasm/manifest.pb.h index 7f09d032..111dab63 100644 --- a/src/wasm/manifest.pb.h +++ b/src/wasm/manifest.pb.h @@ -37,6 +37,7 @@ #include "google/protobuf/generated_enum_reflection.h" #include "google/protobuf/unknown_field_set.h" #include "metrics/metrics.pb.h" +#include "persist/persist.pb.h" #include "scores/scores.pb.h" #include "settings/settings.pb.h" // @@protoc_insertion_point(includes) @@ -1374,6 +1375,7 @@ class MODLOCK_API Manifest final : public ::google::protobuf::Message kMetricsFieldNumber = 11, kBoardsFieldNumber = 14, kServicesFieldNumber = 15, + kPersistFieldNumber = 16, kSlugFieldNumber = 1, kNameFieldNumber = 2, kVersionFieldNumber = 3, @@ -1470,6 +1472,23 @@ class MODLOCK_API Manifest final : public ::google::protobuf::Message const ::modlock::wasm::Service& services(int index) const; ::modlock::wasm::Service* PROTOBUF_NONNULL add_services(); const ::google::protobuf::RepeatedPtrField<::modlock::wasm::Service>& services() const; + // repeated .modlock.wasm.persist.RecordType persist = 16; + int persist_size() const; + private: + int _internal_persist_size() const; + + public: + void clear_persist() ; + ::modlock::wasm::persist::RecordType* PROTOBUF_NONNULL mutable_persist(int index); + ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::RecordType>* PROTOBUF_NONNULL mutable_persist(); + + private: + const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::RecordType>& _internal_persist() const; + ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::RecordType>* PROTOBUF_NONNULL _internal_mutable_persist(); + public: + const ::modlock::wasm::persist::RecordType& persist(int index) const; + ::modlock::wasm::persist::RecordType* PROTOBUF_NONNULL add_persist(); + const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::RecordType>& persist() const; // string slug = 1; void clear_slug() ; const ::std::string& slug() const; @@ -1609,8 +1628,8 @@ class MODLOCK_API Manifest final : public ::google::protobuf::Message private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<4, 15, - 6, 74, + static const ::google::protobuf::internal::TcParseTable<4, 16, + 7, 82, 2> _table_; @@ -1636,6 +1655,7 @@ class MODLOCK_API Manifest final : public ::google::protobuf::Message ::google::protobuf::RepeatedPtrField< ::modlock::wasm::metrics::Metric > metrics_; ::google::protobuf::RepeatedPtrField< ::modlock::wasm::scores::Board > boards_; ::google::protobuf::RepeatedPtrField< ::modlock::wasm::Service > services_; + ::google::protobuf::RepeatedPtrField< ::modlock::wasm::persist::RecordType > persist_; ::google::protobuf::internal::ArenaStringPtr slug_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::internal::ArenaStringPtr version_; @@ -1675,7 +1695,7 @@ inline void Manifest::clear_slug() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.slug_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000020U); + 0x00000040U); } inline const ::std::string& Manifest::slug() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -1685,13 +1705,13 @@ inline const ::std::string& Manifest::slug() const template PROTOBUF_ALWAYS_INLINE void Manifest::set_slug(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000020U); + SetHasBit(_impl_._has_bits_[0], 0x00000040U); _impl_.slug_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.slug) } inline ::std::string* PROTOBUF_NONNULL Manifest::mutable_slug() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000020U); + SetHasBit(_impl_._has_bits_[0], 0x00000040U); ::std::string* _s = _internal_mutable_slug(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.slug) return _s; @@ -1711,10 +1731,10 @@ inline ::std::string* PROTOBUF_NONNULL Manifest::_internal_mutable_slug() { inline ::std::string* PROTOBUF_NULLABLE Manifest::release_slug() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:modlock.wasm.Manifest.slug) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000020U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000040U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000020U); + ClearHasBit(_impl_._has_bits_[0], 0x00000040U); auto* released = _impl_.slug_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.slug_.Set("", GetArena()); @@ -1724,9 +1744,9 @@ inline ::std::string* PROTOBUF_NULLABLE Manifest::release_slug() { inline void Manifest::set_allocated_slug(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000020U); + SetHasBit(_impl_._has_bits_[0], 0x00000040U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000020U); + ClearHasBit(_impl_._has_bits_[0], 0x00000040U); } _impl_.slug_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.slug_.IsDefault()) { @@ -1740,7 +1760,7 @@ inline void Manifest::clear_name() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.name_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000040U); + 0x00000080U); } inline const ::std::string& Manifest::name() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -1750,13 +1770,13 @@ inline const ::std::string& Manifest::name() const template PROTOBUF_ALWAYS_INLINE void Manifest::set_name(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000040U); + SetHasBit(_impl_._has_bits_[0], 0x00000080U); _impl_.name_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.name) } inline ::std::string* PROTOBUF_NONNULL Manifest::mutable_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000040U); + SetHasBit(_impl_._has_bits_[0], 0x00000080U); ::std::string* _s = _internal_mutable_name(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.name) return _s; @@ -1776,10 +1796,10 @@ inline ::std::string* PROTOBUF_NONNULL Manifest::_internal_mutable_name() { inline ::std::string* PROTOBUF_NULLABLE Manifest::release_name() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:modlock.wasm.Manifest.name) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000040U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000080U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000040U); + ClearHasBit(_impl_._has_bits_[0], 0x00000080U); auto* released = _impl_.name_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.name_.Set("", GetArena()); @@ -1789,9 +1809,9 @@ inline ::std::string* PROTOBUF_NULLABLE Manifest::release_name() { inline void Manifest::set_allocated_name(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000040U); + SetHasBit(_impl_._has_bits_[0], 0x00000080U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000040U); + ClearHasBit(_impl_._has_bits_[0], 0x00000080U); } _impl_.name_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.name_.IsDefault()) { @@ -1805,7 +1825,7 @@ inline void Manifest::clear_version() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.version_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000080U); + 0x00000100U); } inline const ::std::string& Manifest::version() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -1815,13 +1835,13 @@ inline const ::std::string& Manifest::version() const template PROTOBUF_ALWAYS_INLINE void Manifest::set_version(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000080U); + SetHasBit(_impl_._has_bits_[0], 0x00000100U); _impl_.version_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.version) } inline ::std::string* PROTOBUF_NONNULL Manifest::mutable_version() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000080U); + SetHasBit(_impl_._has_bits_[0], 0x00000100U); ::std::string* _s = _internal_mutable_version(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.version) return _s; @@ -1841,10 +1861,10 @@ inline ::std::string* PROTOBUF_NONNULL Manifest::_internal_mutable_version() { inline ::std::string* PROTOBUF_NULLABLE Manifest::release_version() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:modlock.wasm.Manifest.version) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000080U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000100U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000080U); + ClearHasBit(_impl_._has_bits_[0], 0x00000100U); auto* released = _impl_.version_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.version_.Set("", GetArena()); @@ -1854,9 +1874,9 @@ inline ::std::string* PROTOBUF_NULLABLE Manifest::release_version() { inline void Manifest::set_allocated_version(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000080U); + SetHasBit(_impl_._has_bits_[0], 0x00000100U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000080U); + ClearHasBit(_impl_._has_bits_[0], 0x00000100U); } _impl_.version_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.version_.IsDefault()) { @@ -1870,7 +1890,7 @@ inline void Manifest::clear_language() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.language_ = 0; ClearHasBit(_impl_._has_bits_[0], - 0x00001000U); + 0x00002000U); } inline ::modlock::wasm::Manifest_Language Manifest::language() const { // @@protoc_insertion_point(field_get:modlock.wasm.Manifest.language) @@ -1878,7 +1898,7 @@ inline ::modlock::wasm::Manifest_Language Manifest::language() const { } inline void Manifest::set_language(::modlock::wasm::Manifest_Language value) { _internal_set_language(value); - SetHasBit(_impl_._has_bits_[0], 0x00001000U); + SetHasBit(_impl_._has_bits_[0], 0x00002000U); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.language) } inline ::modlock::wasm::Manifest_Language Manifest::_internal_language() const { @@ -1895,7 +1915,7 @@ inline void Manifest::clear_runtime() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.runtime_ = 0; ClearHasBit(_impl_._has_bits_[0], - 0x00002000U); + 0x00004000U); } inline ::modlock::wasm::Manifest_Runtime Manifest::runtime() const { // @@protoc_insertion_point(field_get:modlock.wasm.Manifest.runtime) @@ -1903,7 +1923,7 @@ inline ::modlock::wasm::Manifest_Runtime Manifest::runtime() const { } inline void Manifest::set_runtime(::modlock::wasm::Manifest_Runtime value) { _internal_set_runtime(value); - SetHasBit(_impl_._has_bits_[0], 0x00002000U); + SetHasBit(_impl_._has_bits_[0], 0x00004000U); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.runtime) } inline ::modlock::wasm::Manifest_Runtime Manifest::_internal_runtime() const { @@ -1920,7 +1940,7 @@ inline void Manifest::clear_entry() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.entry_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000100U); + 0x00000200U); } inline const ::std::string& Manifest::entry() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -1930,13 +1950,13 @@ inline const ::std::string& Manifest::entry() const template PROTOBUF_ALWAYS_INLINE void Manifest::set_entry(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000100U); + SetHasBit(_impl_._has_bits_[0], 0x00000200U); _impl_.entry_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.entry) } inline ::std::string* PROTOBUF_NONNULL Manifest::mutable_entry() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000100U); + SetHasBit(_impl_._has_bits_[0], 0x00000200U); ::std::string* _s = _internal_mutable_entry(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.entry) return _s; @@ -1956,10 +1976,10 @@ inline ::std::string* PROTOBUF_NONNULL Manifest::_internal_mutable_entry() { inline ::std::string* PROTOBUF_NULLABLE Manifest::release_entry() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:modlock.wasm.Manifest.entry) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000100U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000200U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000100U); + ClearHasBit(_impl_._has_bits_[0], 0x00000200U); auto* released = _impl_.entry_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.entry_.Set("", GetArena()); @@ -1969,9 +1989,9 @@ inline ::std::string* PROTOBUF_NULLABLE Manifest::release_entry() { inline void Manifest::set_allocated_entry(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000100U); + SetHasBit(_impl_._has_bits_[0], 0x00000200U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000100U); + ClearHasBit(_impl_._has_bits_[0], 0x00000200U); } _impl_.entry_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.entry_.IsDefault()) { @@ -1985,7 +2005,7 @@ inline void Manifest::clear_map() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.map_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000200U); + 0x00000400U); } inline const ::std::string& Manifest::map() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -1995,13 +2015,13 @@ inline const ::std::string& Manifest::map() const template PROTOBUF_ALWAYS_INLINE void Manifest::set_map(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000200U); + SetHasBit(_impl_._has_bits_[0], 0x00000400U); _impl_.map_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.map) } inline ::std::string* PROTOBUF_NONNULL Manifest::mutable_map() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000200U); + SetHasBit(_impl_._has_bits_[0], 0x00000400U); ::std::string* _s = _internal_mutable_map(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.map) return _s; @@ -2021,10 +2041,10 @@ inline ::std::string* PROTOBUF_NONNULL Manifest::_internal_mutable_map() { inline ::std::string* PROTOBUF_NULLABLE Manifest::release_map() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:modlock.wasm.Manifest.map) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000200U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000400U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000200U); + ClearHasBit(_impl_._has_bits_[0], 0x00000400U); auto* released = _impl_.map_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.map_.Set("", GetArena()); @@ -2034,9 +2054,9 @@ inline ::std::string* PROTOBUF_NULLABLE Manifest::release_map() { inline void Manifest::set_allocated_map(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000200U); + SetHasBit(_impl_._has_bits_[0], 0x00000400U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000200U); + ClearHasBit(_impl_._has_bits_[0], 0x00000400U); } _impl_.map_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.map_.IsDefault()) { @@ -2047,7 +2067,7 @@ inline void Manifest::set_allocated_map(::std::string* PROTOBUF_NULLABLE value) // .modlock.wasm.Movement movement = 8; inline bool Manifest::has_movement() const { - bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000800U); + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00001000U); PROTOBUF_ASSUME(!value || _impl_.movement_ != nullptr); return value; } @@ -2055,7 +2075,7 @@ inline void Manifest::clear_movement() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.movement_ != nullptr) _impl_.movement_->Clear(); ClearHasBit(_impl_._has_bits_[0], - 0x00000800U); + 0x00001000U); } inline const ::modlock::wasm::Movement& Manifest::_internal_movement() const { ::google::protobuf::internal::TSanRead(&_impl_); @@ -2074,16 +2094,16 @@ inline void Manifest::unsafe_arena_set_allocated_movement( } _impl_.movement_ = reinterpret_cast<::modlock::wasm::Movement*>(value); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000800U); + SetHasBit(_impl_._has_bits_[0], 0x00001000U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000800U); + ClearHasBit(_impl_._has_bits_[0], 0x00001000U); } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.wasm.Manifest.movement) } inline ::modlock::wasm::Movement* PROTOBUF_NULLABLE Manifest::release_movement() { ::google::protobuf::internal::TSanWrite(&_impl_); - ClearHasBit(_impl_._has_bits_[0], 0x00000800U); + ClearHasBit(_impl_._has_bits_[0], 0x00001000U); ::modlock::wasm::Movement* released = _impl_.movement_; _impl_.movement_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -2103,7 +2123,7 @@ inline ::modlock::wasm::Movement* PROTOBUF_NULLABLE Manifest::unsafe_arena_relea ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:modlock.wasm.Manifest.movement) - ClearHasBit(_impl_._has_bits_[0], 0x00000800U); + ClearHasBit(_impl_._has_bits_[0], 0x00001000U); ::modlock::wasm::Movement* temp = _impl_.movement_; _impl_.movement_ = nullptr; return temp; @@ -2118,7 +2138,7 @@ inline ::modlock::wasm::Movement* PROTOBUF_NONNULL Manifest::_internal_mutable_m } inline ::modlock::wasm::Movement* PROTOBUF_NONNULL Manifest::mutable_movement() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000800U); + SetHasBit(_impl_._has_bits_[0], 0x00001000U); ::modlock::wasm::Movement* _msg = _internal_mutable_movement(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.movement) return _msg; @@ -2135,9 +2155,9 @@ inline void Manifest::set_allocated_movement(::modlock::wasm::Movement* PROTOBUF if (message_arena != submessage_arena) { value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - SetHasBit(_impl_._has_bits_[0], 0x00000800U); + SetHasBit(_impl_._has_bits_[0], 0x00001000U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000800U); + ClearHasBit(_impl_._has_bits_[0], 0x00001000U); } _impl_.movement_ = reinterpret_cast<::modlock::wasm::Movement*>(value); @@ -2305,7 +2325,7 @@ inline void Manifest::clear_free_for_all() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.free_for_all_ = false; ClearHasBit(_impl_._has_bits_[0], - 0x00004000U); + 0x00008000U); } inline bool Manifest::free_for_all() const { // @@protoc_insertion_point(field_get:modlock.wasm.Manifest.free_for_all) @@ -2313,7 +2333,7 @@ inline bool Manifest::free_for_all() const { } inline void Manifest::set_free_for_all(bool value) { _internal_set_free_for_all(value); - SetHasBit(_impl_._has_bits_[0], 0x00004000U); + SetHasBit(_impl_._has_bits_[0], 0x00008000U); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.free_for_all) } inline bool Manifest::_internal_free_for_all() const { @@ -2330,7 +2350,7 @@ inline void Manifest::clear_content_addon() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.content_addon_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000400U); + 0x00000800U); } inline const ::std::string& Manifest::content_addon() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -2340,13 +2360,13 @@ inline const ::std::string& Manifest::content_addon() const template PROTOBUF_ALWAYS_INLINE void Manifest::set_content_addon(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000400U); + SetHasBit(_impl_._has_bits_[0], 0x00000800U); _impl_.content_addon_.Set(static_cast(arg), args..., GetArena()); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.content_addon) } inline ::std::string* PROTOBUF_NONNULL Manifest::mutable_content_addon() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000400U); + SetHasBit(_impl_._has_bits_[0], 0x00000800U); ::std::string* _s = _internal_mutable_content_addon(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.content_addon) return _s; @@ -2366,10 +2386,10 @@ inline ::std::string* PROTOBUF_NONNULL Manifest::_internal_mutable_content_addon inline ::std::string* PROTOBUF_NULLABLE Manifest::release_content_addon() { ::google::protobuf::internal::TSanWrite(&_impl_); // @@protoc_insertion_point(field_release:modlock.wasm.Manifest.content_addon) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000400U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000800U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000400U); + ClearHasBit(_impl_._has_bits_[0], 0x00000800U); auto* released = _impl_.content_addon_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.content_addon_.Set("", GetArena()); @@ -2379,9 +2399,9 @@ inline ::std::string* PROTOBUF_NULLABLE Manifest::release_content_addon() { inline void Manifest::set_allocated_content_addon(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000400U); + SetHasBit(_impl_._has_bits_[0], 0x00000800U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000400U); + ClearHasBit(_impl_._has_bits_[0], 0x00000800U); } _impl_.content_addon_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.content_addon_.IsDefault()) { @@ -2496,6 +2516,56 @@ Manifest::_internal_mutable_services() { return &_impl_.services_; } +// repeated .modlock.wasm.persist.RecordType persist = 16; +inline int Manifest::_internal_persist_size() const { + return _internal_persist().size(); +} +inline int Manifest::persist_size() const { + return _internal_persist_size(); +} +inline ::modlock::wasm::persist::RecordType* PROTOBUF_NONNULL Manifest::mutable_persist(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.persist) + return _internal_mutable_persist()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::RecordType>* PROTOBUF_NONNULL Manifest::mutable_persist() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000020U); + // @@protoc_insertion_point(field_mutable_list:modlock.wasm.Manifest.persist) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_persist(); +} +inline const ::modlock::wasm::persist::RecordType& Manifest::persist(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.Manifest.persist) + return _internal_persist().Get(index); +} +inline ::modlock::wasm::persist::RecordType* PROTOBUF_NONNULL Manifest::add_persist() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::modlock::wasm::persist::RecordType* _add = + _internal_mutable_persist()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000020U); + // @@protoc_insertion_point(field_add:modlock.wasm.Manifest.persist) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::RecordType>& Manifest::persist() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:modlock.wasm.Manifest.persist) + return _internal_persist(); +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::RecordType>& +Manifest::_internal_persist() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.persist_; +} +inline ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::RecordType>* PROTOBUF_NONNULL +Manifest::_internal_mutable_persist() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.persist_; +} + // ------------------------------------------------------------------- // Service diff --git a/src/wasm/manifest.pb.ts b/src/wasm/manifest.pb.ts index 6973d3ae..4fe67e91 100644 --- a/src/wasm/manifest.pb.ts +++ b/src/wasm/manifest.pb.ts @@ -5,6 +5,7 @@ import { Setting } from './settings/settings.pb.js' import { Metric } from './metrics/metrics.pb.js' import { Board } from './scores/scores.pb.js' +import { RecordType } from './persist/persist.pb.js' import type { MessageType } from '@aptre/protobuf-es-lite/message' import { createMessageType, newMap } from '@aptre/protobuf-es-lite/message' import type { @@ -98,6 +99,11 @@ export interface Manifest { * calls then fail. */ services?: Service[] + /** + * Persist are the record types the mod keeps for each player through the + * host's persist service, such as stats or unlocks, up to 8. + */ + persist?: RecordType[] } export const Manifest: MessageType = @@ -119,6 +125,7 @@ export const Manifest: MessageType = [13, 'content_addon', 9], [14, 'boards', 11, 1, Board.codec], [15, 'services', 11, 1, Service.codec], + [16, 'persist', 11, 1, RecordType.codec], ], { decode: (r: BinaryReader, end: number, m: Manifest): Manifest => { @@ -173,6 +180,9 @@ export const Manifest: MessageType = case 15: ;(m.services ??= []).push(Service.decode(r, r.delimited(), {})) break + case 16: + ;(m.persist ??= []).push(RecordType.decode(r, r.delimited(), {})) + break default: r.skip(t) } @@ -240,6 +250,10 @@ export const Manifest: MessageType = const a = m.services if (a != null) for (const e of a) Service.writeField(w, 15, e) } + { + const a = m.persist + if (a != null) for (const e of a) RecordType.writeField(w, 16, e) + } }, }, ) diff --git a/src/wasm/manifest.proto b/src/wasm/manifest.proto index f763ec04..78166eb9 100644 --- a/src/wasm/manifest.proto +++ b/src/wasm/manifest.proto @@ -5,6 +5,7 @@ package modlock.wasm; option go_package = "github.com/paralin/modlock/src/wasm;wasm"; import "github.com/paralin/modlock/src/wasm/metrics/metrics.proto"; +import "github.com/paralin/modlock/src/wasm/persist/persist.proto"; import "github.com/paralin/modlock/src/wasm/scores/scores.proto"; import "github.com/paralin/modlock/src/wasm/settings/settings.proto"; @@ -112,6 +113,10 @@ message Manifest { // it needs has no provider, and starts it without an optional one, whose // calls then fail. repeated Service services = 15; + + // Persist are the record types the mod keeps for each player through the + // host's persist service, such as stats or unlocks, up to 8. + repeated modlock.wasm.persist.RecordType persist = 16; } // Service names one service a mod calls. diff --git a/src/wasm/persist/persist.pb.cc b/src/wasm/persist/persist.pb.cc new file mode 100644 index 00000000..cfb6d98d --- /dev/null +++ b/src/wasm/persist/persist.pb.cc @@ -0,0 +1,6421 @@ +//go:build deps_only && cgo + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: github.com/paralin/modlock/src/wasm/persist/persist.proto +// Protobuf C++ Version: 6.33.4 + +#include "persist.pb.h" + +#include +#include +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/generated_message_tctable_impl.h" +#include "google/protobuf/extension_set.h" +#include "google/protobuf/generated_message_util.h" +#include "google/protobuf/wire_format_lite.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/generated_message_reflection.h" +#include "google/protobuf/reflection_ops.h" +#include "google/protobuf/wire_format.h" +// @@protoc_insertion_point(includes) + +// Must be included last. +#include "google/protobuf/port_def.inc" +PROTOBUF_PRAGMA_INIT_SEG +namespace _pb = ::google::protobuf; +namespace _pbi = ::google::protobuf::internal; +namespace _fl = ::google::protobuf::internal::field_layout; +namespace modlock { +namespace wasm { +namespace persist { + +inline constexpr Tags::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + members_{} {} + +template +PROTOBUF_CONSTEXPR Tags::Tags(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Tags_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct TagsDefaultTypeInternal { + PROTOBUF_CONSTEXPR TagsDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~TagsDefaultTypeInternal() {} + union { + Tags _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TagsDefaultTypeInternal _Tags_default_instance_; +template +PROTOBUF_CONSTEXPR StoredRecord_KindsEntry_DoNotUse::StoredRecord_KindsEntry_DoNotUse(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : StoredRecord_KindsEntry_DoNotUse::MapEntry(StoredRecord_KindsEntry_DoNotUse_class_data_.base()){} +#else // PROTOBUF_CUSTOM_VTABLE + : StoredRecord_KindsEntry_DoNotUse::MapEntry() { +} +#endif // PROTOBUF_CUSTOM_VTABLE +struct StoredRecord_KindsEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR StoredRecord_KindsEntry_DoNotUseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~StoredRecord_KindsEntry_DoNotUseDefaultTypeInternal() {} + union { + StoredRecord_KindsEntry_DoNotUse _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StoredRecord_KindsEntry_DoNotUseDefaultTypeInternal _StoredRecord_KindsEntry_DoNotUse_default_instance_; + +inline constexpr GetRequest::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + type_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + key_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + player_{0} {} + +template +PROTOBUF_CONSTEXPR GetRequest::GetRequest(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(GetRequest_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct GetRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR GetRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~GetRequestDefaultTypeInternal() {} + union { + GetRequest _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetRequestDefaultTypeInternal _GetRequest_default_instance_; + +inline constexpr GetManyRequest::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + players_{}, + _players_cached_byte_size_{0}, + type_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()) {} + +template +PROTOBUF_CONSTEXPR GetManyRequest::GetManyRequest(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(GetManyRequest_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct GetManyRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR GetManyRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~GetManyRequestDefaultTypeInternal() {} + union { + GetManyRequest _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetManyRequestDefaultTypeInternal _GetManyRequest_default_instance_; + +inline constexpr Field::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + kind_{static_cast< ::modlock::wasm::persist::Field_Kind >(0)}, + max_bytes_{0u} {} + +template +PROTOBUF_CONSTEXPR Field::Field(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Field_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct FieldDefaultTypeInternal { + PROTOBUF_CONSTEXPR FieldDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~FieldDefaultTypeInternal() {} + union { + Field _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FieldDefaultTypeInternal _Field_default_instance_; + +inline constexpr Value::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : value_{}, + _cached_size_{0}, + _oneof_case_{} {} + +template +PROTOBUF_CONSTEXPR Value::Value(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Value_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct ValueDefaultTypeInternal { + PROTOBUF_CONSTEXPR ValueDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ValueDefaultTypeInternal() {} + union { + Value _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ValueDefaultTypeInternal _Value_default_instance_; +template +PROTOBUF_CONSTEXPR RecordType_FieldsEntry_DoNotUse::RecordType_FieldsEntry_DoNotUse(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : RecordType_FieldsEntry_DoNotUse::MapEntry(RecordType_FieldsEntry_DoNotUse_class_data_.base()){} +#else // PROTOBUF_CUSTOM_VTABLE + : RecordType_FieldsEntry_DoNotUse::MapEntry() { +} +#endif // PROTOBUF_CUSTOM_VTABLE +struct RecordType_FieldsEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR RecordType_FieldsEntry_DoNotUseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~RecordType_FieldsEntry_DoNotUseDefaultTypeInternal() {} + union { + RecordType_FieldsEntry_DoNotUse _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RecordType_FieldsEntry_DoNotUseDefaultTypeInternal _RecordType_FieldsEntry_DoNotUse_default_instance_; + +inline constexpr RecordType::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + writers_{static_cast< ::modlock::wasm::persist::Writers >(0)}, + fields_{} {} + +template +PROTOBUF_CONSTEXPR RecordType::RecordType(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(RecordType_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct RecordTypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR RecordTypeDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~RecordTypeDefaultTypeInternal() {} + union { + RecordType _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RecordTypeDefaultTypeInternal _RecordType_default_instance_; +template +PROTOBUF_CONSTEXPR Record_FieldsEntry_DoNotUse::Record_FieldsEntry_DoNotUse(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : Record_FieldsEntry_DoNotUse::MapEntry(Record_FieldsEntry_DoNotUse_class_data_.base()){} +#else // PROTOBUF_CUSTOM_VTABLE + : Record_FieldsEntry_DoNotUse::MapEntry() { +} +#endif // PROTOBUF_CUSTOM_VTABLE +struct Record_FieldsEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR Record_FieldsEntry_DoNotUseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~Record_FieldsEntry_DoNotUseDefaultTypeInternal() {} + union { + Record_FieldsEntry_DoNotUse _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Record_FieldsEntry_DoNotUseDefaultTypeInternal _Record_FieldsEntry_DoNotUse_default_instance_; + +inline constexpr Op::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + field_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + op_{}, + _oneof_case_{} {} + +template +PROTOBUF_CONSTEXPR Op::Op(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Op_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct OpDefaultTypeInternal { + PROTOBUF_CONSTEXPR OpDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~OpDefaultTypeInternal() {} + union { + Op _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 OpDefaultTypeInternal _Op_default_instance_; + +inline constexpr UpdateRequest::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + ops_{}, + type_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + key_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + update_key_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + player_{0} {} + +template +PROTOBUF_CONSTEXPR UpdateRequest::UpdateRequest(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(UpdateRequest_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct UpdateRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR UpdateRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~UpdateRequestDefaultTypeInternal() {} + union { + UpdateRequest _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UpdateRequestDefaultTypeInternal _UpdateRequest_default_instance_; + +inline constexpr Record::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + fields_{} {} + +template +PROTOBUF_CONSTEXPR Record::Record(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Record_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct RecordDefaultTypeInternal { + PROTOBUF_CONSTEXPR RecordDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~RecordDefaultTypeInternal() {} + union { + Record _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 RecordDefaultTypeInternal _Record_default_instance_; + +inline constexpr UpdateReply::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + record_{nullptr}, + repeated_{false} {} + +template +PROTOBUF_CONSTEXPR UpdateReply::UpdateReply(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(UpdateReply_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct UpdateReplyDefaultTypeInternal { + PROTOBUF_CONSTEXPR UpdateReplyDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~UpdateReplyDefaultTypeInternal() {} + union { + UpdateReply _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UpdateReplyDefaultTypeInternal _UpdateReply_default_instance_; + +inline constexpr StoredRecord::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + recent_keys_{}, + record_{nullptr}, + version_{::uint64_t{0u}}, + kinds_{} {} + +template +PROTOBUF_CONSTEXPR StoredRecord::StoredRecord(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(StoredRecord_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct StoredRecordDefaultTypeInternal { + PROTOBUF_CONSTEXPR StoredRecordDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~StoredRecordDefaultTypeInternal() {} + union { + StoredRecord _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StoredRecordDefaultTypeInternal _StoredRecord_default_instance_; + +inline constexpr PlayerRecord::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + record_{nullptr}, + player_{0} {} + +template +PROTOBUF_CONSTEXPR PlayerRecord::PlayerRecord(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(PlayerRecord_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct PlayerRecordDefaultTypeInternal { + PROTOBUF_CONSTEXPR PlayerRecordDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~PlayerRecordDefaultTypeInternal() {} + union { + PlayerRecord _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PlayerRecordDefaultTypeInternal _PlayerRecord_default_instance_; + +inline constexpr GetReply::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + record_{nullptr} {} + +template +PROTOBUF_CONSTEXPR GetReply::GetReply(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(GetReply_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct GetReplyDefaultTypeInternal { + PROTOBUF_CONSTEXPR GetReplyDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~GetReplyDefaultTypeInternal() {} + union { + GetReply _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetReplyDefaultTypeInternal _GetReply_default_instance_; +template +PROTOBUF_CONSTEXPR PlayerFile_RecordsEntry_DoNotUse::PlayerFile_RecordsEntry_DoNotUse(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : PlayerFile_RecordsEntry_DoNotUse::MapEntry(PlayerFile_RecordsEntry_DoNotUse_class_data_.base()){} +#else // PROTOBUF_CUSTOM_VTABLE + : PlayerFile_RecordsEntry_DoNotUse::MapEntry() { +} +#endif // PROTOBUF_CUSTOM_VTABLE +struct PlayerFile_RecordsEntry_DoNotUseDefaultTypeInternal { + PROTOBUF_CONSTEXPR PlayerFile_RecordsEntry_DoNotUseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~PlayerFile_RecordsEntry_DoNotUseDefaultTypeInternal() {} + union { + PlayerFile_RecordsEntry_DoNotUse _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PlayerFile_RecordsEntry_DoNotUseDefaultTypeInternal _PlayerFile_RecordsEntry_DoNotUse_default_instance_; + +inline constexpr GetManyReply::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + records_{} {} + +template +PROTOBUF_CONSTEXPR GetManyReply::GetManyReply(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(GetManyReply_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct GetManyReplyDefaultTypeInternal { + PROTOBUF_CONSTEXPR GetManyReplyDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~GetManyReplyDefaultTypeInternal() {} + union { + GetManyReply _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetManyReplyDefaultTypeInternal _GetManyReply_default_instance_; + +inline constexpr PlayerFile::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + steam_id_{::uint64_t{0u}}, + records_{} {} + +template +PROTOBUF_CONSTEXPR PlayerFile::PlayerFile(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(PlayerFile_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct PlayerFileDefaultTypeInternal { + PROTOBUF_CONSTEXPR PlayerFileDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~PlayerFileDefaultTypeInternal() {} + union { + PlayerFile _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PlayerFileDefaultTypeInternal _PlayerFile_default_instance_; +} // namespace persist +} // namespace wasm +} // namespace modlock +static const ::_pb::EnumDescriptor* PROTOBUF_NONNULL + file_level_enum_descriptors_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto[2]; +static constexpr const ::_pb::ServiceDescriptor* PROTOBUF_NONNULL* PROTOBUF_NULLABLE + file_level_service_descriptors_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto = nullptr; +const ::uint32_t + TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE( + protodesc_cold) = { + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::RecordType_FieldsEntry_DoNotUse, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::RecordType_FieldsEntry_DoNotUse, _impl_.key_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::RecordType_FieldsEntry_DoNotUse, _impl_.value_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::RecordType, _impl_._has_bits_), + 6, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::RecordType, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::RecordType, _impl_.writers_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::RecordType, _impl_.fields_), + 0, + 1, + 2, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Field, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Field, _impl_.kind_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Field, _impl_.max_bytes_), + 0, + 1, + 0x004, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Value, _impl_._oneof_case_[0]), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Value, _impl_.value_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Value, _impl_.value_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Value, _impl_.value_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Value, _impl_.value_), + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Tags, _impl_._has_bits_), + 4, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Tags, _impl_.members_), + 0, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Record_FieldsEntry_DoNotUse, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Record_FieldsEntry_DoNotUse, _impl_.key_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Record_FieldsEntry_DoNotUse, _impl_.value_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Record, _impl_._has_bits_), + 4, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Record, _impl_.fields_), + 0, + 0x085, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_._oneof_case_[0]), + 12, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_.field_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_.op_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_.op_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_.op_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_.op_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_.op_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_.op_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_.op_), + 0, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + ~0u, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetRequest, _impl_._has_bits_), + 6, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetRequest, _impl_.player_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetRequest, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetRequest, _impl_.key_), + 2, + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetReply, _impl_._has_bits_), + 4, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetReply, _impl_.record_), + 0, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetManyRequest, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetManyRequest, _impl_.players_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetManyRequest, _impl_.type_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetManyReply, _impl_._has_bits_), + 4, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::GetManyReply, _impl_.records_), + 0, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::PlayerRecord, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::PlayerRecord, _impl_.player_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::PlayerRecord, _impl_.record_), + 1, + 0, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::UpdateRequest, _impl_._has_bits_), + 8, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::UpdateRequest, _impl_.player_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::UpdateRequest, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::UpdateRequest, _impl_.key_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::UpdateRequest, _impl_.ops_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::UpdateRequest, _impl_.update_key_), + 4, + 1, + 2, + 0, + 3, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::UpdateReply, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::UpdateReply, _impl_.record_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::UpdateReply, _impl_.repeated_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::StoredRecord_KindsEntry_DoNotUse, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::StoredRecord_KindsEntry_DoNotUse, _impl_.key_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::StoredRecord_KindsEntry_DoNotUse, _impl_.value_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::StoredRecord, _impl_._has_bits_), + 7, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::StoredRecord, _impl_.record_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::StoredRecord, _impl_.recent_keys_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::StoredRecord, _impl_.version_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::StoredRecord, _impl_.kinds_), + 1, + 0, + 2, + 3, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::PlayerFile_RecordsEntry_DoNotUse, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::PlayerFile_RecordsEntry_DoNotUse, _impl_.key_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::PlayerFile_RecordsEntry_DoNotUse, _impl_.value_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::PlayerFile, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::PlayerFile, _impl_.steam_id_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::PlayerFile, _impl_.records_), + 0, + 1, +}; + +static const ::_pbi::MigrationSchema + schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + {0, sizeof(::modlock::wasm::persist::RecordType_FieldsEntry_DoNotUse)}, + {7, sizeof(::modlock::wasm::persist::RecordType)}, + {16, sizeof(::modlock::wasm::persist::Field)}, + {23, sizeof(::modlock::wasm::persist::Value)}, + {29, sizeof(::modlock::wasm::persist::Tags)}, + {34, sizeof(::modlock::wasm::persist::Record_FieldsEntry_DoNotUse)}, + {41, sizeof(::modlock::wasm::persist::Record)}, + {46, sizeof(::modlock::wasm::persist::Op)}, + {65, sizeof(::modlock::wasm::persist::GetRequest)}, + {74, sizeof(::modlock::wasm::persist::GetReply)}, + {79, sizeof(::modlock::wasm::persist::GetManyRequest)}, + {86, sizeof(::modlock::wasm::persist::GetManyReply)}, + {91, sizeof(::modlock::wasm::persist::PlayerRecord)}, + {98, sizeof(::modlock::wasm::persist::UpdateRequest)}, + {111, sizeof(::modlock::wasm::persist::UpdateReply)}, + {118, sizeof(::modlock::wasm::persist::StoredRecord_KindsEntry_DoNotUse)}, + {125, sizeof(::modlock::wasm::persist::StoredRecord)}, + {136, sizeof(::modlock::wasm::persist::PlayerFile_RecordsEntry_DoNotUse)}, + {143, sizeof(::modlock::wasm::persist::PlayerFile)}, +}; +static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { + &::modlock::wasm::persist::_RecordType_FieldsEntry_DoNotUse_default_instance_._instance, + &::modlock::wasm::persist::_RecordType_default_instance_._instance, + &::modlock::wasm::persist::_Field_default_instance_._instance, + &::modlock::wasm::persist::_Value_default_instance_._instance, + &::modlock::wasm::persist::_Tags_default_instance_._instance, + &::modlock::wasm::persist::_Record_FieldsEntry_DoNotUse_default_instance_._instance, + &::modlock::wasm::persist::_Record_default_instance_._instance, + &::modlock::wasm::persist::_Op_default_instance_._instance, + &::modlock::wasm::persist::_GetRequest_default_instance_._instance, + &::modlock::wasm::persist::_GetReply_default_instance_._instance, + &::modlock::wasm::persist::_GetManyRequest_default_instance_._instance, + &::modlock::wasm::persist::_GetManyReply_default_instance_._instance, + &::modlock::wasm::persist::_PlayerRecord_default_instance_._instance, + &::modlock::wasm::persist::_UpdateRequest_default_instance_._instance, + &::modlock::wasm::persist::_UpdateReply_default_instance_._instance, + &::modlock::wasm::persist::_StoredRecord_KindsEntry_DoNotUse_default_instance_._instance, + &::modlock::wasm::persist::_StoredRecord_default_instance_._instance, + &::modlock::wasm::persist::_PlayerFile_RecordsEntry_DoNotUse_default_instance_._instance, + &::modlock::wasm::persist::_PlayerFile_default_instance_._instance, +}; +const char descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( + protodesc_cold) = { + "\n9github.com/paralin/modlock/src/wasm/pe" + "rsist/persist.proto\022\024modlock.wasm.persis" + "t\"\324\001\n\nRecordType\022\014\n\004name\030\001 \001(\t\022.\n\007writer" + "s\030\002 \001(\0162\035.modlock.wasm.persist.Writers\022<" + "\n\006fields\030\003 \003(\0132,.modlock.wasm.persist.Re" + "cordType.FieldsEntry\032J\n\013FieldsEntry\022\013\n\003k" + "ey\030\001 \001(\t\022*\n\005value\030\002 \001(\0132\033.modlock.wasm.p" + "ersist.Field:\0028\001\"\263\001\n\005Field\022.\n\004kind\030\001 \001(\016" + "2 .modlock.wasm.persist.Field.Kind\022\021\n\tma" + "x_bytes\030\002 \001(\r\"g\n\004Kind\022\020\n\014KIND_UNKNOWN\020\000\022" + "\016\n\nKIND_COUNT\020\001\022\017\n\013KIND_NUMBER\020\002\022\014\n\010KIND" + "_MAX\020\003\022\017\n\013KIND_STRING\020\004\022\r\n\tKIND_TAGS\020\005\"^" + "\n\005Value\022\020\n\006number\030\001 \001(\001H\000\022\016\n\004text\030\002 \001(\tH" + "\000\022*\n\004tags\030\003 \001(\0132\032.modlock.wasm.persist.T" + "agsH\000B\007\n\005value\"\027\n\004Tags\022\017\n\007members\030\001 \003(\t\"" + "\216\001\n\006Record\0228\n\006fields\030\001 \003(\0132(.modlock.was" + "m.persist.Record.FieldsEntry\032J\n\013FieldsEn" + "try\022\013\n\003key\030\001 \001(\t\022*\n\005value\030\002 \001(\0132\033.modloc" + "k.wasm.persist.Value:\0028\001\"\226\001\n\002Op\022\r\n\005field" + "\030\001 \001(\t\022\r\n\003add\030\002 \001(\001H\000\022\r\n\003max\030\003 \001(\001H\000\022\r\n\003" + "min\030\004 \001(\001H\000\022*\n\003set\030\005 \001(\0132\033.modlock.wasm." + "persist.ValueH\000\022\020\n\006insert\030\006 \001(\tH\000\022\020\n\006rem" + "ove\030\007 \001(\tH\000B\004\n\002op\"7\n\nGetRequest\022\016\n\006playe" + "r\030\001 \001(\005\022\014\n\004type\030\002 \001(\t\022\013\n\003key\030\003 \001(\t\"8\n\010Ge" + "tReply\022,\n\006record\030\001 \001(\0132\034.modlock.wasm.pe" + "rsist.Record\"/\n\016GetManyRequest\022\017\n\007player" + "s\030\001 \003(\005\022\014\n\004type\030\002 \001(\t\"C\n\014GetManyReply\0223\n" + "\007records\030\001 \003(\0132\".modlock.wasm.persist.Pl" + "ayerRecord\"L\n\014PlayerRecord\022\016\n\006player\030\001 \001" + "(\005\022,\n\006record\030\002 \001(\0132\034.modlock.wasm.persis" + "t.Record\"u\n\rUpdateRequest\022\016\n\006player\030\001 \001(" + "\005\022\014\n\004type\030\002 \001(\t\022\013\n\003key\030\003 \001(\t\022%\n\003ops\030\004 \003(" + "\0132\030.modlock.wasm.persist.Op\022\022\n\nupdate_ke" + "y\030\005 \001(\t\"M\n\013UpdateReply\022,\n\006record\030\001 \001(\0132\034" + ".modlock.wasm.persist.Record\022\020\n\010repeated" + "\030\002 \001(\010\"\360\001\n\014StoredRecord\022,\n\006record\030\001 \001(\0132" + "\034.modlock.wasm.persist.Record\022\023\n\013recent_" + "keys\030\002 \003(\t\022\017\n\007version\030\003 \001(\004\022<\n\005kinds\030\004 \003" + "(\0132-.modlock.wasm.persist.StoredRecord.K" + "indsEntry\032N\n\nKindsEntry\022\013\n\003key\030\001 \001(\t\022/\n\005" + "value\030\002 \001(\0162 .modlock.wasm.persist.Field" + ".Kind:\0028\001\"\262\001\n\nPlayerFile\022\020\n\010steam_id\030\001 \001" + "(\004\022>\n\007records\030\002 \003(\0132-.modlock.wasm.persi" + "st.PlayerFile.RecordsEntry\032R\n\014RecordsEnt" + "ry\022\013\n\003key\030\001 \001(\t\0221\n\005value\030\002 \001(\0132\".modlock" + ".wasm.persist.StoredRecord:\0028\001*H\n\007Writer" + "s\022\023\n\017WRITERS_UNKNOWN\020\000\022\023\n\017WRITERS_SERVER" + "S\020\001\022\023\n\017WRITERS_PLAYERS\020\002B5Z3github.com/p" + "aralin/modlock/src/wasm/persist;persistb" + "\006proto3" +}; +static ::absl::once_flag descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto_once; +PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto = { + false, + false, + 1967, + descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + "github.com/paralin/modlock/src/wasm/persist/persist.proto", + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto_once, + nullptr, + 0, + 19, + schemas, + file_default_instances, + TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto::offsets, + file_level_enum_descriptors_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + file_level_service_descriptors_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, +}; +namespace modlock { +namespace wasm { +namespace persist { +const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL Field_Kind_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto); + return file_level_enum_descriptors_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto[0]; +} +PROTOBUF_CONSTINIT const uint32_t Field_Kind_internal_data_[] = { + 393216u, 0u, }; +const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL Writers_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto); + return file_level_enum_descriptors_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto[1]; +} +PROTOBUF_CONSTINIT const uint32_t Writers_internal_data_[] = { + 196608u, 0u, }; +// =================================================================== + +#if defined(PROTOBUF_CUSTOM_VTABLE) +RecordType_FieldsEntry_DoNotUse::RecordType_FieldsEntry_DoNotUse() + : SuperType(RecordType_FieldsEntry_DoNotUse_class_data_.base()) {} +RecordType_FieldsEntry_DoNotUse::RecordType_FieldsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : SuperType(arena, RecordType_FieldsEntry_DoNotUse_class_data_.base()) {} +#else // PROTOBUF_CUSTOM_VTABLE +RecordType_FieldsEntry_DoNotUse::RecordType_FieldsEntry_DoNotUse() : SuperType() {} +RecordType_FieldsEntry_DoNotUse::RecordType_FieldsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) : SuperType(arena) {} +#endif // PROTOBUF_CUSTOM_VTABLE +inline void* PROTOBUF_NONNULL RecordType_FieldsEntry_DoNotUse::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) RecordType_FieldsEntry_DoNotUse(arena); +} +constexpr auto RecordType_FieldsEntry_DoNotUse::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(RecordType_FieldsEntry_DoNotUse), + alignof(RecordType_FieldsEntry_DoNotUse)); +} +constexpr auto RecordType_FieldsEntry_DoNotUse::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_RecordType_FieldsEntry_DoNotUse_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &RecordType_FieldsEntry_DoNotUse::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &RecordType_FieldsEntry_DoNotUse::SharedDtor, + static_cast(&RecordType_FieldsEntry_DoNotUse::ClearImpl), + ::google::protobuf::Message::ByteSizeLongImpl, ::google::protobuf::Message::_InternalSerializeImpl + , +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(RecordType_FieldsEntry_DoNotUse, _impl_._cached_size_), + false, + }, + &RecordType_FieldsEntry_DoNotUse::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull RecordType_FieldsEntry_DoNotUse_class_data_ = + RecordType_FieldsEntry_DoNotUse::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +RecordType_FieldsEntry_DoNotUse::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&RecordType_FieldsEntry_DoNotUse_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(RecordType_FieldsEntry_DoNotUse_class_data_.tc_table); + return RecordType_FieldsEntry_DoNotUse_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 1, 55, 2> +RecordType_FieldsEntry_DoNotUse::_table_ = { + { + PROTOBUF_FIELD_OFFSET(RecordType_FieldsEntry_DoNotUse, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + RecordType_FieldsEntry_DoNotUse_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::DiscardEverythingFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::RecordType_FieldsEntry_DoNotUse>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .modlock.wasm.persist.Field value = 2; + {::_pbi::TcParser::FastMtS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(RecordType_FieldsEntry_DoNotUse, _impl_.value_)}}, + // string key = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(RecordType_FieldsEntry_DoNotUse, _impl_.key_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string key = 1; + {PROTOBUF_FIELD_OFFSET(RecordType_FieldsEntry_DoNotUse, _impl_.key_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .modlock.wasm.persist.Field value = 2; + {PROTOBUF_FIELD_OFFSET(RecordType_FieldsEntry_DoNotUse, _impl_.value_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Field>()}, + }}, + {{ + "\53\3\0\0\0\0\0\0" + "modlock.wasm.persist.RecordType.FieldsEntry" + "key" + }}, +}; +// =================================================================== + +class RecordType::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(RecordType, _impl_._has_bits_); +}; + +RecordType::RecordType(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, RecordType_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.RecordType) +} +PROTOBUF_NDEBUG_INLINE RecordType::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::RecordType& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + name_(arena, from.name_), + fields_{visibility, arena, from.fields_} {} + +RecordType::RecordType( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const RecordType& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, RecordType_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + RecordType* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.writers_ = from._impl_.writers_; + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.RecordType) +} +PROTOBUF_NDEBUG_INLINE RecordType::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + name_(arena), + fields_{visibility, arena} {} + +inline void RecordType::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.writers_ = {}; +} +RecordType::~RecordType() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.RecordType) + SharedDtor(*this); +} +inline void RecordType::SharedDtor(MessageLite& self) { + RecordType& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.name_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL RecordType::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) RecordType(arena); +} +constexpr auto RecordType::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(RecordType, _impl_.fields_) + + decltype(RecordType::_impl_.fields_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::CopyInit( + sizeof(RecordType), alignof(RecordType), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&RecordType::PlacementNew_, + sizeof(RecordType), + alignof(RecordType)); + } +} +constexpr auto RecordType::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_RecordType_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &RecordType::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &RecordType::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &RecordType::ByteSizeLong, + &RecordType::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(RecordType, _impl_._cached_size_), + false, + }, + &RecordType::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull RecordType_class_data_ = + RecordType::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +RecordType::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&RecordType_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(RecordType_class_data_.tc_table); + return RecordType_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 3, 2, 50, 2> +RecordType::_table_ = { + { + PROTOBUF_FIELD_OFFSET(RecordType, _impl_._has_bits_), + 0, // no _extensions_ + 3, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967288, // skipmap + offsetof(decltype(_table_), field_entries), + 3, // num_field_entries + 2, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + RecordType_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::RecordType>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .modlock.wasm.persist.Writers writers = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(RecordType, _impl_.writers_), 1>(), + {16, 1, 0, + PROTOBUF_FIELD_OFFSET(RecordType, _impl_.writers_)}}, + // string name = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(RecordType, _impl_.name_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string name = 1; + {PROTOBUF_FIELD_OFFSET(RecordType, _impl_.name_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .modlock.wasm.persist.Writers writers = 2; + {PROTOBUF_FIELD_OFFSET(RecordType, _impl_.writers_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // map fields = 3; + {PROTOBUF_FIELD_OFFSET(RecordType, _impl_.fields_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, + }}, + {{ + {::_pbi::TcParser::GetMapAuxInfo( + 1, 0, 9, 11, 0)}, + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Field>()}, + }}, + {{ + "\37\4\0\6\0\0\0\0" + "modlock.wasm.persist.RecordType" + "name" + "fields" + }}, +}; +PROTOBUF_NOINLINE void RecordType::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.RecordType) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.name_.ClearNonDefaultToEmpty(); + } + if (BatchCheckHasBit(cached_has_bits, 0x00000006U)) { + _impl_.writers_ = 0; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000004U)) { + _impl_.fields_.Clear(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL RecordType::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const RecordType& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL RecordType::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const RecordType& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.RecordType) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string name = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_name().empty()) { + const ::std::string& _s = this_._internal_name(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.RecordType.name"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // .modlock.wasm.persist.Writers writers = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_writers() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this_._internal_writers(), target); + } + } + + // map fields = 3; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000004U)) { + if (!this_._internal_fields().empty()) { + using MapType = ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field>; + using WireHelper = _pbi::MapEntryFuncs<::std::string, ::modlock::wasm::persist::Field, + _pbi::WireFormatLite::TYPE_STRING, + _pbi::WireFormatLite::TYPE_MESSAGE>; + const auto& field = this_._internal_fields(); + + if (stream->IsSerializationDeterministic() && field.size() > 1) { + for (const auto& entry : ::google::protobuf::internal::MapSorterPtr(field)) { + target = WireHelper::InternalSerialize( + 3, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.RecordType.fields"); + } + } else { + for (const auto& entry : field) { + target = WireHelper::InternalSerialize( + 3, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.RecordType.fields"); + } + } + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.RecordType) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t RecordType::ByteSizeLong(const MessageLite& base) { + const RecordType& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t RecordType::ByteSizeLong() const { + const RecordType& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.RecordType) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + // string name = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_name().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_name()); + } + } + // .modlock.wasm.persist.Writers writers = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_writers() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_writers()); + } + } + // map fields = 3; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000004U)) { + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this_._internal_fields_size()); + for (const auto& entry : this_._internal_fields()) { + total_size += _pbi::MapEntryFuncs<::std::string, ::modlock::wasm::persist::Field, + _pbi::WireFormatLite::TYPE_STRING, + _pbi::WireFormatLite::TYPE_MESSAGE>::ByteSizeLong(entry.first, entry.second); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void RecordType::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.RecordType) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_name().empty()) { + _this->_internal_set_name(from._internal_name()); + } else { + if (_this->_impl_.name_.IsDefault()) { + _this->_internal_set_name(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (from._internal_writers() != 0) { + _this->_impl_.writers_ = from._impl_.writers_; + } + } + if (CheckHasBitForRepeated(cached_has_bits, 0x00000004U)) { + _this->_impl_.fields_.MergeFrom(from._impl_.fields_); + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void RecordType::CopyFrom(const RecordType& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.RecordType) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void RecordType::InternalSwap(RecordType* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.name_, &other->_impl_.name_, arena); + swap(_impl_.writers_, other->_impl_.writers_); + _impl_.fields_.InternalSwap(&other->_impl_.fields_); +} + +::google::protobuf::Metadata RecordType::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class Field::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Field, _impl_._has_bits_); +}; + +Field::Field(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Field_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.Field) +} +Field::Field( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Field& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Field_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(from._impl_) { + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} +PROTOBUF_NDEBUG_INLINE Field::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0} {} + +inline void Field::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, kind_), + 0, + offsetof(Impl_, max_bytes_) - + offsetof(Impl_, kind_) + + sizeof(Impl_::max_bytes_)); +} +Field::~Field() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.Field) + SharedDtor(*this); +} +inline void Field::SharedDtor(MessageLite& self) { + Field& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL Field::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Field(arena); +} +constexpr auto Field::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(Field), + alignof(Field)); +} +constexpr auto Field::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Field_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Field::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Field::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Field::ByteSizeLong, + &Field::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Field, _impl_._cached_size_), + false, + }, + &Field::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Field_class_data_ = + Field::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Field::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Field_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Field_class_data_.tc_table); + return Field_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 0, 0, 2> +Field::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Field, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + Field_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::Field>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // uint32 max_bytes = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Field, _impl_.max_bytes_), 1>(), + {16, 1, 0, + PROTOBUF_FIELD_OFFSET(Field, _impl_.max_bytes_)}}, + // .modlock.wasm.persist.Field.Kind kind = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Field, _impl_.kind_), 0>(), + {8, 0, 0, + PROTOBUF_FIELD_OFFSET(Field, _impl_.kind_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // .modlock.wasm.persist.Field.Kind kind = 1; + {PROTOBUF_FIELD_OFFSET(Field, _impl_.kind_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // uint32 max_bytes = 2; + {PROTOBUF_FIELD_OFFSET(Field, _impl_.max_bytes_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + }}, + // no aux_entries + {{ + }}, +}; +PROTOBUF_NOINLINE void Field::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.Field) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + ::memset(&_impl_.kind_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.max_bytes_) - + reinterpret_cast(&_impl_.kind_)) + sizeof(_impl_.max_bytes_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Field::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Field& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Field::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Field& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.Field) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // .modlock.wasm.persist.Field.Kind kind = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (this_._internal_kind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this_._internal_kind(), target); + } + } + + // uint32 max_bytes = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_max_bytes() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 2, this_._internal_max_bytes(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.Field) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Field::ByteSizeLong(const MessageLite& base) { + const Field& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Field::ByteSizeLong() const { + const Field& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.Field) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + // .modlock.wasm.persist.Field.Kind kind = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (this_._internal_kind() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_kind()); + } + } + // uint32 max_bytes = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_max_bytes() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this_._internal_max_bytes()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Field::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.Field) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (from._internal_kind() != 0) { + _this->_impl_.kind_ = from._impl_.kind_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (from._internal_max_bytes() != 0) { + _this->_impl_.max_bytes_ = from._impl_.max_bytes_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Field::CopyFrom(const Field& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.Field) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Field::InternalSwap(Field* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(Field, _impl_.max_bytes_) + + sizeof(Field::_impl_.max_bytes_) + - PROTOBUF_FIELD_OFFSET(Field, _impl_.kind_)>( + reinterpret_cast(&_impl_.kind_), + reinterpret_cast(&other->_impl_.kind_)); +} + +::google::protobuf::Metadata Field::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class Value::_Internal { + public: + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Value, _impl_._oneof_case_); +}; + +void Value::set_allocated_tags(::modlock::wasm::persist::Tags* PROTOBUF_NULLABLE tags) { + ::google::protobuf::Arena* message_arena = GetArena(); + clear_value(); + if (tags) { + ::google::protobuf::Arena* submessage_arena = tags->GetArena(); + if (message_arena != submessage_arena) { + tags = ::google::protobuf::internal::GetOwnedMessage(message_arena, tags, submessage_arena); + } + set_has_tags(); + _impl_.value_.tags_ = tags; + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.Value.tags) +} +Value::Value(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Value_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.Value) +} +PROTOBUF_NDEBUG_INLINE Value::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::Value& from_msg) + : value_{}, + _cached_size_{0}, + _oneof_case_{from._oneof_case_[0]} {} + +Value::Value( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Value& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Value_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Value* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + switch (value_case()) { + case VALUE_NOT_SET: + break; + case kNumber: + _impl_.value_.number_ = from._impl_.value_.number_; + break; + case kText: + new (&_impl_.value_.text_) decltype(_impl_.value_.text_){arena, from._impl_.value_.text_}; + break; + case kTags: + _impl_.value_.tags_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.value_.tags_); + break; + } + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.Value) +} +PROTOBUF_NDEBUG_INLINE Value::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : value_{}, + _cached_size_{0}, + _oneof_case_{} {} + +inline void Value::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +Value::~Value() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.Value) + SharedDtor(*this); +} +inline void Value::SharedDtor(MessageLite& self) { + Value& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + if (this_.has_value()) { + this_.clear_value(); + } + this_._impl_.~Impl_(); +} + +void Value::clear_value() { +// @@protoc_insertion_point(one_of_clear_start:modlock.wasm.persist.Value) + ::google::protobuf::internal::TSanWrite(&_impl_); + switch (value_case()) { + case kNumber: { + // No need to clear + break; + } + case kText: { + _impl_.value_.text_.Destroy(); + break; + } + case kTags: { + if (GetArena() == nullptr) { + delete _impl_.value_.tags_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.value_.tags_); + } + break; + } + case VALUE_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = VALUE_NOT_SET; +} + + +inline void* PROTOBUF_NONNULL Value::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Value(arena); +} +constexpr auto Value::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(Value), + alignof(Value)); +} +constexpr auto Value::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Value_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Value::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Value::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Value::ByteSizeLong, + &Value::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Value, _impl_._cached_size_), + false, + }, + &Value::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Value_class_data_ = + Value::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Value::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Value_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Value_class_data_.tc_table); + return Value_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 3, 1, 39, 2> +Value::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 3, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967288, // skipmap + offsetof(decltype(_table_), field_entries), + 3, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + Value_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::Value>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // double number = 1; + {PROTOBUF_FIELD_OFFSET(Value, _impl_.value_.number_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kDouble)}, + // string text = 2; + {PROTOBUF_FIELD_OFFSET(Value, _impl_.value_.text_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .modlock.wasm.persist.Tags tags = 3; + {PROTOBUF_FIELD_OFFSET(Value, _impl_.value_.tags_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Tags>()}, + }}, + {{ + "\32\0\4\0\0\0\0\0" + "modlock.wasm.persist.Value" + "text" + }}, +}; +PROTOBUF_NOINLINE void Value::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.Value) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_value(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Value::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Value& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Value::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Value& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.Value) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + switch (this_.value_case()) { + case kNumber: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray( + 1, this_._internal_number(), target); + break; + } + case kText: { + const ::std::string& _s = this_._internal_text(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.Value.text"); + target = stream->WriteStringMaybeAliased(2, _s, target); + break; + } + case kTags: { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 3, *this_._impl_.value_.tags_, this_._impl_.value_.tags_->GetCachedSize(), target, + stream); + break; + } + default: + break; + } + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.Value) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Value::ByteSizeLong(const MessageLite& base) { + const Value& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Value::ByteSizeLong() const { + const Value& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.Value) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + switch (this_.value_case()) { + // double number = 1; + case kNumber: { + total_size += 9; + break; + } + // string text = 2; + case kText: { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_text()); + break; + } + // .modlock.wasm.persist.Tags tags = 3; + case kTags: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.value_.tags_); + break; + } + case VALUE_NOT_SET: { + break; + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Value::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.Value) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + if (const uint32_t oneof_from_case = + from._impl_._oneof_case_[0]) { + const uint32_t oneof_to_case = _this->_impl_._oneof_case_[0]; + const bool oneof_needs_init = oneof_to_case != oneof_from_case; + if (oneof_needs_init) { + if (oneof_to_case != 0) { + _this->clear_value(); + } + _this->_impl_._oneof_case_[0] = oneof_from_case; + } + + switch (oneof_from_case) { + case kNumber: { + _this->_impl_.value_.number_ = from._impl_.value_.number_; + break; + } + case kText: { + if (oneof_needs_init) { + _this->_impl_.value_.text_.InitDefault(); + } + _this->_impl_.value_.text_.Set(from._internal_text(), arena); + break; + } + case kTags: { + if (oneof_needs_init) { + _this->_impl_.value_.tags_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.value_.tags_); + } else { + _this->_impl_.value_.tags_->MergeFrom(*from._impl_.value_.tags_); + } + break; + } + case VALUE_NOT_SET: + break; + } + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Value::CopyFrom(const Value& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.Value) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Value::InternalSwap(Value* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.value_, other->_impl_.value_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::google::protobuf::Metadata Value::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class Tags::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Tags, _impl_._has_bits_); +}; + +Tags::Tags(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Tags_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.Tags) +} +PROTOBUF_NDEBUG_INLINE Tags::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::Tags& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + members_{visibility, arena, from.members_} {} + +Tags::Tags( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Tags& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Tags_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Tags* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.Tags) +} +PROTOBUF_NDEBUG_INLINE Tags::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + members_{visibility, arena} {} + +inline void Tags::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +Tags::~Tags() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.Tags) + SharedDtor(*this); +} +inline void Tags::SharedDtor(MessageLite& self) { + Tags& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL Tags::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Tags(arena); +} +constexpr auto Tags::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(Tags, _impl_.members_) + + decltype(Tags::_impl_.members_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::ZeroInit( + sizeof(Tags), alignof(Tags), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&Tags::PlacementNew_, + sizeof(Tags), + alignof(Tags)); + } +} +constexpr auto Tags::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Tags_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Tags::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Tags::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Tags::ByteSizeLong, + &Tags::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Tags, _impl_._cached_size_), + false, + }, + &Tags::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Tags_class_data_ = + Tags::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Tags::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Tags_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Tags_class_data_.tc_table); + return Tags_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 1, 0, 41, 2> +Tags::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Tags, _impl_._has_bits_), + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967294, // skipmap + offsetof(decltype(_table_), field_entries), + 1, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + Tags_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::Tags>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // repeated string members = 1; + {::_pbi::TcParser::FastUR1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(Tags, _impl_.members_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // repeated string members = 1; + {PROTOBUF_FIELD_OFFSET(Tags, _impl_.members_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kUtf8String | ::_fl::kRepSString)}, + }}, + // no aux_entries + {{ + "\31\7\0\0\0\0\0\0" + "modlock.wasm.persist.Tags" + "members" + }}, +}; +PROTOBUF_NOINLINE void Tags::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.Tags) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _impl_.members_.Clear(); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Tags::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Tags& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Tags::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Tags& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.Tags) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // repeated string members = 1; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + for (int i = 0, n = this_._internal_members_size(); i < n; ++i) { + const auto& s = this_._internal_members().Get(i); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + s.data(), static_cast(s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.Tags.members"); + target = stream->WriteString(1, s, target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.Tags) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Tags::ByteSizeLong(const MessageLite& base) { + const Tags& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Tags::ByteSizeLong() const { + const Tags& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.Tags) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + { + // repeated string members = 1; + cached_has_bits = this_._impl_._has_bits_[0]; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this_._internal_members().size()); + for (int i = 0, n = this_._internal_members().size(); i < n; ++i) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_members().Get(i)); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Tags::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.Tags) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _this->_internal_mutable_members()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_members()); + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Tags::CopyFrom(const Tags& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.Tags) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Tags::InternalSwap(Tags* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.members_.InternalSwap(&other->_impl_.members_); +} + +::google::protobuf::Metadata Tags::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +#if defined(PROTOBUF_CUSTOM_VTABLE) +Record_FieldsEntry_DoNotUse::Record_FieldsEntry_DoNotUse() + : SuperType(Record_FieldsEntry_DoNotUse_class_data_.base()) {} +Record_FieldsEntry_DoNotUse::Record_FieldsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : SuperType(arena, Record_FieldsEntry_DoNotUse_class_data_.base()) {} +#else // PROTOBUF_CUSTOM_VTABLE +Record_FieldsEntry_DoNotUse::Record_FieldsEntry_DoNotUse() : SuperType() {} +Record_FieldsEntry_DoNotUse::Record_FieldsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) : SuperType(arena) {} +#endif // PROTOBUF_CUSTOM_VTABLE +inline void* PROTOBUF_NONNULL Record_FieldsEntry_DoNotUse::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Record_FieldsEntry_DoNotUse(arena); +} +constexpr auto Record_FieldsEntry_DoNotUse::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(Record_FieldsEntry_DoNotUse), + alignof(Record_FieldsEntry_DoNotUse)); +} +constexpr auto Record_FieldsEntry_DoNotUse::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Record_FieldsEntry_DoNotUse_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Record_FieldsEntry_DoNotUse::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Record_FieldsEntry_DoNotUse::SharedDtor, + static_cast(&Record_FieldsEntry_DoNotUse::ClearImpl), + ::google::protobuf::Message::ByteSizeLongImpl, ::google::protobuf::Message::_InternalSerializeImpl + , +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Record_FieldsEntry_DoNotUse, _impl_._cached_size_), + false, + }, + &Record_FieldsEntry_DoNotUse::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Record_FieldsEntry_DoNotUse_class_data_ = + Record_FieldsEntry_DoNotUse::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Record_FieldsEntry_DoNotUse::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Record_FieldsEntry_DoNotUse_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Record_FieldsEntry_DoNotUse_class_data_.tc_table); + return Record_FieldsEntry_DoNotUse_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 1, 51, 2> +Record_FieldsEntry_DoNotUse::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Record_FieldsEntry_DoNotUse, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + Record_FieldsEntry_DoNotUse_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::DiscardEverythingFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::Record_FieldsEntry_DoNotUse>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .modlock.wasm.persist.Value value = 2; + {::_pbi::TcParser::FastMtS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(Record_FieldsEntry_DoNotUse, _impl_.value_)}}, + // string key = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(Record_FieldsEntry_DoNotUse, _impl_.key_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string key = 1; + {PROTOBUF_FIELD_OFFSET(Record_FieldsEntry_DoNotUse, _impl_.key_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .modlock.wasm.persist.Value value = 2; + {PROTOBUF_FIELD_OFFSET(Record_FieldsEntry_DoNotUse, _impl_.value_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Value>()}, + }}, + {{ + "\47\3\0\0\0\0\0\0" + "modlock.wasm.persist.Record.FieldsEntry" + "key" + }}, +}; +// =================================================================== + +class Record::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Record, _impl_._has_bits_); +}; + +Record::Record(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Record_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.Record) +} +PROTOBUF_NDEBUG_INLINE Record::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::Record& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + fields_{visibility, arena, from.fields_} {} + +Record::Record( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Record& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Record_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Record* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.Record) +} +PROTOBUF_NDEBUG_INLINE Record::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + fields_{visibility, arena} {} + +inline void Record::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +Record::~Record() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.Record) + SharedDtor(*this); +} +inline void Record::SharedDtor(MessageLite& self) { + Record& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL Record::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Record(arena); +} +constexpr auto Record::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(Record, _impl_.fields_) + + decltype(Record::_impl_.fields_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::CopyInit( + sizeof(Record), alignof(Record), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&Record::PlacementNew_, + sizeof(Record), + alignof(Record)); + } +} +constexpr auto Record::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Record_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Record::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Record::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Record::ByteSizeLong, + &Record::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Record, _impl_._cached_size_), + false, + }, + &Record::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Record_class_data_ = + Record::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Record::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Record_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Record_class_data_.tc_table); + return Record_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 1, 2, 42, 2> +Record::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Record, _impl_._has_bits_), + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967294, // skipmap + offsetof(decltype(_table_), field_entries), + 1, // num_field_entries + 2, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + Record_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::Record>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // map fields = 1; + {PROTOBUF_FIELD_OFFSET(Record, _impl_.fields_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, + }}, + {{ + {::_pbi::TcParser::GetMapAuxInfo( + 1, 0, 9, 11, 0)}, + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Value>()}, + }}, + {{ + "\33\6\0\0\0\0\0\0" + "modlock.wasm.persist.Record" + "fields" + }}, +}; +PROTOBUF_NOINLINE void Record::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.Record) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _impl_.fields_.Clear(); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Record::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Record& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Record::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Record& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.Record) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // map fields = 1; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + if (!this_._internal_fields().empty()) { + using MapType = ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Value>; + using WireHelper = _pbi::MapEntryFuncs<::std::string, ::modlock::wasm::persist::Value, + _pbi::WireFormatLite::TYPE_STRING, + _pbi::WireFormatLite::TYPE_MESSAGE>; + const auto& field = this_._internal_fields(); + + if (stream->IsSerializationDeterministic() && field.size() > 1) { + for (const auto& entry : ::google::protobuf::internal::MapSorterPtr(field)) { + target = WireHelper::InternalSerialize( + 1, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.Record.fields"); + } + } else { + for (const auto& entry : field) { + target = WireHelper::InternalSerialize( + 1, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.Record.fields"); + } + } + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.Record) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Record::ByteSizeLong(const MessageLite& base) { + const Record& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Record::ByteSizeLong() const { + const Record& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.Record) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + { + // map fields = 1; + cached_has_bits = this_._impl_._has_bits_[0]; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this_._internal_fields_size()); + for (const auto& entry : this_._internal_fields()) { + total_size += _pbi::MapEntryFuncs<::std::string, ::modlock::wasm::persist::Value, + _pbi::WireFormatLite::TYPE_STRING, + _pbi::WireFormatLite::TYPE_MESSAGE>::ByteSizeLong(entry.first, entry.second); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Record::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.Record) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _this->_impl_.fields_.MergeFrom(from._impl_.fields_); + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Record::CopyFrom(const Record& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.Record) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Record::InternalSwap(Record* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.fields_.InternalSwap(&other->_impl_.fields_); +} + +::google::protobuf::Metadata Record::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class Op::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Op, _impl_._has_bits_); + static constexpr ::int32_t kOneofCaseOffset = + PROTOBUF_FIELD_OFFSET(::modlock::wasm::persist::Op, _impl_._oneof_case_); +}; + +void Op::set_allocated_set(::modlock::wasm::persist::Value* PROTOBUF_NULLABLE set) { + ::google::protobuf::Arena* message_arena = GetArena(); + clear_op(); + if (set) { + ::google::protobuf::Arena* submessage_arena = set->GetArena(); + if (message_arena != submessage_arena) { + set = ::google::protobuf::internal::GetOwnedMessage(message_arena, set, submessage_arena); + } + set_has_set(); + _impl_.op_.set_ = set; + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.Op.set) +} +Op::Op(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Op_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.Op) +} +PROTOBUF_NDEBUG_INLINE Op::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::Op& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + field_(arena, from.field_), + op_{}, + _oneof_case_{from._oneof_case_[0]} {} + +Op::Op( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Op& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Op_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Op* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + switch (op_case()) { + case OP_NOT_SET: + break; + case kAdd: + _impl_.op_.add_ = from._impl_.op_.add_; + break; + case kMax: + _impl_.op_.max_ = from._impl_.op_.max_; + break; + case kMin: + _impl_.op_.min_ = from._impl_.op_.min_; + break; + case kSet: + _impl_.op_.set_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.op_.set_); + break; + case kInsert: + new (&_impl_.op_.insert_) decltype(_impl_.op_.insert_){arena, from._impl_.op_.insert_}; + break; + case kRemove: + new (&_impl_.op_.remove_) decltype(_impl_.op_.remove_){arena, from._impl_.op_.remove_}; + break; + } + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.Op) +} +PROTOBUF_NDEBUG_INLINE Op::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + field_(arena), + op_{}, + _oneof_case_{} {} + +inline void Op::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +Op::~Op() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.Op) + SharedDtor(*this); +} +inline void Op::SharedDtor(MessageLite& self) { + Op& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.field_.Destroy(); + if (this_.has_op()) { + this_.clear_op(); + } + this_._impl_.~Impl_(); +} + +void Op::clear_op() { +// @@protoc_insertion_point(one_of_clear_start:modlock.wasm.persist.Op) + ::google::protobuf::internal::TSanWrite(&_impl_); + switch (op_case()) { + case kAdd: { + // No need to clear + break; + } + case kMax: { + // No need to clear + break; + } + case kMin: { + // No need to clear + break; + } + case kSet: { + if (GetArena() == nullptr) { + delete _impl_.op_.set_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.op_.set_); + } + break; + } + case kInsert: { + _impl_.op_.insert_.Destroy(); + break; + } + case kRemove: { + _impl_.op_.remove_.Destroy(); + break; + } + case OP_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = OP_NOT_SET; +} + + +inline void* PROTOBUF_NONNULL Op::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Op(arena); +} +constexpr auto Op::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(Op), + alignof(Op)); +} +constexpr auto Op::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Op_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Op::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Op::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Op::ByteSizeLong, + &Op::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Op, _impl_._cached_size_), + false, + }, + &Op::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Op_class_data_ = + Op::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Op::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Op_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Op_class_data_.tc_table); + return Op_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 7, 1, 49, 2> +Op::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Op, _impl_._has_bits_), + 0, // no _extensions_ + 7, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967168, // skipmap + offsetof(decltype(_table_), field_entries), + 7, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + Op_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::Op>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // string field = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(Op, _impl_.field_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string field = 1; + {PROTOBUF_FIELD_OFFSET(Op, _impl_.field_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // double add = 2; + {PROTOBUF_FIELD_OFFSET(Op, _impl_.op_.add_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kDouble)}, + // double max = 3; + {PROTOBUF_FIELD_OFFSET(Op, _impl_.op_.max_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kDouble)}, + // double min = 4; + {PROTOBUF_FIELD_OFFSET(Op, _impl_.op_.min_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kDouble)}, + // .modlock.wasm.persist.Value set = 5; + {PROTOBUF_FIELD_OFFSET(Op, _impl_.op_.set_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // string insert = 6; + {PROTOBUF_FIELD_OFFSET(Op, _impl_.op_.insert_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string remove = 7; + {PROTOBUF_FIELD_OFFSET(Op, _impl_.op_.remove_), _Internal::kOneofCaseOffset + 0, 0, (0 | ::_fl::kFcOneof | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Value>()}, + }}, + {{ + "\27\5\0\0\0\0\6\6" + "modlock.wasm.persist.Op" + "field" + "insert" + "remove" + }}, +}; +PROTOBUF_NOINLINE void Op::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.Op) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.field_.ClearNonDefaultToEmpty(); + } + clear_op(); + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Op::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Op& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Op::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Op& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.Op) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string field = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_field().empty()) { + const ::std::string& _s = this_._internal_field(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.Op.field"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + switch (this_.op_case()) { + case kAdd: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray( + 2, this_._internal_add(), target); + break; + } + case kMax: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray( + 3, this_._internal_max(), target); + break; + } + case kMin: { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray( + 4, this_._internal_min(), target); + break; + } + case kSet: { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 5, *this_._impl_.op_.set_, this_._impl_.op_.set_->GetCachedSize(), target, + stream); + break; + } + case kInsert: { + const ::std::string& _s = this_._internal_insert(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.Op.insert"); + target = stream->WriteStringMaybeAliased(6, _s, target); + break; + } + case kRemove: { + const ::std::string& _s = this_._internal_remove(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.Op.remove"); + target = stream->WriteStringMaybeAliased(7, _s, target); + break; + } + default: + break; + } + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.Op) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Op::ByteSizeLong(const MessageLite& base) { + const Op& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Op::ByteSizeLong() const { + const Op& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.Op) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + { + // string field = 1; + cached_has_bits = this_._impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_field().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_field()); + } + } + } + switch (this_.op_case()) { + // double add = 2; + case kAdd: { + total_size += 9; + break; + } + // double max = 3; + case kMax: { + total_size += 9; + break; + } + // double min = 4; + case kMin: { + total_size += 9; + break; + } + // .modlock.wasm.persist.Value set = 5; + case kSet: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.op_.set_); + break; + } + // string insert = 6; + case kInsert: { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_insert()); + break; + } + // string remove = 7; + case kRemove: { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_remove()); + break; + } + case OP_NOT_SET: { + break; + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Op::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.Op) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_field().empty()) { + _this->_internal_set_field(from._internal_field()); + } else { + if (_this->_impl_.field_.IsDefault()) { + _this->_internal_set_field(""); + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + if (const uint32_t oneof_from_case = + from._impl_._oneof_case_[0]) { + const uint32_t oneof_to_case = _this->_impl_._oneof_case_[0]; + const bool oneof_needs_init = oneof_to_case != oneof_from_case; + if (oneof_needs_init) { + if (oneof_to_case != 0) { + _this->clear_op(); + } + _this->_impl_._oneof_case_[0] = oneof_from_case; + } + + switch (oneof_from_case) { + case kAdd: { + _this->_impl_.op_.add_ = from._impl_.op_.add_; + break; + } + case kMax: { + _this->_impl_.op_.max_ = from._impl_.op_.max_; + break; + } + case kMin: { + _this->_impl_.op_.min_ = from._impl_.op_.min_; + break; + } + case kSet: { + if (oneof_needs_init) { + _this->_impl_.op_.set_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.op_.set_); + } else { + _this->_impl_.op_.set_->MergeFrom(*from._impl_.op_.set_); + } + break; + } + case kInsert: { + if (oneof_needs_init) { + _this->_impl_.op_.insert_.InitDefault(); + } + _this->_impl_.op_.insert_.Set(from._internal_insert(), arena); + break; + } + case kRemove: { + if (oneof_needs_init) { + _this->_impl_.op_.remove_.InitDefault(); + } + _this->_impl_.op_.remove_.Set(from._internal_remove(), arena); + break; + } + case OP_NOT_SET: + break; + } + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Op::CopyFrom(const Op& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.Op) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Op::InternalSwap(Op* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.field_, &other->_impl_.field_, arena); + swap(_impl_.op_, other->_impl_.op_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::google::protobuf::Metadata Op::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class GetRequest::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(GetRequest, _impl_._has_bits_); +}; + +GetRequest::GetRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, GetRequest_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.GetRequest) +} +PROTOBUF_NDEBUG_INLINE GetRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::GetRequest& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + type_(arena, from.type_), + key_(arena, from.key_) {} + +GetRequest::GetRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const GetRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, GetRequest_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + GetRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.player_ = from._impl_.player_; + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.GetRequest) +} +PROTOBUF_NDEBUG_INLINE GetRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + type_(arena), + key_(arena) {} + +inline void GetRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.player_ = {}; +} +GetRequest::~GetRequest() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.GetRequest) + SharedDtor(*this); +} +inline void GetRequest::SharedDtor(MessageLite& self) { + GetRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.type_.Destroy(); + this_._impl_.key_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL GetRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) GetRequest(arena); +} +constexpr auto GetRequest::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(GetRequest), + alignof(GetRequest)); +} +constexpr auto GetRequest::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_GetRequest_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &GetRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &GetRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &GetRequest::ByteSizeLong, + &GetRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(GetRequest, _impl_._cached_size_), + false, + }, + &GetRequest::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull GetRequest_class_data_ = + GetRequest::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +GetRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&GetRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(GetRequest_class_data_.tc_table); + return GetRequest_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 3, 0, 47, 2> +GetRequest::_table_ = { + { + PROTOBUF_FIELD_OFFSET(GetRequest, _impl_._has_bits_), + 0, // no _extensions_ + 3, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967288, // skipmap + offsetof(decltype(_table_), field_entries), + 3, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + GetRequest_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::GetRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // int32 player = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(GetRequest, _impl_.player_), 2>(), + {8, 2, 0, + PROTOBUF_FIELD_OFFSET(GetRequest, _impl_.player_)}}, + // string type = 2; + {::_pbi::TcParser::FastUS1, + {18, 0, 0, + PROTOBUF_FIELD_OFFSET(GetRequest, _impl_.type_)}}, + // string key = 3; + {::_pbi::TcParser::FastUS1, + {26, 1, 0, + PROTOBUF_FIELD_OFFSET(GetRequest, _impl_.key_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // int32 player = 1; + {PROTOBUF_FIELD_OFFSET(GetRequest, _impl_.player_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // string type = 2; + {PROTOBUF_FIELD_OFFSET(GetRequest, _impl_.type_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string key = 3; + {PROTOBUF_FIELD_OFFSET(GetRequest, _impl_.key_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\37\0\4\3\0\0\0\0" + "modlock.wasm.persist.GetRequest" + "type" + "key" + }}, +}; +PROTOBUF_NOINLINE void GetRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.GetRequest) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.type_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.key_.ClearNonDefaultToEmpty(); + } + } + _impl_.player_ = 0; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL GetRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const GetRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL GetRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const GetRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.GetRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // int32 player = 1; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_player() != 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<1>( + stream, this_._internal_player(), target); + } + } + + // string type = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_type().empty()) { + const ::std::string& _s = this_._internal_type(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.GetRequest.type"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // string key = 3; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_key().empty()) { + const ::std::string& _s = this_._internal_key(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.GetRequest.key"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.GetRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t GetRequest::ByteSizeLong(const MessageLite& base) { + const GetRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t GetRequest::ByteSizeLong() const { + const GetRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.GetRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + // string type = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_type().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_type()); + } + } + // string key = 3; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_key().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_key()); + } + } + // int32 player = 1; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_player() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this_._internal_player()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void GetRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.GetRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_type().empty()) { + _this->_internal_set_type(from._internal_type()); + } else { + if (_this->_impl_.type_.IsDefault()) { + _this->_internal_set_type(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_key().empty()) { + _this->_internal_set_key(from._internal_key()); + } else { + if (_this->_impl_.key_.IsDefault()) { + _this->_internal_set_key(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (from._internal_player() != 0) { + _this->_impl_.player_ = from._impl_.player_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void GetRequest::CopyFrom(const GetRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.GetRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void GetRequest::InternalSwap(GetRequest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.type_, &other->_impl_.type_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.key_, &other->_impl_.key_, arena); + swap(_impl_.player_, other->_impl_.player_); +} + +::google::protobuf::Metadata GetRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class GetReply::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(GetReply, _impl_._has_bits_); +}; + +GetReply::GetReply(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, GetReply_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.GetReply) +} +PROTOBUF_NDEBUG_INLINE GetReply::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::GetReply& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0} {} + +GetReply::GetReply( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const GetReply& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, GetReply_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + GetReply* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.record_ = (CheckHasBit(cached_has_bits, 0x00000001U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.record_) + : nullptr; + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.GetReply) +} +PROTOBUF_NDEBUG_INLINE GetReply::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0} {} + +inline void GetReply::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.record_ = {}; +} +GetReply::~GetReply() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.GetReply) + SharedDtor(*this); +} +inline void GetReply::SharedDtor(MessageLite& self) { + GetReply& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.record_; + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL GetReply::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) GetReply(arena); +} +constexpr auto GetReply::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(GetReply), + alignof(GetReply)); +} +constexpr auto GetReply::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_GetReply_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &GetReply::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &GetReply::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &GetReply::ByteSizeLong, + &GetReply::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(GetReply, _impl_._cached_size_), + false, + }, + &GetReply::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull GetReply_class_data_ = + GetReply::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +GetReply::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&GetReply_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(GetReply_class_data_.tc_table); + return GetReply_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 1, 1, 0, 2> +GetReply::_table_ = { + { + PROTOBUF_FIELD_OFFSET(GetReply, _impl_._has_bits_), + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967294, // skipmap + offsetof(decltype(_table_), field_entries), + 1, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + GetReply_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::GetReply>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .modlock.wasm.persist.Record record = 1; + {::_pbi::TcParser::FastMtS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(GetReply, _impl_.record_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // .modlock.wasm.persist.Record record = 1; + {PROTOBUF_FIELD_OFFSET(GetReply, _impl_.record_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Record>()}, + }}, + {{ + }}, +}; +PROTOBUF_NOINLINE void GetReply::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.GetReply) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + ABSL_DCHECK(_impl_.record_ != nullptr); + _impl_.record_->Clear(); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL GetReply::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const GetReply& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL GetReply::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const GetReply& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.GetReply) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // .modlock.wasm.persist.Record record = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 1, *this_._impl_.record_, this_._impl_.record_->GetCachedSize(), target, + stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.GetReply) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t GetReply::ByteSizeLong(const MessageLite& base) { + const GetReply& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t GetReply::ByteSizeLong() const { + const GetReply& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.GetReply) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + { + // .modlock.wasm.persist.Record record = 1; + cached_has_bits = this_._impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.record_); + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void GetReply::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.GetReply) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + ABSL_DCHECK(from._impl_.record_ != nullptr); + if (_this->_impl_.record_ == nullptr) { + _this->_impl_.record_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.record_); + } else { + _this->_impl_.record_->MergeFrom(*from._impl_.record_); + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void GetReply::CopyFrom(const GetReply& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.GetReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void GetReply::InternalSwap(GetReply* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + swap(_impl_.record_, other->_impl_.record_); +} + +::google::protobuf::Metadata GetReply::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class GetManyRequest::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(GetManyRequest, _impl_._has_bits_); +}; + +GetManyRequest::GetManyRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, GetManyRequest_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.GetManyRequest) +} +PROTOBUF_NDEBUG_INLINE GetManyRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::GetManyRequest& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + players_{visibility, arena, from.players_}, + _players_cached_byte_size_{0}, + type_(arena, from.type_) {} + +GetManyRequest::GetManyRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const GetManyRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, GetManyRequest_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + GetManyRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.GetManyRequest) +} +PROTOBUF_NDEBUG_INLINE GetManyRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + players_{visibility, arena}, + _players_cached_byte_size_{0}, + type_(arena) {} + +inline void GetManyRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +GetManyRequest::~GetManyRequest() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.GetManyRequest) + SharedDtor(*this); +} +inline void GetManyRequest::SharedDtor(MessageLite& self) { + GetManyRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.type_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL GetManyRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) GetManyRequest(arena); +} +constexpr auto GetManyRequest::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(GetManyRequest, _impl_.players_) + + decltype(GetManyRequest::_impl_.players_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::CopyInit( + sizeof(GetManyRequest), alignof(GetManyRequest), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&GetManyRequest::PlacementNew_, + sizeof(GetManyRequest), + alignof(GetManyRequest)); + } +} +constexpr auto GetManyRequest::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_GetManyRequest_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &GetManyRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &GetManyRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &GetManyRequest::ByteSizeLong, + &GetManyRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(GetManyRequest, _impl_._cached_size_), + false, + }, + &GetManyRequest::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull GetManyRequest_class_data_ = + GetManyRequest::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +GetManyRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&GetManyRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(GetManyRequest_class_data_.tc_table); + return GetManyRequest_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 0, 48, 2> +GetManyRequest::_table_ = { + { + PROTOBUF_FIELD_OFFSET(GetManyRequest, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + GetManyRequest_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::GetManyRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // string type = 2; + {::_pbi::TcParser::FastUS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(GetManyRequest, _impl_.type_)}}, + // repeated int32 players = 1; + {::_pbi::TcParser::FastV32P1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(GetManyRequest, _impl_.players_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // repeated int32 players = 1; + {PROTOBUF_FIELD_OFFSET(GetManyRequest, _impl_.players_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)}, + // string type = 2; + {PROTOBUF_FIELD_OFFSET(GetManyRequest, _impl_.type_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\43\0\4\0\0\0\0\0" + "modlock.wasm.persist.GetManyRequest" + "type" + }}, +}; +PROTOBUF_NOINLINE void GetManyRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.GetManyRequest) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _impl_.players_.Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.type_.ClearNonDefaultToEmpty(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL GetManyRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const GetManyRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL GetManyRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const GetManyRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.GetManyRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // repeated int32 players = 1; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + { + int byte_size = this_._impl_._players_cached_byte_size_.Get(); + if (byte_size > 0) { + target = stream->WriteInt32Packed( + 1, this_._internal_players(), byte_size, target); + } + } + } + + // string type = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_type().empty()) { + const ::std::string& _s = this_._internal_type(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.GetManyRequest.type"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.GetManyRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t GetManyRequest::ByteSizeLong(const MessageLite& base) { + const GetManyRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t GetManyRequest::ByteSizeLong() const { + const GetManyRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.GetManyRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + // repeated int32 players = 1; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + total_size += + ::_pbi::WireFormatLite::Int32SizeWithPackedTagSize( + this_._internal_players(), 1, + this_._impl_._players_cached_byte_size_); + } + // string type = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_type().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_type()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void GetManyRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.GetManyRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _this->_internal_mutable_players()->MergeFrom(from._internal_players()); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_type().empty()) { + _this->_internal_set_type(from._internal_type()); + } else { + if (_this->_impl_.type_.IsDefault()) { + _this->_internal_set_type(""); + } + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void GetManyRequest::CopyFrom(const GetManyRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.GetManyRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void GetManyRequest::InternalSwap(GetManyRequest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.players_.InternalSwap(&other->_impl_.players_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.type_, &other->_impl_.type_, arena); +} + +::google::protobuf::Metadata GetManyRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class GetManyReply::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(GetManyReply, _impl_._has_bits_); +}; + +GetManyReply::GetManyReply(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, GetManyReply_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.GetManyReply) +} +PROTOBUF_NDEBUG_INLINE GetManyReply::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::GetManyReply& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + records_{visibility, arena, from.records_} {} + +GetManyReply::GetManyReply( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const GetManyReply& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, GetManyReply_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + GetManyReply* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.GetManyReply) +} +PROTOBUF_NDEBUG_INLINE GetManyReply::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + records_{visibility, arena} {} + +inline void GetManyReply::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +GetManyReply::~GetManyReply() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.GetManyReply) + SharedDtor(*this); +} +inline void GetManyReply::SharedDtor(MessageLite& self) { + GetManyReply& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL GetManyReply::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) GetManyReply(arena); +} +constexpr auto GetManyReply::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(GetManyReply, _impl_.records_) + + decltype(GetManyReply::_impl_.records_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::ZeroInit( + sizeof(GetManyReply), alignof(GetManyReply), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&GetManyReply::PlacementNew_, + sizeof(GetManyReply), + alignof(GetManyReply)); + } +} +constexpr auto GetManyReply::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_GetManyReply_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &GetManyReply::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &GetManyReply::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &GetManyReply::ByteSizeLong, + &GetManyReply::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(GetManyReply, _impl_._cached_size_), + false, + }, + &GetManyReply::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull GetManyReply_class_data_ = + GetManyReply::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +GetManyReply::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&GetManyReply_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(GetManyReply_class_data_.tc_table); + return GetManyReply_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 1, 1, 0, 2> +GetManyReply::_table_ = { + { + PROTOBUF_FIELD_OFFSET(GetManyReply, _impl_._has_bits_), + 0, // no _extensions_ + 1, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967294, // skipmap + offsetof(decltype(_table_), field_entries), + 1, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + GetManyReply_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::GetManyReply>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // repeated .modlock.wasm.persist.PlayerRecord records = 1; + {::_pbi::TcParser::FastMtR1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(GetManyReply, _impl_.records_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // repeated .modlock.wasm.persist.PlayerRecord records = 1; + {PROTOBUF_FIELD_OFFSET(GetManyReply, _impl_.records_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::PlayerRecord>()}, + }}, + {{ + }}, +}; +PROTOBUF_NOINLINE void GetManyReply::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.GetManyReply) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _impl_.records_.Clear(); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL GetManyReply::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const GetManyReply& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL GetManyReply::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const GetManyReply& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.GetManyReply) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // repeated .modlock.wasm.persist.PlayerRecord records = 1; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + for (unsigned i = 0, n = static_cast( + this_._internal_records_size()); + i < n; i++) { + const auto& repfield = this_._internal_records().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 1, repfield, repfield.GetCachedSize(), + target, stream); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.GetManyReply) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t GetManyReply::ByteSizeLong(const MessageLite& base) { + const GetManyReply& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t GetManyReply::ByteSizeLong() const { + const GetManyReply& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.GetManyReply) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + { + // repeated .modlock.wasm.persist.PlayerRecord records = 1; + cached_has_bits = this_._impl_._has_bits_[0]; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + total_size += 1UL * this_._internal_records_size(); + for (const auto& msg : this_._internal_records()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void GetManyReply::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.GetManyReply) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _this->_internal_mutable_records()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_records()); + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void GetManyReply::CopyFrom(const GetManyReply& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.GetManyReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void GetManyReply::InternalSwap(GetManyReply* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.records_.InternalSwap(&other->_impl_.records_); +} + +::google::protobuf::Metadata GetManyReply::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class PlayerRecord::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(PlayerRecord, _impl_._has_bits_); +}; + +PlayerRecord::PlayerRecord(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, PlayerRecord_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.PlayerRecord) +} +PROTOBUF_NDEBUG_INLINE PlayerRecord::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::PlayerRecord& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0} {} + +PlayerRecord::PlayerRecord( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const PlayerRecord& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, PlayerRecord_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + PlayerRecord* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.record_ = (CheckHasBit(cached_has_bits, 0x00000001U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.record_) + : nullptr; + _impl_.player_ = from._impl_.player_; + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.PlayerRecord) +} +PROTOBUF_NDEBUG_INLINE PlayerRecord::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0} {} + +inline void PlayerRecord::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, record_), + 0, + offsetof(Impl_, player_) - + offsetof(Impl_, record_) + + sizeof(Impl_::player_)); +} +PlayerRecord::~PlayerRecord() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.PlayerRecord) + SharedDtor(*this); +} +inline void PlayerRecord::SharedDtor(MessageLite& self) { + PlayerRecord& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.record_; + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL PlayerRecord::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) PlayerRecord(arena); +} +constexpr auto PlayerRecord::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(PlayerRecord), + alignof(PlayerRecord)); +} +constexpr auto PlayerRecord::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_PlayerRecord_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &PlayerRecord::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &PlayerRecord::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &PlayerRecord::ByteSizeLong, + &PlayerRecord::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(PlayerRecord, _impl_._cached_size_), + false, + }, + &PlayerRecord::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull PlayerRecord_class_data_ = + PlayerRecord::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +PlayerRecord::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&PlayerRecord_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(PlayerRecord_class_data_.tc_table); + return PlayerRecord_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 1, 0, 2> +PlayerRecord::_table_ = { + { + PROTOBUF_FIELD_OFFSET(PlayerRecord, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + PlayerRecord_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::PlayerRecord>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .modlock.wasm.persist.Record record = 2; + {::_pbi::TcParser::FastMtS1, + {18, 0, 0, + PROTOBUF_FIELD_OFFSET(PlayerRecord, _impl_.record_)}}, + // int32 player = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(PlayerRecord, _impl_.player_), 1>(), + {8, 1, 0, + PROTOBUF_FIELD_OFFSET(PlayerRecord, _impl_.player_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // int32 player = 1; + {PROTOBUF_FIELD_OFFSET(PlayerRecord, _impl_.player_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // .modlock.wasm.persist.Record record = 2; + {PROTOBUF_FIELD_OFFSET(PlayerRecord, _impl_.record_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Record>()}, + }}, + {{ + }}, +}; +PROTOBUF_NOINLINE void PlayerRecord::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.PlayerRecord) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + ABSL_DCHECK(_impl_.record_ != nullptr); + _impl_.record_->Clear(); + } + _impl_.player_ = 0; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL PlayerRecord::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const PlayerRecord& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL PlayerRecord::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const PlayerRecord& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.PlayerRecord) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // int32 player = 1; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_player() != 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<1>( + stream, this_._internal_player(), target); + } + } + + // .modlock.wasm.persist.Record record = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 2, *this_._impl_.record_, this_._impl_.record_->GetCachedSize(), target, + stream); + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.PlayerRecord) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t PlayerRecord::ByteSizeLong(const MessageLite& base) { + const PlayerRecord& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t PlayerRecord::ByteSizeLong() const { + const PlayerRecord& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.PlayerRecord) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + // .modlock.wasm.persist.Record record = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.record_); + } + // int32 player = 1; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_player() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this_._internal_player()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void PlayerRecord::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.PlayerRecord) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + ABSL_DCHECK(from._impl_.record_ != nullptr); + if (_this->_impl_.record_ == nullptr) { + _this->_impl_.record_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.record_); + } else { + _this->_impl_.record_->MergeFrom(*from._impl_.record_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (from._internal_player() != 0) { + _this->_impl_.player_ = from._impl_.player_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void PlayerRecord::CopyFrom(const PlayerRecord& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.PlayerRecord) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void PlayerRecord::InternalSwap(PlayerRecord* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(PlayerRecord, _impl_.player_) + + sizeof(PlayerRecord::_impl_.player_) + - PROTOBUF_FIELD_OFFSET(PlayerRecord, _impl_.record_)>( + reinterpret_cast(&_impl_.record_), + reinterpret_cast(&other->_impl_.record_)); +} + +::google::protobuf::Metadata PlayerRecord::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class UpdateRequest::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_._has_bits_); +}; + +UpdateRequest::UpdateRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, UpdateRequest_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.UpdateRequest) +} +PROTOBUF_NDEBUG_INLINE UpdateRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::UpdateRequest& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + ops_{visibility, arena, from.ops_}, + type_(arena, from.type_), + key_(arena, from.key_), + update_key_(arena, from.update_key_) {} + +UpdateRequest::UpdateRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const UpdateRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, UpdateRequest_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + UpdateRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.player_ = from._impl_.player_; + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.UpdateRequest) +} +PROTOBUF_NDEBUG_INLINE UpdateRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + ops_{visibility, arena}, + type_(arena), + key_(arena), + update_key_(arena) {} + +inline void UpdateRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.player_ = {}; +} +UpdateRequest::~UpdateRequest() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.UpdateRequest) + SharedDtor(*this); +} +inline void UpdateRequest::SharedDtor(MessageLite& self) { + UpdateRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.type_.Destroy(); + this_._impl_.key_.Destroy(); + this_._impl_.update_key_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL UpdateRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) UpdateRequest(arena); +} +constexpr auto UpdateRequest::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.ops_) + + decltype(UpdateRequest::_impl_.ops_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::CopyInit( + sizeof(UpdateRequest), alignof(UpdateRequest), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&UpdateRequest::PlacementNew_, + sizeof(UpdateRequest), + alignof(UpdateRequest)); + } +} +constexpr auto UpdateRequest::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_UpdateRequest_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &UpdateRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &UpdateRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &UpdateRequest::ByteSizeLong, + &UpdateRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_._cached_size_), + false, + }, + &UpdateRequest::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull UpdateRequest_class_data_ = + UpdateRequest::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +UpdateRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&UpdateRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(UpdateRequest_class_data_.tc_table); + return UpdateRequest_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<3, 5, 1, 60, 2> +UpdateRequest::_table_ = { + { + PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_._has_bits_), + 0, // no _extensions_ + 5, 56, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967264, // skipmap + offsetof(decltype(_table_), field_entries), + 5, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + UpdateRequest_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::UpdateRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // int32 player = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UpdateRequest, _impl_.player_), 4>(), + {8, 4, 0, + PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.player_)}}, + // string type = 2; + {::_pbi::TcParser::FastUS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.type_)}}, + // string key = 3; + {::_pbi::TcParser::FastUS1, + {26, 2, 0, + PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.key_)}}, + // repeated .modlock.wasm.persist.Op ops = 4; + {::_pbi::TcParser::FastMtR1, + {34, 0, 0, + PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.ops_)}}, + // string update_key = 5; + {::_pbi::TcParser::FastUS1, + {42, 3, 0, + PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.update_key_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // int32 player = 1; + {PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.player_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // string type = 2; + {PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.type_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string key = 3; + {PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.key_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // repeated .modlock.wasm.persist.Op ops = 4; + {PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.ops_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + // string update_key = 5; + {PROTOBUF_FIELD_OFFSET(UpdateRequest, _impl_.update_key_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Op>()}, + }}, + {{ + "\42\0\4\3\0\12\0\0" + "modlock.wasm.persist.UpdateRequest" + "type" + "key" + "update_key" + }}, +}; +PROTOBUF_NOINLINE void UpdateRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.UpdateRequest) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _impl_.ops_.Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.type_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + _impl_.key_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + _impl_.update_key_.ClearNonDefaultToEmpty(); + } + } + _impl_.player_ = 0; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL UpdateRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const UpdateRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL UpdateRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const UpdateRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.UpdateRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // int32 player = 1; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_player() != 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<1>( + stream, this_._internal_player(), target); + } + } + + // string type = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_type().empty()) { + const ::std::string& _s = this_._internal_type(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.UpdateRequest.type"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // string key = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_key().empty()) { + const ::std::string& _s = this_._internal_key(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.UpdateRequest.key"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + } + + // repeated .modlock.wasm.persist.Op ops = 4; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + for (unsigned i = 0, n = static_cast( + this_._internal_ops_size()); + i < n; i++) { + const auto& repfield = this_._internal_ops().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 4, repfield, repfield.GetCachedSize(), + target, stream); + } + } + + // string update_key = 5; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!this_._internal_update_key().empty()) { + const ::std::string& _s = this_._internal_update_key(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.UpdateRequest.update_key"); + target = stream->WriteStringMaybeAliased(5, _s, target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.UpdateRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t UpdateRequest::ByteSizeLong(const MessageLite& base) { + const UpdateRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t UpdateRequest::ByteSizeLong() const { + const UpdateRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.UpdateRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + // repeated .modlock.wasm.persist.Op ops = 4; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + total_size += 1UL * this_._internal_ops_size(); + for (const auto& msg : this_._internal_ops()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + } + // string type = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_type().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_type()); + } + } + // string key = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_key().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_key()); + } + } + // string update_key = 5; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!this_._internal_update_key().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_update_key()); + } + } + // int32 player = 1; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_player() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this_._internal_player()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void UpdateRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.UpdateRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000001fU)) { + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _this->_internal_mutable_ops()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_ops()); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_type().empty()) { + _this->_internal_set_type(from._internal_type()); + } else { + if (_this->_impl_.type_.IsDefault()) { + _this->_internal_set_type(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!from._internal_key().empty()) { + _this->_internal_set_key(from._internal_key()); + } else { + if (_this->_impl_.key_.IsDefault()) { + _this->_internal_set_key(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!from._internal_update_key().empty()) { + _this->_internal_set_update_key(from._internal_update_key()); + } else { + if (_this->_impl_.update_key_.IsDefault()) { + _this->_internal_set_update_key(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (from._internal_player() != 0) { + _this->_impl_.player_ = from._impl_.player_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void UpdateRequest::CopyFrom(const UpdateRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.UpdateRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void UpdateRequest::InternalSwap(UpdateRequest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.ops_.InternalSwap(&other->_impl_.ops_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.type_, &other->_impl_.type_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.key_, &other->_impl_.key_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.update_key_, &other->_impl_.update_key_, arena); + swap(_impl_.player_, other->_impl_.player_); +} + +::google::protobuf::Metadata UpdateRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class UpdateReply::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(UpdateReply, _impl_._has_bits_); +}; + +UpdateReply::UpdateReply(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, UpdateReply_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.UpdateReply) +} +PROTOBUF_NDEBUG_INLINE UpdateReply::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::UpdateReply& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0} {} + +UpdateReply::UpdateReply( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const UpdateReply& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, UpdateReply_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + UpdateReply* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.record_ = (CheckHasBit(cached_has_bits, 0x00000001U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.record_) + : nullptr; + _impl_.repeated_ = from._impl_.repeated_; + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.UpdateReply) +} +PROTOBUF_NDEBUG_INLINE UpdateReply::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0} {} + +inline void UpdateReply::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, record_), + 0, + offsetof(Impl_, repeated_) - + offsetof(Impl_, record_) + + sizeof(Impl_::repeated_)); +} +UpdateReply::~UpdateReply() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.UpdateReply) + SharedDtor(*this); +} +inline void UpdateReply::SharedDtor(MessageLite& self) { + UpdateReply& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.record_; + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL UpdateReply::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) UpdateReply(arena); +} +constexpr auto UpdateReply::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(UpdateReply), + alignof(UpdateReply)); +} +constexpr auto UpdateReply::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_UpdateReply_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &UpdateReply::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &UpdateReply::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &UpdateReply::ByteSizeLong, + &UpdateReply::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(UpdateReply, _impl_._cached_size_), + false, + }, + &UpdateReply::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull UpdateReply_class_data_ = + UpdateReply::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +UpdateReply::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&UpdateReply_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(UpdateReply_class_data_.tc_table); + return UpdateReply_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 1, 0, 2> +UpdateReply::_table_ = { + { + PROTOBUF_FIELD_OFFSET(UpdateReply, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + UpdateReply_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::UpdateReply>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // bool repeated = 2; + {::_pbi::TcParser::SingularVarintNoZag1(), + {16, 1, 0, + PROTOBUF_FIELD_OFFSET(UpdateReply, _impl_.repeated_)}}, + // .modlock.wasm.persist.Record record = 1; + {::_pbi::TcParser::FastMtS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(UpdateReply, _impl_.record_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // .modlock.wasm.persist.Record record = 1; + {PROTOBUF_FIELD_OFFSET(UpdateReply, _impl_.record_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // bool repeated = 2; + {PROTOBUF_FIELD_OFFSET(UpdateReply, _impl_.repeated_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Record>()}, + }}, + {{ + }}, +}; +PROTOBUF_NOINLINE void UpdateReply::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.UpdateReply) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + ABSL_DCHECK(_impl_.record_ != nullptr); + _impl_.record_->Clear(); + } + _impl_.repeated_ = false; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL UpdateReply::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const UpdateReply& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL UpdateReply::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const UpdateReply& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.UpdateReply) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // .modlock.wasm.persist.Record record = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 1, *this_._impl_.record_, this_._impl_.record_->GetCachedSize(), target, + stream); + } + + // bool repeated = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_repeated() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 2, this_._internal_repeated(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.UpdateReply) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t UpdateReply::ByteSizeLong(const MessageLite& base) { + const UpdateReply& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t UpdateReply::ByteSizeLong() const { + const UpdateReply& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.UpdateReply) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + // .modlock.wasm.persist.Record record = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.record_); + } + // bool repeated = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_repeated() != 0) { + total_size += 2; + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void UpdateReply::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.UpdateReply) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + ABSL_DCHECK(from._impl_.record_ != nullptr); + if (_this->_impl_.record_ == nullptr) { + _this->_impl_.record_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.record_); + } else { + _this->_impl_.record_->MergeFrom(*from._impl_.record_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (from._internal_repeated() != 0) { + _this->_impl_.repeated_ = from._impl_.repeated_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void UpdateReply::CopyFrom(const UpdateReply& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.UpdateReply) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void UpdateReply::InternalSwap(UpdateReply* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(UpdateReply, _impl_.repeated_) + + sizeof(UpdateReply::_impl_.repeated_) + - PROTOBUF_FIELD_OFFSET(UpdateReply, _impl_.record_)>( + reinterpret_cast(&_impl_.record_), + reinterpret_cast(&other->_impl_.record_)); +} + +::google::protobuf::Metadata UpdateReply::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +#if defined(PROTOBUF_CUSTOM_VTABLE) +StoredRecord_KindsEntry_DoNotUse::StoredRecord_KindsEntry_DoNotUse() + : SuperType(StoredRecord_KindsEntry_DoNotUse_class_data_.base()) {} +StoredRecord_KindsEntry_DoNotUse::StoredRecord_KindsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : SuperType(arena, StoredRecord_KindsEntry_DoNotUse_class_data_.base()) {} +#else // PROTOBUF_CUSTOM_VTABLE +StoredRecord_KindsEntry_DoNotUse::StoredRecord_KindsEntry_DoNotUse() : SuperType() {} +StoredRecord_KindsEntry_DoNotUse::StoredRecord_KindsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) : SuperType(arena) {} +#endif // PROTOBUF_CUSTOM_VTABLE +inline void* PROTOBUF_NONNULL StoredRecord_KindsEntry_DoNotUse::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) StoredRecord_KindsEntry_DoNotUse(arena); +} +constexpr auto StoredRecord_KindsEntry_DoNotUse::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(StoredRecord_KindsEntry_DoNotUse), + alignof(StoredRecord_KindsEntry_DoNotUse)); +} +constexpr auto StoredRecord_KindsEntry_DoNotUse::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_StoredRecord_KindsEntry_DoNotUse_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &StoredRecord_KindsEntry_DoNotUse::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &StoredRecord_KindsEntry_DoNotUse::SharedDtor, + static_cast(&StoredRecord_KindsEntry_DoNotUse::ClearImpl), + ::google::protobuf::Message::ByteSizeLongImpl, ::google::protobuf::Message::_InternalSerializeImpl + , +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(StoredRecord_KindsEntry_DoNotUse, _impl_._cached_size_), + false, + }, + &StoredRecord_KindsEntry_DoNotUse::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull StoredRecord_KindsEntry_DoNotUse_class_data_ = + StoredRecord_KindsEntry_DoNotUse::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +StoredRecord_KindsEntry_DoNotUse::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&StoredRecord_KindsEntry_DoNotUse_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(StoredRecord_KindsEntry_DoNotUse_class_data_.tc_table); + return StoredRecord_KindsEntry_DoNotUse_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 0, 56, 2> +StoredRecord_KindsEntry_DoNotUse::_table_ = { + { + PROTOBUF_FIELD_OFFSET(StoredRecord_KindsEntry_DoNotUse, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + StoredRecord_KindsEntry_DoNotUse_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::DiscardEverythingFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::StoredRecord_KindsEntry_DoNotUse>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .modlock.wasm.persist.Field.Kind value = 2; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(StoredRecord_KindsEntry_DoNotUse, _impl_.value_), 1>(), + {16, 1, 0, + PROTOBUF_FIELD_OFFSET(StoredRecord_KindsEntry_DoNotUse, _impl_.value_)}}, + // string key = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(StoredRecord_KindsEntry_DoNotUse, _impl_.key_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string key = 1; + {PROTOBUF_FIELD_OFFSET(StoredRecord_KindsEntry_DoNotUse, _impl_.key_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .modlock.wasm.persist.Field.Kind value = 2; + {PROTOBUF_FIELD_OFFSET(StoredRecord_KindsEntry_DoNotUse, _impl_.value_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + }}, + // no aux_entries + {{ + "\54\3\0\0\0\0\0\0" + "modlock.wasm.persist.StoredRecord.KindsEntry" + "key" + }}, +}; +// =================================================================== + +class StoredRecord::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_._has_bits_); +}; + +StoredRecord::StoredRecord(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, StoredRecord_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.StoredRecord) +} +PROTOBUF_NDEBUG_INLINE StoredRecord::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::StoredRecord& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + recent_keys_{visibility, arena, from.recent_keys_}, + kinds_{visibility, arena, from.kinds_} {} + +StoredRecord::StoredRecord( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const StoredRecord& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, StoredRecord_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + StoredRecord* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::uint32_t cached_has_bits = _impl_._has_bits_[0]; + _impl_.record_ = (CheckHasBit(cached_has_bits, 0x00000002U)) + ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.record_) + : nullptr; + _impl_.version_ = from._impl_.version_; + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.StoredRecord) +} +PROTOBUF_NDEBUG_INLINE StoredRecord::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + recent_keys_{visibility, arena}, + kinds_{visibility, arena} {} + +inline void StoredRecord::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, record_), + 0, + offsetof(Impl_, version_) - + offsetof(Impl_, record_) + + sizeof(Impl_::version_)); +} +StoredRecord::~StoredRecord() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.StoredRecord) + SharedDtor(*this); +} +inline void StoredRecord::SharedDtor(MessageLite& self) { + StoredRecord& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + delete this_._impl_.record_; + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL StoredRecord::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) StoredRecord(arena); +} +constexpr auto StoredRecord::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.recent_keys_) + + decltype(StoredRecord::_impl_.recent_keys_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.kinds_) + + decltype(StoredRecord::_impl_.kinds_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::CopyInit( + sizeof(StoredRecord), alignof(StoredRecord), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&StoredRecord::PlacementNew_, + sizeof(StoredRecord), + alignof(StoredRecord)); + } +} +constexpr auto StoredRecord::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_StoredRecord_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &StoredRecord::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &StoredRecord::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &StoredRecord::ByteSizeLong, + &StoredRecord::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_._cached_size_), + false, + }, + &StoredRecord::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull StoredRecord_class_data_ = + StoredRecord::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +StoredRecord::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&StoredRecord_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(StoredRecord_class_data_.tc_table); + return StoredRecord_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 4, 2, 58, 2> +StoredRecord::_table_ = { + { + PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_._has_bits_), + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967280, // skipmap + offsetof(decltype(_table_), field_entries), + 4, // num_field_entries + 2, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + StoredRecord_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::StoredRecord>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // .modlock.wasm.persist.Record record = 1; + {::_pbi::TcParser::FastMtS1, + {10, 1, 0, + PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.record_)}}, + // repeated string recent_keys = 2; + {::_pbi::TcParser::FastUR1, + {18, 0, 0, + PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.recent_keys_)}}, + // uint64 version = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(StoredRecord, _impl_.version_), 2>(), + {24, 2, 0, + PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.version_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // .modlock.wasm.persist.Record record = 1; + {PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.record_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + // repeated string recent_keys = 2; + {PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.recent_keys_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kUtf8String | ::_fl::kRepSString)}, + // uint64 version = 3; + {PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.version_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + // map kinds = 4; + {PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.kinds_), _Internal::kHasBitsOffset + 3, 1, (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::Record>()}, + {::_pbi::TcParser::GetMapAuxInfo( + 1, 0, 9, 14, 0)}, + }}, + {{ + "\41\0\13\0\5\0\0\0" + "modlock.wasm.persist.StoredRecord" + "recent_keys" + "kinds" + }}, +}; +PROTOBUF_NOINLINE void StoredRecord::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.StoredRecord) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _impl_.recent_keys_.Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + ABSL_DCHECK(_impl_.record_ != nullptr); + _impl_.record_->Clear(); + } + } + if (BatchCheckHasBit(cached_has_bits, 0x0000000cU)) { + _impl_.version_ = ::uint64_t{0u}; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000008U)) { + _impl_.kinds_.Clear(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL StoredRecord::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const StoredRecord& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL StoredRecord::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const StoredRecord& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.StoredRecord) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // .modlock.wasm.persist.Record record = 1; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 1, *this_._impl_.record_, this_._impl_.record_->GetCachedSize(), target, + stream); + } + + // repeated string recent_keys = 2; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + for (int i = 0, n = this_._internal_recent_keys_size(); i < n; ++i) { + const auto& s = this_._internal_recent_keys().Get(i); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + s.data(), static_cast(s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.StoredRecord.recent_keys"); + target = stream->WriteString(2, s, target); + } + } + + // uint64 version = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_version() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 3, this_._internal_version(), target); + } + } + + // map kinds = 4; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000008U)) { + if (!this_._internal_kinds().empty()) { + using MapType = ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field_Kind>; + using WireHelper = _pbi::MapEntryFuncs<::std::string, ::modlock::wasm::persist::Field_Kind, + _pbi::WireFormatLite::TYPE_STRING, + _pbi::WireFormatLite::TYPE_ENUM>; + const auto& field = this_._internal_kinds(); + + if (stream->IsSerializationDeterministic() && field.size() > 1) { + for (const auto& entry : ::google::protobuf::internal::MapSorterPtr(field)) { + target = WireHelper::InternalSerialize( + 4, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.StoredRecord.kinds"); + } + } else { + for (const auto& entry : field) { + target = WireHelper::InternalSerialize( + 4, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.StoredRecord.kinds"); + } + } + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.StoredRecord) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t StoredRecord::ByteSizeLong(const MessageLite& base) { + const StoredRecord& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t StoredRecord::ByteSizeLong() const { + const StoredRecord& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.StoredRecord) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + // repeated string recent_keys = 2; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this_._internal_recent_keys().size()); + for (int i = 0, n = this_._internal_recent_keys().size(); i < n; ++i) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_recent_keys().Get(i)); + } + } + // .modlock.wasm.persist.Record record = 1; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.record_); + } + // uint64 version = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_version() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_version()); + } + } + // map kinds = 4; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000008U)) { + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this_._internal_kinds_size()); + for (const auto& entry : this_._internal_kinds()) { + total_size += _pbi::MapEntryFuncs<::std::string, ::modlock::wasm::persist::Field_Kind, + _pbi::WireFormatLite::TYPE_STRING, + _pbi::WireFormatLite::TYPE_ENUM>::ByteSizeLong(entry.first, entry.second); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void StoredRecord::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.StoredRecord) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _this->_internal_mutable_recent_keys()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_recent_keys()); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + ABSL_DCHECK(from._impl_.record_ != nullptr); + if (_this->_impl_.record_ == nullptr) { + _this->_impl_.record_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.record_); + } else { + _this->_impl_.record_->MergeFrom(*from._impl_.record_); + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (from._internal_version() != 0) { + _this->_impl_.version_ = from._impl_.version_; + } + } + if (CheckHasBitForRepeated(cached_has_bits, 0x00000008U)) { + _this->_impl_.kinds_.MergeFrom(from._impl_.kinds_); + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void StoredRecord::CopyFrom(const StoredRecord& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.StoredRecord) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void StoredRecord::InternalSwap(StoredRecord* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.recent_keys_.InternalSwap(&other->_impl_.recent_keys_); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.version_) + + sizeof(StoredRecord::_impl_.version_) + - PROTOBUF_FIELD_OFFSET(StoredRecord, _impl_.record_)>( + reinterpret_cast(&_impl_.record_), + reinterpret_cast(&other->_impl_.record_)); + _impl_.kinds_.InternalSwap(&other->_impl_.kinds_); +} + +::google::protobuf::Metadata StoredRecord::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +#if defined(PROTOBUF_CUSTOM_VTABLE) +PlayerFile_RecordsEntry_DoNotUse::PlayerFile_RecordsEntry_DoNotUse() + : SuperType(PlayerFile_RecordsEntry_DoNotUse_class_data_.base()) {} +PlayerFile_RecordsEntry_DoNotUse::PlayerFile_RecordsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : SuperType(arena, PlayerFile_RecordsEntry_DoNotUse_class_data_.base()) {} +#else // PROTOBUF_CUSTOM_VTABLE +PlayerFile_RecordsEntry_DoNotUse::PlayerFile_RecordsEntry_DoNotUse() : SuperType() {} +PlayerFile_RecordsEntry_DoNotUse::PlayerFile_RecordsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) : SuperType(arena) {} +#endif // PROTOBUF_CUSTOM_VTABLE +inline void* PROTOBUF_NONNULL PlayerFile_RecordsEntry_DoNotUse::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) PlayerFile_RecordsEntry_DoNotUse(arena); +} +constexpr auto PlayerFile_RecordsEntry_DoNotUse::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(PlayerFile_RecordsEntry_DoNotUse), + alignof(PlayerFile_RecordsEntry_DoNotUse)); +} +constexpr auto PlayerFile_RecordsEntry_DoNotUse::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_PlayerFile_RecordsEntry_DoNotUse_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &PlayerFile_RecordsEntry_DoNotUse::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &PlayerFile_RecordsEntry_DoNotUse::SharedDtor, + static_cast(&PlayerFile_RecordsEntry_DoNotUse::ClearImpl), + ::google::protobuf::Message::ByteSizeLongImpl, ::google::protobuf::Message::_InternalSerializeImpl + , +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(PlayerFile_RecordsEntry_DoNotUse, _impl_._cached_size_), + false, + }, + &PlayerFile_RecordsEntry_DoNotUse::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull PlayerFile_RecordsEntry_DoNotUse_class_data_ = + PlayerFile_RecordsEntry_DoNotUse::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +PlayerFile_RecordsEntry_DoNotUse::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&PlayerFile_RecordsEntry_DoNotUse_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(PlayerFile_RecordsEntry_DoNotUse_class_data_.tc_table); + return PlayerFile_RecordsEntry_DoNotUse_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 1, 56, 2> +PlayerFile_RecordsEntry_DoNotUse::_table_ = { + { + PROTOBUF_FIELD_OFFSET(PlayerFile_RecordsEntry_DoNotUse, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + PlayerFile_RecordsEntry_DoNotUse_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::DiscardEverythingFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::PlayerFile_RecordsEntry_DoNotUse>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // .modlock.wasm.persist.StoredRecord value = 2; + {::_pbi::TcParser::FastMtS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(PlayerFile_RecordsEntry_DoNotUse, _impl_.value_)}}, + // string key = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(PlayerFile_RecordsEntry_DoNotUse, _impl_.key_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string key = 1; + {PROTOBUF_FIELD_OFFSET(PlayerFile_RecordsEntry_DoNotUse, _impl_.key_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // .modlock.wasm.persist.StoredRecord value = 2; + {PROTOBUF_FIELD_OFFSET(PlayerFile_RecordsEntry_DoNotUse, _impl_.value_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::StoredRecord>()}, + }}, + {{ + "\54\3\0\0\0\0\0\0" + "modlock.wasm.persist.PlayerFile.RecordsEntry" + "key" + }}, +}; +// =================================================================== + +class PlayerFile::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(PlayerFile, _impl_._has_bits_); +}; + +PlayerFile::PlayerFile(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, PlayerFile_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.persist.PlayerFile) +} +PROTOBUF_NDEBUG_INLINE PlayerFile::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::wasm::persist::PlayerFile& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + records_{visibility, arena, from.records_} {} + +PlayerFile::PlayerFile( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const PlayerFile& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, PlayerFile_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + PlayerFile* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.steam_id_ = from._impl_.steam_id_; + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.persist.PlayerFile) +} +PROTOBUF_NDEBUG_INLINE PlayerFile::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + records_{visibility, arena} {} + +inline void PlayerFile::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.steam_id_ = {}; +} +PlayerFile::~PlayerFile() { + // @@protoc_insertion_point(destructor:modlock.wasm.persist.PlayerFile) + SharedDtor(*this); +} +inline void PlayerFile::SharedDtor(MessageLite& self) { + PlayerFile& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL PlayerFile::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) PlayerFile(arena); +} +constexpr auto PlayerFile::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(PlayerFile, _impl_.records_) + + decltype(PlayerFile::_impl_.records_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::CopyInit( + sizeof(PlayerFile), alignof(PlayerFile), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&PlayerFile::PlacementNew_, + sizeof(PlayerFile), + alignof(PlayerFile)); + } +} +constexpr auto PlayerFile::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_PlayerFile_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &PlayerFile::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &PlayerFile::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &PlayerFile::ByteSizeLong, + &PlayerFile::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(PlayerFile, _impl_._cached_size_), + false, + }, + &PlayerFile::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull PlayerFile_class_data_ = + PlayerFile::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +PlayerFile::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&PlayerFile_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(PlayerFile_class_data_.tc_table); + return PlayerFile_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 2, 2, 47, 2> +PlayerFile::_table_ = { + { + PROTOBUF_FIELD_OFFSET(PlayerFile, _impl_._has_bits_), + 0, // no _extensions_ + 2, 0, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 2, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + PlayerFile_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::persist::PlayerFile>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // uint64 steam_id = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(PlayerFile, _impl_.steam_id_), 0>(), + {8, 0, 0, + PROTOBUF_FIELD_OFFSET(PlayerFile, _impl_.steam_id_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // uint64 steam_id = 1; + {PROTOBUF_FIELD_OFFSET(PlayerFile, _impl_.steam_id_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + // map records = 2; + {PROTOBUF_FIELD_OFFSET(PlayerFile, _impl_.records_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMap)}, + }}, + {{ + {::_pbi::TcParser::GetMapAuxInfo( + 1, 0, 9, 11, 0)}, + {::_pbi::TcParser::GetTable<::modlock::wasm::persist::StoredRecord>()}, + }}, + {{ + "\37\0\7\0\0\0\0\0" + "modlock.wasm.persist.PlayerFile" + "records" + }}, +}; +PROTOBUF_NOINLINE void PlayerFile::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.persist.PlayerFile) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + _impl_.steam_id_ = ::uint64_t{0u}; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + _impl_.records_.Clear(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL PlayerFile::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const PlayerFile& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL PlayerFile::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const PlayerFile& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.persist.PlayerFile) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // uint64 steam_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (this_._internal_steam_id() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 1, this_._internal_steam_id(), target); + } + } + + // map records = 2; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + if (!this_._internal_records().empty()) { + using MapType = ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::StoredRecord>; + using WireHelper = _pbi::MapEntryFuncs<::std::string, ::modlock::wasm::persist::StoredRecord, + _pbi::WireFormatLite::TYPE_STRING, + _pbi::WireFormatLite::TYPE_MESSAGE>; + const auto& field = this_._internal_records(); + + if (stream->IsSerializationDeterministic() && field.size() > 1) { + for (const auto& entry : ::google::protobuf::internal::MapSorterPtr(field)) { + target = WireHelper::InternalSerialize( + 2, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.PlayerFile.records"); + } + } else { + for (const auto& entry : field) { + target = WireHelper::InternalSerialize( + 2, entry.first, entry.second, target, stream); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + entry.first.data(), static_cast(entry.first.length()), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.persist.PlayerFile.records"); + } + } + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:modlock.wasm.persist.PlayerFile) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t PlayerFile::ByteSizeLong(const MessageLite& base) { + const PlayerFile& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t PlayerFile::ByteSizeLong() const { + const PlayerFile& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.persist.PlayerFile) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + // uint64 steam_id = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (this_._internal_steam_id() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_steam_id()); + } + } + // map records = 2; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this_._internal_records_size()); + for (const auto& entry : this_._internal_records()) { + total_size += _pbi::MapEntryFuncs<::std::string, ::modlock::wasm::persist::StoredRecord, + _pbi::WireFormatLite::TYPE_STRING, + _pbi::WireFormatLite::TYPE_MESSAGE>::ByteSizeLong(entry.first, entry.second); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void PlayerFile::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:modlock.wasm.persist.PlayerFile) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (from._internal_steam_id() != 0) { + _this->_impl_.steam_id_ = from._impl_.steam_id_; + } + } + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + _this->_impl_.records_.MergeFrom(from._impl_.records_); + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void PlayerFile::CopyFrom(const PlayerFile& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.persist.PlayerFile) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void PlayerFile::InternalSwap(PlayerFile* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + swap(_impl_.steam_id_, other->_impl_.steam_id_); + _impl_.records_.InternalSwap(&other->_impl_.records_); +} + +::google::protobuf::Metadata PlayerFile::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// @@protoc_insertion_point(namespace_scope) +} // namespace persist +} // namespace wasm +} // namespace modlock +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google +// @@protoc_insertion_point(global_scope) +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::std::false_type + _static_init2_ [[maybe_unused]] = + (::_pbi::AddDescriptors(&descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto), + ::std::false_type{}); +#include "google/protobuf/port_undef.inc" diff --git a/src/wasm/persist/persist.pb.go b/src/wasm/persist/persist.pb.go new file mode 100644 index 00000000..5661f72a --- /dev/null +++ b/src/wasm/persist/persist.pb.go @@ -0,0 +1,5926 @@ +// Code generated by protoc-gen-go-lite. DO NOT EDIT. +// protoc-gen-go-lite version: v0.19.1-0.20261028131920-f644656fc4a7 +// source: github.com/paralin/modlock/src/wasm/persist/persist.proto + +package persist + +import ( + fmt "fmt" + io "io" + maps "maps" + math "math" + slices "slices" + strconv "strconv" + + protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite" + json "github.com/aperturerobotics/protobuf-go-lite/json" +) + +// Writers is who may change a record type's records. +type Writers int32 + +const ( + // WRITERS_UNKNOWN is an unset or unsupported value; a manifest must set + // one of the others. + Writers_WRITERS_UNKNOWN Writers = 0 + // WRITERS_SERVERS takes changes only from a game server the host trusts + // to run the mod, for a player in its game, so the values carry that + // server's trust, such as a level or rounds won. + Writers_WRITERS_SERVERS Writers = 1 + // WRITERS_PLAYERS holds the player's own choices, such as settings: the + // host also takes changes made for the player by the player's own PC. + Writers_WRITERS_PLAYERS Writers = 2 +) + +// Enum value maps for Writers. +var ( + Writers_name = map[int32]string{ + 0: "WRITERS_UNKNOWN", + 1: "WRITERS_SERVERS", + 2: "WRITERS_PLAYERS", + } + Writers_value = map[string]int32{ + "WRITERS_UNKNOWN": 0, + "WRITERS_SERVERS": 1, + "WRITERS_PLAYERS": 2, + } +) + +func (x Writers) Enum() *Writers { + p := new(Writers) + *p = x + return p +} + +func (x Writers) String() string { + name, valid := Writers_name[int32(x)] + if valid { + return name + } + return strconv.Itoa(int(x)) +} + +// Kind is what the field holds and which operations change it. +type Field_Kind int32 + +const ( + // KIND_UNKNOWN is an unset or unsupported kind. + Field_KIND_UNKNOWN Field_Kind = 0 + // KIND_COUNT is a whole number from zero up, changed by add and set. + Field_KIND_COUNT Field_Kind = 1 + // KIND_NUMBER is any number, changed by add, max, min and set. + Field_KIND_NUMBER Field_Kind = 2 + // KIND_MAX is a number that keeps the highest value it was given, + // changed by max. + Field_KIND_MAX Field_Kind = 3 + // KIND_STRING is text of up to max_bytes bytes, changed by set. + Field_KIND_STRING Field_Kind = 4 + // KIND_TAGS is a set of up to 256 short strings, such as unlocks or + // completed goals, changed by insert and remove. + Field_KIND_TAGS Field_Kind = 5 +) + +// Enum value maps for Field_Kind. +var ( + Field_Kind_name = map[int32]string{ + 0: "KIND_UNKNOWN", + 1: "KIND_COUNT", + 2: "KIND_NUMBER", + 3: "KIND_MAX", + 4: "KIND_STRING", + 5: "KIND_TAGS", + } + Field_Kind_value = map[string]int32{ + "KIND_UNKNOWN": 0, + "KIND_COUNT": 1, + "KIND_NUMBER": 2, + "KIND_MAX": 3, + "KIND_STRING": 4, + "KIND_TAGS": 5, + } +) + +func (x Field_Kind) Enum() *Field_Kind { + p := new(Field_Kind) + *p = x + return p +} + +func (x Field_Kind) String() string { + name, valid := Field_Kind_name[int32(x)] + if valid { + return name + } + return strconv.Itoa(int(x)) +} + +// RecordType is one kind of record a mod declares in its manifest under +// persist, such as a player's stats or unlocks. A host that serves the +// persist service keeps one record of each type for each player of the mod. +type RecordType struct { + unknownFields []byte + // Name names the type in the mod's code: up to 32 letters, digits and + // underscores, starting with a letter. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Writers is who may change the type's records. + Writers Writers `protobuf:"varint,2,opt,name=writers,proto3" json:"writers,omitempty"` + // Fields are the record's fields by name: up to 32, each up to 32 + // letters, digits and underscores, starting with a letter. + Fields map[string]*Field `protobuf:"bytes,3,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *RecordType) Reset() { + *x = RecordType{} +} + +func (*RecordType) ProtoMessage() {} + +func (x *RecordType) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RecordType) GetWriters() Writers { + if x != nil { + return x.Writers + } + return Writers_WRITERS_UNKNOWN +} + +func (x *RecordType) GetFields() map[string]*Field { + if x != nil { + return x.Fields + } + return nil +} + +// Field is one declared field of a record type. +type Field struct { + unknownFields []byte + Kind Field_Kind `protobuf:"varint,1,opt,name=kind,proto3" json:"kind,omitempty"` + // MaxBytes bounds a KIND_STRING field's text, up to 256; zero is 64. + MaxBytes uint32 `protobuf:"varint,2,opt,name=max_bytes,json=maxBytes,proto3" json:"maxBytes,omitempty"` +} + +func (x *Field) Reset() { + *x = Field{} +} + +func (*Field) ProtoMessage() {} + +func (x *Field) GetKind() Field_Kind { + if x != nil { + return x.Kind + } + return Field_KIND_UNKNOWN +} + +func (x *Field) GetMaxBytes() uint32 { + if x != nil { + return x.MaxBytes + } + return 0 +} + +// Value is one field's value in a record. +type Value struct { + unknownFields []byte + // Types that are assignable to Value: + // *Value_Number + // *Value_Text + // *Value_Tags + Value isValue_Value `protobuf_oneof:"value"` +} + +func (x *Value) Reset() { + *x = Value{} +} + +func (*Value) ProtoMessage() {} + +func (m *Value) GetValue() isValue_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *Value) GetNumber() float64 { + if x, ok := x.GetValue().(*Value_Number); ok { + return x.Number + } + return 0 +} + +func (x *Value) GetText() string { + if x, ok := x.GetValue().(*Value_Text); ok { + return x.Text + } + return "" +} + +func (x *Value) GetTags() *Tags { + if x, ok := x.GetValue().(*Value_Tags); ok { + return x.Tags + } + return nil +} + +type isValue_Value interface { + isValue_Value() +} + +type Value_Number struct { + // Number holds a KIND_COUNT, KIND_NUMBER or KIND_MAX field. + Number float64 `protobuf:"fixed64,1,opt,name=number,proto3,oneof"` +} + +type Value_Text struct { + // Text holds a KIND_STRING field. + Text string `protobuf:"bytes,2,opt,name=text,proto3,oneof"` +} + +type Value_Tags struct { + // Tags holds a KIND_TAGS field. + Tags *Tags `protobuf:"bytes,3,opt,name=tags,proto3,oneof"` +} + +func (*Value_Number) isValue_Value() {} + +func (*Value_Text) isValue_Value() {} + +func (*Value_Tags) isValue_Value() {} + +// Tags is the members of a KIND_TAGS field, in sorted order. +type Tags struct { + unknownFields []byte + // Members are 1 to 32 bytes each. + Members []string `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"` +} + +func (x *Tags) Reset() { + *x = Tags{} +} + +func (*Tags) ProtoMessage() {} + +func (x *Tags) GetMembers() []string { + if x != nil { + return x.Members + } + return nil +} + +// Record is one player's values of one record type. A field never changed +// is absent and reads as zero, empty text or no tags. +type Record struct { + unknownFields []byte + Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Record) Reset() { + *x = Record{} +} + +func (*Record) ProtoMessage() {} + +func (x *Record) GetFields() map[string]*Value { + if x != nil { + return x.Fields + } + return nil +} + +// Op is one change to one field of a record. +type Op struct { + unknownFields []byte + // Field names a field the record type declares. + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + // Types that are assignable to Op: + // *Op_Add + // *Op_Max + // *Op_Min + // *Op_Set + // *Op_Insert + // *Op_Remove + Op isOp_Op `protobuf_oneof:"op"` +} + +func (x *Op) Reset() { + *x = Op{} +} + +func (*Op) ProtoMessage() {} + +func (x *Op) GetField() string { + if x != nil { + return x.Field + } + return "" +} + +func (m *Op) GetOp() isOp_Op { + if m != nil { + return m.Op + } + return nil +} + +func (x *Op) GetAdd() float64 { + if x, ok := x.GetOp().(*Op_Add); ok { + return x.Add + } + return 0 +} + +func (x *Op) GetMax() float64 { + if x, ok := x.GetOp().(*Op_Max); ok { + return x.Max + } + return 0 +} + +func (x *Op) GetMin() float64 { + if x, ok := x.GetOp().(*Op_Min); ok { + return x.Min + } + return 0 +} + +func (x *Op) GetSet() *Value { + if x, ok := x.GetOp().(*Op_Set); ok { + return x.Set + } + return nil +} + +func (x *Op) GetInsert() string { + if x, ok := x.GetOp().(*Op_Insert); ok { + return x.Insert + } + return "" +} + +func (x *Op) GetRemove() string { + if x, ok := x.GetOp().(*Op_Remove); ok { + return x.Remove + } + return "" +} + +type isOp_Op interface { + isOp_Op() +} + +type Op_Add struct { + // Add adds to a KIND_COUNT or KIND_NUMBER field; a count takes only a + // whole number from zero up. + Add float64 `protobuf:"fixed64,2,opt,name=add,proto3,oneof"` +} + +type Op_Max struct { + // Max raises a KIND_NUMBER or KIND_MAX field to this value when it is + // higher. + Max float64 `protobuf:"fixed64,3,opt,name=max,proto3,oneof"` +} + +type Op_Min struct { + // Min lowers a KIND_NUMBER field to this value when it is lower. + Min float64 `protobuf:"fixed64,4,opt,name=min,proto3,oneof"` +} + +type Op_Set struct { + // Set replaces a KIND_COUNT, KIND_NUMBER or KIND_STRING field's value. + Set *Value `protobuf:"bytes,5,opt,name=set,proto3,oneof"` +} + +type Op_Insert struct { + // Insert adds a member to a KIND_TAGS field. + Insert string `protobuf:"bytes,6,opt,name=insert,proto3,oneof"` +} + +type Op_Remove struct { + // Remove takes a member from a KIND_TAGS field. + Remove string `protobuf:"bytes,7,opt,name=remove,proto3,oneof"` +} + +func (*Op_Add) isOp_Op() {} + +func (*Op_Max) isOp_Op() {} + +func (*Op_Min) isOp_Op() {} + +func (*Op_Set) isOp_Op() {} + +func (*Op_Insert) isOp_Op() {} + +func (*Op_Remove) isOp_Op() {} + +// GetRequest reads one player's record, the request of the persist +// service's Get method. +type GetRequest struct { + unknownFields []byte + // Player is the player's server slot. + Player int32 `protobuf:"varint,1,opt,name=player,proto3" json:"player,omitempty"` + // Type names a record type the manifest declares. + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // Key selects one of the player's records of the type. Empty is the one + // record each player has; hosts refuse any other key for now. + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} +} + +func (*GetRequest) ProtoMessage() {} + +func (x *GetRequest) GetPlayer() int32 { + if x != nil { + return x.Player + } + return 0 +} + +func (x *GetRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *GetRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +// GetReply is the response of the Get method. +type GetReply struct { + unknownFields []byte + // Record is the player's record; a record never written comes back empty. + Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` +} + +func (x *GetReply) Reset() { + *x = GetReply{} +} + +func (*GetReply) ProtoMessage() {} + +func (x *GetReply) GetRecord() *Record { + if x != nil { + return x.Record + } + return nil +} + +// GetManyRequest reads the records of several players, such as a lobby at +// join, the request of the GetMany method. +type GetManyRequest struct { + unknownFields []byte + // Players are the players' server slots, up to 16. + Players []int32 `protobuf:"varint,1,rep,packed,name=players,proto3" json:"players,omitempty"` + // Type names a record type the manifest declares. + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` +} + +func (x *GetManyRequest) Reset() { + *x = GetManyRequest{} +} + +func (*GetManyRequest) ProtoMessage() {} + +func (x *GetManyRequest) GetPlayers() []int32 { + if x != nil { + return x.Players + } + return nil +} + +func (x *GetManyRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +// GetManyReply is the response of the GetMany method. +type GetManyReply struct { + unknownFields []byte + // Records holds one entry for each asked player, in the asked order. + Records []*PlayerRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` +} + +func (x *GetManyReply) Reset() { + *x = GetManyReply{} +} + +func (*GetManyReply) ProtoMessage() {} + +func (x *GetManyReply) GetRecords() []*PlayerRecord { + if x != nil { + return x.Records + } + return nil +} + +// PlayerRecord is one player's record in a GetManyReply. +type PlayerRecord struct { + unknownFields []byte + // Player is the player's server slot. + Player int32 `protobuf:"varint,1,opt,name=player,proto3" json:"player,omitempty"` + Record *Record `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` +} + +func (x *PlayerRecord) Reset() { + *x = PlayerRecord{} +} + +func (*PlayerRecord) ProtoMessage() {} + +func (x *PlayerRecord) GetPlayer() int32 { + if x != nil { + return x.Player + } + return 0 +} + +func (x *PlayerRecord) GetRecord() *Record { + if x != nil { + return x.Record + } + return nil +} + +// UpdateRequest changes one player's record by field operations, the +// request of the Update method. The host applies every op or none, so two +// servers that update one record at once both land; a set is the one op +// whose later write wins. +type UpdateRequest struct { + unknownFields []byte + // Player is the player's server slot. + Player int32 `protobuf:"varint,1,opt,name=player,proto3" json:"player,omitempty"` + // Type names a record type the manifest declares. + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // Key selects the record, as in GetRequest. + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + // Ops are the changes, applied in order, up to 32. + Ops []*Op `protobuf:"bytes,4,rep,name=ops,proto3" json:"ops,omitempty"` + // UpdateKey identifies the change, such as a round, so a resent update + // counts once: an update whose key is among the record's last 64 is + // left out. Up to 64 bytes; empty applies the update every time. + UpdateKey string `protobuf:"bytes,5,opt,name=update_key,json=updateKey,proto3" json:"updateKey,omitempty"` +} + +func (x *UpdateRequest) Reset() { + *x = UpdateRequest{} +} + +func (*UpdateRequest) ProtoMessage() {} + +func (x *UpdateRequest) GetPlayer() int32 { + if x != nil { + return x.Player + } + return 0 +} + +func (x *UpdateRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *UpdateRequest) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UpdateRequest) GetOps() []*Op { + if x != nil { + return x.Ops + } + return nil +} + +func (x *UpdateRequest) GetUpdateKey() string { + if x != nil { + return x.UpdateKey + } + return "" +} + +// UpdateReply is the response of the Update method. +type UpdateReply struct { + unknownFields []byte + // Record is the record after the update. + Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` + // Repeated is set when the update's key was among the record's recent + // keys, so the host left the record as it was. + Repeated bool `protobuf:"varint,2,opt,name=repeated,proto3" json:"repeated,omitempty"` +} + +func (x *UpdateReply) Reset() { + *x = UpdateReply{} +} + +func (*UpdateReply) ProtoMessage() {} + +func (x *UpdateReply) GetRecord() *Record { + if x != nil { + return x.Record + } + return nil +} + +func (x *UpdateReply) GetRepeated() bool { + if x != nil { + return x.Repeated + } + return false +} + +// StoredRecord is a record as a host keeps it: its values and the keys of +// its most recent updates. +type StoredRecord struct { + unknownFields []byte + Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` + // RecentKeys are the update keys of the record's last 64 keyed updates, + // oldest first. + RecentKeys []string `protobuf:"bytes,2,rep,name=recent_keys,json=recentKeys,proto3" json:"recentKeys,omitempty"` + // Version counts the updates that changed the record. + Version uint64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + // Kinds are the kinds of the fields that wrote each value in record, so a + // value is changed only by a field of the same kind. + Kinds map[string]Field_Kind `protobuf:"bytes,4,rep,name=kinds,proto3" json:"kinds,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *StoredRecord) Reset() { + *x = StoredRecord{} +} + +func (*StoredRecord) ProtoMessage() {} + +func (x *StoredRecord) GetRecord() *Record { + if x != nil { + return x.Record + } + return nil +} + +func (x *StoredRecord) GetRecentKeys() []string { + if x != nil { + return x.RecentKeys + } + return nil +} + +func (x *StoredRecord) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *StoredRecord) GetKinds() map[string]Field_Kind { + if x != nil { + return x.Kinds + } + return nil +} + +// PlayerFile is the file a local host keeps for one player of one mod: the +// player's record of each type, by type name. +type PlayerFile struct { + unknownFields []byte + // SteamId is the player's SteamID64. + SteamId uint64 `protobuf:"varint,1,opt,name=steam_id,json=steamId,proto3" json:"steamId,omitempty"` + Records map[string]*StoredRecord `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *PlayerFile) Reset() { + *x = PlayerFile{} +} + +func (*PlayerFile) ProtoMessage() {} + +func (x *PlayerFile) GetSteamId() uint64 { + if x != nil { + return x.SteamId + } + return 0 +} + +func (x *PlayerFile) GetRecords() map[string]*StoredRecord { + if x != nil { + return x.Records + } + return nil +} + +type RecordType_FieldsEntry struct { + unknownFields []byte + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value *Field `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *RecordType_FieldsEntry) Reset() { + *x = RecordType_FieldsEntry{} +} + +func (*RecordType_FieldsEntry) ProtoMessage() {} + +func (x *RecordType_FieldsEntry) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *RecordType_FieldsEntry) GetValue() *Field { + if x != nil { + return x.Value + } + return nil +} + +type Record_FieldsEntry struct { + unknownFields []byte + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value *Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Record_FieldsEntry) Reset() { + *x = Record_FieldsEntry{} +} + +func (*Record_FieldsEntry) ProtoMessage() {} + +func (x *Record_FieldsEntry) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *Record_FieldsEntry) GetValue() *Value { + if x != nil { + return x.Value + } + return nil +} + +type StoredRecord_KindsEntry struct { + unknownFields []byte + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value Field_Kind `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *StoredRecord_KindsEntry) Reset() { + *x = StoredRecord_KindsEntry{} +} + +func (*StoredRecord_KindsEntry) ProtoMessage() {} + +func (x *StoredRecord_KindsEntry) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *StoredRecord_KindsEntry) GetValue() Field_Kind { + if x != nil { + return x.Value + } + return Field_KIND_UNKNOWN +} + +type PlayerFile_RecordsEntry struct { + unknownFields []byte + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value *StoredRecord `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *PlayerFile_RecordsEntry) Reset() { + *x = PlayerFile_RecordsEntry{} +} + +func (*PlayerFile_RecordsEntry) ProtoMessage() {} + +func (x *PlayerFile_RecordsEntry) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *PlayerFile_RecordsEntry) GetValue() *StoredRecord { + if x != nil { + return x.Value + } + return nil +} + +func (m *RecordType) CloneVT() *RecordType { + if m == nil { + return (*RecordType)(nil) + } + r := new(RecordType) + r.Name = m.Name + r.Writers = m.Writers + r.Fields = protobuf_go_lite.CloneVTMap(m.Fields) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *RecordType) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *Field) CloneVT() *Field { + if m == nil { + return (*Field)(nil) + } + r := new(Field) + r.Kind = m.Kind + r.MaxBytes = m.MaxBytes + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *Field) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *Value) CloneVT() *Value { + if m == nil { + return (*Value)(nil) + } + r := new(Value) + if m.Value != nil { + r.Value = m.Value.(interface{ CloneOneofVT() isValue_Value }).CloneOneofVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *Value) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *Value_Number) CloneVT() *Value_Number { + if m == nil { + return (*Value_Number)(nil) + } + r := new(Value_Number) + r.Number = m.Number + return r +} + +func (m *Value_Number) CloneOneofVT() isValue_Value { + return m.CloneVT() +} + +func (m *Value_Text) CloneVT() *Value_Text { + if m == nil { + return (*Value_Text)(nil) + } + r := new(Value_Text) + r.Text = m.Text + return r +} + +func (m *Value_Text) CloneOneofVT() isValue_Value { + return m.CloneVT() +} + +func (m *Value_Tags) CloneVT() *Value_Tags { + if m == nil { + return (*Value_Tags)(nil) + } + r := new(Value_Tags) + r.Tags = protobuf_go_lite.CloneVTValue(m.Tags) + return r +} + +func (m *Value_Tags) CloneOneofVT() isValue_Value { + return m.CloneVT() +} + +func (m *Tags) CloneVT() *Tags { + if m == nil { + return (*Tags)(nil) + } + r := new(Tags) + r.Members = protobuf_go_lite.CloneSlice(m.Members) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *Tags) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *Record) CloneVT() *Record { + if m == nil { + return (*Record)(nil) + } + r := new(Record) + r.Fields = protobuf_go_lite.CloneVTMap(m.Fields) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *Record) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *Op) CloneVT() *Op { + if m == nil { + return (*Op)(nil) + } + r := new(Op) + r.Field = m.Field + if m.Op != nil { + r.Op = m.Op.(interface{ CloneOneofVT() isOp_Op }).CloneOneofVT() + } + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *Op) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *Op_Add) CloneVT() *Op_Add { + if m == nil { + return (*Op_Add)(nil) + } + r := new(Op_Add) + r.Add = m.Add + return r +} + +func (m *Op_Add) CloneOneofVT() isOp_Op { + return m.CloneVT() +} + +func (m *Op_Max) CloneVT() *Op_Max { + if m == nil { + return (*Op_Max)(nil) + } + r := new(Op_Max) + r.Max = m.Max + return r +} + +func (m *Op_Max) CloneOneofVT() isOp_Op { + return m.CloneVT() +} + +func (m *Op_Min) CloneVT() *Op_Min { + if m == nil { + return (*Op_Min)(nil) + } + r := new(Op_Min) + r.Min = m.Min + return r +} + +func (m *Op_Min) CloneOneofVT() isOp_Op { + return m.CloneVT() +} + +func (m *Op_Set) CloneVT() *Op_Set { + if m == nil { + return (*Op_Set)(nil) + } + r := new(Op_Set) + r.Set = protobuf_go_lite.CloneVTValue(m.Set) + return r +} + +func (m *Op_Set) CloneOneofVT() isOp_Op { + return m.CloneVT() +} + +func (m *Op_Insert) CloneVT() *Op_Insert { + if m == nil { + return (*Op_Insert)(nil) + } + r := new(Op_Insert) + r.Insert = m.Insert + return r +} + +func (m *Op_Insert) CloneOneofVT() isOp_Op { + return m.CloneVT() +} + +func (m *Op_Remove) CloneVT() *Op_Remove { + if m == nil { + return (*Op_Remove)(nil) + } + r := new(Op_Remove) + r.Remove = m.Remove + return r +} + +func (m *Op_Remove) CloneOneofVT() isOp_Op { + return m.CloneVT() +} + +func (m *GetRequest) CloneVT() *GetRequest { + if m == nil { + return (*GetRequest)(nil) + } + r := new(GetRequest) + r.Player = m.Player + r.Type = m.Type + r.Key = m.Key + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *GetRequest) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *GetReply) CloneVT() *GetReply { + if m == nil { + return (*GetReply)(nil) + } + r := new(GetReply) + r.Record = protobuf_go_lite.CloneVTValue(m.Record) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *GetReply) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *GetManyRequest) CloneVT() *GetManyRequest { + if m == nil { + return (*GetManyRequest)(nil) + } + r := new(GetManyRequest) + r.Type = m.Type + r.Players = protobuf_go_lite.CloneSlice(m.Players) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *GetManyRequest) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *GetManyReply) CloneVT() *GetManyReply { + if m == nil { + return (*GetManyReply)(nil) + } + r := new(GetManyReply) + r.Records = protobuf_go_lite.CloneVTSlice(m.Records) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *GetManyReply) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *PlayerRecord) CloneVT() *PlayerRecord { + if m == nil { + return (*PlayerRecord)(nil) + } + r := new(PlayerRecord) + r.Player = m.Player + r.Record = protobuf_go_lite.CloneVTValue(m.Record) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *PlayerRecord) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *UpdateRequest) CloneVT() *UpdateRequest { + if m == nil { + return (*UpdateRequest)(nil) + } + r := new(UpdateRequest) + r.Player = m.Player + r.Type = m.Type + r.Key = m.Key + r.UpdateKey = m.UpdateKey + r.Ops = protobuf_go_lite.CloneVTSlice(m.Ops) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *UpdateRequest) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *UpdateReply) CloneVT() *UpdateReply { + if m == nil { + return (*UpdateReply)(nil) + } + r := new(UpdateReply) + r.Repeated = m.Repeated + r.Record = protobuf_go_lite.CloneVTValue(m.Record) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *UpdateReply) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *StoredRecord) CloneVT() *StoredRecord { + if m == nil { + return (*StoredRecord)(nil) + } + r := new(StoredRecord) + r.Version = m.Version + r.Record = protobuf_go_lite.CloneVTValue(m.Record) + r.RecentKeys = protobuf_go_lite.CloneSlice(m.RecentKeys) + r.Kinds = protobuf_go_lite.CloneMap(m.Kinds) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *StoredRecord) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *PlayerFile) CloneVT() *PlayerFile { + if m == nil { + return (*PlayerFile)(nil) + } + r := new(PlayerFile) + r.SteamId = m.SteamId + r.Records = protobuf_go_lite.CloneVTMap(m.Records) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *PlayerFile) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (this *RecordType) EqualVT(that *RecordType) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.Writers != that.Writers { + return false + } + if !protobuf_go_lite.EqualVTMapImplicit(this.Fields, that.Fields, func() *Field { return &Field{} }) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *RecordType) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*RecordType) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *Field) EqualVT(that *Field) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Kind != that.Kind { + return false + } + if this.MaxBytes != that.MaxBytes { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Field) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*Field) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *Value) EqualVT(that *Value) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Value == nil && that.Value != nil { + return false + } else if this.Value != nil { + if that.Value == nil { + return false + } + if !this.Value.(interface{ EqualVT(isValue_Value) bool }).EqualVT(that.Value) { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Value) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*Value) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *Value_Number) EqualVT(thatIface isValue_Value) bool { + that, ok := thatIface.(*Value_Number) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Number != that.Number { + return false + } + return true +} + +func (this *Value_Text) EqualVT(thatIface isValue_Value) bool { + that, ok := thatIface.(*Value_Text) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Text != that.Text { + return false + } + return true +} + +func (this *Value_Tags) EqualVT(thatIface isValue_Value) bool { + that, ok := thatIface.(*Value_Tags) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if !protobuf_go_lite.EqualVTImplicit(this.Tags, that.Tags, func() *Tags { return &Tags{} }) { + return false + } + return true +} + +func (this *Tags) EqualVT(that *Tags) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !protobuf_go_lite.EqualSlice(this.Members, that.Members) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Tags) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*Tags) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *Record) EqualVT(that *Record) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !protobuf_go_lite.EqualVTMapImplicit(this.Fields, that.Fields, func() *Value { return &Value{} }) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Record) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*Record) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *Op) EqualVT(that *Op) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Op == nil && that.Op != nil { + return false + } else if this.Op != nil { + if that.Op == nil { + return false + } + if !this.Op.(interface{ EqualVT(isOp_Op) bool }).EqualVT(that.Op) { + return false + } + } + if this.Field != that.Field { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Op) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*Op) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *Op_Add) EqualVT(thatIface isOp_Op) bool { + that, ok := thatIface.(*Op_Add) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Add != that.Add { + return false + } + return true +} + +func (this *Op_Max) EqualVT(thatIface isOp_Op) bool { + that, ok := thatIface.(*Op_Max) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Max != that.Max { + return false + } + return true +} + +func (this *Op_Min) EqualVT(thatIface isOp_Op) bool { + that, ok := thatIface.(*Op_Min) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Min != that.Min { + return false + } + return true +} + +func (this *Op_Set) EqualVT(thatIface isOp_Op) bool { + that, ok := thatIface.(*Op_Set) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if !protobuf_go_lite.EqualVTImplicit(this.Set, that.Set, func() *Value { return &Value{} }) { + return false + } + return true +} + +func (this *Op_Insert) EqualVT(thatIface isOp_Op) bool { + that, ok := thatIface.(*Op_Insert) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Insert != that.Insert { + return false + } + return true +} + +func (this *Op_Remove) EqualVT(thatIface isOp_Op) bool { + that, ok := thatIface.(*Op_Remove) + if !ok { + return false + } + if this == that { + return true + } + if this == nil && that != nil || this != nil && that == nil { + return false + } + if this.Remove != that.Remove { + return false + } + return true +} + +func (this *GetRequest) EqualVT(that *GetRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Player != that.Player { + return false + } + if this.Type != that.Type { + return false + } + if this.Key != that.Key { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *GetRequest) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*GetRequest) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *GetReply) EqualVT(that *GetReply) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !protobuf_go_lite.IsEqualVT(this.Record, that.Record) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *GetReply) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*GetReply) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *GetManyRequest) EqualVT(that *GetManyRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !protobuf_go_lite.EqualSlice(this.Players, that.Players) { + return false + } + if this.Type != that.Type { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *GetManyRequest) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*GetManyRequest) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *GetManyReply) EqualVT(that *GetManyReply) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !protobuf_go_lite.EqualVTSliceImplicit(this.Records, that.Records, func() *PlayerRecord { return &PlayerRecord{} }) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *GetManyReply) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*GetManyReply) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *PlayerRecord) EqualVT(that *PlayerRecord) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Player != that.Player { + return false + } + if !protobuf_go_lite.IsEqualVT(this.Record, that.Record) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *PlayerRecord) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*PlayerRecord) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *UpdateRequest) EqualVT(that *UpdateRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Player != that.Player { + return false + } + if this.Type != that.Type { + return false + } + if this.Key != that.Key { + return false + } + if !protobuf_go_lite.EqualVTSliceImplicit(this.Ops, that.Ops, func() *Op { return &Op{} }) { + return false + } + if this.UpdateKey != that.UpdateKey { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UpdateRequest) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*UpdateRequest) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *UpdateReply) EqualVT(that *UpdateReply) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !protobuf_go_lite.IsEqualVT(this.Record, that.Record) { + return false + } + if this.Repeated != that.Repeated { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *UpdateReply) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*UpdateReply) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *StoredRecord) EqualVT(that *StoredRecord) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !protobuf_go_lite.IsEqualVT(this.Record, that.Record) { + return false + } + if !protobuf_go_lite.EqualSlice(this.RecentKeys, that.RecentKeys) { + return false + } + if this.Version != that.Version { + return false + } + if !protobuf_go_lite.EqualMap(this.Kinds, that.Kinds) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *StoredRecord) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*StoredRecord) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *PlayerFile) EqualVT(that *PlayerFile) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.SteamId != that.SteamId { + return false + } + if !protobuf_go_lite.EqualVTMapImplicit(this.Records, that.Records, func() *StoredRecord { return &StoredRecord{} }) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *PlayerFile) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*PlayerFile) + if !ok { + return false + } + return this.EqualVT(that) +} + +// MarshalProtoJSON marshals the Writers to JSON. +func (x Writers) MarshalProtoJSON(s *json.MarshalState) { + s.WriteEnum(int32(x), Writers_name) +} + +// MarshalText marshals the Writers to text. +func (x Writers) MarshalText() ([]byte, error) { + return []byte(json.GetEnumString(int32(x), Writers_name)), nil +} + +// MarshalJSON marshals the Writers to JSON. +func (x Writers) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the Writers from JSON. +func (x *Writers) UnmarshalProtoJSON(s *json.UnmarshalState) { + v := s.ReadEnum(Writers_value) + if err := s.Err(); err != nil { + s.SetErrorf("could not read Writers enum: %v", err) + return + } + *x = Writers(v) +} + +// UnmarshalText unmarshals the Writers from text. +func (x *Writers) UnmarshalText(b []byte) error { + i, err := json.ParseEnumString(string(b), Writers_value) + if err != nil { + return err + } + *x = Writers(i) + return nil +} + +// UnmarshalJSON unmarshals the Writers from JSON. +func (x *Writers) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the RecordType_FieldsEntry message to JSON. +func (x *RecordType_FieldsEntry) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Key != "" || s.HasField("key") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("key") + s.WriteString(x.Key) + } + if x.Value != nil || s.HasField("value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("value") + x.Value.MarshalProtoJSON(s.WithField("value")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the RecordType_FieldsEntry to JSON. +func (x *RecordType_FieldsEntry) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the RecordType_FieldsEntry message from JSON. +func (x *RecordType_FieldsEntry) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "key": + s.AddField("key") + x.Key = s.ReadString() + case "value": + if s.ReadNil() { + x.Value = nil + return + } + x.Value = &Field{} + x.Value.UnmarshalProtoJSON(s.WithField("value", true)) + } + }) +} + +// UnmarshalJSON unmarshals the RecordType_FieldsEntry from JSON. +func (x *RecordType_FieldsEntry) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the RecordType message to JSON. +func (x *RecordType) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Name != "" || s.HasField("name") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("name") + s.WriteString(x.Name) + } + if x.Writers != 0 || s.HasField("writers") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("writers") + x.Writers.MarshalProtoJSON(s) + } + if x.Fields != nil || s.HasField("fields") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fields") + s.WriteObjectStart() + var wroteElement bool + for _, k := range slices.Sorted(maps.Keys(x.Fields)) { + v := x.Fields[k] + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + v.MarshalProtoJSON(s.WithField("fields")) + } + s.WriteObjectEnd() + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the RecordType to JSON. +func (x *RecordType) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the RecordType message from JSON. +func (x *RecordType) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "name": + s.AddField("name") + x.Name = s.ReadString() + case "writers": + s.AddField("writers") + x.Writers.UnmarshalProtoJSON(s) + case "fields": + s.AddField("fields") + if s.ReadNil() { + x.Fields = nil + return + } + x.Fields = make(map[string]*Field) + s.ReadStringMap(func(key string) { + var v Field + v.UnmarshalProtoJSON(s) + x.Fields[key] = &v + }) + } + }) +} + +// UnmarshalJSON unmarshals the RecordType from JSON. +func (x *RecordType) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the Field_Kind to JSON. +func (x Field_Kind) MarshalProtoJSON(s *json.MarshalState) { + s.WriteEnum(int32(x), Field_Kind_name) +} + +// MarshalText marshals the Field_Kind to text. +func (x Field_Kind) MarshalText() ([]byte, error) { + return []byte(json.GetEnumString(int32(x), Field_Kind_name)), nil +} + +// MarshalJSON marshals the Field_Kind to JSON. +func (x Field_Kind) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the Field_Kind from JSON. +func (x *Field_Kind) UnmarshalProtoJSON(s *json.UnmarshalState) { + v := s.ReadEnum(Field_Kind_value) + if err := s.Err(); err != nil { + s.SetErrorf("could not read Kind enum: %v", err) + return + } + *x = Field_Kind(v) +} + +// UnmarshalText unmarshals the Field_Kind from text. +func (x *Field_Kind) UnmarshalText(b []byte) error { + i, err := json.ParseEnumString(string(b), Field_Kind_value) + if err != nil { + return err + } + *x = Field_Kind(i) + return nil +} + +// UnmarshalJSON unmarshals the Field_Kind from JSON. +func (x *Field_Kind) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the Field message to JSON. +func (x *Field) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Kind != 0 || s.HasField("kind") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("kind") + x.Kind.MarshalProtoJSON(s) + } + if x.MaxBytes != 0 || s.HasField("maxBytes") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("maxBytes") + s.WriteUint32(x.MaxBytes) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the Field to JSON. +func (x *Field) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the Field message from JSON. +func (x *Field) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "kind": + s.AddField("kind") + x.Kind.UnmarshalProtoJSON(s) + case "max_bytes", "maxBytes": + s.AddField("max_bytes") + x.MaxBytes = s.ReadUint32() + } + }) +} + +// UnmarshalJSON unmarshals the Field from JSON. +func (x *Field) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the Value message to JSON. +func (x *Value) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Value != nil { + switch ov := x.Value.(type) { + case *Value_Number: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("number") + s.WriteFloat64(ov.Number) + case *Value_Text: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("text") + s.WriteString(ov.Text) + case *Value_Tags: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("tags") + ov.Tags.MarshalProtoJSON(s.WithField("tags")) + } + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the Value to JSON. +func (x *Value) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the Value message from JSON. +func (x *Value) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "number": + s.AddField("number") + ov := &Value_Number{} + x.Value = ov + ov.Number = s.ReadFloat64() + case "text": + s.AddField("text") + ov := &Value_Text{} + x.Value = ov + ov.Text = s.ReadString() + case "tags": + ov := &Value_Tags{} + x.Value = ov + if s.ReadNil() { + ov.Tags = nil + return + } + ov.Tags = &Tags{} + ov.Tags.UnmarshalProtoJSON(s.WithField("tags", true)) + } + }) +} + +// UnmarshalJSON unmarshals the Value from JSON. +func (x *Value) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the Tags message to JSON. +func (x *Tags) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if len(x.Members) > 0 || s.HasField("members") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("members") + s.WriteStringArray(x.Members) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the Tags to JSON. +func (x *Tags) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the Tags message from JSON. +func (x *Tags) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "members": + s.AddField("members") + if s.ReadNil() { + x.Members = nil + return + } + x.Members = s.ReadStringArray() + } + }) +} + +// UnmarshalJSON unmarshals the Tags from JSON. +func (x *Tags) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the Record_FieldsEntry message to JSON. +func (x *Record_FieldsEntry) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Key != "" || s.HasField("key") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("key") + s.WriteString(x.Key) + } + if x.Value != nil || s.HasField("value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("value") + x.Value.MarshalProtoJSON(s.WithField("value")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the Record_FieldsEntry to JSON. +func (x *Record_FieldsEntry) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the Record_FieldsEntry message from JSON. +func (x *Record_FieldsEntry) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "key": + s.AddField("key") + x.Key = s.ReadString() + case "value": + if s.ReadNil() { + x.Value = nil + return + } + x.Value = &Value{} + x.Value.UnmarshalProtoJSON(s.WithField("value", true)) + } + }) +} + +// UnmarshalJSON unmarshals the Record_FieldsEntry from JSON. +func (x *Record_FieldsEntry) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the Record message to JSON. +func (x *Record) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Fields != nil || s.HasField("fields") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fields") + s.WriteObjectStart() + var wroteElement bool + for _, k := range slices.Sorted(maps.Keys(x.Fields)) { + v := x.Fields[k] + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + v.MarshalProtoJSON(s.WithField("fields")) + } + s.WriteObjectEnd() + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the Record to JSON. +func (x *Record) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the Record message from JSON. +func (x *Record) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "fields": + s.AddField("fields") + if s.ReadNil() { + x.Fields = nil + return + } + x.Fields = make(map[string]*Value) + s.ReadStringMap(func(key string) { + var v Value + v.UnmarshalProtoJSON(s) + x.Fields[key] = &v + }) + } + }) +} + +// UnmarshalJSON unmarshals the Record from JSON. +func (x *Record) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the Op message to JSON. +func (x *Op) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Field != "" || s.HasField("field") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("field") + s.WriteString(x.Field) + } + if x.Op != nil { + switch ov := x.Op.(type) { + case *Op_Add: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("add") + s.WriteFloat64(ov.Add) + case *Op_Max: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("max") + s.WriteFloat64(ov.Max) + case *Op_Min: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("min") + s.WriteFloat64(ov.Min) + case *Op_Set: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("set") + ov.Set.MarshalProtoJSON(s.WithField("set")) + case *Op_Insert: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("insert") + s.WriteString(ov.Insert) + case *Op_Remove: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("remove") + s.WriteString(ov.Remove) + } + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the Op to JSON. +func (x *Op) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the Op message from JSON. +func (x *Op) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "field": + s.AddField("field") + x.Field = s.ReadString() + case "add": + s.AddField("add") + ov := &Op_Add{} + x.Op = ov + ov.Add = s.ReadFloat64() + case "max": + s.AddField("max") + ov := &Op_Max{} + x.Op = ov + ov.Max = s.ReadFloat64() + case "min": + s.AddField("min") + ov := &Op_Min{} + x.Op = ov + ov.Min = s.ReadFloat64() + case "set": + ov := &Op_Set{} + x.Op = ov + if s.ReadNil() { + ov.Set = nil + return + } + ov.Set = &Value{} + ov.Set.UnmarshalProtoJSON(s.WithField("set", true)) + case "insert": + s.AddField("insert") + ov := &Op_Insert{} + x.Op = ov + ov.Insert = s.ReadString() + case "remove": + s.AddField("remove") + ov := &Op_Remove{} + x.Op = ov + ov.Remove = s.ReadString() + } + }) +} + +// UnmarshalJSON unmarshals the Op from JSON. +func (x *Op) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the GetRequest message to JSON. +func (x *GetRequest) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Player != 0 || s.HasField("player") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("player") + s.WriteInt32(x.Player) + } + if x.Type != "" || s.HasField("type") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("type") + s.WriteString(x.Type) + } + if x.Key != "" || s.HasField("key") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("key") + s.WriteString(x.Key) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the GetRequest to JSON. +func (x *GetRequest) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the GetRequest message from JSON. +func (x *GetRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "player": + s.AddField("player") + x.Player = s.ReadInt32() + case "type": + s.AddField("type") + x.Type = s.ReadString() + case "key": + s.AddField("key") + x.Key = s.ReadString() + } + }) +} + +// UnmarshalJSON unmarshals the GetRequest from JSON. +func (x *GetRequest) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the GetReply message to JSON. +func (x *GetReply) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Record != nil || s.HasField("record") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("record") + x.Record.MarshalProtoJSON(s.WithField("record")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the GetReply to JSON. +func (x *GetReply) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the GetReply message from JSON. +func (x *GetReply) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "record": + if s.ReadNil() { + x.Record = nil + return + } + x.Record = &Record{} + x.Record.UnmarshalProtoJSON(s.WithField("record", true)) + } + }) +} + +// UnmarshalJSON unmarshals the GetReply from JSON. +func (x *GetReply) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the GetManyRequest message to JSON. +func (x *GetManyRequest) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if len(x.Players) > 0 || s.HasField("players") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("players") + s.WriteInt32Array(x.Players) + } + if x.Type != "" || s.HasField("type") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("type") + s.WriteString(x.Type) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the GetManyRequest to JSON. +func (x *GetManyRequest) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the GetManyRequest message from JSON. +func (x *GetManyRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "players": + s.AddField("players") + if s.ReadNil() { + x.Players = nil + return + } + x.Players = s.ReadInt32Array() + case "type": + s.AddField("type") + x.Type = s.ReadString() + } + }) +} + +// UnmarshalJSON unmarshals the GetManyRequest from JSON. +func (x *GetManyRequest) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the GetManyReply message to JSON. +func (x *GetManyReply) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if len(x.Records) > 0 || s.HasField("records") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("records") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Records { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("records")) + } + s.WriteArrayEnd() + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the GetManyReply to JSON. +func (x *GetManyReply) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the GetManyReply message from JSON. +func (x *GetManyReply) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "records": + s.AddField("records") + if s.ReadNil() { + x.Records = nil + return + } + s.ReadArray(func() { + if s.ReadNil() { + x.Records = append(x.Records, nil) + return + } + v := &PlayerRecord{} + v.UnmarshalProtoJSON(s.WithField("records", false)) + if s.Err() != nil { + return + } + x.Records = append(x.Records, v) + }) + } + }) +} + +// UnmarshalJSON unmarshals the GetManyReply from JSON. +func (x *GetManyReply) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the PlayerRecord message to JSON. +func (x *PlayerRecord) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Player != 0 || s.HasField("player") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("player") + s.WriteInt32(x.Player) + } + if x.Record != nil || s.HasField("record") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("record") + x.Record.MarshalProtoJSON(s.WithField("record")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the PlayerRecord to JSON. +func (x *PlayerRecord) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the PlayerRecord message from JSON. +func (x *PlayerRecord) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "player": + s.AddField("player") + x.Player = s.ReadInt32() + case "record": + if s.ReadNil() { + x.Record = nil + return + } + x.Record = &Record{} + x.Record.UnmarshalProtoJSON(s.WithField("record", true)) + } + }) +} + +// UnmarshalJSON unmarshals the PlayerRecord from JSON. +func (x *PlayerRecord) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the UpdateRequest message to JSON. +func (x *UpdateRequest) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Player != 0 || s.HasField("player") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("player") + s.WriteInt32(x.Player) + } + if x.Type != "" || s.HasField("type") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("type") + s.WriteString(x.Type) + } + if x.Key != "" || s.HasField("key") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("key") + s.WriteString(x.Key) + } + if len(x.Ops) > 0 || s.HasField("ops") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("ops") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Ops { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("ops")) + } + s.WriteArrayEnd() + } + if x.UpdateKey != "" || s.HasField("updateKey") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("updateKey") + s.WriteString(x.UpdateKey) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the UpdateRequest to JSON. +func (x *UpdateRequest) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the UpdateRequest message from JSON. +func (x *UpdateRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "player": + s.AddField("player") + x.Player = s.ReadInt32() + case "type": + s.AddField("type") + x.Type = s.ReadString() + case "key": + s.AddField("key") + x.Key = s.ReadString() + case "ops": + s.AddField("ops") + if s.ReadNil() { + x.Ops = nil + return + } + s.ReadArray(func() { + if s.ReadNil() { + x.Ops = append(x.Ops, nil) + return + } + v := &Op{} + v.UnmarshalProtoJSON(s.WithField("ops", false)) + if s.Err() != nil { + return + } + x.Ops = append(x.Ops, v) + }) + case "update_key", "updateKey": + s.AddField("update_key") + x.UpdateKey = s.ReadString() + } + }) +} + +// UnmarshalJSON unmarshals the UpdateRequest from JSON. +func (x *UpdateRequest) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the UpdateReply message to JSON. +func (x *UpdateReply) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Record != nil || s.HasField("record") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("record") + x.Record.MarshalProtoJSON(s.WithField("record")) + } + if x.Repeated || s.HasField("repeated") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("repeated") + s.WriteBool(x.Repeated) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the UpdateReply to JSON. +func (x *UpdateReply) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the UpdateReply message from JSON. +func (x *UpdateReply) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "record": + if s.ReadNil() { + x.Record = nil + return + } + x.Record = &Record{} + x.Record.UnmarshalProtoJSON(s.WithField("record", true)) + case "repeated": + s.AddField("repeated") + x.Repeated = s.ReadBool() + } + }) +} + +// UnmarshalJSON unmarshals the UpdateReply from JSON. +func (x *UpdateReply) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the StoredRecord_KindsEntry message to JSON. +func (x *StoredRecord_KindsEntry) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Key != "" || s.HasField("key") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("key") + s.WriteString(x.Key) + } + if x.Value != 0 || s.HasField("value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("value") + x.Value.MarshalProtoJSON(s) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the StoredRecord_KindsEntry to JSON. +func (x *StoredRecord_KindsEntry) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the StoredRecord_KindsEntry message from JSON. +func (x *StoredRecord_KindsEntry) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "key": + s.AddField("key") + x.Key = s.ReadString() + case "value": + s.AddField("value") + x.Value.UnmarshalProtoJSON(s) + } + }) +} + +// UnmarshalJSON unmarshals the StoredRecord_KindsEntry from JSON. +func (x *StoredRecord_KindsEntry) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the StoredRecord message to JSON. +func (x *StoredRecord) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Record != nil || s.HasField("record") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("record") + x.Record.MarshalProtoJSON(s.WithField("record")) + } + if len(x.RecentKeys) > 0 || s.HasField("recentKeys") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("recentKeys") + s.WriteStringArray(x.RecentKeys) + } + if x.Version != 0 || s.HasField("version") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("version") + s.WriteUint64(x.Version) + } + if x.Kinds != nil || s.HasField("kinds") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("kinds") + s.WriteObjectStart() + var wroteElement bool + for _, k := range slices.Sorted(maps.Keys(x.Kinds)) { + v := x.Kinds[k] + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + v.MarshalProtoJSON(s) + } + s.WriteObjectEnd() + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the StoredRecord to JSON. +func (x *StoredRecord) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the StoredRecord message from JSON. +func (x *StoredRecord) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "record": + if s.ReadNil() { + x.Record = nil + return + } + x.Record = &Record{} + x.Record.UnmarshalProtoJSON(s.WithField("record", true)) + case "recent_keys", "recentKeys": + s.AddField("recent_keys") + if s.ReadNil() { + x.RecentKeys = nil + return + } + x.RecentKeys = s.ReadStringArray() + case "version": + s.AddField("version") + x.Version = s.ReadUint64() + case "kinds": + s.AddField("kinds") + if s.ReadNil() { + x.Kinds = nil + return + } + x.Kinds = make(map[string]Field_Kind) + s.ReadStringMap(func(key string) { + var v Field_Kind + v.UnmarshalProtoJSON(s) + x.Kinds[key] = v + }) + } + }) +} + +// UnmarshalJSON unmarshals the StoredRecord from JSON. +func (x *StoredRecord) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the PlayerFile_RecordsEntry message to JSON. +func (x *PlayerFile_RecordsEntry) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Key != "" || s.HasField("key") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("key") + s.WriteString(x.Key) + } + if x.Value != nil || s.HasField("value") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("value") + x.Value.MarshalProtoJSON(s.WithField("value")) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the PlayerFile_RecordsEntry to JSON. +func (x *PlayerFile_RecordsEntry) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the PlayerFile_RecordsEntry message from JSON. +func (x *PlayerFile_RecordsEntry) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "key": + s.AddField("key") + x.Key = s.ReadString() + case "value": + if s.ReadNil() { + x.Value = nil + return + } + x.Value = &StoredRecord{} + x.Value.UnmarshalProtoJSON(s.WithField("value", true)) + } + }) +} + +// UnmarshalJSON unmarshals the PlayerFile_RecordsEntry from JSON. +func (x *PlayerFile_RecordsEntry) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the PlayerFile message to JSON. +func (x *PlayerFile) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.SteamId != 0 || s.HasField("steamId") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("steamId") + s.WriteUint64(x.SteamId) + } + if x.Records != nil || s.HasField("records") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("records") + s.WriteObjectStart() + var wroteElement bool + for _, k := range slices.Sorted(maps.Keys(x.Records)) { + v := x.Records[k] + s.WriteMoreIf(&wroteElement) + s.WriteObjectStringField(k) + v.MarshalProtoJSON(s.WithField("records")) + } + s.WriteObjectEnd() + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the PlayerFile to JSON. +func (x *PlayerFile) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the PlayerFile message from JSON. +func (x *PlayerFile) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "steam_id", "steamId": + s.AddField("steam_id") + x.SteamId = s.ReadUint64() + case "records": + s.AddField("records") + if s.ReadNil() { + x.Records = nil + return + } + x.Records = make(map[string]*StoredRecord) + s.ReadStringMap(func(key string) { + var v StoredRecord + v.UnmarshalProtoJSON(s) + x.Records[key] = &v + }) + } + }) +} + +// UnmarshalJSON unmarshals the PlayerFile from JSON. +func (x *PlayerFile) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +func (m *RecordType) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RecordType) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RecordType) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if len(m.Fields) > 0 { + for k := range m.Fields { + v := m.Fields[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i = protobuf_go_lite.EncodeString(dAtA, i, k) + i-- + dAtA[i] = 0xa + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if m.Writers != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Writers)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Name) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Field) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Field) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Field) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if m.MaxBytes != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.MaxBytes)) + i-- + dAtA[i] = 0x10 + } + if m.Kind != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Kind)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Value) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Value) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if vtmsg, ok := m.Value.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + return len(dAtA) - i, nil +} + +func (m *Value_Number) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value_Number) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i = protobuf_go_lite.EncodeFixed64(dAtA, i, uint64(math.Float64bits(float64(m.Number)))) + i-- + dAtA[i] = 0x9 + return len(dAtA) - i, nil +} + +func (m *Value_Text) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value_Text) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i = protobuf_go_lite.EncodeString(dAtA, i, m.Text) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} + +func (m *Value_Tags) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Value_Tags) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Tags != nil { + size, err := m.Tags.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } else { + i = protobuf_go_lite.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} + +func (m *Tags) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Tags) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Tags) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if len(m.Members) > 0 { + for iNdEx := len(m.Members) - 1; iNdEx >= 0; iNdEx-- { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Members[iNdEx]) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Record) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Record) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Record) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if len(m.Fields) > 0 { + for k := range m.Fields { + v := m.Fields[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i = protobuf_go_lite.EncodeString(dAtA, i, k) + i-- + dAtA[i] = 0xa + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Op) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Op) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Op) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if vtmsg, ok := m.Op.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + } + if len(m.Field) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Field) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Op_Add) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Op_Add) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i = protobuf_go_lite.EncodeFixed64(dAtA, i, uint64(math.Float64bits(float64(m.Add)))) + i-- + dAtA[i] = 0x11 + return len(dAtA) - i, nil +} + +func (m *Op_Max) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Op_Max) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i = protobuf_go_lite.EncodeFixed64(dAtA, i, uint64(math.Float64bits(float64(m.Max)))) + i-- + dAtA[i] = 0x19 + return len(dAtA) - i, nil +} + +func (m *Op_Min) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Op_Min) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i = protobuf_go_lite.EncodeFixed64(dAtA, i, uint64(math.Float64bits(float64(m.Min)))) + i-- + dAtA[i] = 0x21 + return len(dAtA) - i, nil +} + +func (m *Op_Set) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Op_Set) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Set != nil { + size, err := m.Set.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } else { + i = protobuf_go_lite.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} + +func (m *Op_Insert) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Op_Insert) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i = protobuf_go_lite.EncodeString(dAtA, i, m.Insert) + i-- + dAtA[i] = 0x32 + return len(dAtA) - i, nil +} + +func (m *Op_Remove) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Op_Remove) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + i = protobuf_go_lite.EncodeString(dAtA, i, m.Remove) + i-- + dAtA[i] = 0x3a + return len(dAtA) - i, nil +} + +func (m *GetRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if len(m.Key) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Key) + i-- + dAtA[i] = 0x1a + } + if len(m.Type) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Type) + i-- + dAtA[i] = 0x12 + } + if m.Player != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Player)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetReply) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetReply) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetReply) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if m.Record != nil { + size, err := m.Record.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetManyRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetManyRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetManyRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if len(m.Type) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Type) + i-- + dAtA[i] = 0x12 + } + if len(m.Players) > 0 { + i = protobuf_go_lite.EncodeVarintPacked(dAtA, i, m.Players) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetManyReply) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetManyReply) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetManyReply) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if len(m.Records) > 0 { + for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Records[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PlayerRecord) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PlayerRecord) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PlayerRecord) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if m.Record != nil { + size, err := m.Record.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Player != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Player)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UpdateRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if len(m.UpdateKey) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.UpdateKey) + i-- + dAtA[i] = 0x2a + } + if len(m.Ops) > 0 { + for iNdEx := len(m.Ops) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Ops[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Key) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Key) + i-- + dAtA[i] = 0x1a + } + if len(m.Type) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Type) + i-- + dAtA[i] = 0x12 + } + if m.Player != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Player)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UpdateReply) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateReply) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateReply) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if m.Repeated { + i = protobuf_go_lite.EncodeBool(dAtA, i, m.Repeated) + i-- + dAtA[i] = 0x10 + } + if m.Record != nil { + size, err := m.Record.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StoredRecord) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StoredRecord) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StoredRecord) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if len(m.Kinds) > 0 { + for k := range m.Kinds { + v := m.Kinds[k] + baseI := i + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i = protobuf_go_lite.EncodeString(dAtA, i, k) + i-- + dAtA[i] = 0xa + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if m.Version != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x18 + } + if len(m.RecentKeys) > 0 { + for iNdEx := len(m.RecentKeys) - 1; iNdEx >= 0; iNdEx-- { + i = protobuf_go_lite.EncodeString(dAtA, i, m.RecentKeys[iNdEx]) + i-- + dAtA[i] = 0x12 + } + } + if m.Record != nil { + size, err := m.Record.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PlayerFile) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PlayerFile) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PlayerFile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + } + if len(m.Records) > 0 { + for k := range m.Records { + v := m.Records[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i = protobuf_go_lite.EncodeString(dAtA, i, k) + i-- + dAtA[i] = 0xa + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.SteamId != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.SteamId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *RecordType) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Name) + n += protobuf_go_lite.SizeVarintNonZero(1, m.Writers) + for k, v := range m.Fields { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + mapEntrySize := protobuf_go_lite.SizeStringValue(1, k) + protobuf_go_lite.SizeMessage(1, l) + n += protobuf_go_lite.SizeMessage(1, mapEntrySize) + } + n += len(m.unknownFields) + return n +} + +func (m *Field) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeVarintNonZero(1, m.Kind) + n += protobuf_go_lite.SizeVarintNonZero(1, m.MaxBytes) + n += len(m.unknownFields) + return n +} + +func (m *Value) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Value.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *Value_Number) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeFixed64Value(1) + return n +} + +func (m *Value_Text) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringValue(1, m.Text) + return n +} + +func (m *Value_Tags) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Tags != nil { + l = m.Tags.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } else { + n += 2 + } + return n +} + +func (m *Tags) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringSlice(1, m.Members) + n += len(m.unknownFields) + return n +} + +func (m *Record) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + for k, v := range m.Fields { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + mapEntrySize := protobuf_go_lite.SizeStringValue(1, k) + protobuf_go_lite.SizeMessage(1, l) + n += protobuf_go_lite.SizeMessage(1, mapEntrySize) + } + n += len(m.unknownFields) + return n +} + +func (m *Op) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Field) + if vtmsg, ok := m.Op.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *Op_Add) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeFixed64Value(1) + return n +} + +func (m *Op_Max) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeFixed64Value(1) + return n +} + +func (m *Op_Min) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeFixed64Value(1) + return n +} + +func (m *Op_Set) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Set != nil { + l = m.Set.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } else { + n += 2 + } + return n +} + +func (m *Op_Insert) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringValue(1, m.Insert) + return n +} + +func (m *Op_Remove) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringValue(1, m.Remove) + return n +} + +func (m *GetRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeVarintNonZero(1, m.Player) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Type) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Key) + n += len(m.unknownFields) + return n +} + +func (m *GetReply) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Record != nil { + l = m.Record.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } + n += len(m.unknownFields) + return n +} + +func (m *GetManyRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeVarintPacked(1, m.Players) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Type) + n += len(m.unknownFields) + return n +} + +func (m *GetManyReply) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + for _, e := range m.Records { + l = e.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } + n += len(m.unknownFields) + return n +} + +func (m *PlayerRecord) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeVarintNonZero(1, m.Player) + if m.Record != nil { + l = m.Record.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } + n += len(m.unknownFields) + return n +} + +func (m *UpdateRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeVarintNonZero(1, m.Player) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Type) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Key) + for _, e := range m.Ops { + l = e.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } + n += protobuf_go_lite.SizeStringNonEmpty(1, m.UpdateKey) + n += len(m.unknownFields) + return n +} + +func (m *UpdateReply) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Record != nil { + l = m.Record.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } + n += protobuf_go_lite.SizeBoolNonZero(1, m.Repeated) + n += len(m.unknownFields) + return n +} + +func (m *StoredRecord) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Record != nil { + l = m.Record.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } + n += protobuf_go_lite.SizeStringSlice(1, m.RecentKeys) + n += protobuf_go_lite.SizeVarintNonZero(1, m.Version) + for k, v := range m.Kinds { + _ = k + _ = v + mapEntrySize := protobuf_go_lite.SizeStringValue(1, k) + protobuf_go_lite.SizeVarintValue(1, v) + n += protobuf_go_lite.SizeMessage(1, mapEntrySize) + } + n += len(m.unknownFields) + return n +} + +func (m *PlayerFile) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeVarintNonZero(1, m.SteamId) + for k, v := range m.Records { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + mapEntrySize := protobuf_go_lite.SizeStringValue(1, k) + protobuf_go_lite.SizeMessage(1, l) + n += protobuf_go_lite.SizeMessage(1, mapEntrySize) + } + n += len(m.unknownFields) + return n +} + +func (x Writers) MarshalProtoText() string { + return x.String() +} + +func (x *RecordType_FieldsEntry) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "FieldsEntry") + if x.Key != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "key") + protobuf_go_lite.TextWriteString(&sb, x.Key) + } + if x.Value != nil { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "value") + protobuf_go_lite.TextWriteTextMarshaler(&sb, x.Value) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *RecordType_FieldsEntry) String() string { + return x.MarshalProtoText() +} + +func (x *RecordType) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "RecordType") + if x.Name != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "name") + protobuf_go_lite.TextWriteString(&sb, x.Name) + } + if x.Writers != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "writers") + protobuf_go_lite.TextWriteStringer(&sb, Writers(x.Writers)) + } + if len(x.Fields) > 0 { + protobuf_go_lite.TextWriteMapStart(&sb, initialLen, "fields") + for _, k := range slices.Sorted(maps.Keys(x.Fields)) { + v := x.Fields[k] + protobuf_go_lite.TextWriteMapEntryPrefix(&sb) + protobuf_go_lite.TextWriteString(&sb, k) + protobuf_go_lite.TextWriteMapKeyValueSeparator(&sb) + if v == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &Field{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, v) + } + } + protobuf_go_lite.TextWriteMapEnd(&sb) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *RecordType) String() string { + return x.MarshalProtoText() +} + +func (x Field_Kind) MarshalProtoText() string { + return x.String() +} + +func (x *Field) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "Field") + if x.Kind != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "kind") + protobuf_go_lite.TextWriteStringer(&sb, Field_Kind(x.Kind)) + } + if x.MaxBytes != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "max_bytes") + protobuf_go_lite.TextWriteUint(&sb, x.MaxBytes) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *Field) String() string { + return x.MarshalProtoText() +} + +func (x *Value) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "Value") + switch body := x.Value.(type) { + case *Value_Number: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "number") + protobuf_go_lite.TextWriteFloat64(&sb, body.Number) + case *Value_Text: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "text") + protobuf_go_lite.TextWriteString(&sb, body.Text) + case *Value_Tags: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "tags") + if body.Tags == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &Tags{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, body.Tags) + } + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *Value) String() string { + return x.MarshalProtoText() +} + +func (x *Tags) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "Tags") + if len(x.Members) > 0 { + protobuf_go_lite.TextWriteListStart(&sb, initialLen, "members") + for i, v := range x.Members { + protobuf_go_lite.TextWriteListSeparator(&sb, i) + protobuf_go_lite.TextWriteString(&sb, v) + } + protobuf_go_lite.TextWriteListEnd(&sb) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *Tags) String() string { + return x.MarshalProtoText() +} + +func (x *Record_FieldsEntry) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "FieldsEntry") + if x.Key != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "key") + protobuf_go_lite.TextWriteString(&sb, x.Key) + } + if x.Value != nil { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "value") + protobuf_go_lite.TextWriteTextMarshaler(&sb, x.Value) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *Record_FieldsEntry) String() string { + return x.MarshalProtoText() +} + +func (x *Record) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "Record") + if len(x.Fields) > 0 { + protobuf_go_lite.TextWriteMapStart(&sb, initialLen, "fields") + for _, k := range slices.Sorted(maps.Keys(x.Fields)) { + v := x.Fields[k] + protobuf_go_lite.TextWriteMapEntryPrefix(&sb) + protobuf_go_lite.TextWriteString(&sb, k) + protobuf_go_lite.TextWriteMapKeyValueSeparator(&sb) + if v == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &Value{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, v) + } + } + protobuf_go_lite.TextWriteMapEnd(&sb) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *Record) String() string { + return x.MarshalProtoText() +} + +func (x *Op) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "Op") + if x.Field != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "field") + protobuf_go_lite.TextWriteString(&sb, x.Field) + } + switch body := x.Op.(type) { + case *Op_Add: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "add") + protobuf_go_lite.TextWriteFloat64(&sb, body.Add) + case *Op_Max: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "max") + protobuf_go_lite.TextWriteFloat64(&sb, body.Max) + case *Op_Min: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "min") + protobuf_go_lite.TextWriteFloat64(&sb, body.Min) + case *Op_Set: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "set") + if body.Set == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &Value{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, body.Set) + } + case *Op_Insert: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "insert") + protobuf_go_lite.TextWriteString(&sb, body.Insert) + case *Op_Remove: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "remove") + protobuf_go_lite.TextWriteString(&sb, body.Remove) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *Op) String() string { + return x.MarshalProtoText() +} + +func (x *GetRequest) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "GetRequest") + if x.Player != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "player") + protobuf_go_lite.TextWriteInt(&sb, x.Player) + } + if x.Type != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "type") + protobuf_go_lite.TextWriteString(&sb, x.Type) + } + if x.Key != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "key") + protobuf_go_lite.TextWriteString(&sb, x.Key) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *GetRequest) String() string { + return x.MarshalProtoText() +} + +func (x *GetReply) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "GetReply") + if x.Record != nil { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "record") + protobuf_go_lite.TextWriteTextMarshaler(&sb, x.Record) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *GetReply) String() string { + return x.MarshalProtoText() +} + +func (x *GetManyRequest) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "GetManyRequest") + if len(x.Players) > 0 { + protobuf_go_lite.TextWriteListStart(&sb, initialLen, "players") + for i, v := range x.Players { + protobuf_go_lite.TextWriteListSeparator(&sb, i) + protobuf_go_lite.TextWriteInt(&sb, v) + } + protobuf_go_lite.TextWriteListEnd(&sb) + } + if x.Type != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "type") + protobuf_go_lite.TextWriteString(&sb, x.Type) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *GetManyRequest) String() string { + return x.MarshalProtoText() +} + +func (x *GetManyReply) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "GetManyReply") + if len(x.Records) > 0 { + protobuf_go_lite.TextWriteListStart(&sb, initialLen, "records") + for i, v := range x.Records { + protobuf_go_lite.TextWriteListSeparator(&sb, i) + if v == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &PlayerRecord{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, v) + } + } + protobuf_go_lite.TextWriteListEnd(&sb) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *GetManyReply) String() string { + return x.MarshalProtoText() +} + +func (x *PlayerRecord) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "PlayerRecord") + if x.Player != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "player") + protobuf_go_lite.TextWriteInt(&sb, x.Player) + } + if x.Record != nil { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "record") + protobuf_go_lite.TextWriteTextMarshaler(&sb, x.Record) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *PlayerRecord) String() string { + return x.MarshalProtoText() +} + +func (x *UpdateRequest) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "UpdateRequest") + if x.Player != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "player") + protobuf_go_lite.TextWriteInt(&sb, x.Player) + } + if x.Type != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "type") + protobuf_go_lite.TextWriteString(&sb, x.Type) + } + if x.Key != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "key") + protobuf_go_lite.TextWriteString(&sb, x.Key) + } + if len(x.Ops) > 0 { + protobuf_go_lite.TextWriteListStart(&sb, initialLen, "ops") + for i, v := range x.Ops { + protobuf_go_lite.TextWriteListSeparator(&sb, i) + if v == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &Op{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, v) + } + } + protobuf_go_lite.TextWriteListEnd(&sb) + } + if x.UpdateKey != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "update_key") + protobuf_go_lite.TextWriteString(&sb, x.UpdateKey) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *UpdateRequest) String() string { + return x.MarshalProtoText() +} + +func (x *UpdateReply) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "UpdateReply") + if x.Record != nil { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "record") + protobuf_go_lite.TextWriteTextMarshaler(&sb, x.Record) + } + if x.Repeated != false { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "repeated") + protobuf_go_lite.TextWriteBool(&sb, x.Repeated) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *UpdateReply) String() string { + return x.MarshalProtoText() +} + +func (x *StoredRecord_KindsEntry) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "KindsEntry") + if x.Key != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "key") + protobuf_go_lite.TextWriteString(&sb, x.Key) + } + if x.Value != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "value") + protobuf_go_lite.TextWriteStringer(&sb, Field_Kind(x.Value)) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *StoredRecord_KindsEntry) String() string { + return x.MarshalProtoText() +} + +func (x *StoredRecord) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "StoredRecord") + if x.Record != nil { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "record") + protobuf_go_lite.TextWriteTextMarshaler(&sb, x.Record) + } + if len(x.RecentKeys) > 0 { + protobuf_go_lite.TextWriteListStart(&sb, initialLen, "recent_keys") + for i, v := range x.RecentKeys { + protobuf_go_lite.TextWriteListSeparator(&sb, i) + protobuf_go_lite.TextWriteString(&sb, v) + } + protobuf_go_lite.TextWriteListEnd(&sb) + } + if x.Version != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "version") + protobuf_go_lite.TextWriteUint(&sb, x.Version) + } + if len(x.Kinds) > 0 { + protobuf_go_lite.TextWriteMapStart(&sb, initialLen, "kinds") + for _, k := range slices.Sorted(maps.Keys(x.Kinds)) { + v := x.Kinds[k] + protobuf_go_lite.TextWriteMapEntryPrefix(&sb) + protobuf_go_lite.TextWriteString(&sb, k) + protobuf_go_lite.TextWriteMapKeyValueSeparator(&sb) + protobuf_go_lite.TextWriteStringer(&sb, Field_Kind(v)) + } + protobuf_go_lite.TextWriteMapEnd(&sb) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *StoredRecord) String() string { + return x.MarshalProtoText() +} + +func (x *PlayerFile_RecordsEntry) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "RecordsEntry") + if x.Key != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "key") + protobuf_go_lite.TextWriteString(&sb, x.Key) + } + if x.Value != nil { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "value") + protobuf_go_lite.TextWriteTextMarshaler(&sb, x.Value) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *PlayerFile_RecordsEntry) String() string { + return x.MarshalProtoText() +} + +func (x *PlayerFile) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "PlayerFile") + if x.SteamId != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "steam_id") + protobuf_go_lite.TextWriteUint(&sb, x.SteamId) + } + if len(x.Records) > 0 { + protobuf_go_lite.TextWriteMapStart(&sb, initialLen, "records") + for _, k := range slices.Sorted(maps.Keys(x.Records)) { + v := x.Records[k] + protobuf_go_lite.TextWriteMapEntryPrefix(&sb) + protobuf_go_lite.TextWriteString(&sb, k) + protobuf_go_lite.TextWriteMapKeyValueSeparator(&sb) + if v == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &StoredRecord{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, v) + } + } + protobuf_go_lite.TextWriteMapEnd(&sb) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *PlayerFile) String() string { + return x.MarshalProtoText() +} + +func (m *RecordType) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RecordType: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RecordType: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Name = v + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Writers", wireType) + } + m.Writers = 0 + var _v uint64 + _v, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + m.Writers = Writers(_v) + if err != nil { + return err + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + iNdEx = msgStart + if m.Fields == nil { + m.Fields = make(map[string]*Field) + } + var mapkey string + var mapvalue *Field + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + mapkey, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + } else if fieldNum == 2 { + msgStartmapvalue, postmsgIndexmapvalue, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + mapvalue = &Field{} + if err := mapvalue.UnmarshalVT(dAtA[msgStartmapvalue:postmsgIndexmapvalue]); err != nil { + return err + } + iNdEx = postmsgIndexmapvalue + } else { + iNdEx = entryPreIndex + iNdEx, err = protobuf_go_lite.SkipWithin(dAtA, iNdEx, postIndex) + if err != nil { + return err + } + } + } + m.Fields[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *Field) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Field: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Field: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + m.Kind = 0 + var _v uint64 + _v, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + m.Kind = Field_Kind(_v) + if err != nil { + return err + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) + } + m.MaxBytes = 0 + m.MaxBytes, iNdEx, err = protobuf_go_lite.DecodeVarintUint32(dAtA, iNdEx) + if err != nil { + return err + } + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *Value) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Value: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Value: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + var v uint64 + var _v64 uint64 + _v64, iNdEx, err = protobuf_go_lite.DecodeFixed64(dAtA, iNdEx) + if err != nil { + return err + } + v = uint64(_v64) + m.Value = &Value_Number{Number: float64(math.Float64frombits(v))} + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Value = &Value_Text{Text: v} + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Value.(*Value_Tags); ok { + if err := oneof.Tags.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &Tags{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Value = &Value_Tags{Tags: v} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *Tags) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Tags: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Tags: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Members = append(m.Members, v) + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *Record) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Record: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Record: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + iNdEx = msgStart + if m.Fields == nil { + m.Fields = make(map[string]*Value) + } + var mapkey string + var mapvalue *Value + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + mapkey, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + } else if fieldNum == 2 { + msgStartmapvalue, postmsgIndexmapvalue, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + mapvalue = &Value{} + if err := mapvalue.UnmarshalVT(dAtA[msgStartmapvalue:postmsgIndexmapvalue]); err != nil { + return err + } + iNdEx = postmsgIndexmapvalue + } else { + iNdEx = entryPreIndex + iNdEx, err = protobuf_go_lite.SkipWithin(dAtA, iNdEx, postIndex) + if err != nil { + return err + } + } + } + m.Fields[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *Op) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Op: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Op: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Field = v + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Add", wireType) + } + var v uint64 + var _v64 uint64 + _v64, iNdEx, err = protobuf_go_lite.DecodeFixed64(dAtA, iNdEx) + if err != nil { + return err + } + v = uint64(_v64) + m.Op = &Op_Add{Add: float64(math.Float64frombits(v))} + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType) + } + var v uint64 + var _v64 uint64 + _v64, iNdEx, err = protobuf_go_lite.DecodeFixed64(dAtA, iNdEx) + if err != nil { + return err + } + v = uint64(_v64) + m.Op = &Op_Max{Max: float64(math.Float64frombits(v))} + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Min", wireType) + } + var v uint64 + var _v64 uint64 + _v64, iNdEx, err = protobuf_go_lite.DecodeFixed64(dAtA, iNdEx) + if err != nil { + return err + } + v = uint64(_v64) + m.Op = &Op_Min{Min: float64(math.Float64frombits(v))} + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Op.(*Op_Set); ok { + if err := oneof.Set.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &Value{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Op = &Op_Set{Set: v} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Insert", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Op = &Op_Insert{Insert: v} + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Remove", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Op = &Op_Remove{Remove: v} + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *GetRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Player", wireType) + } + m.Player = 0 + m.Player, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + if err != nil { + return err + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Type = v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Key = v + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *GetReply) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if m.Record == nil { + m.Record = &Record{} + } + if err := m.Record.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *GetManyRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetManyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetManyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType == 0 { + var v int32 + v, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + if err != nil { + return err + } + m.Players = append(m.Players, v) + } else if wireType == 2 { + packedStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + iNdEx = packedStart + var elementCount int + elementCount = protobuf_go_lite.PackedVarintElementCount(dAtA[iNdEx:postIndex]) + if elementCount != 0 && len(m.Players) == 0 { + m.Players = make([]int32, 0, elementCount) + } + for iNdEx < postIndex { + var v int32 + v, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + if err != nil { + return err + } + m.Players = append(m.Players, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field Players", wireType) + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Type = v + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *GetManyReply) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetManyReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetManyReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + m.Records = append(m.Records, &PlayerRecord{}) + if err := m.Records[len(m.Records)-1].UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *PlayerRecord) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PlayerRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PlayerRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Player", wireType) + } + m.Player = 0 + m.Player, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + if err != nil { + return err + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if m.Record == nil { + m.Record = &Record{} + } + if err := m.Record.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *UpdateRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Player", wireType) + } + m.Player = 0 + m.Player, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + if err != nil { + return err + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Type = v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Key = v + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ops", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + m.Ops = append(m.Ops, &Op{}) + if err := m.Ops[len(m.Ops)-1].UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UpdateKey", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.UpdateKey = v + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *UpdateReply) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateReply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateReply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if m.Record == nil { + m.Record = &Record{} + } + if err := m.Record.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Repeated", wireType) + } + var v bool + v, iNdEx, err = protobuf_go_lite.DecodeVarintBool(dAtA, iNdEx) + if err != nil { + return err + } + m.Repeated = bool(v) + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *StoredRecord) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StoredRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoredRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if m.Record == nil { + m.Record = &Record{} + } + if err := m.Record.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentKeys", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.RecentKeys = append(m.RecentKeys, v) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + m.Version, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kinds", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + iNdEx = msgStart + if m.Kinds == nil { + m.Kinds = make(map[string]Field_Kind) + } + var mapkey string + var mapvalue Field_Kind + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + mapkey, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + } else if fieldNum == 2 { + var _v uint64 + _v, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + mapvalue = Field_Kind(_v) + if err != nil { + return err + } + } else { + iNdEx = entryPreIndex + iNdEx, err = protobuf_go_lite.SkipWithin(dAtA, iNdEx, postIndex) + if err != nil { + return err + } + } + } + m.Kinds[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *PlayerFile) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + var err error + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PlayerFile: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PlayerFile: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SteamId", wireType) + } + m.SteamId = 0 + m.SteamId, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + iNdEx = msgStart + if m.Records == nil { + m.Records = make(map[string]*StoredRecord) + } + var mapkey string + var mapvalue *StoredRecord + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + wire, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + if err != nil { + return err + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + mapkey, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + } else if fieldNum == 2 { + msgStartmapvalue, postmsgIndexmapvalue, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + mapvalue = &StoredRecord{} + if err := mapvalue.UnmarshalVT(dAtA[msgStartmapvalue:postmsgIndexmapvalue]); err != nil { + return err + } + iNdEx = postmsgIndexmapvalue + } else { + iNdEx = entryPreIndex + iNdEx, err = protobuf_go_lite.SkipWithin(dAtA, iNdEx, postIndex) + if err != nil { + return err + } + } + } + m.Records[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protobuf_go_lite.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/src/wasm/persist/persist.pb.h b/src/wasm/persist/persist.pb.h new file mode 100644 index 00000000..a5b9876d --- /dev/null +++ b/src/wasm/persist/persist.pb.h @@ -0,0 +1,6021 @@ +//go:build deps_only && cgo + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: github.com/paralin/modlock/src/wasm/persist/persist.proto +// Protobuf C++ Version: 6.33.4 + +#ifndef github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto_2epb_2eh +#define github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto_2epb_2eh + +#include +#include +#include +#include + +#include "google/protobuf/runtime_version.h" +#if PROTOBUF_VERSION != 6033004 +#error "Protobuf C++ gencode is built with an incompatible version of" +#error "Protobuf C++ headers/runtime. See" +#error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp" +#endif +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/arena.h" +#include "google/protobuf/arenastring.h" +#include "google/protobuf/generated_message_tctable_decl.h" +#include "google/protobuf/generated_message_util.h" +#include "google/protobuf/metadata_lite.h" +#include "google/protobuf/generated_message_reflection.h" +#include "google/protobuf/message.h" +#include "google/protobuf/message_lite.h" +#include "google/protobuf/repeated_field.h" // IWYU pragma: export +#include "google/protobuf/extension_set.h" // IWYU pragma: export +#include "google/protobuf/map.h" // IWYU pragma: export +#include "google/protobuf/map_type_handler.h" // IWYU pragma: export +#include "google/protobuf/map_entry.h" +#include "google/protobuf/map_field.h" +#include "google/protobuf/generated_enum_reflection.h" +#include "google/protobuf/unknown_field_set.h" +// @@protoc_insertion_point(includes) + +// Must be included last. +#include "google/protobuf/port_def.inc" + +#define PROTOBUF_INTERNAL_EXPORT_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto MODLOCK_API + +namespace google { +namespace protobuf { +namespace internal { +template +::absl::string_view GetAnyMessageName(); +} // namespace internal +} // namespace protobuf +} // namespace google + +// Internal implementation detail -- do not use these members. +struct MODLOCK_API TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto { + static const ::uint32_t offsets[]; +}; +extern "C" { +MODLOCK_API extern const ::google::protobuf::internal::DescriptorTable descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +} // extern "C" +namespace modlock { +namespace wasm { +namespace persist { +enum Field_Kind : int; +extern const uint32_t Field_Kind_internal_data_[]; +enum Writers : int; +extern const uint32_t Writers_internal_data_[]; +class Field; +struct FieldDefaultTypeInternal; +MODLOCK_API extern FieldDefaultTypeInternal _Field_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Field_class_data_; +class GetManyReply; +struct GetManyReplyDefaultTypeInternal; +MODLOCK_API extern GetManyReplyDefaultTypeInternal _GetManyReply_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull GetManyReply_class_data_; +class GetManyRequest; +struct GetManyRequestDefaultTypeInternal; +MODLOCK_API extern GetManyRequestDefaultTypeInternal _GetManyRequest_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull GetManyRequest_class_data_; +class GetReply; +struct GetReplyDefaultTypeInternal; +MODLOCK_API extern GetReplyDefaultTypeInternal _GetReply_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull GetReply_class_data_; +class GetRequest; +struct GetRequestDefaultTypeInternal; +MODLOCK_API extern GetRequestDefaultTypeInternal _GetRequest_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull GetRequest_class_data_; +class Op; +struct OpDefaultTypeInternal; +MODLOCK_API extern OpDefaultTypeInternal _Op_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Op_class_data_; +class PlayerFile; +struct PlayerFileDefaultTypeInternal; +MODLOCK_API extern PlayerFileDefaultTypeInternal _PlayerFile_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull PlayerFile_class_data_; +class PlayerFile_RecordsEntry_DoNotUse; +struct PlayerFile_RecordsEntry_DoNotUseDefaultTypeInternal; +MODLOCK_API extern PlayerFile_RecordsEntry_DoNotUseDefaultTypeInternal _PlayerFile_RecordsEntry_DoNotUse_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull PlayerFile_RecordsEntry_DoNotUse_class_data_; +class PlayerRecord; +struct PlayerRecordDefaultTypeInternal; +MODLOCK_API extern PlayerRecordDefaultTypeInternal _PlayerRecord_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull PlayerRecord_class_data_; +class Record; +struct RecordDefaultTypeInternal; +MODLOCK_API extern RecordDefaultTypeInternal _Record_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Record_class_data_; +class RecordType; +struct RecordTypeDefaultTypeInternal; +MODLOCK_API extern RecordTypeDefaultTypeInternal _RecordType_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull RecordType_class_data_; +class RecordType_FieldsEntry_DoNotUse; +struct RecordType_FieldsEntry_DoNotUseDefaultTypeInternal; +MODLOCK_API extern RecordType_FieldsEntry_DoNotUseDefaultTypeInternal _RecordType_FieldsEntry_DoNotUse_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull RecordType_FieldsEntry_DoNotUse_class_data_; +class Record_FieldsEntry_DoNotUse; +struct Record_FieldsEntry_DoNotUseDefaultTypeInternal; +MODLOCK_API extern Record_FieldsEntry_DoNotUseDefaultTypeInternal _Record_FieldsEntry_DoNotUse_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Record_FieldsEntry_DoNotUse_class_data_; +class StoredRecord; +struct StoredRecordDefaultTypeInternal; +MODLOCK_API extern StoredRecordDefaultTypeInternal _StoredRecord_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull StoredRecord_class_data_; +class StoredRecord_KindsEntry_DoNotUse; +struct StoredRecord_KindsEntry_DoNotUseDefaultTypeInternal; +MODLOCK_API extern StoredRecord_KindsEntry_DoNotUseDefaultTypeInternal _StoredRecord_KindsEntry_DoNotUse_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull StoredRecord_KindsEntry_DoNotUse_class_data_; +class Tags; +struct TagsDefaultTypeInternal; +MODLOCK_API extern TagsDefaultTypeInternal _Tags_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Tags_class_data_; +class UpdateReply; +struct UpdateReplyDefaultTypeInternal; +MODLOCK_API extern UpdateReplyDefaultTypeInternal _UpdateReply_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull UpdateReply_class_data_; +class UpdateRequest; +struct UpdateRequestDefaultTypeInternal; +MODLOCK_API extern UpdateRequestDefaultTypeInternal _UpdateRequest_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull UpdateRequest_class_data_; +class Value; +struct ValueDefaultTypeInternal; +MODLOCK_API extern ValueDefaultTypeInternal _Value_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Value_class_data_; +} // namespace persist +} // namespace wasm +} // namespace modlock +namespace google { +namespace protobuf { +template <> +internal::EnumTraitsT<::modlock::wasm::persist::Field_Kind_internal_data_> + internal::EnumTraitsImpl::value<::modlock::wasm::persist::Field_Kind>; +template <> +internal::EnumTraitsT<::modlock::wasm::persist::Writers_internal_data_> + internal::EnumTraitsImpl::value<::modlock::wasm::persist::Writers>; +} // namespace protobuf +} // namespace google + +namespace modlock { +namespace wasm { +namespace persist { +enum Field_Kind : int { + Field_Kind_KIND_UNKNOWN = 0, + Field_Kind_KIND_COUNT = 1, + Field_Kind_KIND_NUMBER = 2, + Field_Kind_KIND_MAX = 3, + Field_Kind_KIND_STRING = 4, + Field_Kind_KIND_TAGS = 5, + Field_Kind_Field_Kind_INT_MIN_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::min(), + Field_Kind_Field_Kind_INT_MAX_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::max(), +}; + +extern const uint32_t Field_Kind_internal_data_[]; +inline constexpr Field_Kind Field_Kind_Kind_MIN = + static_cast(0); +inline constexpr Field_Kind Field_Kind_Kind_MAX = + static_cast(5); +inline bool Field_Kind_IsValid(int value) { + return 0 <= value && value <= 5; +} +inline constexpr int Field_Kind_Kind_ARRAYSIZE = 5 + 1; +const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL Field_Kind_descriptor(); +template +const ::std::string& Field_Kind_Name(T value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to Kind_Name()."); + return Field_Kind_Name(static_cast(value)); +} +template <> +inline const ::std::string& Field_Kind_Name(Field_Kind value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool Field_Kind_Parse( + ::absl::string_view name, Field_Kind* PROTOBUF_NONNULL value) { + return ::google::protobuf::internal::ParseNamedEnum(Field_Kind_descriptor(), name, + value); +} +enum Writers : int { + WRITERS_UNKNOWN = 0, + WRITERS_SERVERS = 1, + WRITERS_PLAYERS = 2, + Writers_INT_MIN_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::min(), + Writers_INT_MAX_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::max(), +}; + +extern const uint32_t Writers_internal_data_[]; +inline constexpr Writers Writers_MIN = + static_cast(0); +inline constexpr Writers Writers_MAX = + static_cast(2); +inline bool Writers_IsValid(int value) { + return 0 <= value && value <= 2; +} +inline constexpr int Writers_ARRAYSIZE = 2 + 1; +const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL Writers_descriptor(); +template +const ::std::string& Writers_Name(T value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to Writers_Name()."); + return Writers_Name(static_cast(value)); +} +template <> +inline const ::std::string& Writers_Name(Writers value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool Writers_Parse( + ::absl::string_view name, Writers* PROTOBUF_NONNULL value) { + return ::google::protobuf::internal::ParseNamedEnum(Writers_descriptor(), name, + value); +} + +// =================================================================== + + +// ------------------------------------------------------------------- + +class MODLOCK_API Tags final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.Tags) */ { + public: + inline Tags() : Tags(nullptr) {} + ~Tags() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(Tags* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Tags)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR Tags(::google::protobuf::internal::ConstantInitialized); + + inline Tags(const Tags& from) : Tags(nullptr, from) {} + inline Tags(Tags&& from) noexcept + : Tags(nullptr, ::std::move(from)) {} + inline Tags& operator=(const Tags& from) { + CopyFrom(from); + return *this; + } + inline Tags& operator=(Tags&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Tags& default_instance() { + return *reinterpret_cast( + &_Tags_default_instance_); + } + static constexpr int kIndexInFileMessages = 4; + friend void swap(Tags& a, Tags& b) { a.Swap(&b); } + inline void Swap(Tags* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Tags* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Tags* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Tags& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const Tags& from) { Tags::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(Tags* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.Tags"; } + + explicit Tags(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Tags(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Tags& from); + Tags( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Tags&& from) noexcept + : Tags(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kMembersFieldNumber = 1, + }; + // repeated string members = 1; + int members_size() const; + private: + int _internal_members_size() const; + + public: + void clear_members() ; + const ::std::string& members(int index) const; + ::std::string* PROTOBUF_NONNULL mutable_members(int index); + template + void set_members(int index, Arg_&& value, Args_... args); + ::std::string* PROTOBUF_NONNULL add_members(); + template + void add_members(Arg_&& value, Args_... args); + const ::google::protobuf::RepeatedPtrField<::std::string>& members() const; + ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL mutable_members(); + + private: + const ::google::protobuf::RepeatedPtrField<::std::string>& _internal_members() const; + ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL _internal_mutable_members(); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.Tags) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 1, + 0, 41, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const Tags& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedPtrField<::std::string> members_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Tags_class_data_; +// ------------------------------------------------------------------- + +class StoredRecord_KindsEntry_DoNotUse final + : public ::google::protobuf::internal::MapEntry<::std::string, ::modlock::wasm::persist::Field_Kind, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_ENUM> { + public: + using SuperType = + ::google::protobuf::internal::MapEntry<::std::string, ::modlock::wasm::persist::Field_Kind, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>; + StoredRecord_KindsEntry_DoNotUse(); + template + explicit PROTOBUF_CONSTEXPR StoredRecord_KindsEntry_DoNotUse(::google::protobuf::internal::ConstantInitialized); + explicit StoredRecord_KindsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr const void* PROTOBUF_NONNULL internal_default_instance() { + return &_StoredRecord_KindsEntry_DoNotUse_default_instance_; + } + + + static constexpr auto InternalGenerateClassData_(); + + private: + friend class ::google::protobuf::MessageLite; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 0, 56, + 2> + _table_; + + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); +}; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull StoredRecord_KindsEntry_DoNotUse_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API GetRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.GetRequest) */ { + public: + inline GetRequest() : GetRequest(nullptr) {} + ~GetRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(GetRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(GetRequest)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR GetRequest(::google::protobuf::internal::ConstantInitialized); + + inline GetRequest(const GetRequest& from) : GetRequest(nullptr, from) {} + inline GetRequest(GetRequest&& from) noexcept + : GetRequest(nullptr, ::std::move(from)) {} + inline GetRequest& operator=(const GetRequest& from) { + CopyFrom(from); + return *this; + } + inline GetRequest& operator=(GetRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GetRequest& default_instance() { + return *reinterpret_cast( + &_GetRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = 8; + friend void swap(GetRequest& a, GetRequest& b) { a.Swap(&b); } + inline void Swap(GetRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GetRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + GetRequest* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const GetRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const GetRequest& from) { GetRequest::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(GetRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.GetRequest"; } + + explicit GetRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + GetRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const GetRequest& from); + GetRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, GetRequest&& from) noexcept + : GetRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kTypeFieldNumber = 2, + kKeyFieldNumber = 3, + kPlayerFieldNumber = 1, + }; + // string type = 2; + void clear_type() ; + const ::std::string& type() const; + template + void set_type(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_type(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_type(); + void set_allocated_type(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_type() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_type(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_type(); + + public: + // string key = 3; + void clear_key() ; + const ::std::string& key() const; + template + void set_key(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_key(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_key(); + void set_allocated_key(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_key() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_key(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_key(); + + public: + // int32 player = 1; + void clear_player() ; + ::int32_t player() const; + void set_player(::int32_t value); + + private: + ::int32_t _internal_player() const; + void _internal_set_player(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.GetRequest) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 3, + 0, 47, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const GetRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::google::protobuf::internal::ArenaStringPtr key_; + ::int32_t player_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull GetRequest_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API GetManyRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.GetManyRequest) */ { + public: + inline GetManyRequest() : GetManyRequest(nullptr) {} + ~GetManyRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(GetManyRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(GetManyRequest)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR GetManyRequest(::google::protobuf::internal::ConstantInitialized); + + inline GetManyRequest(const GetManyRequest& from) : GetManyRequest(nullptr, from) {} + inline GetManyRequest(GetManyRequest&& from) noexcept + : GetManyRequest(nullptr, ::std::move(from)) {} + inline GetManyRequest& operator=(const GetManyRequest& from) { + CopyFrom(from); + return *this; + } + inline GetManyRequest& operator=(GetManyRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GetManyRequest& default_instance() { + return *reinterpret_cast( + &_GetManyRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = 10; + friend void swap(GetManyRequest& a, GetManyRequest& b) { a.Swap(&b); } + inline void Swap(GetManyRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GetManyRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + GetManyRequest* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const GetManyRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const GetManyRequest& from) { GetManyRequest::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(GetManyRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.GetManyRequest"; } + + explicit GetManyRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + GetManyRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const GetManyRequest& from); + GetManyRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, GetManyRequest&& from) noexcept + : GetManyRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kPlayersFieldNumber = 1, + kTypeFieldNumber = 2, + }; + // repeated int32 players = 1; + int players_size() const; + private: + int _internal_players_size() const; + + public: + void clear_players() ; + ::int32_t players(int index) const; + void set_players(int index, ::int32_t value); + void add_players(::int32_t value); + const ::google::protobuf::RepeatedField<::int32_t>& players() const; + ::google::protobuf::RepeatedField<::int32_t>* PROTOBUF_NONNULL mutable_players(); + + private: + const ::google::protobuf::RepeatedField<::int32_t>& _internal_players() const; + ::google::protobuf::RepeatedField<::int32_t>* PROTOBUF_NONNULL _internal_mutable_players(); + + public: + // string type = 2; + void clear_type() ; + const ::std::string& type() const; + template + void set_type(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_type(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_type(); + void set_allocated_type(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_type() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_type(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_type(); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.GetManyRequest) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 0, 48, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const GetManyRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedField<::int32_t> players_; + ::google::protobuf::internal::CachedSize _players_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr type_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull GetManyRequest_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API Field final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.Field) */ { + public: + inline Field() : Field(nullptr) {} + ~Field() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(Field* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Field)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR Field(::google::protobuf::internal::ConstantInitialized); + + inline Field(const Field& from) : Field(nullptr, from) {} + inline Field(Field&& from) noexcept + : Field(nullptr, ::std::move(from)) {} + inline Field& operator=(const Field& from) { + CopyFrom(from); + return *this; + } + inline Field& operator=(Field&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Field& default_instance() { + return *reinterpret_cast( + &_Field_default_instance_); + } + static constexpr int kIndexInFileMessages = 2; + friend void swap(Field& a, Field& b) { a.Swap(&b); } + inline void Swap(Field* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Field* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Field* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Field& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const Field& from) { Field::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(Field* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.Field"; } + + explicit Field(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Field(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Field& from); + Field( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Field&& from) noexcept + : Field(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + using Kind = Field_Kind; + static constexpr Kind KIND_UNKNOWN = Field_Kind_KIND_UNKNOWN; + static constexpr Kind KIND_COUNT = Field_Kind_KIND_COUNT; + static constexpr Kind KIND_NUMBER = Field_Kind_KIND_NUMBER; + static constexpr Kind KIND_MAX = Field_Kind_KIND_MAX; + static constexpr Kind KIND_STRING = Field_Kind_KIND_STRING; + static constexpr Kind KIND_TAGS = Field_Kind_KIND_TAGS; + static inline bool Kind_IsValid(int value) { + return Field_Kind_IsValid(value); + } + static constexpr Kind Kind_MIN = Field_Kind_Kind_MIN; + static constexpr Kind Kind_MAX = Field_Kind_Kind_MAX; + static constexpr int Kind_ARRAYSIZE = Field_Kind_Kind_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL Kind_descriptor() { + return Field_Kind_descriptor(); + } + template + static inline const ::std::string& Kind_Name(T value) { + return Field_Kind_Name(value); + } + static inline bool Kind_Parse( + ::absl::string_view name, Kind* PROTOBUF_NONNULL value) { + return Field_Kind_Parse(name, value); + } + + // accessors ------------------------------------------------------- + enum : int { + kKindFieldNumber = 1, + kMaxBytesFieldNumber = 2, + }; + // .modlock.wasm.persist.Field.Kind kind = 1; + void clear_kind() ; + ::modlock::wasm::persist::Field_Kind kind() const; + void set_kind(::modlock::wasm::persist::Field_Kind value); + + private: + ::modlock::wasm::persist::Field_Kind _internal_kind() const; + void _internal_set_kind(::modlock::wasm::persist::Field_Kind value); + + public: + // uint32 max_bytes = 2; + void clear_max_bytes() ; + ::uint32_t max_bytes() const; + void set_max_bytes(::uint32_t value); + + private: + ::uint32_t _internal_max_bytes() const; + void _internal_set_max_bytes(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.Field) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 0, 0, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const Field& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + int kind_; + ::uint32_t max_bytes_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Field_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API Value final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.Value) */ { + public: + inline Value() : Value(nullptr) {} + ~Value() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(Value* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Value)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR Value(::google::protobuf::internal::ConstantInitialized); + + inline Value(const Value& from) : Value(nullptr, from) {} + inline Value(Value&& from) noexcept + : Value(nullptr, ::std::move(from)) {} + inline Value& operator=(const Value& from) { + CopyFrom(from); + return *this; + } + inline Value& operator=(Value&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Value& default_instance() { + return *reinterpret_cast( + &_Value_default_instance_); + } + enum ValueCase { + kNumber = 1, + kText = 2, + kTags = 3, + VALUE_NOT_SET = 0, + }; + static constexpr int kIndexInFileMessages = 3; + friend void swap(Value& a, Value& b) { a.Swap(&b); } + inline void Swap(Value* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Value* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Value* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Value& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const Value& from) { Value::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(Value* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.Value"; } + + explicit Value(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Value(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Value& from); + Value( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Value&& from) noexcept + : Value(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kNumberFieldNumber = 1, + kTextFieldNumber = 2, + kTagsFieldNumber = 3, + }; + // double number = 1; + bool has_number() const; + void clear_number() ; + double number() const; + void set_number(double value); + + private: + double _internal_number() const; + void _internal_set_number(double value); + + public: + // string text = 2; + bool has_text() const; + void clear_text() ; + const ::std::string& text() const; + template + void set_text(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_text(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_text(); + void set_allocated_text(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_text() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_text(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_text(); + + public: + // .modlock.wasm.persist.Tags tags = 3; + bool has_tags() const; + private: + bool _internal_has_tags() const; + + public: + void clear_tags() ; + const ::modlock::wasm::persist::Tags& tags() const; + [[nodiscard]] ::modlock::wasm::persist::Tags* PROTOBUF_NULLABLE release_tags(); + ::modlock::wasm::persist::Tags* PROTOBUF_NONNULL mutable_tags(); + void set_allocated_tags(::modlock::wasm::persist::Tags* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_tags(::modlock::wasm::persist::Tags* PROTOBUF_NULLABLE value); + ::modlock::wasm::persist::Tags* PROTOBUF_NULLABLE unsafe_arena_release_tags(); + + private: + const ::modlock::wasm::persist::Tags& _internal_tags() const; + ::modlock::wasm::persist::Tags* PROTOBUF_NONNULL _internal_mutable_tags(); + + public: + void clear_value(); + ValueCase value_case() const; + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.Value) + private: + class _Internal; + void set_has_number(); + void set_has_text(); + void set_has_tags(); + inline bool has_value() const; + inline void clear_has_value(); + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 3, + 1, 39, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const Value& from_msg); + union ValueUnion { + constexpr ValueUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + double number_; + ::google::protobuf::internal::ArenaStringPtr text_; + ::modlock::wasm::persist::Tags* PROTOBUF_NULLABLE tags_; + } value_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Value_class_data_; +// ------------------------------------------------------------------- + +class RecordType_FieldsEntry_DoNotUse final + : public ::google::protobuf::internal::MapEntry<::std::string, ::google::protobuf::Message, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE> { + public: + using SuperType = + ::google::protobuf::internal::MapEntry<::std::string, ::google::protobuf::Message, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE>; + RecordType_FieldsEntry_DoNotUse(); + template + explicit PROTOBUF_CONSTEXPR RecordType_FieldsEntry_DoNotUse(::google::protobuf::internal::ConstantInitialized); + explicit RecordType_FieldsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr const void* PROTOBUF_NONNULL internal_default_instance() { + return &_RecordType_FieldsEntry_DoNotUse_default_instance_; + } + + + static constexpr auto InternalGenerateClassData_(); + + private: + friend class ::google::protobuf::MessageLite; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 1, 55, + 2> + _table_; + + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); +}; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull RecordType_FieldsEntry_DoNotUse_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API RecordType final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.RecordType) */ { + public: + inline RecordType() : RecordType(nullptr) {} + ~RecordType() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(RecordType* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(RecordType)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR RecordType(::google::protobuf::internal::ConstantInitialized); + + inline RecordType(const RecordType& from) : RecordType(nullptr, from) {} + inline RecordType(RecordType&& from) noexcept + : RecordType(nullptr, ::std::move(from)) {} + inline RecordType& operator=(const RecordType& from) { + CopyFrom(from); + return *this; + } + inline RecordType& operator=(RecordType&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const RecordType& default_instance() { + return *reinterpret_cast( + &_RecordType_default_instance_); + } + static constexpr int kIndexInFileMessages = 1; + friend void swap(RecordType& a, RecordType& b) { a.Swap(&b); } + inline void Swap(RecordType* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(RecordType* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + RecordType* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const RecordType& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const RecordType& from) { RecordType::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(RecordType* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.RecordType"; } + + explicit RecordType(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + RecordType(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const RecordType& from); + RecordType( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, RecordType&& from) noexcept + : RecordType(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kNameFieldNumber = 1, + kWritersFieldNumber = 2, + kFieldsFieldNumber = 3, + }; + // string name = 1; + void clear_name() ; + const ::std::string& name() const; + template + void set_name(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_name(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_name(); + void set_allocated_name(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_name() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_name(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_name(); + + public: + // .modlock.wasm.persist.Writers writers = 2; + void clear_writers() ; + ::modlock::wasm::persist::Writers writers() const; + void set_writers(::modlock::wasm::persist::Writers value); + + private: + ::modlock::wasm::persist::Writers _internal_writers() const; + void _internal_set_writers(::modlock::wasm::persist::Writers value); + + public: + // map fields = 3; + int fields_size() const; + private: + int _internal_fields_size() const; + + public: + void clear_fields() ; + const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field>& fields() const; + ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field>* PROTOBUF_NONNULL mutable_fields(); + + private: + const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field>& _internal_fields() const; + ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field>* PROTOBUF_NONNULL _internal_mutable_fields(); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.RecordType) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 3, + 2, 50, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const RecordType& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + int writers_; + ::google::protobuf::internal::MapField + fields_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull RecordType_class_data_; +// ------------------------------------------------------------------- + +class Record_FieldsEntry_DoNotUse final + : public ::google::protobuf::internal::MapEntry<::std::string, ::google::protobuf::Message, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE> { + public: + using SuperType = + ::google::protobuf::internal::MapEntry<::std::string, ::google::protobuf::Message, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE>; + Record_FieldsEntry_DoNotUse(); + template + explicit PROTOBUF_CONSTEXPR Record_FieldsEntry_DoNotUse(::google::protobuf::internal::ConstantInitialized); + explicit Record_FieldsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr const void* PROTOBUF_NONNULL internal_default_instance() { + return &_Record_FieldsEntry_DoNotUse_default_instance_; + } + + + static constexpr auto InternalGenerateClassData_(); + + private: + friend class ::google::protobuf::MessageLite; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 1, 51, + 2> + _table_; + + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); +}; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Record_FieldsEntry_DoNotUse_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API Op final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.Op) */ { + public: + inline Op() : Op(nullptr) {} + ~Op() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(Op* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Op)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR Op(::google::protobuf::internal::ConstantInitialized); + + inline Op(const Op& from) : Op(nullptr, from) {} + inline Op(Op&& from) noexcept + : Op(nullptr, ::std::move(from)) {} + inline Op& operator=(const Op& from) { + CopyFrom(from); + return *this; + } + inline Op& operator=(Op&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Op& default_instance() { + return *reinterpret_cast( + &_Op_default_instance_); + } + enum OpCase { + kAdd = 2, + kMax = 3, + kMin = 4, + kSet = 5, + kInsert = 6, + kRemove = 7, + OP_NOT_SET = 0, + }; + static constexpr int kIndexInFileMessages = 7; + friend void swap(Op& a, Op& b) { a.Swap(&b); } + inline void Swap(Op* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Op* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Op* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Op& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const Op& from) { Op::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(Op* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.Op"; } + + explicit Op(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Op(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Op& from); + Op( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Op&& from) noexcept + : Op(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kFieldFieldNumber = 1, + kAddFieldNumber = 2, + kMaxFieldNumber = 3, + kMinFieldNumber = 4, + kSetFieldNumber = 5, + kInsertFieldNumber = 6, + kRemoveFieldNumber = 7, + }; + // string field = 1; + void clear_field() ; + const ::std::string& field() const; + template + void set_field(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_field(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_field(); + void set_allocated_field(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_field() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_field(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_field(); + + public: + // double add = 2; + bool has_add() const; + void clear_add() ; + double add() const; + void set_add(double value); + + private: + double _internal_add() const; + void _internal_set_add(double value); + + public: + // double max = 3; + bool has_max() const; + void clear_max() ; + double max() const; + void set_max(double value); + + private: + double _internal_max() const; + void _internal_set_max(double value); + + public: + // double min = 4; + bool has_min() const; + void clear_min() ; + double min() const; + void set_min(double value); + + private: + double _internal_min() const; + void _internal_set_min(double value); + + public: + // .modlock.wasm.persist.Value set = 5; + bool has_set() const; + private: + bool _internal_has_set() const; + + public: + void clear_set() ; + const ::modlock::wasm::persist::Value& set() const; + [[nodiscard]] ::modlock::wasm::persist::Value* PROTOBUF_NULLABLE release_set(); + ::modlock::wasm::persist::Value* PROTOBUF_NONNULL mutable_set(); + void set_allocated_set(::modlock::wasm::persist::Value* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_set(::modlock::wasm::persist::Value* PROTOBUF_NULLABLE value); + ::modlock::wasm::persist::Value* PROTOBUF_NULLABLE unsafe_arena_release_set(); + + private: + const ::modlock::wasm::persist::Value& _internal_set() const; + ::modlock::wasm::persist::Value* PROTOBUF_NONNULL _internal_mutable_set(); + + public: + // string insert = 6; + bool has_insert() const; + void clear_insert() ; + const ::std::string& insert() const; + template + void set_insert(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_insert(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_insert(); + void set_allocated_insert(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_insert() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_insert(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_insert(); + + public: + // string remove = 7; + bool has_remove() const; + void clear_remove() ; + const ::std::string& remove() const; + template + void set_remove(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_remove(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_remove(); + void set_allocated_remove(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_remove() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_remove(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_remove(); + + public: + void clear_op(); + OpCase op_case() const; + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.Op) + private: + class _Internal; + void set_has_add(); + void set_has_max(); + void set_has_min(); + void set_has_set(); + void set_has_insert(); + void set_has_remove(); + inline bool has_op() const; + inline void clear_has_op(); + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 7, + 1, 49, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const Op& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr field_; + union OpUnion { + constexpr OpUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + double add_; + double max_; + double min_; + ::modlock::wasm::persist::Value* PROTOBUF_NULLABLE set_; + ::google::protobuf::internal::ArenaStringPtr insert_; + ::google::protobuf::internal::ArenaStringPtr remove_; + } op_; + ::uint32_t _oneof_case_[1]; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Op_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API UpdateRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.UpdateRequest) */ { + public: + inline UpdateRequest() : UpdateRequest(nullptr) {} + ~UpdateRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(UpdateRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(UpdateRequest)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR UpdateRequest(::google::protobuf::internal::ConstantInitialized); + + inline UpdateRequest(const UpdateRequest& from) : UpdateRequest(nullptr, from) {} + inline UpdateRequest(UpdateRequest&& from) noexcept + : UpdateRequest(nullptr, ::std::move(from)) {} + inline UpdateRequest& operator=(const UpdateRequest& from) { + CopyFrom(from); + return *this; + } + inline UpdateRequest& operator=(UpdateRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const UpdateRequest& default_instance() { + return *reinterpret_cast( + &_UpdateRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = 13; + friend void swap(UpdateRequest& a, UpdateRequest& b) { a.Swap(&b); } + inline void Swap(UpdateRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(UpdateRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + UpdateRequest* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const UpdateRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const UpdateRequest& from) { UpdateRequest::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(UpdateRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.UpdateRequest"; } + + explicit UpdateRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + UpdateRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const UpdateRequest& from); + UpdateRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, UpdateRequest&& from) noexcept + : UpdateRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kOpsFieldNumber = 4, + kTypeFieldNumber = 2, + kKeyFieldNumber = 3, + kUpdateKeyFieldNumber = 5, + kPlayerFieldNumber = 1, + }; + // repeated .modlock.wasm.persist.Op ops = 4; + int ops_size() const; + private: + int _internal_ops_size() const; + + public: + void clear_ops() ; + ::modlock::wasm::persist::Op* PROTOBUF_NONNULL mutable_ops(int index); + ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::Op>* PROTOBUF_NONNULL mutable_ops(); + + private: + const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::Op>& _internal_ops() const; + ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::Op>* PROTOBUF_NONNULL _internal_mutable_ops(); + public: + const ::modlock::wasm::persist::Op& ops(int index) const; + ::modlock::wasm::persist::Op* PROTOBUF_NONNULL add_ops(); + const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::Op>& ops() const; + // string type = 2; + void clear_type() ; + const ::std::string& type() const; + template + void set_type(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_type(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_type(); + void set_allocated_type(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_type() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_type(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_type(); + + public: + // string key = 3; + void clear_key() ; + const ::std::string& key() const; + template + void set_key(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_key(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_key(); + void set_allocated_key(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_key() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_key(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_key(); + + public: + // string update_key = 5; + void clear_update_key() ; + const ::std::string& update_key() const; + template + void set_update_key(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_update_key(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_update_key(); + void set_allocated_update_key(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_update_key() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_update_key(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_update_key(); + + public: + // int32 player = 1; + void clear_player() ; + ::int32_t player() const; + void set_player(::int32_t value); + + private: + ::int32_t _internal_player() const; + void _internal_set_player(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.UpdateRequest) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<3, 5, + 1, 60, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const UpdateRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedPtrField< ::modlock::wasm::persist::Op > ops_; + ::google::protobuf::internal::ArenaStringPtr type_; + ::google::protobuf::internal::ArenaStringPtr key_; + ::google::protobuf::internal::ArenaStringPtr update_key_; + ::int32_t player_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull UpdateRequest_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API Record final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.Record) */ { + public: + inline Record() : Record(nullptr) {} + ~Record() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(Record* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Record)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR Record(::google::protobuf::internal::ConstantInitialized); + + inline Record(const Record& from) : Record(nullptr, from) {} + inline Record(Record&& from) noexcept + : Record(nullptr, ::std::move(from)) {} + inline Record& operator=(const Record& from) { + CopyFrom(from); + return *this; + } + inline Record& operator=(Record&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Record& default_instance() { + return *reinterpret_cast( + &_Record_default_instance_); + } + static constexpr int kIndexInFileMessages = 6; + friend void swap(Record& a, Record& b) { a.Swap(&b); } + inline void Swap(Record* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Record* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Record* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Record& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const Record& from) { Record::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(Record* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.Record"; } + + explicit Record(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Record(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Record& from); + Record( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Record&& from) noexcept + : Record(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kFieldsFieldNumber = 1, + }; + // map fields = 1; + int fields_size() const; + private: + int _internal_fields_size() const; + + public: + void clear_fields() ; + const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Value>& fields() const; + ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Value>* PROTOBUF_NONNULL mutable_fields(); + + private: + const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Value>& _internal_fields() const; + ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Value>* PROTOBUF_NONNULL _internal_mutable_fields(); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.Record) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 1, + 2, 42, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const Record& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::MapField + fields_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Record_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API UpdateReply final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.UpdateReply) */ { + public: + inline UpdateReply() : UpdateReply(nullptr) {} + ~UpdateReply() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(UpdateReply* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(UpdateReply)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR UpdateReply(::google::protobuf::internal::ConstantInitialized); + + inline UpdateReply(const UpdateReply& from) : UpdateReply(nullptr, from) {} + inline UpdateReply(UpdateReply&& from) noexcept + : UpdateReply(nullptr, ::std::move(from)) {} + inline UpdateReply& operator=(const UpdateReply& from) { + CopyFrom(from); + return *this; + } + inline UpdateReply& operator=(UpdateReply&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const UpdateReply& default_instance() { + return *reinterpret_cast( + &_UpdateReply_default_instance_); + } + static constexpr int kIndexInFileMessages = 14; + friend void swap(UpdateReply& a, UpdateReply& b) { a.Swap(&b); } + inline void Swap(UpdateReply* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(UpdateReply* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + UpdateReply* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const UpdateReply& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const UpdateReply& from) { UpdateReply::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(UpdateReply* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.UpdateReply"; } + + explicit UpdateReply(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + UpdateReply(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const UpdateReply& from); + UpdateReply( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, UpdateReply&& from) noexcept + : UpdateReply(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kRecordFieldNumber = 1, + kRepeatedFieldNumber = 2, + }; + // .modlock.wasm.persist.Record record = 1; + bool has_record() const; + void clear_record() ; + const ::modlock::wasm::persist::Record& record() const; + [[nodiscard]] ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE release_record(); + ::modlock::wasm::persist::Record* PROTOBUF_NONNULL mutable_record(); + void set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value); + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE unsafe_arena_release_record(); + + private: + const ::modlock::wasm::persist::Record& _internal_record() const; + ::modlock::wasm::persist::Record* PROTOBUF_NONNULL _internal_mutable_record(); + + public: + // bool repeated = 2; + void clear_repeated() ; + bool repeated() const; + void set_repeated(bool value); + + private: + bool _internal_repeated() const; + void _internal_set_repeated(bool value); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.UpdateReply) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 1, 0, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const UpdateReply& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE record_; + bool repeated_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull UpdateReply_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API StoredRecord final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.StoredRecord) */ { + public: + inline StoredRecord() : StoredRecord(nullptr) {} + ~StoredRecord() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(StoredRecord* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(StoredRecord)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR StoredRecord(::google::protobuf::internal::ConstantInitialized); + + inline StoredRecord(const StoredRecord& from) : StoredRecord(nullptr, from) {} + inline StoredRecord(StoredRecord&& from) noexcept + : StoredRecord(nullptr, ::std::move(from)) {} + inline StoredRecord& operator=(const StoredRecord& from) { + CopyFrom(from); + return *this; + } + inline StoredRecord& operator=(StoredRecord&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const StoredRecord& default_instance() { + return *reinterpret_cast( + &_StoredRecord_default_instance_); + } + static constexpr int kIndexInFileMessages = 16; + friend void swap(StoredRecord& a, StoredRecord& b) { a.Swap(&b); } + inline void Swap(StoredRecord* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(StoredRecord* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + StoredRecord* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const StoredRecord& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const StoredRecord& from) { StoredRecord::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(StoredRecord* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.StoredRecord"; } + + explicit StoredRecord(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + StoredRecord(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const StoredRecord& from); + StoredRecord( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, StoredRecord&& from) noexcept + : StoredRecord(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kRecentKeysFieldNumber = 2, + kRecordFieldNumber = 1, + kVersionFieldNumber = 3, + kKindsFieldNumber = 4, + }; + // repeated string recent_keys = 2; + int recent_keys_size() const; + private: + int _internal_recent_keys_size() const; + + public: + void clear_recent_keys() ; + const ::std::string& recent_keys(int index) const; + ::std::string* PROTOBUF_NONNULL mutable_recent_keys(int index); + template + void set_recent_keys(int index, Arg_&& value, Args_... args); + ::std::string* PROTOBUF_NONNULL add_recent_keys(); + template + void add_recent_keys(Arg_&& value, Args_... args); + const ::google::protobuf::RepeatedPtrField<::std::string>& recent_keys() const; + ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL mutable_recent_keys(); + + private: + const ::google::protobuf::RepeatedPtrField<::std::string>& _internal_recent_keys() const; + ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL _internal_mutable_recent_keys(); + + public: + // .modlock.wasm.persist.Record record = 1; + bool has_record() const; + void clear_record() ; + const ::modlock::wasm::persist::Record& record() const; + [[nodiscard]] ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE release_record(); + ::modlock::wasm::persist::Record* PROTOBUF_NONNULL mutable_record(); + void set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value); + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE unsafe_arena_release_record(); + + private: + const ::modlock::wasm::persist::Record& _internal_record() const; + ::modlock::wasm::persist::Record* PROTOBUF_NONNULL _internal_mutable_record(); + + public: + // uint64 version = 3; + void clear_version() ; + ::uint64_t version() const; + void set_version(::uint64_t value); + + private: + ::uint64_t _internal_version() const; + void _internal_set_version(::uint64_t value); + + public: + // map kinds = 4; + int kinds_size() const; + private: + int _internal_kinds_size() const; + + public: + void clear_kinds() ; + const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field_Kind>& kinds() const; + ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field_Kind>* PROTOBUF_NONNULL mutable_kinds(); + + private: + const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field_Kind>& _internal_kinds() const; + ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field_Kind>* PROTOBUF_NONNULL _internal_mutable_kinds(); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.StoredRecord) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 4, + 2, 58, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const StoredRecord& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedPtrField<::std::string> recent_keys_; + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE record_; + ::uint64_t version_; + ::google::protobuf::internal::MapField + kinds_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull StoredRecord_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API PlayerRecord final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.PlayerRecord) */ { + public: + inline PlayerRecord() : PlayerRecord(nullptr) {} + ~PlayerRecord() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(PlayerRecord* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(PlayerRecord)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR PlayerRecord(::google::protobuf::internal::ConstantInitialized); + + inline PlayerRecord(const PlayerRecord& from) : PlayerRecord(nullptr, from) {} + inline PlayerRecord(PlayerRecord&& from) noexcept + : PlayerRecord(nullptr, ::std::move(from)) {} + inline PlayerRecord& operator=(const PlayerRecord& from) { + CopyFrom(from); + return *this; + } + inline PlayerRecord& operator=(PlayerRecord&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PlayerRecord& default_instance() { + return *reinterpret_cast( + &_PlayerRecord_default_instance_); + } + static constexpr int kIndexInFileMessages = 12; + friend void swap(PlayerRecord& a, PlayerRecord& b) { a.Swap(&b); } + inline void Swap(PlayerRecord* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PlayerRecord* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PlayerRecord* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const PlayerRecord& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const PlayerRecord& from) { PlayerRecord::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(PlayerRecord* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.PlayerRecord"; } + + explicit PlayerRecord(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + PlayerRecord(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const PlayerRecord& from); + PlayerRecord( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, PlayerRecord&& from) noexcept + : PlayerRecord(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kRecordFieldNumber = 2, + kPlayerFieldNumber = 1, + }; + // .modlock.wasm.persist.Record record = 2; + bool has_record() const; + void clear_record() ; + const ::modlock::wasm::persist::Record& record() const; + [[nodiscard]] ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE release_record(); + ::modlock::wasm::persist::Record* PROTOBUF_NONNULL mutable_record(); + void set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value); + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE unsafe_arena_release_record(); + + private: + const ::modlock::wasm::persist::Record& _internal_record() const; + ::modlock::wasm::persist::Record* PROTOBUF_NONNULL _internal_mutable_record(); + + public: + // int32 player = 1; + void clear_player() ; + ::int32_t player() const; + void set_player(::int32_t value); + + private: + ::int32_t _internal_player() const; + void _internal_set_player(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.PlayerRecord) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 1, 0, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const PlayerRecord& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE record_; + ::int32_t player_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull PlayerRecord_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API GetReply final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.GetReply) */ { + public: + inline GetReply() : GetReply(nullptr) {} + ~GetReply() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(GetReply* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(GetReply)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR GetReply(::google::protobuf::internal::ConstantInitialized); + + inline GetReply(const GetReply& from) : GetReply(nullptr, from) {} + inline GetReply(GetReply&& from) noexcept + : GetReply(nullptr, ::std::move(from)) {} + inline GetReply& operator=(const GetReply& from) { + CopyFrom(from); + return *this; + } + inline GetReply& operator=(GetReply&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GetReply& default_instance() { + return *reinterpret_cast( + &_GetReply_default_instance_); + } + static constexpr int kIndexInFileMessages = 9; + friend void swap(GetReply& a, GetReply& b) { a.Swap(&b); } + inline void Swap(GetReply* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GetReply* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + GetReply* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const GetReply& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const GetReply& from) { GetReply::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(GetReply* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.GetReply"; } + + explicit GetReply(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + GetReply(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const GetReply& from); + GetReply( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, GetReply&& from) noexcept + : GetReply(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kRecordFieldNumber = 1, + }; + // .modlock.wasm.persist.Record record = 1; + bool has_record() const; + void clear_record() ; + const ::modlock::wasm::persist::Record& record() const; + [[nodiscard]] ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE release_record(); + ::modlock::wasm::persist::Record* PROTOBUF_NONNULL mutable_record(); + void set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value); + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE unsafe_arena_release_record(); + + private: + const ::modlock::wasm::persist::Record& _internal_record() const; + ::modlock::wasm::persist::Record* PROTOBUF_NONNULL _internal_mutable_record(); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.GetReply) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 1, + 1, 0, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const GetReply& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE record_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull GetReply_class_data_; +// ------------------------------------------------------------------- + +class PlayerFile_RecordsEntry_DoNotUse final + : public ::google::protobuf::internal::MapEntry<::std::string, ::google::protobuf::Message, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE> { + public: + using SuperType = + ::google::protobuf::internal::MapEntry<::std::string, ::google::protobuf::Message, + ::google::protobuf::internal::WireFormatLite::TYPE_STRING, + ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE>; + PlayerFile_RecordsEntry_DoNotUse(); + template + explicit PROTOBUF_CONSTEXPR PlayerFile_RecordsEntry_DoNotUse(::google::protobuf::internal::ConstantInitialized); + explicit PlayerFile_RecordsEntry_DoNotUse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr const void* PROTOBUF_NONNULL internal_default_instance() { + return &_PlayerFile_RecordsEntry_DoNotUse_default_instance_; + } + + + static constexpr auto InternalGenerateClassData_(); + + private: + friend class ::google::protobuf::MessageLite; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; + + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 1, 56, + 2> + _table_; + + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); +}; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull PlayerFile_RecordsEntry_DoNotUse_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API GetManyReply final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.GetManyReply) */ { + public: + inline GetManyReply() : GetManyReply(nullptr) {} + ~GetManyReply() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(GetManyReply* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(GetManyReply)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR GetManyReply(::google::protobuf::internal::ConstantInitialized); + + inline GetManyReply(const GetManyReply& from) : GetManyReply(nullptr, from) {} + inline GetManyReply(GetManyReply&& from) noexcept + : GetManyReply(nullptr, ::std::move(from)) {} + inline GetManyReply& operator=(const GetManyReply& from) { + CopyFrom(from); + return *this; + } + inline GetManyReply& operator=(GetManyReply&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GetManyReply& default_instance() { + return *reinterpret_cast( + &_GetManyReply_default_instance_); + } + static constexpr int kIndexInFileMessages = 11; + friend void swap(GetManyReply& a, GetManyReply& b) { a.Swap(&b); } + inline void Swap(GetManyReply* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GetManyReply* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + GetManyReply* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const GetManyReply& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const GetManyReply& from) { GetManyReply::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(GetManyReply* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.GetManyReply"; } + + explicit GetManyReply(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + GetManyReply(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const GetManyReply& from); + GetManyReply( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, GetManyReply&& from) noexcept + : GetManyReply(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kRecordsFieldNumber = 1, + }; + // repeated .modlock.wasm.persist.PlayerRecord records = 1; + int records_size() const; + private: + int _internal_records_size() const; + + public: + void clear_records() ; + ::modlock::wasm::persist::PlayerRecord* PROTOBUF_NONNULL mutable_records(int index); + ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::PlayerRecord>* PROTOBUF_NONNULL mutable_records(); + + private: + const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::PlayerRecord>& _internal_records() const; + ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::PlayerRecord>* PROTOBUF_NONNULL _internal_mutable_records(); + public: + const ::modlock::wasm::persist::PlayerRecord& records(int index) const; + ::modlock::wasm::persist::PlayerRecord* PROTOBUF_NONNULL add_records(); + const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::PlayerRecord>& records() const; + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.GetManyReply) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 1, + 1, 0, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const GetManyReply& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedPtrField< ::modlock::wasm::persist::PlayerRecord > records_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull GetManyReply_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API PlayerFile final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.persist.PlayerFile) */ { + public: + inline PlayerFile() : PlayerFile(nullptr) {} + ~PlayerFile() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(PlayerFile* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(PlayerFile)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR PlayerFile(::google::protobuf::internal::ConstantInitialized); + + inline PlayerFile(const PlayerFile& from) : PlayerFile(nullptr, from) {} + inline PlayerFile(PlayerFile&& from) noexcept + : PlayerFile(nullptr, ::std::move(from)) {} + inline PlayerFile& operator=(const PlayerFile& from) { + CopyFrom(from); + return *this; + } + inline PlayerFile& operator=(PlayerFile&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PlayerFile& default_instance() { + return *reinterpret_cast( + &_PlayerFile_default_instance_); + } + static constexpr int kIndexInFileMessages = 18; + friend void swap(PlayerFile& a, PlayerFile& b) { a.Swap(&b); } + inline void Swap(PlayerFile* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PlayerFile* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PlayerFile* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const PlayerFile& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const PlayerFile& from) { PlayerFile::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + ::size_t ByteSizeLong() const final; + ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(PlayerFile* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.persist.PlayerFile"; } + + explicit PlayerFile(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + PlayerFile(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const PlayerFile& from); + PlayerFile( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, PlayerFile&& from) noexcept + : PlayerFile(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kSteamIdFieldNumber = 1, + kRecordsFieldNumber = 2, + }; + // uint64 steam_id = 1; + void clear_steam_id() ; + ::uint64_t steam_id() const; + void set_steam_id(::uint64_t value); + + private: + ::uint64_t _internal_steam_id() const; + void _internal_set_steam_id(::uint64_t value); + + public: + // map records = 2; + int records_size() const; + private: + int _internal_records_size() const; + + public: + void clear_records() ; + const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::StoredRecord>& records() const; + ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::StoredRecord>* PROTOBUF_NONNULL mutable_records(); + + private: + const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::StoredRecord>& _internal_records() const; + ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::StoredRecord>* PROTOBUF_NONNULL _internal_mutable_records(); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.persist.PlayerFile) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 2, + 2, 47, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const PlayerFile& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::uint64_t steam_id_; + ::google::protobuf::internal::MapField + records_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull PlayerFile_class_data_; + +// =================================================================== + + + + +// =================================================================== + + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// RecordType + +// string name = 1; +inline void RecordType::clear_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.name_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& RecordType::name() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.RecordType.name) + return _internal_name(); +} +template +PROTOBUF_ALWAYS_INLINE void RecordType::set_name(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.RecordType.name) +} +inline ::std::string* PROTOBUF_NONNULL RecordType::mutable_name() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.RecordType.name) + return _s; +} +inline const ::std::string& RecordType::_internal_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.name_.Get(); +} +inline void RecordType::_internal_set_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL RecordType::_internal_mutable_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE RecordType::release_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.RecordType.name) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.name_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.name_.Set("", GetArena()); + } + return released; +} +inline void RecordType::set_allocated_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.RecordType.name) +} + +// .modlock.wasm.persist.Writers writers = 2; +inline void RecordType::clear_writers() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.writers_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline ::modlock::wasm::persist::Writers RecordType::writers() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.RecordType.writers) + return _internal_writers(); +} +inline void RecordType::set_writers(::modlock::wasm::persist::Writers value) { + _internal_set_writers(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.RecordType.writers) +} +inline ::modlock::wasm::persist::Writers RecordType::_internal_writers() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::modlock::wasm::persist::Writers>(_impl_.writers_); +} +inline void RecordType::_internal_set_writers(::modlock::wasm::persist::Writers value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.writers_ = value; +} + +// map fields = 3; +inline int RecordType::_internal_fields_size() const { + return _internal_fields().size(); +} +inline int RecordType::fields_size() const { + return _internal_fields_size(); +} +inline void RecordType::clear_fields() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.fields_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000004U); +} +inline const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field>& RecordType::_internal_fields() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.fields_.GetMap(); +} +inline const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field>& RecordType::fields() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_map:modlock.wasm.persist.RecordType.fields) + return _internal_fields(); +} +inline ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field>* PROTOBUF_NONNULL RecordType::_internal_mutable_fields() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.fields_.MutableMap(); +} +inline ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field>* PROTOBUF_NONNULL RecordType::mutable_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_mutable_map:modlock.wasm.persist.RecordType.fields) + return _internal_mutable_fields(); +} + +// ------------------------------------------------------------------- + +// Field + +// .modlock.wasm.persist.Field.Kind kind = 1; +inline void Field::clear_kind() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.kind_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline ::modlock::wasm::persist::Field_Kind Field::kind() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Field.kind) + return _internal_kind(); +} +inline void Field::set_kind(::modlock::wasm::persist::Field_Kind value) { + _internal_set_kind(value); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Field.kind) +} +inline ::modlock::wasm::persist::Field_Kind Field::_internal_kind() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::modlock::wasm::persist::Field_Kind>(_impl_.kind_); +} +inline void Field::_internal_set_kind(::modlock::wasm::persist::Field_Kind value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.kind_ = value; +} + +// uint32 max_bytes = 2; +inline void Field::clear_max_bytes() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.max_bytes_ = 0u; + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline ::uint32_t Field::max_bytes() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Field.max_bytes) + return _internal_max_bytes(); +} +inline void Field::set_max_bytes(::uint32_t value) { + _internal_set_max_bytes(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Field.max_bytes) +} +inline ::uint32_t Field::_internal_max_bytes() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.max_bytes_; +} +inline void Field::_internal_set_max_bytes(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.max_bytes_ = value; +} + +// ------------------------------------------------------------------- + +// Value + +// double number = 1; +inline bool Value::has_number() const { + return value_case() == kNumber; +} +inline void Value::set_has_number() { + _impl_._oneof_case_[0] = kNumber; +} +inline void Value::clear_number() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value_case() == kNumber) { + _impl_.value_.number_ = 0; + clear_has_value(); + } +} +inline double Value::number() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Value.number) + return _internal_number(); +} +inline void Value::set_number(double value) { + if (value_case() != kNumber) { + clear_value(); + set_has_number(); + } + _impl_.value_.number_ = value; + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Value.number) +} +inline double Value::_internal_number() const { + if (value_case() == kNumber) { + return _impl_.value_.number_; + } + return 0; +} + +// string text = 2; +inline bool Value::has_text() const { + return value_case() == kText; +} +inline void Value::set_has_text() { + _impl_._oneof_case_[0] = kText; +} +inline void Value::clear_text() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value_case() == kText) { + _impl_.value_.text_.Destroy(); + clear_has_value(); + } +} +inline const ::std::string& Value::text() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Value.text) + return _internal_text(); +} +template +PROTOBUF_ALWAYS_INLINE void Value::set_text(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value_case() != kText) { + clear_value(); + + set_has_text(); + _impl_.value_.text_.InitDefault(); + } + _impl_.value_.text_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Value.text) +} +inline ::std::string* PROTOBUF_NONNULL Value::mutable_text() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + if (value_case() != kText) { + clear_value(); + + set_has_text(); + _impl_.value_.text_.InitDefault(); + } + ::std::string* _s = _internal_mutable_text(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.Value.text) + return _s; +} +inline const ::std::string& Value::_internal_text() const { + ::google::protobuf::internal::TSanRead(&_impl_); + if (value_case() != kText) { + return ::google::protobuf::internal::GetEmptyStringAlreadyInited(); + } + return _impl_.value_.text_.Get(); +} +inline void Value::_internal_set_text(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.value_.text_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL Value::_internal_mutable_text() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.value_.text_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE Value::release_text() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.Value.text) + if (value_case() != kText) { + return nullptr; + } + clear_has_value(); + return _impl_.value_.text_.Release(); +} +inline void Value::set_allocated_text(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (has_value()) { + clear_value(); + } + if (value != nullptr) { + set_has_text(); + _impl_.value_.text_.InitAllocated(value, GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.Value.text) +} + +// .modlock.wasm.persist.Tags tags = 3; +inline bool Value::has_tags() const { + return value_case() == kTags; +} +inline bool Value::_internal_has_tags() const { + return value_case() == kTags; +} +inline void Value::set_has_tags() { + _impl_._oneof_case_[0] = kTags; +} +inline void Value::clear_tags() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value_case() == kTags) { + if (GetArena() == nullptr) { + delete _impl_.value_.tags_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.value_.tags_); + } + clear_has_value(); + } +} +inline ::modlock::wasm::persist::Tags* PROTOBUF_NULLABLE Value::release_tags() { + // @@protoc_insertion_point(field_release:modlock.wasm.persist.Value.tags) + if (value_case() == kTags) { + clear_has_value(); + auto* temp = _impl_.value_.tags_; + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.value_.tags_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::wasm::persist::Tags& Value::_internal_tags() const { + return value_case() == kTags ? static_cast(*_impl_.value_.tags_) + : reinterpret_cast(::modlock::wasm::persist::_Tags_default_instance_); +} +inline const ::modlock::wasm::persist::Tags& Value::tags() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Value.tags) + return _internal_tags(); +} +inline ::modlock::wasm::persist::Tags* PROTOBUF_NULLABLE Value::unsafe_arena_release_tags() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.wasm.persist.Value.tags) + if (value_case() == kTags) { + clear_has_value(); + auto* temp = _impl_.value_.tags_; + _impl_.value_.tags_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Value::unsafe_arena_set_allocated_tags( + ::modlock::wasm::persist::Tags* PROTOBUF_NULLABLE value) { + // We rely on the oneof clear method to free the earlier contents + // of this oneof. We can directly use the pointer we're given to + // set the new value. + clear_value(); + if (value) { + set_has_tags(); + _impl_.value_.tags_ = value; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.wasm.persist.Value.tags) +} +inline ::modlock::wasm::persist::Tags* PROTOBUF_NONNULL Value::_internal_mutable_tags() { + if (value_case() != kTags) { + clear_value(); + set_has_tags(); + _impl_.value_.tags_ = + ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::persist::Tags>(GetArena()); + } + return _impl_.value_.tags_; +} +inline ::modlock::wasm::persist::Tags* PROTOBUF_NONNULL Value::mutable_tags() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::wasm::persist::Tags* _msg = _internal_mutable_tags(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.Value.tags) + return _msg; +} + +inline bool Value::has_value() const { + return value_case() != VALUE_NOT_SET; +} +inline void Value::clear_has_value() { + _impl_._oneof_case_[0] = VALUE_NOT_SET; +} +inline Value::ValueCase Value::value_case() const { + return Value::ValueCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Tags + +// repeated string members = 1; +inline int Tags::_internal_members_size() const { + return _internal_members().size(); +} +inline int Tags::members_size() const { + return _internal_members_size(); +} +inline void Tags::clear_members() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.members_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000001U); +} +inline ::std::string* PROTOBUF_NONNULL Tags::add_members() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::std::string* _s = + _internal_mutable_members()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add_mutable:modlock.wasm.persist.Tags.members) + return _s; +} +inline const ::std::string& Tags::members(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Tags.members) + return _internal_members().Get(index); +} +inline ::std::string* PROTOBUF_NONNULL Tags::mutable_members(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.Tags.members) + return _internal_mutable_members()->Mutable(index); +} +template +inline void Tags::set_members(int index, Arg_&& value, Args_... args) { + ::google::protobuf::internal::AssignToString(*_internal_mutable_members()->Mutable(index), ::std::forward(value), + args... ); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Tags.members) +} +template +inline void Tags::add_members(Arg_&& value, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::google::protobuf::internal::AddToRepeatedPtrField( + ::google::protobuf::MessageLite::internal_visibility(), GetArena(), + *_internal_mutable_members(), ::std::forward(value), + args... ); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add:modlock.wasm.persist.Tags.members) +} +inline const ::google::protobuf::RepeatedPtrField<::std::string>& Tags::members() + const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:modlock.wasm.persist.Tags.members) + return _internal_members(); +} +inline ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL +Tags::mutable_members() ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_mutable_list:modlock.wasm.persist.Tags.members) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_members(); +} +inline const ::google::protobuf::RepeatedPtrField<::std::string>& +Tags::_internal_members() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.members_; +} +inline ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL +Tags::_internal_mutable_members() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.members_; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// Record + +// map fields = 1; +inline int Record::_internal_fields_size() const { + return _internal_fields().size(); +} +inline int Record::fields_size() const { + return _internal_fields_size(); +} +inline void Record::clear_fields() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.fields_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Value>& Record::_internal_fields() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.fields_.GetMap(); +} +inline const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Value>& Record::fields() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_map:modlock.wasm.persist.Record.fields) + return _internal_fields(); +} +inline ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Value>* PROTOBUF_NONNULL Record::_internal_mutable_fields() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.fields_.MutableMap(); +} +inline ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Value>* PROTOBUF_NONNULL Record::mutable_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_mutable_map:modlock.wasm.persist.Record.fields) + return _internal_mutable_fields(); +} + +// ------------------------------------------------------------------- + +// Op + +// string field = 1; +inline void Op::clear_field() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.field_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& Op::field() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Op.field) + return _internal_field(); +} +template +PROTOBUF_ALWAYS_INLINE void Op::set_field(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.field_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Op.field) +} +inline ::std::string* PROTOBUF_NONNULL Op::mutable_field() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_field(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.Op.field) + return _s; +} +inline const ::std::string& Op::_internal_field() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.field_.Get(); +} +inline void Op::_internal_set_field(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.field_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL Op::_internal_mutable_field() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.field_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE Op::release_field() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.Op.field) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.field_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.field_.Set("", GetArena()); + } + return released; +} +inline void Op::set_allocated_field(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.field_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.field_.IsDefault()) { + _impl_.field_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.Op.field) +} + +// double add = 2; +inline bool Op::has_add() const { + return op_case() == kAdd; +} +inline void Op::set_has_add() { + _impl_._oneof_case_[0] = kAdd; +} +inline void Op::clear_add() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (op_case() == kAdd) { + _impl_.op_.add_ = 0; + clear_has_op(); + } +} +inline double Op::add() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Op.add) + return _internal_add(); +} +inline void Op::set_add(double value) { + if (op_case() != kAdd) { + clear_op(); + set_has_add(); + } + _impl_.op_.add_ = value; + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Op.add) +} +inline double Op::_internal_add() const { + if (op_case() == kAdd) { + return _impl_.op_.add_; + } + return 0; +} + +// double max = 3; +inline bool Op::has_max() const { + return op_case() == kMax; +} +inline void Op::set_has_max() { + _impl_._oneof_case_[0] = kMax; +} +inline void Op::clear_max() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (op_case() == kMax) { + _impl_.op_.max_ = 0; + clear_has_op(); + } +} +inline double Op::max() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Op.max) + return _internal_max(); +} +inline void Op::set_max(double value) { + if (op_case() != kMax) { + clear_op(); + set_has_max(); + } + _impl_.op_.max_ = value; + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Op.max) +} +inline double Op::_internal_max() const { + if (op_case() == kMax) { + return _impl_.op_.max_; + } + return 0; +} + +// double min = 4; +inline bool Op::has_min() const { + return op_case() == kMin; +} +inline void Op::set_has_min() { + _impl_._oneof_case_[0] = kMin; +} +inline void Op::clear_min() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (op_case() == kMin) { + _impl_.op_.min_ = 0; + clear_has_op(); + } +} +inline double Op::min() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Op.min) + return _internal_min(); +} +inline void Op::set_min(double value) { + if (op_case() != kMin) { + clear_op(); + set_has_min(); + } + _impl_.op_.min_ = value; + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Op.min) +} +inline double Op::_internal_min() const { + if (op_case() == kMin) { + return _impl_.op_.min_; + } + return 0; +} + +// .modlock.wasm.persist.Value set = 5; +inline bool Op::has_set() const { + return op_case() == kSet; +} +inline bool Op::_internal_has_set() const { + return op_case() == kSet; +} +inline void Op::set_has_set() { + _impl_._oneof_case_[0] = kSet; +} +inline void Op::clear_set() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (op_case() == kSet) { + if (GetArena() == nullptr) { + delete _impl_.op_.set_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.op_.set_); + } + clear_has_op(); + } +} +inline ::modlock::wasm::persist::Value* PROTOBUF_NULLABLE Op::release_set() { + // @@protoc_insertion_point(field_release:modlock.wasm.persist.Op.set) + if (op_case() == kSet) { + clear_has_op(); + auto* temp = _impl_.op_.set_; + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.op_.set_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::wasm::persist::Value& Op::_internal_set() const { + return op_case() == kSet ? static_cast(*_impl_.op_.set_) + : reinterpret_cast(::modlock::wasm::persist::_Value_default_instance_); +} +inline const ::modlock::wasm::persist::Value& Op::set() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Op.set) + return _internal_set(); +} +inline ::modlock::wasm::persist::Value* PROTOBUF_NULLABLE Op::unsafe_arena_release_set() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.wasm.persist.Op.set) + if (op_case() == kSet) { + clear_has_op(); + auto* temp = _impl_.op_.set_; + _impl_.op_.set_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void Op::unsafe_arena_set_allocated_set( + ::modlock::wasm::persist::Value* PROTOBUF_NULLABLE value) { + // We rely on the oneof clear method to free the earlier contents + // of this oneof. We can directly use the pointer we're given to + // set the new value. + clear_op(); + if (value) { + set_has_set(); + _impl_.op_.set_ = value; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.wasm.persist.Op.set) +} +inline ::modlock::wasm::persist::Value* PROTOBUF_NONNULL Op::_internal_mutable_set() { + if (op_case() != kSet) { + clear_op(); + set_has_set(); + _impl_.op_.set_ = + ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::persist::Value>(GetArena()); + } + return _impl_.op_.set_; +} +inline ::modlock::wasm::persist::Value* PROTOBUF_NONNULL Op::mutable_set() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::wasm::persist::Value* _msg = _internal_mutable_set(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.Op.set) + return _msg; +} + +// string insert = 6; +inline bool Op::has_insert() const { + return op_case() == kInsert; +} +inline void Op::set_has_insert() { + _impl_._oneof_case_[0] = kInsert; +} +inline void Op::clear_insert() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (op_case() == kInsert) { + _impl_.op_.insert_.Destroy(); + clear_has_op(); + } +} +inline const ::std::string& Op::insert() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Op.insert) + return _internal_insert(); +} +template +PROTOBUF_ALWAYS_INLINE void Op::set_insert(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (op_case() != kInsert) { + clear_op(); + + set_has_insert(); + _impl_.op_.insert_.InitDefault(); + } + _impl_.op_.insert_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Op.insert) +} +inline ::std::string* PROTOBUF_NONNULL Op::mutable_insert() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + if (op_case() != kInsert) { + clear_op(); + + set_has_insert(); + _impl_.op_.insert_.InitDefault(); + } + ::std::string* _s = _internal_mutable_insert(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.Op.insert) + return _s; +} +inline const ::std::string& Op::_internal_insert() const { + ::google::protobuf::internal::TSanRead(&_impl_); + if (op_case() != kInsert) { + return ::google::protobuf::internal::GetEmptyStringAlreadyInited(); + } + return _impl_.op_.insert_.Get(); +} +inline void Op::_internal_set_insert(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.op_.insert_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL Op::_internal_mutable_insert() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.op_.insert_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE Op::release_insert() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.Op.insert) + if (op_case() != kInsert) { + return nullptr; + } + clear_has_op(); + return _impl_.op_.insert_.Release(); +} +inline void Op::set_allocated_insert(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (has_op()) { + clear_op(); + } + if (value != nullptr) { + set_has_insert(); + _impl_.op_.insert_.InitAllocated(value, GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.Op.insert) +} + +// string remove = 7; +inline bool Op::has_remove() const { + return op_case() == kRemove; +} +inline void Op::set_has_remove() { + _impl_._oneof_case_[0] = kRemove; +} +inline void Op::clear_remove() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (op_case() == kRemove) { + _impl_.op_.remove_.Destroy(); + clear_has_op(); + } +} +inline const ::std::string& Op::remove() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.Op.remove) + return _internal_remove(); +} +template +PROTOBUF_ALWAYS_INLINE void Op::set_remove(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (op_case() != kRemove) { + clear_op(); + + set_has_remove(); + _impl_.op_.remove_.InitDefault(); + } + _impl_.op_.remove_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.Op.remove) +} +inline ::std::string* PROTOBUF_NONNULL Op::mutable_remove() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + if (op_case() != kRemove) { + clear_op(); + + set_has_remove(); + _impl_.op_.remove_.InitDefault(); + } + ::std::string* _s = _internal_mutable_remove(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.Op.remove) + return _s; +} +inline const ::std::string& Op::_internal_remove() const { + ::google::protobuf::internal::TSanRead(&_impl_); + if (op_case() != kRemove) { + return ::google::protobuf::internal::GetEmptyStringAlreadyInited(); + } + return _impl_.op_.remove_.Get(); +} +inline void Op::_internal_set_remove(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.op_.remove_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL Op::_internal_mutable_remove() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.op_.remove_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE Op::release_remove() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.Op.remove) + if (op_case() != kRemove) { + return nullptr; + } + clear_has_op(); + return _impl_.op_.remove_.Release(); +} +inline void Op::set_allocated_remove(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (has_op()) { + clear_op(); + } + if (value != nullptr) { + set_has_remove(); + _impl_.op_.remove_.InitAllocated(value, GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.Op.remove) +} + +inline bool Op::has_op() const { + return op_case() != OP_NOT_SET; +} +inline void Op::clear_has_op() { + _impl_._oneof_case_[0] = OP_NOT_SET; +} +inline Op::OpCase Op::op_case() const { + return Op::OpCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// GetRequest + +// int32 player = 1; +inline void GetRequest::clear_player() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.player_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); +} +inline ::int32_t GetRequest::player() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.GetRequest.player) + return _internal_player(); +} +inline void GetRequest::set_player(::int32_t value) { + _internal_set_player(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.GetRequest.player) +} +inline ::int32_t GetRequest::_internal_player() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.player_; +} +inline void GetRequest::_internal_set_player(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.player_ = value; +} + +// string type = 2; +inline void GetRequest::clear_type() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.type_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& GetRequest::type() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.GetRequest.type) + return _internal_type(); +} +template +PROTOBUF_ALWAYS_INLINE void GetRequest::set_type(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.type_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.GetRequest.type) +} +inline ::std::string* PROTOBUF_NONNULL GetRequest::mutable_type() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_type(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.GetRequest.type) + return _s; +} +inline const ::std::string& GetRequest::_internal_type() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.type_.Get(); +} +inline void GetRequest::_internal_set_type(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.type_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL GetRequest::_internal_mutable_type() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.type_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE GetRequest::release_type() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.GetRequest.type) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.type_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.type_.Set("", GetArena()); + } + return released; +} +inline void GetRequest::set_allocated_type(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.type_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.type_.IsDefault()) { + _impl_.type_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.GetRequest.type) +} + +// string key = 3; +inline void GetRequest::clear_key() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.key_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& GetRequest::key() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.GetRequest.key) + return _internal_key(); +} +template +PROTOBUF_ALWAYS_INLINE void GetRequest::set_key(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.key_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.GetRequest.key) +} +inline ::std::string* PROTOBUF_NONNULL GetRequest::mutable_key() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_key(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.GetRequest.key) + return _s; +} +inline const ::std::string& GetRequest::_internal_key() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.key_.Get(); +} +inline void GetRequest::_internal_set_key(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.key_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL GetRequest::_internal_mutable_key() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.key_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE GetRequest::release_key() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.GetRequest.key) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.key_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.key_.Set("", GetArena()); + } + return released; +} +inline void GetRequest::set_allocated_key(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.key_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.key_.IsDefault()) { + _impl_.key_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.GetRequest.key) +} + +// ------------------------------------------------------------------- + +// GetReply + +// .modlock.wasm.persist.Record record = 1; +inline bool GetReply::has_record() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000001U); + PROTOBUF_ASSUME(!value || _impl_.record_ != nullptr); + return value; +} +inline void GetReply::clear_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.record_ != nullptr) _impl_.record_->Clear(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::modlock::wasm::persist::Record& GetReply::_internal_record() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::modlock::wasm::persist::Record* p = _impl_.record_; + return p != nullptr ? *p : reinterpret_cast(::modlock::wasm::persist::_Record_default_instance_); +} +inline const ::modlock::wasm::persist::Record& GetReply::record() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.GetReply.record) + return _internal_record(); +} +inline void GetReply::unsafe_arena_set_allocated_record( + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.record_); + } + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.wasm.persist.GetReply.record) +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE GetReply::release_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + ::modlock::wasm::persist::Record* released = _impl_.record_; + _impl_.record_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE GetReply::unsafe_arena_release_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.GetReply.record) + + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + ::modlock::wasm::persist::Record* temp = _impl_.record_; + _impl_.record_ = nullptr; + return temp; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NONNULL GetReply::_internal_mutable_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.record_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::persist::Record>(GetArena()); + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(p); + } + return _impl_.record_; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NONNULL GetReply::mutable_record() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::modlock::wasm::persist::Record* _msg = _internal_mutable_record(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.GetReply.record) + return _msg; +} +inline void GetReply::set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.record_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(value); + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.GetReply.record) +} + +// ------------------------------------------------------------------- + +// GetManyRequest + +// repeated int32 players = 1; +inline int GetManyRequest::_internal_players_size() const { + return _internal_players().size(); +} +inline int GetManyRequest::players_size() const { + return _internal_players_size(); +} +inline void GetManyRequest::clear_players() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.players_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000001U); +} +inline ::int32_t GetManyRequest::players(int index) const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.GetManyRequest.players) + return _internal_players().Get(index); +} +inline void GetManyRequest::set_players(int index, ::int32_t value) { + _internal_mutable_players()->Set(index, value); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.GetManyRequest.players) +} +inline void GetManyRequest::add_players(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _internal_mutable_players()->Add(value); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add:modlock.wasm.persist.GetManyRequest.players) +} +inline const ::google::protobuf::RepeatedField<::int32_t>& GetManyRequest::players() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:modlock.wasm.persist.GetManyRequest.players) + return _internal_players(); +} +inline ::google::protobuf::RepeatedField<::int32_t>* PROTOBUF_NONNULL GetManyRequest::mutable_players() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_mutable_list:modlock.wasm.persist.GetManyRequest.players) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_players(); +} +inline const ::google::protobuf::RepeatedField<::int32_t>& +GetManyRequest::_internal_players() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.players_; +} +inline ::google::protobuf::RepeatedField<::int32_t>* PROTOBUF_NONNULL +GetManyRequest::_internal_mutable_players() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.players_; +} + +// string type = 2; +inline void GetManyRequest::clear_type() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.type_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& GetManyRequest::type() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.GetManyRequest.type) + return _internal_type(); +} +template +PROTOBUF_ALWAYS_INLINE void GetManyRequest::set_type(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.type_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.GetManyRequest.type) +} +inline ::std::string* PROTOBUF_NONNULL GetManyRequest::mutable_type() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_type(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.GetManyRequest.type) + return _s; +} +inline const ::std::string& GetManyRequest::_internal_type() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.type_.Get(); +} +inline void GetManyRequest::_internal_set_type(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.type_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL GetManyRequest::_internal_mutable_type() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.type_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE GetManyRequest::release_type() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.GetManyRequest.type) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.type_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.type_.Set("", GetArena()); + } + return released; +} +inline void GetManyRequest::set_allocated_type(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.type_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.type_.IsDefault()) { + _impl_.type_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.GetManyRequest.type) +} + +// ------------------------------------------------------------------- + +// GetManyReply + +// repeated .modlock.wasm.persist.PlayerRecord records = 1; +inline int GetManyReply::_internal_records_size() const { + return _internal_records().size(); +} +inline int GetManyReply::records_size() const { + return _internal_records_size(); +} +inline void GetManyReply::clear_records() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.records_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000001U); +} +inline ::modlock::wasm::persist::PlayerRecord* PROTOBUF_NONNULL GetManyReply::mutable_records(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.GetManyReply.records) + return _internal_mutable_records()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::PlayerRecord>* PROTOBUF_NONNULL GetManyReply::mutable_records() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_mutable_list:modlock.wasm.persist.GetManyReply.records) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_records(); +} +inline const ::modlock::wasm::persist::PlayerRecord& GetManyReply::records(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.GetManyReply.records) + return _internal_records().Get(index); +} +inline ::modlock::wasm::persist::PlayerRecord* PROTOBUF_NONNULL GetManyReply::add_records() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::modlock::wasm::persist::PlayerRecord* _add = + _internal_mutable_records()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add:modlock.wasm.persist.GetManyReply.records) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::PlayerRecord>& GetManyReply::records() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:modlock.wasm.persist.GetManyReply.records) + return _internal_records(); +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::PlayerRecord>& +GetManyReply::_internal_records() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.records_; +} +inline ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::PlayerRecord>* PROTOBUF_NONNULL +GetManyReply::_internal_mutable_records() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.records_; +} + +// ------------------------------------------------------------------- + +// PlayerRecord + +// int32 player = 1; +inline void PlayerRecord::clear_player() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.player_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline ::int32_t PlayerRecord::player() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.PlayerRecord.player) + return _internal_player(); +} +inline void PlayerRecord::set_player(::int32_t value) { + _internal_set_player(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.PlayerRecord.player) +} +inline ::int32_t PlayerRecord::_internal_player() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.player_; +} +inline void PlayerRecord::_internal_set_player(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.player_ = value; +} + +// .modlock.wasm.persist.Record record = 2; +inline bool PlayerRecord::has_record() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000001U); + PROTOBUF_ASSUME(!value || _impl_.record_ != nullptr); + return value; +} +inline void PlayerRecord::clear_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.record_ != nullptr) _impl_.record_->Clear(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::modlock::wasm::persist::Record& PlayerRecord::_internal_record() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::modlock::wasm::persist::Record* p = _impl_.record_; + return p != nullptr ? *p : reinterpret_cast(::modlock::wasm::persist::_Record_default_instance_); +} +inline const ::modlock::wasm::persist::Record& PlayerRecord::record() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.PlayerRecord.record) + return _internal_record(); +} +inline void PlayerRecord::unsafe_arena_set_allocated_record( + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.record_); + } + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.wasm.persist.PlayerRecord.record) +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE PlayerRecord::release_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + ::modlock::wasm::persist::Record* released = _impl_.record_; + _impl_.record_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE PlayerRecord::unsafe_arena_release_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.PlayerRecord.record) + + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + ::modlock::wasm::persist::Record* temp = _impl_.record_; + _impl_.record_ = nullptr; + return temp; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NONNULL PlayerRecord::_internal_mutable_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.record_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::persist::Record>(GetArena()); + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(p); + } + return _impl_.record_; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NONNULL PlayerRecord::mutable_record() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::modlock::wasm::persist::Record* _msg = _internal_mutable_record(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.PlayerRecord.record) + return _msg; +} +inline void PlayerRecord::set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.record_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(value); + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.PlayerRecord.record) +} + +// ------------------------------------------------------------------- + +// UpdateRequest + +// int32 player = 1; +inline void UpdateRequest::clear_player() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.player_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000010U); +} +inline ::int32_t UpdateRequest::player() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.UpdateRequest.player) + return _internal_player(); +} +inline void UpdateRequest::set_player(::int32_t value) { + _internal_set_player(value); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.UpdateRequest.player) +} +inline ::int32_t UpdateRequest::_internal_player() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.player_; +} +inline void UpdateRequest::_internal_set_player(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.player_ = value; +} + +// string type = 2; +inline void UpdateRequest::clear_type() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.type_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& UpdateRequest::type() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.UpdateRequest.type) + return _internal_type(); +} +template +PROTOBUF_ALWAYS_INLINE void UpdateRequest::set_type(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.type_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.UpdateRequest.type) +} +inline ::std::string* PROTOBUF_NONNULL UpdateRequest::mutable_type() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_type(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.UpdateRequest.type) + return _s; +} +inline const ::std::string& UpdateRequest::_internal_type() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.type_.Get(); +} +inline void UpdateRequest::_internal_set_type(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.type_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL UpdateRequest::_internal_mutable_type() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.type_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE UpdateRequest::release_type() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.UpdateRequest.type) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.type_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.type_.Set("", GetArena()); + } + return released; +} +inline void UpdateRequest::set_allocated_type(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.type_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.type_.IsDefault()) { + _impl_.type_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.UpdateRequest.type) +} + +// string key = 3; +inline void UpdateRequest::clear_key() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.key_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); +} +inline const ::std::string& UpdateRequest::key() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.UpdateRequest.key) + return _internal_key(); +} +template +PROTOBUF_ALWAYS_INLINE void UpdateRequest::set_key(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.key_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.UpdateRequest.key) +} +inline ::std::string* PROTOBUF_NONNULL UpdateRequest::mutable_key() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_key(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.UpdateRequest.key) + return _s; +} +inline const ::std::string& UpdateRequest::_internal_key() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.key_.Get(); +} +inline void UpdateRequest::_internal_set_key(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.key_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL UpdateRequest::_internal_mutable_key() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.key_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE UpdateRequest::release_key() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.UpdateRequest.key) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.key_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.key_.Set("", GetArena()); + } + return released; +} +inline void UpdateRequest::set_allocated_key(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + _impl_.key_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.key_.IsDefault()) { + _impl_.key_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.UpdateRequest.key) +} + +// repeated .modlock.wasm.persist.Op ops = 4; +inline int UpdateRequest::_internal_ops_size() const { + return _internal_ops().size(); +} +inline int UpdateRequest::ops_size() const { + return _internal_ops_size(); +} +inline void UpdateRequest::clear_ops() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.ops_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000001U); +} +inline ::modlock::wasm::persist::Op* PROTOBUF_NONNULL UpdateRequest::mutable_ops(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.UpdateRequest.ops) + return _internal_mutable_ops()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::Op>* PROTOBUF_NONNULL UpdateRequest::mutable_ops() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_mutable_list:modlock.wasm.persist.UpdateRequest.ops) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_ops(); +} +inline const ::modlock::wasm::persist::Op& UpdateRequest::ops(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.UpdateRequest.ops) + return _internal_ops().Get(index); +} +inline ::modlock::wasm::persist::Op* PROTOBUF_NONNULL UpdateRequest::add_ops() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::modlock::wasm::persist::Op* _add = + _internal_mutable_ops()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add:modlock.wasm.persist.UpdateRequest.ops) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::Op>& UpdateRequest::ops() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:modlock.wasm.persist.UpdateRequest.ops) + return _internal_ops(); +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::Op>& +UpdateRequest::_internal_ops() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.ops_; +} +inline ::google::protobuf::RepeatedPtrField<::modlock::wasm::persist::Op>* PROTOBUF_NONNULL +UpdateRequest::_internal_mutable_ops() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.ops_; +} + +// string update_key = 5; +inline void UpdateRequest::clear_update_key() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.update_key_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000008U); +} +inline const ::std::string& UpdateRequest::update_key() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.UpdateRequest.update_key) + return _internal_update_key(); +} +template +PROTOBUF_ALWAYS_INLINE void UpdateRequest::set_update_key(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + _impl_.update_key_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.UpdateRequest.update_key) +} +inline ::std::string* PROTOBUF_NONNULL UpdateRequest::mutable_update_key() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + ::std::string* _s = _internal_mutable_update_key(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.UpdateRequest.update_key) + return _s; +} +inline const ::std::string& UpdateRequest::_internal_update_key() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.update_key_.Get(); +} +inline void UpdateRequest::_internal_set_update_key(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.update_key_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL UpdateRequest::_internal_mutable_update_key() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.update_key_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE UpdateRequest::release_update_key() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.UpdateRequest.update_key) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000008U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + auto* released = _impl_.update_key_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.update_key_.Set("", GetArena()); + } + return released; +} +inline void UpdateRequest::set_allocated_update_key(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + } + _impl_.update_key_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.update_key_.IsDefault()) { + _impl_.update_key_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.UpdateRequest.update_key) +} + +// ------------------------------------------------------------------- + +// UpdateReply + +// .modlock.wasm.persist.Record record = 1; +inline bool UpdateReply::has_record() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000001U); + PROTOBUF_ASSUME(!value || _impl_.record_ != nullptr); + return value; +} +inline void UpdateReply::clear_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.record_ != nullptr) _impl_.record_->Clear(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::modlock::wasm::persist::Record& UpdateReply::_internal_record() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::modlock::wasm::persist::Record* p = _impl_.record_; + return p != nullptr ? *p : reinterpret_cast(::modlock::wasm::persist::_Record_default_instance_); +} +inline const ::modlock::wasm::persist::Record& UpdateReply::record() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.UpdateReply.record) + return _internal_record(); +} +inline void UpdateReply::unsafe_arena_set_allocated_record( + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.record_); + } + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.wasm.persist.UpdateReply.record) +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE UpdateReply::release_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + ::modlock::wasm::persist::Record* released = _impl_.record_; + _impl_.record_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE UpdateReply::unsafe_arena_release_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.UpdateReply.record) + + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + ::modlock::wasm::persist::Record* temp = _impl_.record_; + _impl_.record_ = nullptr; + return temp; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NONNULL UpdateReply::_internal_mutable_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.record_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::persist::Record>(GetArena()); + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(p); + } + return _impl_.record_; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NONNULL UpdateReply::mutable_record() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::modlock::wasm::persist::Record* _msg = _internal_mutable_record(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.UpdateReply.record) + return _msg; +} +inline void UpdateReply::set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.record_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(value); + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.UpdateReply.record) +} + +// bool repeated = 2; +inline void UpdateReply::clear_repeated() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.repeated_ = false; + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline bool UpdateReply::repeated() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.UpdateReply.repeated) + return _internal_repeated(); +} +inline void UpdateReply::set_repeated(bool value) { + _internal_set_repeated(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.UpdateReply.repeated) +} +inline bool UpdateReply::_internal_repeated() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.repeated_; +} +inline void UpdateReply::_internal_set_repeated(bool value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.repeated_ = value; +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// StoredRecord + +// .modlock.wasm.persist.Record record = 1; +inline bool StoredRecord::has_record() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000002U); + PROTOBUF_ASSUME(!value || _impl_.record_ != nullptr); + return value; +} +inline void StoredRecord::clear_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.record_ != nullptr) _impl_.record_->Clear(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::modlock::wasm::persist::Record& StoredRecord::_internal_record() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::modlock::wasm::persist::Record* p = _impl_.record_; + return p != nullptr ? *p : reinterpret_cast(::modlock::wasm::persist::_Record_default_instance_); +} +inline const ::modlock::wasm::persist::Record& StoredRecord::record() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.StoredRecord.record) + return _internal_record(); +} +inline void StoredRecord::unsafe_arena_set_allocated_record( + ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.record_); + } + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.wasm.persist.StoredRecord.record) +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE StoredRecord::release_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::persist::Record* released = _impl_.record_; + _impl_.record_ = nullptr; + if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { + auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released); + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + if (GetArena() == nullptr) { + delete old; + } + } else { + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } + } + return released; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NULLABLE StoredRecord::unsafe_arena_release_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.persist.StoredRecord.record) + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::persist::Record* temp = _impl_.record_; + _impl_.record_ = nullptr; + return temp; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NONNULL StoredRecord::_internal_mutable_record() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.record_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::persist::Record>(GetArena()); + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(p); + } + return _impl_.record_; +} +inline ::modlock::wasm::persist::Record* PROTOBUF_NONNULL StoredRecord::mutable_record() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::persist::Record* _msg = _internal_mutable_record(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.StoredRecord.record) + return _msg; +} +inline void StoredRecord::set_allocated_record(::modlock::wasm::persist::Record* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); + ::google::protobuf::internal::TSanWrite(&_impl_); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.record_); + } + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = value->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); + } + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + + _impl_.record_ = reinterpret_cast<::modlock::wasm::persist::Record*>(value); + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.persist.StoredRecord.record) +} + +// repeated string recent_keys = 2; +inline int StoredRecord::_internal_recent_keys_size() const { + return _internal_recent_keys().size(); +} +inline int StoredRecord::recent_keys_size() const { + return _internal_recent_keys_size(); +} +inline void StoredRecord::clear_recent_keys() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.recent_keys_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000001U); +} +inline ::std::string* PROTOBUF_NONNULL StoredRecord::add_recent_keys() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::std::string* _s = + _internal_mutable_recent_keys()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add_mutable:modlock.wasm.persist.StoredRecord.recent_keys) + return _s; +} +inline const ::std::string& StoredRecord::recent_keys(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.StoredRecord.recent_keys) + return _internal_recent_keys().Get(index); +} +inline ::std::string* PROTOBUF_NONNULL StoredRecord::mutable_recent_keys(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:modlock.wasm.persist.StoredRecord.recent_keys) + return _internal_mutable_recent_keys()->Mutable(index); +} +template +inline void StoredRecord::set_recent_keys(int index, Arg_&& value, Args_... args) { + ::google::protobuf::internal::AssignToString(*_internal_mutable_recent_keys()->Mutable(index), ::std::forward(value), + args... ); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.StoredRecord.recent_keys) +} +template +inline void StoredRecord::add_recent_keys(Arg_&& value, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::google::protobuf::internal::AddToRepeatedPtrField( + ::google::protobuf::MessageLite::internal_visibility(), GetArena(), + *_internal_mutable_recent_keys(), ::std::forward(value), + args... ); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add:modlock.wasm.persist.StoredRecord.recent_keys) +} +inline const ::google::protobuf::RepeatedPtrField<::std::string>& StoredRecord::recent_keys() + const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:modlock.wasm.persist.StoredRecord.recent_keys) + return _internal_recent_keys(); +} +inline ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL +StoredRecord::mutable_recent_keys() ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_mutable_list:modlock.wasm.persist.StoredRecord.recent_keys) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_recent_keys(); +} +inline const ::google::protobuf::RepeatedPtrField<::std::string>& +StoredRecord::_internal_recent_keys() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.recent_keys_; +} +inline ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL +StoredRecord::_internal_mutable_recent_keys() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.recent_keys_; +} + +// uint64 version = 3; +inline void StoredRecord::clear_version() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.version_ = ::uint64_t{0u}; + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); +} +inline ::uint64_t StoredRecord::version() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.StoredRecord.version) + return _internal_version(); +} +inline void StoredRecord::set_version(::uint64_t value) { + _internal_set_version(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.StoredRecord.version) +} +inline ::uint64_t StoredRecord::_internal_version() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.version_; +} +inline void StoredRecord::_internal_set_version(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.version_ = value; +} + +// map kinds = 4; +inline int StoredRecord::_internal_kinds_size() const { + return _internal_kinds().size(); +} +inline int StoredRecord::kinds_size() const { + return _internal_kinds_size(); +} +inline void StoredRecord::clear_kinds() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.kinds_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000008U); +} +inline const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field_Kind>& StoredRecord::_internal_kinds() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.kinds_.GetMap(); +} +inline const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field_Kind>& StoredRecord::kinds() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_map:modlock.wasm.persist.StoredRecord.kinds) + return _internal_kinds(); +} +inline ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field_Kind>* PROTOBUF_NONNULL StoredRecord::_internal_mutable_kinds() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.kinds_.MutableMap(); +} +inline ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::Field_Kind>* PROTOBUF_NONNULL StoredRecord::mutable_kinds() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_mutable_map:modlock.wasm.persist.StoredRecord.kinds) + return _internal_mutable_kinds(); +} + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// PlayerFile + +// uint64 steam_id = 1; +inline void PlayerFile::clear_steam_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.steam_id_ = ::uint64_t{0u}; + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline ::uint64_t PlayerFile::steam_id() const { + // @@protoc_insertion_point(field_get:modlock.wasm.persist.PlayerFile.steam_id) + return _internal_steam_id(); +} +inline void PlayerFile::set_steam_id(::uint64_t value) { + _internal_set_steam_id(value); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_set:modlock.wasm.persist.PlayerFile.steam_id) +} +inline ::uint64_t PlayerFile::_internal_steam_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.steam_id_; +} +inline void PlayerFile::_internal_set_steam_id(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.steam_id_ = value; +} + +// map records = 2; +inline int PlayerFile::_internal_records_size() const { + return _internal_records().size(); +} +inline int PlayerFile::records_size() const { + return _internal_records_size(); +} +inline void PlayerFile::clear_records() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.records_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::StoredRecord>& PlayerFile::_internal_records() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.records_.GetMap(); +} +inline const ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::StoredRecord>& PlayerFile::records() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_map:modlock.wasm.persist.PlayerFile.records) + return _internal_records(); +} +inline ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::StoredRecord>* PROTOBUF_NONNULL PlayerFile::_internal_mutable_records() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.records_.MutableMap(); +} +inline ::google::protobuf::Map<::std::string, ::modlock::wasm::persist::StoredRecord>* PROTOBUF_NONNULL PlayerFile::mutable_records() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_mutable_map:modlock.wasm.persist.PlayerFile.records) + return _internal_mutable_records(); +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) +} // namespace persist +} // namespace wasm +} // namespace modlock + + +namespace google { +namespace protobuf { + +template <> +struct is_proto_enum<::modlock::wasm::persist::Field_Kind> : std::true_type {}; +template <> +inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::modlock::wasm::persist::Field_Kind>() { + return ::modlock::wasm::persist::Field_Kind_descriptor(); +} +template <> +struct is_proto_enum<::modlock::wasm::persist::Writers> : std::true_type {}; +template <> +inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::modlock::wasm::persist::Writers>() { + return ::modlock::wasm::persist::Writers_descriptor(); +} + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) + +#include "google/protobuf/port_undef.inc" + +#endif // github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fpersist_2fpersist_2eproto_2epb_2eh diff --git a/src/wasm/persist/persist.pb.ts b/src/wasm/persist/persist.pb.ts new file mode 100644 index 00000000..08ebd404 --- /dev/null +++ b/src/wasm/persist/persist.pb.ts @@ -0,0 +1,1082 @@ +// @generated by protoc-gen-es-lite unknown with parameter "target=ts,ts_nocheck=false,typed_decode=true,typed_encode=true" +// @generated from file github.com/paralin/modlock/src/wasm/persist/persist.proto (package modlock.wasm.persist, syntax proto3) +/* eslint-disable */ + +import { createEnumType } from '@aptre/protobuf-es-lite/enum' +import type { MessageType } from '@aptre/protobuf-es-lite/message' +import { createMessageType, newMap } from '@aptre/protobuf-es-lite/message' +import type { + BinaryReader, + Writer, +} from '@aptre/protobuf-es-lite/binary-encoding' + +/** + * Writers is who may change a record type's records. + * + * @generated from enum modlock.wasm.persist.Writers + */ +export enum Writers { + /** + * WRITERS_UNKNOWN is an unset or unsupported value; a manifest must set + * one of the others. + */ + UNKNOWN = 0, + + /** + * WRITERS_SERVERS takes changes only from a game server the host trusts + * to run the mod, for a player in its game, so the values carry that + * server's trust, such as a level or rounds won. + */ + SERVERS = 1, + + /** + * WRITERS_PLAYERS holds the player's own choices, such as settings: the + * host also takes changes made for the player by the player's own PC. + */ + PLAYERS = 2, +} + +export const Writers_Enum = /* @__PURE__ */ createEnumType( + 'modlock.wasm.persist.Writers', + [ + [0, 'WRITERS_UNKNOWN'], + [1, 'WRITERS_SERVERS'], + [2, 'WRITERS_PLAYERS'], + ], +) + +/** + * RecordType is one kind of record a mod declares in its manifest under + * persist, such as a player's stats or unlocks. A host that serves the + * persist service keeps one record of each type for each player of the mod. + * + * @generated from message modlock.wasm.persist.RecordType + */ +export interface RecordType { + /** + * Name names the type in the mod's code: up to 32 letters, digits and + * underscores, starting with a letter. + */ + name?: string + /** + * Writers is who may change the type's records. + */ + writers?: Writers + /** + * Fields are the record's fields by name: up to 32, each up to 32 + * letters, digits and underscores, starting with a letter. + */ + fields?: { [key: string]: Field } +} + +export const RecordType: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.RecordType', + () => [ + [1, 'name', 9], + [2, 'writers', 14, 0, Writers_Enum], + [3, 'fields', 11, 584, Field.codec], + ], + { + decode: (r: BinaryReader, end: number, m: RecordType): RecordType => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.name = r.string() + break + case 2: + m.writers = r.int32() + break + case 3: { + const [k, v] = r.entry( + (r) => r.string(), + (r) => Field.decode(r, r.delimited(), {}), + '', + {}, + ) + m.fields ??= newMap() + m.fields[k] = v + break + } + default: + r.skip(t) + } + } + return m + }, + encode: (m: RecordType, w: Writer): void => { + { + const v = m.name + if (v) w.uint32(10).string(v) + } + { + const v = m.writers + if (v) w.uint32(16).int32(v) + } + { + const o = m.fields + if (o != null) + for (const [k, v] of Object.entries(o)) { + const s = w.uint32(26).fork() + w.uint32(10).string(k) + Field.writeField(w, 2, v) + w.join(s) + } + } + }, + }, + ) + +/** + * Field is one declared field of a record type. + * + * @generated from message modlock.wasm.persist.Field + */ +export interface Field { + kind?: Field_Kind + /** + * MaxBytes bounds a KIND_STRING field's text, up to 256; zero is 64. + */ + maxBytes?: number +} + +export const Field: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.Field', + () => [ + [1, 'kind', 14, 0, Field_Kind_Enum], + [2, 'max_bytes', 13], + ], + { + decode: (r: BinaryReader, end: number, m: Field): Field => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.kind = r.int32() + break + case 2: + m.maxBytes = r.uint32() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: Field, w: Writer): void => { + { + const v = m.kind + if (v) w.uint32(8).int32(v) + } + { + const v = m.maxBytes + if (v) w.uint32(16).uint32(v) + } + }, + }, + ) + +/** + * Kind is what the field holds and which operations change it. + * + * @generated from enum modlock.wasm.persist.Field.Kind + */ +export enum Field_Kind { + /** + * KIND_UNKNOWN is an unset or unsupported kind. + */ + UNKNOWN = 0, + + /** + * KIND_COUNT is a whole number from zero up, changed by add and set. + */ + COUNT = 1, + + /** + * KIND_NUMBER is any number, changed by add, max, min and set. + */ + NUMBER = 2, + + /** + * KIND_MAX is a number that keeps the highest value it was given, + * changed by max. + */ + MAX = 3, + + /** + * KIND_STRING is text of up to max_bytes bytes, changed by set. + */ + STRING = 4, + + /** + * KIND_TAGS is a set of up to 256 short strings, such as unlocks or + * completed goals, changed by insert and remove. + */ + TAGS = 5, +} + +export const Field_Kind_Enum = /* @__PURE__ */ createEnumType( + 'modlock.wasm.persist.Field.Kind', + [ + [0, 'KIND_UNKNOWN'], + [1, 'KIND_COUNT'], + [2, 'KIND_NUMBER'], + [3, 'KIND_MAX'], + [4, 'KIND_STRING'], + [5, 'KIND_TAGS'], + ], +) + +/** + * Value is one field's value in a record. + * + * @generated from message modlock.wasm.persist.Value + */ +export interface Value { + /** + * @generated from oneof modlock.wasm.persist.Value.value + */ + value?: + | { value?: undefined; case: undefined } + | { value: number; case: 'number' } + | { value: string; case: 'text' } + | { value: Tags; case: 'tags' } +} + +export const Value: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.Value', + () => [ + [1, 'number', 1, 0, 0, 'value'], + [2, 'text', 9, 0, 0, 'value'], + [3, 'tags', 11, 0, Tags.codec, 'value'], + ], + { + decode: (r: BinaryReader, end: number, m: Value): Value => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.value = { case: 'number', value: r.double() } + break + case 2: + m.value = { case: 'text', value: r.string() } + break + case 3: + m.value = { + case: 'tags', + value: Tags.decode( + r, + r.delimited(), + m.value?.case === 'tags' ? m.value.value : {}, + ), + } + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: Value, w: Writer): void => { + { + const o = m.value + if (o?.case === 'number' && o.value != null) + w.uint32(9).double(o.value) + } + { + const o = m.value + if (o?.case === 'text' && o.value != null) + w.uint32(18).string(o.value) + } + { + const o = m.value + if (o?.case === 'tags' && o.value != null) + Tags.writeField(w, 3, o.value) + } + }, + }, + ) + +/** + * Tags is the members of a KIND_TAGS field, in sorted order. + * + * @generated from message modlock.wasm.persist.Tags + */ +export interface Tags { + /** + * Members are 1 to 32 bytes each. + */ + members?: string[] +} + +export const Tags: MessageType = /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.Tags', + () => [[1, 'members', 9, 1]], + { + decode: (r: BinaryReader, end: number, m: Tags): Tags => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + ;(m.members ??= []).push(r.string()) + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: Tags, w: Writer): void => { + { + const a = m.members + if (a != null) for (const e of a) w.uint32(10).string(e) + } + }, + }, +) + +/** + * Record is one player's values of one record type. A field never changed + * is absent and reads as zero, empty text or no tags. + * + * @generated from message modlock.wasm.persist.Record + */ +export interface Record { + fields?: { [key: string]: Value } +} + +export const Record: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.Record', + () => [[1, 'fields', 11, 584, Value.codec]], + { + decode: (r: BinaryReader, end: number, m: Record): Record => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: { + const [k, v] = r.entry( + (r) => r.string(), + (r) => Value.decode(r, r.delimited(), {}), + '', + {}, + ) + m.fields ??= newMap() + m.fields[k] = v + break + } + default: + r.skip(t) + } + } + return m + }, + encode: (m: Record, w: Writer): void => { + { + const o = m.fields + if (o != null) + for (const [k, v] of Object.entries(o)) { + const s = w.uint32(10).fork() + w.uint32(10).string(k) + Value.writeField(w, 2, v) + w.join(s) + } + } + }, + }, + ) + +/** + * Op is one change to one field of a record. + * + * @generated from message modlock.wasm.persist.Op + */ +export interface Op { + /** + * Field names a field the record type declares. + */ + field?: string + /** + * @generated from oneof modlock.wasm.persist.Op.op + */ + op?: + | { value?: undefined; case: undefined } + | { value: number; case: 'add' } + | { value: number; case: 'max' } + | { value: number; case: 'min' } + | { value: Value; case: 'set' } + | { value: string; case: 'insert' } + | { value: string; case: 'remove' } +} + +export const Op: MessageType = /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.Op', + () => [ + [1, 'field', 9], + [2, 'add', 1, 0, 0, 'op'], + [3, 'max', 1, 0, 0, 'op'], + [4, 'min', 1, 0, 0, 'op'], + [5, 'set', 11, 0, Value.codec, 'op'], + [6, 'insert', 9, 0, 0, 'op'], + [7, 'remove', 9, 0, 0, 'op'], + ], + { + decode: (r: BinaryReader, end: number, m: Op): Op => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.field = r.string() + break + case 2: + m.op = { case: 'add', value: r.double() } + break + case 3: + m.op = { case: 'max', value: r.double() } + break + case 4: + m.op = { case: 'min', value: r.double() } + break + case 5: + m.op = { + case: 'set', + value: Value.decode( + r, + r.delimited(), + m.op?.case === 'set' ? m.op.value : {}, + ), + } + break + case 6: + m.op = { case: 'insert', value: r.string() } + break + case 7: + m.op = { case: 'remove', value: r.string() } + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: Op, w: Writer): void => { + { + const v = m.field + if (v) w.uint32(10).string(v) + } + { + const o = m.op + if (o?.case === 'add' && o.value != null) w.uint32(17).double(o.value) + } + { + const o = m.op + if (o?.case === 'max' && o.value != null) w.uint32(25).double(o.value) + } + { + const o = m.op + if (o?.case === 'min' && o.value != null) w.uint32(33).double(o.value) + } + { + const o = m.op + if (o?.case === 'set' && o.value != null) + Value.writeField(w, 5, o.value) + } + { + const o = m.op + if (o?.case === 'insert' && o.value != null) + w.uint32(50).string(o.value) + } + { + const o = m.op + if (o?.case === 'remove' && o.value != null) + w.uint32(58).string(o.value) + } + }, + }, +) + +/** + * GetRequest reads one player's record, the request of the persist + * service's Get method. + * + * @generated from message modlock.wasm.persist.GetRequest + */ +export interface GetRequest { + /** + * Player is the player's server slot. + */ + player?: number + /** + * Type names a record type the manifest declares. + */ + type?: string + /** + * Key selects one of the player's records of the type. Empty is the one + * record each player has; hosts refuse any other key for now. + */ + key?: string +} + +export const GetRequest: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.GetRequest', + () => [ + [1, 'player', 5], + [2, 'type', 9], + [3, 'key', 9], + ], + { + decode: (r: BinaryReader, end: number, m: GetRequest): GetRequest => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.player = r.int32() + break + case 2: + m.type = r.string() + break + case 3: + m.key = r.string() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: GetRequest, w: Writer): void => { + { + const v = m.player + if (v) w.uint32(8).int32(v) + } + { + const v = m.type + if (v) w.uint32(18).string(v) + } + { + const v = m.key + if (v) w.uint32(26).string(v) + } + }, + }, + ) + +/** + * GetReply is the response of the Get method. + * + * @generated from message modlock.wasm.persist.GetReply + */ +export interface GetReply { + /** + * Record is the player's record; a record never written comes back empty. + */ + record?: Record +} + +export const GetReply: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.GetReply', + () => [[1, 'record', 11, 0, Record.codec]], + { + decode: (r: BinaryReader, end: number, m: GetReply): GetReply => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.record = Record.decode(r, r.delimited(), m.record ?? {}) + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: GetReply, w: Writer): void => { + { + const v = m.record + if (v != null) Record.writeField(w, 1, v) + } + }, + }, + ) + +/** + * GetManyRequest reads the records of several players, such as a lobby at + * join, the request of the GetMany method. + * + * @generated from message modlock.wasm.persist.GetManyRequest + */ +export interface GetManyRequest { + /** + * Players are the players' server slots, up to 16. + */ + players?: number[] + /** + * Type names a record type the manifest declares. + */ + type?: string +} + +export const GetManyRequest: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.GetManyRequest', + () => [ + [1, 'players', 5, 3], + [2, 'type', 9], + ], + { + decode: ( + r: BinaryReader, + end: number, + m: GetManyRequest, + ): GetManyRequest => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + for (const e = r.run(t), a = (m.players ??= []); r.pos < e;) + a.push(r.int32()) + break + case 2: + m.type = r.string() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: GetManyRequest, w: Writer): void => { + { + const a = m.players + if (a != null && a.length > 0) { + const s = w.uint32(10).fork() + for (const e of a) w.int32(e) + w.join(s) + } + } + { + const v = m.type + if (v) w.uint32(18).string(v) + } + }, + }, + ) + +/** + * GetManyReply is the response of the GetMany method. + * + * @generated from message modlock.wasm.persist.GetManyReply + */ +export interface GetManyReply { + /** + * Records holds one entry for each asked player, in the asked order. + */ + records?: PlayerRecord[] +} + +export const GetManyReply: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.GetManyReply', + () => [[1, 'records', 11, 1, PlayerRecord.codec]], + { + decode: (r: BinaryReader, end: number, m: GetManyReply): GetManyReply => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + ;(m.records ??= []).push( + PlayerRecord.decode(r, r.delimited(), {}), + ) + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: GetManyReply, w: Writer): void => { + { + const a = m.records + if (a != null) for (const e of a) PlayerRecord.writeField(w, 1, e) + } + }, + }, + ) + +/** + * PlayerRecord is one player's record in a GetManyReply. + * + * @generated from message modlock.wasm.persist.PlayerRecord + */ +export interface PlayerRecord { + /** + * Player is the player's server slot. + */ + player?: number + record?: Record +} + +export const PlayerRecord: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.PlayerRecord', + () => [ + [1, 'player', 5], + [2, 'record', 11, 0, Record.codec], + ], + { + decode: (r: BinaryReader, end: number, m: PlayerRecord): PlayerRecord => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.player = r.int32() + break + case 2: + m.record = Record.decode(r, r.delimited(), m.record ?? {}) + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: PlayerRecord, w: Writer): void => { + { + const v = m.player + if (v) w.uint32(8).int32(v) + } + { + const v = m.record + if (v != null) Record.writeField(w, 2, v) + } + }, + }, + ) + +/** + * UpdateRequest changes one player's record by field operations, the + * request of the Update method. The host applies every op or none, so two + * servers that update one record at once both land; a set is the one op + * whose later write wins. + * + * @generated from message modlock.wasm.persist.UpdateRequest + */ +export interface UpdateRequest { + /** + * Player is the player's server slot. + */ + player?: number + /** + * Type names a record type the manifest declares. + */ + type?: string + /** + * Key selects the record, as in GetRequest. + */ + key?: string + /** + * Ops are the changes, applied in order, up to 32. + */ + ops?: Op[] + /** + * UpdateKey identifies the change, such as a round, so a resent update + * counts once: an update whose key is among the record's last 64 is + * left out. Up to 64 bytes; empty applies the update every time. + */ + updateKey?: string +} + +export const UpdateRequest: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.UpdateRequest', + () => [ + [1, 'player', 5], + [2, 'type', 9], + [3, 'key', 9], + [4, 'ops', 11, 1, Op.codec], + [5, 'update_key', 9], + ], + { + decode: ( + r: BinaryReader, + end: number, + m: UpdateRequest, + ): UpdateRequest => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.player = r.int32() + break + case 2: + m.type = r.string() + break + case 3: + m.key = r.string() + break + case 4: + ;(m.ops ??= []).push(Op.decode(r, r.delimited(), {})) + break + case 5: + m.updateKey = r.string() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: UpdateRequest, w: Writer): void => { + { + const v = m.player + if (v) w.uint32(8).int32(v) + } + { + const v = m.type + if (v) w.uint32(18).string(v) + } + { + const v = m.key + if (v) w.uint32(26).string(v) + } + { + const a = m.ops + if (a != null) for (const e of a) Op.writeField(w, 4, e) + } + { + const v = m.updateKey + if (v) w.uint32(42).string(v) + } + }, + }, + ) + +/** + * UpdateReply is the response of the Update method. + * + * @generated from message modlock.wasm.persist.UpdateReply + */ +export interface UpdateReply { + /** + * Record is the record after the update. + */ + record?: Record + /** + * Repeated is set when the update's key was among the record's recent + * keys, so the host left the record as it was. + */ + repeated?: boolean +} + +export const UpdateReply: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.UpdateReply', + () => [ + [1, 'record', 11, 0, Record.codec], + [2, 'repeated', 8], + ], + { + decode: (r: BinaryReader, end: number, m: UpdateReply): UpdateReply => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.record = Record.decode(r, r.delimited(), m.record ?? {}) + break + case 2: + m.repeated = r.bool() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: UpdateReply, w: Writer): void => { + { + const v = m.record + if (v != null) Record.writeField(w, 1, v) + } + { + const v = m.repeated + if (v) w.uint32(16).bool(v) + } + }, + }, + ) + +/** + * StoredRecord is a record as a host keeps it: its values and the keys of + * its most recent updates. + * + * @generated from message modlock.wasm.persist.StoredRecord + */ +export interface StoredRecord { + record?: Record + /** + * RecentKeys are the update keys of the record's last 64 keyed updates, + * oldest first. + */ + recentKeys?: string[] + /** + * Version counts the updates that changed the record. + */ + version?: bigint + /** + * Kinds are the kinds of the fields that wrote each value in record, so a + * value is changed only by a field of the same kind. + */ + kinds?: { [key: string]: Field_Kind } +} + +export const StoredRecord: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.StoredRecord', + () => [ + [1, 'record', 11, 0, Record.codec], + [2, 'recent_keys', 9, 1], + [3, 'version', 4], + [4, 'kinds', 14, 584, Field_Kind_Enum], + ], + { + decode: (r: BinaryReader, end: number, m: StoredRecord): StoredRecord => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.record = Record.decode(r, r.delimited(), m.record ?? {}) + break + case 2: + ;(m.recentKeys ??= []).push(r.string()) + break + case 3: + m.version = r.uint64() + break + case 4: { + const [k, v] = r.entry( + (r) => r.string(), + (r) => r.int32(), + '', + 0, + ) + m.kinds ??= newMap() + m.kinds[k] = v + break + } + default: + r.skip(t) + } + } + return m + }, + encode: (m: StoredRecord, w: Writer): void => { + { + const v = m.record + if (v != null) Record.writeField(w, 1, v) + } + { + const a = m.recentKeys + if (a != null) for (const e of a) w.uint32(18).string(e) + } + { + const v = m.version + if (v) w.uint32(24).uint64(v) + } + { + const o = m.kinds + if (o != null) + for (const [k, v] of Object.entries(o)) { + const s = w.uint32(34).fork() + w.uint32(10).string(k) + w.uint32(16).int32(v) + w.join(s) + } + } + }, + }, + ) + +/** + * PlayerFile is the file a local host keeps for one player of one mod: the + * player's record of each type, by type name. + * + * @generated from message modlock.wasm.persist.PlayerFile + */ +export interface PlayerFile { + /** + * SteamId is the player's SteamID64. + */ + steamId?: bigint + records?: { [key: string]: StoredRecord } +} + +export const PlayerFile: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.persist.PlayerFile', + () => [ + [1, 'steam_id', 4], + [2, 'records', 11, 584, StoredRecord.codec], + ], + { + decode: (r: BinaryReader, end: number, m: PlayerFile): PlayerFile => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.steamId = r.uint64() + break + case 2: { + const [k, v] = r.entry( + (r) => r.string(), + (r) => StoredRecord.decode(r, r.delimited(), {}), + '', + {}, + ) + m.records ??= newMap() + m.records[k] = v + break + } + default: + r.skip(t) + } + } + return m + }, + encode: (m: PlayerFile, w: Writer): void => { + { + const v = m.steamId + if (v) w.uint32(8).uint64(v) + } + { + const o = m.records + if (o != null) + for (const [k, v] of Object.entries(o)) { + const s = w.uint32(18).fork() + w.uint32(10).string(k) + StoredRecord.writeField(w, 2, v) + w.join(s) + } + } + }, + }, + ) diff --git a/src/wasm/persist/persist.proto b/src/wasm/persist/persist.proto new file mode 100644 index 00000000..60ce4a50 --- /dev/null +++ b/src/wasm/persist/persist.proto @@ -0,0 +1,225 @@ +syntax = "proto3"; + +package modlock.wasm.persist; + +option go_package = "github.com/paralin/modlock/src/wasm/persist;persist"; + +// RecordType is one kind of record a mod declares in its manifest under +// persist, such as a player's stats or unlocks. A host that serves the +// persist service keeps one record of each type for each player of the mod. +message RecordType { + // Name names the type in the mod's code: up to 32 letters, digits and + // underscores, starting with a letter. + string name = 1; + + // Writers is who may change the type's records. + Writers writers = 2; + + // Fields are the record's fields by name: up to 32, each up to 32 + // letters, digits and underscores, starting with a letter. + map fields = 3; +} + +// Writers is who may change a record type's records. +enum Writers { + // WRITERS_UNKNOWN is an unset or unsupported value; a manifest must set + // one of the others. + WRITERS_UNKNOWN = 0; + + // WRITERS_SERVERS takes changes only from a game server the host trusts + // to run the mod, for a player in its game, so the values carry that + // server's trust, such as a level or rounds won. + WRITERS_SERVERS = 1; + + // WRITERS_PLAYERS holds the player's own choices, such as settings: the + // host also takes changes made for the player by the player's own PC. + WRITERS_PLAYERS = 2; +} + +// Field is one declared field of a record type. +message Field { + // Kind is what the field holds and which operations change it. + enum Kind { + // KIND_UNKNOWN is an unset or unsupported kind. + KIND_UNKNOWN = 0; + + // KIND_COUNT is a whole number from zero up, changed by add and set. + KIND_COUNT = 1; + + // KIND_NUMBER is any number, changed by add, max, min and set. + KIND_NUMBER = 2; + + // KIND_MAX is a number that keeps the highest value it was given, + // changed by max. + KIND_MAX = 3; + + // KIND_STRING is text of up to max_bytes bytes, changed by set. + KIND_STRING = 4; + + // KIND_TAGS is a set of up to 256 short strings, such as unlocks or + // completed goals, changed by insert and remove. + KIND_TAGS = 5; + } + + Kind kind = 1; + + // MaxBytes bounds a KIND_STRING field's text, up to 256; zero is 64. + uint32 max_bytes = 2; +} + +// Value is one field's value in a record. +message Value { + oneof value { + // Number holds a KIND_COUNT, KIND_NUMBER or KIND_MAX field. + double number = 1; + + // Text holds a KIND_STRING field. + string text = 2; + + // Tags holds a KIND_TAGS field. + Tags tags = 3; + } +} + +// Tags is the members of a KIND_TAGS field, in sorted order. +message Tags { + // Members are 1 to 32 bytes each. + repeated string members = 1; +} + +// Record is one player's values of one record type. A field never changed +// is absent and reads as zero, empty text or no tags. +message Record { + map fields = 1; +} + +// Op is one change to one field of a record. +message Op { + // Field names a field the record type declares. + string field = 1; + + oneof op { + // Add adds to a KIND_COUNT or KIND_NUMBER field; a count takes only a + // whole number from zero up. + double add = 2; + + // Max raises a KIND_NUMBER or KIND_MAX field to this value when it is + // higher. + double max = 3; + + // Min lowers a KIND_NUMBER field to this value when it is lower. + double min = 4; + + // Set replaces a KIND_COUNT, KIND_NUMBER or KIND_STRING field's value. + Value set = 5; + + // Insert adds a member to a KIND_TAGS field. + string insert = 6; + + // Remove takes a member from a KIND_TAGS field. + string remove = 7; + } +} + +// GetRequest reads one player's record, the request of the persist +// service's Get method. +message GetRequest { + // Player is the player's server slot. + int32 player = 1; + + // Type names a record type the manifest declares. + string type = 2; + + // Key selects one of the player's records of the type. Empty is the one + // record each player has; hosts refuse any other key for now. + string key = 3; +} + +// GetReply is the response of the Get method. +message GetReply { + // Record is the player's record; a record never written comes back empty. + Record record = 1; +} + +// GetManyRequest reads the records of several players, such as a lobby at +// join, the request of the GetMany method. +message GetManyRequest { + // Players are the players' server slots, up to 16. + repeated int32 players = 1; + + // Type names a record type the manifest declares. + string type = 2; +} + +// GetManyReply is the response of the GetMany method. +message GetManyReply { + // Records holds one entry for each asked player, in the asked order. + repeated PlayerRecord records = 1; +} + +// PlayerRecord is one player's record in a GetManyReply. +message PlayerRecord { + // Player is the player's server slot. + int32 player = 1; + + Record record = 2; +} + +// UpdateRequest changes one player's record by field operations, the +// request of the Update method. The host applies every op or none, so two +// servers that update one record at once both land; a set is the one op +// whose later write wins. +message UpdateRequest { + // Player is the player's server slot. + int32 player = 1; + + // Type names a record type the manifest declares. + string type = 2; + + // Key selects the record, as in GetRequest. + string key = 3; + + // Ops are the changes, applied in order, up to 32. + repeated Op ops = 4; + + // UpdateKey identifies the change, such as a round, so a resent update + // counts once: an update whose key is among the record's last 64 is + // left out. Up to 64 bytes; empty applies the update every time. + string update_key = 5; +} + +// UpdateReply is the response of the Update method. +message UpdateReply { + // Record is the record after the update. + Record record = 1; + + // Repeated is set when the update's key was among the record's recent + // keys, so the host left the record as it was. + bool repeated = 2; +} + +// StoredRecord is a record as a host keeps it: its values and the keys of +// its most recent updates. +message StoredRecord { + Record record = 1; + + // RecentKeys are the update keys of the record's last 64 keyed updates, + // oldest first. + repeated string recent_keys = 2; + + // Version counts the updates that changed the record. + uint64 version = 3; + + // Kinds are the kinds of the fields that wrote each value in record, so a + // value is changed only by a field of the same kind. + map kinds = 4; +} + +// PlayerFile is the file a local host keeps for one player of one mod: the +// player's record of each type, by type name. +message PlayerFile { + // SteamId is the player's SteamID64. + uint64 steam_id = 1; + + map records = 2; +}