diff --git a/CMakeLists.txt b/CMakeLists.txt index ae7a6fef..ecf81d87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,7 @@ add_library(modlock_sdk SHARED ${CMAKE_CURRENT_BINARY_DIR}/src/wasm/hero_builds_data.cc src/wasm/game_match.cc src/wasm/call_profile.cc + src/wasm/service_calls.cc src/wasm/console_lines.cc src/wasm/entity_rules.cc src/wasm/game_services.cc @@ -296,6 +297,7 @@ endif() add_executable(modlock-host src/host_app/control_link.cc + src/host_app/fixtures.cc src/host_app/game_dump.cc src/host_app/game_dump_console.cc src/host_app/game_dump_entities.cc @@ -697,6 +699,19 @@ if(BUILD_TESTING) target_compile_definitions(wasm_host_test PRIVATE EXTENSION_GO_WASM="${extension_go_wasm}") target_link_libraries(wasm_host_test PRIVATE modlock::sdk gtest_main) add_test(NAME wasm_host_test COMMAND wasm_host_test) + # host_fixtures_test runs the same mod against needed services and the + # host's fixtures, and its forwarded calls over the control link. + add_executable(host_fixtures_test tests/host_fixtures_test.cc src/host_app/fixtures.cc + src/host_app/control_link.cc + src/host_app/control/control.pb.cc) + add_dependencies(host_fixtures_test extension_go_wasm) + target_include_directories(host_fixtures_test PRIVATE src) + target_compile_definitions(host_fixtures_test PRIVATE EXTENSION_GO_WASM="${extension_go_wasm}") + target_link_libraries(host_fixtures_test PRIVATE modlock::sdk gtest_main) + if(WIN32) + target_link_libraries(host_fixtures_test PRIVATE ws2_32) + endif() + add_test(NAME host_fixtures_test COMMAND host_fixtures_test) add_executable(wasm_ui_test tests/wasm_ui_test.cc src/wasm/ui.cc) target_include_directories(wasm_ui_test PRIVATE src) target_link_libraries(wasm_ui_test PRIVATE modlock::sdk gtest_main) diff --git a/cli/cli.pb.go b/cli/cli.pb.go index 084d0395..c77f8406 100644 --- a/cli/cli.pb.go +++ b/cli/cli.pb.go @@ -635,15 +635,21 @@ func (x *Change) GetEvent() *ui.UiInputEvent { return nil } -// Press identifies a button in the interface a mod shows a player. +// Press identifies a button in the interface a mod shows a player, or a +// press a layout's script sent from its node. type Press struct { unknownFields []byte // Mod is the mod's name. Mod string `protobuf:"bytes,1,opt,name=mod,proto3" json:"mod,omitempty"` // Slot identifies the player. Slot int32 `protobuf:"varint,2,opt,name=slot,proto3" json:"slot,omitempty"` - // Node is the button's id in the mod's tree. + // Node is the button's id in the mod's tree, or the layout's. Node string `protobuf:"bytes,3,opt,name=node,proto3" json:"node,omitempty"` + // Action names a layout's press, as its script sent it with Modlock.press. + // It is empty for a button's press. + Action string `protobuf:"bytes,4,opt,name=action,proto3" json:"action,omitempty"` + // Payload is the JSON text a layout's press carries, or empty. + Payload string `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` } func (x *Press) Reset() { @@ -673,6 +679,20 @@ func (x *Press) GetNode() string { return "" } +func (x *Press) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +func (x *Press) GetPayload() string { + if x != nil { + return x.Payload + } + return "" +} + // Published reports a release. type Published struct { unknownFields []byte @@ -1271,6 +1291,8 @@ func (m *Press) CloneVT() *Press { r.Mod = m.Mod r.Slot = m.Slot r.Node = m.Node + r.Action = m.Action + r.Payload = m.Payload if len(m.unknownFields) > 0 { r.unknownFields = slices.Clone(m.unknownFields) } @@ -1960,6 +1982,12 @@ func (this *Press) EqualVT(that *Press) bool { if this.Node != that.Node { return false } + if this.Action != that.Action { + return false + } + if this.Payload != that.Payload { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -2934,6 +2962,16 @@ func (x *Press) MarshalProtoJSON(s *json.MarshalState) { s.WriteObjectField("node") s.WriteString(x.Node) } + if x.Action != "" || s.HasField("action") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("action") + s.WriteString(x.Action) + } + if x.Payload != "" || s.HasField("payload") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("payload") + s.WriteString(x.Payload) + } s.WriteObjectEnd() } @@ -2960,6 +2998,12 @@ func (x *Press) UnmarshalProtoJSON(s *json.UnmarshalState) { case "node": s.AddField("node") x.Node = s.ReadString() + case "action": + s.AddField("action") + x.Action = s.ReadString() + case "payload": + s.AddField("payload") + x.Payload = s.ReadString() } }) } @@ -4077,6 +4121,16 @@ func (m *Press) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.unknownFields != nil { i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) } + if len(m.Payload) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Payload) + i-- + dAtA[i] = 0x2a + } + if len(m.Action) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Action) + i-- + dAtA[i] = 0x22 + } if len(m.Node) > 0 { i = protobuf_go_lite.EncodeString(dAtA, i, m.Node) i-- @@ -4742,6 +4796,8 @@ func (m *Press) SizeVT() (n int) { n += protobuf_go_lite.SizeStringNonEmpty(1, m.Mod) n += protobuf_go_lite.SizeVarintNonZero(1, m.Slot) n += protobuf_go_lite.SizeStringNonEmpty(1, m.Node) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Action) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Payload) n += len(m.unknownFields) return n } @@ -5182,6 +5238,14 @@ func (x *Press) MarshalProtoText() string { protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "node") protobuf_go_lite.TextWriteString(&sb, x.Node) } + if x.Action != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "action") + protobuf_go_lite.TextWriteString(&sb, x.Action) + } + if x.Payload != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "payload") + protobuf_go_lite.TextWriteString(&sb, x.Payload) + } return protobuf_go_lite.TextFinishMessage(&sb) } @@ -6304,6 +6368,26 @@ func (m *Press) UnmarshalVT(dAtA []byte) error { return err } m.Node = v + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Action = v + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Payload = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) diff --git a/cli/cli.pb.ts b/cli/cli.pb.ts index 1bb888e3..ba8c1e68 100644 --- a/cli/cli.pb.ts +++ b/cli/cli.pb.ts @@ -875,7 +875,8 @@ export const Change: MessageType = ) /** - * Press identifies a button in the interface a mod shows a player. + * Press identifies a button in the interface a mod shows a player, or a + * press a layout's script sent from its node. * * @generated from message modlock.cli.Press */ @@ -889,9 +890,18 @@ export interface Press { */ slot?: number /** - * Node is the button's id in the mod's tree. + * Node is the button's id in the mod's tree, or the layout's. */ node?: string + /** + * Action names a layout's press, as its script sent it with Modlock.press. + * It is empty for a button's press. + */ + action?: string + /** + * Payload is the JSON text a layout's press carries, or empty. + */ + payload?: string } export const Press: MessageType = @@ -901,6 +911,8 @@ export const Press: MessageType = [1, 'mod', 9], [2, 'slot', 5], [3, 'node', 9], + [4, 'action', 9], + [5, 'payload', 9], ], { decode: (r: BinaryReader, end: number, m: Press): Press => { @@ -917,6 +929,12 @@ export const Press: MessageType = case 3: m.node = r.string() break + case 4: + m.action = r.string() + break + case 5: + m.payload = r.string() + break default: r.skip(t) } @@ -936,6 +954,14 @@ export const Press: MessageType = const v = m.node if (v) w.uint32(26).string(v) } + { + const v = m.action + if (v) w.uint32(34).string(v) + } + { + const v = m.payload + if (v) w.uint32(42).string(v) + } }, }, ) diff --git a/cli/cli.proto b/cli/cli.proto index 823709c7..fd0781fb 100644 --- a/cli/cli.proto +++ b/cli/cli.proto @@ -190,7 +190,8 @@ message Change { modlock.wasm.ui.UiInputEvent event = 2; } -// Press identifies a button in the interface a mod shows a player. +// Press identifies a button in the interface a mod shows a player, or a +// press a layout's script sent from its node. message Press { // Mod is the mod's name. string mod = 1; @@ -198,8 +199,15 @@ message Press { // Slot identifies the player. int32 slot = 2; - // Node is the button's id in the mod's tree. + // Node is the button's id in the mod's tree, or the layout's. string node = 3; + + // Action names a layout's press, as its script sent it with Modlock.press. + // It is empty for a button's press. + string action = 4; + + // Payload is the JSON text a layout's press carries, or empty. + string payload = 5; } // Published reports a release. diff --git a/cmd/modlock/play.go b/cmd/modlock/play.go index ce72301d..13751d83 100644 --- a/cmd/modlock/play.go +++ b/cmd/modlock/play.go @@ -3,6 +3,7 @@ package main import ( "bufio" "context" + "maps" "os" "path/filepath" "slices" @@ -13,6 +14,7 @@ import ( modcli "github.com/paralin/modlock/cli" "github.com/paralin/modlock/js" "github.com/paralin/modlock/project" + modpublish "github.com/paralin/modlock/publish" "github.com/paralin/modlock/sandbox" "github.com/paralin/modlock/session" "github.com/paralin/modlock/src/host_app/control" @@ -58,6 +60,10 @@ func playCommand(out *printer) *cli.Command { &cli.BoolFlag{Name: "host", Usage: "let friends join this PC's server with a join code"}, &cli.BoolFlag{Name: "lobby", Usage: "let friends join this PC's server through a Hyperline lobby"}, &cli.UintFlag{Name: "preview-port", Value: previewPort, Usage: "the watched project's browser preview port; 0 turns it off"}, + &cli.StringFlag{ + Name: "forward-services", + Usage: "answer the services the mods name from the service at this origin, as your saved modlock login, in place of fixtures", + }, ), Action: func(c *cli.Context) error { // Take each mod as a built mod or a project's build, building a @@ -168,6 +174,9 @@ func startSession(c *cli.Context, out *printer, mods []string, logPath string) ( // Run the mods in the sandbox, with the interpreters from the host's // package and the modules compiled in earlier sessions. out.sandbox(reason) + if c.String("forward-services") != "" { + out.mark("!", yellow, "the sandbox answers services from fixtures; --forward-services works only in the game") + } compiled := "" if cache, err := os.UserCacheDir(); err == nil { compiled = filepath.Join(cache, "modlock", "compiled") @@ -183,10 +192,25 @@ func startSession(c *cli.Context, out *printer, mods []string, logPath string) ( host, err := session.FindHost(ctx, Version) return filepath.Dir(host), err }, - Events: events, + Events: events, + Fixtures: projectFixtures, }), nil } +// projectFixtures is the service fixture directory of the project whose build +// is at path, or empty for a built mod outside a project. +func projectFixtures(path string) string { + // A project's build sits in its build directory. + if filepath.Base(path) != project.BuildDir { + return "" + } + dir := filepath.Dir(path) + if _, err := os.Stat(filepath.Join(dir, project.ManifestFile)); err != nil { + return "" + } + return filepath.Join(dir, sandbox.FixtureDir) +} + // startServer starts a local server with mods on mapName, writing its console // to logPath and passing the host's events to events. func startServer(c *cli.Context, out *printer, events func(*control.HostEvent), mods []string, mapName, logPath string) (*session.Session, error) { @@ -212,6 +236,17 @@ func startServer(c *cli.Context, out *printer, events func(*control.HostEvent), out.mark("!", yellow, "mod interfaces show only in the browser preview: "+err.Error()) } } + // Hand the host the projects' service fixtures, or the services to + // forward, naming who answers each service the mods call. + forward := strings.TrimSuffix(c.String("forward-services"), "/") + fixtures, err := writeFixtures(out, mods, filepath.Join(filepath.Dir(logPath), "fixtures.pb"), forward) + if err != nil { + return nil, err + } + answer, err := forwarder(forward) + if err != nil { + return nil, err + } running, err := session.Start(c.Context, session.Config{ Version: Version, Mods: mods, @@ -220,6 +255,8 @@ func startServer(c *cli.Context, out *printer, events func(*control.HostEvent), Args: c.StringSlice("arg"), Settings: configPath("settings.json"), Files: configPath("files"), + Fixtures: fixtures, + Answer: answer, Launch: !c.Bool("no-game"), HostOutput: log, Interface: ui, @@ -241,6 +278,86 @@ func startServer(c *cli.Context, out *printer, events func(*control.HostEvent), return running, nil } +// 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) { + // Read each named service's fixture from its mod's project, or forward + // every service to the origin forward names. + fixtures := &control.Fixtures{} + for _, mod := range mods { + manifest, err := project.ReadManifest(mod) + if err != nil { + return "", err + } + slug := manifest.GetSlug() + for _, service := range manifest.GetServices() { + name := service.GetName() + if forward != "" { + out.mark("·", dim, slug+": service "+name+": forwarded to "+forward) + fixtures.Forwards = append(fixtures.Forwards, &control.Forward{Mod: slug, Service: name, Target: forward}) + continue + } + source, replies, err := sandbox.ReadFixture(projectFixtures(mod), name) + switch { + case err != nil: + return "", err + case source != "": + out.mark("·", dim, slug+": service "+name+": fixture "+source) + case service.GetOptional(): + out.mark("·", dim, slug+": service "+name+": nobody (optional)") + default: + out.mark("!", yellow, slug+": service "+name+": nobody; the mod needs it, so add "+ + filepath.Join(sandbox.FixtureDir, name+".json")) + } + + // Keep the replies in method order, so the file is the same each run. + for _, method := range slices.Sorted(maps.Keys(replies)) { + fixtures.Fixtures = append(fixtures.Fixtures, &control.Fixture{ + Mod: slug, Service: name, Method: method, Payload: replies[method], Source: source, + }) + } + } + } + + // Write the file the host reads, or none. + if len(fixtures.GetFixtures()) == 0 && len(fixtures.GetForwards()) == 0 { + return "", nil + } + data, err := fixtures.MarshalVT() + if err != nil { + return "", err + } + if err := os.WriteFile(path, data, 0o644); err != nil { + return "", errors.Wrap(err, "write the service fixtures") + } + return path, nil +} + +// forwarder returns what answers the forwarded calls: the service at origin, +// called with the saved modlock login, read at each call; nil without origin. +func forwarder(origin string) (func(context.Context, *control.ServiceCall) ([]byte, error), error) { + // Forward only when asked, to a service that keeps the session private. + if origin == "" { + return nil, nil + } + if err := modpublish.CheckOrigin(origin); err != nil { + return nil, errors.Wrap(err, "--forward-services") + } + sessionFile, err := hyperlineSessionFile() + if err != nil { + return nil, err + } + service := &modpublish.Hyperline{Origin: origin, SessionFile: sessionFile} + return func(ctx context.Context, call *control.ServiceCall) ([]byte, error) { + return service.CallService(ctx, &modpublish.ServiceCall{ + Mod: call.GetMod(), Service: call.GetService(), Method: call.GetMethod(), Payload: call.GetPayload(), + }) + }, nil +} + // readRenderer returns the built renderer the game draws the mods' // interfaces with. func readRenderer(ctx context.Context) (*session.Renderer, error) { @@ -361,9 +478,13 @@ func input(ctx context.Context, out *printer, running server, box *sandbox.Sandb // deliver presses the button or sends the command in to the sandbox's mods, // and returns a line for the creator when no mod received it, or empty. func deliver(ctx context.Context, box *sandbox.Sandbox, in *modcli.Input) string { - // Press the button. + // Press the button, or send the layout's press; a press the game would + // refuse says why. if press := in.GetPress(); press != nil { - pressed, err := box.Press(ctx, press.GetMod(), press.GetSlot(), press.GetNode()) + pressed, err := box.Press(ctx, press.GetMod(), press.GetSlot(), press.GetNode(), press.GetAction(), press.GetPayload()) + if err != nil && ctx.Err() == nil { + return press.GetMod() + ": " + err.Error() + } if err == nil && !pressed { return press.GetMod() + " is not running to receive the press" } diff --git a/cmd/modlock/play_test.go b/cmd/modlock/play_test.go new file mode 100644 index 00000000..f5d0b5bb --- /dev/null +++ b/cmd/modlock/play_test.go @@ -0,0 +1,147 @@ +package main + +import ( + "io" + "os" + "path/filepath" + "slices" + "strings" + "testing" + + "github.com/paralin/modlock/src/host_app/control" +) + +// TestWriteFixtures checks a real-game session hands the host its project's +// fixtures and names who answers each service. +func TestWriteFixtures(t *testing.T) { + // A project names a needed service with a fixture, an optional one + // without, and a needed one without. + dir := t.TempDir() + build := filepath.Join(dir, "build") + manifest := `{"slug":"drills","services":[{"name":"example.drills.v1"},` + + `{"name":"example.ghosts.v1","optional":true},{"name":"example.scores.v1"}]}` + 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) + } + } + fixture := filepath.Join(dir, "services", "example.drills.v1.json") + if err := os.MkdirAll(filepath.Dir(fixture), 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(fixture, []byte(`{"read": { "key": "slide" }, "save": true}`), 0o644); err != nil { + t.Fatal(err) + } + + // 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, "") + }) + if written != path { + t.Fatalf("wrote %q, want %q", written, path) + } + + // Each service names its provider, and the missing needed one says how to + // add it. + for _, want := range []string{ + "drills: service example.drills.v1: fixture " + fixture, + "drills: service example.ghosts.v1: nobody (optional)", + "drills: service example.scores.v1: nobody; the mod needs it, so add " + + filepath.Join("services", "example.scores.v1.json"), + } { + if !strings.Contains(printed, want) { + t.Errorf("output lacks %q:\n%s", want, printed) + } + } + + // The file holds each method's compact reply, in method order. + data, err := os.ReadFile(path) + if err != nil { + t.Fatal(err) + } + fixtures := &control.Fixtures{} + if err := fixtures.UnmarshalVT(data); err != nil { + t.Fatal(err) + } + var got []string + for _, each := range fixtures.GetFixtures() { + got = append(got, each.GetMod()+" "+each.GetService()+" "+each.GetMethod()+" "+ + string(each.GetPayload())+" "+each.GetSource()) + } + want := []string{ + "drills example.drills.v1 read {\"key\":\"slide\"} " + fixture, + "drills example.drills.v1 save true " + fixture, + } + if strings.Join(got, "\n") != strings.Join(want, "\n") { + t.Fatalf("fixtures:\n%s\nwant:\n%s", strings.Join(got, "\n"), strings.Join(want, "\n")) + } + + // 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"), "") + if err != nil || none != "" { + t.Fatalf("a mod without fixtures wrote %q, %v", none, err) + } + + // 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") + }) + data, err = os.ReadFile(forwarded) + if err != nil { + t.Fatal(err) + } + fixtures = &control.Fixtures{} + if err := fixtures.UnmarshalVT(data); err != nil { + t.Fatal(err) + } + got = nil + for _, each := range fixtures.GetForwards() { + got = append(got, each.GetMod()+" "+each.GetService()+" "+each.GetTarget()) + if !strings.Contains(printed, "drills: service "+each.GetService()+": forwarded to http://127.0.0.1:9") { + t.Errorf("output lacks the forward of %s:\n%s", each.GetService(), printed) + } + } + if len(fixtures.GetFixtures()) != 0 || !slices.Equal(got, []string{ + "drills example.drills.v1 http://127.0.0.1:9", + "drills example.ghosts.v1 http://127.0.0.1:9", + "drills example.scores.v1 http://127.0.0.1:9", + }) { + t.Errorf("forwarded %q with %d fixtures", got, len(fixtures.GetFixtures())) + } +} + +// TestForwarderNeedsASafeOrigin forwards nothing without the flag and refuses +// an origin that would send the session in the clear. +func TestForwarderNeedsASafeOrigin(t *testing.T) { + if answer, err := forwarder(""); answer != nil || err != nil { + t.Errorf("no origin: %v, %v", answer != nil, err) + } + if _, err := forwarder("http://example.com"); err == nil { + t.Error("a plain http origin was taken") + } +} + +// capture runs fn with standard output kept, returning what it printed and +// fn's path, and failing the test on fn's error. +func capture(t *testing.T, fn func() (string, error)) (string, string) { + t.Helper() + reader, writer, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + stdout := os.Stdout + os.Stdout = writer + path, fnErr := fn() + os.Stdout = stdout + _ = writer.Close() + printed, _ := io.ReadAll(reader) + if fnErr != nil { + t.Fatal(fnErr) + } + return string(printed), path +} diff --git a/docs/content/guides/layouts.mdx b/docs/content/guides/layouts.mdx index 75d21d93..e4517cc6 100644 --- a/docs/content/guides/layouts.mdx +++ b/docs/content/guides/layouts.mdx @@ -67,7 +67,31 @@ it delivers `PlaySoundEffect` to every script, and no sound has that name, so none plays. The library hears it, rereads each attribute, and calls the handler of each value that changed. -The layout answers the mod with its own console commands. +The layout answers the mod by pressing back. `Modlock.press('buy', { item: +'boots' })` sends the action with its payload as JSON, and the layout's +element hears it as `onAction`, with the player the server says sent it: + +```tsx + buy(player, action, payload)} +/> +``` + +A press runs the console command `modlockaction +[payload]` in the player's game, the payload's UTF-8 in unpadded base64url. +The server checks the press against the player who sent it and that +player's tree. It takes a press only while that player's tree shows the +layout. The action must be one to 64 letters, digits, `_`, `-` and `.`, and +the payload at most 180 bytes of UTF-8. Each player gets a burst of 8 +presses, refilling at 4 a second. It takes nothing once the mod stops. +`press` returns false and logs a line for a press it will not send: a name +the server would refuse, a payload over 180 bytes, or a layout the renderer +did not name. A press the server refuses goes to the server's log. A +layout may still run its own console commands. `modlock dev` and +`modlock play` in the sandbox draw a layout's panels but run none of its +scripts, so a press happens only in the game. ## The renderer diff --git a/docs/content/reference/manifest.mdx b/docs/content/reference/manifest.mdx index 391a667a..56d460d6 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. | +| `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). | ## Map @@ -247,6 +248,52 @@ 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. +## Services + +Name each service the mod calls in `mod.json`; a service is needed unless it +is marked optional. The sandbox and the game host refuse to start a mod whose +needed service nobody provides there, naming it, and start one without an +optional service, whose calls then fail: + +```json +"services": [ + { "name": "example.drills.v1" }, + { "name": "example.ghosts.v1", "optional": true } +] +``` + +`modlock play` answers a named service from a fixture in the project, in the +sandbox and in the game: `services/.json`, an object whose keys are the +service's methods and whose values are their replies, sent as JSON. Before the +mod starts, it logs which provider answers each named service: a fixture or +nobody. In the game, `modlock play` hands the host the fixtures in a file it +names with `--fixtures`, and each fixture answers only its own mod. + +`modlock play --forward-services ` answers the mod's named services +from the service at that origin in place of fixtures, in the game only. Each +call a mod starts goes from the host over `--control` to `modlock play`, which +posts it to `/api/mods/services/call` with the session `modlock login` +saved, read at each call, and hands back the answer. It never signs in: without +a saved session for that origin the call fails, naming `modlock login`. The +origin must be https, or http on 127.0.0.1. A forwarded service answers only +calls started with `callServiceLater`, and at most 8 calls wait on the origin +at once; the host fails the calls still waiting when `modlock play` goes. + +A service may answer in a later frame, as one that asks a server across the +network does. `callServiceLater(service, method, payload, done)` returns at +once, and `done(reply, error, failure)` runs once in a later frame: with the +reply, or with the service's refusal, a timeout or `unavailable` when nobody +provides the service, which is then never asked. The host waits at most 30 +seconds, or the call's own shorter timeout, and drops the calls a mod still +waits for when it stops or reloads. A service that answers at once, a +fixture among them, answers a started call the same way in the next frame, so +a mod cannot tell which provider it has. A host provides a service that +answers later with `WasmHost::ProvideLater`. + +```json +{ "read": { "key": "slide" }, "save": true } +``` + ## The built manifest `modlock build` writes a `mod.json` into `build/` that adds the `entry` file and diff --git a/include/modlock/wasm_host.h b/include/modlock/wasm_host.h index 0fee4c92..9478f8bc 100644 --- a/include/modlock/wasm_host.h +++ b/include/modlock/wasm_host.h @@ -59,6 +59,12 @@ class MODLOCK_API WasmHostObserver { // that stops, and a player who leaves, end with a reset change. virtual void Ui(std::string_view mod, int32_t slot, const wasm::ui::Change& change) = 0; + // Halted reports that mod's running build stopped: for a reload, a + // restart, a failure or the mod's end. Its started service calls are + // dropped before its next build starts, so a host forgets what it keeps + // for them here, and their replies do nothing. + virtual void Halted(std::string_view /*mod*/) {} + // Slowed reports an event of mod that ran past its slow time and finished, // with where the time went. The players may restart a mod that stays stuck. virtual void Slowed(std::string_view /*mod*/, std::string_view /*report*/) {} @@ -87,6 +93,19 @@ class MODLOCK_API WasmHostObserver { using WasmExtension = std::function( std::string_view mod, std::string_view method, std::string_view payload)>; +// WasmReply ends one started call to a service the host provides: with the +// answer, or an error the mod receives as the service's refusal. It may run +// on any thread, at most once; once the call timed out or the mod stopped, +// it does nothing. +using WasmReply = std::function answer)>; + +// WasmLateExtension takes mods' started calls to one service the host +// provides, answered in a later frame. It receives the calling mod's name, +// the method, the payload and the reply that ends the call, which it may +// keep and run later. Modlock times the call out after at most 30 seconds. +using WasmLateExtension = std::function; + // WasmHost runs WebAssembly mods. Each mod runs in its own sandbox and reaches // the game only through the host requests in src/wasm/wasm.proto. An // event that runs past half a second finishes; the host warns the players in @@ -153,6 +172,14 @@ class MODLOCK_API WasmHost { // service's earlier extension. An empty extension withdraws the service. void Provide(std::string service, WasmExtension extension); + // ProvideLater takes mods' started calls to service with extension, which + // answers each through its reply, replacing the service's earlier late + // extension. An empty extension withdraws it. A mod's started call to a + // service with only an extension from Provide is answered by that + // extension in the next frame; a CallService to a service with only a late + // extension is refused. + void ProvideLater(std::string service, WasmLateExtension extension); + // KeepSettings keeps players' settings in settings, which must stay valid // until the host is destroyed or keeps them elsewhere. A null settings // returns to the host's own, which last until it is destroyed. diff --git a/js/library.go b/js/library.go index 51a56f2a..58dd3ef5 100644 --- a/js/library.go +++ b/js/library.go @@ -409,8 +409,8 @@ func Build(ctx context.Context, source, out string) error { } } - // Bundle the library, the entity classes, the console, the renderer and - // the pages. + // Bundle the library, the entity classes, the console, the renderer, the + // layout library and the pages, which run the layout library as well. bundles := []struct { name string options api.BuildOptions @@ -420,6 +420,7 @@ func Build(ctx context.Context, source, out string) error { {"console.js", api.BuildOptions{EntryPoints: []string{"js/src/console.ts"}, Format: api.FormatESModule, Target: api.ES2023, External: []string{"modlock"}}}, {Renderer, api.BuildOptions{EntryPoints: []string{"panorama/src/main.ts"}, Format: api.FormatIIFE, Target: api.ES2020, MinifyWhitespace: true, MinifyIdentifiers: true, MinifySyntax: true}}, {LayoutLibrary, api.BuildOptions{EntryPoints: []string{"panorama/src/layout.ts"}, Format: api.FormatIIFE, GlobalName: "Modlock", Target: api.ES2020, MinifySyntax: true}}, + {Preview + "/" + LayoutLibrary, api.BuildOptions{EntryPoints: []string{"panorama/src/layout.ts"}, Format: api.FormatIIFE, GlobalName: "Modlock", Target: api.ES2020, MinifySyntax: true}}, {Preview + "/preview.js", api.BuildOptions{EntryPoints: []string{"panorama/browser/preview.ts"}, Format: api.FormatIIFE, Target: api.ES2022, MinifySyntax: true}}, {Studio + "/studio.js", api.BuildOptions{ EntryPoints: []string{"studio/web/main.tsx"}, Format: api.FormatIIFE, Target: api.ES2022, diff --git a/js/src/host.gen.ts b/js/src/host.gen.ts index 482b7c31..71fb7f59 100644 --- a/js/src/host.gen.ts +++ b/js/src/host.gen.ts @@ -513,6 +513,21 @@ const cameraParamValues: Record = { horizontalOffset: 4, } +/** ServiceFailure says why a service call ended without an answer. */ +export type ServiceFailure = + | 'none' + | 'refused' + | 'timeout' + | 'unavailable' + +/** serviceFailureNames decodes each ServiceFailure; an unknown value has no name. */ +const serviceFailureNames: Partial> = { + 0: 'none', + 1: 'refused', + 2: 'timeout', + 3: 'unavailable', +} + /** Ability is one ability a hero owns. */ export interface Ability { /** name is the ability's name, such as citadel_ability_hornet_snipe. */ @@ -2629,12 +2644,28 @@ function fromWheel(message: uiPb.Wheel): Wheel { } } -/** UiPressEvent reports a press on a button in a player's interface. */ +/** + * UiPressEvent reports a press on a button in a player's interface, or a + * press a layout's script sent with an action and a payload. + */ export interface UiPressEvent { /** player is the player who pressed. */ readonly player: Player - /** node is the id of the pressed button. */ + /** + * node is the id of the pressed button, or of the layout whose script + * sent the press. + */ readonly node: string + /** + * action names a layout's press, as its script sent it: one to 64 + * letters, digits, '_', '-' and '.'. It is empty for a button's press. + */ + readonly action: string + /** + * payload is the text a layout's press carries, which the layout library + * writes as JSON: valid UTF-8 of at most 180 bytes. + */ + readonly payload: string } /** fromUiPressEvent decodes an UiPressEvent. */ @@ -2642,6 +2673,8 @@ function fromUiPressEvent(message: uiPb.UiPressEvent): UiPressEvent { return { player: Player.of(message.player ?? 0), node: message.node ?? '', + action: message.action ?? '', + payload: message.payload ?? '', } } @@ -2888,6 +2921,28 @@ export interface ServiceReply { payload: Uint8Array } +/** ServiceRepliedEvent ends one started service call. */ +export interface ServiceRepliedEvent { + /** call is the number StartServiceCall returned. */ + readonly call: bigint + /** payload is the answer, when failure is none. */ + readonly payload: Uint8Array + /** failure says why the call ended without an answer. */ + readonly failure?: ServiceFailure + /** error describes the failure. */ + readonly error: string +} + +/** fromServiceRepliedEvent decodes a ServiceRepliedEvent. */ +function fromServiceRepliedEvent(message: wasmPb.ServiceRepliedEvent): ServiceRepliedEvent { + return { + call: message.call ?? 0n, + payload: message.payload ?? new Uint8Array(), + failure: serviceFailureNames[message.failure ?? 0], + error: message.error ?? '', + } +} + /** PrecacheOptions names what the next world loads ahead of use. */ export interface PrecacheOptions { /** heroes are hero names, such as hero_wraith. */ @@ -3951,6 +4006,23 @@ export function callService(service: string, method: string, payload: Uint8Array return response.payload ?? new Uint8Array() } +/** + * startServiceCall calls method of a service the host provides and + * returns at once with a number; the answer arrives in a later frame as a + * ServiceReplied event carrying that number. Every call ends once: with + * the reply, the service's refusal, a timeout or no provider at all. A + * service nobody provides is never asked. The host waits at most 30 + * seconds, or the call's shorter timeout, and drops the mod's waiting + * calls when the mod stops or reloads. A service that answers at once + * answers this way too, in the next frame. + */ +export function startServiceCall(service: string, method: string, payload: Uint8Array, timeoutMilliseconds: number): bigint | undefined { + const reply = call('StartServiceCall', wasmPb.StartServiceCallRequest.toBinary({ service, method, payload, timeoutMilliseconds })) + if (reply === undefined) return undefined + const response = wasmPb.ServiceCallStarted.fromBinary(reply) + return response.call ?? 0n +} + /** * createEntity creates an entity the server knows by its designer name, * such as npc_trooper_boss or prop_dynamic, with spawn key values and fields @@ -4256,6 +4328,8 @@ export interface ModHandlers { uiInput(event: UiInputEvent): void /** serve calls a service the mod serves from the host. */ serve(event: ServiceCall): ServiceReply + /** serviceReplied ends one StartServiceCall, in a frame after the call. */ + serviceReplied(event: ServiceRepliedEvent): void /** * damage offers one hit before the game applies it, while the mod asked * for damage. The mod's answer may block the hit or change its amount. @@ -4383,6 +4457,9 @@ export function serveMod(handlers: ModHandlers, bytes: Uint8Array): Uint8Array { return reply() case 'Serve': return reply(wasmPb.ServiceReply.toBinary(handlers.serve(fromServiceCall(wasmPb.ServiceCall.fromBinary(input))))) + case 'ServiceReplied': + handlers.serviceReplied(fromServiceRepliedEvent(wasmPb.ServiceRepliedEvent.fromBinary(input))) + return reply() case 'Damage': return reply(combatPb.DamageResult.toBinary(handlers.damage(fromDamageEvent(combatPb.DamageEvent.fromBinary(input))))) case 'Damaged': diff --git a/js/src/index.ts b/js/src/index.ts index e8ae7d25..108ef861 100644 --- a/js/src/index.ts +++ b/js/src/index.ts @@ -40,6 +40,8 @@ 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' @@ -235,6 +237,47 @@ 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 @@ -648,6 +691,9 @@ 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)[] = [] @@ -755,7 +801,7 @@ const handlers: ModHandlers = { uiPress(event) { // A press arrives under the same CPU budget as a command, so its handler // also runs with the next frame. - after(0, () => press(event.player, event.node)) + after(0, () => press(event.player, event.node, event.action, event.payload)) }, uiInput(event) { @@ -771,6 +817,22 @@ const handlers: ModHandlers = { return { payload: registered.handler(event.method, event.payload) } }, + 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) + }, + // scriptc types an unannotated method that returns literals of different // shapes by those literals rather than by ModHandlers, and the call throws. damage(event): DamageResult { diff --git a/js/src/ui.ts b/js/src/ui.ts index 5e551518..4b74ce38 100644 --- a/js/src/ui.ts +++ b/js/src/ui.ts @@ -40,7 +40,10 @@ // . Its script runs in the player's // game, so only a host that has reviewed the mod's content loads it; elsewhere // it draws nothing. The script includes the Panorama library -// scripts/modlock/layout.js and reads data with Modlock.data. +// scripts/modlock/layout.js and reads data with Modlock.data. It presses +// back with Modlock.press('buy', { item: 'boots' }), which runs the element's +// onAction with the player who pressed, the action and the payload: +// ...} />. // // route sends a player a named JSON value that every layout of the mod reads // with Modlock.route, wherever it sits in the tree, such as @@ -359,6 +362,7 @@ export interface Props { readonly sound?: string readonly disabled?: boolean readonly onPress?: (player: Player) => void + readonly onAction?: LayoutPressHandler readonly enter?: Style readonly exit?: Style readonly cycle?: Cycle @@ -548,16 +552,28 @@ export interface ButtonProps extends ElementProps { onPress?: (player: Player) => void } +/** + * LayoutPressHandler hears a press a layout's script sent: the player the + * server says sent it, its action and its JSON payload, undefined for none. + */ +export type LayoutPressHandler = ( + player: Player, + action: string, + payload: unknown, +) => void + /** * LayoutProps load a layout from the mod's content addon: src is its path * there, such as 'shop.xml', and data is the JSON value its script reads with - * Modlock.data. + * Modlock.data. onAction hears each press its script sends with + * Modlock.press. */ export interface LayoutProps { class?: string style?: Style src: string data?: unknown + onAction?: LayoutPressHandler } /** JSX types the elements a mod's JSX may use. */ @@ -861,8 +877,32 @@ export function uiSound( return draw(player) } -/** press runs the handler of the button the player pressed. */ -export function press(player: Player, node: string): void { +/** + * press runs the handler of the button the player pressed, or, for a press + * with an action, the handler of the layout whose script sent it, with the + * payload's JSON, undefined for none or for text JSON cannot read. + */ +export function press( + player: Player, + node: string, + action = '', + payload = '', +): void { + // A press with an action came from a layout's script, not a button. + if (action !== '') { + const pressed = screens.get(player.slot)?.actions.get(node) + if (pressed) { + let value: unknown = undefined + try { + value = payload === '' ? undefined : (JSON.parse(payload) as unknown) + } catch { + value = undefined + } + pressed.handler(player, action, value) + } + return + } + // A click on the game's ability bar names its slot, which no button's id // does. const bar = abilityBarNode.exec(node) @@ -1087,6 +1127,8 @@ interface Screen { readonly presses: Map void }> /** changes maps each input's id to its handler, as presses does. */ readonly changes: Map + /** actions maps each layout's id to its press handler, as presses does. */ + readonly actions: Map /** wheels holds only the enabled sliders that opted in to wheel events. */ readonly wheels: Map< string, @@ -1157,6 +1199,7 @@ class Layout { ids: new Map(), presses: new Map(), changes: new Map(), + actions: new Map(), wheels: new Map(), next: previous?.next ?? 0, } @@ -1275,6 +1318,9 @@ function place(layout: Layout, child: Child, at: string): string[] { node.layout = props.src ?? '' node.data = props.data === undefined ? '' : (JSON.stringify(props.data) ?? '') + if (props.onAction) { + layout.screen.actions.set(node.id!, { handler: props.onAction }) + } break default: node.kind = Kind.PANEL diff --git a/js/test/service-later.test.ts b/js/test/service-later.test.ts new file mode 100644 index 00000000..3b6daf46 --- /dev/null +++ b/js/test/service-later.test.ts @@ -0,0 +1,90 @@ +import { expect, test } from 'bun:test' + +import { + Call, + Reply, + ServiceCallStarted, + ServiceFailure, + ServiceRepliedEvent, + StartServiceCallRequest, +} from '../../src/wasm/wasm.pb.js' +import { bind, deliver as dispatch } from '../src/host.js' +import { callServiceLater } from '../src/index.js' + +/** started holds the calls the mod started, in order. */ +const started: { service: string; method: string; timeout: number }[] = [] + +// The host numbers each started call from one. +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 ?? '', + timeout: request.timeoutMilliseconds ?? 0, + }) + const call = BigInt(started.length) + return Reply.toBinary({ response: ServiceCallStarted.toBinary({ call }) }) +}) + +/** replied delivers one ServiceReplied event as the host does. */ +function replied( + event: Parameters[0], +): void { + const reply = Reply.fromBinary( + dispatch( + Call.toBinary({ + method: 'ServiceReplied', + request: ServiceRepliedEvent.toBinary(event), + }), + ), + ) + expect(reply.error ?? '').toBe('') +} + +test('a started call ends once, through the event carrying its number', () => { + // Start an answered call and a refused one. + const ended: string[] = [] + callServiceLater( + 'example.drills.v1', + 'Drill', + new Uint8Array([1]), + (reply, error, failure) => { + ended.push( + error + ? `${failure}: ${error}` + : `reply ${Array.from(reply ?? []).join(',')}`, + ) + }, + ) + callServiceLater( + 'example.drills.v1', + 'Drill', + new Uint8Array(), + (reply, error, failure) => + ended.push(error ? `${failure}: ${error}` : 'reply'), + 500, + ) + expect(started).toEqual([ + { service: 'example.drills.v1', method: 'Drill', timeout: 0 }, + { service: 'example.drills.v1', method: 'Drill', timeout: 500 }, + ]) + expect(ended).toEqual([]) + + // Each ends with its own event, and a repeated or unknown number does + // nothing. + replied({ + call: 2n, + failure: ServiceFailure.TIMEOUT, + error: 'too slow', + }) + replied({ call: 1n, payload: new Uint8Array([7, 8]) }) + replied({ call: 1n, payload: new Uint8Array([9]) }) + replied({ call: 99n, payload: new Uint8Array([9]) }) + expect(ended).toEqual(['timeout: too slow', 'reply 7,8']) +}) diff --git a/js/test/ui.test.ts b/js/test/ui.test.ts index 82f3dfb8..96d84d4d 100644 --- a/js/test/ui.test.ts +++ b/js/test/ui.test.ts @@ -178,6 +178,40 @@ test('clicks on the ability bar reach the handler while the root asks', () => { expect(slots).toEqual([0, 3]) }) +test("a layout's press reaches its onAction with the player and payload", () => { + // The layout's node goes out as a layout; its press comes back with the + // player the host named, the action and the payload's JSON. + const player = new Player(5) + const heard: [number, string, unknown][] = [] + show( + player, + jsx('layout', { + src: 'card.xml', + onAction: (by: Player, action: string, payload: unknown) => + heard.push([by.slot, action, payload]), + }), + ) + const node = sent.at(-1)!.change!.set!.find((each) => each.layout)! + press(player, node.id!, 'vote', '{"vote":1}') + press(player, node.id!, 'close', '') + press(player, node.id!, 'keep', 'not json') + expect(heard).toEqual([ + [5, 'vote', { vote: 1 }], + [5, 'close', undefined], + [5, 'keep', undefined], + ]) + + // A plain press on the layout, or an action on another node, runs nothing. + press(player, node.id!) + press(player, 'elsewhere', 'vote', '{}') + expect(heard.length).toBe(3) + + // A screen without the layout takes its presses no longer. + show(player, jsx('panel', {})) + press(player, node.id!, 'vote', '{}') + expect(heard.length).toBe(3) +}) + test("the ability display names each row's player as Tab shows them", () => { // Each row carries its player's slot, name and hero, with its abilities' // ids, pictures and upgrades; the viewer's row is its own. diff --git a/luau/library.luau b/luau/library.luau index c63d3988..bee561ac 100644 --- a/luau/library.luau +++ b/luau/library.luau @@ -266,6 +266,14 @@ local commands: { [string]: (player: Player, args: string) -> () } = {} -- services maps each service the mod serves to its handler. local services: { [string]: Service } = {} +-- ServiceDone ends one callServiceLater: with the reply and no error, or with +-- no reply, the error and the failure that says why. +export type ServiceDone = (reply: string?, error: string?, failure: ServiceFailure) -> () + +-- waiting maps each started service call's number to the function its end +-- runs. +local waiting: { [number]: ServiceDone } = {} + -- starts to settingChanges hold each event's handlers, which run in -- registration order. local starts: { (args: { string }) -> () } = {} @@ -884,6 +892,25 @@ function modlock.serve(service: string, handler: Service) services[service] = handler end +-- 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 timeout seconds or nobody +-- provides the service. Zero or nil waits the host's longest, 30 seconds. +-- done runs once while the mod runs; calls still waiting when the mod stops +-- end with it. +function modlock.callServiceLater(service: string, method: string, payload: string, done: ServiceDone, timeout: number?) + -- A call the host refuses to start ends in the next frame as well, so + -- done never runs before this returns. + local call = modlock.startServiceCall(service, method, payload, math.floor((timeout or 0) * 1000)) + if call == nil then + modlock.after(0, function() + done(nil, "the host did not start the call to " .. service, "unavailable") + end) + return + end + waiting[call] = done +end + -- 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 -- next server frame, before the frame handlers, and receives the text after @@ -1495,6 +1522,19 @@ local handlers: ModHandlers = { end end, + serviceReplied = function(event) + local done = waiting[event.call] + if done == nil then + return + end + waiting[event.call] = nil + if event.failure ~= nil and event.failure ~= "none" then + done(nil, event.error, event.failure) + return + end + done(event.payload, nil, "none") + end, + npcsRestored = function(event) for _, handler in npcsRestoreds do handler(if event.error ~= "" then event.error else nil) diff --git a/luau/modlock/init.luau b/luau/modlock/init.luau index 572c4cfd..6e445ce9 100644 --- a/luau/modlock/init.luau +++ b/luau/modlock/init.luau @@ -458,6 +458,19 @@ local CameraParam: { [any]: any } = { horizontalOffset = 4, } +-- ServiceFailure says why a service call ended without an answer. +export type ServiceFailure = "none" | "refused" | "timeout" | "unavailable" +local ServiceFailure: { [any]: any } = { + [0] = "none", + none = 0, + [1] = "refused", + refused = 1, + [2] = "timeout", + timeout = 2, + [3] = "unavailable", + unavailable = 3, +} + -- Ability is one ability a hero owns. export type Ability = { -- name is the ability's name, such as citadel_ability_hornet_snipe. @@ -1594,12 +1607,20 @@ export type Wheel = { fraction: number, } --- UiPressEvent reports a press on a button in a player's interface. +-- UiPressEvent reports a press on a button in a player's interface, or a +-- press a layout's script sent with an action and a payload. export type UiPressEvent = { -- player is the player who pressed. player: Player, - -- node is the id of the pressed button. + -- node is the id of the pressed button, or of the layout whose script + -- sent the press. node: string, + -- action names a layout's press, as its script sent it: one to 64 + -- letters, digits, '_', '-' and '.'. It is empty for a button's press. + action: string, + -- payload is the text a layout's press carries, which the layout library + -- writes as JSON: valid UTF-8 of at most 180 bytes. + payload: string, } -- UiInputEvent reports a change the player made to an input in their @@ -1733,6 +1754,18 @@ export type ServiceReply = { payload: string, } +-- ServiceRepliedEvent ends one started service call. +export type ServiceRepliedEvent = { + -- call is the number StartServiceCall returned. + call: number, + -- payload is the answer, when failure is none. + payload: string, + -- failure says why the call ended without an answer. + failure: ServiceFailure?, + -- error describes the failure. + error: string, +} + -- PrecacheOptions names what the next world loads ahead of use. export type PrecacheOptions = { -- heroes are hero names, such as hero_wraith. @@ -3993,6 +4026,8 @@ schema.Change = { schema.UiPressEvent = { { number = 1, name = "player", kind = "int32", class = Player, key = "slot" }, { number = 2, name = "node", kind = "string" }, + { number = 3, name = "action", kind = "string" }, + { number = 4, name = "payload", kind = "string" }, } schema.UiInputEvent = { { number = 1, name = "player", kind = "int32", class = Player, key = "slot" }, @@ -4065,6 +4100,21 @@ schema.ServiceCall = { schema.ServiceReply = { { number = 1, name = "payload", kind = "bytes" }, } +schema.StartServiceCallRequest = { + { number = 1, name = "service", kind = "string" }, + { number = 2, name = "method", kind = "string" }, + { number = 3, name = "payload", kind = "bytes" }, + { number = 4, name = "timeoutMilliseconds", kind = "uint32" }, +} +schema.ServiceCallStarted = { + { number = 1, name = "call", kind = "uint64" }, +} +schema.ServiceRepliedEvent = { + { number = 1, name = "call", kind = "uint64" }, + { number = 2, name = "payload", kind = "bytes" }, + { number = 3, name = "failure", kind = "enum", enum = ServiceFailure }, + { number = 4, name = "error", kind = "string" }, +} schema.LogRequest = { { number = 1, name = "message", kind = "string" }, } @@ -4459,6 +4509,22 @@ function modlock.callService(service: string, method: string, payload: string): return response.payload end +-- startServiceCall calls method of a service the host provides and +-- returns at once with a number; the answer arrives in a later frame as a +-- ServiceReplied event carrying that number. Every call ends once: with +-- the reply, the service's refusal, a timeout or no provider at all. A +-- service nobody provides is never asked. The host waits at most 30 +-- seconds, or the call's shorter timeout, and drops the mod's waiting +-- calls when the mod stops or reloads. A service that answers at once +-- answers this way too, in the next frame. +function modlock.startServiceCall(service: string, method: string, payload: string, timeoutMilliseconds: number): number? + local response = call("StartServiceCall", "StartServiceCallRequest", { service = service, method = method, payload = payload, timeoutMilliseconds = timeoutMilliseconds }, "ServiceCallStarted") + if response == nil then + return nil + end + return response.call +end + -- createEntity creates an entity the server knows by its designer name, -- such as npc_trooper_boss or prop_dynamic, with spawn key values and fields -- written before it spawns. The world removes it when the world ends; @@ -4722,6 +4788,8 @@ export type ModHandlers = { uiInput: (event: UiInputEvent) -> (), -- serve calls a service the mod serves from the host. serve: (event: ServiceCall) -> ServiceReply, + -- serviceReplied ends one StartServiceCall, in a frame after the call. + serviceReplied: (event: ServiceRepliedEvent) -> (), -- damage offers one hit before the game applies it, while the mod asked -- for damage. The mod's answer may block the hit or change its amount. damage: (event: DamageEvent) -> DamageResult, @@ -4795,6 +4863,7 @@ local events: { [string]: { request: string, response: string, handler: string } UiPress = { request = "UiPressEvent", response = "Empty", handler = "uiPress" }, UiInput = { request = "UiInputEvent", response = "Empty", handler = "uiInput" }, Serve = { request = "ServiceCall", response = "ServiceReply", handler = "serve" }, + ServiceReplied = { request = "ServiceRepliedEvent", response = "Empty", handler = "serviceReplied" }, Damage = { request = "DamageEvent", response = "DamageResult", handler = "damage" }, Damaged = { request = "DamagedEvent", response = "Empty", handler = "damaged" }, Killed = { request = "KillEvent", response = "Empty", handler = "killed" }, @@ -5105,6 +5174,14 @@ local commands: { [string]: (player: Player, args: string) -> () } = {} -- services maps each service the mod serves to its handler. local services: { [string]: Service } = {} +-- ServiceDone ends one callServiceLater: with the reply and no error, or with +-- no reply, the error and the failure that says why. +export type ServiceDone = (reply: string?, error: string?, failure: ServiceFailure) -> () + +-- waiting maps each started service call's number to the function its end +-- runs. +local waiting: { [number]: ServiceDone } = {} + -- starts to settingChanges hold each event's handlers, which run in -- registration order. local starts: { (args: { string }) -> () } = {} @@ -5723,6 +5800,25 @@ function modlock.serve(service: string, handler: Service) services[service] = handler end +-- 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 timeout seconds or nobody +-- provides the service. Zero or nil waits the host's longest, 30 seconds. +-- done runs once while the mod runs; calls still waiting when the mod stops +-- end with it. +function modlock.callServiceLater(service: string, method: string, payload: string, done: ServiceDone, timeout: number?) + -- A call the host refuses to start ends in the next frame as well, so + -- done never runs before this returns. + local call = modlock.startServiceCall(service, method, payload, math.floor((timeout or 0) * 1000)) + if call == nil then + modlock.after(0, function() + done(nil, "the host did not start the call to " .. service, "unavailable") + end) + return + end + waiting[call] = done +end + -- 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 -- next server frame, before the frame handlers, and receives the text after @@ -6334,6 +6430,19 @@ local handlers: ModHandlers = { end end, + serviceReplied = function(event) + local done = waiting[event.call] + if done == nil then + return + end + waiting[event.call] = nil + if event.failure ~= nil and event.failure ~= "none" then + done(nil, event.error, event.failure) + return + end + done(event.payload, nil, "none") + end, + npcsRestored = function(event) for _, handler in npcsRestoreds do handler(if event.error ~= "" then event.error else nil) diff --git a/mod/host.gen.go b/mod/host.gen.go index e39ab6ac..c1e79940 100644 --- a/mod/host.gen.go +++ b/mod/host.gen.go @@ -313,6 +313,22 @@ const ( CameraParamHorizontalOffset = playerspb.CameraParam_CAMERA_PARAM_HORIZONTAL_OFFSET ) +// ServiceFailure says why a service call ended without an answer. +type ServiceFailure = wasmpb.ServiceFailure + +// The values of ServiceFailure. +const ( + // ServiceFailureNone is an answered call. + ServiceFailureNone = wasmpb.ServiceFailure_SERVICE_FAILURE_NONE + // ServiceFailureRefused is a call the service answered with an error. + ServiceFailureRefused = wasmpb.ServiceFailure_SERVICE_FAILURE_REFUSED + // ServiceFailureTimeout is a call that waited out its timeout. + ServiceFailureTimeout = wasmpb.ServiceFailure_SERVICE_FAILURE_TIMEOUT + // ServiceFailureUnavailable is a call to a service nobody provides + // here, or one more than the host keeps waiting for a mod. + ServiceFailureUnavailable = wasmpb.ServiceFailure_SERVICE_FAILURE_UNAVAILABLE +) + // Ability is one ability a hero owns. type Ability = abilitiespb.Ability @@ -543,7 +559,8 @@ type SettingChangedEvent = settingspb.SettingChangedEvent // Wheel reports one wheel step over a slider, anchored to its pointer position. type Wheel = uipb.Wheel -// UiPressEvent reports a press on a button in a player's interface. +// UiPressEvent reports a press on a button in a player's interface, or a +// press a layout's script sent with an action and a payload. type UiPressEvent = uipb.UiPressEvent // UiInputEvent reports a change the player made to an input in their @@ -598,6 +615,9 @@ type ServiceCall = wasmpb.ServiceCall // ServiceReply is a service's answer. type ServiceReply = wasmpb.ServiceReply +// ServiceRepliedEvent ends one started service call. +type ServiceRepliedEvent = wasmpb.ServiceRepliedEvent + // PrecacheOptions names what the next world loads ahead of use. type PrecacheOptions = wasmpb.PrecacheOptions @@ -1529,6 +1549,23 @@ func CallService(service, method string, payload []byte) ([]byte, error) { return response.GetPayload(), nil } +// StartServiceCall calls method of a service the host provides and +// returns at once with a number; the answer arrives in a later frame as a +// ServiceReplied event carrying that number. Every call ends once: with +// the reply, the service's refusal, a timeout or no provider at all. A +// service nobody provides is never asked. The host waits at most 30 +// seconds, or the call's shorter timeout, and drops the mod's waiting +// calls when the mod stops or reloads. A service that answers at once +// answers this way too, in the next frame. +func StartServiceCall(service, method string, payload []byte, timeoutMilliseconds uint32) (uint64, error) { + request := &wasmpb.StartServiceCallRequest{Service: service, Method: method, Payload: payload, TimeoutMilliseconds: timeoutMilliseconds} + response := &wasmpb.ServiceCallStarted{} + if err := invoke("StartServiceCall", request, response); err != nil { + return 0, err + } + return response.GetCall(), nil +} + // CreateEntity creates an entity the server knows by its designer name, // such as npc_trooper_boss or prop_dynamic, with spawn key values and fields // written before it spawns. The world removes it when the world ends; @@ -1900,6 +1937,8 @@ type modHandlers interface { UiInput(event *UiInputEvent) error // Serve calls a service the mod serves from the host. Serve(event *ServiceCall) (*ServiceReply, error) + // ServiceReplied ends one StartServiceCall, in a frame after the call. + ServiceReplied(event *ServiceRepliedEvent) error // Damage offers one hit before the game applies it, while the mod asked // for damage. The mod's answer may block the hit or change its amount. Damage(event *DamageEvent) (*DamageResult, error) @@ -2014,6 +2053,12 @@ func serveMod(handlers modHandlers, call *wasmpb.Call) *wasmpb.Reply { return &wasmpb.Reply{Error: err.Error()} } return answer(handlers.Serve(event)) + case "ServiceReplied": + event := &ServiceRepliedEvent{} + if err := event.UnmarshalVT(call.GetRequest()); err != nil { + return &wasmpb.Reply{Error: err.Error()} + } + return answer(nil, handlers.ServiceReplied(event)) case "Damage": event := &DamageEvent{} if err := event.UnmarshalVT(call.GetRequest()); err != nil { diff --git a/mod/mod.go b/mod/mod.go index 6f03401a..59b6ec61 100644 --- a/mod/mod.go +++ b/mod/mod.go @@ -27,6 +27,7 @@ import ( "maps" "slices" "strings" + "time" "github.com/paralin/modlock/src/wasm" "github.com/paralin/modlock/src/wasm/players" @@ -45,6 +46,9 @@ type handlers struct { commands map[string]func(Player, string) // services maps each service the mod serves to its handler. services map[string]Service + // waiting maps each started service call's number to the function its + // end runs. + waiting map[uint64]func(reply []byte, err error) starts []func(args []string) frames []func(*FrameEvent) @@ -91,6 +95,7 @@ type handlers struct { var registered = &handlers{ commands: map[string]func(Player, string){}, services: map[string]Service{}, + waiting: map[uint64]func(reply []byte, err error){}, generations: map[int32]uint32{}, tenures: map[int32]uint32{}, } @@ -109,6 +114,35 @@ func Serve(service string, handler Service) { registered.services[service] = handler } +// ServiceError ends a started service call without an answer: Failure says +// why and Message describes it. +type ServiceError struct { + Failure ServiceFailure + Message string +} + +// Error returns the failure's description. +func (e *ServiceError) Error() string { + return e.Message +} + +// CallServiceLater calls method of a service the host provides and returns +// at once; done runs in a later frame with the answer, or with a +// *ServiceError when the service refused, the call waited past timeout or +// nobody provides the service. A zero timeout waits the host's longest, 30 +// seconds. done runs exactly once while the mod runs; calls still waiting +// when the mod stops end with it. +func CallServiceLater(service, method string, payload []byte, timeout time.Duration, done func(reply []byte, err error)) { + // A call the host refuses to start ends in the next frame as well, so + // done never runs before this returns. + call, err := StartServiceCall(service, method, payload, uint32(timeout.Milliseconds())) + if err != nil { + After(0, func() { done(nil, &ServiceError{Failure: ServiceFailureUnavailable, Message: err.Error()}) }) + return + } + registered.waiting[call] = done +} + // OnStart calls handler once when the server starts the mod, with the // arguments that follow -- on the modlock-host command line. func OnStart(handler func(args []string)) { @@ -479,6 +513,21 @@ func (h *handlers) NpcsRestored(event *NpcsRestoredEvent) error { return nil } +// ServiceReplied ends one started service call. +func (h *handlers) ServiceReplied(event *ServiceRepliedEvent) error { + done, ok := h.waiting[event.GetCall()] + if !ok { + return nil + } + delete(h.waiting, event.GetCall()) + if event.GetFailure() != ServiceFailureNone { + done(nil, &ServiceError{Failure: event.GetFailure(), Message: event.GetError()}) + return nil + } + done(event.GetPayload(), nil) + return nil +} + // Launch runs the launch handlers. func (h *handlers) Launch(event *LaunchEvent) error { return each(h.launches, event) } diff --git a/panorama/browser/dom.ts b/panorama/browser/dom.ts index fb8d6c84..d2306827 100644 --- a/panorama/browser/dom.ts +++ b/panorama/browser/dom.ts @@ -1,4 +1,5 @@ import type { Panel, Panorama } from '../src/draw.js' +import { scriptPath } from './layouts.js' import { cascade, parseSheet, type Rule, type Scope } from './sheets.js' /** mouse is the last pointer position in window pixels, as Panorama reports it. */ @@ -10,10 +11,10 @@ const mouse = { x: 0, y: 0 } * layout with the CSS in panels.css, which the page must link: children * overlap unless the panel flows them down or right, and fill-parent-flow * takes the remaining space. Fonts and engine-only styles are approximate. - * A layout it loads draws its panels, their classes and inline styles, and + * A layout it loads draws its panels, their classes and inline styles, * applies its style sheets to the panel it loads into and that panel's - * subtree, but runs none of its scripts; the installed game remains the - * reference. + * subtree, and runs its scripts with that panel as their context; the + * installed game remains the reference. */ export class DomPanel implements Panel { readonly element: HTMLElement @@ -120,10 +121,28 @@ export class DomPanel implements Panel { return this.element.offsetWidth } + get actuallayoutheight(): number { + return this.element.offsetHeight + } + get actualuiscale_x(): number { return this.element.getBoundingClientRect().width / this.element.offsetWidth } + get actualuiscale_y(): number { + return ( + this.element.getBoundingClientRect().height / this.element.offsetHeight + ) + } + + get actualxoffset(): number { + return this.element.offsetLeft + } + + get actualyoffset(): number { + return this.element.offsetTop + } + GetPositionWithinWindow(): { x: number; y: number } { const bounds = this.element.getBoundingClientRect() return { x: bounds.x, y: bounds.y } @@ -301,6 +320,9 @@ export class DomPanel implements Panel { return this.attributes.get(name) ?? fallback } + // The page shows no web page in a panel, so an HTML panel stays empty. + SetURL(_url: string) {} + SetImage(path: string) { this.element.style.backgroundImage = path ? `url(${JSON.stringify(path)})` @@ -311,8 +333,9 @@ export class DomPanel implements Panel { * BLoadLayout loads the layout a page path such as /layout/mod/board.xml * serves into this panel, as Panorama does: the layout's top panel * describes this one and its children become this panel's, though a style - * the drawing already gave this panel stays. It loads in the background, - * and refuses a game path, which a browser cannot read. + * the drawing already gave this panel stays. Its scripts run once its + * panels are built. It loads in the background, and refuses a game path, + * which a browser cannot read. */ BLoadLayout(url: string) { if (!url.startsWith('/')) return false @@ -320,6 +343,8 @@ export class DomPanel implements Panel { new DOMParser().parseFromString(text, 'text/xml'), ) .then((layout) => { + // Style the panel, then build its panels, then run its scripts + // over them. const top = [...layout.documentElement.children].find( (child) => !nonPanels.has(child.tagName.toLowerCase()), ) @@ -328,6 +353,9 @@ export class DomPanel implements Panel { if (child.tagName.toLowerCase() === 'styles') this.loadSheets(child, url) if (top) this.loadElement(top, new Set(Object.keys(this.inline))) + for (const child of layout.documentElement.children) + if (child.tagName.toLowerCase() === 'scripts') + this.loadScripts(child, url) }) .catch((error: unknown) => console.debug(`layout ${url}:`, error)) return true @@ -387,6 +415,34 @@ export class DomPanel implements Panel { } } + // loadScripts runs the scripts a layout's scripts element includes, fetched + // from the page beside the layout at url, in order and in one scope, as the + // game runs a layout's scripts in one context: the layout library's Modlock + // is the next script's. A script the page does not serve leaves the rest + // unrun, since a later one leans on it. + private loadScripts(scripts: Element, url: string) { + const build = new URL(url, location.href).search + const paths = [...scripts.children].map((include) => + scriptPath(include.getAttribute('src') ?? '', build), + ) + if (paths.some((path) => path === '')) { + console.debug(`layout ${url}: a script the page cannot load`) + return + } + void Promise.all(paths.map((path) => fetchOnce(path, (text) => text))) + .then((sources) => { + if (!this.valid) return + // A mod's layout script is code by design; the page runs what the + // game would. + // oxlint-disable-next-line typescript/no-implied-eval + const run = new Function('$', sources.join('\n;\n')) as ( + panorama: unknown, + ) => void + run(layoutPanorama(this)) + }) + .catch((error: unknown) => console.debug(`layout ${url}:`, error)) + } + /** applySheets writes the values the style sheets now give this panel. */ applySheets(values: ReadonlyMap) { for (const [name, value] of values) { @@ -500,10 +556,32 @@ if (typeof document !== 'undefined') { // than panels. const nonPanels = new Set(['styles', 'scripts', 'snippets']) +/** Listener is a layout script's handler for an event nothing handled. */ +interface Listener { + readonly event: string + readonly handler: (...values: unknown[]) => void + readonly context: DomPanel +} + +// listeners holds the layout scripts' handlers in registration order; one +// whose layout left the page hears nothing more, and one that throws keeps +// the rest from missing the event. command passes on the console +// commands the scripts dispatch. +const listeners = new Set() +let command: (line: string) => void = () => {} + +/** + * onCommand passes each console command a layout's script dispatches, such + * as a press for its mod, to handler. + */ +export function onCommand(handler: (line: string) => void): void { + command = handler +} + /** * domPanorama is the part of Panorama a Drawing uses, on DomPanels. Debug - * messages go to the console; a press reaches the page through the Drawing's - * Press, so dispatched events go nowhere. + * messages go to the console; a button's press reaches the page through the + * Drawing's Press, and a layout's through onCommand. */ export const domPanorama = { MousePosition: () => mouse, @@ -540,8 +618,30 @@ export const domPanorama = { const values = Object.values(panel.dialogVariables()) return values.length ? `${token} ${values.join(' ')}` : token }, - // A text tooltip shows as the element's title; other events go nowhere. + // A console command goes to the page, a text tooltip shows as the element's + // title, and other events reach the layout scripts listening for them. DispatchEvent(event: string, ...values: unknown[]) { + // A console command, such as a layout's press, is the page's alone. + if (event === 'CitadelConCommand') { + command(typeof values[0] === 'string' ? values[0] : '') + return + } + + // Each live layout listening hears the event. + for (const listener of listeners) { + const { context } = listener + if (!context.IsValid() || !context.element.isConnected) { + listeners.delete(listener) + } else if (listener.event === event) { + try { + listener.handler(...values) + } catch (error: unknown) { + console.debug(`layout script ${event}:`, error) + } + } + } + + // A tooltip shows on the panel it names. const [panel, text] = values if (!(panel instanceof DomPanel)) return if (event === 'UIShowTextTooltip') panel.element.title = String(text) @@ -555,6 +655,37 @@ export const domPanorama = { }, } satisfies Panorama +/** + * layoutPanorama is the $ a layout's scripts see: domPanorama with context as + * the panel the layout loaded into, timers it can cancel, and handlers for + * the events nothing else handles. Called with a selector #id, it finds that + * panel in context's subtree. + */ +export function layoutPanorama(context: DomPanel) { + const find = (selector: string) => + selector.startsWith('#') + ? context.FindChildTraverse(selector.slice(1)) + : null + return Object.assign(find, domPanorama, { + GetContextPanel: () => context, + Schedule: (seconds: number, callback: () => void) => + setTimeout(callback, seconds * 1000), + CancelScheduled: (handle: ReturnType) => + clearTimeout(handle), + RegisterForUnhandledEvent( + event: string, + handler: (...values: unknown[]) => void, + ) { + const listener = { event, handler, context } + listeners.add(listener) + return listener + }, + UnregisterForUnhandledEvent(_event: string, listener: Listener) { + listeners.delete(listener) + }, + }) +} + // control returns the form element a panel of type draws on, made with // properties as the game makes it, or undefined for a plain panel. function control( diff --git a/panorama/browser/layouts.test.ts b/panorama/browser/layouts.test.ts new file mode 100644 index 00000000..391593dc --- /dev/null +++ b/panorama/browser/layouts.test.ts @@ -0,0 +1,40 @@ +import { expect, test } from 'bun:test' +import { actionCommand } from '../src/data.js' +import { layoutPress, scriptPath } from './layouts.js' + +test('a layout press reads back from the command the library writes', () => { + // A press with a payload and one without come back as sent. + const payload = JSON.stringify({ route: 'gate', note: 'é→' }) + expect(layoutPress(actionCommand('arena', 'card', 'retry', payload))).toEqual( + { mod: 'arena', node: 'card', action: 'retry', payload }, + ) + expect(layoutPress(actionCommand('arena', 'card', 'close', ''))).toEqual({ + mod: 'arena', + node: 'card', + action: 'close', + payload: '', + }) + + // Another command, a short one and a payload that is not UTF-8 read as none. + expect(layoutPress('say hello')).toBeUndefined() + expect(layoutPress('modlockaction arena card')).toBeUndefined() + expect(layoutPress('modlockaction arena card keep _w')).toBeUndefined() + expect(layoutPress('modlockaction arena card keep a+b')).toBeUndefined() +}) + +test('a layout script loads from the page', () => { + // The layout library is the page's copy; a mod's script is its build's. + expect( + scriptPath('s2r://panorama/scripts/modlock/layout.vjs', '?build=2'), + ).toBe('/layout.js') + expect( + scriptPath('file://{resources}/scripts/modlock/layout.js', '?build=2'), + ).toBe('/layout.js') + expect( + scriptPath('s2r://panorama/scripts/arena-1a2b/board.vjs', '?build=2'), + ).toBe('/scripts/arena-1a2b/board.js?build=2') + + // A game path the page does not serve has none. + expect(scriptPath('s2r://panorama/scripts/board.vjs', '')).toBe('') + expect(scriptPath('file://{resources}/layout/arena/board.xml', '')).toBe('') +}) diff --git a/panorama/browser/layouts.ts b/panorama/browser/layouts.ts new file mode 100644 index 00000000..66926748 --- /dev/null +++ b/panorama/browser/layouts.ts @@ -0,0 +1,50 @@ +// The preview page runs a layout's scripts from the page's own paths, and +// reads back the press a script sends as the console command actionCommand +// writes, to send it to modlock dev. + +/** LayoutPress is a press a layout's script sent from its node. */ +export interface LayoutPress { + readonly mod: string + readonly node: string + readonly action: string + readonly payload: string +} + +/** + * layoutPress reads the press in a modlockaction console command, with its + * payload decoded to text, or returns undefined for any other command and for + * a payload that is not base64url of UTF-8. + */ +export function layoutPress(line: string): LayoutPress | undefined { + // Split the command into its words. + const [name, mod, node, action, encoded, ...rest] = line.split(' ') + if (name !== 'modlockaction' || !mod || !node || !action || rest.length) { + return undefined + } + if (encoded === undefined) return { mod, node, action, payload: '' } + + // Decode the payload's base64url, then its UTF-8. + if (!/^[\w-]+$/.test(encoded)) return undefined + try { + const binary = atob(encoded.replace(/-/g, '+').replace(/_/g, '/')) + const bytes = Uint8Array.from(binary, (each) => each.charCodeAt(0)) + const payload = new TextDecoder('utf-8', { fatal: true }).decode(bytes) + return { mod, node, action, payload } + } catch { + return undefined + } +} + +/** + * scriptPath returns the page path of a script a layout includes by its game + * path, with build's query, or '' for one the page does not serve. The layout + * library is the page's own copy. + */ +export function scriptPath(src: string, build: string): string { + const match = + /^(?:s2r:\/\/panorama|file:\/\/\{resources\})\/scripts\/([^/]+\/.+)\.v?js$/.exec( + src, + ) + if (match?.[1] === 'modlock/layout') return '/layout.js' + return match ? `/scripts/${match[1]}.js${build}` : '' +} diff --git a/panorama/browser/preview.ts b/panorama/browser/preview.ts index 1e420193..0b4e2d40 100644 --- a/panorama/browser/preview.ts +++ b/panorama/browser/preview.ts @@ -4,7 +4,8 @@ import { type Built, Input, Preview, type Stopped } from '../../cli/cli.pb.js' import { Drawing, type Layouts } from '../src/draw.js' -import { DomPanel, domPanorama } from './dom.js' +import { DomPanel, domPanorama, onCommand } from './dom.js' +import { layoutPress } from './layouts.js' /** View is what the page shows, derived from modlock dev's latest state. */ type View = @@ -97,6 +98,14 @@ const drawing = new Drawing( }, ) +// A layout's press reaches the mods as the player's, with its action and +// payload; any other command a layout dispatches is the game's alone. +onCommand((line) => { + const press = layoutPress(line) + if (press) send({ body: { case: 'press', value: press } }) + else console.debug(`console command ${line}`) +}) + /** building is true while the latest state reports a build. */ let building = false diff --git a/panorama/panorama.go b/panorama/panorama.go index 18919dea..46d1f63f 100644 --- a/panorama/panorama.go +++ b/panorama/panorama.go @@ -23,7 +23,7 @@ import "embed" // display's and the layout library's TypeScript source and the drawing's // browser stand-in. // -//go:embed src/draw.ts src/data.ts src/hud.ts src/guard.ts src/ability-hud.ts src/abilities.ts src/layout.ts browser/dom.ts browser/sheets.ts browser/panels.css +//go:embed src/draw.ts src/data.ts src/hud.ts src/guard.ts src/ability-hud.ts src/abilities.ts src/layout.ts browser/dom.ts browser/layouts.ts browser/sheets.ts browser/panels.css var Sources embed.FS // Layout is the renderer's layout, which a client content package installs diff --git a/panorama/src/data.ts b/panorama/src/data.ts index c8c0c46e..4479c3db 100644 --- a/panorama/src/data.ts +++ b/panorama/src/data.ts @@ -1,7 +1,8 @@ // The data contract between the renderer and a mod's layout scripts: the -// attributes of a layout's panel that hold its data and the mod's routes, and -// the event that announces a change. The renderer writes them and the layout -// library reads them, so only these two change when the contract does. +// attributes of a layout's panel that hold its data, the mod's routes and +// the names a press goes back with, the event that announces a change, and +// the console command a layout's press runs. The renderer writes them and the +// layout library reads them, so only these two change when the contract does. /** layoutDataAttribute names the attribute holding a layout node's data. */ export const layoutDataAttribute = 'modlock_data' @@ -29,3 +30,97 @@ export const layoutDataChanged = 'modlock_data_changed' export function isRouteName(name: string): boolean { return /^[\w.-]+$/.test(name) } + +/** + * layoutModAttribute names the attribute holding the name of the running mod + * instance whose tree shows the layout. That name is the mod's slug unless + * the host loaded the mod under another name. + */ +export const layoutModAttribute = 'modlock_mod' + +/** layoutNodeAttribute names the attribute holding a layout node's id. */ +export const layoutNodeAttribute = 'modlock_node' + +/** + * maxActionPayload is the most bytes of UTF-8 a layout's press carries, so + * its console command stays inside the engine's line. + */ +export const maxActionPayload = 180 + +/** + * actionCommand is the console command that sends a layout's press to its + * mod: the action's name and payload's text, as unpadded base64url of its + * UTF-8, which an empty payload leaves off. The game server hears it with the sending player, as it hears a + * button's press, and the host refuses it unless that player's tree shows the + * layout. It is empty for a name, a node or a mod the host would refuse, and + * for a payload over maxActionPayload bytes. + */ +export function actionCommand( + mod: string, + node: string, + action: string, + payload: string, +): string { + // Encoding past the limit by a character's most bytes shows an overflow. + const bytes = utf8(payload, maxActionPayload + 4) + if ( + !/^[a-z0-9]+(-[a-z0-9]+)*$/.test(mod) || + !/^[\w.:-]{1,64}$/.test(node) || + !/^[\w.-]{1,64}$/.test(action) || + bytes.length > maxActionPayload + ) { + return '' + } + const command = `modlockaction ${mod} ${node} ${action}` + return bytes.length === 0 ? command : `${command} ${base64Url(bytes)}` +} + +/** + * utf8 returns text's UTF-8 bytes, cut at a character to at most limit bytes. + * A lone surrogate becomes the replacement character. + */ +export function utf8(text: string, limit: number): number[] { + const bytes: number[] = [] + for (const character of text) { + // Encode one character in one to four bytes. + let point = character.codePointAt(0) ?? 0xfffd + if (point >= 0xd800 && point <= 0xdfff) { + point = 0xfffd + } + const tail = (shift: number) => 0x80 | ((point >> shift) & 63) + const encoded = + point < 0x80 + ? [point] + : point < 0x800 + ? [0xc0 | (point >> 6), tail(0)] + : point < 0x10000 + ? [0xe0 | (point >> 12), tail(6), tail(0)] + : [0xf0 | (point >> 18), tail(12), tail(6), tail(0)] + + // Stop before the character that would pass the limit. + if (bytes.length + encoded.length > limit) { + break + } + bytes.push(...encoded) + } + return bytes +} + +/** base64Digits are the digits of base64url in order. */ +const base64Digits = + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_' + +/** base64Url writes bytes in unpadded base64url. */ +export function base64Url(bytes: readonly number[]): string { + let written = '' + for (let at = 0; at < bytes.length; at += 3) { + // Each three bytes make four digits; a short end makes one per byte and one. + const chunk = + (bytes[at]! << 16) | ((bytes[at + 1] ?? 0) << 8) | (bytes[at + 2] ?? 0) + const digits = Math.min(3, bytes.length - at) + 1 + for (let digit = 0; digit < digits; digit++) { + written += base64Digits[(chunk >> (18 - 6 * digit)) & 63] + } + } + return written +} diff --git a/panorama/src/draw.ts b/panorama/src/draw.ts index 42050534..1d75eea5 100644 --- a/panorama/src/draw.ts +++ b/panorama/src/draw.ts @@ -55,16 +55,24 @@ import { Weight, } from '../../src/wasm/ui/ui.pb.js' import { + base64Url, isRouteName, layoutDataAttribute, layoutDataChanged, + layoutModAttribute, + layoutNodeAttribute, routeAttribute, + utf8, } from './data.js' export { + actionCommand, isRouteName, layoutDataAttribute, layoutDataChanged, + layoutModAttribute, + layoutNodeAttribute, + maxActionPayload, routeAttribute, } from './data.js' @@ -315,56 +323,6 @@ const maxInput = 240 */ const maxUnanswered = 10 -/** - * utf8 returns text's UTF-8 bytes, cut at a character to at most limit bytes. - * A lone surrogate becomes the replacement character. - */ -function utf8(text: string, limit: number): number[] { - const bytes: number[] = [] - for (const character of text) { - // Encode one character in one to four bytes. - let point = character.codePointAt(0) ?? 0xfffd - if (point >= 0xd800 && point <= 0xdfff) { - point = 0xfffd - } - const tail = (shift: number) => 0x80 | ((point >> shift) & 63) - const encoded = - point < 0x80 - ? [point] - : point < 0x800 - ? [0xc0 | (point >> 6), tail(0)] - : point < 0x10000 - ? [0xe0 | (point >> 12), tail(6), tail(0)] - : [0xf0 | (point >> 18), tail(12), tail(6), tail(0)] - - // Stop before the character that would pass the limit. - if (bytes.length + encoded.length > limit) { - break - } - bytes.push(...encoded) - } - return bytes -} - -/** base64Digits are the digits of base64url in order. */ -const base64Digits = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_' - -/** base64Url writes bytes in unpadded base64url. */ -function base64Url(bytes: readonly number[]): string { - let written = '' - for (let at = 0; at < bytes.length; at += 3) { - // Each three bytes make four digits; a short end makes one per byte and one. - const chunk = - (bytes[at]! << 16) | ((bytes[at + 1] ?? 0) << 8) | (bytes[at + 2] ?? 0) - const digits = Math.min(3, bytes.length - at) + 1 - for (let digit = 0; digit < digits; digit++) { - written += base64Digits[(chunk >> (18 - 6 * digit)) & 63] - } - } - return written -} - /** panelTypes maps each kind of node to the stock panel that draws it. */ const panelTypes: Record = { [Kind.PANEL]: 'Panel', @@ -1217,6 +1175,8 @@ export class Drawing { // Load the node's layout with its data, or hand a loaded layout its new // data. A layout whose addon has not mounted yet loads on a later draw. if (layout && !loaded) { + panel.SetAttributeString(layoutModAttribute, mod) + panel.SetAttributeString(layoutNodeAttribute, id) panel.SetAttributeString(layoutDataAttribute, data) for (const [name, value] of this.routes.get(mod) ?? []) { panel.SetAttributeString(routeAttribute(name), value) diff --git a/panorama/src/layout.test.ts b/panorama/src/layout.test.ts new file mode 100644 index 00000000..5377d20e --- /dev/null +++ b/panorama/src/layout.test.ts @@ -0,0 +1,43 @@ +// Contract tests for the layout library's press: it runs the console command +// that names the layout's mod and node, which the renderer set on its panel, +// and sends nothing it cannot name. +import { expect, test } from 'bun:test' + +/** attributes are the attributes the renderer set on the layout's panel. */ +const attributes = new Map([ + ['modlock_mod', 'arena'], + ['modlock_node', 'card'], +]) + +/** sent holds each event the library dispatched, with its arguments. */ +const sent: unknown[][] = [] + +Object.assign(globalThis, { + $: { + GetContextPanel: () => ({ + GetAttributeString: (name: string, fallback: string) => + attributes.get(name) ?? fallback, + }), + DispatchEvent: (...args: unknown[]) => sent.push(args), + Msg: () => {}, + RegisterForUnhandledEvent: () => {}, + }, +}) +const { press } = await import('./layout.js') + +test('a layout presses its mod with its own node and a JSON payload', () => { + expect(press('vote', { vote: 1 })).toBe(true) + expect(press('close')).toBe(true) + expect(sent).toEqual([ + ['CitadelConCommand', 'modlockaction arena card vote eyJ2b3RlIjoxfQ'], + ['CitadelConCommand', 'modlockaction arena card close'], + ]) + + // A payload past the limit, a bad name or an unnamed layout sends nothing. + sent.length = 0 + expect(press('keep', 'x'.repeat(200))).toBe(false) + expect(press('a b')).toBe(false) + attributes.delete('modlock_node') + expect(press('close')).toBe(false) + expect(sent).toEqual([]) +}) diff --git a/panorama/src/layout.ts b/panorama/src/layout.ts index 9c9b9798..5fd5226f 100644 --- a/panorama/src/layout.ts +++ b/panorama/src/layout.ts @@ -15,11 +15,22 @@ // change, with undefined while the mod sends none. The library reads the // attributes the renderer sets on the layout's panel and rereads them on the // renderer's change event, so no layout script names either. +// +// A layout sends a press back to its mod's server with a name and a small +// JSON payload: +// +// Modlock.press('buy', { item: 'boots' }) +// +// The mod hears it as a press on the layout's node with the action and the +// payload's JSON, from the player the server says sent it. import { + actionCommand, isRouteName, layoutDataAttribute, layoutDataChanged, + layoutModAttribute, + layoutNodeAttribute, routeAttribute, } from './data.js' @@ -30,6 +41,7 @@ import { */ declare const $: { Msg(...values: unknown[]): void + DispatchEvent(event: string, ...args: unknown[]): void GetContextPanel(): { GetAttributeString(name: string, fallback: string): string } @@ -74,6 +86,29 @@ export function route(name: string, handler: Handler): void { watch(routeAttribute(name), handler) } +/** + * press sends action to the layout's mod with payload as JSON, and reports + * whether it went: a name the host refuses, a payload whose JSON passes the + * bytes a press carries, or a layout the renderer did not name stays here. + * The host takes a few presses a second from each player and drops the rest. + */ +export function press(action: string, payload?: unknown): boolean { + // Build the command from the node the renderer named on this panel. + const json = payload === undefined ? '' : (JSON.stringify(payload) ?? '') + const command = actionCommand( + panel.GetAttributeString(layoutModAttribute, ''), + panel.GetAttributeString(layoutNodeAttribute, ''), + action, + json, + ) + if (command === '') { + $.Msg(`[Modlock] ${action} cannot be pressed`) + return false + } + $.DispatchEvent('CitadelConCommand', command) + return true +} + /** watch registers handler for attribute and hands it the current value. */ function watch(attribute: string, handler: Handler): void { if (watches.length === 0) { diff --git a/panorama/src/renderer.test.ts b/panorama/src/renderer.test.ts index ec8bd252..8ab5fdc8 100644 --- a/panorama/src/renderer.test.ts +++ b/panorama/src/renderer.test.ts @@ -4,11 +4,13 @@ import { beforeEach, expect, test } from 'bun:test' import { HudPart, Screen } from '../../src/wasm/ui/ui.pb.js' import { Bridge } from './bridge.js' import { + actionCommand, AddonLayouts, Drawing, type InputValue, inputCommand, layoutDataChanged, + maxActionPayload, pressCommand, } from './draw.js' import { @@ -897,6 +899,30 @@ test('draws inputs, avatars and game text, and sends edits', () => { ) }) +test("a layout's press names its mod, node and action and carries a short payload", () => { + // The payload travels as base64url of its UTF-8; an empty one is left off. + expect(actionCommand('arena', 'card', 'vote', '{"vote":1}')).toBe( + 'modlockaction arena card vote eyJ2b3RlIjoxfQ', + ) + expect(actionCommand('arena', 'card', 'close', '')).toBe( + 'modlockaction arena card close', + ) + expect(actionCommand('arena', 'card', 'keep', 'é'.repeat(90))).toBe( + `modlockaction arena card keep ${Buffer.from('é'.repeat(90)).toString('base64url')}`, + ) + + // A payload past the limit, or a name the host refuses, sends nothing. + expect(actionCommand('arena', 'card', 'keep', 'é'.repeat(91))).toBe('') + expect( + actionCommand('arena', 'card', 'keep', 'x'.repeat(maxActionPayload + 1)), + ).toBe('') + for (const action of ['', 'a b', 'a;quit', 'a\nquit', 'x'.repeat(65)]) { + expect(actionCommand('arena', 'card', action, '')).toBe('') + } + expect(actionCommand('Arena', 'card', 'vote', '')).toBe('') + expect(actionCommand('arena', 'a;quit', 'vote', '')).toBe('') +}) + test('sliders map native fractions to ranges and send scoped wheel anchors', () => { // Set up a renderer that reports the values it sends. const root = new FakePanel('Panel', 'ModlockUi') @@ -1596,6 +1622,8 @@ test('loads layouts and style sheets a host allows and hands them data', () => { const panel = root.children[0]!.children[0]! expect(panel.layout).toBe('file://arena/shop.xml') expect(panel.attributes.get('modlock_data')).toBe('{"gold":1}') + expect(panel.attributes.get('modlock_mod')).toBe('arena') + expect(panel.attributes.get('modlock_node')).toBe('a') expect(panel.children).toEqual([]) expect(dispatched).toEqual([]) diff --git a/preview/preview.go b/preview/preview.go index d33410f8..09126a03 100644 --- a/preview/preview.go +++ b/preview/preview.go @@ -22,6 +22,7 @@ import ( "github.com/paralin/modlock/cli" "github.com/paralin/modlock/session" "github.com/paralin/modlock/source2/panorama" + "github.com/paralin/modlock/source2/resource" ) // logLines is how many of a mod's last log lines a stop carries. @@ -139,6 +140,8 @@ func (p *Page) ServeHTTP(w http.ResponseWriter, request *http.Request) { p.layout(w, strings.TrimPrefix(request.URL.Path, "/layout/")) case request.Method == http.MethodGet && strings.HasPrefix(request.URL.Path, "/styles/"): p.sheet(w, strings.TrimPrefix(request.URL.Path, "/styles/")) + case request.Method == http.MethodGet && strings.HasPrefix(request.URL.Path, "/scripts/"): + p.script(w, strings.TrimPrefix(request.URL.Path, "/scripts/")) case request.Method == http.MethodGet: p.files.ServeHTTP(w, request) default: @@ -207,6 +210,32 @@ func (p *Page) sheet(w http.ResponseWriter, name string) { _, _ = w.Write([]byte(source)) } +// script answers with the source of the built script that name, +// /, names, as a loaded layout's include names it, so the page +// runs a layout's scripts as the game does. +func (p *Page) script(w http.ResponseWriter, name string) { + // Find the script in the build's content. + compiled, ok := panorama.Compiled(name) + if !ok || path.Ext(name) != ".js" || !fs.ValidPath(compiled) || !strings.Contains(compiled, "/") { + http.NotFound(w, nil) + return + } + data, err := fs.ReadFile(p.built, path.Join(check.ContentDir, "scripts", compiled)) + if err != nil { + http.Error(w, "the mod's build has no script "+name, http.StatusNotFound) + return + } + + // A compiled script's data block is its source. + source, err := resource.ReadBlock(data, "DATA") + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + w.Header().Set("Content-Type", "text/javascript; charset=utf-8") + _, _ = w.Write(source) +} + // current returns the page's state with the player's screen, and channels // that close when the state or the screen changes. func (p *Page) current() (*cli.Preview, <-chan struct{}, <-chan struct{}) { diff --git a/preview/preview_test.go b/preview/preview_test.go new file mode 100644 index 00000000..c0ad0e41 --- /dev/null +++ b/preview/preview_test.go @@ -0,0 +1,62 @@ +package preview + +import ( + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "testing" + + "github.com/paralin/modlock/source2/panorama" +) + +// TestScriptServesTheBuiltSource checks the page answers a layout's script +// include with the script's source from the build, and nothing outside the +// build's scripts. +func TestScriptServesTheBuiltSource(t *testing.T) { + // Build one script into a mod's content addon. + built := t.TempDir() + source := []byte("Modlock.data((value) => $.Msg(value))\n") + compiled, err := panorama.Compile("arena-1a2b", "panorama/scripts/board.js", source) + if err != nil { + t.Fatal(err) + } + dir := filepath.Join(built, "panorama", "scripts", "arena-1a2b") + if err := os.MkdirAll(dir, 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(dir, "board.vjs_c"), compiled, 0o644); err != nil { + t.Fatal(err) + } + page := New(t.TempDir(), built, false, nil) + + // get answers one loopback request from the page itself. + get := func(path string) *httptest.ResponseRecorder { + request := httptest.NewRequest(http.MethodGet, "http://localhost:4000"+path, nil) + answer := httptest.NewRecorder() + page.ServeHTTP(answer, request) + return answer + } + + // The include's path names the addon and the script's source path. + answer := get("/scripts/arena-1a2b/board.js") + if answer.Code != http.StatusOK || answer.Body.String() != string(source) { + t.Fatalf("board.js: %d %q", answer.Code, answer.Body.String()) + } + if kind := answer.Header().Get("Content-Type"); kind != "text/javascript; charset=utf-8" { + t.Fatalf("board.js type %q", kind) + } + + // A missing script, another kind of file and a path out of the addon find + // nothing. + for _, path := range []string{ + "/scripts/arena-1a2b/missing.js", + "/scripts/arena-1a2b/board.css", + "/scripts/board.js", + "/scripts/../scripts/arena-1a2b/board.js", + } { + if answer := get(path); answer.Code == http.StatusOK { + t.Fatalf("%s answered %q", path, answer.Body.String()) + } + } +} diff --git a/project/scriptc.go b/project/scriptc.go index 00f2b74d..e0d6ce4f 100644 --- a/project/scriptc.go +++ b/project/scriptc.go @@ -68,7 +68,9 @@ func (p *Project) writeScriptcConfig(dir, library string, own map[string][]strin config.Extends = filepath.ToSlash(project) } - // Map the library and the protobuf runtime to their source. + // Map the library and the protobuf runtime to their source. The runtime + // exports each well-known type as google/protobuf/, from a source + // file named .pb.ts, so those take their own, longer pattern. source := filepath.Join(library, js.Scriptc) index := filepath.Join(source, "js", "src", "index.ts") protobuf := filepath.Join(source, js.ScriptcProtobuf) @@ -78,13 +80,14 @@ func (p *Project) writeScriptcConfig(dir, library string, own map[string][]strin } _, ownLibrary := own["modlock"] for name, targets := range map[string][]string{ - "modlock": {index}, - "modlock/jsx-runtime": {index}, - "modlock/entities": {filepath.Join(source, "js", "src", "entities.ts")}, - "modlock/console": {filepath.Join(source, "js", "src", "console.ts")}, - "modlock/scriptc": {filepath.Join(source, "js", "src", "scriptc.ts")}, - "@aptre/protobuf-es-lite": {filepath.Join(protobuf, "index.ts")}, - "@aptre/protobuf-es-lite/*": {filepath.Join(protobuf, "*.ts")}, + "modlock": {index}, + "modlock/jsx-runtime": {index}, + "modlock/entities": {filepath.Join(source, "js", "src", "entities.ts")}, + "modlock/console": {filepath.Join(source, "js", "src", "console.ts")}, + "modlock/scriptc": {filepath.Join(source, "js", "src", "scriptc.ts")}, + "@aptre/protobuf-es-lite": {filepath.Join(protobuf, "index.ts")}, + "@aptre/protobuf-es-lite/*": {filepath.Join(protobuf, "*.ts")}, + "@aptre/protobuf-es-lite/google/protobuf/*": {filepath.Join(protobuf, "google", "protobuf", "*.pb.ts")}, } { if ownLibrary && isLibrary(name) { continue diff --git a/project/scriptc_test.go b/project/scriptc_test.go new file mode 100644 index 00000000..e014ef09 --- /dev/null +++ b/project/scriptc_test.go @@ -0,0 +1,98 @@ +package project + +import ( + "encoding/json" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/paralin/modlock/js" +) + +// TestScriptcConfigResolvesProtobuf checks that the scriptc configuration +// resolves the protobuf runtime's modules to the shipped source, the +// well-known types under google/protobuf as well as message and enum. +func TestScriptcConfigResolvesProtobuf(t *testing.T) { + // Ship the runtime's source files as the built library lays them out. + library := t.TempDir() + protobuf := filepath.Join(library, js.Scriptc, js.ScriptcProtobuf) + shipped := []string{ + "index.ts", + "message.ts", + "enum.ts", + "google/protobuf/timestamp.pb.ts", + "google/protobuf/struct.pb.ts", + "google/protobuf/wrappers.pb.ts", + } + for _, name := range shipped { + path := filepath.Join(protobuf, filepath.FromSlash(name)) + if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(path, nil, 0o644); err != nil { + t.Fatal(err) + } + } + + // Write the configuration for a project with no tsconfig of its own. + dir := t.TempDir() + p := &Project{Dir: t.TempDir()} + if err := p.writeScriptcConfig(dir, library, nil); err != nil { + t.Fatal(err) + } + data, err := os.ReadFile(filepath.Join(dir, "tsconfig.json")) + if err != nil { + t.Fatal(err) + } + var config scriptcConfig + if err := json.Unmarshal(data, &config); err != nil { + t.Fatal(err) + } + + // Each import the generated messages make lands on a shipped file. + for specifier, want := range map[string]string{ + "@aptre/protobuf-es-lite": "index.ts", + "@aptre/protobuf-es-lite/message": "message.ts", + "@aptre/protobuf-es-lite/enum": "enum.ts", + "@aptre/protobuf-es-lite/google/protobuf/timestamp": "google/protobuf/timestamp.pb.ts", + "@aptre/protobuf-es-lite/google/protobuf/struct": "google/protobuf/struct.pb.ts", + "@aptre/protobuf-es-lite/google/protobuf/wrappers": "google/protobuf/wrappers.pb.ts", + } { + got := resolvePath(config.CompilerOptions.Paths, specifier) + if got != filepath.Join(protobuf, filepath.FromSlash(want)) { + t.Errorf("%s resolves to %q, want %s", specifier, got, want) + continue + } + if _, err := os.Stat(got); err != nil { + t.Errorf("%s resolves to a missing file: %v", specifier, err) + } + } +} + +// resolvePath resolves specifier through paths as TypeScript does: an exact +// key first, then the wildcard key with the longest prefix, taking the first +// target with the wildcard's match substituted. +func resolvePath(paths map[string][]string, specifier string) string { + // Take an exact key. + if targets, ok := paths[specifier]; ok && len(targets) != 0 { + return targets[0] + } + + // Otherwise take the matching wildcard key with the longest prefix. + best, bestPrefix, match := "", "", "" + for key := range paths { + prefix, suffix, ok := strings.Cut(key, "*") + if !ok || !strings.HasPrefix(specifier, prefix) || !strings.HasSuffix(specifier, suffix) { + continue + } + if len(specifier) < len(prefix)+len(suffix) || best != "" && len(prefix) <= len(bestPrefix) { + continue + } + best, bestPrefix, match = key, prefix, specifier[len(prefix):len(specifier)-len(suffix)] + } + if best == "" || len(paths[best]) == 0 { + return "" + } + return strings.Replace(paths[best][0], "*", match, 1) +} diff --git a/publish/hyperline.go b/publish/hyperline.go index 4e0d1852..2b83fd92 100644 --- a/publish/hyperline.go +++ b/publish/hyperline.go @@ -42,6 +42,10 @@ const maxResponseBytes = 1 << 20 // contentType is the media type of every request and response body. const contentType = "application/octet-stream" +// serviceCallPath answers a local session's call to a service its mod names, +// for the mod's signed-in developer. +const serviceCallPath = "/api/mods/services/call" + // Hyperline publishes to hyperline.gg or another service with its API. type Hyperline struct { // Origin is the service, such as DefaultOrigin. @@ -86,6 +90,36 @@ func (h *Hyperline) JoinDevLobby(ctx context.Context, lobby string) (*DevLobbyHo return host, h.signedSend(ctx, devLobbyJoinPath, body, host) } +// CallService sends one call a mod in a local session made to a service its +// mod.json names, as the saved session's developer, and returns the reply. It +// never signs in: without a usable saved session it fails, naming modlock +// login. +func (h *Hyperline) CallService(ctx context.Context, call *ServiceCall) ([]byte, error) { + // Use only the saved session. + if err := checkOrigin(h.Origin); err != nil { + return nil, err + } + saved := SavedSession(h.SessionFile, h.Origin) + if saved == nil { + return nil, errors.Errorf("no saved sign-in for %s; run modlock login first", h.Origin) + } + + // Send the call; a refused session needs a new sign-in. + body, err := call.MarshalVT() + if err != nil { + return nil, err + } + answer := &ServiceAnswer{} + err = h.send(ctx, serviceCallPath, saved.GetToken(), body, answer) + if errors.Is(err, errSignIn) { + return nil, errors.Errorf("%s refused the saved sign-in; run modlock login again", h.Origin) + } + if err != nil { + return nil, err + } + return answer.GetPayload(), nil +} + // errSignIn reports that the service refused the session. var errSignIn = errors.New("sign in again") @@ -287,6 +321,12 @@ func (h *Hyperline) signIn(ctx context.Context) (*Session, error) { }, nil } +// CheckOrigin requires origin to be a service origin over HTTPS, or HTTP on +// loopback for a local service. +func CheckOrigin(origin string) error { + return checkOrigin(origin) +} + // checkOrigin requires HTTPS, except on loopback for a local service. func checkOrigin(origin string) error { parsed, err := url.Parse(origin) diff --git a/publish/hyperline_test.go b/publish/hyperline_test.go index bc8bb4bc..7281becc 100644 --- a/publish/hyperline_test.go +++ b/publish/hyperline_test.go @@ -139,3 +139,74 @@ func tarNames(t *testing.T, body io.Reader) []string { names = append(names, header.Name) } } + +// TestCallService sends a call with the saved session only, and reads back the +// service's answer and its refusals without ever signing in. +func TestCallService(t *testing.T) { + // Serve the call endpoint, refusing any other session. + var got *ServiceCall + service := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Refuse any other path or session. + if r.URL.Path != serviceCallPath || r.Header.Get("Authorization") != "Bearer saved" { + w.WriteHeader(http.StatusUnauthorized) + return + } + + // Record the call, then refuse another mod or answer. + body, _ := io.ReadAll(r.Body) + got = &ServiceCall{} + if err := got.UnmarshalVT(body); err != nil { + t.Error(err) + } + if got.GetMod() != "arena" { + data, _ := (&Error{Code: "forbidden", Message: "this account cannot call that service"}).MarshalVT() + w.WriteHeader(http.StatusForbidden) + _, _ = w.Write(data) + return + } + data, _ := (&ServiceAnswer{Payload: []byte(`{"drills":[]}`)}).MarshalVT() + _, _ = w.Write(data) + })) + defer service.Close() + call := &ServiceCall{Mod: "arena", Service: "Drills", Method: "ListDrills", Payload: []byte("{}")} + + // With no saved session the call fails before it is sent. + sessionFile := filepath.Join(t.TempDir(), "session.json") + hyperline := &Hyperline{Origin: service.URL, SessionFile: sessionFile, Output: io.Discard} + if _, err := hyperline.CallService(t.Context(), call); err == nil || got != nil { + t.Fatalf("no session: err %v, sent %v", err, got) + } + + // A refused session asks for a new sign-in rather than making one. + save := func(token string) { + saved, _ := (&Session{Origin: service.URL, Token: token, ExpiresAt: time.Now().Add(time.Hour).UnixMilli()}).MarshalJSON() + if err := os.WriteFile(sessionFile, saved, 0o600); err != nil { + t.Fatal(err) + } + } + save("stale") + if _, err := hyperline.CallService(t.Context(), call); err == nil || err.Error() != service.URL+" refused the saved sign-in; run modlock login again" { + t.Fatalf("stale session: %v", err) + } + + // The saved session's call reaches the service and returns its reply. + save("saved") + payload, err := hyperline.CallService(t.Context(), call) + if err != nil || string(payload) != `{"drills":[]}` { + t.Fatalf("answered %q, %v", payload, err) + } + if got.GetService() != "Drills" || got.GetMethod() != "ListDrills" || string(got.GetPayload()) != "{}" { + t.Errorf("the service got %v", got) + } + + // A refusal returns the service's explanation. + other := &ServiceCall{Mod: "other", Service: "Drills", Method: "ListDrills"} + if _, err := hyperline.CallService(t.Context(), other); err == nil || err.Error() != "this account cannot call that service" { + t.Errorf("refused call: %v", err) + } + + // Another origin is refused before any session is read. + if _, err := (&Hyperline{Origin: "http://example.com", SessionFile: sessionFile}).CallService(t.Context(), call); err == nil { + t.Error("a plain http origin was used") + } +} diff --git a/publish/publish.pb.go b/publish/publish.pb.go index 645397ef..52be9389 100644 --- a/publish/publish.pb.go +++ b/publish/publish.pb.go @@ -544,6 +544,74 @@ func (x *DevLobbyHost) GetSecret() uint64 { return 0 } +// ServiceCall is one call a mod in a local session makes to a service its +// mod.json names, which the signed-in developer forwards to the service. +type ServiceCall struct { + unknownFields []byte + // Mod is the calling mod's slug. + Mod string `protobuf:"bytes,1,opt,name=mod,proto3" json:"mod,omitempty"` + // Service names the service, as the mod's mod.json does. + Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` + // Method names the service's method. + Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` + // Payload is the call's bytes, opaque to Modlock. + Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *ServiceCall) Reset() { + *x = ServiceCall{} +} + +func (*ServiceCall) ProtoMessage() {} + +func (x *ServiceCall) GetMod() string { + if x != nil { + return x.Mod + } + return "" +} + +func (x *ServiceCall) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *ServiceCall) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *ServiceCall) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// ServiceAnswer is the service's reply to one ServiceCall. +type ServiceAnswer struct { + unknownFields []byte + // Payload is the reply's bytes. + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *ServiceAnswer) Reset() { + *x = ServiceAnswer{} +} + +func (*ServiceAnswer) ProtoMessage() {} + +func (x *ServiceAnswer) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + func (m *SignInExchange) CloneVT() *SignInExchange { if m == nil { return (*SignInExchange)(nil) @@ -786,6 +854,41 @@ func (m *DevLobbyHost) CloneMessageVT() protobuf_go_lite.CloneMessage { return m.CloneVT() } +func (m *ServiceCall) CloneVT() *ServiceCall { + if m == nil { + return (*ServiceCall)(nil) + } + r := new(ServiceCall) + r.Mod = m.Mod + r.Service = m.Service + r.Method = m.Method + r.Payload = protobuf_go_lite.CloneBytes(m.Payload) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *ServiceCall) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *ServiceAnswer) CloneVT() *ServiceAnswer { + if m == nil { + return (*ServiceAnswer)(nil) + } + r := new(ServiceAnswer) + r.Payload = protobuf_go_lite.CloneBytes(m.Payload) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *ServiceAnswer) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + func (this *SignInExchange) EqualVT(that *SignInExchange) bool { if this == that { return true @@ -1135,6 +1238,55 @@ func (this *DevLobbyHost) EqualMessageVT(thatMsg any) bool { return this.EqualVT(that) } +func (this *ServiceCall) EqualVT(that *ServiceCall) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Mod != that.Mod { + return false + } + if this.Service != that.Service { + return false + } + if this.Method != that.Method { + return false + } + if !protobuf_go_lite.EqualBytes(this.Payload, that.Payload) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ServiceCall) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*ServiceCall) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *ServiceAnswer) EqualVT(that *ServiceAnswer) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !protobuf_go_lite.EqualBytes(this.Payload, that.Payload) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ServiceAnswer) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*ServiceAnswer) + if !ok { + return false + } + return this.EqualVT(that) +} + // MarshalProtoJSON marshals the ReviewState to JSON. func (x ReviewState) MarshalProtoJSON(s *json.MarshalState) { s.WriteEnum(int32(x), ReviewState_name) @@ -1910,6 +2062,114 @@ func (x *DevLobbyHost) UnmarshalJSON(b []byte) error { return json.DefaultUnmarshalerConfig.Unmarshal(b, x) } +// MarshalProtoJSON marshals the ServiceCall message to JSON. +func (x *ServiceCall) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Mod != "" || s.HasField("mod") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("mod") + s.WriteString(x.Mod) + } + if x.Service != "" || s.HasField("service") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("service") + s.WriteString(x.Service) + } + if x.Method != "" || s.HasField("method") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("method") + s.WriteString(x.Method) + } + if len(x.Payload) > 0 || s.HasField("payload") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("payload") + s.WriteBytes(x.Payload) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the ServiceCall to JSON. +func (x *ServiceCall) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the ServiceCall message from JSON. +func (x *ServiceCall) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "mod": + s.AddField("mod") + x.Mod = s.ReadString() + case "service": + s.AddField("service") + x.Service = s.ReadString() + case "method": + s.AddField("method") + x.Method = s.ReadString() + case "payload": + s.AddField("payload") + x.Payload = s.ReadBytes() + } + }) +} + +// UnmarshalJSON unmarshals the ServiceCall from JSON. +func (x *ServiceCall) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the ServiceAnswer message to JSON. +func (x *ServiceAnswer) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if len(x.Payload) > 0 || s.HasField("payload") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("payload") + s.WriteBytes(x.Payload) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the ServiceAnswer to JSON. +func (x *ServiceAnswer) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the ServiceAnswer message from JSON. +func (x *ServiceAnswer) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "payload": + s.AddField("payload") + x.Payload = s.ReadBytes() + } + }) +} + +// UnmarshalJSON unmarshals the ServiceAnswer from JSON. +func (x *ServiceAnswer) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + func (m *SignInExchange) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -2531,6 +2791,95 @@ func (m *DevLobbyHost) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ServiceCall) 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 *ServiceCall) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ServiceCall) 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.Payload) > 0 { + i = protobuf_go_lite.EncodeBytes(dAtA, i, m.Payload) + i-- + dAtA[i] = 0x22 + } + if len(m.Method) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Method) + i-- + dAtA[i] = 0x1a + } + if len(m.Service) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Service) + i-- + dAtA[i] = 0x12 + } + if len(m.Mod) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Mod) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ServiceAnswer) 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 *ServiceAnswer) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ServiceAnswer) 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.Payload) > 0 { + i = protobuf_go_lite.EncodeBytes(dAtA, i, m.Payload) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *SignInExchange) SizeVT() (n int) { if m == nil { return 0 @@ -2724,6 +3073,31 @@ func (m *DevLobbyHost) SizeVT() (n int) { return n } +func (m *ServiceCall) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Mod) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Service) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Method) + n += protobuf_go_lite.SizeBytesNonEmpty(1, m.Payload) + n += len(m.unknownFields) + return n +} + +func (m *ServiceAnswer) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeBytesNonEmpty(1, m.Payload) + n += len(m.unknownFields) + return n +} + func (x ReviewState) MarshalProtoText() string { return x.String() } @@ -3004,6 +3378,46 @@ func (x *DevLobbyHost) String() string { return x.MarshalProtoText() } +func (x *ServiceCall) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "ServiceCall") + if x.Mod != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "mod") + protobuf_go_lite.TextWriteString(&sb, x.Mod) + } + if x.Service != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "service") + protobuf_go_lite.TextWriteString(&sb, x.Service) + } + if x.Method != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "method") + protobuf_go_lite.TextWriteString(&sb, x.Method) + } + if len(x.Payload) != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "payload") + protobuf_go_lite.TextWriteBytes(&sb, x.Payload) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *ServiceCall) String() string { + return x.MarshalProtoText() +} + +func (x *ServiceAnswer) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "ServiceAnswer") + if len(x.Payload) != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "payload") + protobuf_go_lite.TextWriteBytes(&sb, x.Payload) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *ServiceAnswer) String() string { + return x.MarshalProtoText() +} + func (m *SignInExchange) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3890,3 +4304,135 @@ func (m *DevLobbyHost) UnmarshalVT(dAtA []byte) error { } return nil } + +func (m *ServiceCall) 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: ServiceCall: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceCall: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Mod = v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Service = v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Method = v + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, 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 *ServiceAnswer) 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: ServiceAnswer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceAnswer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, 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 +} diff --git a/publish/publish.pb.ts b/publish/publish.pb.ts index d5450e95..1f0d5d45 100644 --- a/publish/publish.pb.ts +++ b/publish/publish.pb.ts @@ -855,3 +855,126 @@ export const DevLobbyHost: MessageType = }, }, ) + +/** + * ServiceCall is one call a mod in a local session makes to a service its + * mod.json names, which the signed-in developer forwards to the service. + * + * @generated from message modlock.publish.ServiceCall + */ +export interface ServiceCall { + /** + * Mod is the calling mod's slug. + */ + mod?: string + /** + * Service names the service, as the mod's mod.json does. + */ + service?: string + /** + * Method names the service's method. + */ + method?: string + /** + * Payload is the call's bytes, opaque to Modlock. + */ + payload?: Uint8Array +} + +export const ServiceCall: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.publish.ServiceCall', + () => [ + [1, 'mod', 9], + [2, 'service', 9], + [3, 'method', 9], + [4, 'payload', 12], + ], + { + decode: (r: BinaryReader, end: number, m: ServiceCall): ServiceCall => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.mod = r.string() + break + case 2: + m.service = r.string() + break + case 3: + m.method = r.string() + break + case 4: + m.payload = r.bytes() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: ServiceCall, w: Writer): void => { + { + const v = m.mod + if (v) w.uint32(10).string(v) + } + { + const v = m.service + if (v) w.uint32(18).string(v) + } + { + const v = m.method + if (v) w.uint32(26).string(v) + } + { + const v = m.payload + if (v != null && v.length !== 0) w.uint32(34).bytes(v) + } + }, + }, + ) + +/** + * ServiceAnswer is the service's reply to one ServiceCall. + * + * @generated from message modlock.publish.ServiceAnswer + */ +export interface ServiceAnswer { + /** + * Payload is the reply's bytes. + */ + payload?: Uint8Array +} + +export const ServiceAnswer: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.publish.ServiceAnswer', + () => [[1, 'payload', 12]], + { + decode: ( + r: BinaryReader, + end: number, + m: ServiceAnswer, + ): ServiceAnswer => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.payload = r.bytes() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: ServiceAnswer, w: Writer): void => { + { + const v = m.payload + if (v != null && v.length !== 0) w.uint32(10).bytes(v) + } + }, + }, + ) diff --git a/publish/publish.proto b/publish/publish.proto index 99e36060..dbbb707b 100644 --- a/publish/publish.proto +++ b/publish/publish.proto @@ -178,3 +178,25 @@ message DevLobbyHost { // Secret admits the guest's game to the host session. uint64 secret = 2; } + +// ServiceCall is one call a mod in a local session makes to a service its +// mod.json names, which the signed-in developer forwards to the service. +message ServiceCall { + // Mod is the calling mod's slug. + string mod = 1; + + // Service names the service, as the mod's mod.json does. + string service = 2; + + // Method names the service's method. + string method = 3; + + // Payload is the call's bytes, opaque to Modlock. + bytes payload = 4; +} + +// ServiceAnswer is the service's reply to one ServiceCall. +message ServiceAnswer { + // Payload is the reply's bytes. + bytes payload = 1; +} diff --git a/python/library.py b/python/library.py index 637c4827..2840bda9 100644 --- a/python/library.py +++ b/python/library.py @@ -826,6 +826,33 @@ def __init__(self, delay: float, run: Callable[[], float | None]) -> None: _entries: list[_Entry] = [] +# ServiceDone ends one call_service_later: with the reply and no error, or +# with no reply, the error and the failure that says why. +type ServiceDone = Callable[[bytes | None, str | None, ServiceFailure], object] + +# _waiting maps each started service call's number to the function its end +# runs. +_waiting: dict[int, ServiceDone] = {} + + +def call_service_later( + service: str, method: str, payload: bytes, done: ServiceDone, timeout: float = 0.0 +) -> None: + """call_service_later 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 timeout seconds 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.""" + # A call the host refuses to start ends in the next frame as well, so done + # never runs before this returns. + call = start_service_call(service, method, payload, int(timeout * 1000)) + if call is None: + after(0, lambda: done(None, "the host did not start the call to " + service, "unavailable")) + return + _waiting[call] = done + + def _schedule(delay: float, run: Callable[[], float | None]) -> Timer: entry = _Entry(delay, run) _entries.append(entry) @@ -1437,6 +1464,16 @@ def _npcs_restored(event: NpcsRestoredEvent) -> None: handler(event.error or None) +def _service_replied(event: ServiceRepliedEvent) -> None: + done = _waiting.pop(event.call, None) + if done is None: + return + if event.failure not in (None, "none"): + done(None, event.error, event.failure) + return + done(event.payload, None, "none") + + def _launch(event: LaunchEvent) -> None: for handler in _launches: handler(event) @@ -1513,6 +1550,7 @@ def _player_left(event: PlayerLeftEvent) -> None: "ui_press": _ui_press, "ui_input": _ui_input, "serve": _serve, + "service_replied": _service_replied, "damage": _damage, "damaged": _damaged, "killed": _killed, diff --git a/python/modlock/__init__.py b/python/modlock/__init__.py index a9ef0d52..a97e6013 100644 --- a/python/modlock/__init__.py +++ b/python/modlock/__init__.py @@ -836,6 +836,20 @@ def _hero_name(name: str) -> str: } +# ServiceFailure says why a service call ended without an answer. +type ServiceFailure = Literal["none", "refused", "timeout", "unavailable"] +_ServiceFailure: dict[Any, Any] = { + 0: "none", + "none": 0, + 1: "refused", + "refused": 1, + 2: "timeout", + "timeout": 2, + 3: "unavailable", + "unavailable": 3, +} + + # _Window maps each Window to its number and back. _Window: dict[Any, Any] = { 1: "all_time", @@ -2158,12 +2172,21 @@ class Wheel: @dataclasses.dataclass(slots=True, kw_only=True) class UiPressEvent: - """UiPressEvent reports a press on a button in a player's interface.""" + """UiPressEvent reports a press on a button in a player's interface, or a + press a layout's script sent with an action and a payload. + """ # player is the player who pressed. player: Player - # node is the id of the pressed button. + # node is the id of the pressed button, or of the layout whose script + # sent the press. node: str = "" + # action names a layout's press, as its script sent it: one to 64 + # letters, digits, '_', '-' and '.'. It is empty for a button's press. + action: str = "" + # payload is the text a layout's press carries, which the layout library + # writes as JSON: valid UTF-8 of at most 180 bytes. + payload: str = "" @dataclasses.dataclass(slots=True, kw_only=True) @@ -2321,6 +2344,20 @@ class ServiceReply: payload: bytes = b"" +@dataclasses.dataclass(slots=True, kw_only=True) +class ServiceRepliedEvent: + """ServiceRepliedEvent ends one started service call.""" + + # call is the number StartServiceCall returned. + call: int = 0 + # payload is the answer, when failure is none. + payload: bytes = b"" + # failure says why the call ended without an answer. + failure: ServiceFailure | None = None + # error describes the failure. + error: str = "" + + @dataclasses.dataclass(slots=True, kw_only=True) class PrecacheOptions: """PrecacheOptions names what the next world loads ahead of use.""" @@ -4690,6 +4727,8 @@ def remove(self) -> bool: [ wire.Field(1, "player", "int32", cls=Player, key="slot"), wire.Field(2, "node", "string"), + wire.Field(3, "action", "string"), + wire.Field(4, "payload", "string"), ], ), "UiInputEvent": ( @@ -4802,6 +4841,30 @@ def remove(self) -> bool: wire.Field(1, "payload", "bytes"), ], ), + "StartServiceCallRequest": ( + None, + [ + wire.Field(1, "service", "string"), + wire.Field(2, "method", "string"), + wire.Field(3, "payload", "bytes"), + wire.Field(4, "timeout_milliseconds", "uint32"), + ], + ), + "ServiceCallStarted": ( + None, + [ + wire.Field(1, "call", "uint64"), + ], + ), + "ServiceRepliedEvent": ( + ServiceRepliedEvent, + [ + wire.Field(1, "call", "uint64"), + wire.Field(2, "payload", "bytes"), + wire.Field(3, "failure", "enum", enum=_ServiceFailure), + wire.Field(4, "error", "string"), + ], + ), "LogRequest": ( None, [ @@ -5246,6 +5309,22 @@ def call_service(service: str, method: str, payload: bytes) -> bytes | None: return response.payload +def start_service_call(service: str, method: str, payload: bytes, timeout_milliseconds: int) -> int | None: + """start_service_call calls method of a service the host provides and + returns at once with a number; the answer arrives in a later frame as a + ServiceReplied event carrying that number. Every call ends once: with + the reply, the service's refusal, a timeout or no provider at all. A + service nobody provides is never asked. The host waits at most 30 + seconds, or the call's shorter timeout, and drops the mod's waiting + calls when the mod stops or reloads. A service that answers at once + answers this way too, in the next frame. + """ + response = _call("StartServiceCall", "StartServiceCallRequest", {"service": service, "method": method, "payload": payload, "timeout_milliseconds": timeout_milliseconds}, "ServiceCallStarted") + if response is None: + return None + return response["call"] + + def create_entity(options: EntityOptions) -> int | None: """create_entity creates an entity the server knows by its designer name, such as npc_trooper_boss or prop_dynamic, with spawn key values and fields @@ -5512,6 +5591,7 @@ def give_entity_modifier(entity: int, modifier: str, seconds: float) -> bool: "UiPress": ("UiPressEvent", "Empty", "ui_press"), "UiInput": ("UiInputEvent", "Empty", "ui_input"), "Serve": ("ServiceCall", "ServiceReply", "serve"), + "ServiceReplied": ("ServiceRepliedEvent", "Empty", "service_replied"), "Damage": ("DamageEvent", "DamageResult", "damage"), "Damaged": ("DamagedEvent", "Empty", "damaged"), "Killed": ("KillEvent", "Empty", "killed"), @@ -6343,6 +6423,33 @@ def __init__(self, delay: float, run: Callable[[], float | None]) -> None: _entries: list[_Entry] = [] +# ServiceDone ends one call_service_later: with the reply and no error, or +# with no reply, the error and the failure that says why. +type ServiceDone = Callable[[bytes | None, str | None, ServiceFailure], object] + +# _waiting maps each started service call's number to the function its end +# runs. +_waiting: dict[int, ServiceDone] = {} + + +def call_service_later( + service: str, method: str, payload: bytes, done: ServiceDone, timeout: float = 0.0 +) -> None: + """call_service_later 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 timeout seconds 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.""" + # A call the host refuses to start ends in the next frame as well, so done + # never runs before this returns. + call = start_service_call(service, method, payload, int(timeout * 1000)) + if call is None: + after(0, lambda: done(None, "the host did not start the call to " + service, "unavailable")) + return + _waiting[call] = done + + def _schedule(delay: float, run: Callable[[], float | None]) -> Timer: entry = _Entry(delay, run) _entries.append(entry) @@ -6954,6 +7061,16 @@ def _npcs_restored(event: NpcsRestoredEvent) -> None: handler(event.error or None) +def _service_replied(event: ServiceRepliedEvent) -> None: + done = _waiting.pop(event.call, None) + if done is None: + return + if event.failure not in (None, "none"): + done(None, event.error, event.failure) + return + done(event.payload, None, "none") + + def _launch(event: LaunchEvent) -> None: for handler in _launches: handler(event) @@ -7030,6 +7147,7 @@ def _player_left(event: PlayerLeftEvent) -> None: "ui_press": _ui_press, "ui_input": _ui_input, "serve": _serve, + "service_replied": _service_replied, "damage": _damage, "damaged": _damaged, "killed": _killed, diff --git a/sandbox/build.go b/sandbox/build.go index e416ed92..b941d901 100644 --- a/sandbox/build.go +++ b/sandbox/build.go @@ -22,6 +22,9 @@ type Build struct { Entry []byte // Data holds the files the mod ships in its data/ directory. Data fs.FS + // fixtures answer the services the manifest names that have a fixture, + // by service name. + fixtures map[string]*fixture } // ReadBuild reads the built mod in dist through its manifest. diff --git a/sandbox/config.go b/sandbox/config.go index 0b74e40d..89e2508c 100644 --- a/sandbox/config.go +++ b/sandbox/config.go @@ -30,4 +30,8 @@ type Config struct { // so a later session loads the interpreters and an unchanged mod without // compiling them, or empty to compile each module once per session. Compiled string + // Fixtures returns the directory of service fixtures for the built mod at + // path, or empty when it has none; see FixtureDir. Nil gives no mod + // fixtures. + Fixtures func(path string) string } diff --git a/sandbox/metrics_test.go b/sandbox/metrics_test.go index 2ba5abf0..8a3d8821 100644 --- a/sandbox/metrics_test.go +++ b/sandbox/metrics_test.go @@ -23,7 +23,7 @@ func TestMetrics(t *testing.T) { }}} add := func(name, label string) { request, _ := (&metricspb.AddMetricRequest{Name: name, Label: &label}).MarshalVT() - s.answer(&Build{Manifest: manifest}, &wasm.Call{Method: "AddMetric", Request: request}) + s.answer(&Build{Manifest: manifest}, &serviceCalls{}, &wasm.Call{Method: "AddMetric", Request: request}) } // Count the declared label and refuse an undeclared label and metric. @@ -46,7 +46,7 @@ func TestHandoff(t *testing.T) { build := &Build{Manifest: &wasm.Manifest{Slug: "hud"}} call := func(method string, request interface{ MarshalVT() ([]byte, error) }) string { data, _ := request.MarshalVT() - reply := s.answer(build, &wasm.Call{Method: method, Request: data}) + reply := s.answer(build, &serviceCalls{}, &wasm.Call{Method: method, Request: data}) response := &wasm.HandedOffResponse{} if err := response.UnmarshalVT(reply.GetResponse()); err != nil { t.Fatal(err) diff --git a/sandbox/sandbox.go b/sandbox/sandbox.go index 23dc8238..9382afd6 100644 --- a/sandbox/sandbox.go +++ b/sandbox/sandbox.go @@ -4,9 +4,11 @@ import ( "context" "os" "path/filepath" + "regexp" "strconv" "strings" "time" + "unicode/utf8" "github.com/paralin/modlock/files" "github.com/paralin/modlock/metrics" @@ -89,6 +91,9 @@ type running struct { mod *Mod // wants lists the events the mod consumes. wants *wasm.StartResult + // calls holds the instance's started service calls until a frame ends + // them. + calls *serviceCalls } // Start starts the mods in a new sandbox. A mod that fails to load reports @@ -139,19 +144,38 @@ func (s *Sandbox) Command(ctx context.Context, line string) (bool, error) { } // Press presses the button node in the interface mod shows the player in -// slot, and reports whether the mod is running to receive it. -func (s *Sandbox) Press(ctx context.Context, mod string, slot int32, node string) (bool, error) { +// slot, or with an action sends the press node's layout script made with +// that payload, and reports whether the mod is running to receive it. It +// refuses an action or payload the game's host would not pass on. +func (s *Sandbox) Press(ctx context.Context, mod string, slot int32, node, action, payload string) (bool, error) { + // Hold a layout's press to what the game carries. + if action != "" && !layoutAction.MatchString(action) { + return false, errors.Errorf("%s cannot name a layout's press", action) + } + if len(payload) > maxActionPayload || !utf8.ValidString(payload) || (action == "" && payload != "") { + return false, errors.New("a layout's press carries at most 180 bytes of text") + } + + // Deliver the press to the mod that shows it. var pressed bool + event := &ui.UiPressEvent{Player: slot, Node: node, Action: action, Payload: payload} err := s.do(ctx, func(ctx context.Context) { for _, running := range s.mods { if running.name == mod { - pressed = s.deliver(ctx, running, "UiPress", &ui.UiPressEvent{Player: slot, Node: node}, nil) + pressed = s.deliver(ctx, running, "UiPress", event, nil) } } }) return pressed, err } +// layoutAction matches the name of a layout's press, as the game's host +// takes it. +var layoutAction = regexp.MustCompile(`^[\w.-]{1,64}$`) + +// maxActionPayload is the most bytes of text a layout's press carries. +const maxActionPayload = 180 + // Input delivers a change to an input in the interface mod shows the // event's player, and reports whether the mod is running to receive it. The // creator's own preview sends it, so the sandbox passes the value on as sent. @@ -273,30 +297,39 @@ func (s *Sandbox) load(ctx context.Context, path string) { return } + // Name the provider of each service it calls; a needed one missing + // refuses the mod before it starts. + if err := s.provide(path, build); err != nil { + fail(err) + return + } + // Load its module and start it in the world. - mod, wants, err := s.start(ctx, name, build) + calls := &serviceCalls{} + mod, wants, err := s.start(ctx, name, build, calls) if err != nil { fail(err) return } - // Replace the running mod of the same name, or add it. + // Replace the running mod of the same name, or add it; the calls the + // old instance started end with it. for _, old := range s.mods { if old.name == name { if old.mod != nil { _ = old.mod.Close(ctx) } - old.mod, old.wants = mod, wants + old.mod, old.wants, old.calls = mod, wants, calls s.event(&control.HostEvent{Body: &control.HostEvent_Started{Started: &control.ModStarted{Mod: name, Reloaded: true}}}) return } } - s.mods = append(s.mods, &running{name: name, mod: mod, wants: wants}) + s.mods = append(s.mods, &running{name: name, mod: mod, wants: wants, calls: calls}) s.event(&control.HostEvent{Body: &control.HostEvent_Started{Started: &control.ModStarted{Mod: name}}}) } // start loads build's module, starts it and gives it the world. -func (s *Sandbox) start(ctx context.Context, name string, build *Build) (*Mod, *wasm.StartResult, error) { +func (s *Sandbox) start(ctx context.Context, name string, build *Build, calls *serviceCalls) (*Mod, *wasm.StartResult, error) { // Choose the module: the mod's own, or the interpreter for its source. module, source, err := s.module(ctx, build) if err != nil { @@ -305,7 +338,7 @@ func (s *Sandbox) start(ctx context.Context, name string, build *Build) (*Mod, * // Load it with the sandbox answering its host calls. mod, err := Load(ctx, module, Options{ - Calls: func(call *wasm.Call) *wasm.Reply { return s.answer(build, call) }, + Calls: func(call *wasm.Call) *wasm.Reply { return s.answer(build, calls, call) }, Output: &lines{write: func(line string) { s.log(name, line) }}, Cache: s.cache, }) @@ -379,10 +412,12 @@ func (s *Sandbox) command(ctx context.Context, line string) bool { return false } -// frame gives one frame to each mod that consumes frames. +// frame ends each mod's started service calls, then gives one frame to each +// mod that consumes frames. func (s *Sandbox) frame(ctx context.Context, elapsed time.Duration) { s.tick++ for _, mod := range s.mods { + s.endCalls(ctx, mod) if mod.wants.GetFrames() { s.deliver(ctx, mod, "Frame", &wasm.FrameEvent{Tick: s.tick, TimeSeconds: elapsed.Seconds()}, nil) } @@ -438,7 +473,7 @@ func (s *Sandbox) failed(mod string, err error) { // stand-in player, keeps the player's settings, refuses service calls as a // host without extensions does, and answers the rest empty, as for a player // without a hero. -func (s *Sandbox) answer(build *Build, call *wasm.Call) *wasm.Reply { +func (s *Sandbox) answer(build *Build, calls *serviceCalls, call *wasm.Call) *wasm.Reply { // Decode the requests the sandbox reports. manifest := build.Manifest mod := manifest.GetSlug() @@ -503,10 +538,12 @@ func (s *Sandbox) answer(build *Build, call *wasm.Call) *wasm.Reply { case "CallService": request := &wasm.ServiceCall{} _ = request.UnmarshalVT(call.GetRequest()) - if request.GetService() == scoresService { - return s.scores(manifest, request) + if reply := s.callService(build, request); reply != nil { + return reply } return &wasm.Reply{Error: "this host provides no service " + request.GetService()} + case "StartServiceCall": + return s.startServiceCall(build, calls, call) } return &wasm.Reply{} diff --git a/sandbox/sandbox_test.go b/sandbox/sandbox_test.go index 28dbe7a3..3985b877 100644 --- a/sandbox/sandbox_test.go +++ b/sandbox/sandbox_test.go @@ -15,8 +15,8 @@ import ( // TestSandbox runs a Go mod that answers /hello: the stand-in player joins, // the command reaches the mod and its chat comes back as a message, an -// unknown command and a press in a missing mod go unhandled, and a reload -// restarts the mod. +// unknown command and a press in a missing mod go unhandled, a layout press +// the game could not carry is refused, and a reload restarts the mod. func TestSandbox(t *testing.T) { // Build the mod. dist := t.TempDir() @@ -62,9 +62,21 @@ func TestSandbox(t *testing.T) { case <-time.After(10 * time.Second): t.Fatal("/hello did not answer within 10 s") } - if pressed, err := box.Press(ctx, "missing", 0, "button"); err != nil || pressed { + if pressed, err := box.Press(ctx, "missing", 0, "button", "", ""); err != nil || pressed { t.Fatalf("press in a missing mod: pressed %v, %v", pressed, err) } + + // A layout's press the game could not carry is refused before any mod. + for _, refused := range [][2]string{ + {"buy now", ""}, + {"", "{}"}, + {"buy", string(make([]byte, 181))}, + {"buy", "\xff"}, + } { + if pressed, err := box.Press(ctx, "hello", 0, "card", refused[0], refused[1]); err == nil || pressed { + t.Fatalf("press %q %q: pressed %v, %v", refused[0], refused[1], pressed, err) + } + } if err := box.Reload(ctx, dist); err != nil { t.Fatal(err) } diff --git a/sandbox/service_test.go b/sandbox/service_test.go index 1423a231..f97dc9e9 100644 --- a/sandbox/service_test.go +++ b/sandbox/service_test.go @@ -24,7 +24,7 @@ func TestCallService(t *testing.T) { serve := func(service, method string, payload interface{ MarshalVT() ([]byte, error) }) *wasm.Reply { data, _ := payload.MarshalVT() request, _ := (&wasm.ServiceCall{Service: service, Method: method, Payload: data}).MarshalVT() - return s.answer(build, &wasm.Call{Method: "CallService", Request: request}) + return s.answer(build, &serviceCalls{}, &wasm.Call{Method: "CallService", Request: request}) } // Refuse a service the sandbox lacks. diff --git a/sandbox/services.go b/sandbox/services.go new file mode 100644 index 00000000..da75d9ab --- /dev/null +++ b/sandbox/services.go @@ -0,0 +1,212 @@ +package sandbox + +import ( + "bytes" + "context" + "encoding/json" + "os" + "path/filepath" + "strconv" + + "github.com/paralin/modlock/src/wasm" + "github.com/pkg/errors" +) + +// FixtureDir is the directory of a mod project that holds its service +// fixtures: one file per service, .json, an object whose keys are the +// service's methods and whose values are each method's reply, sent as that +// JSON's bytes. +const FixtureDir = "services" + +// fixture answers one service from a fixture file. +type fixture struct { + // path is the fixture file. + path string + // replies are the replies by method. + replies map[string]json.RawMessage +} + +// provide finds the provider of each service build's manifest names, logs +// which answers each, and keeps the fixtures on build. It fails, naming the +// service, when a service the mod needs has no provider. +func (s *Sandbox) provide(path string, build *Build) error { + // Find the mod's fixtures, if its build has a project. + mod := build.Manifest.GetSlug() + var dir string + if s.config.Fixtures != nil { + dir = s.config.Fixtures(path) + } + + // Name each service's provider: the sandbox itself, a fixture or nobody. + var missing error + for _, service := range build.Manifest.GetServices() { + name := service.GetName() + provider, err := readFixture(dir, name) + switch { + case err != nil: + return err + case provider == nil && name == scoresService: + s.log(mod, "service "+name+": the sandbox") + case provider != nil: + s.log(mod, "service "+name+": fixture "+provider.path) + if build.fixtures == nil { + build.fixtures = map[string]*fixture{} + } + build.fixtures[name] = provider + case service.GetOptional(): + s.log(mod, "service "+name+": nobody (optional)") + default: + s.log(mod, "service "+name+": nobody") + if missing == nil { + missing = errors.Errorf("the mod needs service %s, which nobody provides here; add %s", name, filepath.Join(FixtureDir, name+".json")) + } + } + } + return missing +} + +// ReadFixture reads the fixture of service name in dir: its file and each +// method's reply as compact JSON. The path is empty when dir holds none, so a +// game host can answer from the same files the sandbox does. +func ReadFixture(dir, name string) (string, map[string][]byte, error) { + // Read the file, if there is one. + found, err := readFixture(dir, name) + if err != nil || found == nil { + return "", nil, err + } + + // Compact each reply as the sandbox sends it. + replies := make(map[string][]byte, len(found.replies)) + for method, reply := range found.replies { + var compact bytes.Buffer + if err := json.Compact(&compact, reply); err != nil { + return "", nil, errors.Wrapf(err, "compact %s's reply to %s", found.path, method) + } + replies[method] = compact.Bytes() + } + return found.path, replies, nil +} + +// readFixture reads the fixture of service name in dir, or is nil when dir +// holds none. +func readFixture(dir, name string) (*fixture, error) { + // A service without a fixture file has no fixture; a name that is not one + // file name never reads outside dir. + if dir == "" || name == "" || name == "." || name == ".." || filepath.Base(name) != name { + return nil, nil + } + path := filepath.Join(dir, name+".json") + data, err := os.ReadFile(path) + if errors.Is(err, os.ErrNotExist) { + return nil, nil + } + if err != nil { + return nil, errors.Wrap(err, "read the fixture of service "+name) + } + + // Read its replies by method. + replies := map[string]json.RawMessage{} + if err := json.Unmarshal(data, &replies); err != nil { + return nil, errors.Wrapf(err, "parse %s, an object of replies by method", path) + } + return &fixture{path: path, replies: replies}, nil +} + +// answer replies to call from the fixture, or fails for a method it lacks. +func (f *fixture) answer(call *wasm.ServiceCall) *wasm.Reply { + // Find the method's reply. + reply, ok := f.replies[call.GetMethod()] + if !ok { + return &wasm.Reply{Error: "the fixture " + f.path + " has no method " + call.GetMethod()} + } + + // Send it as compact JSON. + var compact bytes.Buffer + if err := json.Compact(&compact, reply); err != nil { + return &wasm.Reply{Error: err.Error()} + } + response, _ := (&wasm.ServiceReply{Payload: compact.Bytes()}).MarshalVT() + return &wasm.Reply{Response: response} +} + +// maxServiceCalls bounds the calls a mod starts between frames, as the host +// does. +const maxServiceCalls = 256 + +// serviceCalls holds one mod instance's started service calls. Every +// provider here answers at once, so each call ends in the next frame. +type serviceCalls struct { + // next is the number of the last call started. + next uint64 + // ended holds the ends the next frame delivers, in call order. + ended []*wasm.ServiceRepliedEvent +} + +// callService answers request from the provider of its service: the +// sandbox's scores or the mod's fixture. It is nil when nobody provides the +// service. +func (s *Sandbox) callService(build *Build, request *wasm.ServiceCall) *wasm.Reply { + if request.GetService() == scoresService { + return s.scores(build.Manifest, request) + } + if provider := build.fixtures[request.GetService()]; provider != nil { + return provider.answer(request) + } + return nil +} + +// startServiceCall numbers a StartServiceCall from the mod build describes +// and keeps its end for the next frame. The provider answers through the +// same path as a CallService, so a mod cannot tell a fixture from another +// provider; a service nobody provides is never asked. +func (s *Sandbox) startServiceCall(build *Build, calls *serviceCalls, call *wasm.Call) *wasm.Reply { + // Decode the call, refusing one past the bound. + request := &wasm.StartServiceCallRequest{} + if err := request.UnmarshalVT(call.GetRequest()); err != nil { + return &wasm.Reply{Error: "the StartServiceCall request is malformed"} + } + if len(calls.ended) >= maxServiceCalls { + return &wasm.Reply{Error: "the mod already holds " + strconv.Itoa(maxServiceCalls) + " service calls"} + } + calls.next++ + event := &wasm.ServiceRepliedEvent{Call: calls.next} + + // Ask the provider now, and keep the answer, its refusal or the absence + // of a provider. + reply := s.callService(build, &wasm.ServiceCall{ + Service: request.GetService(), + Method: request.GetMethod(), + Payload: request.GetPayload(), + }) + switch { + case reply == nil: + event.Failure = wasm.ServiceFailure_SERVICE_FAILURE_UNAVAILABLE + event.Error = "this host provides no service " + request.GetService() + case reply.GetError() != "": + event.Failure = wasm.ServiceFailure_SERVICE_FAILURE_REFUSED + event.Error = reply.GetError() + default: + answer := &wasm.ServiceReply{} + _ = answer.UnmarshalVT(reply.GetResponse()) + event.Payload = answer.GetPayload() + } + calls.ended = append(calls.ended, event) + + // Return the call's number. + started, _ := (&wasm.ServiceCallStarted{Call: calls.next}).MarshalVT() + return &wasm.Reply{Response: started} +} + +// endCalls delivers the ends of mod's started service calls. +func (s *Sandbox) endCalls(ctx context.Context, mod *running) { + if mod.calls == nil || len(mod.calls.ended) == 0 { + return + } + ended := mod.calls.ended + mod.calls.ended = nil + for _, event := range ended { + if !s.deliver(ctx, mod, "ServiceReplied", event, nil) { + return + } + } +} diff --git a/sandbox/services_test.go b/sandbox/services_test.go new file mode 100644 index 00000000..8bf67d70 --- /dev/null +++ b/sandbox/services_test.go @@ -0,0 +1,211 @@ +package sandbox + +import ( + "context" + "os" + "os/exec" + "path/filepath" + "slices" + "strings" + "sync" + "testing" + + "github.com/paralin/modlock/src/host_app/control" + "github.com/paralin/modlock/src/wasm" +) + +// TestServiceFixture answers a service the manifest names from the fixture +// in the mod's project, reply by method, and fails a method the fixture lacks +// and a service the manifest does not name. +func TestServiceFixture(t *testing.T) { + // Write one fixture and name its service. + dir := t.TempDir() + fixture := `{"read": {"key": "slide", "steps": [1, 2]}, "save": true}` + if err := os.WriteFile(filepath.Join(dir, "example.drills.v1.json"), []byte(fixture), 0o644); err != nil { + t.Fatal(err) + } + var logged []string + s := &Sandbox{config: Config{ + Fixtures: func(string) string { return dir }, + Events: func(event *control.HostEvent) { logged = append(logged, event.GetLog().GetText()) }, + }} + build := &Build{Manifest: &wasm.Manifest{Slug: "trial", Services: []*wasm.Service{{Name: "example.drills.v1"}}}} + if err := s.provide("build", build); err != nil { + t.Fatal(err) + } + if want := "service example.drills.v1: fixture " + filepath.Join(dir, "example.drills.v1.json"); !slices.Equal(logged, []string{want}) { + t.Fatalf("logged %q, want %q", logged, want) + } + serve := func(service, method string) *wasm.Reply { + request, _ := (&wasm.ServiceCall{Service: service, Method: method, Payload: []byte(`{"key":"slide"}`)}).MarshalVT() + return s.answer(build, &serviceCalls{}, &wasm.Call{Method: "CallService", Request: request}) + } + + // Answer each method with its reply as compact JSON. + for method, want := range map[string]string{"read": `{"key":"slide","steps":[1,2]}`, "save": `true`} { + reply := serve("example.drills.v1", method) + answer := &wasm.ServiceReply{} + if reply.GetError() != "" || answer.UnmarshalVT(reply.GetResponse()) != nil || string(answer.GetPayload()) != want { + t.Fatalf("%s answered %q (error %q), want %s", method, answer.GetPayload(), reply.GetError(), want) + } + } + + // Fail a method the fixture lacks, and a service the manifest does not name. + if reply := serve("example.drills.v1", "list"); !strings.Contains(reply.GetError(), "has no method list") { + t.Fatalf("a missing method answered %v", reply) + } + if reply, want := serve("example.other.v1", "read"), "this host provides no service example.other.v1"; reply.GetError() != want { + t.Fatalf("error %q, want %q", reply.GetError(), want) + } +} + +// TestStartedServiceCall answers a started call from the same fixture a +// CallService reads, and keeps each end for the next frame: the answer, the +// fixture's refusal, and a service nobody provides, which is never asked. +func TestStartedServiceCall(t *testing.T) { + // Write one fixture and name its service. + dir := t.TempDir() + if err := os.WriteFile(filepath.Join(dir, "example.drills.v1.json"), []byte(`{"read": {"key": "slide"}}`), 0o644); err != nil { + t.Fatal(err) + } + s := &Sandbox{config: Config{Fixtures: func(string) string { return dir }, Events: func(*control.HostEvent) {}}} + build := &Build{Manifest: &wasm.Manifest{Slug: "trial", Services: []*wasm.Service{{Name: "example.drills.v1"}}}} + if err := s.provide("build", build); err != nil { + t.Fatal(err) + } + calls := &serviceCalls{} + start := func(service, method string) uint64 { + request, _ := (&wasm.StartServiceCallRequest{Service: service, Method: method}).MarshalVT() + reply := s.answer(build, calls, &wasm.Call{Method: "StartServiceCall", Request: request}) + started := &wasm.ServiceCallStarted{} + if reply.GetError() != "" || started.UnmarshalVT(reply.GetResponse()) != nil { + t.Fatalf("start %s.%s: %v", service, method, reply) + } + return started.GetCall() + } + + // Each call has its own number and ends in order. + numbers := []uint64{start("example.drills.v1", "read"), start("example.drills.v1", "list"), start("example.other.v1", "read")} + if !slices.Equal(numbers, []uint64{1, 2, 3}) { + t.Fatalf("numbers %v", numbers) + } + want := []*wasm.ServiceRepliedEvent{ + {Call: 1, Payload: []byte(`{"key":"slide"}`)}, + {Call: 2, Failure: wasm.ServiceFailure_SERVICE_FAILURE_REFUSED, Error: "the fixture " + filepath.Join(dir, "example.drills.v1.json") + " has no method list"}, + {Call: 3, Failure: wasm.ServiceFailure_SERVICE_FAILURE_UNAVAILABLE, Error: "this host provides no service example.other.v1"}, + } + if !slices.EqualFunc(calls.ended, want, (*wasm.ServiceRepliedEvent).EqualVT) { + t.Fatalf("ended %v, want %v", calls.ended, want) + } +} + +// TestServiceProviders starts mods in a project's build that name services: +// the sandbox names each service's provider before the mod starts, starts a +// mod whose optional service nobody provides, and refuses to start one whose +// needed service nobody provides, naming it. +func TestServiceProviders(t *testing.T) { + // Build the mod once. + module := filepath.Join(t.TempDir(), "mod.wasm") + cmd := exec.Command("go", "build", "-buildmode=c-shared", "-o", module, "../check/testdata/hello") + cmd.Env = append(os.Environ(), "GOOS=wasip1", "GOARCH=wasm") + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("build the mod: %v\n%s", err, out) + } + wasmBytes, err := os.ReadFile(module) + if err != nil { + t.Fatal(err) + } + + // Each case's mod names services, one of which has a fixture. + cases := []struct { + name string + services string + want []string + }{{ + name: "optional missing", + services: `[{"name": "example.drills.v1"}, {"name": "example.ghosts.v1", "optional": true}]`, + want: []string{ + modLog("service example.drills.v1: fixture %s"), + modLog("service example.ghosts.v1: nobody (optional)"), + (&control.HostEvent{Body: &control.HostEvent_Started{Started: &control.ModStarted{Mod: "hello"}}}).String(), + }, + }, { + name: "needed missing", + services: `[{"name": "example.drills.v1"}, {"name": "example.ghosts.v1"}]`, + want: []string{ + modLog("service example.drills.v1: fixture %s"), + modLog("service example.ghosts.v1: nobody"), + (&control.HostEvent{Body: &control.HostEvent_Failed{Failed: &control.ModFailed{ + Mod: "hello", + Error: "the mod needs service example.ghosts.v1, which nobody provides here; add services/example.ghosts.v1.json", + }}}).String(), + }, + }} + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + // Lay out a project with its build and one fixture. + project := t.TempDir() + build := filepath.Join(project, "build") + fixtures := filepath.Join(project, FixtureDir) + for _, dir := range []string{build, fixtures} { + if err := os.MkdirAll(dir, 0o755); err != nil { + t.Fatal(err) + } + } + manifest := `{"slug": "hello", "version": "0.1.0", "runtime": "RUNTIME_WASM", "entry": "mod.wasm", "services": ` + c.services + `}` + fixture := filepath.Join(fixtures, "example.drills.v1.json") + for path, data := range map[string]string{ + filepath.Join(build, "mod.json"): manifest, + filepath.Join(build, "mod.wasm"): string(wasmBytes), + fixture: `{"read": null}`, + } { + if err := os.WriteFile(path, []byte(data), 0o644); err != nil { + t.Fatal(err) + } + } + + // Run the session to its end, keeping the mod's events. + var mu sync.Mutex + var events []string + joined := make(chan struct{}) + box := Start(context.Background(), Config{ + Mods: []string{build}, + Fixtures: func(path string) string { + if path != build { + t.Errorf("fixtures asked for %s, want %s", path, build) + } + return fixtures + }, + Events: func(event *control.HostEvent) { + mu.Lock() + defer mu.Unlock() + switch { + case event.GetJoined() != nil: + close(joined) + case event.GetReady() == nil: + events = append(events, event.String()) + } + }, + }) + <-joined + box.Stop() + if err := box.Wait(); err != nil { + t.Fatal(err) + } + + // The providers come first, then the start or the refusal. + want := slices.Clone(c.want) + for i := range want { + want[i] = strings.ReplaceAll(want[i], "%s", fixture) + } + if !slices.Equal(events, want) { + t.Fatalf("got events\n%q\nwant\n%q", events, want) + } + }) + } +} + +// modLog is the host event of one sandbox line about the hello mod. +func modLog(text string) string { + return (&control.HostEvent{Body: &control.HostEvent_Log{Log: &control.ModLog{Mod: "hello", Text: text}}}).String() +} diff --git a/sandbox/settings_test.go b/sandbox/settings_test.go index 91e1de45..05ae9088 100644 --- a/sandbox/settings_test.go +++ b/sandbox/settings_test.go @@ -36,14 +36,14 @@ func TestKept(t *testing.T) { read := func(s *Sandbox) string { request, _ := (&settingspb.PlayerSettingRequest{Key: "layout"}).MarshalVT() response := &settingspb.SettingResponse{} - if err := response.UnmarshalVT(s.answer(build, &wasm.Call{Method: "PlayerSetting", Request: request}).GetResponse()); err != nil { + if err := response.UnmarshalVT(s.answer(build, &serviceCalls{}, &wasm.Call{Method: "PlayerSetting", Request: request}).GetResponse()); err != nil { t.Fatal(err) } return response.GetValue() } set := func(s *Sandbox, value string) { request, _ := (&settingspb.SetPlayerSettingRequest{Key: "layout", Value: value}).MarshalVT() - s.answer(build, &wasm.Call{Method: "SetPlayerSetting", Request: request}) + s.answer(build, &serviceCalls{}, &wasm.Call{Method: "SetPlayerSetting", Request: request}) } // Start at the default, keep the accepted value and refuse the other. @@ -60,7 +60,7 @@ func TestKept(t *testing.T) { // Read the shipped file, then the written one in the next session. readFile := func(s *Sandbox, name string) (*wasm.ReadFileResponse, string) { request, _ := (&wasm.ReadFileRequest{Path: name}).MarshalVT() - reply := s.answer(build, &wasm.Call{Method: "ReadFile", Request: request}) + reply := s.answer(build, &serviceCalls{}, &wasm.Call{Method: "ReadFile", Request: request}) response := &wasm.ReadFileResponse{} if err := response.UnmarshalVT(reply.GetResponse()); err != nil { t.Fatal(err) @@ -69,7 +69,7 @@ func TestKept(t *testing.T) { } writeFile := func(s *Sandbox, name, text string) string { request, _ := (&wasm.WriteFileRequest{Path: name, Text: text}).MarshalVT() - return s.answer(build, &wasm.Call{Method: "WriteFile", Request: request}).GetError() + return s.answer(build, &serviceCalls{}, &wasm.Call{Method: "WriteFile", Request: request}).GetError() } if got, _ := readFile(first, "maps/areas.yaml"); got.GetText() != "shipped" { t.Fatalf("read %q, want the shipped file", got.GetText()) diff --git a/session/answer_test.go b/session/answer_test.go new file mode 100644 index 00000000..b1e7abf8 --- /dev/null +++ b/session/answer_test.go @@ -0,0 +1,52 @@ +package session + +import ( + "context" + "errors" + "testing" + + "github.com/paralin/modlock/src/host_app/control" +) + +// TestAnswerEndsEachForwardedCall answers the host's forwarded calls with the +// service's reply, its error, or the refusal of a session that forwards none. +func TestAnswerEndsEachForwardedCall(t *testing.T) { + link, err := NewControl() + if err != nil { + t.Fatal(err) + } + defer link.Close() + turns := make(chan struct{}, maxAnswers) + + // The service sees the call as the host sent it. + call := &control.ServiceCall{Id: 7, Mod: "arena", Service: "Drills", Method: "list", Payload: []byte("{}")} + reply := func(_ context.Context, got *control.ServiceCall) ([]byte, error) { + if got.GetMod() != "arena" || got.GetMethod() != "list" || string(got.GetPayload()) != "{}" { + t.Errorf("the service got %v", got) + } + return []byte("[]"), nil + } + failed := func(context.Context, *control.ServiceCall) ([]byte, error) { return nil, errors.New("refused") } + silent := func(context.Context, *control.ServiceCall) ([]byte, error) { return nil, errors.New("") } + + // Each answer carries the call's id and the outcome. + for _, check := range []struct { + name string + fn func(context.Context, *control.ServiceCall) ([]byte, error) + payload, error string + }{ + {"reply", reply, "[]", ""}, + {"error", failed, "", "refused"}, + {"empty error", silent, "", "the service failed"}, + {"no forwarder", nil, "", "this session forwards no services"}, + } { + answer(t.Context(), link, check.fn, turns, call) + ended := (<-link.requests).GetAnswer() + if ended.GetId() != 7 || string(ended.GetPayload()) != check.payload || ended.GetError() != check.error { + t.Errorf("%s: answered %v, want payload %q error %q", check.name, ended, check.payload, check.error) + } + } + if len(turns) != 0 { + t.Errorf("%d turns still held", len(turns)) + } +} diff --git a/session/config.go b/session/config.go index 3b8b3322..e6f160c3 100644 --- a/session/config.go +++ b/session/config.go @@ -1,6 +1,7 @@ package session import ( + "context" "io" "github.com/paralin/modlock/src/host_app/control" @@ -25,6 +26,13 @@ type Config struct { // Files is the directory that keeps the files mods write, or empty to // refuse their writes. Files string + // Fixtures is the file of service fixtures the host answers from, a + // control.Fixtures message, or empty for none. + Fixtures string + // Answer answers each started call of a service the fixtures forward, + // returning the reply or the error that fails the call. A session whose + // fixtures forward nothing needs none. + Answer func(ctx context.Context, call *control.ServiceCall) ([]byte, error) // Launch starts the Deadlock client once the server is ready. Launch bool // HostOutput receives the host's console output. diff --git a/session/control.go b/session/control.go index 2b53fd33..87d932d8 100644 --- a/session/control.go +++ b/session/control.go @@ -56,6 +56,11 @@ func (c *Control) SetService(ctx context.Context, reply *control.ServiceReply) e return c.request(ctx, &control.ControlRequest{Body: &control.ControlRequest_Service{Service: reply}}) } +// Answer ends one service call the host forwarded. +func (c *Control) Answer(ctx context.Context, answer *control.ServiceAnswer) error { + return c.request(ctx, &control.ControlRequest{Body: &control.ControlRequest_Answer{Answer: answer}}) +} + // SetRoles replaces the players' roles, which the mods read on each // connection. Requests made before the host connects wait for it. func (c *Control) SetRoles(ctx context.Context, roles *players.RolesTable) error { diff --git a/session/host.go b/session/host.go index a031e302..d480c0f3 100644 --- a/session/host.go +++ b/session/host.go @@ -67,6 +67,9 @@ func StartHost(ctx context.Context, config HostConfig) (*Host, error) { if config.Files != "" { arguments = append(arguments, "--files", path(config.Files)) } + if config.Fixtures != "" { + arguments = append(arguments, "--fixtures", path(config.Fixtures)) + } for _, mod := range config.Mods { arguments = append(arguments, "--plugin", path(mod)) } diff --git a/session/host_config.go b/session/host_config.go index 4eb0b0d6..3d1d34f9 100644 --- a/session/host_config.go +++ b/session/host_config.go @@ -24,6 +24,9 @@ type HostConfig struct { // Files is the directory that keeps the files mods write, or empty to // refuse their writes. Files string + // Fixtures is the file of service fixtures the host answers from, a + // control.Fixtures message, or empty for none. + Fixtures string // Steam is the Steam installation; on Linux its Proton runs the host. Steam *Steam // Output receives the host's console output. diff --git a/session/session.go b/session/session.go index e2195990..0d36288b 100644 --- a/session/session.go +++ b/session/session.go @@ -1,6 +1,7 @@ package session import ( + "cmp" "context" "runtime" "strconv" @@ -111,6 +112,7 @@ func Start(ctx context.Context, config Config) (*Session, error) { Args: config.Args, Settings: config.Settings, Files: config.Files, + Fixtures: config.Fixtures, Steam: steam, Output: config.HostOutput, }) @@ -127,7 +129,13 @@ func Start(ctx context.Context, config Config) (*Session, error) { // Pass events on, each followed by the frame it changes, launching the // client at the first ready server. frame := NewFrame(config.Version, config.Mods) + answers := make(chan struct{}, maxAnswers) handle := func(event *control.HostEvent) { + // Answer a forwarded call away from the events, which go on. + if call := event.GetServiceCall(); call != nil { + go answer(ctx, link, config.Answer, answers, call) + return + } framed := frame.Follow(event) screens.Handle(event) if event.GetReady() != nil && config.Launch && !session.launched.Swap(true) { @@ -151,6 +159,31 @@ func Start(ctx context.Context, config Config) (*Session, error) { return session, nil } +// maxAnswers bounds the forwarded calls answered at once; later ones wait. +const maxAnswers = 8 + +// answer ends one forwarded call with what fn answers, or with why it could +// not, waiting for a turn among the answers in progress. +func answer(ctx context.Context, link *Control, fn func(context.Context, *control.ServiceCall) ([]byte, error), turns chan struct{}, call *control.ServiceCall) { + // Take a turn, then ask. + ended := &control.ServiceAnswer{Id: call.GetId()} + select { + case turns <- struct{}{}: + defer func() { <-turns }() + if fn == nil { + ended.Error = "this session forwards no services" + } else if payload, err := fn(ctx, call); err != nil { + ended.Error = cmp.Or(err.Error(), "the service failed") + } else { + ended.Payload = payload + } + case <-ctx.Done(): + ended.Error = "the session ended" + } + // Send the answer; a session that ended sends nothing. + _ = link.Answer(ctx, ended) +} + // Reload asks the host to replace the running mod built at path, first // adding the mod's changed content to the mounted package, so the reloaded // mod finds the content its rebuilt addon names. diff --git a/src/host_app/control/control.pb.cc b/src/host_app/control/control.pb.cc index 395515a3..bcbbcd27 100644 --- a/src/host_app/control/control.pb.cc +++ b/src/host_app/control/control.pb.cc @@ -102,6 +102,74 @@ struct ServiceReplyDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ServiceReplyDefaultTypeInternal _ServiceReply_default_instance_; +inline constexpr ServiceCall::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + mod_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + service_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + method_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + payload_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + id_{::uint64_t{0u}} {} + +template +PROTOBUF_CONSTEXPR ServiceCall::ServiceCall(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(ServiceCall_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct ServiceCallDefaultTypeInternal { + PROTOBUF_CONSTEXPR ServiceCallDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ServiceCallDefaultTypeInternal() {} + union { + ServiceCall _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ServiceCallDefaultTypeInternal _ServiceCall_default_instance_; + +inline constexpr ServiceAnswer::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + payload_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + error_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + id_{::uint64_t{0u}} {} + +template +PROTOBUF_CONSTEXPR ServiceAnswer::ServiceAnswer(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(ServiceAnswer_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct ServiceAnswerDefaultTypeInternal { + PROTOBUF_CONSTEXPR ServiceAnswerDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ServiceAnswerDefaultTypeInternal() {} + union { + ServiceAnswer _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ServiceAnswerDefaultTypeInternal _ServiceAnswer_default_instance_; + inline constexpr ServerReady::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : _cached_size_{0}, @@ -439,6 +507,104 @@ struct ModCallDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ModCallDefaultTypeInternal _ModCall_default_instance_; +inline constexpr Forward::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + mod_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + service_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + target_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()) {} + +template +PROTOBUF_CONSTEXPR Forward::Forward(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Forward_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct ForwardDefaultTypeInternal { + PROTOBUF_CONSTEXPR ForwardDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ForwardDefaultTypeInternal() {} + union { + Forward _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ForwardDefaultTypeInternal _Forward_default_instance_; + +inline constexpr Fixture::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + mod_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + service_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + method_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + payload_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + source_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()) {} + +template +PROTOBUF_CONSTEXPR Fixture::Fixture(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Fixture_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct FixtureDefaultTypeInternal { + PROTOBUF_CONSTEXPR FixtureDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~FixtureDefaultTypeInternal() {} + union { + Fixture _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FixtureDefaultTypeInternal _Fixture_default_instance_; + +inline constexpr Fixtures::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + fixtures_{}, + forwards_{} {} + +template +PROTOBUF_CONSTEXPR Fixtures::Fixtures(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Fixtures_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct FixturesDefaultTypeInternal { + PROTOBUF_CONSTEXPR FixturesDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~FixturesDefaultTypeInternal() {} + union { + Fixtures _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FixturesDefaultTypeInternal _Fixtures_default_instance_; + inline constexpr ControlRequest::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : body_{}, @@ -592,6 +758,7 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ControlRequest, _impl_.body_), PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ControlRequest, _impl_.body_), PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ControlRequest, _impl_.body_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ControlRequest, _impl_.body_), 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ModCall, _impl_._has_bits_), 8, // hasbit index offset @@ -637,6 +804,7 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::HostEvent, _impl_.body_), PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::HostEvent, _impl_.body_), PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::HostEvent, _impl_.body_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::HostEvent, _impl_.body_), 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::PlayerChat, _impl_._has_bits_), 6, // hasbit index offset @@ -744,28 +912,84 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceResult, _impl_.error_), 0, 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Fixture, _impl_._has_bits_), + 8, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Fixture, _impl_.mod_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Fixture, _impl_.service_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Fixture, _impl_.method_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Fixture, _impl_.payload_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Fixture, _impl_.source_), + 0, + 1, + 2, + 3, + 4, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Forward, _impl_._has_bits_), + 6, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Forward, _impl_.mod_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Forward, _impl_.service_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Forward, _impl_.target_), + 0, + 1, + 2, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Fixtures, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Fixtures, _impl_.fixtures_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::Fixtures, _impl_.forwards_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceCall, _impl_._has_bits_), + 8, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceCall, _impl_.id_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceCall, _impl_.mod_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceCall, _impl_.service_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceCall, _impl_.method_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceCall, _impl_.payload_), + 4, + 0, + 1, + 2, + 3, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceAnswer, _impl_._has_bits_), + 6, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceAnswer, _impl_.id_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceAnswer, _impl_.payload_), + PROTOBUF_FIELD_OFFSET(::modlock::host_app::control::ServiceAnswer, _impl_.error_), + 2, + 0, + 1, }; static const ::_pbi::MigrationSchema schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { {0, sizeof(::modlock::host_app::control::ControlRequest)}, - {7, sizeof(::modlock::host_app::control::ModCall)}, - {20, sizeof(::modlock::host_app::control::ModCallResult)}, - {31, sizeof(::modlock::host_app::control::ReloadRequest)}, - {36, sizeof(::modlock::host_app::control::HostEvent)}, - {52, sizeof(::modlock::host_app::control::PlayerChat)}, - {61, sizeof(::modlock::host_app::control::ModStarted)}, - {68, sizeof(::modlock::host_app::control::ModLog)}, - {75, sizeof(::modlock::host_app::control::ModFailed)}, - {82, sizeof(::modlock::host_app::control::ModCalls)}, - {89, sizeof(::modlock::host_app::control::ModSlowFrame)}, - {96, sizeof(::modlock::host_app::control::PlayerJoined)}, - {105, sizeof(::modlock::host_app::control::PlayerLeft)}, - {110, sizeof(::modlock::host_app::control::PlayerMessage)}, - {123, sizeof(::modlock::host_app::control::ServerReady)}, - {128, sizeof(::modlock::host_app::control::UiChanged)}, - {137, sizeof(::modlock::host_app::control::ServiceReply)}, - {152, sizeof(::modlock::host_app::control::ServiceResult)}, + {8, sizeof(::modlock::host_app::control::ModCall)}, + {21, sizeof(::modlock::host_app::control::ModCallResult)}, + {32, sizeof(::modlock::host_app::control::ReloadRequest)}, + {37, sizeof(::modlock::host_app::control::HostEvent)}, + {54, sizeof(::modlock::host_app::control::PlayerChat)}, + {63, sizeof(::modlock::host_app::control::ModStarted)}, + {70, sizeof(::modlock::host_app::control::ModLog)}, + {77, sizeof(::modlock::host_app::control::ModFailed)}, + {84, sizeof(::modlock::host_app::control::ModCalls)}, + {91, sizeof(::modlock::host_app::control::ModSlowFrame)}, + {98, sizeof(::modlock::host_app::control::PlayerJoined)}, + {107, sizeof(::modlock::host_app::control::PlayerLeft)}, + {112, sizeof(::modlock::host_app::control::PlayerMessage)}, + {125, sizeof(::modlock::host_app::control::ServerReady)}, + {130, sizeof(::modlock::host_app::control::UiChanged)}, + {139, sizeof(::modlock::host_app::control::ServiceReply)}, + {154, sizeof(::modlock::host_app::control::ServiceResult)}, + {161, sizeof(::modlock::host_app::control::Fixture)}, + {174, sizeof(::modlock::host_app::control::Forward)}, + {183, sizeof(::modlock::host_app::control::Fixtures)}, + {190, sizeof(::modlock::host_app::control::ServiceCall)}, + {203, sizeof(::modlock::host_app::control::ServiceAnswer)}, }; static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { &::modlock::host_app::control::_ControlRequest_default_instance_._instance, @@ -786,6 +1010,11 @@ static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { &::modlock::host_app::control::_UiChanged_default_instance_._instance, &::modlock::host_app::control::_ServiceReply_default_instance_._instance, &::modlock::host_app::control::_ServiceResult_default_instance_._instance, + &::modlock::host_app::control::_Fixture_default_instance_._instance, + &::modlock::host_app::control::_Forward_default_instance_._instance, + &::modlock::host_app::control::_Fixtures_default_instance_._instance, + &::modlock::host_app::control::_ServiceCall_default_instance_._instance, + &::modlock::host_app::control::_ServiceAnswer_default_instance_._instance, }; const char descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( protodesc_cold) = { @@ -795,61 +1024,74 @@ const char descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fho "c/wasm/players/players.proto\0329github.com" "/paralin/modlock/src/wasm/profile/profil" "e.proto\032/github.com/paralin/modlock/src/" - "wasm/ui/ui.proto\"\364\001\n\016ControlRequest\0229\n\006r" + "wasm/ui/ui.proto\"\257\002\n\016ControlRequest\0229\n\006r" "eload\030\001 \001(\0132\'.modlock.host_app.control.R" "eloadRequestH\000\0221\n\005roles\030\002 \001(\0132 .modlock." "wasm.players.RolesTableH\000\0229\n\007service\030\003 \001" "(\0132&.modlock.host_app.control.ServiceRep" "lyH\000\0221\n\004call\030\004 \001(\0132!.modlock.host_app.co" - "ntrol.ModCallH\000B\006\n\004body\"T\n\007ModCall\022\013\n\003mo" - "d\030\001 \001(\t\022\017\n\007service\030\002 \001(\t\022\016\n\006method\030\003 \001(\t" - "\022\017\n\007payload\030\004 \001(\014\022\n\n\002id\030\005 \001(\t\"H\n\rModCall" - "Result\022\n\n\002id\030\001 \001(\t\022\013\n\003mod\030\002 \001(\t\022\017\n\007paylo" - "ad\030\003 \001(\014\022\r\n\005error\030\004 \001(\t\"\035\n\rReloadRequest" - "\022\014\n\004path\030\001 \001(\t\"\363\005\n\tHostEvent\0227\n\007started\030" - "\001 \001(\0132$.modlock.host_app.control.ModStar" - "tedH\000\022/\n\003log\030\002 \001(\0132 .modlock.host_app.co" - "ntrol.ModLogH\000\0225\n\006failed\030\003 \001(\0132#.modlock" - ".host_app.control.ModFailedH\000\0228\n\006joined\030" - "\004 \001(\0132&.modlock.host_app.control.PlayerJ" - "oinedH\000\0226\n\005ready\030\005 \001(\0132%.modlock.host_ap" - "p.control.ServerReadyH\000\0221\n\002ui\030\006 \001(\0132#.mo" - "dlock.host_app.control.UiChangedH\000\0224\n\004le" - "ft\030\007 \001(\0132$.modlock.host_app.control.Play" - "erLeftH\000\022:\n\007message\030\010 \001(\0132\'.modlock.host" - "_app.control.PlayerMessageH\000\0224\n\004chat\030\t \001" - "(\0132$.modlock.host_app.control.PlayerChat" - "H\000\0223\n\005calls\030\n \001(\0132\".modlock.host_app.con" - "trol.ModCallsH\000\022<\n\nslow_frame\030\013 \001(\0132&.mo" - "dlock.host_app.control.ModSlowFrameH\000\022B\n" - "\017service_applied\030\014 \001(\0132\'.modlock.host_ap" - "p.control.ServiceResultH\000\0229\n\006called\030\r \001(" - "\0132\'.modlock.host_app.control.ModCallResu" - "ltH\000B\006\n\004body\"6\n\nPlayerChat\022\014\n\004slot\030\001 \001(\005" - "\022\014\n\004name\030\002 \001(\t\022\014\n\004text\030\003 \001(\t\"+\n\nModStart" - "ed\022\013\n\003mod\030\001 \001(\t\022\020\n\010reloaded\030\002 \001(\010\"#\n\006Mod" - "Log\022\013\n\003mod\030\001 \001(\t\022\014\n\004text\030\002 \001(\t\"\'\n\tModFai" - "led\022\013\n\003mod\030\001 \001(\t\022\r\n\005error\030\002 \001(\t\"K\n\010ModCa" - "lls\022\013\n\003mod\030\001 \001(\t\0222\n\007profile\030\002 \001(\0132!.modl" - "ock.wasm.profile.CallProfile\"L\n\014ModSlowF" - "rame\022\013\n\003mod\030\001 \001(\t\022/\n\006report\030\002 \001(\0132\037.modl" - "ock.wasm.profile.SlowFrame\"<\n\014PlayerJoin" - "ed\022\014\n\004slot\030\001 \001(\005\022\014\n\004name\030\002 \001(\t\022\020\n\010steam_" - "id\030\003 \001(\006\"\032\n\nPlayerLeft\022\014\n\004slot\030\001 \001(\005\"|\n\r" - "PlayerMessage\022\013\n\003mod\030\001 \001(\t\022\014\n\004slot\030\002 \001(\005" - "\0223\n\004kind\030\003 \001(\0162%.modlock.host_app.contro" - "l.MessageKind\022\r\n\005title\030\004 \001(\t\022\014\n\004text\030\005 \001" - "(\t\"\032\n\013ServerReady\022\013\n\003map\030\001 \001(\t\"O\n\tUiChan" - "ged\022\013\n\003mod\030\001 \001(\t\022\014\n\004slot\030\002 \001(\005\022\'\n\006change" - "\030\003 \001(\0132\027.modlock.wasm.ui.Change\"g\n\014Servi" - "ceReply\022\013\n\003mod\030\001 \001(\t\022\017\n\007service\030\002 \001(\t\022\016\n" - "\006method\030\003 \001(\t\022\017\n\007payload\030\004 \001(\014\022\014\n\004path\030\005" - " \001(\t\022\n\n\002id\030\006 \001(\t\"*\n\rServiceResult\022\n\n\002id\030" - "\001 \001(\t\022\r\n\005error\030\002 \001(\t*\\\n\013MessageKind\022\025\n\021M" - "ESSAGE_KIND_CHAT\020\000\022\027\n\023MESSAGE_KIND_CENTE" - "R\020\001\022\035\n\031MESSAGE_KIND_ANNOUNCEMENT\020\002B9Z7gi" - "thub.com/paralin/modlock/src/host_app/co" - "ntrol;controlb\006proto3" + "ntrol.ModCallH\000\0229\n\006answer\030\005 \001(\0132\'.modloc" + "k.host_app.control.ServiceAnswerH\000B\006\n\004bo" + "dy\"T\n\007ModCall\022\013\n\003mod\030\001 \001(\t\022\017\n\007service\030\002 " + "\001(\t\022\016\n\006method\030\003 \001(\t\022\017\n\007payload\030\004 \001(\014\022\n\n\002" + "id\030\005 \001(\t\"H\n\rModCallResult\022\n\n\002id\030\001 \001(\t\022\013\n" + "\003mod\030\002 \001(\t\022\017\n\007payload\030\003 \001(\014\022\r\n\005error\030\004 \001" + "(\t\"\035\n\rReloadRequest\022\014\n\004path\030\001 \001(\t\"\262\006\n\tHo" + "stEvent\0227\n\007started\030\001 \001(\0132$.modlock.host_" + "app.control.ModStartedH\000\022/\n\003log\030\002 \001(\0132 ." + "modlock.host_app.control.ModLogH\000\0225\n\006fai" + "led\030\003 \001(\0132#.modlock.host_app.control.Mod" + "FailedH\000\0228\n\006joined\030\004 \001(\0132&.modlock.host_" + "app.control.PlayerJoinedH\000\0226\n\005ready\030\005 \001(" + "\0132%.modlock.host_app.control.ServerReady" + "H\000\0221\n\002ui\030\006 \001(\0132#.modlock.host_app.contro" + "l.UiChangedH\000\0224\n\004left\030\007 \001(\0132$.modlock.ho" + "st_app.control.PlayerLeftH\000\022:\n\007message\030\010" + " \001(\0132\'.modlock.host_app.control.PlayerMe" + "ssageH\000\0224\n\004chat\030\t \001(\0132$.modlock.host_app" + ".control.PlayerChatH\000\0223\n\005calls\030\n \001(\0132\".m" + "odlock.host_app.control.ModCallsH\000\022<\n\nsl" + "ow_frame\030\013 \001(\0132&.modlock.host_app.contro" + "l.ModSlowFrameH\000\022B\n\017service_applied\030\014 \001(" + "\0132\'.modlock.host_app.control.ServiceResu" + "ltH\000\0229\n\006called\030\r \001(\0132\'.modlock.host_app." + "control.ModCallResultH\000\022=\n\014service_call\030" + "\016 \001(\0132%.modlock.host_app.control.Service" + "CallH\000B\006\n\004body\"6\n\nPlayerChat\022\014\n\004slot\030\001 \001" + "(\005\022\014\n\004name\030\002 \001(\t\022\014\n\004text\030\003 \001(\t\"+\n\nModSta" + "rted\022\013\n\003mod\030\001 \001(\t\022\020\n\010reloaded\030\002 \001(\010\"#\n\006M" + "odLog\022\013\n\003mod\030\001 \001(\t\022\014\n\004text\030\002 \001(\t\"\'\n\tModF" + "ailed\022\013\n\003mod\030\001 \001(\t\022\r\n\005error\030\002 \001(\t\"K\n\010Mod" + "Calls\022\013\n\003mod\030\001 \001(\t\0222\n\007profile\030\002 \001(\0132!.mo" + "dlock.wasm.profile.CallProfile\"L\n\014ModSlo" + "wFrame\022\013\n\003mod\030\001 \001(\t\022/\n\006report\030\002 \001(\0132\037.mo" + "dlock.wasm.profile.SlowFrame\"<\n\014PlayerJo" + "ined\022\014\n\004slot\030\001 \001(\005\022\014\n\004name\030\002 \001(\t\022\020\n\010stea" + "m_id\030\003 \001(\006\"\032\n\nPlayerLeft\022\014\n\004slot\030\001 \001(\005\"|" + "\n\rPlayerMessage\022\013\n\003mod\030\001 \001(\t\022\014\n\004slot\030\002 \001" + "(\005\0223\n\004kind\030\003 \001(\0162%.modlock.host_app.cont" + "rol.MessageKind\022\r\n\005title\030\004 \001(\t\022\014\n\004text\030\005" + " \001(\t\"\032\n\013ServerReady\022\013\n\003map\030\001 \001(\t\"O\n\tUiCh" + "anged\022\013\n\003mod\030\001 \001(\t\022\014\n\004slot\030\002 \001(\005\022\'\n\006chan" + "ge\030\003 \001(\0132\027.modlock.wasm.ui.Change\"g\n\014Ser" + "viceReply\022\013\n\003mod\030\001 \001(\t\022\017\n\007service\030\002 \001(\t\022" + "\016\n\006method\030\003 \001(\t\022\017\n\007payload\030\004 \001(\014\022\014\n\004path" + "\030\005 \001(\t\022\n\n\002id\030\006 \001(\t\"*\n\rServiceResult\022\n\n\002i" + "d\030\001 \001(\t\022\r\n\005error\030\002 \001(\t\"X\n\007Fixture\022\013\n\003mod" + "\030\001 \001(\t\022\017\n\007service\030\002 \001(\t\022\016\n\006method\030\003 \001(\t\022" + "\017\n\007payload\030\004 \001(\014\022\016\n\006source\030\005 \001(\t\"7\n\007Forw" + "ard\022\013\n\003mod\030\001 \001(\t\022\017\n\007service\030\002 \001(\t\022\016\n\006tar" + "get\030\003 \001(\t\"t\n\010Fixtures\0223\n\010fixtures\030\001 \003(\0132" + "!.modlock.host_app.control.Fixture\0223\n\010fo" + "rwards\030\002 \003(\0132!.modlock.host_app.control." + "Forward\"X\n\013ServiceCall\022\n\n\002id\030\001 \001(\004\022\013\n\003mo" + "d\030\002 \001(\t\022\017\n\007service\030\003 \001(\t\022\016\n\006method\030\004 \001(\t" + "\022\017\n\007payload\030\005 \001(\014\";\n\rServiceAnswer\022\n\n\002id" + "\030\001 \001(\004\022\017\n\007payload\030\002 \001(\014\022\r\n\005error\030\003 \001(\t*\\" + "\n\013MessageKind\022\025\n\021MESSAGE_KIND_CHAT\020\000\022\027\n\023" + "MESSAGE_KIND_CENTER\020\001\022\035\n\031MESSAGE_KIND_AN" + "NOUNCEMENT\020\002B9Z7github.com/paralin/modlo" + "ck/src/host_app/control;controlb\006proto3" }; static const ::_pbi::DescriptorTable* PROTOBUF_NONNULL const descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto_deps[3] = { @@ -861,13 +1103,13 @@ static ::absl::once_flag descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto = { false, false, - 2421, + 2959, descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto, "github.com/paralin/modlock/src/host_app/control/control.proto", &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto_once, descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto_deps, 3, - 18, + 23, schemas, file_default_instances, TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto::offsets, @@ -954,6 +1196,19 @@ void ControlRequest::set_allocated_call(::modlock::host_app::control::ModCall* P } // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ControlRequest.call) } +void ControlRequest::set_allocated_answer(::modlock::host_app::control::ServiceAnswer* PROTOBUF_NULLABLE answer) { + ::google::protobuf::Arena* message_arena = GetArena(); + clear_body(); + if (answer) { + ::google::protobuf::Arena* submessage_arena = answer->GetArena(); + if (message_arena != submessage_arena) { + answer = ::google::protobuf::internal::GetOwnedMessage(message_arena, answer, submessage_arena); + } + set_has_answer(); + _impl_.body_.answer_ = answer; + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ControlRequest.answer) +} ControlRequest::ControlRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) #if defined(PROTOBUF_CUSTOM_VTABLE) : ::google::protobuf::Message(arena, ControlRequest_class_data_.base()) { @@ -999,6 +1254,9 @@ ControlRequest::ControlRequest( case kCall: _impl_.body_.call_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.body_.call_); break; + case kAnswer: + _impl_.body_.answer_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.body_.answer_); + break; } // @@protoc_insertion_point(copy_constructor:modlock.host_app.control.ControlRequest) @@ -1066,6 +1324,14 @@ void ControlRequest::clear_body() { } break; } + case kAnswer: { + if (GetArena() == nullptr) { + delete _impl_.body_.answer_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.answer_); + } + break; + } case BODY_NOT_SET: { break; } @@ -1117,17 +1383,17 @@ ControlRequest::GetClassData() const { return ControlRequest_class_data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 4, 4, 0, 2> +const ::_pbi::TcParseTable<0, 5, 5, 0, 2> ControlRequest::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 4, 0, // max_field_number, fast_idx_mask + 5, 0, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967280, // skipmap + 4294967264, // skipmap offsetof(decltype(_table_), field_entries), - 4, // num_field_entries - 4, // num_aux_entries + 5, // num_field_entries + 5, // num_aux_entries offsetof(decltype(_table_), aux_entries), ControlRequest_class_data_.base(), nullptr, // post_loop_handler @@ -1148,12 +1414,15 @@ ControlRequest::_table_ = { {PROTOBUF_FIELD_OFFSET(ControlRequest, _impl_.body_.service_), _Internal::kOneofCaseOffset + 0, 2, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, // .modlock.host_app.control.ModCall call = 4; {PROTOBUF_FIELD_OFFSET(ControlRequest, _impl_.body_.call_), _Internal::kOneofCaseOffset + 0, 3, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .modlock.host_app.control.ServiceAnswer answer = 5; + {PROTOBUF_FIELD_OFFSET(ControlRequest, _impl_.body_.answer_), _Internal::kOneofCaseOffset + 0, 4, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ {::_pbi::TcParser::GetTable<::modlock::host_app::control::ReloadRequest>()}, {::_pbi::TcParser::GetTable<::modlock::wasm::players::RolesTable>()}, {::_pbi::TcParser::GetTable<::modlock::host_app::control::ServiceReply>()}, {::_pbi::TcParser::GetTable<::modlock::host_app::control::ModCall>()}, + {::_pbi::TcParser::GetTable<::modlock::host_app::control::ServiceAnswer>()}, }}, {{ }}, @@ -1212,6 +1481,12 @@ ::uint8_t* PROTOBUF_NONNULL ControlRequest::_InternalSerialize( stream); break; } + case kAnswer: { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 5, *this_._impl_.body_.answer_, this_._impl_.body_.answer_->GetCachedSize(), target, + stream); + break; + } default: break; } @@ -1263,6 +1538,12 @@ ::size_t ControlRequest::ByteSizeLong() const { ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.body_.call_); break; } + // .modlock.host_app.control.ServiceAnswer answer = 5; + case kAnswer: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.body_.answer_); + break; + } case BODY_NOT_SET: { break; } @@ -1329,6 +1610,14 @@ void ControlRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, } break; } + case kAnswer: { + if (oneof_needs_init) { + _this->_impl_.body_.answer_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.body_.answer_); + } else { + _this->_impl_.body_.answer_->MergeFrom(*from._impl_.body_.answer_); + } + break; + } case BODY_NOT_SET: break; } @@ -2644,6 +2933,19 @@ void HostEvent::set_allocated_called(::modlock::host_app::control::ModCallResult } // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.HostEvent.called) } +void HostEvent::set_allocated_service_call(::modlock::host_app::control::ServiceCall* PROTOBUF_NULLABLE service_call) { + ::google::protobuf::Arena* message_arena = GetArena(); + clear_body(); + if (service_call) { + ::google::protobuf::Arena* submessage_arena = service_call->GetArena(); + if (message_arena != submessage_arena) { + service_call = ::google::protobuf::internal::GetOwnedMessage(message_arena, service_call, submessage_arena); + } + set_has_service_call(); + _impl_.body_.service_call_ = service_call; + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.HostEvent.service_call) +} HostEvent::HostEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) #if defined(PROTOBUF_CUSTOM_VTABLE) : ::google::protobuf::Message(arena, HostEvent_class_data_.base()) { @@ -2716,6 +3018,9 @@ HostEvent::HostEvent( case kCalled: _impl_.body_.called_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.body_.called_); break; + case kServiceCall: + _impl_.body_.service_call_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.body_.service_call_); + break; } // @@protoc_insertion_point(copy_constructor:modlock.host_app.control.HostEvent) @@ -2855,6 +3160,14 @@ void HostEvent::clear_body() { } break; } + case kServiceCall: { + if (GetArena() == nullptr) { + delete _impl_.body_.service_call_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.service_call_); + } + break; + } case BODY_NOT_SET: { break; } @@ -2906,17 +3219,17 @@ HostEvent::GetClassData() const { return HostEvent_class_data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<0, 13, 13, 0, 2> +const ::_pbi::TcParseTable<0, 14, 14, 0, 2> HostEvent::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 13, 0, // max_field_number, fast_idx_mask + 14, 0, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294959104, // skipmap + 4294950912, // skipmap offsetof(decltype(_table_), field_entries), - 13, // num_field_entries - 13, // num_aux_entries + 14, // num_field_entries + 14, // num_aux_entries offsetof(decltype(_table_), aux_entries), HostEvent_class_data_.base(), nullptr, // post_loop_handler @@ -2955,6 +3268,8 @@ HostEvent::_table_ = { {PROTOBUF_FIELD_OFFSET(HostEvent, _impl_.body_.service_applied_), _Internal::kOneofCaseOffset + 0, 11, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, // .modlock.host_app.control.ModCallResult called = 13; {PROTOBUF_FIELD_OFFSET(HostEvent, _impl_.body_.called_), _Internal::kOneofCaseOffset + 0, 12, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, + // .modlock.host_app.control.ServiceCall service_call = 14; + {PROTOBUF_FIELD_OFFSET(HostEvent, _impl_.body_.service_call_), _Internal::kOneofCaseOffset + 0, 13, (0 | ::_fl::kFcOneof | ::_fl::kMessage | ::_fl::kTvTable)}, }}, {{ {::_pbi::TcParser::GetTable<::modlock::host_app::control::ModStarted>()}, @@ -2970,6 +3285,7 @@ HostEvent::_table_ = { {::_pbi::TcParser::GetTable<::modlock::host_app::control::ModSlowFrame>()}, {::_pbi::TcParser::GetTable<::modlock::host_app::control::ServiceResult>()}, {::_pbi::TcParser::GetTable<::modlock::host_app::control::ModCallResult>()}, + {::_pbi::TcParser::GetTable<::modlock::host_app::control::ServiceCall>()}, }}, {{ }}, @@ -3082,6 +3398,12 @@ ::uint8_t* PROTOBUF_NONNULL HostEvent::_InternalSerialize( stream); break; } + case kServiceCall: { + target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 14, *this_._impl_.body_.service_call_, this_._impl_.body_.service_call_->GetCachedSize(), target, + stream); + break; + } default: break; } @@ -3187,6 +3509,12 @@ ::size_t HostEvent::ByteSizeLong() const { ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.body_.called_); break; } + // .modlock.host_app.control.ServiceCall service_call = 14; + case kServiceCall: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.body_.service_call_); + break; + } case BODY_NOT_SET: { break; } @@ -3325,6 +3653,14 @@ void HostEvent::MergeImpl(::google::protobuf::MessageLite& to_msg, } break; } + case kServiceCall: { + if (oneof_needs_init) { + _this->_impl_.body_.service_call_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.body_.service_call_); + } else { + _this->_impl_.body_.service_call_->MergeFrom(*from._impl_.body_.service_call_); + } + break; + } case BODY_NOT_SET: break; } @@ -7788,6 +8124,1917 @@ void ServiceResult::InternalSwap(ServiceResult* PROTOBUF_RESTRICT PROTOBUF_NONNU ::google::protobuf::Metadata ServiceResult::GetMetadata() const { return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); } +// =================================================================== + +class Fixture::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Fixture, _impl_._has_bits_); +}; + +Fixture::Fixture(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Fixture_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.host_app.control.Fixture) +} +PROTOBUF_NDEBUG_INLINE Fixture::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::host_app::control::Fixture& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + mod_(arena, from.mod_), + service_(arena, from.service_), + method_(arena, from.method_), + payload_(arena, from.payload_), + source_(arena, from.source_) {} + +Fixture::Fixture( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Fixture& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Fixture_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Fixture* 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.host_app.control.Fixture) +} +PROTOBUF_NDEBUG_INLINE Fixture::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + mod_(arena), + service_(arena), + method_(arena), + payload_(arena), + source_(arena) {} + +inline void Fixture::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +Fixture::~Fixture() { + // @@protoc_insertion_point(destructor:modlock.host_app.control.Fixture) + SharedDtor(*this); +} +inline void Fixture::SharedDtor(MessageLite& self) { + Fixture& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.mod_.Destroy(); + this_._impl_.service_.Destroy(); + this_._impl_.method_.Destroy(); + this_._impl_.payload_.Destroy(); + this_._impl_.source_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL Fixture::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Fixture(arena); +} +constexpr auto Fixture::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(Fixture), + alignof(Fixture)); +} +constexpr auto Fixture::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Fixture_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Fixture::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Fixture::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Fixture::ByteSizeLong, + &Fixture::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Fixture, _impl_._cached_size_), + false, + }, + &Fixture::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Fixture_class_data_ = + Fixture::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Fixture::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Fixture_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Fixture_class_data_.tc_table); + return Fixture_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<3, 5, 0, 63, 2> +Fixture::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Fixture, _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 + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + Fixture_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::host_app::control::Fixture>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // string mod = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(Fixture, _impl_.mod_)}}, + // string service = 2; + {::_pbi::TcParser::FastUS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(Fixture, _impl_.service_)}}, + // string method = 3; + {::_pbi::TcParser::FastUS1, + {26, 2, 0, + PROTOBUF_FIELD_OFFSET(Fixture, _impl_.method_)}}, + // bytes payload = 4; + {::_pbi::TcParser::FastBS1, + {34, 3, 0, + PROTOBUF_FIELD_OFFSET(Fixture, _impl_.payload_)}}, + // string source = 5; + {::_pbi::TcParser::FastUS1, + {42, 4, 0, + PROTOBUF_FIELD_OFFSET(Fixture, _impl_.source_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // string mod = 1; + {PROTOBUF_FIELD_OFFSET(Fixture, _impl_.mod_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string service = 2; + {PROTOBUF_FIELD_OFFSET(Fixture, _impl_.service_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string method = 3; + {PROTOBUF_FIELD_OFFSET(Fixture, _impl_.method_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // bytes payload = 4; + {PROTOBUF_FIELD_OFFSET(Fixture, _impl_.payload_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)}, + // string source = 5; + {PROTOBUF_FIELD_OFFSET(Fixture, _impl_.source_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\40\3\7\6\0\6\0\0" + "modlock.host_app.control.Fixture" + "mod" + "service" + "method" + "source" + }}, +}; +PROTOBUF_NOINLINE void Fixture::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.host_app.control.Fixture) + ::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, 0x0000001fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.mod_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.service_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + _impl_.method_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + _impl_.payload_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + _impl_.source_.ClearNonDefaultToEmpty(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Fixture::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Fixture& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Fixture::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Fixture& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.host_app.control.Fixture) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string mod = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_mod().empty()) { + const ::std::string& _s = this_._internal_mod(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.Fixture.mod"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // string service = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_service().empty()) { + const ::std::string& _s = this_._internal_service(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.Fixture.service"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // string method = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_method().empty()) { + const ::std::string& _s = this_._internal_method(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.Fixture.method"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + } + + // bytes payload = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!this_._internal_payload().empty()) { + const ::std::string& _s = this_._internal_payload(); + target = stream->WriteBytesMaybeAliased(4, _s, target); + } + } + + // string source = 5; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (!this_._internal_source().empty()) { + const ::std::string& _s = this_._internal_source(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.Fixture.source"); + 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.host_app.control.Fixture) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Fixture::ByteSizeLong(const MessageLite& base) { + const Fixture& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Fixture::ByteSizeLong() const { + const Fixture& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.host_app.control.Fixture) + ::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)) { + // string mod = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_mod().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_mod()); + } + } + // string service = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_service().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_service()); + } + } + // string method = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_method().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_method()); + } + } + // bytes payload = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!this_._internal_payload().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this_._internal_payload()); + } + } + // string source = 5; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (!this_._internal_source().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_source()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Fixture::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.host_app.control.Fixture) + 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 (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_mod().empty()) { + _this->_internal_set_mod(from._internal_mod()); + } else { + if (_this->_impl_.mod_.IsDefault()) { + _this->_internal_set_mod(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_service().empty()) { + _this->_internal_set_service(from._internal_service()); + } else { + if (_this->_impl_.service_.IsDefault()) { + _this->_internal_set_service(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!from._internal_method().empty()) { + _this->_internal_set_method(from._internal_method()); + } else { + if (_this->_impl_.method_.IsDefault()) { + _this->_internal_set_method(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!from._internal_payload().empty()) { + _this->_internal_set_payload(from._internal_payload()); + } else { + if (_this->_impl_.payload_.IsDefault()) { + _this->_internal_set_payload(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (!from._internal_source().empty()) { + _this->_internal_set_source(from._internal_source()); + } else { + if (_this->_impl_.source_.IsDefault()) { + _this->_internal_set_source(""); + } + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Fixture::CopyFrom(const Fixture& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.host_app.control.Fixture) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Fixture::InternalSwap(Fixture* 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_.mod_, &other->_impl_.mod_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.service_, &other->_impl_.service_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.method_, &other->_impl_.method_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.payload_, &other->_impl_.payload_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.source_, &other->_impl_.source_, arena); +} + +::google::protobuf::Metadata Fixture::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class Forward::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Forward, _impl_._has_bits_); +}; + +Forward::Forward(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Forward_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.host_app.control.Forward) +} +PROTOBUF_NDEBUG_INLINE Forward::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::host_app::control::Forward& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + mod_(arena, from.mod_), + service_(arena, from.service_), + target_(arena, from.target_) {} + +Forward::Forward( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Forward& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Forward_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Forward* 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.host_app.control.Forward) +} +PROTOBUF_NDEBUG_INLINE Forward::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + mod_(arena), + service_(arena), + target_(arena) {} + +inline void Forward::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +Forward::~Forward() { + // @@protoc_insertion_point(destructor:modlock.host_app.control.Forward) + SharedDtor(*this); +} +inline void Forward::SharedDtor(MessageLite& self) { + Forward& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.mod_.Destroy(); + this_._impl_.service_.Destroy(); + this_._impl_.target_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL Forward::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Forward(arena); +} +constexpr auto Forward::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(Forward), + alignof(Forward)); +} +constexpr auto Forward::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Forward_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Forward::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Forward::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Forward::ByteSizeLong, + &Forward::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Forward, _impl_._cached_size_), + false, + }, + &Forward::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Forward_class_data_ = + Forward::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Forward::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Forward_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Forward_class_data_.tc_table); + return Forward_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 3, 0, 57, 2> +Forward::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Forward, _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 + Forward_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::host_app::control::Forward>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // string mod = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(Forward, _impl_.mod_)}}, + // string service = 2; + {::_pbi::TcParser::FastUS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(Forward, _impl_.service_)}}, + // string target = 3; + {::_pbi::TcParser::FastUS1, + {26, 2, 0, + PROTOBUF_FIELD_OFFSET(Forward, _impl_.target_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string mod = 1; + {PROTOBUF_FIELD_OFFSET(Forward, _impl_.mod_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string service = 2; + {PROTOBUF_FIELD_OFFSET(Forward, _impl_.service_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string target = 3; + {PROTOBUF_FIELD_OFFSET(Forward, _impl_.target_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\40\3\7\6\0\0\0\0" + "modlock.host_app.control.Forward" + "mod" + "service" + "target" + }}, +}; +PROTOBUF_NOINLINE void Forward::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.host_app.control.Forward) + ::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, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.mod_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.service_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + _impl_.target_.ClearNonDefaultToEmpty(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Forward::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Forward& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Forward::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Forward& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.host_app.control.Forward) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string mod = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_mod().empty()) { + const ::std::string& _s = this_._internal_mod(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.Forward.mod"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // string service = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_service().empty()) { + const ::std::string& _s = this_._internal_service(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.Forward.service"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // string target = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_target().empty()) { + const ::std::string& _s = this_._internal_target(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.Forward.target"); + 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.host_app.control.Forward) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Forward::ByteSizeLong(const MessageLite& base) { + const Forward& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Forward::ByteSizeLong() const { + const Forward& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.host_app.control.Forward) + ::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 mod = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_mod().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_mod()); + } + } + // string service = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_service().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_service()); + } + } + // string target = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_target().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_target()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Forward::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.host_app.control.Forward) + 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_mod().empty()) { + _this->_internal_set_mod(from._internal_mod()); + } else { + if (_this->_impl_.mod_.IsDefault()) { + _this->_internal_set_mod(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_service().empty()) { + _this->_internal_set_service(from._internal_service()); + } else { + if (_this->_impl_.service_.IsDefault()) { + _this->_internal_set_service(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!from._internal_target().empty()) { + _this->_internal_set_target(from._internal_target()); + } else { + if (_this->_impl_.target_.IsDefault()) { + _this->_internal_set_target(""); + } + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Forward::CopyFrom(const Forward& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.host_app.control.Forward) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Forward::InternalSwap(Forward* 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_.mod_, &other->_impl_.mod_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.service_, &other->_impl_.service_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.target_, &other->_impl_.target_, arena); +} + +::google::protobuf::Metadata Forward::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class Fixtures::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Fixtures, _impl_._has_bits_); +}; + +Fixtures::Fixtures(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Fixtures_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.host_app.control.Fixtures) +} +PROTOBUF_NDEBUG_INLINE Fixtures::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::host_app::control::Fixtures& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + fixtures_{visibility, arena, from.fixtures_}, + forwards_{visibility, arena, from.forwards_} {} + +Fixtures::Fixtures( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Fixtures& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Fixtures_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Fixtures* 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.host_app.control.Fixtures) +} +PROTOBUF_NDEBUG_INLINE Fixtures::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + fixtures_{visibility, arena}, + forwards_{visibility, arena} {} + +inline void Fixtures::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +Fixtures::~Fixtures() { + // @@protoc_insertion_point(destructor:modlock.host_app.control.Fixtures) + SharedDtor(*this); +} +inline void Fixtures::SharedDtor(MessageLite& self) { + Fixtures& 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 Fixtures::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Fixtures(arena); +} +constexpr auto Fixtures::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(Fixtures, _impl_.fixtures_) + + decltype(Fixtures::_impl_.fixtures_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + PROTOBUF_FIELD_OFFSET(Fixtures, _impl_.forwards_) + + decltype(Fixtures::_impl_.forwards_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::ZeroInit( + sizeof(Fixtures), alignof(Fixtures), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&Fixtures::PlacementNew_, + sizeof(Fixtures), + alignof(Fixtures)); + } +} +constexpr auto Fixtures::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Fixtures_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Fixtures::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Fixtures::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Fixtures::ByteSizeLong, + &Fixtures::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Fixtures, _impl_._cached_size_), + false, + }, + &Fixtures::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Fixtures_class_data_ = + Fixtures::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Fixtures::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Fixtures_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Fixtures_class_data_.tc_table); + return Fixtures_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 2, 0, 2> +Fixtures::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Fixtures, _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 + 2, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + Fixtures_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::host_app::control::Fixtures>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // repeated .modlock.host_app.control.Forward forwards = 2; + {::_pbi::TcParser::FastMtR1, + {18, 1, 1, + PROTOBUF_FIELD_OFFSET(Fixtures, _impl_.forwards_)}}, + // repeated .modlock.host_app.control.Fixture fixtures = 1; + {::_pbi::TcParser::FastMtR1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(Fixtures, _impl_.fixtures_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // repeated .modlock.host_app.control.Fixture fixtures = 1; + {PROTOBUF_FIELD_OFFSET(Fixtures, _impl_.fixtures_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + // repeated .modlock.host_app.control.Forward forwards = 2; + {PROTOBUF_FIELD_OFFSET(Fixtures, _impl_.forwards_), _Internal::kHasBitsOffset + 1, 1, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::modlock::host_app::control::Fixture>()}, + {::_pbi::TcParser::GetTable<::modlock::host_app::control::Forward>()}, + }}, + {{ + }}, +}; +PROTOBUF_NOINLINE void Fixtures::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.host_app.control.Fixtures) + ::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_.fixtures_.Clear(); + } + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + _impl_.forwards_.Clear(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Fixtures::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Fixtures& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Fixtures::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Fixtures& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.host_app.control.Fixtures) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // repeated .modlock.host_app.control.Fixture fixtures = 1; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + for (unsigned i = 0, n = static_cast( + this_._internal_fixtures_size()); + i < n; i++) { + const auto& repfield = this_._internal_fixtures().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 1, repfield, repfield.GetCachedSize(), + target, stream); + } + } + + // repeated .modlock.host_app.control.Forward forwards = 2; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + for (unsigned i = 0, n = static_cast( + this_._internal_forwards_size()); + i < n; i++) { + const auto& repfield = this_._internal_forwards().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 2, 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.host_app.control.Fixtures) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Fixtures::ByteSizeLong(const MessageLite& base) { + const Fixtures& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Fixtures::ByteSizeLong() const { + const Fixtures& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.host_app.control.Fixtures) + ::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 .modlock.host_app.control.Fixture fixtures = 1; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + total_size += 1UL * this_._internal_fixtures_size(); + for (const auto& msg : this_._internal_fixtures()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + } + // repeated .modlock.host_app.control.Forward forwards = 2; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + total_size += 1UL * this_._internal_forwards_size(); + for (const auto& msg : this_._internal_forwards()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Fixtures::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.host_app.control.Fixtures) + 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_fixtures()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_fixtures()); + } + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + _this->_internal_mutable_forwards()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_forwards()); + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Fixtures::CopyFrom(const Fixtures& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.host_app.control.Fixtures) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Fixtures::InternalSwap(Fixtures* 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_.fixtures_.InternalSwap(&other->_impl_.fixtures_); + _impl_.forwards_.InternalSwap(&other->_impl_.forwards_); +} + +::google::protobuf::Metadata Fixtures::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class ServiceCall::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_._has_bits_); +}; + +ServiceCall::ServiceCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ServiceCall_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.host_app.control.ServiceCall) +} +PROTOBUF_NDEBUG_INLINE ServiceCall::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::host_app::control::ServiceCall& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + mod_(arena, from.mod_), + service_(arena, from.service_), + method_(arena, from.method_), + payload_(arena, from.payload_) {} + +ServiceCall::ServiceCall( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ServiceCall& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ServiceCall_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ServiceCall* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.id_ = from._impl_.id_; + + // @@protoc_insertion_point(copy_constructor:modlock.host_app.control.ServiceCall) +} +PROTOBUF_NDEBUG_INLINE ServiceCall::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + mod_(arena), + service_(arena), + method_(arena), + payload_(arena) {} + +inline void ServiceCall::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.id_ = {}; +} +ServiceCall::~ServiceCall() { + // @@protoc_insertion_point(destructor:modlock.host_app.control.ServiceCall) + SharedDtor(*this); +} +inline void ServiceCall::SharedDtor(MessageLite& self) { + ServiceCall& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.mod_.Destroy(); + this_._impl_.service_.Destroy(); + this_._impl_.method_.Destroy(); + this_._impl_.payload_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL ServiceCall::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ServiceCall(arena); +} +constexpr auto ServiceCall::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ServiceCall), + alignof(ServiceCall)); +} +constexpr auto ServiceCall::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_ServiceCall_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &ServiceCall::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ServiceCall::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ServiceCall::ByteSizeLong, + &ServiceCall::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_._cached_size_), + false, + }, + &ServiceCall::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ServiceCall_class_data_ = + ServiceCall::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ServiceCall::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ServiceCall_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ServiceCall_class_data_.tc_table); + return ServiceCall_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<3, 5, 0, 61, 2> +ServiceCall::_table_ = { + { + PROTOBUF_FIELD_OFFSET(ServiceCall, _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 + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + ServiceCall_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::host_app::control::ServiceCall>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // uint64 id = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(ServiceCall, _impl_.id_), 4>(), + {8, 4, 0, + PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_.id_)}}, + // string mod = 2; + {::_pbi::TcParser::FastUS1, + {18, 0, 0, + PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_.mod_)}}, + // string service = 3; + {::_pbi::TcParser::FastUS1, + {26, 1, 0, + PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_.service_)}}, + // string method = 4; + {::_pbi::TcParser::FastUS1, + {34, 2, 0, + PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_.method_)}}, + // bytes payload = 5; + {::_pbi::TcParser::FastBS1, + {42, 3, 0, + PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_.payload_)}}, + {::_pbi::TcParser::MiniParse, {}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // uint64 id = 1; + {PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_.id_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + // string mod = 2; + {PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_.mod_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string service = 3; + {PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_.service_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string method = 4; + {PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_.method_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // bytes payload = 5; + {PROTOBUF_FIELD_OFFSET(ServiceCall, _impl_.payload_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\44\0\3\7\6\0\0\0" + "modlock.host_app.control.ServiceCall" + "mod" + "service" + "method" + }}, +}; +PROTOBUF_NOINLINE void ServiceCall::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.host_app.control.ServiceCall) + ::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 (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.mod_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.service_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + _impl_.method_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + _impl_.payload_.ClearNonDefaultToEmpty(); + } + } + _impl_.id_ = ::uint64_t{0u}; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ServiceCall::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ServiceCall& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ServiceCall::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ServiceCall& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.host_app.control.ServiceCall) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // uint64 id = 1; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_id() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 1, this_._internal_id(), target); + } + } + + // string mod = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_mod().empty()) { + const ::std::string& _s = this_._internal_mod(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.ServiceCall.mod"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // string service = 3; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_service().empty()) { + const ::std::string& _s = this_._internal_service(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.ServiceCall.service"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + } + + // string method = 4; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_method().empty()) { + const ::std::string& _s = this_._internal_method(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.ServiceCall.method"); + target = stream->WriteStringMaybeAliased(4, _s, target); + } + } + + // bytes payload = 5; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!this_._internal_payload().empty()) { + const ::std::string& _s = this_._internal_payload(); + target = stream->WriteBytesMaybeAliased(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.host_app.control.ServiceCall) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ServiceCall::ByteSizeLong(const MessageLite& base) { + const ServiceCall& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ServiceCall::ByteSizeLong() const { + const ServiceCall& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.host_app.control.ServiceCall) + ::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)) { + // string mod = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_mod().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_mod()); + } + } + // string service = 3; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_service().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_service()); + } + } + // string method = 4; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_method().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_method()); + } + } + // bytes payload = 5; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!this_._internal_payload().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this_._internal_payload()); + } + } + // uint64 id = 1; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_id() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_id()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ServiceCall::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.host_app.control.ServiceCall) + 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 (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_mod().empty()) { + _this->_internal_set_mod(from._internal_mod()); + } else { + if (_this->_impl_.mod_.IsDefault()) { + _this->_internal_set_mod(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_service().empty()) { + _this->_internal_set_service(from._internal_service()); + } else { + if (_this->_impl_.service_.IsDefault()) { + _this->_internal_set_service(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!from._internal_method().empty()) { + _this->_internal_set_method(from._internal_method()); + } else { + if (_this->_impl_.method_.IsDefault()) { + _this->_internal_set_method(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (!from._internal_payload().empty()) { + _this->_internal_set_payload(from._internal_payload()); + } else { + if (_this->_impl_.payload_.IsDefault()) { + _this->_internal_set_payload(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (from._internal_id() != 0) { + _this->_impl_.id_ = from._impl_.id_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ServiceCall::CopyFrom(const ServiceCall& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.host_app.control.ServiceCall) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ServiceCall::InternalSwap(ServiceCall* 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_.mod_, &other->_impl_.mod_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.service_, &other->_impl_.service_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.method_, &other->_impl_.method_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.payload_, &other->_impl_.payload_, arena); + swap(_impl_.id_, other->_impl_.id_); +} + +::google::protobuf::Metadata ServiceCall::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class ServiceAnswer::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ServiceAnswer, _impl_._has_bits_); +}; + +ServiceAnswer::ServiceAnswer(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ServiceAnswer_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.host_app.control.ServiceAnswer) +} +PROTOBUF_NDEBUG_INLINE ServiceAnswer::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::modlock::host_app::control::ServiceAnswer& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + payload_(arena, from.payload_), + error_(arena, from.error_) {} + +ServiceAnswer::ServiceAnswer( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ServiceAnswer& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ServiceAnswer_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ServiceAnswer* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.id_ = from._impl_.id_; + + // @@protoc_insertion_point(copy_constructor:modlock.host_app.control.ServiceAnswer) +} +PROTOBUF_NDEBUG_INLINE ServiceAnswer::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + payload_(arena), + error_(arena) {} + +inline void ServiceAnswer::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.id_ = {}; +} +ServiceAnswer::~ServiceAnswer() { + // @@protoc_insertion_point(destructor:modlock.host_app.control.ServiceAnswer) + SharedDtor(*this); +} +inline void ServiceAnswer::SharedDtor(MessageLite& self) { + ServiceAnswer& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.payload_.Destroy(); + this_._impl_.error_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL ServiceAnswer::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ServiceAnswer(arena); +} +constexpr auto ServiceAnswer::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ServiceAnswer), + alignof(ServiceAnswer)); +} +constexpr auto ServiceAnswer::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_ServiceAnswer_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &ServiceAnswer::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ServiceAnswer::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ServiceAnswer::ByteSizeLong, + &ServiceAnswer::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ServiceAnswer, _impl_._cached_size_), + false, + }, + &ServiceAnswer::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ServiceAnswer_class_data_ = + ServiceAnswer::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ServiceAnswer::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ServiceAnswer_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ServiceAnswer_class_data_.tc_table); + return ServiceAnswer_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 3, 0, 52, 2> +ServiceAnswer::_table_ = { + { + PROTOBUF_FIELD_OFFSET(ServiceAnswer, _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 + ServiceAnswer_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::host_app::control::ServiceAnswer>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // uint64 id = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(ServiceAnswer, _impl_.id_), 2>(), + {8, 2, 0, + PROTOBUF_FIELD_OFFSET(ServiceAnswer, _impl_.id_)}}, + // bytes payload = 2; + {::_pbi::TcParser::FastBS1, + {18, 0, 0, + PROTOBUF_FIELD_OFFSET(ServiceAnswer, _impl_.payload_)}}, + // string error = 3; + {::_pbi::TcParser::FastUS1, + {26, 1, 0, + PROTOBUF_FIELD_OFFSET(ServiceAnswer, _impl_.error_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // uint64 id = 1; + {PROTOBUF_FIELD_OFFSET(ServiceAnswer, _impl_.id_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + // bytes payload = 2; + {PROTOBUF_FIELD_OFFSET(ServiceAnswer, _impl_.payload_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)}, + // string error = 3; + {PROTOBUF_FIELD_OFFSET(ServiceAnswer, _impl_.error_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\46\0\0\5\0\0\0\0" + "modlock.host_app.control.ServiceAnswer" + "error" + }}, +}; +PROTOBUF_NOINLINE void ServiceAnswer::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.host_app.control.ServiceAnswer) + ::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_.payload_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.error_.ClearNonDefaultToEmpty(); + } + } + _impl_.id_ = ::uint64_t{0u}; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ServiceAnswer::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ServiceAnswer& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ServiceAnswer::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ServiceAnswer& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.host_app.control.ServiceAnswer) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // uint64 id = 1; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_id() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 1, this_._internal_id(), target); + } + } + + // bytes payload = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_payload().empty()) { + const ::std::string& _s = this_._internal_payload(); + target = stream->WriteBytesMaybeAliased(2, _s, target); + } + } + + // string error = 3; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_error().empty()) { + const ::std::string& _s = this_._internal_error(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.host_app.control.ServiceAnswer.error"); + 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.host_app.control.ServiceAnswer) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ServiceAnswer::ByteSizeLong(const MessageLite& base) { + const ServiceAnswer& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ServiceAnswer::ByteSizeLong() const { + const ServiceAnswer& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.host_app.control.ServiceAnswer) + ::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)) { + // bytes payload = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_payload().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this_._internal_payload()); + } + } + // string error = 3; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_error().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_error()); + } + } + // uint64 id = 1; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_id() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_id()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ServiceAnswer::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.host_app.control.ServiceAnswer) + 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_payload().empty()) { + _this->_internal_set_payload(from._internal_payload()); + } else { + if (_this->_impl_.payload_.IsDefault()) { + _this->_internal_set_payload(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_error().empty()) { + _this->_internal_set_error(from._internal_error()); + } else { + if (_this->_impl_.error_.IsDefault()) { + _this->_internal_set_error(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (from._internal_id() != 0) { + _this->_impl_.id_ = from._impl_.id_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ServiceAnswer::CopyFrom(const ServiceAnswer& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.host_app.control.ServiceAnswer) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ServiceAnswer::InternalSwap(ServiceAnswer* 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_.payload_, &other->_impl_.payload_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, &other->_impl_.error_, arena); + swap(_impl_.id_, other->_impl_.id_); +} + +::google::protobuf::Metadata ServiceAnswer::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} // @@protoc_insertion_point(namespace_scope) } // namespace control } // namespace host_app diff --git a/src/host_app/control/control.pb.go b/src/host_app/control/control.pb.go index 07580766..8b3e3491 100644 --- a/src/host_app/control/control.pb.go +++ b/src/host_app/control/control.pb.go @@ -67,6 +67,7 @@ type ControlRequest struct { // *ControlRequest_Roles // *ControlRequest_Service // *ControlRequest_Call + // *ControlRequest_Answer Body isControlRequest_Body `protobuf_oneof:"body"` } @@ -111,6 +112,13 @@ func (x *ControlRequest) GetCall() *ModCall { return nil } +func (x *ControlRequest) GetAnswer() *ServiceAnswer { + if x, ok := x.GetBody().(*ControlRequest_Answer); ok { + return x.Answer + } + return nil +} + type isControlRequest_Body interface { isControlRequest_Body() } @@ -136,6 +144,11 @@ type ControlRequest_Call struct { Call *ModCall `protobuf:"bytes,4,opt,name=call,proto3,oneof"` } +type ControlRequest_Answer struct { + // Answer ends one ServiceCall the host forwarded. + Answer *ServiceAnswer `protobuf:"bytes,5,opt,name=answer,proto3,oneof"` +} + func (*ControlRequest_Reload) isControlRequest_Body() {} func (*ControlRequest_Roles) isControlRequest_Body() {} @@ -144,6 +157,8 @@ func (*ControlRequest_Service) isControlRequest_Body() {} func (*ControlRequest_Call) isControlRequest_Body() {} +func (*ControlRequest_Answer) isControlRequest_Body() {} + // ModCall calls one method of a service a running mod serves, on the game's // thread between frames. Only the controller can send it; no player can. type ModCall struct { @@ -290,6 +305,7 @@ type HostEvent struct { // *HostEvent_SlowFrame // *HostEvent_ServiceApplied // *HostEvent_Called + // *HostEvent_ServiceCall Body isHostEvent_Body `protobuf_oneof:"body"` } @@ -397,6 +413,13 @@ func (x *HostEvent) GetCalled() *ModCallResult { return nil } +func (x *HostEvent) GetServiceCall() *ServiceCall { + if x, ok := x.GetBody().(*HostEvent_ServiceCall); ok { + return x.ServiceCall + } + return nil +} + type isHostEvent_Body interface { isHostEvent_Body() } @@ -471,6 +494,12 @@ type HostEvent_Called struct { Called *ModCallResult `protobuf:"bytes,13,opt,name=called,proto3,oneof"` } +type HostEvent_ServiceCall struct { + // ServiceCall asks the controller to answer a mod's started call to a + // service the fixtures forward; an Answer with its id ends it. + ServiceCall *ServiceCall `protobuf:"bytes,14,opt,name=service_call,json=serviceCall,proto3,oneof"` +} + func (*HostEvent_Started) isHostEvent_Body() {} func (*HostEvent_Log) isHostEvent_Body() {} @@ -497,6 +526,8 @@ func (*HostEvent_ServiceApplied) isHostEvent_Body() {} func (*HostEvent_Called) isHostEvent_Body() {} +func (*HostEvent_ServiceCall) isHostEvent_Body() {} + // PlayerChat is a line a player said in chat, to everyone or to their team. type PlayerChat struct { unknownFields []byte @@ -949,6 +980,223 @@ func (x *ServiceResult) GetError() string { return "" } +// Fixture is one method's reply from a mod project's service fixture, which +// the controller hands the host at start so the mod's first frame can call it. +type Fixture struct { + unknownFields []byte + // Mod is the slug of the mod the reply answers. + Mod string `protobuf:"bytes,1,opt,name=mod,proto3" json:"mod,omitempty"` + // Service and Method select the call this reply answers. + Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` + Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` + // Payload is the reply's bytes, opaque to Modlock. + Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` + // Source names the fixture file, for the host's log. + Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` +} + +func (x *Fixture) Reset() { + *x = Fixture{} +} + +func (*Fixture) ProtoMessage() {} + +func (x *Fixture) GetMod() string { + if x != nil { + return x.Mod + } + return "" +} + +func (x *Fixture) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *Fixture) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *Fixture) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *Fixture) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +// Forward hands one mod's started calls of a service to the controller over +// the control link, in place of a fixture. +type Forward struct { + unknownFields []byte + // Mod is the slug of the mod whose calls go to the controller. + Mod string `protobuf:"bytes,1,opt,name=mod,proto3" json:"mod,omitempty"` + // Service names the service forwarded. + Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` + // Target names where the controller sends the calls, for the host's log. + Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` +} + +func (x *Forward) Reset() { + *x = Forward{} +} + +func (*Forward) ProtoMessage() {} + +func (x *Forward) GetMod() string { + if x != nil { + return x.Mod + } + return "" +} + +func (x *Forward) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *Forward) GetTarget() string { + if x != nil { + return x.Target + } + return "" +} + +// Fixtures is the file --fixtures names: every fixture reply of the mods the +// host loads, and the services the controller answers instead. +type Fixtures struct { + unknownFields []byte + Fixtures []*Fixture `protobuf:"bytes,1,rep,name=fixtures,proto3" json:"fixtures,omitempty"` + Forwards []*Forward `protobuf:"bytes,2,rep,name=forwards,proto3" json:"forwards,omitempty"` +} + +func (x *Fixtures) Reset() { + *x = Fixtures{} +} + +func (*Fixtures) ProtoMessage() {} + +func (x *Fixtures) GetFixtures() []*Fixture { + if x != nil { + return x.Fixtures + } + return nil +} + +func (x *Fixtures) GetForwards() []*Forward { + if x != nil { + return x.Forwards + } + return nil +} + +// ServiceCall is one started call of a forwarded service, for the controller +// to answer. +type ServiceCall struct { + unknownFields []byte + // Id names the call in the Answer that ends it. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Mod is the slug of the calling mod. + Mod string `protobuf:"bytes,2,opt,name=mod,proto3" json:"mod,omitempty"` + // Service and Method select the call. + Service string `protobuf:"bytes,3,opt,name=service,proto3" json:"service,omitempty"` + Method string `protobuf:"bytes,4,opt,name=method,proto3" json:"method,omitempty"` + // Payload is the call's bytes, opaque to Modlock. + Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *ServiceCall) Reset() { + *x = ServiceCall{} +} + +func (*ServiceCall) ProtoMessage() {} + +func (x *ServiceCall) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ServiceCall) GetMod() string { + if x != nil { + return x.Mod + } + return "" +} + +func (x *ServiceCall) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *ServiceCall) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *ServiceCall) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// ServiceAnswer ends one forwarded ServiceCall with its reply or an error. +type ServiceAnswer struct { + unknownFields []byte + // Id matches the ServiceCall it ends. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Payload is the reply's bytes when Error is empty. + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + // Error, when set, fails the call with this text. + Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *ServiceAnswer) Reset() { + *x = ServiceAnswer{} +} + +func (*ServiceAnswer) ProtoMessage() {} + +func (x *ServiceAnswer) GetId() uint64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ServiceAnswer) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *ServiceAnswer) GetError() string { + if x != nil { + return x.Error + } + return "" +} + func (m *ControlRequest) CloneVT() *ControlRequest { if m == nil { return (*ControlRequest)(nil) @@ -1019,6 +1267,19 @@ func (m *ControlRequest_Call) CloneOneofVT() isControlRequest_Body { return m.CloneVT() } +func (m *ControlRequest_Answer) CloneVT() *ControlRequest_Answer { + if m == nil { + return (*ControlRequest_Answer)(nil) + } + r := new(ControlRequest_Answer) + r.Answer = protobuf_go_lite.CloneVTValue(m.Answer) + return r +} + +func (m *ControlRequest_Answer) CloneOneofVT() isControlRequest_Body { + return m.CloneVT() +} + func (m *ModCall) CloneVT() *ModCall { if m == nil { return (*ModCall)(nil) @@ -1261,6 +1522,19 @@ func (m *HostEvent_Called) CloneOneofVT() isHostEvent_Body { return m.CloneVT() } +func (m *HostEvent_ServiceCall) CloneVT() *HostEvent_ServiceCall { + if m == nil { + return (*HostEvent_ServiceCall)(nil) + } + r := new(HostEvent_ServiceCall) + r.ServiceCall = protobuf_go_lite.CloneVTValue(m.ServiceCall) + return r +} + +func (m *HostEvent_ServiceCall) CloneOneofVT() isHostEvent_Body { + return m.CloneVT() +} + func (m *PlayerChat) CloneVT() *PlayerChat { if m == nil { return (*PlayerChat)(nil) @@ -1490,6 +1764,99 @@ func (m *ServiceResult) CloneMessageVT() protobuf_go_lite.CloneMessage { return m.CloneVT() } +func (m *Fixture) CloneVT() *Fixture { + if m == nil { + return (*Fixture)(nil) + } + r := new(Fixture) + r.Mod = m.Mod + r.Service = m.Service + r.Method = m.Method + r.Source = m.Source + r.Payload = protobuf_go_lite.CloneBytes(m.Payload) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *Fixture) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *Forward) CloneVT() *Forward { + if m == nil { + return (*Forward)(nil) + } + r := new(Forward) + r.Mod = m.Mod + r.Service = m.Service + r.Target = m.Target + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *Forward) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *Fixtures) CloneVT() *Fixtures { + if m == nil { + return (*Fixtures)(nil) + } + r := new(Fixtures) + r.Fixtures = protobuf_go_lite.CloneVTSlice(m.Fixtures) + r.Forwards = protobuf_go_lite.CloneVTSlice(m.Forwards) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *Fixtures) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *ServiceCall) CloneVT() *ServiceCall { + if m == nil { + return (*ServiceCall)(nil) + } + r := new(ServiceCall) + r.Id = m.Id + r.Mod = m.Mod + r.Service = m.Service + r.Method = m.Method + r.Payload = protobuf_go_lite.CloneBytes(m.Payload) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *ServiceCall) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *ServiceAnswer) CloneVT() *ServiceAnswer { + if m == nil { + return (*ServiceAnswer)(nil) + } + r := new(ServiceAnswer) + r.Id = m.Id + r.Error = m.Error + r.Payload = protobuf_go_lite.CloneBytes(m.Payload) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *ServiceAnswer) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + func (this *ControlRequest) EqualVT(that *ControlRequest) bool { if this == that { return true @@ -1587,6 +1954,23 @@ func (this *ControlRequest_Call) EqualVT(thatIface isControlRequest_Body) bool { return true } +func (this *ControlRequest_Answer) EqualVT(thatIface isControlRequest_Body) bool { + that, ok := thatIface.(*ControlRequest_Answer) + 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.Answer, that.Answer, func() *ServiceAnswer { return &ServiceAnswer{} }) { + return false + } + return true +} + func (this *ModCall) EqualVT(that *ModCall) bool { if this == that { return true @@ -1916,8 +2300,25 @@ func (this *HostEvent_Called) EqualVT(thatIface isHostEvent_Body) bool { return true } -func (this *PlayerChat) EqualVT(that *PlayerChat) bool { - if this == that { +func (this *HostEvent_ServiceCall) EqualVT(thatIface isHostEvent_Body) bool { + that, ok := thatIface.(*HostEvent_ServiceCall) + 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.ServiceCall, that.ServiceCall, func() *ServiceCall { return &ServiceCall{} }) { + return false + } + return true +} + +func (this *PlayerChat) EqualVT(that *PlayerChat) bool { + if this == that { return true } else if this == nil || that == nil { return false @@ -2239,6 +2640,145 @@ func (this *ServiceResult) EqualMessageVT(thatMsg any) bool { return this.EqualVT(that) } +func (this *Fixture) EqualVT(that *Fixture) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Mod != that.Mod { + return false + } + if this.Service != that.Service { + return false + } + if this.Method != that.Method { + return false + } + if !protobuf_go_lite.EqualBytes(this.Payload, that.Payload) { + return false + } + if this.Source != that.Source { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Fixture) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*Fixture) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *Forward) EqualVT(that *Forward) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Mod != that.Mod { + return false + } + if this.Service != that.Service { + return false + } + if this.Target != that.Target { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Forward) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*Forward) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *Fixtures) EqualVT(that *Fixtures) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if !protobuf_go_lite.EqualVTSliceImplicit(this.Fixtures, that.Fixtures, func() *Fixture { return &Fixture{} }) { + return false + } + if !protobuf_go_lite.EqualVTSliceImplicit(this.Forwards, that.Forwards, func() *Forward { return &Forward{} }) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Fixtures) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*Fixtures) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *ServiceCall) EqualVT(that *ServiceCall) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Id != that.Id { + return false + } + if this.Mod != that.Mod { + return false + } + if this.Service != that.Service { + return false + } + if this.Method != that.Method { + return false + } + if !protobuf_go_lite.EqualBytes(this.Payload, that.Payload) { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ServiceCall) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*ServiceCall) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *ServiceAnswer) EqualVT(that *ServiceAnswer) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Id != that.Id { + return false + } + if !protobuf_go_lite.EqualBytes(this.Payload, that.Payload) { + return false + } + if this.Error != that.Error { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ServiceAnswer) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*ServiceAnswer) + if !ok { + return false + } + return this.EqualVT(that) +} + // MarshalProtoJSON marshals the MessageKind to JSON. func (x MessageKind) MarshalProtoJSON(s *json.MarshalState) { s.WriteEnum(int32(x), MessageKind_name) @@ -2305,6 +2845,10 @@ func (x *ControlRequest) MarshalProtoJSON(s *json.MarshalState) { s.WriteMoreIf(&wroteField) s.WriteObjectField("call") ov.Call.MarshalProtoJSON(s.WithField("call")) + case *ControlRequest_Answer: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("answer") + ov.Answer.MarshalProtoJSON(s.WithField("answer")) } } s.WriteObjectEnd() @@ -2360,6 +2904,15 @@ func (x *ControlRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { } ov.Call = &ModCall{} ov.Call.UnmarshalProtoJSON(s.WithField("call", true)) + case "answer": + ov := &ControlRequest_Answer{} + x.Body = ov + if s.ReadNil() { + ov.Answer = nil + return + } + ov.Answer = &ServiceAnswer{} + ov.Answer.UnmarshalProtoJSON(s.WithField("answer", true)) } }) } @@ -2613,6 +3166,10 @@ func (x *HostEvent) MarshalProtoJSON(s *json.MarshalState) { s.WriteMoreIf(&wroteField) s.WriteObjectField("called") ov.Called.MarshalProtoJSON(s.WithField("called")) + case *HostEvent_ServiceCall: + s.WriteMoreIf(&wroteField) + s.WriteObjectField("serviceCall") + ov.ServiceCall.MarshalProtoJSON(s.WithField("serviceCall")) } } s.WriteObjectEnd() @@ -2749,6 +3306,15 @@ func (x *HostEvent) UnmarshalProtoJSON(s *json.UnmarshalState) { } ov.Called = &ModCallResult{} ov.Called.UnmarshalProtoJSON(s.WithField("called", true)) + case "service_call", "serviceCall": + ov := &HostEvent_ServiceCall{} + x.Body = ov + if s.ReadNil() { + ov.ServiceCall = nil + return + } + ov.ServiceCall = &ServiceCall{} + ov.ServiceCall.UnmarshalProtoJSON(s.WithField("service_call", true)) } }) } @@ -3484,144 +4050,363 @@ func (x *ServiceResult) UnmarshalJSON(b []byte) error { return json.DefaultUnmarshalerConfig.Unmarshal(b, x) } -func (m *ControlRequest) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil +// MarshalProtoJSON marshals the Fixture message to JSON. +func (x *Fixture) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err + s.WriteObjectStart() + var wroteField bool + if x.Mod != "" || s.HasField("mod") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("mod") + s.WriteString(x.Mod) } - return dAtA[:n], nil -} - -func (m *ControlRequest) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *ControlRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil + if x.Service != "" || s.HasField("service") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("service") + s.WriteString(x.Service) } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) + if x.Method != "" || s.HasField("method") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("method") + s.WriteString(x.Method) } - if vtmsg, ok := m.Body.(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size + if len(x.Payload) > 0 || s.HasField("payload") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("payload") + s.WriteBytes(x.Payload) } - return len(dAtA) - i, nil + if x.Source != "" || s.HasField("source") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("source") + s.WriteString(x.Source) + } + s.WriteObjectEnd() } -func (m *ControlRequest_Reload) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) +// MarshalJSON marshals the Fixture to JSON. +func (x *Fixture) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) } -func (m *ControlRequest_Reload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Reload != nil { - size, err := m.Reload.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa - } else { - i = protobuf_go_lite.EncodeVarint(dAtA, i, 0) - i-- - dAtA[i] = 0xa +// UnmarshalProtoJSON unmarshals the Fixture message from JSON. +func (x *Fixture) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return } - return len(dAtA) - i, nil + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "mod": + s.AddField("mod") + x.Mod = s.ReadString() + case "service": + s.AddField("service") + x.Service = s.ReadString() + case "method": + s.AddField("method") + x.Method = s.ReadString() + case "payload": + s.AddField("payload") + x.Payload = s.ReadBytes() + case "source": + s.AddField("source") + x.Source = s.ReadString() + } + }) } -func (m *ControlRequest_Roles) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) +// UnmarshalJSON unmarshals the Fixture from JSON. +func (x *Fixture) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) } -func (m *ControlRequest_Roles) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Roles != nil { - size, err := m.Roles.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } else { - i = protobuf_go_lite.EncodeVarint(dAtA, i, 0) - i-- - dAtA[i] = 0x12 +// MarshalProtoJSON marshals the Forward message to JSON. +func (x *Forward) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return } - return len(dAtA) - i, nil + s.WriteObjectStart() + var wroteField bool + if x.Mod != "" || s.HasField("mod") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("mod") + s.WriteString(x.Mod) + } + if x.Service != "" || s.HasField("service") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("service") + s.WriteString(x.Service) + } + if x.Target != "" || s.HasField("target") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("target") + s.WriteString(x.Target) + } + s.WriteObjectEnd() } -func (m *ControlRequest_Service) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) +// MarshalJSON marshals the Forward to JSON. +func (x *Forward) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) } -func (m *ControlRequest_Service) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Service != nil { - size, err := m.Service.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err +// UnmarshalProtoJSON unmarshals the Forward message from JSON. +func (x *Forward) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "mod": + s.AddField("mod") + x.Mod = s.ReadString() + case "service": + s.AddField("service") + x.Service = s.ReadString() + case "target": + s.AddField("target") + x.Target = s.ReadString() } - 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 + }) +} + +// UnmarshalJSON unmarshals the Forward from JSON. +func (x *Forward) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the Fixtures message to JSON. +func (x *Fixtures) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return } - return len(dAtA) - i, nil + s.WriteObjectStart() + var wroteField bool + if len(x.Fixtures) > 0 || s.HasField("fixtures") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("fixtures") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Fixtures { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("fixtures")) + } + s.WriteArrayEnd() + } + if len(x.Forwards) > 0 || s.HasField("forwards") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("forwards") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Forwards { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("forwards")) + } + s.WriteArrayEnd() + } + s.WriteObjectEnd() } -func (m *ControlRequest_Call) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) +// MarshalJSON marshals the Fixtures to JSON. +func (x *Fixtures) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) } -func (m *ControlRequest_Call) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Call != nil { - size, err := m.Call.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err +// UnmarshalProtoJSON unmarshals the Fixtures message from JSON. +func (x *Fixtures) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "fixtures": + s.AddField("fixtures") + if s.ReadNil() { + x.Fixtures = nil + return + } + s.ReadArray(func() { + if s.ReadNil() { + x.Fixtures = append(x.Fixtures, nil) + return + } + v := &Fixture{} + v.UnmarshalProtoJSON(s.WithField("fixtures", false)) + if s.Err() != nil { + return + } + x.Fixtures = append(x.Fixtures, v) + }) + case "forwards": + s.AddField("forwards") + if s.ReadNil() { + x.Forwards = nil + return + } + s.ReadArray(func() { + if s.ReadNil() { + x.Forwards = append(x.Forwards, nil) + return + } + v := &Forward{} + v.UnmarshalProtoJSON(s.WithField("forwards", false)) + if s.Err() != nil { + return + } + x.Forwards = append(x.Forwards, v) + }) } - i -= size - i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } else { - i = protobuf_go_lite.EncodeVarint(dAtA, i, 0) - i-- - dAtA[i] = 0x22 + }) +} + +// UnmarshalJSON unmarshals the Fixtures from JSON. +func (x *Fixtures) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the ServiceCall message to JSON. +func (x *ServiceCall) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return } - return len(dAtA) - i, nil + s.WriteObjectStart() + var wroteField bool + if x.Id != 0 || s.HasField("id") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("id") + s.WriteUint64(x.Id) + } + if x.Mod != "" || s.HasField("mod") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("mod") + s.WriteString(x.Mod) + } + if x.Service != "" || s.HasField("service") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("service") + s.WriteString(x.Service) + } + if x.Method != "" || s.HasField("method") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("method") + s.WriteString(x.Method) + } + if len(x.Payload) > 0 || s.HasField("payload") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("payload") + s.WriteBytes(x.Payload) + } + s.WriteObjectEnd() } -func (m *ModCall) MarshalVT() (dAtA []byte, err error) { +// MarshalJSON marshals the ServiceCall to JSON. +func (x *ServiceCall) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the ServiceCall message from JSON. +func (x *ServiceCall) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "id": + s.AddField("id") + x.Id = s.ReadUint64() + case "mod": + s.AddField("mod") + x.Mod = s.ReadString() + case "service": + s.AddField("service") + x.Service = s.ReadString() + case "method": + s.AddField("method") + x.Method = s.ReadString() + case "payload": + s.AddField("payload") + x.Payload = s.ReadBytes() + } + }) +} + +// UnmarshalJSON unmarshals the ServiceCall from JSON. +func (x *ServiceCall) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the ServiceAnswer message to JSON. +func (x *ServiceAnswer) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Id != 0 || s.HasField("id") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("id") + s.WriteUint64(x.Id) + } + if len(x.Payload) > 0 || s.HasField("payload") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("payload") + s.WriteBytes(x.Payload) + } + if x.Error != "" || s.HasField("error") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("error") + s.WriteString(x.Error) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the ServiceAnswer to JSON. +func (x *ServiceAnswer) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the ServiceAnswer message from JSON. +func (x *ServiceAnswer) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "id": + s.AddField("id") + x.Id = s.ReadUint64() + case "payload": + s.AddField("payload") + x.Payload = s.ReadBytes() + case "error": + s.AddField("error") + x.Error = s.ReadString() + } + }) +} + +// UnmarshalJSON unmarshals the ServiceAnswer from JSON. +func (x *ServiceAnswer) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +func (m *ControlRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -3634,12 +4419,12 @@ func (m *ModCall) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ModCall) MarshalToVT(dAtA []byte) (int, error) { +func (m *ControlRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ModCall) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ControlRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -3650,24 +4435,185 @@ func (m *ModCall) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.unknownFields != nil { i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) } - if len(m.Id) > 0 { - i = protobuf_go_lite.EncodeString(dAtA, i, m.Id) - i-- - dAtA[i] = 0x2a - } - if len(m.Payload) > 0 { - i = protobuf_go_lite.EncodeBytes(dAtA, i, m.Payload) - i-- - dAtA[i] = 0x22 - } - if len(m.Method) > 0 { - i = protobuf_go_lite.EncodeString(dAtA, i, m.Method) - i-- - dAtA[i] = 0x1a + if vtmsg, ok := m.Body.(interface { + MarshalToSizedBufferVT([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size } - if len(m.Service) > 0 { - i = protobuf_go_lite.EncodeString(dAtA, i, m.Service) - i-- + return len(dAtA) - i, nil +} + +func (m *ControlRequest_Reload) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ControlRequest_Reload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Reload != nil { + size, err := m.Reload.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } else { + i = protobuf_go_lite.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ControlRequest_Roles) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ControlRequest_Roles) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Roles != nil { + size, err := m.Roles.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } else { + i = protobuf_go_lite.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *ControlRequest_Service) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ControlRequest_Service) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Service != nil { + size, err := m.Service.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 *ControlRequest_Call) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ControlRequest_Call) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Call != nil { + size, err := m.Call.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } else { + i = protobuf_go_lite.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} + +func (m *ControlRequest_Answer) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ControlRequest_Answer) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Answer != nil { + size, err := m.Answer.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 *ModCall) 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 *ModCall) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModCall) 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.Id) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Id) + i-- + dAtA[i] = 0x2a + } + if len(m.Payload) > 0 { + i = protobuf_go_lite.EncodeBytes(dAtA, i, m.Payload) + i-- + dAtA[i] = 0x22 + } + if len(m.Method) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Method) + i-- + dAtA[i] = 0x1a + } + if len(m.Service) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Service) + i-- dAtA[i] = 0x12 } if len(m.Mod) > 0 { @@ -4120,6 +5066,30 @@ func (m *HostEvent_Called) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *HostEvent_ServiceCall) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HostEvent_ServiceCall) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ServiceCall != nil { + size, err := m.ServiceCall.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x72 + } else { + i = protobuf_go_lite.EncodeVarint(dAtA, i, 0) + i-- + dAtA[i] = 0x72 + } + return len(dAtA) - i, nil +} + func (m *PlayerChat) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -4721,55 +5691,319 @@ func (m *ServiceResult) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ControlRequest) SizeVT() (n int) { +func (m *Fixture) MarshalVT() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - if vtmsg, ok := m.Body.(interface{ SizeVT() int }); ok { - n += vtmsg.SizeVT() + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err } - n += len(m.unknownFields) - return n + return dAtA[:n], nil } -func (m *ControlRequest_Reload) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Reload != nil { - l = m.Reload.SizeVT() - n += protobuf_go_lite.SizeMessage(1, l) - } else { - n += 2 - } - return n +func (m *Fixture) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ControlRequest_Roles) SizeVT() (n int) { +func (m *Fixture) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - if m.Roles != nil { - l = m.Roles.SizeVT() - n += protobuf_go_lite.SizeMessage(1, l) - } else { - n += 2 + if m.unknownFields != nil { + i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) } - return n + if len(m.Source) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Source) + i-- + dAtA[i] = 0x2a + } + if len(m.Payload) > 0 { + i = protobuf_go_lite.EncodeBytes(dAtA, i, m.Payload) + i-- + dAtA[i] = 0x22 + } + if len(m.Method) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Method) + i-- + dAtA[i] = 0x1a + } + if len(m.Service) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Service) + i-- + dAtA[i] = 0x12 + } + if len(m.Mod) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Mod) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *ControlRequest_Service) SizeVT() (n int) { +func (m *Forward) MarshalVT() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l + 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 *Forward) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Forward) 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.Target) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Target) + i-- + dAtA[i] = 0x1a + } + if len(m.Service) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Service) + i-- + dAtA[i] = 0x12 + } + if len(m.Mod) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Mod) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Fixtures) 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 *Fixtures) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Fixtures) 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.Forwards) > 0 { + for iNdEx := len(m.Forwards) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Forwards[iNdEx].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 len(m.Fixtures) > 0 { + for iNdEx := len(m.Fixtures) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Fixtures[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 *ServiceCall) 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 *ServiceCall) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ServiceCall) 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.Payload) > 0 { + i = protobuf_go_lite.EncodeBytes(dAtA, i, m.Payload) + i-- + dAtA[i] = 0x2a + } + if len(m.Method) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Method) + i-- + dAtA[i] = 0x22 + } + if len(m.Service) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Service) + i-- + dAtA[i] = 0x1a + } + if len(m.Mod) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Mod) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ServiceAnswer) 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 *ServiceAnswer) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ServiceAnswer) 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.Error) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Error) + i-- + dAtA[i] = 0x1a + } + if len(m.Payload) > 0 { + i = protobuf_go_lite.EncodeBytes(dAtA, i, m.Payload) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ControlRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if vtmsg, ok := m.Body.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + n += len(m.unknownFields) + return n +} + +func (m *ControlRequest_Reload) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Reload != nil { + l = m.Reload.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } else { + n += 2 + } + return n +} + +func (m *ControlRequest_Roles) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Roles != nil { + l = m.Roles.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } else { + n += 2 + } + return n +} + +func (m *ControlRequest_Service) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l if m.Service != nil { l = m.Service.SizeVT() n += protobuf_go_lite.SizeMessage(1, l) @@ -4794,6 +6028,21 @@ func (m *ControlRequest_Call) SizeVT() (n int) { return n } +func (m *ControlRequest_Answer) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Answer != nil { + l = m.Answer.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } else { + n += 2 + } + return n +} + func (m *ModCall) SizeVT() (n int) { if m == nil { return 0 @@ -5042,6 +6291,21 @@ func (m *HostEvent_Called) SizeVT() (n int) { return n } +func (m *HostEvent_ServiceCall) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ServiceCall != nil { + l = m.ServiceCall.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } else { + n += 2 + } + return n +} + func (m *PlayerChat) SizeVT() (n int) { if m == nil { return 0 @@ -5215,8 +6479,82 @@ func (m *ServiceResult) SizeVT() (n int) { return n } -func (x MessageKind) MarshalProtoText() string { - return x.String() +func (m *Fixture) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Mod) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Service) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Method) + n += protobuf_go_lite.SizeBytesNonEmpty(1, m.Payload) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Source) + n += len(m.unknownFields) + return n +} + +func (m *Forward) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Mod) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Service) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Target) + n += len(m.unknownFields) + return n +} + +func (m *Fixtures) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + for _, e := range m.Fixtures { + l = e.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } + for _, e := range m.Forwards { + l = e.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } + n += len(m.unknownFields) + return n +} + +func (m *ServiceCall) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeVarintNonZero(1, m.Id) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Mod) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Service) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Method) + n += protobuf_go_lite.SizeBytesNonEmpty(1, m.Payload) + n += len(m.unknownFields) + return n +} + +func (m *ServiceAnswer) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeVarintNonZero(1, m.Id) + n += protobuf_go_lite.SizeBytesNonEmpty(1, m.Payload) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Error) + n += len(m.unknownFields) + return n +} + +func (x MessageKind) MarshalProtoText() string { + return x.String() } func (x *ControlRequest) MarshalProtoText() string { @@ -5251,6 +6589,13 @@ func (x *ControlRequest) MarshalProtoText() string { } else { protobuf_go_lite.TextWriteTextMarshaler(&sb, body.Call) } + case *ControlRequest_Answer: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "answer") + if body.Answer == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &ServiceAnswer{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, body.Answer) + } } return protobuf_go_lite.TextFinishMessage(&sb) } @@ -5424,6 +6769,13 @@ func (x *HostEvent) MarshalProtoText() string { } else { protobuf_go_lite.TextWriteTextMarshaler(&sb, body.Called) } + case *HostEvent_ServiceCall: + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "service_call") + if body.ServiceCall == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &ServiceCall{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, body.ServiceCall) + } } return protobuf_go_lite.TextFinishMessage(&sb) } @@ -5698,6 +7050,144 @@ func (x *ServiceResult) String() string { return x.MarshalProtoText() } +func (x *Fixture) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "Fixture") + if x.Mod != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "mod") + protobuf_go_lite.TextWriteString(&sb, x.Mod) + } + if x.Service != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "service") + protobuf_go_lite.TextWriteString(&sb, x.Service) + } + if x.Method != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "method") + protobuf_go_lite.TextWriteString(&sb, x.Method) + } + if len(x.Payload) != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "payload") + protobuf_go_lite.TextWriteBytes(&sb, x.Payload) + } + if x.Source != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "source") + protobuf_go_lite.TextWriteString(&sb, x.Source) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *Fixture) String() string { + return x.MarshalProtoText() +} + +func (x *Forward) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "Forward") + if x.Mod != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "mod") + protobuf_go_lite.TextWriteString(&sb, x.Mod) + } + if x.Service != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "service") + protobuf_go_lite.TextWriteString(&sb, x.Service) + } + if x.Target != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "target") + protobuf_go_lite.TextWriteString(&sb, x.Target) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *Forward) String() string { + return x.MarshalProtoText() +} + +func (x *Fixtures) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "Fixtures") + if len(x.Fixtures) > 0 { + protobuf_go_lite.TextWriteListStart(&sb, initialLen, "fixtures") + for i, v := range x.Fixtures { + protobuf_go_lite.TextWriteListSeparator(&sb, i) + if v == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &Fixture{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, v) + } + } + protobuf_go_lite.TextWriteListEnd(&sb) + } + if len(x.Forwards) > 0 { + protobuf_go_lite.TextWriteListStart(&sb, initialLen, "forwards") + for i, v := range x.Forwards { + protobuf_go_lite.TextWriteListSeparator(&sb, i) + if v == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &Forward{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, v) + } + } + protobuf_go_lite.TextWriteListEnd(&sb) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *Fixtures) String() string { + return x.MarshalProtoText() +} + +func (x *ServiceCall) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "ServiceCall") + if x.Id != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "id") + protobuf_go_lite.TextWriteUint(&sb, x.Id) + } + if x.Mod != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "mod") + protobuf_go_lite.TextWriteString(&sb, x.Mod) + } + if x.Service != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "service") + protobuf_go_lite.TextWriteString(&sb, x.Service) + } + if x.Method != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "method") + protobuf_go_lite.TextWriteString(&sb, x.Method) + } + if len(x.Payload) != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "payload") + protobuf_go_lite.TextWriteBytes(&sb, x.Payload) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *ServiceCall) String() string { + return x.MarshalProtoText() +} + +func (x *ServiceAnswer) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "ServiceAnswer") + if x.Id != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "id") + protobuf_go_lite.TextWriteUint(&sb, x.Id) + } + if len(x.Payload) != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "payload") + protobuf_go_lite.TextWriteBytes(&sb, x.Payload) + } + if x.Error != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "error") + protobuf_go_lite.TextWriteString(&sb, x.Error) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *ServiceAnswer) String() string { + return x.MarshalProtoText() +} + func (m *ControlRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5720,82 +7210,650 @@ func (m *ControlRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reload", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Reload", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*ControlRequest_Reload); ok { + if err := oneof.Reload.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &ReloadRequest{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &ControlRequest_Reload{Reload: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*ControlRequest_Roles); ok { + if err := oneof.Roles.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &players.RolesTable{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &ControlRequest_Roles{Roles: v} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*ControlRequest_Service); ok { + if err := oneof.Service.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &ServiceReply{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &ControlRequest_Service{Service: v} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Call", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*ControlRequest_Call); ok { + if err := oneof.Call.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &ModCall{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &ControlRequest_Call{Call: v} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Answer", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*ControlRequest_Answer); ok { + if err := oneof.Answer.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &ServiceAnswer{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &ControlRequest_Answer{Answer: 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 *ModCall) 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: ModCall: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModCall: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Mod = v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Service = v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Method = v + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, dAtA, iNdEx) + if err != nil { + return err + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Id = 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 *ModCallResult) 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: ModCallResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModCallResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Id = v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Mod = v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, dAtA, iNdEx) + if err != nil { + return err + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Error = 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 *ReloadRequest) 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: ReloadRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ReloadRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Path = 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 *HostEvent) 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: HostEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HostEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Started", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*HostEvent_Started); ok { + if err := oneof.Started.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &ModStarted{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &HostEvent_Started{Started: v} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) } msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) if err != nil { return err } - if oneof, ok := m.Body.(*ControlRequest_Reload); ok { - if err := oneof.Reload.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + if oneof, ok := m.Body.(*HostEvent_Log); ok { + if err := oneof.Log.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } } else { - v := &ReloadRequest{} + v := &ModLog{} if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } - m.Body = &ControlRequest_Reload{Reload: v} + m.Body = &HostEvent_Log{Log: v} } iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) } msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) if err != nil { return err } - if oneof, ok := m.Body.(*ControlRequest_Roles); ok { - if err := oneof.Roles.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + if oneof, ok := m.Body.(*HostEvent_Failed); ok { + if err := oneof.Failed.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } } else { - v := &players.RolesTable{} + v := &ModFailed{} if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } - m.Body = &ControlRequest_Roles{Roles: v} + m.Body = &HostEvent_Failed{Failed: v} } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Joined", wireType) } msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) if err != nil { return err } - if oneof, ok := m.Body.(*ControlRequest_Service); ok { - if err := oneof.Service.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + if oneof, ok := m.Body.(*HostEvent_Joined); ok { + if err := oneof.Joined.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } } else { - v := &ServiceReply{} + v := &PlayerJoined{} if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } - m.Body = &ControlRequest_Service{Service: v} + m.Body = &HostEvent_Joined{Joined: v} } iNdEx = postIndex - case 4: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Call", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ready", wireType) } msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) if err != nil { return err } - if oneof, ok := m.Body.(*ControlRequest_Call); ok { - if err := oneof.Call.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + if oneof, ok := m.Body.(*HostEvent_Ready); ok { + if err := oneof.Ready.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } } else { - v := &ModCall{} + v := &ServerReady{} if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } - m.Body = &ControlRequest_Call{Call: v} + m.Body = &HostEvent_Ready{Ready: v} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ui", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*HostEvent_Ui); ok { + if err := oneof.Ui.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &UiChanged{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &HostEvent_Ui{Ui: v} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Left", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*HostEvent_Left); ok { + if err := oneof.Left.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &PlayerLeft{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &HostEvent_Left{Left: v} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*HostEvent_Message); ok { + if err := oneof.Message.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &PlayerMessage{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &HostEvent_Message{Message: v} + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chat", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*HostEvent_Chat); ok { + if err := oneof.Chat.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &PlayerChat{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &HostEvent_Chat{Chat: v} + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Calls", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*HostEvent_Calls); ok { + if err := oneof.Calls.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &ModCalls{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &HostEvent_Calls{Calls: v} + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlowFrame", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*HostEvent_SlowFrame); ok { + if err := oneof.SlowFrame.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &ModSlowFrame{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &HostEvent_SlowFrame{SlowFrame: v} + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceApplied", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*HostEvent_ServiceApplied); ok { + if err := oneof.ServiceApplied.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &ServiceResult{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &HostEvent_ServiceApplied{ServiceApplied: v} + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Called", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*HostEvent_Called); ok { + if err := oneof.Called.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &ModCallResult{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &HostEvent_Called{Called: v} + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceCall", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + if oneof, ok := m.Body.(*HostEvent_ServiceCall); ok { + if err := oneof.ServiceCall.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + } else { + v := &ServiceCall{} + if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err + } + m.Body = &HostEvent_ServiceCall{ServiceCall: v} } iNdEx = postIndex default: @@ -5821,7 +7879,7 @@ func (m *ControlRequest) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ModCall) UnmarshalVT(dAtA []byte) error { +func (m *PlayerChat) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -5835,60 +7893,41 @@ func (m *ModCall) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ModCall: wiretype end group for non-group") + return fmt.Errorf("proto: PlayerChat: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ModCall: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PlayerChat: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + m.Slot = 0 + m.Slot, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) if err != nil { return err } - m.Mod = v case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) - if err != nil { - return err - } - m.Service = v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) - } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) - if err != nil { - return err - } - m.Method = v - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, dAtA, iNdEx) + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - case 5: + m.Name = v + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + 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.Id = v + m.Text = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -5912,7 +7951,7 @@ func (m *ModCall) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ModCallResult) UnmarshalVT(dAtA []byte) error { +func (m *ModStarted) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -5926,23 +7965,13 @@ func (m *ModCallResult) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ModCallResult: wiretype end group for non-group") + return fmt.Errorf("proto: ModStarted: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ModCallResult: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ModStarted: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) - if err != nil { - return err - } - m.Id = v - case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) } @@ -5952,24 +7981,16 @@ func (m *ModCallResult) UnmarshalVT(dAtA []byte) error { return err } m.Mod = v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, dAtA, iNdEx) - if err != nil { - return err - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reloaded", wireType) } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + var v bool + v, iNdEx, err = protobuf_go_lite.DecodeVarintBool(dAtA, iNdEx) if err != nil { return err } - m.Error = v + m.Reloaded = bool(v) default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -5993,7 +8014,7 @@ func (m *ModCallResult) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ReloadRequest) UnmarshalVT(dAtA []byte) error { +func (m *ModLog) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6007,22 +8028,32 @@ func (m *ReloadRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ReloadRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ModLog: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ReloadRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ModLog: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) } var v string v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - m.Path = v + m.Mod = 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.Text = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -6046,7 +8077,7 @@ func (m *ReloadRequest) UnmarshalVT(dAtA []byte) error { return nil } -func (m *HostEvent) UnmarshalVT(dAtA []byte) error { +func (m *ModFailed) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6060,270 +8091,98 @@ func (m *HostEvent) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HostEvent: wiretype end group for non-group") + return fmt.Errorf("proto: ModFailed: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HostEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Started", wireType) - } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) - if err != nil { - return err - } - if oneof, ok := m.Body.(*HostEvent_Started); ok { - if err := oneof.Started.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &ModStarted{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Started{Started: v} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) - } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) - if err != nil { - return err - } - if oneof, ok := m.Body.(*HostEvent_Log); ok { - if err := oneof.Log.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &ModLog{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Log{Log: v} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) - } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) - if err != nil { - return err - } - if oneof, ok := m.Body.(*HostEvent_Failed); ok { - if err := oneof.Failed.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &ModFailed{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Failed{Failed: v} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Joined", wireType) - } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) - if err != nil { - return err - } - if oneof, ok := m.Body.(*HostEvent_Joined); ok { - if err := oneof.Joined.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &PlayerJoined{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Joined{Joined: v} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ready", wireType) - } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) - if err != nil { - return err - } - if oneof, ok := m.Body.(*HostEvent_Ready); ok { - if err := oneof.Ready.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &ServerReady{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Ready{Ready: v} - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ui", wireType) - } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) - if err != nil { - return err - } - if oneof, ok := m.Body.(*HostEvent_Ui); ok { - if err := oneof.Ui.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &UiChanged{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Ui{Ui: v} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Left", wireType) - } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) - if err != nil { - return err - } - if oneof, ok := m.Body.(*HostEvent_Left); ok { - if err := oneof.Left.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &PlayerLeft{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Left{Left: v} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) - if err != nil { - return err - } - if oneof, ok := m.Body.(*HostEvent_Message); ok { - if err := oneof.Message.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &PlayerMessage{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Message{Message: v} - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chat", wireType) - } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) - if err != nil { - return err - } - if oneof, ok := m.Body.(*HostEvent_Chat); ok { - if err := oneof.Chat.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &PlayerChat{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Chat{Chat: v} - } - iNdEx = postIndex - case 10: + return fmt.Errorf("proto: ModFailed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Calls", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - if oneof, ok := m.Body.(*HostEvent_Calls); ok { - if err := oneof.Calls.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &ModCalls{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Calls{Calls: v} - } - iNdEx = postIndex - case 11: + m.Mod = v + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlowFrame", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - if oneof, ok := m.Body.(*HostEvent_SlowFrame); ok { - if err := oneof.SlowFrame.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &ModSlowFrame{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_SlowFrame{SlowFrame: v} + m.Error = v + default: + iNdEx = preIndex + skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) + if err != nil { + return err } - iNdEx = postIndex - case 12: + 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 *ModCalls) 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: ModCalls: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModCalls: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceApplied", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - if oneof, ok := m.Body.(*HostEvent_ServiceApplied); ok { - if err := oneof.ServiceApplied.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &ServiceResult{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_ServiceApplied{ServiceApplied: v} - } - iNdEx = postIndex - case 13: + m.Mod = v + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Called", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Profile", wireType) } msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) if err != nil { return err } - if oneof, ok := m.Body.(*HostEvent_Called); ok { - if err := oneof.Called.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - } else { - v := &ModCallResult{} - if err := v.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - m.Body = &HostEvent_Called{Called: v} + if m.Profile == nil { + m.Profile = &profile.CallProfile{} + } + if err := m.Profile.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + return err } iNdEx = postIndex default: @@ -6349,7 +8208,7 @@ func (m *HostEvent) UnmarshalVT(dAtA []byte) error { return nil } -func (m *PlayerChat) UnmarshalVT(dAtA []byte) error { +func (m *ModSlowFrame) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6363,41 +8222,37 @@ func (m *PlayerChat) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PlayerChat: wiretype end group for non-group") + return fmt.Errorf("proto: ModSlowFrame: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PlayerChat: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ModSlowFrame: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) } - m.Slot = 0 - m.Slot, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } + m.Mod = v case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Report", wireType) } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) if err != nil { return err } - m.Name = v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + if m.Report == nil { + m.Report = &profile.SlowFrame{} } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) - if err != nil { + if err := m.Report.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } - m.Text = v + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -6421,7 +8276,7 @@ func (m *PlayerChat) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ModStarted) UnmarshalVT(dAtA []byte) error { +func (m *PlayerJoined) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6435,32 +8290,42 @@ func (m *ModStarted) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ModStarted: wiretype end group for non-group") + return fmt.Errorf("proto: PlayerJoined: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ModStarted: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PlayerJoined: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) + } + m.Slot = 0 + m.Slot, 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 Mod", wireType) + 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.Mod = v - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Reloaded", wireType) + m.Name = v + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field SteamId", wireType) } - var v bool - v, iNdEx, err = protobuf_go_lite.DecodeVarintBool(dAtA, iNdEx) + m.SteamId = 0 + var _v64 uint64 + _v64, iNdEx, err = protobuf_go_lite.DecodeFixed64(dAtA, iNdEx) if err != nil { return err } - m.Reloaded = bool(v) + m.SteamId = uint64(_v64) default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -6484,7 +8349,7 @@ func (m *ModStarted) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ModLog) UnmarshalVT(dAtA []byte) error { +func (m *PlayerLeft) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6498,32 +8363,21 @@ func (m *ModLog) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ModLog: wiretype end group for non-group") + return fmt.Errorf("proto: PlayerLeft: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ModLog: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PlayerLeft: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) - } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) - if err != nil { - return err - } - m.Mod = v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + m.Slot = 0 + m.Slot, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) if err != nil { return err } - m.Text = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -6547,7 +8401,7 @@ func (m *ModLog) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ModFailed) UnmarshalVT(dAtA []byte) error { +func (m *PlayerMessage) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6561,10 +8415,10 @@ func (m *ModFailed) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ModFailed: wiretype end group for non-group") + return fmt.Errorf("proto: PlayerMessage: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ModFailed: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PlayerMessage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6578,15 +8432,45 @@ func (m *ModFailed) UnmarshalVT(dAtA []byte) error { } m.Mod = v case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) + } + m.Slot = 0 + m.Slot, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + if err != nil { + return err + } + case 3: + 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 = MessageKind(_v) + if err != nil { + return err + } + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } var v string v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - m.Error = v + m.Title = v + case 5: + 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.Text = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -6610,7 +8494,7 @@ func (m *ModFailed) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ModCalls) UnmarshalVT(dAtA []byte) error { +func (m *ServerReady) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6624,37 +8508,22 @@ func (m *ModCalls) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ModCalls: wiretype end group for non-group") + return fmt.Errorf("proto: ServerReady: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ModCalls: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ServerReady: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Map", wireType) } var v string v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - m.Mod = v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Profile", wireType) - } - msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) - if err != nil { - return err - } - if m.Profile == nil { - m.Profile = &profile.CallProfile{} - } - if err := m.Profile.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { - return err - } - iNdEx = postIndex + m.Map = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -6678,7 +8547,7 @@ func (m *ModCalls) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ModSlowFrame) UnmarshalVT(dAtA []byte) error { +func (m *UiChanged) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6692,10 +8561,10 @@ func (m *ModSlowFrame) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ModSlowFrame: wiretype end group for non-group") + return fmt.Errorf("proto: UiChanged: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ModSlowFrame: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UiChanged: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6709,17 +8578,26 @@ func (m *ModSlowFrame) UnmarshalVT(dAtA []byte) error { } m.Mod = v case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) + } + m.Slot = 0 + m.Slot, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + if err != nil { + return err + } + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Report", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Change", wireType) } msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) if err != nil { return err } - if m.Report == nil { - m.Report = &profile.SlowFrame{} + if m.Change == nil { + m.Change = &ui.Change{} } - if err := m.Report.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + if err := m.Change.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } iNdEx = postIndex @@ -6746,7 +8624,7 @@ func (m *ModSlowFrame) UnmarshalVT(dAtA []byte) error { return nil } -func (m *PlayerJoined) UnmarshalVT(dAtA []byte) error { +func (m *ServiceReply) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6760,42 +8638,70 @@ func (m *PlayerJoined) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PlayerJoined: wiretype end group for non-group") + return fmt.Errorf("proto: ServiceReply: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PlayerJoined: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ServiceReply: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) } - m.Slot = 0 - m.Slot, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } + m.Mod = v case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) } var v string v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - m.Name = v + m.Service = v case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field SteamId", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) } - m.SteamId = 0 - var _v64 uint64 - _v64, iNdEx, err = protobuf_go_lite.DecodeFixed64(dAtA, iNdEx) + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - m.SteamId = uint64(_v64) + m.Method = v + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, dAtA, iNdEx) + if err != nil { + return err + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Path = v + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Id = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -6819,7 +8725,7 @@ func (m *PlayerJoined) UnmarshalVT(dAtA []byte) error { return nil } -func (m *PlayerLeft) UnmarshalVT(dAtA []byte) error { +func (m *ServiceResult) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6833,21 +8739,32 @@ func (m *PlayerLeft) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PlayerLeft: wiretype end group for non-group") + return fmt.Errorf("proto: ServiceResult: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PlayerLeft: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ServiceResult: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - m.Slot = 0 - m.Slot, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Id = v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } + m.Error = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -6871,7 +8788,7 @@ func (m *PlayerLeft) UnmarshalVT(dAtA []byte) error { return nil } -func (m *PlayerMessage) UnmarshalVT(dAtA []byte) error { +func (m *Fixture) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6885,10 +8802,10 @@ func (m *PlayerMessage) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PlayerMessage: wiretype end group for non-group") + return fmt.Errorf("proto: Fixture: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PlayerMessage: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Fixture: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -6902,45 +8819,43 @@ func (m *PlayerMessage) UnmarshalVT(dAtA []byte) error { } m.Mod = v case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) } - m.Slot = 0 - m.Slot, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } + m.Service = v case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) } - m.Kind = 0 - var _v uint64 - _v, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) - m.Kind = MessageKind(_v) + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } + m.Method = v case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, dAtA, iNdEx) if err != nil { return err } - m.Title = v case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Text", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) } var v string v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - m.Text = v + m.Source = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -6964,7 +8879,7 @@ func (m *PlayerMessage) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ServerReady) UnmarshalVT(dAtA []byte) error { +func (m *Forward) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -6978,22 +8893,42 @@ func (m *ServerReady) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ServerReady: wiretype end group for non-group") + return fmt.Errorf("proto: Forward: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ServerReady: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Forward: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Map", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) } var v string v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) if err != nil { return err } - m.Map = v + m.Mod = v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Service = v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Target = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -7017,7 +8952,7 @@ func (m *ServerReady) UnmarshalVT(dAtA []byte) error { return nil } -func (m *UiChanged) UnmarshalVT(dAtA []byte) error { +func (m *Fixtures) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -7031,43 +8966,35 @@ func (m *UiChanged) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: UiChanged: wiretype end group for non-group") + return fmt.Errorf("proto: Fixtures: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: UiChanged: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Fixtures: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mod", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Fixtures", wireType) } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) if err != nil { return err } - m.Mod = v - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Slot", wireType) - } - m.Slot = 0 - m.Slot, iNdEx, err = protobuf_go_lite.DecodeVarintInt32(dAtA, iNdEx) - if err != nil { + m.Fixtures = append(m.Fixtures, &Fixture{}) + if err := m.Fixtures[len(m.Fixtures)-1].UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } - case 3: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Change", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Forwards", wireType) } msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) if err != nil { return err } - if m.Change == nil { - m.Change = &ui.Change{} - } - if err := m.Change.UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { + m.Forwards = append(m.Forwards, &Forward{}) + if err := m.Forwards[len(m.Forwards)-1].UnmarshalVT(dAtA[msgStart:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7094,7 +9021,7 @@ func (m *UiChanged) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ServiceReply) UnmarshalVT(dAtA []byte) error { +func (m *ServiceCall) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -7108,13 +9035,22 @@ func (m *ServiceReply) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ServiceReply: wiretype end group for non-group") + return fmt.Errorf("proto: ServiceCall: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceReply: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ServiceCall: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + m.Id, 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 Mod", wireType) } @@ -7124,7 +9060,7 @@ func (m *ServiceReply) UnmarshalVT(dAtA []byte) error { return err } m.Mod = v - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) } @@ -7134,7 +9070,7 @@ func (m *ServiceReply) UnmarshalVT(dAtA []byte) error { return err } m.Service = v - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) } @@ -7144,7 +9080,7 @@ func (m *ServiceReply) UnmarshalVT(dAtA []byte) error { return err } m.Method = v - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) } @@ -7152,26 +9088,6 @@ func (m *ServiceReply) UnmarshalVT(dAtA []byte) error { if err != nil { return err } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) - } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) - if err != nil { - return err - } - m.Path = v - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) - if err != nil { - return err - } - m.Id = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) @@ -7195,7 +9111,7 @@ func (m *ServiceReply) UnmarshalVT(dAtA []byte) error { return nil } -func (m *ServiceResult) UnmarshalVT(dAtA []byte) error { +func (m *ServiceAnswer) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 var err error @@ -7209,23 +9125,30 @@ func (m *ServiceResult) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ServiceResult: wiretype end group for non-group") + return fmt.Errorf("proto: ServiceAnswer: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceResult: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ServiceAnswer: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var v string - v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + m.Id = 0 + m.Id, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) if err != nil { return err } - m.Id = v case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, dAtA, iNdEx) + if err != nil { + return err + } + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } diff --git a/src/host_app/control/control.pb.h b/src/host_app/control/control.pb.h index e34b1da7..9313b5ea 100644 --- a/src/host_app/control/control.pb.h +++ b/src/host_app/control/control.pb.h @@ -67,6 +67,18 @@ class ControlRequest; struct ControlRequestDefaultTypeInternal; extern ControlRequestDefaultTypeInternal _ControlRequest_default_instance_; extern const ::google::protobuf::internal::ClassDataFull ControlRequest_class_data_; +class Fixture; +struct FixtureDefaultTypeInternal; +extern FixtureDefaultTypeInternal _Fixture_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull Fixture_class_data_; +class Fixtures; +struct FixturesDefaultTypeInternal; +extern FixturesDefaultTypeInternal _Fixtures_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull Fixtures_class_data_; +class Forward; +struct ForwardDefaultTypeInternal; +extern ForwardDefaultTypeInternal _Forward_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull Forward_class_data_; class HostEvent; struct HostEventDefaultTypeInternal; extern HostEventDefaultTypeInternal _HostEvent_default_instance_; @@ -123,6 +135,14 @@ class ServerReady; struct ServerReadyDefaultTypeInternal; extern ServerReadyDefaultTypeInternal _ServerReady_default_instance_; extern const ::google::protobuf::internal::ClassDataFull ServerReady_class_data_; +class ServiceAnswer; +struct ServiceAnswerDefaultTypeInternal; +extern ServiceAnswerDefaultTypeInternal _ServiceAnswer_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull ServiceAnswer_class_data_; +class ServiceCall; +struct ServiceCallDefaultTypeInternal; +extern ServiceCallDefaultTypeInternal _ServiceCall_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull ServiceCall_class_data_; class ServiceReply; struct ServiceReplyDefaultTypeInternal; extern ServiceReplyDefaultTypeInternal _ServiceReply_default_instance_; @@ -684,30 +704,30 @@ class ServiceReply final : public ::google::protobuf::Message extern const ::google::protobuf::internal::ClassDataFull ServiceReply_class_data_; // ------------------------------------------------------------------- -class ServerReady final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ServerReady) */ { +class ServiceCall final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ServiceCall) */ { public: - inline ServerReady() : ServerReady(nullptr) {} - ~ServerReady() PROTOBUF_FINAL; + inline ServiceCall() : ServiceCall(nullptr) {} + ~ServiceCall() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ServerReady* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(ServiceCall* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ServerReady)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ServiceCall)); } #endif template - explicit PROTOBUF_CONSTEXPR ServerReady(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ServiceCall(::google::protobuf::internal::ConstantInitialized); - inline ServerReady(const ServerReady& from) : ServerReady(nullptr, from) {} - inline ServerReady(ServerReady&& from) noexcept - : ServerReady(nullptr, ::std::move(from)) {} - inline ServerReady& operator=(const ServerReady& from) { + inline ServiceCall(const ServiceCall& from) : ServiceCall(nullptr, from) {} + inline ServiceCall(ServiceCall&& from) noexcept + : ServiceCall(nullptr, ::std::move(from)) {} + inline ServiceCall& operator=(const ServiceCall& from) { CopyFrom(from); return *this; } - inline ServerReady& operator=(ServerReady&& from) noexcept { + inline ServiceCall& operator=(ServiceCall&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -735,13 +755,13 @@ class ServerReady final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ServerReady& default_instance() { - return *reinterpret_cast( - &_ServerReady_default_instance_); + static const ServiceCall& default_instance() { + return *reinterpret_cast( + &_ServiceCall_default_instance_); } - static constexpr int kIndexInFileMessages = 14; - friend void swap(ServerReady& a, ServerReady& b) { a.Swap(&b); } - inline void Swap(ServerReady* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 21; + friend void swap(ServiceCall& a, ServiceCall& b) { a.Swap(&b); } + inline void Swap(ServiceCall* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -749,7 +769,7 @@ class ServerReady final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ServerReady* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ServiceCall* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -757,13 +777,13 @@ class ServerReady final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ServerReady* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ServiceCall* 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 ServerReady& from); + void CopyFrom(const ServiceCall& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ServerReady& from) { ServerReady::MergeImpl(*this, from); } + void MergeFrom(const ServiceCall& from) { ServiceCall::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -799,17 +819,17 @@ class ServerReady final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ServerReady* PROTOBUF_NONNULL other); + void InternalSwap(ServiceCall* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ServerReady"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ServiceCall"; } - explicit ServerReady(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ServerReady(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ServerReady& from); - ServerReady( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ServerReady&& from) noexcept - : ServerReady(arena) { + explicit ServiceCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ServiceCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ServiceCall& from); + ServiceCall( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ServiceCall&& from) noexcept + : ServiceCall(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -826,29 +846,88 @@ class ServerReady final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kMapFieldNumber = 1, + kModFieldNumber = 2, + kServiceFieldNumber = 3, + kMethodFieldNumber = 4, + kPayloadFieldNumber = 5, + kIdFieldNumber = 1, }; - // string map = 1; - void clear_map() ; - const ::std::string& map() const; + // string mod = 2; + void clear_mod() ; + const ::std::string& mod() const; template - void set_map(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_map(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_map(); - void set_allocated_map(::std::string* PROTOBUF_NULLABLE value); + void set_mod(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_mod(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_mod(); + void set_allocated_mod(::std::string* PROTOBUF_NULLABLE value); private: - const ::std::string& _internal_map() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_map(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_map(); + const ::std::string& _internal_mod() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_mod(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.ServerReady) + // string service = 3; + void clear_service() ; + const ::std::string& service() const; + template + void set_service(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_service(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_service(); + void set_allocated_service(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_service() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_service(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_service(); + + public: + // string method = 4; + void clear_method() ; + const ::std::string& method() const; + template + void set_method(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_method(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_method(); + void set_allocated_method(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_method() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_method(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_method(); + + public: + // bytes payload = 5; + void clear_payload() ; + const ::std::string& payload() const; + template + void set_payload(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_payload(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_payload(); + void set_allocated_payload(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_payload() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_payload(); + + public: + // uint64 id = 1; + void clear_id() ; + ::uint64_t id() const; + void set_id(::uint64_t value); + + private: + ::uint64_t _internal_id() const; + void _internal_set_id(::uint64_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ServiceCall) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 1, - 0, 48, + static const ::google::protobuf::internal::TcParseTable<3, 5, + 0, 61, 2> _table_; @@ -866,43 +945,47 @@ class ServerReady final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ServerReady& from_msg); + const ServiceCall& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr map_; + ::google::protobuf::internal::ArenaStringPtr mod_; + ::google::protobuf::internal::ArenaStringPtr service_; + ::google::protobuf::internal::ArenaStringPtr method_; + ::google::protobuf::internal::ArenaStringPtr payload_; + ::uint64_t id_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull ServerReady_class_data_; +extern const ::google::protobuf::internal::ClassDataFull ServiceCall_class_data_; // ------------------------------------------------------------------- -class ReloadRequest final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ReloadRequest) */ { +class ServiceAnswer final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ServiceAnswer) */ { public: - inline ReloadRequest() : ReloadRequest(nullptr) {} - ~ReloadRequest() PROTOBUF_FINAL; + inline ServiceAnswer() : ServiceAnswer(nullptr) {} + ~ServiceAnswer() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ReloadRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(ServiceAnswer* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ReloadRequest)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ServiceAnswer)); } #endif template - explicit PROTOBUF_CONSTEXPR ReloadRequest(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ServiceAnswer(::google::protobuf::internal::ConstantInitialized); - inline ReloadRequest(const ReloadRequest& from) : ReloadRequest(nullptr, from) {} - inline ReloadRequest(ReloadRequest&& from) noexcept - : ReloadRequest(nullptr, ::std::move(from)) {} - inline ReloadRequest& operator=(const ReloadRequest& from) { + inline ServiceAnswer(const ServiceAnswer& from) : ServiceAnswer(nullptr, from) {} + inline ServiceAnswer(ServiceAnswer&& from) noexcept + : ServiceAnswer(nullptr, ::std::move(from)) {} + inline ServiceAnswer& operator=(const ServiceAnswer& from) { CopyFrom(from); return *this; } - inline ReloadRequest& operator=(ReloadRequest&& from) noexcept { + inline ServiceAnswer& operator=(ServiceAnswer&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -930,13 +1013,13 @@ class ReloadRequest final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ReloadRequest& default_instance() { - return *reinterpret_cast( - &_ReloadRequest_default_instance_); + static const ServiceAnswer& default_instance() { + return *reinterpret_cast( + &_ServiceAnswer_default_instance_); } - static constexpr int kIndexInFileMessages = 3; - friend void swap(ReloadRequest& a, ReloadRequest& b) { a.Swap(&b); } - inline void Swap(ReloadRequest* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 22; + friend void swap(ServiceAnswer& a, ServiceAnswer& b) { a.Swap(&b); } + inline void Swap(ServiceAnswer* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -944,7 +1027,7 @@ class ReloadRequest final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ReloadRequest* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ServiceAnswer* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -952,13 +1035,13 @@ class ReloadRequest final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ReloadRequest* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ServiceAnswer* 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 ReloadRequest& from); + void CopyFrom(const ServiceAnswer& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ReloadRequest& from) { ReloadRequest::MergeImpl(*this, from); } + void MergeFrom(const ServiceAnswer& from) { ServiceAnswer::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -994,17 +1077,17 @@ class ReloadRequest final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ReloadRequest* PROTOBUF_NONNULL other); + void InternalSwap(ServiceAnswer* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ReloadRequest"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ServiceAnswer"; } - explicit ReloadRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ReloadRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ReloadRequest& from); - ReloadRequest( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ReloadRequest&& from) noexcept - : ReloadRequest(arena) { + explicit ServiceAnswer(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ServiceAnswer(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ServiceAnswer& from); + ServiceAnswer( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ServiceAnswer&& from) noexcept + : ServiceAnswer(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -1021,29 +1104,56 @@ class ReloadRequest final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kPathFieldNumber = 1, + kPayloadFieldNumber = 2, + kErrorFieldNumber = 3, + kIdFieldNumber = 1, }; - // string path = 1; - void clear_path() ; - const ::std::string& path() const; + // bytes payload = 2; + void clear_payload() ; + const ::std::string& payload() const; template - void set_path(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_path(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_path(); - void set_allocated_path(::std::string* PROTOBUF_NULLABLE value); + void set_payload(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_payload(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_payload(); + void set_allocated_payload(::std::string* PROTOBUF_NULLABLE value); private: - const ::std::string& _internal_path() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_path(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_path(); + const ::std::string& _internal_payload() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_payload(); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.ReloadRequest) + // string error = 3; + void clear_error() ; + const ::std::string& error() const; + template + void set_error(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_error(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_error(); + void set_allocated_error(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_error() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_error(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_error(); + + public: + // uint64 id = 1; + void clear_id() ; + ::uint64_t id() const; + void set_id(::uint64_t value); + + private: + ::uint64_t _internal_id() const; + void _internal_set_id(::uint64_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ServiceAnswer) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 1, - 0, 51, + static const ::google::protobuf::internal::TcParseTable<2, 3, + 0, 52, 2> _table_; @@ -1061,43 +1171,45 @@ class ReloadRequest final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ReloadRequest& from_msg); + const ServiceAnswer& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr path_; + ::google::protobuf::internal::ArenaStringPtr payload_; + ::google::protobuf::internal::ArenaStringPtr error_; + ::uint64_t id_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull ReloadRequest_class_data_; +extern const ::google::protobuf::internal::ClassDataFull ServiceAnswer_class_data_; // ------------------------------------------------------------------- -class PlayerMessage final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.PlayerMessage) */ { +class ServerReady final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ServerReady) */ { public: - inline PlayerMessage() : PlayerMessage(nullptr) {} - ~PlayerMessage() PROTOBUF_FINAL; + inline ServerReady() : ServerReady(nullptr) {} + ~ServerReady() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(PlayerMessage* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(ServerReady* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(PlayerMessage)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ServerReady)); } #endif template - explicit PROTOBUF_CONSTEXPR PlayerMessage(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ServerReady(::google::protobuf::internal::ConstantInitialized); - inline PlayerMessage(const PlayerMessage& from) : PlayerMessage(nullptr, from) {} - inline PlayerMessage(PlayerMessage&& from) noexcept - : PlayerMessage(nullptr, ::std::move(from)) {} - inline PlayerMessage& operator=(const PlayerMessage& from) { + inline ServerReady(const ServerReady& from) : ServerReady(nullptr, from) {} + inline ServerReady(ServerReady&& from) noexcept + : ServerReady(nullptr, ::std::move(from)) {} + inline ServerReady& operator=(const ServerReady& from) { CopyFrom(from); return *this; } - inline PlayerMessage& operator=(PlayerMessage&& from) noexcept { + inline ServerReady& operator=(ServerReady&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -1125,13 +1237,13 @@ class PlayerMessage final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const PlayerMessage& default_instance() { - return *reinterpret_cast( - &_PlayerMessage_default_instance_); + static const ServerReady& default_instance() { + return *reinterpret_cast( + &_ServerReady_default_instance_); } - static constexpr int kIndexInFileMessages = 13; - friend void swap(PlayerMessage& a, PlayerMessage& b) { a.Swap(&b); } - inline void Swap(PlayerMessage* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 14; + friend void swap(ServerReady& a, ServerReady& b) { a.Swap(&b); } + inline void Swap(ServerReady* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -1139,7 +1251,7 @@ class PlayerMessage final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(PlayerMessage* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ServerReady* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -1147,13 +1259,13 @@ class PlayerMessage final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - PlayerMessage* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ServerReady* 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 PlayerMessage& from); + void CopyFrom(const ServerReady& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const PlayerMessage& from) { PlayerMessage::MergeImpl(*this, from); } + void MergeFrom(const ServerReady& from) { ServerReady::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -1189,17 +1301,17 @@ class PlayerMessage final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(PlayerMessage* PROTOBUF_NONNULL other); + void InternalSwap(ServerReady* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.PlayerMessage"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ServerReady"; } - explicit PlayerMessage(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - PlayerMessage(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const PlayerMessage& from); - PlayerMessage( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, PlayerMessage&& from) noexcept - : PlayerMessage(arena) { + explicit ServerReady(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ServerReady(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ServerReady& from); + ServerReady( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ServerReady&& from) noexcept + : ServerReady(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -1216,83 +1328,29 @@ class PlayerMessage final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kModFieldNumber = 1, - kTitleFieldNumber = 4, - kTextFieldNumber = 5, - kSlotFieldNumber = 2, - kKindFieldNumber = 3, + kMapFieldNumber = 1, }; - // string mod = 1; - void clear_mod() ; - const ::std::string& mod() const; - template - void set_mod(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_mod(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_mod(); - void set_allocated_mod(::std::string* PROTOBUF_NULLABLE value); - - private: - const ::std::string& _internal_mod() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_mod(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); - - public: - // string title = 4; - void clear_title() ; - const ::std::string& title() const; - template - void set_title(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_title(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_title(); - void set_allocated_title(::std::string* PROTOBUF_NULLABLE value); - - private: - const ::std::string& _internal_title() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_title(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_title(); - - public: - // string text = 5; - void clear_text() ; - const ::std::string& text() const; + // string map = 1; + void clear_map() ; + const ::std::string& map() 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: - // int32 slot = 2; - void clear_slot() ; - ::int32_t slot() const; - void set_slot(::int32_t value); - - private: - ::int32_t _internal_slot() const; - void _internal_set_slot(::int32_t value); - - public: - // .modlock.host_app.control.MessageKind kind = 3; - void clear_kind() ; - ::modlock::host_app::control::MessageKind kind() const; - void set_kind(::modlock::host_app::control::MessageKind value); + void set_map(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_map(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_map(); + void set_allocated_map(::std::string* PROTOBUF_NULLABLE value); private: - ::modlock::host_app::control::MessageKind _internal_kind() const; - void _internal_set_kind(::modlock::host_app::control::MessageKind value); + const ::std::string& _internal_map() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_map(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_map(); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.PlayerMessage) + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ServerReady) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, - 0, 59, + static const ::google::protobuf::internal::TcParseTable<0, 1, + 0, 48, 2> _table_; @@ -1310,47 +1368,43 @@ class PlayerMessage final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const PlayerMessage& from_msg); + const ServerReady& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr mod_; - ::google::protobuf::internal::ArenaStringPtr title_; - ::google::protobuf::internal::ArenaStringPtr text_; - ::int32_t slot_; - int kind_; + ::google::protobuf::internal::ArenaStringPtr map_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull PlayerMessage_class_data_; +extern const ::google::protobuf::internal::ClassDataFull ServerReady_class_data_; // ------------------------------------------------------------------- -class PlayerLeft final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.PlayerLeft) */ { +class ReloadRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ReloadRequest) */ { public: - inline PlayerLeft() : PlayerLeft(nullptr) {} - ~PlayerLeft() PROTOBUF_FINAL; + inline ReloadRequest() : ReloadRequest(nullptr) {} + ~ReloadRequest() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(PlayerLeft* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(ReloadRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(PlayerLeft)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ReloadRequest)); } #endif template - explicit PROTOBUF_CONSTEXPR PlayerLeft(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ReloadRequest(::google::protobuf::internal::ConstantInitialized); - inline PlayerLeft(const PlayerLeft& from) : PlayerLeft(nullptr, from) {} - inline PlayerLeft(PlayerLeft&& from) noexcept - : PlayerLeft(nullptr, ::std::move(from)) {} - inline PlayerLeft& operator=(const PlayerLeft& from) { + inline ReloadRequest(const ReloadRequest& from) : ReloadRequest(nullptr, from) {} + inline ReloadRequest(ReloadRequest&& from) noexcept + : ReloadRequest(nullptr, ::std::move(from)) {} + inline ReloadRequest& operator=(const ReloadRequest& from) { CopyFrom(from); return *this; } - inline PlayerLeft& operator=(PlayerLeft&& from) noexcept { + inline ReloadRequest& operator=(ReloadRequest&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -1378,13 +1432,13 @@ class PlayerLeft final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const PlayerLeft& default_instance() { - return *reinterpret_cast( - &_PlayerLeft_default_instance_); + static const ReloadRequest& default_instance() { + return *reinterpret_cast( + &_ReloadRequest_default_instance_); } - static constexpr int kIndexInFileMessages = 12; - friend void swap(PlayerLeft& a, PlayerLeft& b) { a.Swap(&b); } - inline void Swap(PlayerLeft* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 3; + friend void swap(ReloadRequest& a, ReloadRequest& b) { a.Swap(&b); } + inline void Swap(ReloadRequest* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -1392,7 +1446,7 @@ class PlayerLeft final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(PlayerLeft* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ReloadRequest* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -1400,13 +1454,13 @@ class PlayerLeft final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - PlayerLeft* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ReloadRequest* 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 PlayerLeft& from); + void CopyFrom(const ReloadRequest& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const PlayerLeft& from) { PlayerLeft::MergeImpl(*this, from); } + void MergeFrom(const ReloadRequest& from) { ReloadRequest::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -1442,17 +1496,17 @@ class PlayerLeft final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(PlayerLeft* PROTOBUF_NONNULL other); + void InternalSwap(ReloadRequest* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.PlayerLeft"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ReloadRequest"; } - explicit PlayerLeft(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - PlayerLeft(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const PlayerLeft& from); - PlayerLeft( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, PlayerLeft&& from) noexcept - : PlayerLeft(arena) { + explicit ReloadRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ReloadRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ReloadRequest& from); + ReloadRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ReloadRequest&& from) noexcept + : ReloadRequest(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -1469,24 +1523,29 @@ class PlayerLeft final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kSlotFieldNumber = 1, + kPathFieldNumber = 1, }; - // int32 slot = 1; - void clear_slot() ; - ::int32_t slot() const; - void set_slot(::int32_t value); + // string path = 1; + void clear_path() ; + const ::std::string& path() const; + template + void set_path(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_path(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_path(); + void set_allocated_path(::std::string* PROTOBUF_NULLABLE value); private: - ::int32_t _internal_slot() const; - void _internal_set_slot(::int32_t value); + const ::std::string& _internal_path() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_path(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_path(); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.PlayerLeft) + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ReloadRequest) private: class _Internal; friend class ::google::protobuf::internal::TcParser; static const ::google::protobuf::internal::TcParseTable<0, 1, - 0, 0, + 0, 51, 2> _table_; @@ -1504,43 +1563,43 @@ class PlayerLeft final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const PlayerLeft& from_msg); + const ReloadRequest& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::int32_t slot_; + ::google::protobuf::internal::ArenaStringPtr path_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull PlayerLeft_class_data_; +extern const ::google::protobuf::internal::ClassDataFull ReloadRequest_class_data_; // ------------------------------------------------------------------- -class PlayerJoined final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.PlayerJoined) */ { +class PlayerMessage final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.PlayerMessage) */ { public: - inline PlayerJoined() : PlayerJoined(nullptr) {} - ~PlayerJoined() PROTOBUF_FINAL; + inline PlayerMessage() : PlayerMessage(nullptr) {} + ~PlayerMessage() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(PlayerJoined* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(PlayerMessage* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(PlayerJoined)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(PlayerMessage)); } #endif template - explicit PROTOBUF_CONSTEXPR PlayerJoined(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR PlayerMessage(::google::protobuf::internal::ConstantInitialized); - inline PlayerJoined(const PlayerJoined& from) : PlayerJoined(nullptr, from) {} - inline PlayerJoined(PlayerJoined&& from) noexcept - : PlayerJoined(nullptr, ::std::move(from)) {} - inline PlayerJoined& operator=(const PlayerJoined& from) { + inline PlayerMessage(const PlayerMessage& from) : PlayerMessage(nullptr, from) {} + inline PlayerMessage(PlayerMessage&& from) noexcept + : PlayerMessage(nullptr, ::std::move(from)) {} + inline PlayerMessage& operator=(const PlayerMessage& from) { CopyFrom(from); return *this; } - inline PlayerJoined& operator=(PlayerJoined&& from) noexcept { + inline PlayerMessage& operator=(PlayerMessage&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -1568,13 +1627,13 @@ class PlayerJoined final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const PlayerJoined& default_instance() { - return *reinterpret_cast( - &_PlayerJoined_default_instance_); + static const PlayerMessage& default_instance() { + return *reinterpret_cast( + &_PlayerMessage_default_instance_); } - static constexpr int kIndexInFileMessages = 11; - friend void swap(PlayerJoined& a, PlayerJoined& b) { a.Swap(&b); } - inline void Swap(PlayerJoined* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 13; + friend void swap(PlayerMessage& a, PlayerMessage& b) { a.Swap(&b); } + inline void Swap(PlayerMessage* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -1582,7 +1641,7 @@ class PlayerJoined final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(PlayerJoined* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(PlayerMessage* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -1590,13 +1649,13 @@ class PlayerJoined final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - PlayerJoined* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + PlayerMessage* 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 PlayerJoined& from); + void CopyFrom(const PlayerMessage& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const PlayerJoined& from) { PlayerJoined::MergeImpl(*this, from); } + void MergeFrom(const PlayerMessage& from) { PlayerMessage::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -1632,17 +1691,17 @@ class PlayerJoined final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(PlayerJoined* PROTOBUF_NONNULL other); + void InternalSwap(PlayerMessage* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.PlayerJoined"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.PlayerMessage"; } - explicit PlayerJoined(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - PlayerJoined(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const PlayerJoined& from); - PlayerJoined( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, PlayerJoined&& from) noexcept - : PlayerJoined(arena) { + explicit PlayerMessage(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + PlayerMessage(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const PlayerMessage& from); + PlayerMessage( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, PlayerMessage&& from) noexcept + : PlayerMessage(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -1659,36 +1718,58 @@ class PlayerJoined final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kNameFieldNumber = 2, - kSteamIdFieldNumber = 3, - kSlotFieldNumber = 1, + kModFieldNumber = 1, + kTitleFieldNumber = 4, + kTextFieldNumber = 5, + kSlotFieldNumber = 2, + kKindFieldNumber = 3, }; - // string name = 2; - void clear_name() ; - const ::std::string& name() const; + // string mod = 1; + void clear_mod() ; + const ::std::string& mod() 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); - + void set_mod(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_mod(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_mod(); + void set_allocated_mod(::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(); + const ::std::string& _internal_mod() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_mod(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); public: - // fixed64 steam_id = 3; - void clear_steam_id() ; - ::uint64_t steam_id() const; - void set_steam_id(::uint64_t value); + // string title = 4; + void clear_title() ; + const ::std::string& title() const; + template + void set_title(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_title(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_title(); + void set_allocated_title(::std::string* PROTOBUF_NULLABLE value); private: - ::uint64_t _internal_steam_id() const; - void _internal_set_steam_id(::uint64_t value); + const ::std::string& _internal_title() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_title(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_title(); public: - // int32 slot = 1; + // string text = 5; + 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: + // int32 slot = 2; void clear_slot() ; ::int32_t slot() const; void set_slot(::int32_t value); @@ -1698,12 +1779,22 @@ class PlayerJoined final : public ::google::protobuf::Message void _internal_set_slot(::int32_t value); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.PlayerJoined) + // .modlock.host_app.control.MessageKind kind = 3; + void clear_kind() ; + ::modlock::host_app::control::MessageKind kind() const; + void set_kind(::modlock::host_app::control::MessageKind value); + + private: + ::modlock::host_app::control::MessageKind _internal_kind() const; + void _internal_set_kind(::modlock::host_app::control::MessageKind value); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.PlayerMessage) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 3, - 0, 50, + static const ::google::protobuf::internal::TcParseTable<3, 5, + 0, 59, 2> _table_; @@ -1721,45 +1812,47 @@ class PlayerJoined final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const PlayerJoined& from_msg); + const PlayerMessage& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr name_; - ::uint64_t steam_id_; + ::google::protobuf::internal::ArenaStringPtr mod_; + ::google::protobuf::internal::ArenaStringPtr title_; + ::google::protobuf::internal::ArenaStringPtr text_; ::int32_t slot_; + int kind_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull PlayerJoined_class_data_; +extern const ::google::protobuf::internal::ClassDataFull PlayerMessage_class_data_; // ------------------------------------------------------------------- -class PlayerChat final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.PlayerChat) */ { +class PlayerLeft final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.PlayerLeft) */ { public: - inline PlayerChat() : PlayerChat(nullptr) {} - ~PlayerChat() PROTOBUF_FINAL; + inline PlayerLeft() : PlayerLeft(nullptr) {} + ~PlayerLeft() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(PlayerChat* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(PlayerLeft* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(PlayerChat)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(PlayerLeft)); } #endif template - explicit PROTOBUF_CONSTEXPR PlayerChat(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR PlayerLeft(::google::protobuf::internal::ConstantInitialized); - inline PlayerChat(const PlayerChat& from) : PlayerChat(nullptr, from) {} - inline PlayerChat(PlayerChat&& from) noexcept - : PlayerChat(nullptr, ::std::move(from)) {} - inline PlayerChat& operator=(const PlayerChat& from) { + inline PlayerLeft(const PlayerLeft& from) : PlayerLeft(nullptr, from) {} + inline PlayerLeft(PlayerLeft&& from) noexcept + : PlayerLeft(nullptr, ::std::move(from)) {} + inline PlayerLeft& operator=(const PlayerLeft& from) { CopyFrom(from); return *this; } - inline PlayerChat& operator=(PlayerChat&& from) noexcept { + inline PlayerLeft& operator=(PlayerLeft&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -1787,13 +1880,13 @@ class PlayerChat final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const PlayerChat& default_instance() { - return *reinterpret_cast( - &_PlayerChat_default_instance_); + static const PlayerLeft& default_instance() { + return *reinterpret_cast( + &_PlayerLeft_default_instance_); } - static constexpr int kIndexInFileMessages = 5; - friend void swap(PlayerChat& a, PlayerChat& b) { a.Swap(&b); } - inline void Swap(PlayerChat* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 12; + friend void swap(PlayerLeft& a, PlayerLeft& b) { a.Swap(&b); } + inline void Swap(PlayerLeft* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -1801,7 +1894,7 @@ class PlayerChat final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(PlayerChat* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(PlayerLeft* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -1809,13 +1902,13 @@ class PlayerChat final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - PlayerChat* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + PlayerLeft* 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 PlayerChat& from); + void CopyFrom(const PlayerLeft& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const PlayerChat& from) { PlayerChat::MergeImpl(*this, from); } + void MergeFrom(const PlayerLeft& from) { PlayerLeft::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -1851,17 +1944,17 @@ class PlayerChat final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(PlayerChat* PROTOBUF_NONNULL other); + void InternalSwap(PlayerLeft* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.PlayerChat"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.PlayerLeft"; } - explicit PlayerChat(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - PlayerChat(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const PlayerChat& from); - PlayerChat( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, PlayerChat&& from) noexcept - : PlayerChat(arena) { + explicit PlayerLeft(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + PlayerLeft(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const PlayerLeft& from); + PlayerLeft( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, PlayerLeft&& from) noexcept + : PlayerLeft(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -1878,40 +1971,8 @@ class PlayerChat final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kNameFieldNumber = 2, - kTextFieldNumber = 3, kSlotFieldNumber = 1, }; - // string name = 2; - 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: - // string text = 3; - 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: // int32 slot = 1; void clear_slot() ; ::int32_t slot() const; @@ -1922,12 +1983,12 @@ class PlayerChat final : public ::google::protobuf::Message void _internal_set_slot(::int32_t value); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.PlayerChat) + // @@protoc_insertion_point(class_scope:modlock.host_app.control.PlayerLeft) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 3, - 0, 52, + static const ::google::protobuf::internal::TcParseTable<0, 1, + 0, 0, 2> _table_; @@ -1945,11 +2006,9 @@ class PlayerChat final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const PlayerChat& from_msg); + const PlayerLeft& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr name_; - ::google::protobuf::internal::ArenaStringPtr text_; ::int32_t slot_; PROTOBUF_TSAN_DECLARE_MEMBER }; @@ -1957,33 +2016,33 @@ class PlayerChat final : public ::google::protobuf::Message friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull PlayerChat_class_data_; +extern const ::google::protobuf::internal::ClassDataFull PlayerLeft_class_data_; // ------------------------------------------------------------------- -class ModStarted final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModStarted) */ { +class PlayerJoined final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.PlayerJoined) */ { public: - inline ModStarted() : ModStarted(nullptr) {} - ~ModStarted() PROTOBUF_FINAL; + inline PlayerJoined() : PlayerJoined(nullptr) {} + ~PlayerJoined() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ModStarted* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(PlayerJoined* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ModStarted)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(PlayerJoined)); } #endif template - explicit PROTOBUF_CONSTEXPR ModStarted(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR PlayerJoined(::google::protobuf::internal::ConstantInitialized); - inline ModStarted(const ModStarted& from) : ModStarted(nullptr, from) {} - inline ModStarted(ModStarted&& from) noexcept - : ModStarted(nullptr, ::std::move(from)) {} - inline ModStarted& operator=(const ModStarted& from) { + inline PlayerJoined(const PlayerJoined& from) : PlayerJoined(nullptr, from) {} + inline PlayerJoined(PlayerJoined&& from) noexcept + : PlayerJoined(nullptr, ::std::move(from)) {} + inline PlayerJoined& operator=(const PlayerJoined& from) { CopyFrom(from); return *this; } - inline ModStarted& operator=(ModStarted&& from) noexcept { + inline PlayerJoined& operator=(PlayerJoined&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -2011,13 +2070,13 @@ class ModStarted final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ModStarted& default_instance() { - return *reinterpret_cast( - &_ModStarted_default_instance_); + static const PlayerJoined& default_instance() { + return *reinterpret_cast( + &_PlayerJoined_default_instance_); } - static constexpr int kIndexInFileMessages = 6; - friend void swap(ModStarted& a, ModStarted& b) { a.Swap(&b); } - inline void Swap(ModStarted* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 11; + friend void swap(PlayerJoined& a, PlayerJoined& b) { a.Swap(&b); } + inline void Swap(PlayerJoined* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -2025,7 +2084,7 @@ class ModStarted final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ModStarted* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(PlayerJoined* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -2033,13 +2092,13 @@ class ModStarted final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ModStarted* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + PlayerJoined* 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 ModStarted& from); + void CopyFrom(const PlayerJoined& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ModStarted& from) { ModStarted::MergeImpl(*this, from); } + void MergeFrom(const PlayerJoined& from) { PlayerJoined::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -2075,17 +2134,17 @@ class ModStarted final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ModStarted* PROTOBUF_NONNULL other); + void InternalSwap(PlayerJoined* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModStarted"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.PlayerJoined"; } - explicit ModStarted(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ModStarted(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModStarted& from); - ModStarted( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModStarted&& from) noexcept - : ModStarted(arena) { + explicit PlayerJoined(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + PlayerJoined(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const PlayerJoined& from); + PlayerJoined( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, PlayerJoined&& from) noexcept + : PlayerJoined(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -2102,40 +2161,51 @@ class ModStarted final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kModFieldNumber = 1, - kReloadedFieldNumber = 2, + kNameFieldNumber = 2, + kSteamIdFieldNumber = 3, + kSlotFieldNumber = 1, }; - // string mod = 1; - void clear_mod() ; - const ::std::string& mod() const; + // string name = 2; + void clear_name() ; + const ::std::string& name() const; template - void set_mod(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_mod(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_mod(); - void set_allocated_mod(::std::string* PROTOBUF_NULLABLE value); + 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_mod() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_mod(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); + 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: - // bool reloaded = 2; - void clear_reloaded() ; - bool reloaded() const; - void set_reloaded(bool value); + // fixed64 steam_id = 3; + void clear_steam_id() ; + ::uint64_t steam_id() const; + void set_steam_id(::uint64_t value); private: - bool _internal_reloaded() const; - void _internal_set_reloaded(bool value); + ::uint64_t _internal_steam_id() const; + void _internal_set_steam_id(::uint64_t value); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModStarted) + // int32 slot = 1; + void clear_slot() ; + ::int32_t slot() const; + void set_slot(::int32_t value); + + private: + ::int32_t _internal_slot() const; + void _internal_set_slot(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.PlayerJoined) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 2, - 0, 47, + static const ::google::protobuf::internal::TcParseTable<2, 3, + 0, 50, 2> _table_; @@ -2153,44 +2223,45 @@ class ModStarted final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ModStarted& from_msg); + const PlayerJoined& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr mod_; - bool reloaded_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::uint64_t steam_id_; + ::int32_t slot_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull ModStarted_class_data_; +extern const ::google::protobuf::internal::ClassDataFull PlayerJoined_class_data_; // ------------------------------------------------------------------- -class ModLog final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModLog) */ { +class PlayerChat final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.PlayerChat) */ { public: - inline ModLog() : ModLog(nullptr) {} - ~ModLog() PROTOBUF_FINAL; + inline PlayerChat() : PlayerChat(nullptr) {} + ~PlayerChat() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ModLog* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(PlayerChat* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ModLog)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(PlayerChat)); } #endif template - explicit PROTOBUF_CONSTEXPR ModLog(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR PlayerChat(::google::protobuf::internal::ConstantInitialized); - inline ModLog(const ModLog& from) : ModLog(nullptr, from) {} - inline ModLog(ModLog&& from) noexcept - : ModLog(nullptr, ::std::move(from)) {} - inline ModLog& operator=(const ModLog& from) { + inline PlayerChat(const PlayerChat& from) : PlayerChat(nullptr, from) {} + inline PlayerChat(PlayerChat&& from) noexcept + : PlayerChat(nullptr, ::std::move(from)) {} + inline PlayerChat& operator=(const PlayerChat& from) { CopyFrom(from); return *this; } - inline ModLog& operator=(ModLog&& from) noexcept { + inline PlayerChat& operator=(PlayerChat&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -2218,13 +2289,13 @@ class ModLog final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ModLog& default_instance() { - return *reinterpret_cast( - &_ModLog_default_instance_); + static const PlayerChat& default_instance() { + return *reinterpret_cast( + &_PlayerChat_default_instance_); } - static constexpr int kIndexInFileMessages = 7; - friend void swap(ModLog& a, ModLog& b) { a.Swap(&b); } - inline void Swap(ModLog* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 5; + friend void swap(PlayerChat& a, PlayerChat& b) { a.Swap(&b); } + inline void Swap(PlayerChat* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -2232,7 +2303,7 @@ class ModLog final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ModLog* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(PlayerChat* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -2240,13 +2311,13 @@ class ModLog final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ModLog* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + PlayerChat* 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 ModLog& from); + void CopyFrom(const PlayerChat& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ModLog& from) { ModLog::MergeImpl(*this, from); } + void MergeFrom(const PlayerChat& from) { PlayerChat::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -2282,17 +2353,17 @@ class ModLog final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ModLog* PROTOBUF_NONNULL other); + void InternalSwap(PlayerChat* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModLog"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.PlayerChat"; } - explicit ModLog(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ModLog(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModLog& from); - ModLog( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModLog&& from) noexcept - : ModLog(arena) { + explicit PlayerChat(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + PlayerChat(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const PlayerChat& from); + PlayerChat( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, PlayerChat&& from) noexcept + : PlayerChat(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -2309,25 +2380,26 @@ class ModLog final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kModFieldNumber = 1, - kTextFieldNumber = 2, + kNameFieldNumber = 2, + kTextFieldNumber = 3, + kSlotFieldNumber = 1, }; - // string mod = 1; - void clear_mod() ; - const ::std::string& mod() const; + // string name = 2; + void clear_name() ; + const ::std::string& name() const; template - void set_mod(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_mod(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_mod(); - void set_allocated_mod(::std::string* PROTOBUF_NULLABLE value); + 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_mod() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_mod(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); + 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: - // string text = 2; + // string text = 3; void clear_text() ; const ::std::string& text() const; template @@ -2342,12 +2414,22 @@ class ModLog final : public ::google::protobuf::Message ::std::string* PROTOBUF_NONNULL _internal_mutable_text(); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModLog) + // int32 slot = 1; + void clear_slot() ; + ::int32_t slot() const; + void set_slot(::int32_t value); + + private: + ::int32_t _internal_slot() const; + void _internal_set_slot(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.PlayerChat) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 2, - 0, 47, + static const ::google::protobuf::internal::TcParseTable<2, 3, + 0, 52, 2> _table_; @@ -2365,44 +2447,45 @@ class ModLog final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ModLog& from_msg); + const PlayerChat& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr mod_; + ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::internal::ArenaStringPtr text_; + ::int32_t slot_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull ModLog_class_data_; +extern const ::google::protobuf::internal::ClassDataFull PlayerChat_class_data_; // ------------------------------------------------------------------- -class ModFailed final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModFailed) */ { +class ModStarted final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModStarted) */ { public: - inline ModFailed() : ModFailed(nullptr) {} - ~ModFailed() PROTOBUF_FINAL; + inline ModStarted() : ModStarted(nullptr) {} + ~ModStarted() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ModFailed* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(ModStarted* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ModFailed)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ModStarted)); } #endif template - explicit PROTOBUF_CONSTEXPR ModFailed(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ModStarted(::google::protobuf::internal::ConstantInitialized); - inline ModFailed(const ModFailed& from) : ModFailed(nullptr, from) {} - inline ModFailed(ModFailed&& from) noexcept - : ModFailed(nullptr, ::std::move(from)) {} - inline ModFailed& operator=(const ModFailed& from) { + inline ModStarted(const ModStarted& from) : ModStarted(nullptr, from) {} + inline ModStarted(ModStarted&& from) noexcept + : ModStarted(nullptr, ::std::move(from)) {} + inline ModStarted& operator=(const ModStarted& from) { CopyFrom(from); return *this; } - inline ModFailed& operator=(ModFailed&& from) noexcept { + inline ModStarted& operator=(ModStarted&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -2430,13 +2513,13 @@ class ModFailed final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ModFailed& default_instance() { - return *reinterpret_cast( - &_ModFailed_default_instance_); + static const ModStarted& default_instance() { + return *reinterpret_cast( + &_ModStarted_default_instance_); } - static constexpr int kIndexInFileMessages = 8; - friend void swap(ModFailed& a, ModFailed& b) { a.Swap(&b); } - inline void Swap(ModFailed* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 6; + friend void swap(ModStarted& a, ModStarted& b) { a.Swap(&b); } + inline void Swap(ModStarted* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -2444,7 +2527,7 @@ class ModFailed final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ModFailed* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ModStarted* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -2452,13 +2535,13 @@ class ModFailed final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ModFailed* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ModStarted* 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 ModFailed& from); + void CopyFrom(const ModStarted& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ModFailed& from) { ModFailed::MergeImpl(*this, from); } + void MergeFrom(const ModStarted& from) { ModStarted::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -2494,17 +2577,17 @@ class ModFailed final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ModFailed* PROTOBUF_NONNULL other); + void InternalSwap(ModStarted* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModFailed"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModStarted"; } - explicit ModFailed(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ModFailed(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModFailed& from); - ModFailed( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModFailed&& from) noexcept - : ModFailed(arena) { + explicit ModStarted(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ModStarted(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModStarted& from); + ModStarted( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModStarted&& from) noexcept + : ModStarted(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -2522,7 +2605,7 @@ class ModFailed final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { kModFieldNumber = 1, - kErrorFieldNumber = 2, + kReloadedFieldNumber = 2, }; // string mod = 1; void clear_mod() ; @@ -2539,27 +2622,22 @@ class ModFailed final : public ::google::protobuf::Message ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); public: - // string error = 2; - void clear_error() ; - const ::std::string& error() const; - template - void set_error(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_error(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_error(); - void set_allocated_error(::std::string* PROTOBUF_NULLABLE value); + // bool reloaded = 2; + void clear_reloaded() ; + bool reloaded() const; + void set_reloaded(bool value); private: - const ::std::string& _internal_error() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_error(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_error(); + bool _internal_reloaded() const; + void _internal_set_reloaded(bool value); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModFailed) + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModStarted) private: class _Internal; friend class ::google::protobuf::internal::TcParser; static const ::google::protobuf::internal::TcParseTable<1, 2, - 0, 51, + 0, 47, 2> _table_; @@ -2577,44 +2655,44 @@ class ModFailed final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ModFailed& from_msg); + const ModStarted& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr mod_; - ::google::protobuf::internal::ArenaStringPtr error_; + bool reloaded_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull ModFailed_class_data_; +extern const ::google::protobuf::internal::ClassDataFull ModStarted_class_data_; // ------------------------------------------------------------------- -class ModCallResult final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModCallResult) */ { +class ModLog final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModLog) */ { public: - inline ModCallResult() : ModCallResult(nullptr) {} - ~ModCallResult() PROTOBUF_FINAL; + inline ModLog() : ModLog(nullptr) {} + ~ModLog() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ModCallResult* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(ModLog* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ModCallResult)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ModLog)); } #endif template - explicit PROTOBUF_CONSTEXPR ModCallResult(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ModLog(::google::protobuf::internal::ConstantInitialized); - inline ModCallResult(const ModCallResult& from) : ModCallResult(nullptr, from) {} - inline ModCallResult(ModCallResult&& from) noexcept - : ModCallResult(nullptr, ::std::move(from)) {} - inline ModCallResult& operator=(const ModCallResult& from) { + inline ModLog(const ModLog& from) : ModLog(nullptr, from) {} + inline ModLog(ModLog&& from) noexcept + : ModLog(nullptr, ::std::move(from)) {} + inline ModLog& operator=(const ModLog& from) { CopyFrom(from); return *this; } - inline ModCallResult& operator=(ModCallResult&& from) noexcept { + inline ModLog& operator=(ModLog&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -2642,13 +2720,13 @@ class ModCallResult final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ModCallResult& default_instance() { - return *reinterpret_cast( - &_ModCallResult_default_instance_); + static const ModLog& default_instance() { + return *reinterpret_cast( + &_ModLog_default_instance_); } - static constexpr int kIndexInFileMessages = 2; - friend void swap(ModCallResult& a, ModCallResult& b) { a.Swap(&b); } - inline void Swap(ModCallResult* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 7; + friend void swap(ModLog& a, ModLog& b) { a.Swap(&b); } + inline void Swap(ModLog* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -2656,7 +2734,7 @@ class ModCallResult final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ModCallResult* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ModLog* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -2664,13 +2742,13 @@ class ModCallResult final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ModCallResult* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ModLog* 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 ModCallResult& from); + void CopyFrom(const ModLog& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ModCallResult& from) { ModCallResult::MergeImpl(*this, from); } + void MergeFrom(const ModLog& from) { ModLog::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -2706,17 +2784,17 @@ class ModCallResult final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ModCallResult* PROTOBUF_NONNULL other); + void InternalSwap(ModLog* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModCallResult"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModLog"; } - explicit ModCallResult(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ModCallResult(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModCallResult& from); - ModCallResult( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModCallResult&& from) noexcept - : ModCallResult(arena) { + explicit ModLog(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ModLog(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModLog& from); + ModLog( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModLog&& from) noexcept + : ModLog(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -2733,27 +2811,10 @@ class ModCallResult final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kIdFieldNumber = 1, - kModFieldNumber = 2, - kPayloadFieldNumber = 3, - kErrorFieldNumber = 4, + kModFieldNumber = 1, + kTextFieldNumber = 2, }; - // string id = 1; - void clear_id() ; - const ::std::string& id() const; - template - void set_id(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_id(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_id(); - void set_allocated_id(::std::string* PROTOBUF_NULLABLE value); - - private: - const ::std::string& _internal_id() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_id(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_id(); - - public: - // string mod = 2; + // string mod = 1; void clear_mod() ; const ::std::string& mod() const; template @@ -2768,42 +2829,27 @@ class ModCallResult final : public ::google::protobuf::Message ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); public: - // bytes payload = 3; - void clear_payload() ; - const ::std::string& payload() const; - template - void set_payload(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_payload(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_payload(); - void set_allocated_payload(::std::string* PROTOBUF_NULLABLE value); - - private: - const ::std::string& _internal_payload() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_payload(); - - public: - // string error = 4; - void clear_error() ; - const ::std::string& error() const; + // string text = 2; + void clear_text() ; + const ::std::string& text() const; template - void set_error(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_error(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_error(); - void set_allocated_error(::std::string* PROTOBUF_NULLABLE value); + 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_error() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_error(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_error(); + 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: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModCallResult) + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModLog) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 4, - 0, 57, + static const ::google::protobuf::internal::TcParseTable<1, 2, + 0, 47, 2> _table_; @@ -2821,46 +2867,44 @@ class ModCallResult final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ModCallResult& from_msg); + const ModLog& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::google::protobuf::internal::ArenaStringPtr id_; ::google::protobuf::internal::ArenaStringPtr mod_; - ::google::protobuf::internal::ArenaStringPtr payload_; - ::google::protobuf::internal::ArenaStringPtr error_; + ::google::protobuf::internal::ArenaStringPtr text_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull ModCallResult_class_data_; +extern const ::google::protobuf::internal::ClassDataFull ModLog_class_data_; // ------------------------------------------------------------------- -class ModCall final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModCall) */ { +class ModFailed final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModFailed) */ { public: - inline ModCall() : ModCall(nullptr) {} - ~ModCall() PROTOBUF_FINAL; + inline ModFailed() : ModFailed(nullptr) {} + ~ModFailed() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ModCall* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(ModFailed* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ModCall)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ModFailed)); } #endif template - explicit PROTOBUF_CONSTEXPR ModCall(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ModFailed(::google::protobuf::internal::ConstantInitialized); - inline ModCall(const ModCall& from) : ModCall(nullptr, from) {} - inline ModCall(ModCall&& from) noexcept - : ModCall(nullptr, ::std::move(from)) {} - inline ModCall& operator=(const ModCall& from) { + inline ModFailed(const ModFailed& from) : ModFailed(nullptr, from) {} + inline ModFailed(ModFailed&& from) noexcept + : ModFailed(nullptr, ::std::move(from)) {} + inline ModFailed& operator=(const ModFailed& from) { CopyFrom(from); return *this; } - inline ModCall& operator=(ModCall&& from) noexcept { + inline ModFailed& operator=(ModFailed&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -2888,13 +2932,13 @@ class ModCall final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ModCall& default_instance() { - return *reinterpret_cast( - &_ModCall_default_instance_); + static const ModFailed& default_instance() { + return *reinterpret_cast( + &_ModFailed_default_instance_); } - static constexpr int kIndexInFileMessages = 1; - friend void swap(ModCall& a, ModCall& b) { a.Swap(&b); } - inline void Swap(ModCall* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 8; + friend void swap(ModFailed& a, ModFailed& b) { a.Swap(&b); } + inline void Swap(ModFailed* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -2902,7 +2946,7 @@ class ModCall final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ModCall* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ModFailed* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -2910,13 +2954,13 @@ class ModCall final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ModCall* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ModFailed* 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 ModCall& from); + void CopyFrom(const ModFailed& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ModCall& from) { ModCall::MergeImpl(*this, from); } + void MergeFrom(const ModFailed& from) { ModFailed::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -2952,17 +2996,17 @@ class ModCall final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ModCall* PROTOBUF_NONNULL other); + void InternalSwap(ModFailed* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModCall"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModFailed"; } - explicit ModCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ModCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModCall& from); - ModCall( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModCall&& from) noexcept - : ModCall(arena) { + explicit ModFailed(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ModFailed(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModFailed& from); + ModFailed( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModFailed&& from) noexcept + : ModFailed(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -2980,10 +3024,7 @@ class ModCall final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { kModFieldNumber = 1, - kServiceFieldNumber = 2, - kMethodFieldNumber = 3, - kPayloadFieldNumber = 4, - kIdFieldNumber = 5, + kErrorFieldNumber = 2, }; // string mod = 1; void clear_mod() ; @@ -3000,72 +3041,27 @@ class ModCall final : public ::google::protobuf::Message ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); public: - // string service = 2; - void clear_service() ; - const ::std::string& service() const; - template - void set_service(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_service(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_service(); - void set_allocated_service(::std::string* PROTOBUF_NULLABLE value); - - private: - const ::std::string& _internal_service() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_service(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_service(); - - public: - // string method = 3; - void clear_method() ; - const ::std::string& method() const; - template - void set_method(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_method(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_method(); - void set_allocated_method(::std::string* PROTOBUF_NULLABLE value); - - private: - const ::std::string& _internal_method() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_method(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_method(); - - public: - // bytes payload = 4; - void clear_payload() ; - const ::std::string& payload() const; - template - void set_payload(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_payload(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_payload(); - void set_allocated_payload(::std::string* PROTOBUF_NULLABLE value); - - private: - const ::std::string& _internal_payload() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_payload(); - - public: - // string id = 5; - void clear_id() ; - const ::std::string& id() const; + // string error = 2; + void clear_error() ; + const ::std::string& error() const; template - void set_id(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_id(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_id(); - void set_allocated_id(::std::string* PROTOBUF_NULLABLE value); + void set_error(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_error(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_error(); + void set_allocated_error(::std::string* PROTOBUF_NULLABLE value); private: - const ::std::string& _internal_id() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_id(const ::std::string& value); - ::std::string* PROTOBUF_NONNULL _internal_mutable_id(); + const ::std::string& _internal_error() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_error(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_error(); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModCall) + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModFailed) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<3, 5, - 0, 59, + static const ::google::protobuf::internal::TcParseTable<1, 2, + 0, 51, 2> _table_; @@ -3083,47 +3079,44 @@ class ModCall final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ModCall& from_msg); + const ModFailed& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr mod_; - ::google::protobuf::internal::ArenaStringPtr service_; - ::google::protobuf::internal::ArenaStringPtr method_; - ::google::protobuf::internal::ArenaStringPtr payload_; - ::google::protobuf::internal::ArenaStringPtr id_; + ::google::protobuf::internal::ArenaStringPtr error_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull ModCall_class_data_; +extern const ::google::protobuf::internal::ClassDataFull ModFailed_class_data_; // ------------------------------------------------------------------- -class ControlRequest final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ControlRequest) */ { +class ModCallResult final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModCallResult) */ { public: - inline ControlRequest() : ControlRequest(nullptr) {} - ~ControlRequest() PROTOBUF_FINAL; + inline ModCallResult() : ModCallResult(nullptr) {} + ~ModCallResult() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ControlRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(ModCallResult* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ControlRequest)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ModCallResult)); } #endif template - explicit PROTOBUF_CONSTEXPR ControlRequest(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ModCallResult(::google::protobuf::internal::ConstantInitialized); - inline ControlRequest(const ControlRequest& from) : ControlRequest(nullptr, from) {} - inline ControlRequest(ControlRequest&& from) noexcept - : ControlRequest(nullptr, ::std::move(from)) {} - inline ControlRequest& operator=(const ControlRequest& from) { + inline ModCallResult(const ModCallResult& from) : ModCallResult(nullptr, from) {} + inline ModCallResult(ModCallResult&& from) noexcept + : ModCallResult(nullptr, ::std::move(from)) {} + inline ModCallResult& operator=(const ModCallResult& from) { CopyFrom(from); return *this; } - inline ControlRequest& operator=(ControlRequest&& from) noexcept { + inline ModCallResult& operator=(ModCallResult&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -3151,20 +3144,13 @@ class ControlRequest final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ControlRequest& default_instance() { - return *reinterpret_cast( - &_ControlRequest_default_instance_); + static const ModCallResult& default_instance() { + return *reinterpret_cast( + &_ModCallResult_default_instance_); } - enum BodyCase { - kReload = 1, - kRoles = 2, - kService = 3, - kCall = 4, - BODY_NOT_SET = 0, - }; - static constexpr int kIndexInFileMessages = 0; - friend void swap(ControlRequest& a, ControlRequest& b) { a.Swap(&b); } - inline void Swap(ControlRequest* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 2; + friend void swap(ModCallResult& a, ModCallResult& b) { a.Swap(&b); } + inline void Swap(ModCallResult* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -3172,7 +3158,7 @@ class ControlRequest final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ControlRequest* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ModCallResult* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -3180,13 +3166,13 @@ class ControlRequest final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ControlRequest* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ModCallResult* 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 ControlRequest& from); + void CopyFrom(const ModCallResult& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ControlRequest& from) { ControlRequest::MergeImpl(*this, from); } + void MergeFrom(const ModCallResult& from) { ModCallResult::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -3222,17 +3208,17 @@ class ControlRequest final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ControlRequest* PROTOBUF_NONNULL other); + void InternalSwap(ModCallResult* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ControlRequest"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModCallResult"; } - explicit ControlRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ControlRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ControlRequest& from); - ControlRequest( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ControlRequest&& from) noexcept - : ControlRequest(arena) { + explicit ModCallResult(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ModCallResult(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModCallResult& from); + ModCallResult( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModCallResult&& from) noexcept + : ModCallResult(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -3249,101 +3235,77 @@ class ControlRequest final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kReloadFieldNumber = 1, - kRolesFieldNumber = 2, - kServiceFieldNumber = 3, - kCallFieldNumber = 4, + kIdFieldNumber = 1, + kModFieldNumber = 2, + kPayloadFieldNumber = 3, + kErrorFieldNumber = 4, }; - // .modlock.host_app.control.ReloadRequest reload = 1; - bool has_reload() const; - private: - bool _internal_has_reload() const; - - public: - void clear_reload() ; - const ::modlock::host_app::control::ReloadRequest& reload() const; - [[nodiscard]] ::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE release_reload(); - ::modlock::host_app::control::ReloadRequest* PROTOBUF_NONNULL mutable_reload(); - void set_allocated_reload(::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_reload(::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE unsafe_arena_release_reload(); - - private: - const ::modlock::host_app::control::ReloadRequest& _internal_reload() const; - ::modlock::host_app::control::ReloadRequest* PROTOBUF_NONNULL _internal_mutable_reload(); + // string id = 1; + void clear_id() ; + const ::std::string& id() const; + template + void set_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_id(); + void set_allocated_id(::std::string* PROTOBUF_NULLABLE value); - public: - // .modlock.wasm.players.RolesTable roles = 2; - bool has_roles() const; private: - bool _internal_has_roles() const; + const ::std::string& _internal_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_id(); public: - void clear_roles() ; - const ::modlock::wasm::players::RolesTable& roles() const; - [[nodiscard]] ::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE release_roles(); - ::modlock::wasm::players::RolesTable* PROTOBUF_NONNULL mutable_roles(); - void set_allocated_roles(::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_roles(::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE value); - ::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE unsafe_arena_release_roles(); - - private: - const ::modlock::wasm::players::RolesTable& _internal_roles() const; - ::modlock::wasm::players::RolesTable* PROTOBUF_NONNULL _internal_mutable_roles(); + // string mod = 2; + void clear_mod() ; + const ::std::string& mod() const; + template + void set_mod(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_mod(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_mod(); + void set_allocated_mod(::std::string* PROTOBUF_NULLABLE value); - public: - // .modlock.host_app.control.ServiceReply service = 3; - bool has_service() const; private: - bool _internal_has_service() const; + const ::std::string& _internal_mod() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_mod(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); public: - void clear_service() ; - const ::modlock::host_app::control::ServiceReply& service() const; - [[nodiscard]] ::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE release_service(); - ::modlock::host_app::control::ServiceReply* PROTOBUF_NONNULL mutable_service(); - void set_allocated_service(::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_service(::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE unsafe_arena_release_service(); - - private: - const ::modlock::host_app::control::ServiceReply& _internal_service() const; - ::modlock::host_app::control::ServiceReply* PROTOBUF_NONNULL _internal_mutable_service(); + // bytes payload = 3; + void clear_payload() ; + const ::std::string& payload() const; + template + void set_payload(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_payload(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_payload(); + void set_allocated_payload(::std::string* PROTOBUF_NULLABLE value); - public: - // .modlock.host_app.control.ModCall call = 4; - bool has_call() const; private: - bool _internal_has_call() const; + const ::std::string& _internal_payload() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_payload(); public: - void clear_call() ; - const ::modlock::host_app::control::ModCall& call() const; - [[nodiscard]] ::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE release_call(); - ::modlock::host_app::control::ModCall* PROTOBUF_NONNULL mutable_call(); - void set_allocated_call(::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_call(::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE unsafe_arena_release_call(); + // string error = 4; + void clear_error() ; + const ::std::string& error() const; + template + void set_error(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_error(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_error(); + void set_allocated_error(::std::string* PROTOBUF_NULLABLE value); private: - const ::modlock::host_app::control::ModCall& _internal_call() const; - ::modlock::host_app::control::ModCall* PROTOBUF_NONNULL _internal_mutable_call(); + const ::std::string& _internal_error() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_error(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_error(); public: - void clear_body(); - BodyCase body_case() const; - // @@protoc_insertion_point(class_scope:modlock.host_app.control.ControlRequest) + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModCallResult) private: class _Internal; - void set_has_reload(); - void set_has_roles(); - void set_has_service(); - void set_has_call(); - inline bool has_body() const; - inline void clear_has_body(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 4, - 4, 0, + static const ::google::protobuf::internal::TcParseTable<2, 4, + 0, 57, 2> _table_; @@ -3361,50 +3323,46 @@ class ControlRequest final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ControlRequest& from_msg); - union BodyUnion { - constexpr BodyUnion() : _constinit_{} {} - ::google::protobuf::internal::ConstantInitialized _constinit_; - ::google::protobuf::Message* PROTOBUF_NULLABLE reload_; - ::google::protobuf::Message* PROTOBUF_NULLABLE roles_; - ::google::protobuf::Message* PROTOBUF_NULLABLE service_; - ::google::protobuf::Message* PROTOBUF_NULLABLE call_; - } body_; + const ModCallResult& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; - ::uint32_t _oneof_case_[1]; + ::google::protobuf::internal::ArenaStringPtr id_; + ::google::protobuf::internal::ArenaStringPtr mod_; + ::google::protobuf::internal::ArenaStringPtr payload_; + ::google::protobuf::internal::ArenaStringPtr error_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull ControlRequest_class_data_; +extern const ::google::protobuf::internal::ClassDataFull ModCallResult_class_data_; // ------------------------------------------------------------------- -class ModCalls final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModCalls) */ { +class ModCall final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModCall) */ { public: - inline ModCalls() : ModCalls(nullptr) {} - ~ModCalls() PROTOBUF_FINAL; + inline ModCall() : ModCall(nullptr) {} + ~ModCall() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ModCalls* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(ModCall* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ModCalls)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ModCall)); } #endif template - explicit PROTOBUF_CONSTEXPR ModCalls(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ModCall(::google::protobuf::internal::ConstantInitialized); - inline ModCalls(const ModCalls& from) : ModCalls(nullptr, from) {} - inline ModCalls(ModCalls&& from) noexcept - : ModCalls(nullptr, ::std::move(from)) {} - inline ModCalls& operator=(const ModCalls& from) { + inline ModCall(const ModCall& from) : ModCall(nullptr, from) {} + inline ModCall(ModCall&& from) noexcept + : ModCall(nullptr, ::std::move(from)) {} + inline ModCall& operator=(const ModCall& from) { CopyFrom(from); return *this; } - inline ModCalls& operator=(ModCalls&& from) noexcept { + inline ModCall& operator=(ModCall&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -3432,13 +3390,13 @@ class ModCalls final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ModCalls& default_instance() { - return *reinterpret_cast( - &_ModCalls_default_instance_); + static const ModCall& default_instance() { + return *reinterpret_cast( + &_ModCall_default_instance_); } - static constexpr int kIndexInFileMessages = 9; - friend void swap(ModCalls& a, ModCalls& b) { a.Swap(&b); } - inline void Swap(ModCalls* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 1; + friend void swap(ModCall& a, ModCall& b) { a.Swap(&b); } + inline void Swap(ModCall* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -3446,7 +3404,7 @@ class ModCalls final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ModCalls* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ModCall* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -3454,13 +3412,13 @@ class ModCalls final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ModCalls* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ModCall* 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 ModCalls& from); + void CopyFrom(const ModCall& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ModCalls& from) { ModCalls::MergeImpl(*this, from); } + void MergeFrom(const ModCall& from) { ModCall::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -3496,17 +3454,17 @@ class ModCalls final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ModCalls* PROTOBUF_NONNULL other); + void InternalSwap(ModCall* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModCalls"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModCall"; } - explicit ModCalls(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ModCalls(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModCalls& from); - ModCalls( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModCalls&& from) noexcept - : ModCalls(arena) { + explicit ModCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ModCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModCall& from); + ModCall( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModCall&& from) noexcept + : ModCall(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -3524,7 +3482,10 @@ class ModCalls final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { kModFieldNumber = 1, - kProfileFieldNumber = 2, + kServiceFieldNumber = 2, + kMethodFieldNumber = 3, + kPayloadFieldNumber = 4, + kIdFieldNumber = 5, }; // string mod = 1; void clear_mod() ; @@ -3541,27 +3502,72 @@ class ModCalls final : public ::google::protobuf::Message ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); public: - // .modlock.wasm.profile.CallProfile profile = 2; - bool has_profile() const; - void clear_profile() ; - const ::modlock::wasm::profile::CallProfile& profile() const; - [[nodiscard]] ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE release_profile(); - ::modlock::wasm::profile::CallProfile* PROTOBUF_NONNULL mutable_profile(); - void set_allocated_profile(::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_profile(::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE value); - ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE unsafe_arena_release_profile(); + // string service = 2; + void clear_service() ; + const ::std::string& service() const; + template + void set_service(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_service(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_service(); + void set_allocated_service(::std::string* PROTOBUF_NULLABLE value); private: - const ::modlock::wasm::profile::CallProfile& _internal_profile() const; - ::modlock::wasm::profile::CallProfile* PROTOBUF_NONNULL _internal_mutable_profile(); + const ::std::string& _internal_service() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_service(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_service(); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModCalls) + // string method = 3; + void clear_method() ; + const ::std::string& method() const; + template + void set_method(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_method(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_method(); + void set_allocated_method(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_method() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_method(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_method(); + + public: + // bytes payload = 4; + void clear_payload() ; + const ::std::string& payload() const; + template + void set_payload(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_payload(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_payload(); + void set_allocated_payload(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_payload() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_payload(); + + public: + // string id = 5; + void clear_id() ; + const ::std::string& id() const; + template + void set_id(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_id(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_id(); + void set_allocated_id(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_id() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_id(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_id(); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModCall) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 2, - 1, 45, + static const ::google::protobuf::internal::TcParseTable<3, 5, + 0, 59, 2> _table_; @@ -3579,44 +3585,47 @@ class ModCalls final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ModCalls& from_msg); + const ModCall& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr mod_; - ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE profile_; + ::google::protobuf::internal::ArenaStringPtr service_; + ::google::protobuf::internal::ArenaStringPtr method_; + ::google::protobuf::internal::ArenaStringPtr payload_; + ::google::protobuf::internal::ArenaStringPtr id_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull ModCalls_class_data_; +extern const ::google::protobuf::internal::ClassDataFull ModCall_class_data_; // ------------------------------------------------------------------- -class ModSlowFrame final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModSlowFrame) */ { +class Forward final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.Forward) */ { public: - inline ModSlowFrame() : ModSlowFrame(nullptr) {} - ~ModSlowFrame() PROTOBUF_FINAL; + inline Forward() : Forward(nullptr) {} + ~Forward() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ModSlowFrame* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(Forward* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ModSlowFrame)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Forward)); } #endif template - explicit PROTOBUF_CONSTEXPR ModSlowFrame(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Forward(::google::protobuf::internal::ConstantInitialized); - inline ModSlowFrame(const ModSlowFrame& from) : ModSlowFrame(nullptr, from) {} - inline ModSlowFrame(ModSlowFrame&& from) noexcept - : ModSlowFrame(nullptr, ::std::move(from)) {} - inline ModSlowFrame& operator=(const ModSlowFrame& from) { + inline Forward(const Forward& from) : Forward(nullptr, from) {} + inline Forward(Forward&& from) noexcept + : Forward(nullptr, ::std::move(from)) {} + inline Forward& operator=(const Forward& from) { CopyFrom(from); return *this; } - inline ModSlowFrame& operator=(ModSlowFrame&& from) noexcept { + inline Forward& operator=(Forward&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -3644,13 +3653,13 @@ class ModSlowFrame final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ModSlowFrame& default_instance() { - return *reinterpret_cast( - &_ModSlowFrame_default_instance_); + static const Forward& default_instance() { + return *reinterpret_cast( + &_Forward_default_instance_); } - static constexpr int kIndexInFileMessages = 10; - friend void swap(ModSlowFrame& a, ModSlowFrame& b) { a.Swap(&b); } - inline void Swap(ModSlowFrame* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 19; + friend void swap(Forward& a, Forward& b) { a.Swap(&b); } + inline void Swap(Forward* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -3658,7 +3667,7 @@ class ModSlowFrame final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ModSlowFrame* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(Forward* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -3666,13 +3675,13 @@ class ModSlowFrame final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ModSlowFrame* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + Forward* 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 ModSlowFrame& from); + void CopyFrom(const Forward& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ModSlowFrame& from) { ModSlowFrame::MergeImpl(*this, from); } + void MergeFrom(const Forward& from) { Forward::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -3708,17 +3717,17 @@ class ModSlowFrame final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ModSlowFrame* PROTOBUF_NONNULL other); + void InternalSwap(Forward* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModSlowFrame"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.Forward"; } - explicit ModSlowFrame(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ModSlowFrame(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModSlowFrame& from); - ModSlowFrame( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModSlowFrame&& from) noexcept - : ModSlowFrame(arena) { + explicit Forward(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Forward(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Forward& from); + Forward( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Forward&& from) noexcept + : Forward(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -3736,7 +3745,8 @@ class ModSlowFrame final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { kModFieldNumber = 1, - kReportFieldNumber = 2, + kServiceFieldNumber = 2, + kTargetFieldNumber = 3, }; // string mod = 1; void clear_mod() ; @@ -3753,27 +3763,42 @@ class ModSlowFrame final : public ::google::protobuf::Message ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); public: - // .modlock.wasm.profile.SlowFrame report = 2; - bool has_report() const; - void clear_report() ; - const ::modlock::wasm::profile::SlowFrame& report() const; - [[nodiscard]] ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE release_report(); - ::modlock::wasm::profile::SlowFrame* PROTOBUF_NONNULL mutable_report(); - void set_allocated_report(::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_report(::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE value); - ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE unsafe_arena_release_report(); + // string service = 2; + void clear_service() ; + const ::std::string& service() const; + template + void set_service(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_service(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_service(); + void set_allocated_service(::std::string* PROTOBUF_NULLABLE value); private: - const ::modlock::wasm::profile::SlowFrame& _internal_report() const; - ::modlock::wasm::profile::SlowFrame* PROTOBUF_NONNULL _internal_mutable_report(); + const ::std::string& _internal_service() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_service(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_service(); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModSlowFrame) + // string target = 3; + void clear_target() ; + const ::std::string& target() const; + template + void set_target(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_target(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_target(); + void set_allocated_target(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_target() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_target(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_target(); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.Forward) private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 2, - 1, 49, + static const ::google::protobuf::internal::TcParseTable<2, 3, + 0, 57, 2> _table_; @@ -3791,44 +3816,45 @@ class ModSlowFrame final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const ModSlowFrame& from_msg); + const Forward& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr mod_; - ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE report_; + ::google::protobuf::internal::ArenaStringPtr service_; + ::google::protobuf::internal::ArenaStringPtr target_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull ModSlowFrame_class_data_; +extern const ::google::protobuf::internal::ClassDataFull Forward_class_data_; // ------------------------------------------------------------------- -class UiChanged final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.UiChanged) */ { +class Fixture final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.Fixture) */ { public: - inline UiChanged() : UiChanged(nullptr) {} - ~UiChanged() PROTOBUF_FINAL; + inline Fixture() : Fixture(nullptr) {} + ~Fixture() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(UiChanged* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(Fixture* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(UiChanged)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Fixture)); } #endif template - explicit PROTOBUF_CONSTEXPR UiChanged(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Fixture(::google::protobuf::internal::ConstantInitialized); - inline UiChanged(const UiChanged& from) : UiChanged(nullptr, from) {} - inline UiChanged(UiChanged&& from) noexcept - : UiChanged(nullptr, ::std::move(from)) {} - inline UiChanged& operator=(const UiChanged& from) { + inline Fixture(const Fixture& from) : Fixture(nullptr, from) {} + inline Fixture(Fixture&& from) noexcept + : Fixture(nullptr, ::std::move(from)) {} + inline Fixture& operator=(const Fixture& from) { CopyFrom(from); return *this; } - inline UiChanged& operator=(UiChanged&& from) noexcept { + inline Fixture& operator=(Fixture&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -3856,13 +3882,13 @@ class UiChanged final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const UiChanged& default_instance() { - return *reinterpret_cast( - &_UiChanged_default_instance_); + static const Fixture& default_instance() { + return *reinterpret_cast( + &_Fixture_default_instance_); } - static constexpr int kIndexInFileMessages = 15; - friend void swap(UiChanged& a, UiChanged& b) { a.Swap(&b); } - inline void Swap(UiChanged* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 18; + friend void swap(Fixture& a, Fixture& b) { a.Swap(&b); } + inline void Swap(Fixture* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -3870,7 +3896,7 @@ class UiChanged final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(UiChanged* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(Fixture* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -3878,13 +3904,13 @@ class UiChanged final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - UiChanged* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + Fixture* 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 UiChanged& from); + void CopyFrom(const Fixture& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const UiChanged& from) { UiChanged::MergeImpl(*this, from); } + void MergeFrom(const Fixture& from) { Fixture::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -3920,17 +3946,17 @@ class UiChanged final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(UiChanged* PROTOBUF_NONNULL other); + void InternalSwap(Fixture* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.UiChanged"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.Fixture"; } - explicit UiChanged(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - UiChanged(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const UiChanged& from); - UiChanged( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, UiChanged&& from) noexcept - : UiChanged(arena) { + explicit Fixture(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Fixture(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Fixture& from); + Fixture( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Fixture&& from) noexcept + : Fixture(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -3948,8 +3974,10 @@ class UiChanged final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { kModFieldNumber = 1, - kChangeFieldNumber = 3, - kSlotFieldNumber = 2, + kServiceFieldNumber = 2, + kMethodFieldNumber = 3, + kPayloadFieldNumber = 4, + kSourceFieldNumber = 5, }; // string mod = 1; void clear_mod() ; @@ -3966,40 +3994,75 @@ class UiChanged final : public ::google::protobuf::Message ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); public: - // .modlock.wasm.ui.Change change = 3; - bool has_change() const; - void clear_change() ; - const ::modlock::wasm::ui::Change& change() const; - [[nodiscard]] ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE release_change(); - ::modlock::wasm::ui::Change* PROTOBUF_NONNULL mutable_change(); - void set_allocated_change(::modlock::wasm::ui::Change* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_change(::modlock::wasm::ui::Change* PROTOBUF_NULLABLE value); - ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE unsafe_arena_release_change(); + // string service = 2; + void clear_service() ; + const ::std::string& service() const; + template + void set_service(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_service(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_service(); + void set_allocated_service(::std::string* PROTOBUF_NULLABLE value); private: - const ::modlock::wasm::ui::Change& _internal_change() const; - ::modlock::wasm::ui::Change* PROTOBUF_NONNULL _internal_mutable_change(); + const ::std::string& _internal_service() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_service(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_service(); public: - // int32 slot = 2; - void clear_slot() ; - ::int32_t slot() const; - void set_slot(::int32_t value); + // string method = 3; + void clear_method() ; + const ::std::string& method() const; + template + void set_method(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_method(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_method(); + void set_allocated_method(::std::string* PROTOBUF_NULLABLE value); private: - ::int32_t _internal_slot() const; - void _internal_set_slot(::int32_t value); + const ::std::string& _internal_method() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_method(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_method(); public: - // @@protoc_insertion_point(class_scope:modlock.host_app.control.UiChanged) - private: - class _Internal; - friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<2, 3, - 1, 46, - 2> - _table_; - + // bytes payload = 4; + void clear_payload() ; + const ::std::string& payload() const; + template + void set_payload(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_payload(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_payload(); + void set_allocated_payload(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_payload() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_payload(); + + public: + // string source = 5; + void clear_source() ; + const ::std::string& source() const; + template + void set_source(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_source(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_source(); + void set_allocated_source(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_source() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_source(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_source(); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.Fixture) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<3, 5, + 0, 63, + 2> + _table_; + friend class ::google::protobuf::MessageLite; friend class ::google::protobuf::Arena; template @@ -4014,45 +4077,47 @@ class UiChanged final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const UiChanged& from_msg); + const Fixture& from_msg); ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr mod_; - ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE change_; - ::int32_t slot_; + ::google::protobuf::internal::ArenaStringPtr service_; + ::google::protobuf::internal::ArenaStringPtr method_; + ::google::protobuf::internal::ArenaStringPtr payload_; + ::google::protobuf::internal::ArenaStringPtr source_; PROTOBUF_TSAN_DECLARE_MEMBER }; union { Impl_ _impl_; }; friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull UiChanged_class_data_; +extern const ::google::protobuf::internal::ClassDataFull Fixture_class_data_; // ------------------------------------------------------------------- -class HostEvent final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.host_app.control.HostEvent) */ { +class Fixtures final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.Fixtures) */ { public: - inline HostEvent() : HostEvent(nullptr) {} - ~HostEvent() PROTOBUF_FINAL; + inline Fixtures() : Fixtures(nullptr) {} + ~Fixtures() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(HostEvent* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(Fixtures* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(HostEvent)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Fixtures)); } #endif template - explicit PROTOBUF_CONSTEXPR HostEvent(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR Fixtures(::google::protobuf::internal::ConstantInitialized); - inline HostEvent(const HostEvent& from) : HostEvent(nullptr, from) {} - inline HostEvent(HostEvent&& from) noexcept - : HostEvent(nullptr, ::std::move(from)) {} - inline HostEvent& operator=(const HostEvent& from) { + inline Fixtures(const Fixtures& from) : Fixtures(nullptr, from) {} + inline Fixtures(Fixtures&& from) noexcept + : Fixtures(nullptr, ::std::move(from)) {} + inline Fixtures& operator=(const Fixtures& from) { CopyFrom(from); return *this; } - inline HostEvent& operator=(HostEvent&& from) noexcept { + inline Fixtures& operator=(Fixtures&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -4080,29 +4145,13 @@ class HostEvent final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const HostEvent& default_instance() { - return *reinterpret_cast( - &_HostEvent_default_instance_); + static const Fixtures& default_instance() { + return *reinterpret_cast( + &_Fixtures_default_instance_); } - enum BodyCase { - kStarted = 1, - kLog = 2, - kFailed = 3, - kJoined = 4, - kReady = 5, - kUi = 6, - kLeft = 7, - kMessage = 8, - kChat = 9, - kCalls = 10, - kSlowFrame = 11, - kServiceApplied = 12, - kCalled = 13, - BODY_NOT_SET = 0, - }; - static constexpr int kIndexInFileMessages = 4; - friend void swap(HostEvent& a, HostEvent& b) { a.Swap(&b); } - inline void Swap(HostEvent* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 20; + friend void swap(Fixtures& a, Fixtures& b) { a.Swap(&b); } + inline void Swap(Fixtures* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -4110,7 +4159,7 @@ class HostEvent final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(HostEvent* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(Fixtures* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -4118,13 +4167,13 @@ class HostEvent final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - HostEvent* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + Fixtures* 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 HostEvent& from); + void CopyFrom(const Fixtures& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const HostEvent& from) { HostEvent::MergeImpl(*this, from); } + void MergeFrom(const Fixtures& from) { Fixtures::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -4160,17 +4209,17 @@ class HostEvent final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(HostEvent* PROTOBUF_NONNULL other); + void InternalSwap(Fixtures* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.host_app.control.HostEvent"; } + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.Fixtures"; } - explicit HostEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - HostEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const HostEvent& from); - HostEvent( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, HostEvent&& from) noexcept - : HostEvent(arena) { + explicit Fixtures(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Fixtures(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Fixtures& from); + Fixtures( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Fixtures&& from) noexcept + : Fixtures(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -4187,290 +4236,346 @@ class HostEvent final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kStartedFieldNumber = 1, - kLogFieldNumber = 2, - kFailedFieldNumber = 3, - kJoinedFieldNumber = 4, - kReadyFieldNumber = 5, - kUiFieldNumber = 6, - kLeftFieldNumber = 7, - kMessageFieldNumber = 8, - kChatFieldNumber = 9, - kCallsFieldNumber = 10, - kSlowFrameFieldNumber = 11, - kServiceAppliedFieldNumber = 12, - kCalledFieldNumber = 13, + kFixturesFieldNumber = 1, + kForwardsFieldNumber = 2, }; - // .modlock.host_app.control.ModStarted started = 1; - bool has_started() const; - private: - bool _internal_has_started() const; - - public: - void clear_started() ; - const ::modlock::host_app::control::ModStarted& started() const; - [[nodiscard]] ::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE release_started(); - ::modlock::host_app::control::ModStarted* PROTOBUF_NONNULL mutable_started(); - void set_allocated_started(::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_started(::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE unsafe_arena_release_started(); - - private: - const ::modlock::host_app::control::ModStarted& _internal_started() const; - ::modlock::host_app::control::ModStarted* PROTOBUF_NONNULL _internal_mutable_started(); - - public: - // .modlock.host_app.control.ModLog log = 2; - bool has_log() const; + // repeated .modlock.host_app.control.Fixture fixtures = 1; + int fixtures_size() const; private: - bool _internal_has_log() const; + int _internal_fixtures_size() const; public: - void clear_log() ; - const ::modlock::host_app::control::ModLog& log() const; - [[nodiscard]] ::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE release_log(); - ::modlock::host_app::control::ModLog* PROTOBUF_NONNULL mutable_log(); - void set_allocated_log(::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_log(::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE unsafe_arena_release_log(); + void clear_fixtures() ; + ::modlock::host_app::control::Fixture* PROTOBUF_NONNULL mutable_fixtures(int index); + ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Fixture>* PROTOBUF_NONNULL mutable_fixtures(); private: - const ::modlock::host_app::control::ModLog& _internal_log() const; - ::modlock::host_app::control::ModLog* PROTOBUF_NONNULL _internal_mutable_log(); - + const ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Fixture>& _internal_fixtures() const; + ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Fixture>* PROTOBUF_NONNULL _internal_mutable_fixtures(); public: - // .modlock.host_app.control.ModFailed failed = 3; - bool has_failed() const; + const ::modlock::host_app::control::Fixture& fixtures(int index) const; + ::modlock::host_app::control::Fixture* PROTOBUF_NONNULL add_fixtures(); + const ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Fixture>& fixtures() const; + // repeated .modlock.host_app.control.Forward forwards = 2; + int forwards_size() const; private: - bool _internal_has_failed() const; + int _internal_forwards_size() const; public: - void clear_failed() ; - const ::modlock::host_app::control::ModFailed& failed() const; - [[nodiscard]] ::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE release_failed(); - ::modlock::host_app::control::ModFailed* PROTOBUF_NONNULL mutable_failed(); - void set_allocated_failed(::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_failed(::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE unsafe_arena_release_failed(); - - private: - const ::modlock::host_app::control::ModFailed& _internal_failed() const; - ::modlock::host_app::control::ModFailed* PROTOBUF_NONNULL _internal_mutable_failed(); + void clear_forwards() ; + ::modlock::host_app::control::Forward* PROTOBUF_NONNULL mutable_forwards(int index); + ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Forward>* PROTOBUF_NONNULL mutable_forwards(); - public: - // .modlock.host_app.control.PlayerJoined joined = 4; - bool has_joined() const; private: - bool _internal_has_joined() const; - + const ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Forward>& _internal_forwards() const; + ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Forward>* PROTOBUF_NONNULL _internal_mutable_forwards(); public: - void clear_joined() ; - const ::modlock::host_app::control::PlayerJoined& joined() const; - [[nodiscard]] ::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE release_joined(); - ::modlock::host_app::control::PlayerJoined* PROTOBUF_NONNULL mutable_joined(); - void set_allocated_joined(::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_joined(::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE unsafe_arena_release_joined(); + const ::modlock::host_app::control::Forward& forwards(int index) const; + ::modlock::host_app::control::Forward* PROTOBUF_NONNULL add_forwards(); + const ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Forward>& forwards() const; + // @@protoc_insertion_point(class_scope:modlock.host_app.control.Fixtures) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 2, 0, + 2> + _table_; - private: - const ::modlock::host_app::control::PlayerJoined& _internal_joined() const; - ::modlock::host_app::control::PlayerJoined* PROTOBUF_NONNULL _internal_mutable_joined(); + 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 Fixtures& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedPtrField< ::modlock::host_app::control::Fixture > fixtures_; + ::google::protobuf::RepeatedPtrField< ::modlock::host_app::control::Forward > forwards_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; +}; - public: - // .modlock.host_app.control.ServerReady ready = 5; - bool has_ready() const; - private: - bool _internal_has_ready() const; +extern const ::google::protobuf::internal::ClassDataFull Fixtures_class_data_; +// ------------------------------------------------------------------- - public: - void clear_ready() ; - const ::modlock::host_app::control::ServerReady& ready() const; - [[nodiscard]] ::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE release_ready(); - ::modlock::host_app::control::ServerReady* PROTOBUF_NONNULL mutable_ready(); - void set_allocated_ready(::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_ready(::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE unsafe_arena_release_ready(); +class ControlRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ControlRequest) */ { + public: + inline ControlRequest() : ControlRequest(nullptr) {} + ~ControlRequest() PROTOBUF_FINAL; - private: - const ::modlock::host_app::control::ServerReady& _internal_ready() const; - ::modlock::host_app::control::ServerReady* PROTOBUF_NONNULL _internal_mutable_ready(); +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ControlRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ControlRequest)); + } +#endif - public: - // .modlock.host_app.control.UiChanged ui = 6; - bool has_ui() const; - private: - bool _internal_has_ui() const; + template + explicit PROTOBUF_CONSTEXPR ControlRequest(::google::protobuf::internal::ConstantInitialized); - public: - void clear_ui() ; - const ::modlock::host_app::control::UiChanged& ui() const; - [[nodiscard]] ::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE release_ui(); - ::modlock::host_app::control::UiChanged* PROTOBUF_NONNULL mutable_ui(); - void set_allocated_ui(::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_ui(::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE unsafe_arena_release_ui(); + inline ControlRequest(const ControlRequest& from) : ControlRequest(nullptr, from) {} + inline ControlRequest(ControlRequest&& from) noexcept + : ControlRequest(nullptr, ::std::move(from)) {} + inline ControlRequest& operator=(const ControlRequest& from) { + CopyFrom(from); + return *this; + } + inline ControlRequest& operator=(ControlRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } - private: - const ::modlock::host_app::control::UiChanged& _internal_ui() const; - ::modlock::host_app::control::UiChanged* PROTOBUF_NONNULL _internal_mutable_ui(); + 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>(); + } - public: - // .modlock.host_app.control.PlayerLeft left = 7; - bool has_left() const; - private: - bool _internal_has_left() const; + 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 ControlRequest& default_instance() { + return *reinterpret_cast( + &_ControlRequest_default_instance_); + } + enum BodyCase { + kReload = 1, + kRoles = 2, + kService = 3, + kCall = 4, + kAnswer = 5, + BODY_NOT_SET = 0, + }; + static constexpr int kIndexInFileMessages = 0; + friend void swap(ControlRequest& a, ControlRequest& b) { a.Swap(&b); } + inline void Swap(ControlRequest* 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(ControlRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } - public: - void clear_left() ; - const ::modlock::host_app::control::PlayerLeft& left() const; - [[nodiscard]] ::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE release_left(); - ::modlock::host_app::control::PlayerLeft* PROTOBUF_NONNULL mutable_left(); - void set_allocated_left(::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_left(::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE unsafe_arena_release_left(); + // implements Message ---------------------------------------------- + + ControlRequest* 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 ControlRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ControlRequest& from) { ControlRequest::MergeImpl(*this, from); } private: - const ::modlock::host_app::control::PlayerLeft& _internal_left() const; - ::modlock::host_app::control::PlayerLeft* PROTOBUF_NONNULL _internal_mutable_left(); + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); public: - // .modlock.host_app.control.PlayerMessage message = 8; - bool has_message() const; + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) private: - bool _internal_has_message() const; + 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: - void clear_message() ; - const ::modlock::host_app::control::PlayerMessage& message() const; - [[nodiscard]] ::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE release_message(); - ::modlock::host_app::control::PlayerMessage* PROTOBUF_NONNULL mutable_message(); - void set_allocated_message(::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_message(::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE unsafe_arena_release_message(); + ::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: - const ::modlock::host_app::control::PlayerMessage& _internal_message() const; - ::modlock::host_app::control::PlayerMessage* PROTOBUF_NONNULL _internal_mutable_message(); + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(ControlRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ControlRequest"; } - public: - // .modlock.host_app.control.PlayerChat chat = 9; - bool has_chat() const; + explicit ControlRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ControlRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ControlRequest& from); + ControlRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ControlRequest&& from) noexcept + : ControlRequest(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 { + kReloadFieldNumber = 1, + kRolesFieldNumber = 2, + kServiceFieldNumber = 3, + kCallFieldNumber = 4, + kAnswerFieldNumber = 5, + }; + // .modlock.host_app.control.ReloadRequest reload = 1; + bool has_reload() const; private: - bool _internal_has_chat() const; + bool _internal_has_reload() const; public: - void clear_chat() ; - const ::modlock::host_app::control::PlayerChat& chat() const; - [[nodiscard]] ::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE release_chat(); - ::modlock::host_app::control::PlayerChat* PROTOBUF_NONNULL mutable_chat(); - void set_allocated_chat(::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_chat(::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE unsafe_arena_release_chat(); + void clear_reload() ; + const ::modlock::host_app::control::ReloadRequest& reload() const; + [[nodiscard]] ::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE release_reload(); + ::modlock::host_app::control::ReloadRequest* PROTOBUF_NONNULL mutable_reload(); + void set_allocated_reload(::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_reload(::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE unsafe_arena_release_reload(); private: - const ::modlock::host_app::control::PlayerChat& _internal_chat() const; - ::modlock::host_app::control::PlayerChat* PROTOBUF_NONNULL _internal_mutable_chat(); + const ::modlock::host_app::control::ReloadRequest& _internal_reload() const; + ::modlock::host_app::control::ReloadRequest* PROTOBUF_NONNULL _internal_mutable_reload(); public: - // .modlock.host_app.control.ModCalls calls = 10; - bool has_calls() const; + // .modlock.wasm.players.RolesTable roles = 2; + bool has_roles() const; private: - bool _internal_has_calls() const; + bool _internal_has_roles() const; public: - void clear_calls() ; - const ::modlock::host_app::control::ModCalls& calls() const; - [[nodiscard]] ::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE release_calls(); - ::modlock::host_app::control::ModCalls* PROTOBUF_NONNULL mutable_calls(); - void set_allocated_calls(::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_calls(::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE unsafe_arena_release_calls(); + void clear_roles() ; + const ::modlock::wasm::players::RolesTable& roles() const; + [[nodiscard]] ::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE release_roles(); + ::modlock::wasm::players::RolesTable* PROTOBUF_NONNULL mutable_roles(); + void set_allocated_roles(::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_roles(::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE value); + ::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE unsafe_arena_release_roles(); private: - const ::modlock::host_app::control::ModCalls& _internal_calls() const; - ::modlock::host_app::control::ModCalls* PROTOBUF_NONNULL _internal_mutable_calls(); + const ::modlock::wasm::players::RolesTable& _internal_roles() const; + ::modlock::wasm::players::RolesTable* PROTOBUF_NONNULL _internal_mutable_roles(); public: - // .modlock.host_app.control.ModSlowFrame slow_frame = 11; - bool has_slow_frame() const; + // .modlock.host_app.control.ServiceReply service = 3; + bool has_service() const; private: - bool _internal_has_slow_frame() const; + bool _internal_has_service() const; public: - void clear_slow_frame() ; - const ::modlock::host_app::control::ModSlowFrame& slow_frame() const; - [[nodiscard]] ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE release_slow_frame(); - ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NONNULL mutable_slow_frame(); - void set_allocated_slow_frame(::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_slow_frame(::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE unsafe_arena_release_slow_frame(); + void clear_service() ; + const ::modlock::host_app::control::ServiceReply& service() const; + [[nodiscard]] ::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE release_service(); + ::modlock::host_app::control::ServiceReply* PROTOBUF_NONNULL mutable_service(); + void set_allocated_service(::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_service(::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE unsafe_arena_release_service(); private: - const ::modlock::host_app::control::ModSlowFrame& _internal_slow_frame() const; - ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NONNULL _internal_mutable_slow_frame(); + const ::modlock::host_app::control::ServiceReply& _internal_service() const; + ::modlock::host_app::control::ServiceReply* PROTOBUF_NONNULL _internal_mutable_service(); public: - // .modlock.host_app.control.ServiceResult service_applied = 12; - bool has_service_applied() const; + // .modlock.host_app.control.ModCall call = 4; + bool has_call() const; private: - bool _internal_has_service_applied() const; + bool _internal_has_call() const; public: - void clear_service_applied() ; - const ::modlock::host_app::control::ServiceResult& service_applied() const; - [[nodiscard]] ::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE release_service_applied(); - ::modlock::host_app::control::ServiceResult* PROTOBUF_NONNULL mutable_service_applied(); - void set_allocated_service_applied(::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_service_applied(::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE unsafe_arena_release_service_applied(); + void clear_call() ; + const ::modlock::host_app::control::ModCall& call() const; + [[nodiscard]] ::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE release_call(); + ::modlock::host_app::control::ModCall* PROTOBUF_NONNULL mutable_call(); + void set_allocated_call(::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_call(::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE unsafe_arena_release_call(); private: - const ::modlock::host_app::control::ServiceResult& _internal_service_applied() const; - ::modlock::host_app::control::ServiceResult* PROTOBUF_NONNULL _internal_mutable_service_applied(); + const ::modlock::host_app::control::ModCall& _internal_call() const; + ::modlock::host_app::control::ModCall* PROTOBUF_NONNULL _internal_mutable_call(); public: - // .modlock.host_app.control.ModCallResult called = 13; - bool has_called() const; + // .modlock.host_app.control.ServiceAnswer answer = 5; + bool has_answer() const; private: - bool _internal_has_called() const; + bool _internal_has_answer() const; public: - void clear_called() ; - const ::modlock::host_app::control::ModCallResult& called() const; - [[nodiscard]] ::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE release_called(); - ::modlock::host_app::control::ModCallResult* PROTOBUF_NONNULL mutable_called(); - void set_allocated_called(::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE value); - void unsafe_arena_set_allocated_called(::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE value); - ::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE unsafe_arena_release_called(); + void clear_answer() ; + const ::modlock::host_app::control::ServiceAnswer& answer() const; + [[nodiscard]] ::modlock::host_app::control::ServiceAnswer* PROTOBUF_NULLABLE release_answer(); + ::modlock::host_app::control::ServiceAnswer* PROTOBUF_NONNULL mutable_answer(); + void set_allocated_answer(::modlock::host_app::control::ServiceAnswer* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_answer(::modlock::host_app::control::ServiceAnswer* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ServiceAnswer* PROTOBUF_NULLABLE unsafe_arena_release_answer(); private: - const ::modlock::host_app::control::ModCallResult& _internal_called() const; - ::modlock::host_app::control::ModCallResult* PROTOBUF_NONNULL _internal_mutable_called(); + const ::modlock::host_app::control::ServiceAnswer& _internal_answer() const; + ::modlock::host_app::control::ServiceAnswer* PROTOBUF_NONNULL _internal_mutable_answer(); public: void clear_body(); BodyCase body_case() const; - // @@protoc_insertion_point(class_scope:modlock.host_app.control.HostEvent) + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ControlRequest) private: class _Internal; - void set_has_started(); - void set_has_log(); - void set_has_failed(); - void set_has_joined(); - void set_has_ready(); - void set_has_ui(); - void set_has_left(); - void set_has_message(); - void set_has_chat(); - void set_has_calls(); - void set_has_slow_frame(); - void set_has_service_applied(); - void set_has_called(); + void set_has_reload(); + void set_has_roles(); + void set_has_service(); + void set_has_call(); + void set_has_answer(); inline bool has_body() const; inline void clear_has_body(); friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<0, 13, - 13, 0, + static const ::google::protobuf::internal::TcParseTable<0, 5, + 5, 0, 2> _table_; @@ -4488,23 +4593,15 @@ class HostEvent final : public ::google::protobuf::Message inline explicit Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, - const HostEvent& from_msg); + const ControlRequest& from_msg); union BodyUnion { constexpr BodyUnion() : _constinit_{} {} ::google::protobuf::internal::ConstantInitialized _constinit_; - ::google::protobuf::Message* PROTOBUF_NULLABLE started_; - ::google::protobuf::Message* PROTOBUF_NULLABLE log_; - ::google::protobuf::Message* PROTOBUF_NULLABLE failed_; - ::google::protobuf::Message* PROTOBUF_NULLABLE joined_; - ::google::protobuf::Message* PROTOBUF_NULLABLE ready_; - ::google::protobuf::Message* PROTOBUF_NULLABLE ui_; - ::google::protobuf::Message* PROTOBUF_NULLABLE left_; - ::google::protobuf::Message* PROTOBUF_NULLABLE message_; - ::google::protobuf::Message* PROTOBUF_NULLABLE chat_; - ::google::protobuf::Message* PROTOBUF_NULLABLE calls_; - ::google::protobuf::Message* PROTOBUF_NULLABLE slow_frame_; - ::google::protobuf::Message* PROTOBUF_NULLABLE service_applied_; - ::google::protobuf::Message* PROTOBUF_NULLABLE called_; + ::google::protobuf::Message* PROTOBUF_NULLABLE reload_; + ::google::protobuf::Message* PROTOBUF_NULLABLE roles_; + ::google::protobuf::Message* PROTOBUF_NULLABLE service_; + ::google::protobuf::Message* PROTOBUF_NULLABLE call_; + ::google::protobuf::Message* PROTOBUF_NULLABLE answer_; } body_; ::google::protobuf::internal::CachedSize _cached_size_; ::uint32_t _oneof_case_[1]; @@ -4514,2389 +4611,4770 @@ class HostEvent final : public ::google::protobuf::Message friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; }; -extern const ::google::protobuf::internal::ClassDataFull HostEvent_class_data_; +extern const ::google::protobuf::internal::ClassDataFull ControlRequest_class_data_; +// ------------------------------------------------------------------- -// =================================================================== +class ModCalls final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModCalls) */ { + public: + inline ModCalls() : ModCalls(nullptr) {} + ~ModCalls() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ModCalls* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ModCalls)); + } +#endif + template + explicit PROTOBUF_CONSTEXPR ModCalls(::google::protobuf::internal::ConstantInitialized); + inline ModCalls(const ModCalls& from) : ModCalls(nullptr, from) {} + inline ModCalls(ModCalls&& from) noexcept + : ModCalls(nullptr, ::std::move(from)) {} + inline ModCalls& operator=(const ModCalls& from) { + CopyFrom(from); + return *this; + } + inline ModCalls& operator=(ModCalls&& 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 ModCalls& default_instance() { + return *reinterpret_cast( + &_ModCalls_default_instance_); + } + static constexpr int kIndexInFileMessages = 9; + friend void swap(ModCalls& a, ModCalls& b) { a.Swap(&b); } + inline void Swap(ModCalls* 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(ModCalls* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + // implements Message ---------------------------------------------- -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ + ModCalls* 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 ModCalls& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ModCalls& from) { ModCalls::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(ModCalls* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModCalls"; } + + explicit ModCalls(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ModCalls(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModCalls& from); + ModCalls( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModCalls&& from) noexcept + : ModCalls(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 { + kModFieldNumber = 1, + kProfileFieldNumber = 2, + }; + // string mod = 1; + void clear_mod() ; + const ::std::string& mod() const; + template + void set_mod(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_mod(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_mod(); + void set_allocated_mod(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_mod() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_mod(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); + + public: + // .modlock.wasm.profile.CallProfile profile = 2; + bool has_profile() const; + void clear_profile() ; + const ::modlock::wasm::profile::CallProfile& profile() const; + [[nodiscard]] ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE release_profile(); + ::modlock::wasm::profile::CallProfile* PROTOBUF_NONNULL mutable_profile(); + void set_allocated_profile(::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_profile(::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE value); + ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE unsafe_arena_release_profile(); + + private: + const ::modlock::wasm::profile::CallProfile& _internal_profile() const; + ::modlock::wasm::profile::CallProfile* PROTOBUF_NONNULL _internal_mutable_profile(); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModCalls) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 1, 45, + 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 ModCalls& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr mod_; + ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE profile_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull ModCalls_class_data_; // ------------------------------------------------------------------- -// ControlRequest +class ModSlowFrame final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.ModSlowFrame) */ { + public: + inline ModSlowFrame() : ModSlowFrame(nullptr) {} + ~ModSlowFrame() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ModSlowFrame* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ModSlowFrame)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR ModSlowFrame(::google::protobuf::internal::ConstantInitialized); + + inline ModSlowFrame(const ModSlowFrame& from) : ModSlowFrame(nullptr, from) {} + inline ModSlowFrame(ModSlowFrame&& from) noexcept + : ModSlowFrame(nullptr, ::std::move(from)) {} + inline ModSlowFrame& operator=(const ModSlowFrame& from) { + CopyFrom(from); + return *this; + } + inline ModSlowFrame& operator=(ModSlowFrame&& 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 ModSlowFrame& default_instance() { + return *reinterpret_cast( + &_ModSlowFrame_default_instance_); + } + static constexpr int kIndexInFileMessages = 10; + friend void swap(ModSlowFrame& a, ModSlowFrame& b) { a.Swap(&b); } + inline void Swap(ModSlowFrame* 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(ModSlowFrame* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ModSlowFrame* 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 ModSlowFrame& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ModSlowFrame& from) { ModSlowFrame::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(ModSlowFrame* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.ModSlowFrame"; } + + explicit ModSlowFrame(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ModSlowFrame(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ModSlowFrame& from); + ModSlowFrame( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ModSlowFrame&& from) noexcept + : ModSlowFrame(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 { + kModFieldNumber = 1, + kReportFieldNumber = 2, + }; + // string mod = 1; + void clear_mod() ; + const ::std::string& mod() const; + template + void set_mod(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_mod(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_mod(); + void set_allocated_mod(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_mod() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_mod(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); + + public: + // .modlock.wasm.profile.SlowFrame report = 2; + bool has_report() const; + void clear_report() ; + const ::modlock::wasm::profile::SlowFrame& report() const; + [[nodiscard]] ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE release_report(); + ::modlock::wasm::profile::SlowFrame* PROTOBUF_NONNULL mutable_report(); + void set_allocated_report(::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_report(::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE value); + ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE unsafe_arena_release_report(); + + private: + const ::modlock::wasm::profile::SlowFrame& _internal_report() const; + ::modlock::wasm::profile::SlowFrame* PROTOBUF_NONNULL _internal_mutable_report(); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.ModSlowFrame) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 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 ModSlowFrame& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr mod_; + ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE report_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull ModSlowFrame_class_data_; +// ------------------------------------------------------------------- + +class UiChanged final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.UiChanged) */ { + public: + inline UiChanged() : UiChanged(nullptr) {} + ~UiChanged() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(UiChanged* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(UiChanged)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR UiChanged(::google::protobuf::internal::ConstantInitialized); + + inline UiChanged(const UiChanged& from) : UiChanged(nullptr, from) {} + inline UiChanged(UiChanged&& from) noexcept + : UiChanged(nullptr, ::std::move(from)) {} + inline UiChanged& operator=(const UiChanged& from) { + CopyFrom(from); + return *this; + } + inline UiChanged& operator=(UiChanged&& 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 UiChanged& default_instance() { + return *reinterpret_cast( + &_UiChanged_default_instance_); + } + static constexpr int kIndexInFileMessages = 15; + friend void swap(UiChanged& a, UiChanged& b) { a.Swap(&b); } + inline void Swap(UiChanged* 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(UiChanged* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + UiChanged* 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 UiChanged& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const UiChanged& from) { UiChanged::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(UiChanged* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.UiChanged"; } + + explicit UiChanged(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + UiChanged(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const UiChanged& from); + UiChanged( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, UiChanged&& from) noexcept + : UiChanged(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 { + kModFieldNumber = 1, + kChangeFieldNumber = 3, + kSlotFieldNumber = 2, + }; + // string mod = 1; + void clear_mod() ; + const ::std::string& mod() const; + template + void set_mod(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_mod(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_mod(); + void set_allocated_mod(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_mod() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_mod(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_mod(); + + public: + // .modlock.wasm.ui.Change change = 3; + bool has_change() const; + void clear_change() ; + const ::modlock::wasm::ui::Change& change() const; + [[nodiscard]] ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE release_change(); + ::modlock::wasm::ui::Change* PROTOBUF_NONNULL mutable_change(); + void set_allocated_change(::modlock::wasm::ui::Change* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_change(::modlock::wasm::ui::Change* PROTOBUF_NULLABLE value); + ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE unsafe_arena_release_change(); + + private: + const ::modlock::wasm::ui::Change& _internal_change() const; + ::modlock::wasm::ui::Change* PROTOBUF_NONNULL _internal_mutable_change(); + + public: + // int32 slot = 2; + void clear_slot() ; + ::int32_t slot() const; + void set_slot(::int32_t value); + + private: + ::int32_t _internal_slot() const; + void _internal_set_slot(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.host_app.control.UiChanged) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 3, + 1, 46, + 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 UiChanged& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr mod_; + ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE change_; + ::int32_t slot_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull UiChanged_class_data_; +// ------------------------------------------------------------------- + +class HostEvent final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.host_app.control.HostEvent) */ { + public: + inline HostEvent() : HostEvent(nullptr) {} + ~HostEvent() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(HostEvent* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(HostEvent)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR HostEvent(::google::protobuf::internal::ConstantInitialized); + + inline HostEvent(const HostEvent& from) : HostEvent(nullptr, from) {} + inline HostEvent(HostEvent&& from) noexcept + : HostEvent(nullptr, ::std::move(from)) {} + inline HostEvent& operator=(const HostEvent& from) { + CopyFrom(from); + return *this; + } + inline HostEvent& operator=(HostEvent&& 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 HostEvent& default_instance() { + return *reinterpret_cast( + &_HostEvent_default_instance_); + } + enum BodyCase { + kStarted = 1, + kLog = 2, + kFailed = 3, + kJoined = 4, + kReady = 5, + kUi = 6, + kLeft = 7, + kMessage = 8, + kChat = 9, + kCalls = 10, + kSlowFrame = 11, + kServiceApplied = 12, + kCalled = 13, + kServiceCall = 14, + BODY_NOT_SET = 0, + }; + static constexpr int kIndexInFileMessages = 4; + friend void swap(HostEvent& a, HostEvent& b) { a.Swap(&b); } + inline void Swap(HostEvent* 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(HostEvent* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + HostEvent* 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 HostEvent& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const HostEvent& from) { HostEvent::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(HostEvent* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.host_app.control.HostEvent"; } + + explicit HostEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + HostEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const HostEvent& from); + HostEvent( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, HostEvent&& from) noexcept + : HostEvent(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 { + kStartedFieldNumber = 1, + kLogFieldNumber = 2, + kFailedFieldNumber = 3, + kJoinedFieldNumber = 4, + kReadyFieldNumber = 5, + kUiFieldNumber = 6, + kLeftFieldNumber = 7, + kMessageFieldNumber = 8, + kChatFieldNumber = 9, + kCallsFieldNumber = 10, + kSlowFrameFieldNumber = 11, + kServiceAppliedFieldNumber = 12, + kCalledFieldNumber = 13, + kServiceCallFieldNumber = 14, + }; + // .modlock.host_app.control.ModStarted started = 1; + bool has_started() const; + private: + bool _internal_has_started() const; + + public: + void clear_started() ; + const ::modlock::host_app::control::ModStarted& started() const; + [[nodiscard]] ::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE release_started(); + ::modlock::host_app::control::ModStarted* PROTOBUF_NONNULL mutable_started(); + void set_allocated_started(::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_started(::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE unsafe_arena_release_started(); + + private: + const ::modlock::host_app::control::ModStarted& _internal_started() const; + ::modlock::host_app::control::ModStarted* PROTOBUF_NONNULL _internal_mutable_started(); + + public: + // .modlock.host_app.control.ModLog log = 2; + bool has_log() const; + private: + bool _internal_has_log() const; + + public: + void clear_log() ; + const ::modlock::host_app::control::ModLog& log() const; + [[nodiscard]] ::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE release_log(); + ::modlock::host_app::control::ModLog* PROTOBUF_NONNULL mutable_log(); + void set_allocated_log(::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_log(::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE unsafe_arena_release_log(); + + private: + const ::modlock::host_app::control::ModLog& _internal_log() const; + ::modlock::host_app::control::ModLog* PROTOBUF_NONNULL _internal_mutable_log(); + + public: + // .modlock.host_app.control.ModFailed failed = 3; + bool has_failed() const; + private: + bool _internal_has_failed() const; + + public: + void clear_failed() ; + const ::modlock::host_app::control::ModFailed& failed() const; + [[nodiscard]] ::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE release_failed(); + ::modlock::host_app::control::ModFailed* PROTOBUF_NONNULL mutable_failed(); + void set_allocated_failed(::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_failed(::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE unsafe_arena_release_failed(); + + private: + const ::modlock::host_app::control::ModFailed& _internal_failed() const; + ::modlock::host_app::control::ModFailed* PROTOBUF_NONNULL _internal_mutable_failed(); + + public: + // .modlock.host_app.control.PlayerJoined joined = 4; + bool has_joined() const; + private: + bool _internal_has_joined() const; + + public: + void clear_joined() ; + const ::modlock::host_app::control::PlayerJoined& joined() const; + [[nodiscard]] ::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE release_joined(); + ::modlock::host_app::control::PlayerJoined* PROTOBUF_NONNULL mutable_joined(); + void set_allocated_joined(::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_joined(::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE unsafe_arena_release_joined(); + + private: + const ::modlock::host_app::control::PlayerJoined& _internal_joined() const; + ::modlock::host_app::control::PlayerJoined* PROTOBUF_NONNULL _internal_mutable_joined(); + + public: + // .modlock.host_app.control.ServerReady ready = 5; + bool has_ready() const; + private: + bool _internal_has_ready() const; + + public: + void clear_ready() ; + const ::modlock::host_app::control::ServerReady& ready() const; + [[nodiscard]] ::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE release_ready(); + ::modlock::host_app::control::ServerReady* PROTOBUF_NONNULL mutable_ready(); + void set_allocated_ready(::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_ready(::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE unsafe_arena_release_ready(); + + private: + const ::modlock::host_app::control::ServerReady& _internal_ready() const; + ::modlock::host_app::control::ServerReady* PROTOBUF_NONNULL _internal_mutable_ready(); + + public: + // .modlock.host_app.control.UiChanged ui = 6; + bool has_ui() const; + private: + bool _internal_has_ui() const; + + public: + void clear_ui() ; + const ::modlock::host_app::control::UiChanged& ui() const; + [[nodiscard]] ::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE release_ui(); + ::modlock::host_app::control::UiChanged* PROTOBUF_NONNULL mutable_ui(); + void set_allocated_ui(::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_ui(::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE unsafe_arena_release_ui(); + + private: + const ::modlock::host_app::control::UiChanged& _internal_ui() const; + ::modlock::host_app::control::UiChanged* PROTOBUF_NONNULL _internal_mutable_ui(); + + public: + // .modlock.host_app.control.PlayerLeft left = 7; + bool has_left() const; + private: + bool _internal_has_left() const; + + public: + void clear_left() ; + const ::modlock::host_app::control::PlayerLeft& left() const; + [[nodiscard]] ::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE release_left(); + ::modlock::host_app::control::PlayerLeft* PROTOBUF_NONNULL mutable_left(); + void set_allocated_left(::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_left(::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE unsafe_arena_release_left(); + + private: + const ::modlock::host_app::control::PlayerLeft& _internal_left() const; + ::modlock::host_app::control::PlayerLeft* PROTOBUF_NONNULL _internal_mutable_left(); + + public: + // .modlock.host_app.control.PlayerMessage message = 8; + bool has_message() const; + private: + bool _internal_has_message() const; + + public: + void clear_message() ; + const ::modlock::host_app::control::PlayerMessage& message() const; + [[nodiscard]] ::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE release_message(); + ::modlock::host_app::control::PlayerMessage* PROTOBUF_NONNULL mutable_message(); + void set_allocated_message(::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_message(::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE unsafe_arena_release_message(); + + private: + const ::modlock::host_app::control::PlayerMessage& _internal_message() const; + ::modlock::host_app::control::PlayerMessage* PROTOBUF_NONNULL _internal_mutable_message(); + + public: + // .modlock.host_app.control.PlayerChat chat = 9; + bool has_chat() const; + private: + bool _internal_has_chat() const; + + public: + void clear_chat() ; + const ::modlock::host_app::control::PlayerChat& chat() const; + [[nodiscard]] ::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE release_chat(); + ::modlock::host_app::control::PlayerChat* PROTOBUF_NONNULL mutable_chat(); + void set_allocated_chat(::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_chat(::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE unsafe_arena_release_chat(); + + private: + const ::modlock::host_app::control::PlayerChat& _internal_chat() const; + ::modlock::host_app::control::PlayerChat* PROTOBUF_NONNULL _internal_mutable_chat(); + + public: + // .modlock.host_app.control.ModCalls calls = 10; + bool has_calls() const; + private: + bool _internal_has_calls() const; + + public: + void clear_calls() ; + const ::modlock::host_app::control::ModCalls& calls() const; + [[nodiscard]] ::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE release_calls(); + ::modlock::host_app::control::ModCalls* PROTOBUF_NONNULL mutable_calls(); + void set_allocated_calls(::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_calls(::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE unsafe_arena_release_calls(); + + private: + const ::modlock::host_app::control::ModCalls& _internal_calls() const; + ::modlock::host_app::control::ModCalls* PROTOBUF_NONNULL _internal_mutable_calls(); + + public: + // .modlock.host_app.control.ModSlowFrame slow_frame = 11; + bool has_slow_frame() const; + private: + bool _internal_has_slow_frame() const; + + public: + void clear_slow_frame() ; + const ::modlock::host_app::control::ModSlowFrame& slow_frame() const; + [[nodiscard]] ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE release_slow_frame(); + ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NONNULL mutable_slow_frame(); + void set_allocated_slow_frame(::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_slow_frame(::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE unsafe_arena_release_slow_frame(); + + private: + const ::modlock::host_app::control::ModSlowFrame& _internal_slow_frame() const; + ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NONNULL _internal_mutable_slow_frame(); + + public: + // .modlock.host_app.control.ServiceResult service_applied = 12; + bool has_service_applied() const; + private: + bool _internal_has_service_applied() const; + + public: + void clear_service_applied() ; + const ::modlock::host_app::control::ServiceResult& service_applied() const; + [[nodiscard]] ::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE release_service_applied(); + ::modlock::host_app::control::ServiceResult* PROTOBUF_NONNULL mutable_service_applied(); + void set_allocated_service_applied(::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_service_applied(::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE unsafe_arena_release_service_applied(); + + private: + const ::modlock::host_app::control::ServiceResult& _internal_service_applied() const; + ::modlock::host_app::control::ServiceResult* PROTOBUF_NONNULL _internal_mutable_service_applied(); + + public: + // .modlock.host_app.control.ModCallResult called = 13; + bool has_called() const; + private: + bool _internal_has_called() const; + + public: + void clear_called() ; + const ::modlock::host_app::control::ModCallResult& called() const; + [[nodiscard]] ::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE release_called(); + ::modlock::host_app::control::ModCallResult* PROTOBUF_NONNULL mutable_called(); + void set_allocated_called(::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_called(::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE unsafe_arena_release_called(); + + private: + const ::modlock::host_app::control::ModCallResult& _internal_called() const; + ::modlock::host_app::control::ModCallResult* PROTOBUF_NONNULL _internal_mutable_called(); + + public: + // .modlock.host_app.control.ServiceCall service_call = 14; + bool has_service_call() const; + private: + bool _internal_has_service_call() const; + + public: + void clear_service_call() ; + const ::modlock::host_app::control::ServiceCall& service_call() const; + [[nodiscard]] ::modlock::host_app::control::ServiceCall* PROTOBUF_NULLABLE release_service_call(); + ::modlock::host_app::control::ServiceCall* PROTOBUF_NONNULL mutable_service_call(); + void set_allocated_service_call(::modlock::host_app::control::ServiceCall* PROTOBUF_NULLABLE value); + void unsafe_arena_set_allocated_service_call(::modlock::host_app::control::ServiceCall* PROTOBUF_NULLABLE value); + ::modlock::host_app::control::ServiceCall* PROTOBUF_NULLABLE unsafe_arena_release_service_call(); + + private: + const ::modlock::host_app::control::ServiceCall& _internal_service_call() const; + ::modlock::host_app::control::ServiceCall* PROTOBUF_NONNULL _internal_mutable_service_call(); + + public: + void clear_body(); + BodyCase body_case() const; + // @@protoc_insertion_point(class_scope:modlock.host_app.control.HostEvent) + private: + class _Internal; + void set_has_started(); + void set_has_log(); + void set_has_failed(); + void set_has_joined(); + void set_has_ready(); + void set_has_ui(); + void set_has_left(); + void set_has_message(); + void set_has_chat(); + void set_has_calls(); + void set_has_slow_frame(); + void set_has_service_applied(); + void set_has_called(); + void set_has_service_call(); + inline bool has_body() const; + inline void clear_has_body(); + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 14, + 14, 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 HostEvent& from_msg); + union BodyUnion { + constexpr BodyUnion() : _constinit_{} {} + ::google::protobuf::internal::ConstantInitialized _constinit_; + ::google::protobuf::Message* PROTOBUF_NULLABLE started_; + ::google::protobuf::Message* PROTOBUF_NULLABLE log_; + ::google::protobuf::Message* PROTOBUF_NULLABLE failed_; + ::google::protobuf::Message* PROTOBUF_NULLABLE joined_; + ::google::protobuf::Message* PROTOBUF_NULLABLE ready_; + ::google::protobuf::Message* PROTOBUF_NULLABLE ui_; + ::google::protobuf::Message* PROTOBUF_NULLABLE left_; + ::google::protobuf::Message* PROTOBUF_NULLABLE message_; + ::google::protobuf::Message* PROTOBUF_NULLABLE chat_; + ::google::protobuf::Message* PROTOBUF_NULLABLE calls_; + ::google::protobuf::Message* PROTOBUF_NULLABLE slow_frame_; + ::google::protobuf::Message* PROTOBUF_NULLABLE service_applied_; + ::google::protobuf::Message* PROTOBUF_NULLABLE called_; + ::google::protobuf::Message* PROTOBUF_NULLABLE service_call_; + } body_; + ::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_2fhost_5fapp_2fcontrol_2fcontrol_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull HostEvent_class_data_; + +// =================================================================== + + + + +// =================================================================== + + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ControlRequest + +// .modlock.host_app.control.ReloadRequest reload = 1; +inline bool ControlRequest::has_reload() const { + return body_case() == kReload; +} +inline bool ControlRequest::_internal_has_reload() const { + return body_case() == kReload; +} +inline void ControlRequest::set_has_reload() { + _impl_._oneof_case_[0] = kReload; +} +inline void ControlRequest::clear_reload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (body_case() == kReload) { + if (GetArena() == nullptr) { + delete _impl_.body_.reload_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.reload_); + } + clear_has_body(); + } +} +inline ::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE ControlRequest::release_reload() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.ControlRequest.reload) + if (body_case() == kReload) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ReloadRequest*>(_impl_.body_.reload_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.reload_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::host_app::control::ReloadRequest& ControlRequest::_internal_reload() const { + return body_case() == kReload ? static_cast(*reinterpret_cast<::modlock::host_app::control::ReloadRequest*>(_impl_.body_.reload_)) + : reinterpret_cast(::modlock::host_app::control::_ReloadRequest_default_instance_); +} +inline const ::modlock::host_app::control::ReloadRequest& ControlRequest::reload() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ControlRequest.reload) + return _internal_reload(); +} +inline ::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE ControlRequest::unsafe_arena_release_reload() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.ControlRequest.reload) + if (body_case() == kReload) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ReloadRequest*>(_impl_.body_.reload_); + _impl_.body_.reload_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void ControlRequest::unsafe_arena_set_allocated_reload( + ::modlock::host_app::control::ReloadRequest* 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_body(); + if (value) { + set_has_reload(); + _impl_.body_.reload_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ControlRequest.reload) +} +inline ::modlock::host_app::control::ReloadRequest* PROTOBUF_NONNULL ControlRequest::_internal_mutable_reload() { + if (body_case() != kReload) { + clear_body(); + set_has_reload(); + _impl_.body_.reload_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ReloadRequest>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ReloadRequest*>(_impl_.body_.reload_); +} +inline ::modlock::host_app::control::ReloadRequest* PROTOBUF_NONNULL ControlRequest::mutable_reload() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::host_app::control::ReloadRequest* _msg = _internal_mutable_reload(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ControlRequest.reload) + return _msg; +} + +// .modlock.wasm.players.RolesTable roles = 2; +inline bool ControlRequest::has_roles() const { + return body_case() == kRoles; +} +inline bool ControlRequest::_internal_has_roles() const { + return body_case() == kRoles; +} +inline void ControlRequest::set_has_roles() { + _impl_._oneof_case_[0] = kRoles; +} +inline ::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE ControlRequest::release_roles() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.ControlRequest.roles) + if (body_case() == kRoles) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::wasm::players::RolesTable*>(_impl_.body_.roles_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.roles_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::wasm::players::RolesTable& ControlRequest::_internal_roles() const { + return body_case() == kRoles ? static_cast(*reinterpret_cast<::modlock::wasm::players::RolesTable*>(_impl_.body_.roles_)) + : reinterpret_cast(::modlock::wasm::players::_RolesTable_default_instance_); +} +inline const ::modlock::wasm::players::RolesTable& ControlRequest::roles() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ControlRequest.roles) + return _internal_roles(); +} +inline ::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE ControlRequest::unsafe_arena_release_roles() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.ControlRequest.roles) + if (body_case() == kRoles) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::wasm::players::RolesTable*>(_impl_.body_.roles_); + _impl_.body_.roles_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void ControlRequest::unsafe_arena_set_allocated_roles( + ::modlock::wasm::players::RolesTable* 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_body(); + if (value) { + set_has_roles(); + _impl_.body_.roles_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ControlRequest.roles) +} +inline ::modlock::wasm::players::RolesTable* PROTOBUF_NONNULL ControlRequest::_internal_mutable_roles() { + if (body_case() != kRoles) { + clear_body(); + set_has_roles(); + _impl_.body_.roles_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::players::RolesTable>(GetArena())); + } + return reinterpret_cast<::modlock::wasm::players::RolesTable*>(_impl_.body_.roles_); +} +inline ::modlock::wasm::players::RolesTable* PROTOBUF_NONNULL ControlRequest::mutable_roles() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::wasm::players::RolesTable* _msg = _internal_mutable_roles(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ControlRequest.roles) + return _msg; +} + +// .modlock.host_app.control.ServiceReply service = 3; +inline bool ControlRequest::has_service() const { + return body_case() == kService; +} +inline bool ControlRequest::_internal_has_service() const { + return body_case() == kService; +} +inline void ControlRequest::set_has_service() { + _impl_._oneof_case_[0] = kService; +} +inline void ControlRequest::clear_service() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (body_case() == kService) { + if (GetArena() == nullptr) { + delete _impl_.body_.service_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.service_); + } + clear_has_body(); + } +} +inline ::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE ControlRequest::release_service() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.ControlRequest.service) + if (body_case() == kService) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceReply*>(_impl_.body_.service_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.service_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::host_app::control::ServiceReply& ControlRequest::_internal_service() const { + return body_case() == kService ? static_cast(*reinterpret_cast<::modlock::host_app::control::ServiceReply*>(_impl_.body_.service_)) + : reinterpret_cast(::modlock::host_app::control::_ServiceReply_default_instance_); +} +inline const ::modlock::host_app::control::ServiceReply& ControlRequest::service() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ControlRequest.service) + return _internal_service(); +} +inline ::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE ControlRequest::unsafe_arena_release_service() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.ControlRequest.service) + if (body_case() == kService) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceReply*>(_impl_.body_.service_); + _impl_.body_.service_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void ControlRequest::unsafe_arena_set_allocated_service( + ::modlock::host_app::control::ServiceReply* 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_body(); + if (value) { + set_has_service(); + _impl_.body_.service_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ControlRequest.service) +} +inline ::modlock::host_app::control::ServiceReply* PROTOBUF_NONNULL ControlRequest::_internal_mutable_service() { + if (body_case() != kService) { + clear_body(); + set_has_service(); + _impl_.body_.service_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ServiceReply>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ServiceReply*>(_impl_.body_.service_); +} +inline ::modlock::host_app::control::ServiceReply* PROTOBUF_NONNULL ControlRequest::mutable_service() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::host_app::control::ServiceReply* _msg = _internal_mutable_service(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ControlRequest.service) + return _msg; +} + +// .modlock.host_app.control.ModCall call = 4; +inline bool ControlRequest::has_call() const { + return body_case() == kCall; +} +inline bool ControlRequest::_internal_has_call() const { + return body_case() == kCall; +} +inline void ControlRequest::set_has_call() { + _impl_._oneof_case_[0] = kCall; +} +inline void ControlRequest::clear_call() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (body_case() == kCall) { + if (GetArena() == nullptr) { + delete _impl_.body_.call_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.call_); + } + clear_has_body(); + } +} +inline ::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE ControlRequest::release_call() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.ControlRequest.call) + if (body_case() == kCall) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModCall*>(_impl_.body_.call_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.call_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::host_app::control::ModCall& ControlRequest::_internal_call() const { + return body_case() == kCall ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModCall*>(_impl_.body_.call_)) + : reinterpret_cast(::modlock::host_app::control::_ModCall_default_instance_); +} +inline const ::modlock::host_app::control::ModCall& ControlRequest::call() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ControlRequest.call) + return _internal_call(); +} +inline ::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE ControlRequest::unsafe_arena_release_call() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.ControlRequest.call) + if (body_case() == kCall) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModCall*>(_impl_.body_.call_); + _impl_.body_.call_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void ControlRequest::unsafe_arena_set_allocated_call( + ::modlock::host_app::control::ModCall* 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_body(); + if (value) { + set_has_call(); + _impl_.body_.call_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ControlRequest.call) +} +inline ::modlock::host_app::control::ModCall* PROTOBUF_NONNULL ControlRequest::_internal_mutable_call() { + if (body_case() != kCall) { + clear_body(); + set_has_call(); + _impl_.body_.call_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModCall>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ModCall*>(_impl_.body_.call_); +} +inline ::modlock::host_app::control::ModCall* PROTOBUF_NONNULL ControlRequest::mutable_call() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::host_app::control::ModCall* _msg = _internal_mutable_call(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ControlRequest.call) + return _msg; +} + +// .modlock.host_app.control.ServiceAnswer answer = 5; +inline bool ControlRequest::has_answer() const { + return body_case() == kAnswer; +} +inline bool ControlRequest::_internal_has_answer() const { + return body_case() == kAnswer; +} +inline void ControlRequest::set_has_answer() { + _impl_._oneof_case_[0] = kAnswer; +} +inline void ControlRequest::clear_answer() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (body_case() == kAnswer) { + if (GetArena() == nullptr) { + delete _impl_.body_.answer_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.answer_); + } + clear_has_body(); + } +} +inline ::modlock::host_app::control::ServiceAnswer* PROTOBUF_NULLABLE ControlRequest::release_answer() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.ControlRequest.answer) + if (body_case() == kAnswer) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceAnswer*>(_impl_.body_.answer_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.answer_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::host_app::control::ServiceAnswer& ControlRequest::_internal_answer() const { + return body_case() == kAnswer ? static_cast(*reinterpret_cast<::modlock::host_app::control::ServiceAnswer*>(_impl_.body_.answer_)) + : reinterpret_cast(::modlock::host_app::control::_ServiceAnswer_default_instance_); +} +inline const ::modlock::host_app::control::ServiceAnswer& ControlRequest::answer() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ControlRequest.answer) + return _internal_answer(); +} +inline ::modlock::host_app::control::ServiceAnswer* PROTOBUF_NULLABLE ControlRequest::unsafe_arena_release_answer() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.ControlRequest.answer) + if (body_case() == kAnswer) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceAnswer*>(_impl_.body_.answer_); + _impl_.body_.answer_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void ControlRequest::unsafe_arena_set_allocated_answer( + ::modlock::host_app::control::ServiceAnswer* 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_body(); + if (value) { + set_has_answer(); + _impl_.body_.answer_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ControlRequest.answer) +} +inline ::modlock::host_app::control::ServiceAnswer* PROTOBUF_NONNULL ControlRequest::_internal_mutable_answer() { + if (body_case() != kAnswer) { + clear_body(); + set_has_answer(); + _impl_.body_.answer_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ServiceAnswer>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ServiceAnswer*>(_impl_.body_.answer_); +} +inline ::modlock::host_app::control::ServiceAnswer* PROTOBUF_NONNULL ControlRequest::mutable_answer() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::host_app::control::ServiceAnswer* _msg = _internal_mutable_answer(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ControlRequest.answer) + return _msg; +} + +inline bool ControlRequest::has_body() const { + return body_case() != BODY_NOT_SET; +} +inline void ControlRequest::clear_has_body() { + _impl_._oneof_case_[0] = BODY_NOT_SET; +} +inline ControlRequest::BodyCase ControlRequest::body_case() const { + return ControlRequest::BodyCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// ModCall + +// string mod = 1; +inline void ModCall::clear_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& ModCall::mod() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCall.mod) + return _internal_mod(); +} +template +PROTOBUF_ALWAYS_INLINE void ModCall::set_mod(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.mod_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCall.mod) +} +inline ::std::string* PROTOBUF_NONNULL ModCall::mutable_mod() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_mod(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCall.mod) + return _s; +} +inline const ::std::string& ModCall::_internal_mod() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.mod_.Get(); +} +inline void ModCall::_internal_set_mod(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ModCall::_internal_mutable_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.mod_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModCall::release_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCall.mod) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.mod_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.mod_.Set("", GetArena()); + } + return released; +} +inline void ModCall::set_allocated_mod(::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_.mod_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { + _impl_.mod_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCall.mod) +} + +// string service = 2; +inline void ModCall::clear_service() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.service_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& ModCall::service() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCall.service) + return _internal_service(); +} +template +PROTOBUF_ALWAYS_INLINE void ModCall::set_service(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.service_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCall.service) +} +inline ::std::string* PROTOBUF_NONNULL ModCall::mutable_service() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_service(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCall.service) + return _s; +} +inline const ::std::string& ModCall::_internal_service() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.service_.Get(); +} +inline void ModCall::_internal_set_service(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.service_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ModCall::_internal_mutable_service() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.service_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModCall::release_service() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCall.service) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.service_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.service_.Set("", GetArena()); + } + return released; +} +inline void ModCall::set_allocated_service(::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_.service_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.service_.IsDefault()) { + _impl_.service_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCall.service) +} + +// string method = 3; +inline void ModCall::clear_method() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.method_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); +} +inline const ::std::string& ModCall::method() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCall.method) + return _internal_method(); +} +template +PROTOBUF_ALWAYS_INLINE void ModCall::set_method(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.method_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCall.method) +} +inline ::std::string* PROTOBUF_NONNULL ModCall::mutable_method() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_method(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCall.method) + return _s; +} +inline const ::std::string& ModCall::_internal_method() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.method_.Get(); +} +inline void ModCall::_internal_set_method(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.method_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ModCall::_internal_mutable_method() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.method_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModCall::release_method() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCall.method) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.method_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.method_.Set("", GetArena()); + } + return released; +} +inline void ModCall::set_allocated_method(::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_.method_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.method_.IsDefault()) { + _impl_.method_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCall.method) +} + +// bytes payload = 4; +inline void ModCall::clear_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.payload_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000008U); +} +inline const ::std::string& ModCall::payload() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCall.payload) + return _internal_payload(); +} +template +PROTOBUF_ALWAYS_INLINE void ModCall::set_payload(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCall.payload) +} +inline ::std::string* PROTOBUF_NONNULL ModCall::mutable_payload() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + ::std::string* _s = _internal_mutable_payload(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCall.payload) + return _s; +} +inline const ::std::string& ModCall::_internal_payload() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.payload_.Get(); +} +inline void ModCall::_internal_set_payload(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.payload_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ModCall::_internal_mutable_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.payload_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModCall::release_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCall.payload) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000008U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + auto* released = _impl_.payload_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.payload_.Set("", GetArena()); + } + return released; +} +inline void ModCall::set_allocated_payload(::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_.payload_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { + _impl_.payload_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCall.payload) +} + +// string id = 5; +inline void ModCall::clear_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000010U); +} +inline const ::std::string& ModCall::id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCall.id) + return _internal_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ModCall::set_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + _impl_.id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCall.id) +} +inline ::std::string* PROTOBUF_NONNULL ModCall::mutable_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + ::std::string* _s = _internal_mutable_id(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCall.id) + return _s; +} +inline const ::std::string& ModCall::_internal_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.id_.Get(); +} +inline void ModCall::_internal_set_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ModCall::_internal_mutable_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModCall::release_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCall.id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000010U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + auto* released = _impl_.id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.id_.Set("", GetArena()); + } + return released; +} +inline void ModCall::set_allocated_id(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + } + _impl_.id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.id_.IsDefault()) { + _impl_.id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCall.id) +} + +// ------------------------------------------------------------------- + +// ModCallResult + +// string id = 1; +inline void ModCallResult::clear_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& ModCallResult::id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCallResult.id) + return _internal_id(); +} +template +PROTOBUF_ALWAYS_INLINE void ModCallResult::set_id(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCallResult.id) +} +inline ::std::string* PROTOBUF_NONNULL ModCallResult::mutable_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_id(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCallResult.id) + return _s; +} +inline const ::std::string& ModCallResult::_internal_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.id_.Get(); +} +inline void ModCallResult::_internal_set_id(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.id_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ModCallResult::_internal_mutable_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.id_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModCallResult::release_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCallResult.id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.id_.Set("", GetArena()); + } + return released; +} +inline void ModCallResult::set_allocated_id(::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_.id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.id_.IsDefault()) { + _impl_.id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCallResult.id) +} + +// string mod = 2; +inline void ModCallResult::clear_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& ModCallResult::mod() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCallResult.mod) + return _internal_mod(); +} +template +PROTOBUF_ALWAYS_INLINE void ModCallResult::set_mod(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.mod_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCallResult.mod) +} +inline ::std::string* PROTOBUF_NONNULL ModCallResult::mutable_mod() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_mod(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCallResult.mod) + return _s; +} +inline const ::std::string& ModCallResult::_internal_mod() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.mod_.Get(); +} +inline void ModCallResult::_internal_set_mod(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ModCallResult::_internal_mutable_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.mod_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModCallResult::release_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCallResult.mod) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.mod_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.mod_.Set("", GetArena()); + } + return released; +} +inline void ModCallResult::set_allocated_mod(::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_.mod_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { + _impl_.mod_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCallResult.mod) +} + +// bytes payload = 3; +inline void ModCallResult::clear_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.payload_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); +} +inline const ::std::string& ModCallResult::payload() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCallResult.payload) + return _internal_payload(); +} +template +PROTOBUF_ALWAYS_INLINE void ModCallResult::set_payload(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCallResult.payload) +} +inline ::std::string* PROTOBUF_NONNULL ModCallResult::mutable_payload() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_payload(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCallResult.payload) + return _s; +} +inline const ::std::string& ModCallResult::_internal_payload() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.payload_.Get(); +} +inline void ModCallResult::_internal_set_payload(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.payload_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ModCallResult::_internal_mutable_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.payload_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModCallResult::release_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCallResult.payload) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.payload_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.payload_.Set("", GetArena()); + } + return released; +} +inline void ModCallResult::set_allocated_payload(::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_.payload_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { + _impl_.payload_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCallResult.payload) +} + +// string error = 4; +inline void ModCallResult::clear_error() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.error_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000008U); +} +inline const ::std::string& ModCallResult::error() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCallResult.error) + return _internal_error(); +} +template +PROTOBUF_ALWAYS_INLINE void ModCallResult::set_error(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + _impl_.error_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCallResult.error) +} +inline ::std::string* PROTOBUF_NONNULL ModCallResult::mutable_error() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + ::std::string* _s = _internal_mutable_error(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCallResult.error) + return _s; +} +inline const ::std::string& ModCallResult::_internal_error() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.error_.Get(); +} +inline void ModCallResult::_internal_set_error(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.error_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ModCallResult::_internal_mutable_error() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.error_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModCallResult::release_error() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCallResult.error) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000008U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + auto* released = _impl_.error_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.error_.Set("", GetArena()); + } + return released; +} +inline void ModCallResult::set_allocated_error(::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_.error_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.error_.IsDefault()) { + _impl_.error_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCallResult.error) +} + +// ------------------------------------------------------------------- + +// ReloadRequest + +// string path = 1; +inline void ReloadRequest::clear_path() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.path_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& ReloadRequest::path() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ReloadRequest.path) + return _internal_path(); +} +template +PROTOBUF_ALWAYS_INLINE void ReloadRequest::set_path(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.path_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ReloadRequest.path) +} +inline ::std::string* PROTOBUF_NONNULL ReloadRequest::mutable_path() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_path(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ReloadRequest.path) + return _s; +} +inline const ::std::string& ReloadRequest::_internal_path() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.path_.Get(); +} +inline void ReloadRequest::_internal_set_path(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.path_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ReloadRequest::_internal_mutable_path() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.path_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ReloadRequest::release_path() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ReloadRequest.path) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.path_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.path_.Set("", GetArena()); + } + return released; +} +inline void ReloadRequest::set_allocated_path(::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_.path_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.path_.IsDefault()) { + _impl_.path_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ReloadRequest.path) +} + +// ------------------------------------------------------------------- + +// HostEvent + +// .modlock.host_app.control.ModStarted started = 1; +inline bool HostEvent::has_started() const { + return body_case() == kStarted; +} +inline bool HostEvent::_internal_has_started() const { + return body_case() == kStarted; +} +inline void HostEvent::set_has_started() { + _impl_._oneof_case_[0] = kStarted; +} +inline void HostEvent::clear_started() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (body_case() == kStarted) { + if (GetArena() == nullptr) { + delete _impl_.body_.started_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.started_); + } + clear_has_body(); + } +} +inline ::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE HostEvent::release_started() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.started) + if (body_case() == kStarted) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModStarted*>(_impl_.body_.started_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.started_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::host_app::control::ModStarted& HostEvent::_internal_started() const { + return body_case() == kStarted ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModStarted*>(_impl_.body_.started_)) + : reinterpret_cast(::modlock::host_app::control::_ModStarted_default_instance_); +} +inline const ::modlock::host_app::control::ModStarted& HostEvent::started() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.started) + return _internal_started(); +} +inline ::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_started() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.started) + if (body_case() == kStarted) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModStarted*>(_impl_.body_.started_); + _impl_.body_.started_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void HostEvent::unsafe_arena_set_allocated_started( + ::modlock::host_app::control::ModStarted* 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_body(); + if (value) { + set_has_started(); + _impl_.body_.started_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.started) +} +inline ::modlock::host_app::control::ModStarted* PROTOBUF_NONNULL HostEvent::_internal_mutable_started() { + if (body_case() != kStarted) { + clear_body(); + set_has_started(); + _impl_.body_.started_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModStarted>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ModStarted*>(_impl_.body_.started_); +} +inline ::modlock::host_app::control::ModStarted* PROTOBUF_NONNULL HostEvent::mutable_started() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::host_app::control::ModStarted* _msg = _internal_mutable_started(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.started) + return _msg; +} + +// .modlock.host_app.control.ModLog log = 2; +inline bool HostEvent::has_log() const { + return body_case() == kLog; +} +inline bool HostEvent::_internal_has_log() const { + return body_case() == kLog; +} +inline void HostEvent::set_has_log() { + _impl_._oneof_case_[0] = kLog; +} +inline void HostEvent::clear_log() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (body_case() == kLog) { + if (GetArena() == nullptr) { + delete _impl_.body_.log_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.log_); + } + clear_has_body(); + } +} +inline ::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE HostEvent::release_log() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.log) + if (body_case() == kLog) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModLog*>(_impl_.body_.log_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.log_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::host_app::control::ModLog& HostEvent::_internal_log() const { + return body_case() == kLog ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModLog*>(_impl_.body_.log_)) + : reinterpret_cast(::modlock::host_app::control::_ModLog_default_instance_); +} +inline const ::modlock::host_app::control::ModLog& HostEvent::log() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.log) + return _internal_log(); +} +inline ::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_log() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.log) + if (body_case() == kLog) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModLog*>(_impl_.body_.log_); + _impl_.body_.log_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void HostEvent::unsafe_arena_set_allocated_log( + ::modlock::host_app::control::ModLog* 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_body(); + if (value) { + set_has_log(); + _impl_.body_.log_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.log) +} +inline ::modlock::host_app::control::ModLog* PROTOBUF_NONNULL HostEvent::_internal_mutable_log() { + if (body_case() != kLog) { + clear_body(); + set_has_log(); + _impl_.body_.log_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModLog>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ModLog*>(_impl_.body_.log_); +} +inline ::modlock::host_app::control::ModLog* PROTOBUF_NONNULL HostEvent::mutable_log() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::host_app::control::ModLog* _msg = _internal_mutable_log(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.log) + return _msg; +} + +// .modlock.host_app.control.ModFailed failed = 3; +inline bool HostEvent::has_failed() const { + return body_case() == kFailed; +} +inline bool HostEvent::_internal_has_failed() const { + return body_case() == kFailed; +} +inline void HostEvent::set_has_failed() { + _impl_._oneof_case_[0] = kFailed; +} +inline void HostEvent::clear_failed() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (body_case() == kFailed) { + if (GetArena() == nullptr) { + delete _impl_.body_.failed_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.failed_); + } + clear_has_body(); + } +} +inline ::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE HostEvent::release_failed() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.failed) + if (body_case() == kFailed) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModFailed*>(_impl_.body_.failed_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.failed_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::host_app::control::ModFailed& HostEvent::_internal_failed() const { + return body_case() == kFailed ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModFailed*>(_impl_.body_.failed_)) + : reinterpret_cast(::modlock::host_app::control::_ModFailed_default_instance_); +} +inline const ::modlock::host_app::control::ModFailed& HostEvent::failed() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.failed) + return _internal_failed(); +} +inline ::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_failed() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.failed) + if (body_case() == kFailed) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModFailed*>(_impl_.body_.failed_); + _impl_.body_.failed_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void HostEvent::unsafe_arena_set_allocated_failed( + ::modlock::host_app::control::ModFailed* 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_body(); + if (value) { + set_has_failed(); + _impl_.body_.failed_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.failed) +} +inline ::modlock::host_app::control::ModFailed* PROTOBUF_NONNULL HostEvent::_internal_mutable_failed() { + if (body_case() != kFailed) { + clear_body(); + set_has_failed(); + _impl_.body_.failed_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModFailed>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ModFailed*>(_impl_.body_.failed_); +} +inline ::modlock::host_app::control::ModFailed* PROTOBUF_NONNULL HostEvent::mutable_failed() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::host_app::control::ModFailed* _msg = _internal_mutable_failed(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.failed) + return _msg; +} + +// .modlock.host_app.control.PlayerJoined joined = 4; +inline bool HostEvent::has_joined() const { + return body_case() == kJoined; +} +inline bool HostEvent::_internal_has_joined() const { + return body_case() == kJoined; +} +inline void HostEvent::set_has_joined() { + _impl_._oneof_case_[0] = kJoined; +} +inline void HostEvent::clear_joined() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (body_case() == kJoined) { + if (GetArena() == nullptr) { + delete _impl_.body_.joined_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.joined_); + } + clear_has_body(); + } +} +inline ::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE HostEvent::release_joined() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.joined) + if (body_case() == kJoined) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerJoined*>(_impl_.body_.joined_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.joined_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::host_app::control::PlayerJoined& HostEvent::_internal_joined() const { + return body_case() == kJoined ? static_cast(*reinterpret_cast<::modlock::host_app::control::PlayerJoined*>(_impl_.body_.joined_)) + : reinterpret_cast(::modlock::host_app::control::_PlayerJoined_default_instance_); +} +inline const ::modlock::host_app::control::PlayerJoined& HostEvent::joined() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.joined) + return _internal_joined(); +} +inline ::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_joined() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.joined) + if (body_case() == kJoined) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerJoined*>(_impl_.body_.joined_); + _impl_.body_.joined_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void HostEvent::unsafe_arena_set_allocated_joined( + ::modlock::host_app::control::PlayerJoined* 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_body(); + if (value) { + set_has_joined(); + _impl_.body_.joined_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.joined) +} +inline ::modlock::host_app::control::PlayerJoined* PROTOBUF_NONNULL HostEvent::_internal_mutable_joined() { + if (body_case() != kJoined) { + clear_body(); + set_has_joined(); + _impl_.body_.joined_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::PlayerJoined>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::PlayerJoined*>(_impl_.body_.joined_); +} +inline ::modlock::host_app::control::PlayerJoined* PROTOBUF_NONNULL HostEvent::mutable_joined() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::host_app::control::PlayerJoined* _msg = _internal_mutable_joined(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.joined) + return _msg; +} + +// .modlock.host_app.control.ServerReady ready = 5; +inline bool HostEvent::has_ready() const { + return body_case() == kReady; +} +inline bool HostEvent::_internal_has_ready() const { + return body_case() == kReady; +} +inline void HostEvent::set_has_ready() { + _impl_._oneof_case_[0] = kReady; +} +inline void HostEvent::clear_ready() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (body_case() == kReady) { + if (GetArena() == nullptr) { + delete _impl_.body_.ready_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.ready_); + } + clear_has_body(); + } +} +inline ::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE HostEvent::release_ready() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.ready) + if (body_case() == kReady) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ServerReady*>(_impl_.body_.ready_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.ready_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::modlock::host_app::control::ServerReady& HostEvent::_internal_ready() const { + return body_case() == kReady ? static_cast(*reinterpret_cast<::modlock::host_app::control::ServerReady*>(_impl_.body_.ready_)) + : reinterpret_cast(::modlock::host_app::control::_ServerReady_default_instance_); +} +inline const ::modlock::host_app::control::ServerReady& HostEvent::ready() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.ready) + return _internal_ready(); +} +inline ::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_ready() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.ready) + if (body_case() == kReady) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ServerReady*>(_impl_.body_.ready_); + _impl_.body_.ready_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void HostEvent::unsafe_arena_set_allocated_ready( + ::modlock::host_app::control::ServerReady* 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_body(); + if (value) { + set_has_ready(); + _impl_.body_.ready_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.ready) +} +inline ::modlock::host_app::control::ServerReady* PROTOBUF_NONNULL HostEvent::_internal_mutable_ready() { + if (body_case() != kReady) { + clear_body(); + set_has_ready(); + _impl_.body_.ready_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ServerReady>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ServerReady*>(_impl_.body_.ready_); +} +inline ::modlock::host_app::control::ServerReady* PROTOBUF_NONNULL HostEvent::mutable_ready() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::modlock::host_app::control::ServerReady* _msg = _internal_mutable_ready(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.ready) + return _msg; +} -// .modlock.host_app.control.ReloadRequest reload = 1; -inline bool ControlRequest::has_reload() const { - return body_case() == kReload; +// .modlock.host_app.control.UiChanged ui = 6; +inline bool HostEvent::has_ui() const { + return body_case() == kUi; } -inline bool ControlRequest::_internal_has_reload() const { - return body_case() == kReload; +inline bool HostEvent::_internal_has_ui() const { + return body_case() == kUi; } -inline void ControlRequest::set_has_reload() { - _impl_._oneof_case_[0] = kReload; +inline void HostEvent::set_has_ui() { + _impl_._oneof_case_[0] = kUi; } -inline void ControlRequest::clear_reload() { +inline void HostEvent::clear_ui() { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kReload) { + if (body_case() == kUi) { if (GetArena() == nullptr) { - delete _impl_.body_.reload_; + delete _impl_.body_.ui_; } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.reload_); + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.ui_); } clear_has_body(); } } -inline ::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE ControlRequest::release_reload() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.ControlRequest.reload) - if (body_case() == kReload) { +inline ::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE HostEvent::release_ui() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.ui) + if (body_case() == kUi) { clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ReloadRequest*>(_impl_.body_.reload_); + auto* temp = reinterpret_cast<::modlock::host_app::control::UiChanged*>(_impl_.body_.ui_); if (GetArena() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - _impl_.body_.reload_ = nullptr; + _impl_.body_.ui_ = nullptr; return temp; } else { return nullptr; } } -inline const ::modlock::host_app::control::ReloadRequest& ControlRequest::_internal_reload() const { - return body_case() == kReload ? static_cast(*reinterpret_cast<::modlock::host_app::control::ReloadRequest*>(_impl_.body_.reload_)) - : reinterpret_cast(::modlock::host_app::control::_ReloadRequest_default_instance_); +inline const ::modlock::host_app::control::UiChanged& HostEvent::_internal_ui() const { + return body_case() == kUi ? static_cast(*reinterpret_cast<::modlock::host_app::control::UiChanged*>(_impl_.body_.ui_)) + : reinterpret_cast(::modlock::host_app::control::_UiChanged_default_instance_); } -inline const ::modlock::host_app::control::ReloadRequest& ControlRequest::reload() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ControlRequest.reload) - return _internal_reload(); +inline const ::modlock::host_app::control::UiChanged& HostEvent::ui() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.ui) + return _internal_ui(); } -inline ::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE ControlRequest::unsafe_arena_release_reload() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.ControlRequest.reload) - if (body_case() == kReload) { +inline ::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_ui() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.ui) + if (body_case() == kUi) { clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ReloadRequest*>(_impl_.body_.reload_); - _impl_.body_.reload_ = nullptr; + auto* temp = reinterpret_cast<::modlock::host_app::control::UiChanged*>(_impl_.body_.ui_); + _impl_.body_.ui_ = nullptr; return temp; } else { return nullptr; } } -inline void ControlRequest::unsafe_arena_set_allocated_reload( - ::modlock::host_app::control::ReloadRequest* PROTOBUF_NULLABLE value) { +inline void HostEvent::unsafe_arena_set_allocated_ui( + ::modlock::host_app::control::UiChanged* 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_body(); if (value) { - set_has_reload(); - _impl_.body_.reload_ = reinterpret_cast<::google::protobuf::Message*>(value); + set_has_ui(); + _impl_.body_.ui_ = reinterpret_cast<::google::protobuf::Message*>(value); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ControlRequest.reload) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.ui) } -inline ::modlock::host_app::control::ReloadRequest* PROTOBUF_NONNULL ControlRequest::_internal_mutable_reload() { - if (body_case() != kReload) { +inline ::modlock::host_app::control::UiChanged* PROTOBUF_NONNULL HostEvent::_internal_mutable_ui() { + if (body_case() != kUi) { clear_body(); - set_has_reload(); - _impl_.body_.reload_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ReloadRequest>(GetArena())); + set_has_ui(); + _impl_.body_.ui_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::UiChanged>(GetArena())); } - return reinterpret_cast<::modlock::host_app::control::ReloadRequest*>(_impl_.body_.reload_); + return reinterpret_cast<::modlock::host_app::control::UiChanged*>(_impl_.body_.ui_); } -inline ::modlock::host_app::control::ReloadRequest* PROTOBUF_NONNULL ControlRequest::mutable_reload() +inline ::modlock::host_app::control::UiChanged* PROTOBUF_NONNULL HostEvent::mutable_ui() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ReloadRequest* _msg = _internal_mutable_reload(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ControlRequest.reload) + ::modlock::host_app::control::UiChanged* _msg = _internal_mutable_ui(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.ui) return _msg; } -// .modlock.wasm.players.RolesTable roles = 2; -inline bool ControlRequest::has_roles() const { - return body_case() == kRoles; +// .modlock.host_app.control.PlayerLeft left = 7; +inline bool HostEvent::has_left() const { + return body_case() == kLeft; } -inline bool ControlRequest::_internal_has_roles() const { - return body_case() == kRoles; +inline bool HostEvent::_internal_has_left() const { + return body_case() == kLeft; } -inline void ControlRequest::set_has_roles() { - _impl_._oneof_case_[0] = kRoles; +inline void HostEvent::set_has_left() { + _impl_._oneof_case_[0] = kLeft; } -inline ::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE ControlRequest::release_roles() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.ControlRequest.roles) - if (body_case() == kRoles) { +inline void HostEvent::clear_left() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (body_case() == kLeft) { + if (GetArena() == nullptr) { + delete _impl_.body_.left_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.left_); + } clear_has_body(); - auto* temp = reinterpret_cast<::modlock::wasm::players::RolesTable*>(_impl_.body_.roles_); + } +} +inline ::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE HostEvent::release_left() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.left) + if (body_case() == kLeft) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerLeft*>(_impl_.body_.left_); if (GetArena() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - _impl_.body_.roles_ = nullptr; + _impl_.body_.left_ = nullptr; return temp; } else { return nullptr; } } -inline const ::modlock::wasm::players::RolesTable& ControlRequest::_internal_roles() const { - return body_case() == kRoles ? static_cast(*reinterpret_cast<::modlock::wasm::players::RolesTable*>(_impl_.body_.roles_)) - : reinterpret_cast(::modlock::wasm::players::_RolesTable_default_instance_); +inline const ::modlock::host_app::control::PlayerLeft& HostEvent::_internal_left() const { + return body_case() == kLeft ? static_cast(*reinterpret_cast<::modlock::host_app::control::PlayerLeft*>(_impl_.body_.left_)) + : reinterpret_cast(::modlock::host_app::control::_PlayerLeft_default_instance_); } -inline const ::modlock::wasm::players::RolesTable& ControlRequest::roles() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ControlRequest.roles) - return _internal_roles(); +inline const ::modlock::host_app::control::PlayerLeft& HostEvent::left() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.left) + return _internal_left(); } -inline ::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE ControlRequest::unsafe_arena_release_roles() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.ControlRequest.roles) - if (body_case() == kRoles) { +inline ::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_left() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.left) + if (body_case() == kLeft) { clear_has_body(); - auto* temp = reinterpret_cast<::modlock::wasm::players::RolesTable*>(_impl_.body_.roles_); - _impl_.body_.roles_ = nullptr; + auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerLeft*>(_impl_.body_.left_); + _impl_.body_.left_ = nullptr; return temp; } else { return nullptr; } } -inline void ControlRequest::unsafe_arena_set_allocated_roles( - ::modlock::wasm::players::RolesTable* PROTOBUF_NULLABLE value) { +inline void HostEvent::unsafe_arena_set_allocated_left( + ::modlock::host_app::control::PlayerLeft* 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_body(); if (value) { - set_has_roles(); - _impl_.body_.roles_ = reinterpret_cast<::google::protobuf::Message*>(value); + set_has_left(); + _impl_.body_.left_ = reinterpret_cast<::google::protobuf::Message*>(value); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ControlRequest.roles) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.left) } -inline ::modlock::wasm::players::RolesTable* PROTOBUF_NONNULL ControlRequest::_internal_mutable_roles() { - if (body_case() != kRoles) { +inline ::modlock::host_app::control::PlayerLeft* PROTOBUF_NONNULL HostEvent::_internal_mutable_left() { + if (body_case() != kLeft) { clear_body(); - set_has_roles(); - _impl_.body_.roles_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::players::RolesTable>(GetArena())); + set_has_left(); + _impl_.body_.left_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::PlayerLeft>(GetArena())); } - return reinterpret_cast<::modlock::wasm::players::RolesTable*>(_impl_.body_.roles_); + return reinterpret_cast<::modlock::host_app::control::PlayerLeft*>(_impl_.body_.left_); } -inline ::modlock::wasm::players::RolesTable* PROTOBUF_NONNULL ControlRequest::mutable_roles() +inline ::modlock::host_app::control::PlayerLeft* PROTOBUF_NONNULL HostEvent::mutable_left() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::wasm::players::RolesTable* _msg = _internal_mutable_roles(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ControlRequest.roles) + ::modlock::host_app::control::PlayerLeft* _msg = _internal_mutable_left(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.left) return _msg; } -// .modlock.host_app.control.ServiceReply service = 3; -inline bool ControlRequest::has_service() const { - return body_case() == kService; +// .modlock.host_app.control.PlayerMessage message = 8; +inline bool HostEvent::has_message() const { + return body_case() == kMessage; } -inline bool ControlRequest::_internal_has_service() const { - return body_case() == kService; +inline bool HostEvent::_internal_has_message() const { + return body_case() == kMessage; } -inline void ControlRequest::set_has_service() { - _impl_._oneof_case_[0] = kService; +inline void HostEvent::set_has_message() { + _impl_._oneof_case_[0] = kMessage; } -inline void ControlRequest::clear_service() { +inline void HostEvent::clear_message() { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kService) { + if (body_case() == kMessage) { if (GetArena() == nullptr) { - delete _impl_.body_.service_; + delete _impl_.body_.message_; } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.service_); + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.message_); } clear_has_body(); } -} -inline ::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE ControlRequest::release_service() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.ControlRequest.service) - if (body_case() == kService) { +} +inline ::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE HostEvent::release_message() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.message) + if (body_case() == kMessage) { clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceReply*>(_impl_.body_.service_); + auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerMessage*>(_impl_.body_.message_); if (GetArena() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - _impl_.body_.service_ = nullptr; + _impl_.body_.message_ = nullptr; return temp; } else { return nullptr; } } -inline const ::modlock::host_app::control::ServiceReply& ControlRequest::_internal_service() const { - return body_case() == kService ? static_cast(*reinterpret_cast<::modlock::host_app::control::ServiceReply*>(_impl_.body_.service_)) - : reinterpret_cast(::modlock::host_app::control::_ServiceReply_default_instance_); +inline const ::modlock::host_app::control::PlayerMessage& HostEvent::_internal_message() const { + return body_case() == kMessage ? static_cast(*reinterpret_cast<::modlock::host_app::control::PlayerMessage*>(_impl_.body_.message_)) + : reinterpret_cast(::modlock::host_app::control::_PlayerMessage_default_instance_); } -inline const ::modlock::host_app::control::ServiceReply& ControlRequest::service() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ControlRequest.service) - return _internal_service(); +inline const ::modlock::host_app::control::PlayerMessage& HostEvent::message() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.message) + return _internal_message(); } -inline ::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE ControlRequest::unsafe_arena_release_service() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.ControlRequest.service) - if (body_case() == kService) { +inline ::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_message() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.message) + if (body_case() == kMessage) { clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceReply*>(_impl_.body_.service_); - _impl_.body_.service_ = nullptr; + auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerMessage*>(_impl_.body_.message_); + _impl_.body_.message_ = nullptr; return temp; } else { return nullptr; } } -inline void ControlRequest::unsafe_arena_set_allocated_service( - ::modlock::host_app::control::ServiceReply* PROTOBUF_NULLABLE value) { +inline void HostEvent::unsafe_arena_set_allocated_message( + ::modlock::host_app::control::PlayerMessage* 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_body(); if (value) { - set_has_service(); - _impl_.body_.service_ = reinterpret_cast<::google::protobuf::Message*>(value); + set_has_message(); + _impl_.body_.message_ = reinterpret_cast<::google::protobuf::Message*>(value); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ControlRequest.service) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.message) } -inline ::modlock::host_app::control::ServiceReply* PROTOBUF_NONNULL ControlRequest::_internal_mutable_service() { - if (body_case() != kService) { +inline ::modlock::host_app::control::PlayerMessage* PROTOBUF_NONNULL HostEvent::_internal_mutable_message() { + if (body_case() != kMessage) { clear_body(); - set_has_service(); - _impl_.body_.service_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ServiceReply>(GetArena())); + set_has_message(); + _impl_.body_.message_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::PlayerMessage>(GetArena())); } - return reinterpret_cast<::modlock::host_app::control::ServiceReply*>(_impl_.body_.service_); + return reinterpret_cast<::modlock::host_app::control::PlayerMessage*>(_impl_.body_.message_); } -inline ::modlock::host_app::control::ServiceReply* PROTOBUF_NONNULL ControlRequest::mutable_service() +inline ::modlock::host_app::control::PlayerMessage* PROTOBUF_NONNULL HostEvent::mutable_message() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ServiceReply* _msg = _internal_mutable_service(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ControlRequest.service) + ::modlock::host_app::control::PlayerMessage* _msg = _internal_mutable_message(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.message) return _msg; } -// .modlock.host_app.control.ModCall call = 4; -inline bool ControlRequest::has_call() const { - return body_case() == kCall; +// .modlock.host_app.control.PlayerChat chat = 9; +inline bool HostEvent::has_chat() const { + return body_case() == kChat; } -inline bool ControlRequest::_internal_has_call() const { - return body_case() == kCall; +inline bool HostEvent::_internal_has_chat() const { + return body_case() == kChat; } -inline void ControlRequest::set_has_call() { - _impl_._oneof_case_[0] = kCall; +inline void HostEvent::set_has_chat() { + _impl_._oneof_case_[0] = kChat; } -inline void ControlRequest::clear_call() { +inline void HostEvent::clear_chat() { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kCall) { + if (body_case() == kChat) { if (GetArena() == nullptr) { - delete _impl_.body_.call_; + delete _impl_.body_.chat_; } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.call_); + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.chat_); } clear_has_body(); } } -inline ::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE ControlRequest::release_call() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.ControlRequest.call) - if (body_case() == kCall) { +inline ::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE HostEvent::release_chat() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.chat) + if (body_case() == kChat) { clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModCall*>(_impl_.body_.call_); + auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerChat*>(_impl_.body_.chat_); if (GetArena() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - _impl_.body_.call_ = nullptr; + _impl_.body_.chat_ = nullptr; return temp; } else { return nullptr; } } -inline const ::modlock::host_app::control::ModCall& ControlRequest::_internal_call() const { - return body_case() == kCall ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModCall*>(_impl_.body_.call_)) - : reinterpret_cast(::modlock::host_app::control::_ModCall_default_instance_); +inline const ::modlock::host_app::control::PlayerChat& HostEvent::_internal_chat() const { + return body_case() == kChat ? static_cast(*reinterpret_cast<::modlock::host_app::control::PlayerChat*>(_impl_.body_.chat_)) + : reinterpret_cast(::modlock::host_app::control::_PlayerChat_default_instance_); } -inline const ::modlock::host_app::control::ModCall& ControlRequest::call() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ControlRequest.call) - return _internal_call(); +inline const ::modlock::host_app::control::PlayerChat& HostEvent::chat() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.chat) + return _internal_chat(); } -inline ::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE ControlRequest::unsafe_arena_release_call() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.ControlRequest.call) - if (body_case() == kCall) { +inline ::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_chat() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.chat) + if (body_case() == kChat) { clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModCall*>(_impl_.body_.call_); - _impl_.body_.call_ = nullptr; + auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerChat*>(_impl_.body_.chat_); + _impl_.body_.chat_ = nullptr; return temp; } else { return nullptr; } } -inline void ControlRequest::unsafe_arena_set_allocated_call( - ::modlock::host_app::control::ModCall* PROTOBUF_NULLABLE value) { +inline void HostEvent::unsafe_arena_set_allocated_chat( + ::modlock::host_app::control::PlayerChat* 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_body(); if (value) { - set_has_call(); - _impl_.body_.call_ = reinterpret_cast<::google::protobuf::Message*>(value); + set_has_chat(); + _impl_.body_.chat_ = reinterpret_cast<::google::protobuf::Message*>(value); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ControlRequest.call) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.chat) } -inline ::modlock::host_app::control::ModCall* PROTOBUF_NONNULL ControlRequest::_internal_mutable_call() { - if (body_case() != kCall) { +inline ::modlock::host_app::control::PlayerChat* PROTOBUF_NONNULL HostEvent::_internal_mutable_chat() { + if (body_case() != kChat) { clear_body(); - set_has_call(); - _impl_.body_.call_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModCall>(GetArena())); + set_has_chat(); + _impl_.body_.chat_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::PlayerChat>(GetArena())); } - return reinterpret_cast<::modlock::host_app::control::ModCall*>(_impl_.body_.call_); + return reinterpret_cast<::modlock::host_app::control::PlayerChat*>(_impl_.body_.chat_); } -inline ::modlock::host_app::control::ModCall* PROTOBUF_NONNULL ControlRequest::mutable_call() +inline ::modlock::host_app::control::PlayerChat* PROTOBUF_NONNULL HostEvent::mutable_chat() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ModCall* _msg = _internal_mutable_call(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ControlRequest.call) + ::modlock::host_app::control::PlayerChat* _msg = _internal_mutable_chat(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.chat) return _msg; } -inline bool ControlRequest::has_body() const { - return body_case() != BODY_NOT_SET; -} -inline void ControlRequest::clear_has_body() { - _impl_._oneof_case_[0] = BODY_NOT_SET; -} -inline ControlRequest::BodyCase ControlRequest::body_case() const { - return ControlRequest::BodyCase(_impl_._oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// ModCall - -// string mod = 1; -inline void ModCall::clear_mod() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.mod_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], - 0x00000001U); -} -inline const ::std::string& ModCall::mod() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCall.mod) - return _internal_mod(); -} -template -PROTOBUF_ALWAYS_INLINE void ModCall::set_mod(Arg_&& arg, Args_... args) { - ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - _impl_.mod_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCall.mod) -} -inline ::std::string* PROTOBUF_NONNULL ModCall::mutable_mod() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_mod(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCall.mod) - return _s; -} -inline const ::std::string& ModCall::_internal_mod() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.mod_.Get(); -} -inline void ModCall::_internal_set_mod(const ::std::string& value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.mod_.Set(value, GetArena()); -} -inline ::std::string* PROTOBUF_NONNULL ModCall::_internal_mutable_mod() { - ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.mod_.Mutable( GetArena()); -} -inline ::std::string* PROTOBUF_NULLABLE ModCall::release_mod() { - ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCall.mod) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { - return nullptr; - } - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.mod_.Release(); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.mod_.Set("", GetArena()); - } - return released; -} -inline void ModCall::set_allocated_mod(::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_.mod_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { - _impl_.mod_.Set("", GetArena()); - } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCall.mod) -} - -// string service = 2; -inline void ModCall::clear_service() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.service_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], - 0x00000002U); -} -inline const ::std::string& ModCall::service() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCall.service) - return _internal_service(); -} -template -PROTOBUF_ALWAYS_INLINE void ModCall::set_service(Arg_&& arg, Args_... args) { - ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - _impl_.service_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCall.service) -} -inline ::std::string* PROTOBUF_NONNULL ModCall::mutable_service() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - ::std::string* _s = _internal_mutable_service(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCall.service) - return _s; +// .modlock.host_app.control.ModCalls calls = 10; +inline bool HostEvent::has_calls() const { + return body_case() == kCalls; } -inline const ::std::string& ModCall::_internal_service() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.service_.Get(); +inline bool HostEvent::_internal_has_calls() const { + return body_case() == kCalls; } -inline void ModCall::_internal_set_service(const ::std::string& value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.service_.Set(value, GetArena()); +inline void HostEvent::set_has_calls() { + _impl_._oneof_case_[0] = kCalls; } -inline ::std::string* PROTOBUF_NONNULL ModCall::_internal_mutable_service() { +inline void HostEvent::clear_calls() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.service_.Mutable( GetArena()); + if (body_case() == kCalls) { + if (GetArena() == nullptr) { + delete _impl_.body_.calls_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.calls_); + } + clear_has_body(); + } } -inline ::std::string* PROTOBUF_NULLABLE ModCall::release_service() { - ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCall.service) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { +inline ::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE HostEvent::release_calls() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.calls) + if (body_case() == kCalls) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModCalls*>(_impl_.body_.calls_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.calls_ = nullptr; + return temp; + } else { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - auto* released = _impl_.service_.Release(); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.service_.Set("", GetArena()); - } - return released; } -inline void ModCall::set_allocated_service(::std::string* PROTOBUF_NULLABLE value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); +inline const ::modlock::host_app::control::ModCalls& HostEvent::_internal_calls() const { + return body_case() == kCalls ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModCalls*>(_impl_.body_.calls_)) + : reinterpret_cast(::modlock::host_app::control::_ModCalls_default_instance_); +} +inline const ::modlock::host_app::control::ModCalls& HostEvent::calls() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.calls) + return _internal_calls(); +} +inline ::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_calls() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.calls) + if (body_case() == kCalls) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModCalls*>(_impl_.body_.calls_); + _impl_.body_.calls_ = nullptr; + return temp; } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + return nullptr; } - _impl_.service_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.service_.IsDefault()) { - _impl_.service_.Set("", GetArena()); +} +inline void HostEvent::unsafe_arena_set_allocated_calls( + ::modlock::host_app::control::ModCalls* 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_body(); + if (value) { + set_has_calls(); + _impl_.body_.calls_ = reinterpret_cast<::google::protobuf::Message*>(value); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCall.service) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.calls) } - -// string method = 3; -inline void ModCall::clear_method() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.method_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], - 0x00000004U); +inline ::modlock::host_app::control::ModCalls* PROTOBUF_NONNULL HostEvent::_internal_mutable_calls() { + if (body_case() != kCalls) { + clear_body(); + set_has_calls(); + _impl_.body_.calls_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModCalls>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ModCalls*>(_impl_.body_.calls_); } -inline const ::std::string& ModCall::method() const +inline ::modlock::host_app::control::ModCalls* PROTOBUF_NONNULL HostEvent::mutable_calls() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCall.method) - return _internal_method(); -} -template -PROTOBUF_ALWAYS_INLINE void ModCall::set_method(Arg_&& arg, Args_... args) { - ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000004U); - _impl_.method_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCall.method) + ::modlock::host_app::control::ModCalls* _msg = _internal_mutable_calls(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.calls) + return _msg; } -inline ::std::string* PROTOBUF_NONNULL ModCall::mutable_method() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000004U); - ::std::string* _s = _internal_mutable_method(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCall.method) - return _s; + +// .modlock.host_app.control.ModSlowFrame slow_frame = 11; +inline bool HostEvent::has_slow_frame() const { + return body_case() == kSlowFrame; } -inline const ::std::string& ModCall::_internal_method() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.method_.Get(); +inline bool HostEvent::_internal_has_slow_frame() const { + return body_case() == kSlowFrame; } -inline void ModCall::_internal_set_method(const ::std::string& value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.method_.Set(value, GetArena()); +inline void HostEvent::set_has_slow_frame() { + _impl_._oneof_case_[0] = kSlowFrame; } -inline ::std::string* PROTOBUF_NONNULL ModCall::_internal_mutable_method() { +inline void HostEvent::clear_slow_frame() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.method_.Mutable( GetArena()); + if (body_case() == kSlowFrame) { + if (GetArena() == nullptr) { + delete _impl_.body_.slow_frame_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.slow_frame_); + } + clear_has_body(); + } } -inline ::std::string* PROTOBUF_NULLABLE ModCall::release_method() { - ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCall.method) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { +inline ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE HostEvent::release_slow_frame() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.slow_frame) + if (body_case() == kSlowFrame) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModSlowFrame*>(_impl_.body_.slow_frame_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.slow_frame_ = nullptr; + return temp; + } else { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); - auto* released = _impl_.method_.Release(); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.method_.Set("", GetArena()); - } - return released; } -inline void ModCall::set_allocated_method(::std::string* PROTOBUF_NULLABLE value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000004U); +inline const ::modlock::host_app::control::ModSlowFrame& HostEvent::_internal_slow_frame() const { + return body_case() == kSlowFrame ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModSlowFrame*>(_impl_.body_.slow_frame_)) + : reinterpret_cast(::modlock::host_app::control::_ModSlowFrame_default_instance_); +} +inline const ::modlock::host_app::control::ModSlowFrame& HostEvent::slow_frame() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.slow_frame) + return _internal_slow_frame(); +} +inline ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_slow_frame() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.slow_frame) + if (body_case() == kSlowFrame) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModSlowFrame*>(_impl_.body_.slow_frame_); + _impl_.body_.slow_frame_ = nullptr; + return temp; } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + return nullptr; } - _impl_.method_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.method_.IsDefault()) { - _impl_.method_.Set("", GetArena()); +} +inline void HostEvent::unsafe_arena_set_allocated_slow_frame( + ::modlock::host_app::control::ModSlowFrame* 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_body(); + if (value) { + set_has_slow_frame(); + _impl_.body_.slow_frame_ = reinterpret_cast<::google::protobuf::Message*>(value); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCall.method) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.slow_frame) } - -// bytes payload = 4; -inline void ModCall::clear_payload() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.payload_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], - 0x00000008U); +inline ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NONNULL HostEvent::_internal_mutable_slow_frame() { + if (body_case() != kSlowFrame) { + clear_body(); + set_has_slow_frame(); + _impl_.body_.slow_frame_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModSlowFrame>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ModSlowFrame*>(_impl_.body_.slow_frame_); } -inline const ::std::string& ModCall::payload() const +inline ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NONNULL HostEvent::mutable_slow_frame() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCall.payload) - return _internal_payload(); -} -template -PROTOBUF_ALWAYS_INLINE void ModCall::set_payload(Arg_&& arg, Args_... args) { - ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000008U); - _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCall.payload) + ::modlock::host_app::control::ModSlowFrame* _msg = _internal_mutable_slow_frame(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.slow_frame) + return _msg; } -inline ::std::string* PROTOBUF_NONNULL ModCall::mutable_payload() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000008U); - ::std::string* _s = _internal_mutable_payload(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCall.payload) - return _s; + +// .modlock.host_app.control.ServiceResult service_applied = 12; +inline bool HostEvent::has_service_applied() const { + return body_case() == kServiceApplied; } -inline const ::std::string& ModCall::_internal_payload() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.payload_.Get(); +inline bool HostEvent::_internal_has_service_applied() const { + return body_case() == kServiceApplied; } -inline void ModCall::_internal_set_payload(const ::std::string& value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.payload_.Set(value, GetArena()); +inline void HostEvent::set_has_service_applied() { + _impl_._oneof_case_[0] = kServiceApplied; } -inline ::std::string* PROTOBUF_NONNULL ModCall::_internal_mutable_payload() { +inline void HostEvent::clear_service_applied() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.payload_.Mutable( GetArena()); + if (body_case() == kServiceApplied) { + if (GetArena() == nullptr) { + delete _impl_.body_.service_applied_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.service_applied_); + } + clear_has_body(); + } } -inline ::std::string* PROTOBUF_NULLABLE ModCall::release_payload() { - ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCall.payload) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000008U)) { +inline ::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE HostEvent::release_service_applied() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.service_applied) + if (body_case() == kServiceApplied) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceResult*>(_impl_.body_.service_applied_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.service_applied_ = nullptr; + return temp; + } else { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000008U); - auto* released = _impl_.payload_.Release(); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.payload_.Set("", GetArena()); - } - return released; } -inline void ModCall::set_allocated_payload(::std::string* PROTOBUF_NULLABLE value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000008U); +inline const ::modlock::host_app::control::ServiceResult& HostEvent::_internal_service_applied() const { + return body_case() == kServiceApplied ? static_cast(*reinterpret_cast<::modlock::host_app::control::ServiceResult*>(_impl_.body_.service_applied_)) + : reinterpret_cast(::modlock::host_app::control::_ServiceResult_default_instance_); +} +inline const ::modlock::host_app::control::ServiceResult& HostEvent::service_applied() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.service_applied) + return _internal_service_applied(); +} +inline ::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_service_applied() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.service_applied) + if (body_case() == kServiceApplied) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceResult*>(_impl_.body_.service_applied_); + _impl_.body_.service_applied_ = nullptr; + return temp; } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + return nullptr; } - _impl_.payload_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { - _impl_.payload_.Set("", GetArena()); +} +inline void HostEvent::unsafe_arena_set_allocated_service_applied( + ::modlock::host_app::control::ServiceResult* 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_body(); + if (value) { + set_has_service_applied(); + _impl_.body_.service_applied_ = reinterpret_cast<::google::protobuf::Message*>(value); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCall.payload) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.service_applied) } - -// string id = 5; -inline void ModCall::clear_id() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.id_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], - 0x00000010U); +inline ::modlock::host_app::control::ServiceResult* PROTOBUF_NONNULL HostEvent::_internal_mutable_service_applied() { + if (body_case() != kServiceApplied) { + clear_body(); + set_has_service_applied(); + _impl_.body_.service_applied_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ServiceResult>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ServiceResult*>(_impl_.body_.service_applied_); } -inline const ::std::string& ModCall::id() const +inline ::modlock::host_app::control::ServiceResult* PROTOBUF_NONNULL HostEvent::mutable_service_applied() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCall.id) - return _internal_id(); -} -template -PROTOBUF_ALWAYS_INLINE void ModCall::set_id(Arg_&& arg, Args_... args) { - ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000010U); - _impl_.id_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCall.id) + ::modlock::host_app::control::ServiceResult* _msg = _internal_mutable_service_applied(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.service_applied) + return _msg; } -inline ::std::string* PROTOBUF_NONNULL ModCall::mutable_id() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000010U); - ::std::string* _s = _internal_mutable_id(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCall.id) - return _s; + +// .modlock.host_app.control.ModCallResult called = 13; +inline bool HostEvent::has_called() const { + return body_case() == kCalled; } -inline const ::std::string& ModCall::_internal_id() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.id_.Get(); +inline bool HostEvent::_internal_has_called() const { + return body_case() == kCalled; } -inline void ModCall::_internal_set_id(const ::std::string& value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.id_.Set(value, GetArena()); +inline void HostEvent::set_has_called() { + _impl_._oneof_case_[0] = kCalled; } -inline ::std::string* PROTOBUF_NONNULL ModCall::_internal_mutable_id() { +inline void HostEvent::clear_called() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.id_.Mutable( GetArena()); + if (body_case() == kCalled) { + if (GetArena() == nullptr) { + delete _impl_.body_.called_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.called_); + } + clear_has_body(); + } } -inline ::std::string* PROTOBUF_NULLABLE ModCall::release_id() { - ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCall.id) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000010U)) { +inline ::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE HostEvent::release_called() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.called) + if (body_case() == kCalled) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModCallResult*>(_impl_.body_.called_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.called_ = nullptr; + return temp; + } else { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000010U); - auto* released = _impl_.id_.Release(); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.id_.Set("", GetArena()); - } - return released; } -inline void ModCall::set_allocated_id(::std::string* PROTOBUF_NULLABLE value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000010U); +inline const ::modlock::host_app::control::ModCallResult& HostEvent::_internal_called() const { + return body_case() == kCalled ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModCallResult*>(_impl_.body_.called_)) + : reinterpret_cast(::modlock::host_app::control::_ModCallResult_default_instance_); +} +inline const ::modlock::host_app::control::ModCallResult& HostEvent::called() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.called) + return _internal_called(); +} +inline ::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_called() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.called) + if (body_case() == kCalled) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ModCallResult*>(_impl_.body_.called_); + _impl_.body_.called_ = nullptr; + return temp; } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + return nullptr; } - _impl_.id_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.id_.IsDefault()) { - _impl_.id_.Set("", GetArena()); +} +inline void HostEvent::unsafe_arena_set_allocated_called( + ::modlock::host_app::control::ModCallResult* 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_body(); + if (value) { + set_has_called(); + _impl_.body_.called_ = reinterpret_cast<::google::protobuf::Message*>(value); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCall.id) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.called) } - -// ------------------------------------------------------------------- - -// ModCallResult - -// string id = 1; -inline void ModCallResult::clear_id() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.id_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], - 0x00000001U); +inline ::modlock::host_app::control::ModCallResult* PROTOBUF_NONNULL HostEvent::_internal_mutable_called() { + if (body_case() != kCalled) { + clear_body(); + set_has_called(); + _impl_.body_.called_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModCallResult>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ModCallResult*>(_impl_.body_.called_); } -inline const ::std::string& ModCallResult::id() const +inline ::modlock::host_app::control::ModCallResult* PROTOBUF_NONNULL HostEvent::mutable_called() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCallResult.id) - return _internal_id(); -} -template -PROTOBUF_ALWAYS_INLINE void ModCallResult::set_id(Arg_&& arg, Args_... args) { - ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - _impl_.id_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCallResult.id) + ::modlock::host_app::control::ModCallResult* _msg = _internal_mutable_called(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.called) + return _msg; } -inline ::std::string* PROTOBUF_NONNULL ModCallResult::mutable_id() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_id(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCallResult.id) - return _s; + +// .modlock.host_app.control.ServiceCall service_call = 14; +inline bool HostEvent::has_service_call() const { + return body_case() == kServiceCall; } -inline const ::std::string& ModCallResult::_internal_id() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.id_.Get(); +inline bool HostEvent::_internal_has_service_call() const { + return body_case() == kServiceCall; } -inline void ModCallResult::_internal_set_id(const ::std::string& value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.id_.Set(value, GetArena()); +inline void HostEvent::set_has_service_call() { + _impl_._oneof_case_[0] = kServiceCall; } -inline ::std::string* PROTOBUF_NONNULL ModCallResult::_internal_mutable_id() { +inline void HostEvent::clear_service_call() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.id_.Mutable( GetArena()); + if (body_case() == kServiceCall) { + if (GetArena() == nullptr) { + delete _impl_.body_.service_call_; + } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { + ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.service_call_); + } + clear_has_body(); + } } -inline ::std::string* PROTOBUF_NULLABLE ModCallResult::release_id() { - ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCallResult.id) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { +inline ::modlock::host_app::control::ServiceCall* PROTOBUF_NULLABLE HostEvent::release_service_call() { + // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.service_call) + if (body_case() == kServiceCall) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceCall*>(_impl_.body_.service_call_); + if (GetArena() != nullptr) { + temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + } + _impl_.body_.service_call_ = nullptr; + return temp; + } else { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.id_.Release(); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.id_.Set("", GetArena()); - } - return released; } -inline void ModCallResult::set_allocated_id(::std::string* PROTOBUF_NULLABLE value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); +inline const ::modlock::host_app::control::ServiceCall& HostEvent::_internal_service_call() const { + return body_case() == kServiceCall ? static_cast(*reinterpret_cast<::modlock::host_app::control::ServiceCall*>(_impl_.body_.service_call_)) + : reinterpret_cast(::modlock::host_app::control::_ServiceCall_default_instance_); +} +inline const ::modlock::host_app::control::ServiceCall& HostEvent::service_call() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.service_call) + return _internal_service_call(); +} +inline ::modlock::host_app::control::ServiceCall* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_service_call() { + // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.service_call) + if (body_case() == kServiceCall) { + clear_has_body(); + auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceCall*>(_impl_.body_.service_call_); + _impl_.body_.service_call_ = nullptr; + return temp; } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - } - _impl_.id_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.id_.IsDefault()) { - _impl_.id_.Set("", GetArena()); + return nullptr; } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCallResult.id) } - -// string mod = 2; -inline void ModCallResult::clear_mod() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.mod_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], - 0x00000002U); +inline void HostEvent::unsafe_arena_set_allocated_service_call( + ::modlock::host_app::control::ServiceCall* 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_body(); + if (value) { + set_has_service_call(); + _impl_.body_.service_call_ = reinterpret_cast<::google::protobuf::Message*>(value); + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.service_call) } -inline const ::std::string& ModCallResult::mod() const +inline ::modlock::host_app::control::ServiceCall* PROTOBUF_NONNULL HostEvent::_internal_mutable_service_call() { + if (body_case() != kServiceCall) { + clear_body(); + set_has_service_call(); + _impl_.body_.service_call_ = reinterpret_cast<::google::protobuf::Message*>( + ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ServiceCall>(GetArena())); + } + return reinterpret_cast<::modlock::host_app::control::ServiceCall*>(_impl_.body_.service_call_); +} +inline ::modlock::host_app::control::ServiceCall* PROTOBUF_NONNULL HostEvent::mutable_service_call() ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCallResult.mod) - return _internal_mod(); + ::modlock::host_app::control::ServiceCall* _msg = _internal_mutable_service_call(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.service_call) + return _msg; } -template -PROTOBUF_ALWAYS_INLINE void ModCallResult::set_mod(Arg_&& arg, Args_... args) { - ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - _impl_.mod_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCallResult.mod) + +inline bool HostEvent::has_body() const { + return body_case() != BODY_NOT_SET; } -inline ::std::string* PROTOBUF_NONNULL ModCallResult::mutable_mod() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - ::std::string* _s = _internal_mutable_mod(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCallResult.mod) - return _s; +inline void HostEvent::clear_has_body() { + _impl_._oneof_case_[0] = BODY_NOT_SET; } -inline const ::std::string& ModCallResult::_internal_mod() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.mod_.Get(); +inline HostEvent::BodyCase HostEvent::body_case() const { + return HostEvent::BodyCase(_impl_._oneof_case_[0]); } -inline void ModCallResult::_internal_set_mod(const ::std::string& value) { +// ------------------------------------------------------------------- + +// PlayerChat + +// int32 slot = 1; +inline void PlayerChat::clear_slot() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.mod_.Set(value, GetArena()); + _impl_.slot_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); } -inline ::std::string* PROTOBUF_NONNULL ModCallResult::_internal_mutable_mod() { - ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.mod_.Mutable( GetArena()); +inline ::int32_t PlayerChat::slot() const { + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerChat.slot) + return _internal_slot(); } -inline ::std::string* PROTOBUF_NULLABLE ModCallResult::release_mod() { - ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCallResult.mod) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { - return nullptr; - } - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - auto* released = _impl_.mod_.Release(); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.mod_.Set("", GetArena()); - } - return released; +inline void PlayerChat::set_slot(::int32_t value) { + _internal_set_slot(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerChat.slot) } -inline void ModCallResult::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { +inline ::int32_t PlayerChat::_internal_slot() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.slot_; +} +inline void PlayerChat::_internal_set_slot(::int32_t value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - } - _impl_.mod_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { - _impl_.mod_.Set("", GetArena()); - } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCallResult.mod) + _impl_.slot_ = value; } -// bytes payload = 3; -inline void ModCallResult::clear_payload() { +// string name = 2; +inline void PlayerChat::clear_name() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.payload_.ClearToEmpty(); + _impl_.name_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000004U); + 0x00000001U); } -inline const ::std::string& ModCallResult::payload() const +inline const ::std::string& PlayerChat::name() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCallResult.payload) - return _internal_payload(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerChat.name) + return _internal_name(); } template -PROTOBUF_ALWAYS_INLINE void ModCallResult::set_payload(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void PlayerChat::set_name(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000004U); - _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCallResult.payload) + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.name_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerChat.name) } -inline ::std::string* PROTOBUF_NONNULL ModCallResult::mutable_payload() +inline ::std::string* PROTOBUF_NONNULL PlayerChat::mutable_name() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000004U); - ::std::string* _s = _internal_mutable_payload(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCallResult.payload) + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerChat.name) return _s; } -inline const ::std::string& ModCallResult::_internal_payload() const { +inline const ::std::string& PlayerChat::_internal_name() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.payload_.Get(); + return _impl_.name_.Get(); } -inline void ModCallResult::_internal_set_payload(const ::std::string& value) { +inline void PlayerChat::_internal_set_name(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.payload_.Set(value, GetArena()); + _impl_.name_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ModCallResult::_internal_mutable_payload() { +inline ::std::string* PROTOBUF_NONNULL PlayerChat::_internal_mutable_name() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.payload_.Mutable( GetArena()); + return _impl_.name_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ModCallResult::release_payload() { +inline ::std::string* PROTOBUF_NULLABLE PlayerChat::release_name() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCallResult.payload) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerChat.name) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); - auto* released = _impl_.payload_.Release(); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.name_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.payload_.Set("", GetArena()); + _impl_.name_.Set("", GetArena()); } return released; } -inline void ModCallResult::set_allocated_payload(::std::string* PROTOBUF_NULLABLE value) { +inline void PlayerChat::set_allocated_name(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000004U); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } - _impl_.payload_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { - _impl_.payload_.Set("", GetArena()); + _impl_.name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCallResult.payload) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerChat.name) } -// string error = 4; -inline void ModCallResult::clear_error() { +// string text = 3; +inline void PlayerChat::clear_text() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.error_.ClearToEmpty(); + _impl_.text_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000008U); + 0x00000002U); } -inline const ::std::string& ModCallResult::error() const +inline const ::std::string& PlayerChat::text() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCallResult.error) - return _internal_error(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerChat.text) + return _internal_text(); } template -PROTOBUF_ALWAYS_INLINE void ModCallResult::set_error(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void PlayerChat::set_text(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000008U); - _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCallResult.error) + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.text_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerChat.text) } -inline ::std::string* PROTOBUF_NONNULL ModCallResult::mutable_error() +inline ::std::string* PROTOBUF_NONNULL PlayerChat::mutable_text() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000008U); - ::std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCallResult.error) + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_text(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerChat.text) return _s; } -inline const ::std::string& ModCallResult::_internal_error() const { +inline const ::std::string& PlayerChat::_internal_text() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.error_.Get(); + return _impl_.text_.Get(); } -inline void ModCallResult::_internal_set_error(const ::std::string& value) { +inline void PlayerChat::_internal_set_text(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.error_.Set(value, GetArena()); + _impl_.text_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ModCallResult::_internal_mutable_error() { +inline ::std::string* PROTOBUF_NONNULL PlayerChat::_internal_mutable_text() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.error_.Mutable( GetArena()); + return _impl_.text_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ModCallResult::release_error() { +inline ::std::string* PROTOBUF_NULLABLE PlayerChat::release_text() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCallResult.error) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000008U)) { + // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerChat.text) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000008U); - auto* released = _impl_.error_.Release(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.text_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.error_.Set("", GetArena()); + _impl_.text_.Set("", GetArena()); } return released; } -inline void ModCallResult::set_allocated_error(::std::string* PROTOBUF_NULLABLE value) { +inline void PlayerChat::set_allocated_text(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000008U); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } - _impl_.error_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.error_.IsDefault()) { - _impl_.error_.Set("", GetArena()); + _impl_.text_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.text_.IsDefault()) { + _impl_.text_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCallResult.error) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerChat.text) } // ------------------------------------------------------------------- -// ReloadRequest +// ModStarted -// string path = 1; -inline void ReloadRequest::clear_path() { +// string mod = 1; +inline void ModStarted::clear_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.path_.ClearToEmpty(); + _impl_.mod_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& ReloadRequest::path() const +inline const ::std::string& ModStarted::mod() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ReloadRequest.path) - return _internal_path(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModStarted.mod) + return _internal_mod(); } template -PROTOBUF_ALWAYS_INLINE void ReloadRequest::set_path(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ModStarted::set_mod(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); - _impl_.path_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ReloadRequest.path) + _impl_.mod_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModStarted.mod) } -inline ::std::string* PROTOBUF_NONNULL ReloadRequest::mutable_path() +inline ::std::string* PROTOBUF_NONNULL ModStarted::mutable_mod() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_path(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ReloadRequest.path) + ::std::string* _s = _internal_mutable_mod(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModStarted.mod) return _s; } -inline const ::std::string& ReloadRequest::_internal_path() const { +inline const ::std::string& ModStarted::_internal_mod() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.path_.Get(); + return _impl_.mod_.Get(); } -inline void ReloadRequest::_internal_set_path(const ::std::string& value) { +inline void ModStarted::_internal_set_mod(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.path_.Set(value, GetArena()); + _impl_.mod_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ReloadRequest::_internal_mutable_path() { +inline ::std::string* PROTOBUF_NONNULL ModStarted::_internal_mutable_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.path_.Mutable( GetArena()); + return _impl_.mod_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ReloadRequest::release_path() { +inline ::std::string* PROTOBUF_NULLABLE ModStarted::release_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ReloadRequest.path) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModStarted.mod) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.path_.Release(); + auto* released = _impl_.mod_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.path_.Set("", GetArena()); + _impl_.mod_.Set("", GetArena()); } return released; } -inline void ReloadRequest::set_allocated_path(::std::string* PROTOBUF_NULLABLE value) { +inline void ModStarted::set_allocated_mod(::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_.path_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.path_.IsDefault()) { - _impl_.path_.Set("", GetArena()); + _impl_.mod_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { + _impl_.mod_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ReloadRequest.path) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModStarted.mod) } -// ------------------------------------------------------------------- - -// HostEvent - -// .modlock.host_app.control.ModStarted started = 1; -inline bool HostEvent::has_started() const { - return body_case() == kStarted; -} -inline bool HostEvent::_internal_has_started() const { - return body_case() == kStarted; -} -inline void HostEvent::set_has_started() { - _impl_._oneof_case_[0] = kStarted; -} -inline void HostEvent::clear_started() { +// bool reloaded = 2; +inline void ModStarted::clear_reloaded() { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kStarted) { - if (GetArena() == nullptr) { - delete _impl_.body_.started_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.started_); - } - clear_has_body(); - } -} -inline ::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE HostEvent::release_started() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.started) - if (body_case() == kStarted) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModStarted*>(_impl_.body_.started_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.started_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::modlock::host_app::control::ModStarted& HostEvent::_internal_started() const { - return body_case() == kStarted ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModStarted*>(_impl_.body_.started_)) - : reinterpret_cast(::modlock::host_app::control::_ModStarted_default_instance_); -} -inline const ::modlock::host_app::control::ModStarted& HostEvent::started() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.started) - return _internal_started(); + _impl_.reloaded_ = false; + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); } -inline ::modlock::host_app::control::ModStarted* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_started() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.started) - if (body_case() == kStarted) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModStarted*>(_impl_.body_.started_); - _impl_.body_.started_ = nullptr; - return temp; - } else { - return nullptr; - } +inline bool ModStarted::reloaded() const { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModStarted.reloaded) + return _internal_reloaded(); } -inline void HostEvent::unsafe_arena_set_allocated_started( - ::modlock::host_app::control::ModStarted* 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_body(); - if (value) { - set_has_started(); - _impl_.body_.started_ = reinterpret_cast<::google::protobuf::Message*>(value); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.started) +inline void ModStarted::set_reloaded(bool value) { + _internal_set_reloaded(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModStarted.reloaded) } -inline ::modlock::host_app::control::ModStarted* PROTOBUF_NONNULL HostEvent::_internal_mutable_started() { - if (body_case() != kStarted) { - clear_body(); - set_has_started(); - _impl_.body_.started_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModStarted>(GetArena())); - } - return reinterpret_cast<::modlock::host_app::control::ModStarted*>(_impl_.body_.started_); +inline bool ModStarted::_internal_reloaded() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.reloaded_; } -inline ::modlock::host_app::control::ModStarted* PROTOBUF_NONNULL HostEvent::mutable_started() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ModStarted* _msg = _internal_mutable_started(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.started) - return _msg; +inline void ModStarted::_internal_set_reloaded(bool value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.reloaded_ = value; } -// .modlock.host_app.control.ModLog log = 2; -inline bool HostEvent::has_log() const { - return body_case() == kLog; -} -inline bool HostEvent::_internal_has_log() const { - return body_case() == kLog; -} -inline void HostEvent::set_has_log() { - _impl_._oneof_case_[0] = kLog; -} -inline void HostEvent::clear_log() { +// ------------------------------------------------------------------- + +// ModLog + +// string mod = 1; +inline void ModLog::clear_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kLog) { - if (GetArena() == nullptr) { - delete _impl_.body_.log_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.log_); - } - clear_has_body(); - } -} -inline ::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE HostEvent::release_log() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.log) - if (body_case() == kLog) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModLog*>(_impl_.body_.log_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.log_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::modlock::host_app::control::ModLog& HostEvent::_internal_log() const { - return body_case() == kLog ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModLog*>(_impl_.body_.log_)) - : reinterpret_cast(::modlock::host_app::control::_ModLog_default_instance_); -} -inline const ::modlock::host_app::control::ModLog& HostEvent::log() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.log) - return _internal_log(); -} -inline ::modlock::host_app::control::ModLog* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_log() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.log) - if (body_case() == kLog) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModLog*>(_impl_.body_.log_); - _impl_.body_.log_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void HostEvent::unsafe_arena_set_allocated_log( - ::modlock::host_app::control::ModLog* 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_body(); - if (value) { - set_has_log(); - _impl_.body_.log_ = reinterpret_cast<::google::protobuf::Message*>(value); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.log) -} -inline ::modlock::host_app::control::ModLog* PROTOBUF_NONNULL HostEvent::_internal_mutable_log() { - if (body_case() != kLog) { - clear_body(); - set_has_log(); - _impl_.body_.log_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModLog>(GetArena())); - } - return reinterpret_cast<::modlock::host_app::control::ModLog*>(_impl_.body_.log_); + _impl_.mod_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); } -inline ::modlock::host_app::control::ModLog* PROTOBUF_NONNULL HostEvent::mutable_log() +inline const ::std::string& ModLog::mod() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ModLog* _msg = _internal_mutable_log(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.log) - return _msg; + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModLog.mod) + return _internal_mod(); } - -// .modlock.host_app.control.ModFailed failed = 3; -inline bool HostEvent::has_failed() const { - return body_case() == kFailed; +template +PROTOBUF_ALWAYS_INLINE void ModLog::set_mod(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.mod_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModLog.mod) } -inline bool HostEvent::_internal_has_failed() const { - return body_case() == kFailed; +inline ::std::string* PROTOBUF_NONNULL ModLog::mutable_mod() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_mod(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModLog.mod) + return _s; } -inline void HostEvent::set_has_failed() { - _impl_._oneof_case_[0] = kFailed; +inline const ::std::string& ModLog::_internal_mod() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.mod_.Get(); } -inline void HostEvent::clear_failed() { +inline void ModLog::_internal_set_mod(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kFailed) { - if (GetArena() == nullptr) { - delete _impl_.body_.failed_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.failed_); - } - clear_has_body(); - } -} -inline ::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE HostEvent::release_failed() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.failed) - if (body_case() == kFailed) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModFailed*>(_impl_.body_.failed_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.failed_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::modlock::host_app::control::ModFailed& HostEvent::_internal_failed() const { - return body_case() == kFailed ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModFailed*>(_impl_.body_.failed_)) - : reinterpret_cast(::modlock::host_app::control::_ModFailed_default_instance_); + _impl_.mod_.Set(value, GetArena()); } -inline const ::modlock::host_app::control::ModFailed& HostEvent::failed() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.failed) - return _internal_failed(); +inline ::std::string* PROTOBUF_NONNULL ModLog::_internal_mutable_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.mod_.Mutable( GetArena()); } -inline ::modlock::host_app::control::ModFailed* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_failed() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.failed) - if (body_case() == kFailed) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModFailed*>(_impl_.body_.failed_); - _impl_.body_.failed_ = nullptr; - return temp; - } else { +inline ::std::string* PROTOBUF_NULLABLE ModLog::release_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModLog.mod) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } -} -inline void HostEvent::unsafe_arena_set_allocated_failed( - ::modlock::host_app::control::ModFailed* 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_body(); - if (value) { - set_has_failed(); - _impl_.body_.failed_ = reinterpret_cast<::google::protobuf::Message*>(value); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.mod_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.mod_.Set("", GetArena()); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.failed) + return released; } -inline ::modlock::host_app::control::ModFailed* PROTOBUF_NONNULL HostEvent::_internal_mutable_failed() { - if (body_case() != kFailed) { - clear_body(); - set_has_failed(); - _impl_.body_.failed_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModFailed>(GetArena())); +inline void ModLog::set_allocated_mod(::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); } - return reinterpret_cast<::modlock::host_app::control::ModFailed*>(_impl_.body_.failed_); -} -inline ::modlock::host_app::control::ModFailed* PROTOBUF_NONNULL HostEvent::mutable_failed() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ModFailed* _msg = _internal_mutable_failed(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.failed) - return _msg; + _impl_.mod_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { + _impl_.mod_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModLog.mod) } -// .modlock.host_app.control.PlayerJoined joined = 4; -inline bool HostEvent::has_joined() const { - return body_case() == kJoined; -} -inline bool HostEvent::_internal_has_joined() const { - return body_case() == kJoined; +// string text = 2; +inline void ModLog::clear_text() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.text_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); } -inline void HostEvent::set_has_joined() { - _impl_._oneof_case_[0] = kJoined; +inline const ::std::string& ModLog::text() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModLog.text) + return _internal_text(); } -inline void HostEvent::clear_joined() { +template +PROTOBUF_ALWAYS_INLINE void ModLog::set_text(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kJoined) { - if (GetArena() == nullptr) { - delete _impl_.body_.joined_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.joined_); - } - clear_has_body(); - } + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.text_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModLog.text) } -inline ::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE HostEvent::release_joined() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.joined) - if (body_case() == kJoined) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerJoined*>(_impl_.body_.joined_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.joined_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::std::string* PROTOBUF_NONNULL ModLog::mutable_text() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_text(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModLog.text) + return _s; } -inline const ::modlock::host_app::control::PlayerJoined& HostEvent::_internal_joined() const { - return body_case() == kJoined ? static_cast(*reinterpret_cast<::modlock::host_app::control::PlayerJoined*>(_impl_.body_.joined_)) - : reinterpret_cast(::modlock::host_app::control::_PlayerJoined_default_instance_); +inline const ::std::string& ModLog::_internal_text() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.text_.Get(); } -inline const ::modlock::host_app::control::PlayerJoined& HostEvent::joined() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.joined) - return _internal_joined(); +inline void ModLog::_internal_set_text(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.text_.Set(value, GetArena()); } -inline ::modlock::host_app::control::PlayerJoined* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_joined() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.joined) - if (body_case() == kJoined) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerJoined*>(_impl_.body_.joined_); - _impl_.body_.joined_ = nullptr; - return temp; - } else { +inline ::std::string* PROTOBUF_NONNULL ModLog::_internal_mutable_text() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.text_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModLog::release_text() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModLog.text) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { return nullptr; } -} -inline void HostEvent::unsafe_arena_set_allocated_joined( - ::modlock::host_app::control::PlayerJoined* 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_body(); - if (value) { - set_has_joined(); - _impl_.body_.joined_ = reinterpret_cast<::google::protobuf::Message*>(value); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.text_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.text_.Set("", GetArena()); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.joined) + return released; } -inline ::modlock::host_app::control::PlayerJoined* PROTOBUF_NONNULL HostEvent::_internal_mutable_joined() { - if (body_case() != kJoined) { - clear_body(); - set_has_joined(); - _impl_.body_.joined_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::PlayerJoined>(GetArena())); +inline void ModLog::set_allocated_text(::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); } - return reinterpret_cast<::modlock::host_app::control::PlayerJoined*>(_impl_.body_.joined_); -} -inline ::modlock::host_app::control::PlayerJoined* PROTOBUF_NONNULL HostEvent::mutable_joined() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::PlayerJoined* _msg = _internal_mutable_joined(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.joined) - return _msg; + _impl_.text_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.text_.IsDefault()) { + _impl_.text_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModLog.text) } -// .modlock.host_app.control.ServerReady ready = 5; -inline bool HostEvent::has_ready() const { - return body_case() == kReady; -} -inline bool HostEvent::_internal_has_ready() const { - return body_case() == kReady; +// ------------------------------------------------------------------- + +// ModFailed + +// string mod = 1; +inline void ModFailed::clear_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); } -inline void HostEvent::set_has_ready() { - _impl_._oneof_case_[0] = kReady; +inline const ::std::string& ModFailed::mod() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModFailed.mod) + return _internal_mod(); } -inline void HostEvent::clear_ready() { +template +PROTOBUF_ALWAYS_INLINE void ModFailed::set_mod(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kReady) { - if (GetArena() == nullptr) { - delete _impl_.body_.ready_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.ready_); - } - clear_has_body(); - } + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.mod_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModFailed.mod) } -inline ::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE HostEvent::release_ready() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.ready) - if (body_case() == kReady) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ServerReady*>(_impl_.body_.ready_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.ready_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::std::string* PROTOBUF_NONNULL ModFailed::mutable_mod() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_mod(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModFailed.mod) + return _s; } -inline const ::modlock::host_app::control::ServerReady& HostEvent::_internal_ready() const { - return body_case() == kReady ? static_cast(*reinterpret_cast<::modlock::host_app::control::ServerReady*>(_impl_.body_.ready_)) - : reinterpret_cast(::modlock::host_app::control::_ServerReady_default_instance_); +inline const ::std::string& ModFailed::_internal_mod() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.mod_.Get(); } -inline const ::modlock::host_app::control::ServerReady& HostEvent::ready() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.ready) - return _internal_ready(); +inline void ModFailed::_internal_set_mod(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.Set(value, GetArena()); } -inline ::modlock::host_app::control::ServerReady* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_ready() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.ready) - if (body_case() == kReady) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ServerReady*>(_impl_.body_.ready_); - _impl_.body_.ready_ = nullptr; - return temp; - } else { +inline ::std::string* PROTOBUF_NONNULL ModFailed::_internal_mutable_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.mod_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModFailed::release_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModFailed.mod) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } -} -inline void HostEvent::unsafe_arena_set_allocated_ready( - ::modlock::host_app::control::ServerReady* 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_body(); - if (value) { - set_has_ready(); - _impl_.body_.ready_ = reinterpret_cast<::google::protobuf::Message*>(value); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.mod_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.mod_.Set("", GetArena()); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.ready) + return released; } -inline ::modlock::host_app::control::ServerReady* PROTOBUF_NONNULL HostEvent::_internal_mutable_ready() { - if (body_case() != kReady) { - clear_body(); - set_has_ready(); - _impl_.body_.ready_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ServerReady>(GetArena())); +inline void ModFailed::set_allocated_mod(::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); } - return reinterpret_cast<::modlock::host_app::control::ServerReady*>(_impl_.body_.ready_); + _impl_.mod_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { + _impl_.mod_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModFailed.mod) } -inline ::modlock::host_app::control::ServerReady* PROTOBUF_NONNULL HostEvent::mutable_ready() + +// string error = 2; +inline void ModFailed::clear_error() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.error_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& ModFailed::error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ServerReady* _msg = _internal_mutable_ready(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.ready) - return _msg; + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModFailed.error) + return _internal_error(); } - -// .modlock.host_app.control.UiChanged ui = 6; -inline bool HostEvent::has_ui() const { - return body_case() == kUi; +template +PROTOBUF_ALWAYS_INLINE void ModFailed::set_error(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.error_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModFailed.error) } -inline bool HostEvent::_internal_has_ui() const { - return body_case() == kUi; +inline ::std::string* PROTOBUF_NONNULL ModFailed::mutable_error() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_error(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModFailed.error) + return _s; } -inline void HostEvent::set_has_ui() { - _impl_._oneof_case_[0] = kUi; +inline const ::std::string& ModFailed::_internal_error() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.error_.Get(); } -inline void HostEvent::clear_ui() { +inline void ModFailed::_internal_set_error(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kUi) { - if (GetArena() == nullptr) { - delete _impl_.body_.ui_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.ui_); - } - clear_has_body(); - } + _impl_.error_.Set(value, GetArena()); } -inline ::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE HostEvent::release_ui() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.ui) - if (body_case() == kUi) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::UiChanged*>(_impl_.body_.ui_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.ui_ = nullptr; - return temp; - } else { +inline ::std::string* PROTOBUF_NONNULL ModFailed::_internal_mutable_error() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.error_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModFailed::release_error() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModFailed.error) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { return nullptr; } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.error_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.error_.Set("", GetArena()); + } + return released; } -inline const ::modlock::host_app::control::UiChanged& HostEvent::_internal_ui() const { - return body_case() == kUi ? static_cast(*reinterpret_cast<::modlock::host_app::control::UiChanged*>(_impl_.body_.ui_)) - : reinterpret_cast(::modlock::host_app::control::_UiChanged_default_instance_); -} -inline const ::modlock::host_app::control::UiChanged& HostEvent::ui() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.ui) - return _internal_ui(); -} -inline ::modlock::host_app::control::UiChanged* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_ui() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.ui) - if (body_case() == kUi) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::UiChanged*>(_impl_.body_.ui_); - _impl_.body_.ui_ = nullptr; - return temp; +inline void ModFailed::set_allocated_error(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); } else { - return nullptr; + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } -} -inline void HostEvent::unsafe_arena_set_allocated_ui( - ::modlock::host_app::control::UiChanged* 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_body(); - if (value) { - set_has_ui(); - _impl_.body_.ui_ = reinterpret_cast<::google::protobuf::Message*>(value); + _impl_.error_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.error_.IsDefault()) { + _impl_.error_.Set("", GetArena()); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.ui) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModFailed.error) } -inline ::modlock::host_app::control::UiChanged* PROTOBUF_NONNULL HostEvent::_internal_mutable_ui() { - if (body_case() != kUi) { - clear_body(); - set_has_ui(); - _impl_.body_.ui_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::UiChanged>(GetArena())); - } - return reinterpret_cast<::modlock::host_app::control::UiChanged*>(_impl_.body_.ui_); + +// ------------------------------------------------------------------- + +// ModCalls + +// string mod = 1; +inline void ModCalls::clear_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); } -inline ::modlock::host_app::control::UiChanged* PROTOBUF_NONNULL HostEvent::mutable_ui() +inline const ::std::string& ModCalls::mod() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::UiChanged* _msg = _internal_mutable_ui(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.ui) - return _msg; + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCalls.mod) + return _internal_mod(); } - -// .modlock.host_app.control.PlayerLeft left = 7; -inline bool HostEvent::has_left() const { - return body_case() == kLeft; +template +PROTOBUF_ALWAYS_INLINE void ModCalls::set_mod(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.mod_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCalls.mod) } -inline bool HostEvent::_internal_has_left() const { - return body_case() == kLeft; +inline ::std::string* PROTOBUF_NONNULL ModCalls::mutable_mod() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_mod(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCalls.mod) + return _s; } -inline void HostEvent::set_has_left() { - _impl_._oneof_case_[0] = kLeft; +inline const ::std::string& ModCalls::_internal_mod() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.mod_.Get(); } -inline void HostEvent::clear_left() { +inline void ModCalls::_internal_set_mod(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kLeft) { - if (GetArena() == nullptr) { - delete _impl_.body_.left_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.left_); - } - clear_has_body(); - } -} -inline ::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE HostEvent::release_left() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.left) - if (body_case() == kLeft) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerLeft*>(_impl_.body_.left_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.left_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::modlock::host_app::control::PlayerLeft& HostEvent::_internal_left() const { - return body_case() == kLeft ? static_cast(*reinterpret_cast<::modlock::host_app::control::PlayerLeft*>(_impl_.body_.left_)) - : reinterpret_cast(::modlock::host_app::control::_PlayerLeft_default_instance_); + _impl_.mod_.Set(value, GetArena()); } -inline const ::modlock::host_app::control::PlayerLeft& HostEvent::left() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.left) - return _internal_left(); +inline ::std::string* PROTOBUF_NONNULL ModCalls::_internal_mutable_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.mod_.Mutable( GetArena()); } -inline ::modlock::host_app::control::PlayerLeft* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_left() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.left) - if (body_case() == kLeft) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerLeft*>(_impl_.body_.left_); - _impl_.body_.left_ = nullptr; - return temp; - } else { +inline ::std::string* PROTOBUF_NULLABLE ModCalls::release_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCalls.mod) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } -} -inline void HostEvent::unsafe_arena_set_allocated_left( - ::modlock::host_app::control::PlayerLeft* 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_body(); - if (value) { - set_has_left(); - _impl_.body_.left_ = reinterpret_cast<::google::protobuf::Message*>(value); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.left) -} -inline ::modlock::host_app::control::PlayerLeft* PROTOBUF_NONNULL HostEvent::_internal_mutable_left() { - if (body_case() != kLeft) { - clear_body(); - set_has_left(); - _impl_.body_.left_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::PlayerLeft>(GetArena())); + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.mod_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.mod_.Set("", GetArena()); } - return reinterpret_cast<::modlock::host_app::control::PlayerLeft*>(_impl_.body_.left_); + return released; } -inline ::modlock::host_app::control::PlayerLeft* PROTOBUF_NONNULL HostEvent::mutable_left() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::PlayerLeft* _msg = _internal_mutable_left(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.left) - return _msg; +inline void ModCalls::set_allocated_mod(::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_.mod_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { + _impl_.mod_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCalls.mod) } -// .modlock.host_app.control.PlayerMessage message = 8; -inline bool HostEvent::has_message() const { - return body_case() == kMessage; +// .modlock.wasm.profile.CallProfile profile = 2; +inline bool ModCalls::has_profile() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000002U); + PROTOBUF_ASSUME(!value || _impl_.profile_ != nullptr); + return value; } -inline bool HostEvent::_internal_has_message() const { - return body_case() == kMessage; +inline const ::modlock::wasm::profile::CallProfile& ModCalls::_internal_profile() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::modlock::wasm::profile::CallProfile* p = _impl_.profile_; + return p != nullptr ? *p : reinterpret_cast(::modlock::wasm::profile::_CallProfile_default_instance_); } -inline void HostEvent::set_has_message() { - _impl_._oneof_case_[0] = kMessage; +inline const ::modlock::wasm::profile::CallProfile& ModCalls::profile() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCalls.profile) + return _internal_profile(); } -inline void HostEvent::clear_message() { +inline void ModCalls::unsafe_arena_set_allocated_profile( + ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kMessage) { - if (GetArena() == nullptr) { - delete _impl_.body_.message_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.message_); - } - clear_has_body(); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.profile_); } -} -inline ::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE HostEvent::release_message() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.message) - if (body_case() == kMessage) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerMessage*>(_impl_.body_.message_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.message_ = nullptr; - return temp; + _impl_.profile_ = reinterpret_cast<::modlock::wasm::profile::CallProfile*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); } else { - return nullptr; + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ModCalls.profile) } -inline const ::modlock::host_app::control::PlayerMessage& HostEvent::_internal_message() const { - return body_case() == kMessage ? static_cast(*reinterpret_cast<::modlock::host_app::control::PlayerMessage*>(_impl_.body_.message_)) - : reinterpret_cast(::modlock::host_app::control::_PlayerMessage_default_instance_); -} -inline const ::modlock::host_app::control::PlayerMessage& HostEvent::message() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.message) - return _internal_message(); -} -inline ::modlock::host_app::control::PlayerMessage* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_message() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.message) - if (body_case() == kMessage) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerMessage*>(_impl_.body_.message_); - _impl_.body_.message_ = nullptr; - return temp; +inline ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE ModCalls::release_profile() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::profile::CallProfile* released = _impl_.profile_; + _impl_.profile_ = 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 { - return nullptr; + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } } + return released; } -inline void HostEvent::unsafe_arena_set_allocated_message( - ::modlock::host_app::control::PlayerMessage* 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_body(); - if (value) { - set_has_message(); - _impl_.body_.message_ = reinterpret_cast<::google::protobuf::Message*>(value); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.message) +inline ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE ModCalls::unsafe_arena_release_profile() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCalls.profile) + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::profile::CallProfile* temp = _impl_.profile_; + _impl_.profile_ = nullptr; + return temp; } -inline ::modlock::host_app::control::PlayerMessage* PROTOBUF_NONNULL HostEvent::_internal_mutable_message() { - if (body_case() != kMessage) { - clear_body(); - set_has_message(); - _impl_.body_.message_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::PlayerMessage>(GetArena())); +inline ::modlock::wasm::profile::CallProfile* PROTOBUF_NONNULL ModCalls::_internal_mutable_profile() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.profile_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::profile::CallProfile>(GetArena()); + _impl_.profile_ = reinterpret_cast<::modlock::wasm::profile::CallProfile*>(p); } - return reinterpret_cast<::modlock::host_app::control::PlayerMessage*>(_impl_.body_.message_); + return _impl_.profile_; } -inline ::modlock::host_app::control::PlayerMessage* PROTOBUF_NONNULL HostEvent::mutable_message() +inline ::modlock::wasm::profile::CallProfile* PROTOBUF_NONNULL ModCalls::mutable_profile() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::PlayerMessage* _msg = _internal_mutable_message(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.message) + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::profile::CallProfile* _msg = _internal_mutable_profile(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCalls.profile) return _msg; } +inline void ModCalls::set_allocated_profile(::modlock::wasm::profile::CallProfile* 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_.profile_); + } -// .modlock.host_app.control.PlayerChat chat = 9; -inline bool HostEvent::has_chat() const { - return body_case() == kChat; + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::Message*>(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_.profile_ = reinterpret_cast<::modlock::wasm::profile::CallProfile*>(value); + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCalls.profile) } -inline bool HostEvent::_internal_has_chat() const { - return body_case() == kChat; + +// ------------------------------------------------------------------- + +// ModSlowFrame + +// string mod = 1; +inline void ModSlowFrame::clear_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); } -inline void HostEvent::set_has_chat() { - _impl_._oneof_case_[0] = kChat; +inline const ::std::string& ModSlowFrame::mod() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModSlowFrame.mod) + return _internal_mod(); } -inline void HostEvent::clear_chat() { +template +PROTOBUF_ALWAYS_INLINE void ModSlowFrame::set_mod(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kChat) { - if (GetArena() == nullptr) { - delete _impl_.body_.chat_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.chat_); - } - clear_has_body(); - } + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.mod_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ModSlowFrame.mod) } -inline ::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE HostEvent::release_chat() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.chat) - if (body_case() == kChat) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerChat*>(_impl_.body_.chat_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.chat_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::std::string* PROTOBUF_NONNULL ModSlowFrame::mutable_mod() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_mod(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModSlowFrame.mod) + return _s; } -inline const ::modlock::host_app::control::PlayerChat& HostEvent::_internal_chat() const { - return body_case() == kChat ? static_cast(*reinterpret_cast<::modlock::host_app::control::PlayerChat*>(_impl_.body_.chat_)) - : reinterpret_cast(::modlock::host_app::control::_PlayerChat_default_instance_); +inline const ::std::string& ModSlowFrame::_internal_mod() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.mod_.Get(); } -inline const ::modlock::host_app::control::PlayerChat& HostEvent::chat() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.chat) - return _internal_chat(); +inline void ModSlowFrame::_internal_set_mod(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.Set(value, GetArena()); } -inline ::modlock::host_app::control::PlayerChat* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_chat() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.chat) - if (body_case() == kChat) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::PlayerChat*>(_impl_.body_.chat_); - _impl_.body_.chat_ = nullptr; - return temp; - } else { +inline ::std::string* PROTOBUF_NONNULL ModSlowFrame::_internal_mutable_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.mod_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ModSlowFrame::release_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModSlowFrame.mod) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.mod_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.mod_.Set("", GetArena()); + } + return released; } -inline void HostEvent::unsafe_arena_set_allocated_chat( - ::modlock::host_app::control::PlayerChat* 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_body(); - if (value) { - set_has_chat(); - _impl_.body_.chat_ = reinterpret_cast<::google::protobuf::Message*>(value); +inline void ModSlowFrame::set_allocated_mod(::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); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.chat) -} -inline ::modlock::host_app::control::PlayerChat* PROTOBUF_NONNULL HostEvent::_internal_mutable_chat() { - if (body_case() != kChat) { - clear_body(); - set_has_chat(); - _impl_.body_.chat_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::PlayerChat>(GetArena())); + _impl_.mod_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { + _impl_.mod_.Set("", GetArena()); } - return reinterpret_cast<::modlock::host_app::control::PlayerChat*>(_impl_.body_.chat_); -} -inline ::modlock::host_app::control::PlayerChat* PROTOBUF_NONNULL HostEvent::mutable_chat() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::PlayerChat* _msg = _internal_mutable_chat(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.chat) - return _msg; + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModSlowFrame.mod) } -// .modlock.host_app.control.ModCalls calls = 10; -inline bool HostEvent::has_calls() const { - return body_case() == kCalls; +// .modlock.wasm.profile.SlowFrame report = 2; +inline bool ModSlowFrame::has_report() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000002U); + PROTOBUF_ASSUME(!value || _impl_.report_ != nullptr); + return value; } -inline bool HostEvent::_internal_has_calls() const { - return body_case() == kCalls; +inline const ::modlock::wasm::profile::SlowFrame& ModSlowFrame::_internal_report() const { + ::google::protobuf::internal::TSanRead(&_impl_); + const ::modlock::wasm::profile::SlowFrame* p = _impl_.report_; + return p != nullptr ? *p : reinterpret_cast(::modlock::wasm::profile::_SlowFrame_default_instance_); } -inline void HostEvent::set_has_calls() { - _impl_._oneof_case_[0] = kCalls; +inline const ::modlock::wasm::profile::SlowFrame& ModSlowFrame::report() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ModSlowFrame.report) + return _internal_report(); } -inline void HostEvent::clear_calls() { +inline void ModSlowFrame::unsafe_arena_set_allocated_report( + ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kCalls) { - if (GetArena() == nullptr) { - delete _impl_.body_.calls_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.calls_); - } - clear_has_body(); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.report_); } -} -inline ::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE HostEvent::release_calls() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.calls) - if (body_case() == kCalls) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModCalls*>(_impl_.body_.calls_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.calls_ = nullptr; - return temp; + _impl_.report_ = reinterpret_cast<::modlock::wasm::profile::SlowFrame*>(value); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); } else { - return nullptr; + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.ModSlowFrame.report) } -inline const ::modlock::host_app::control::ModCalls& HostEvent::_internal_calls() const { - return body_case() == kCalls ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModCalls*>(_impl_.body_.calls_)) - : reinterpret_cast(::modlock::host_app::control::_ModCalls_default_instance_); -} -inline const ::modlock::host_app::control::ModCalls& HostEvent::calls() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.calls) - return _internal_calls(); -} -inline ::modlock::host_app::control::ModCalls* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_calls() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.calls) - if (body_case() == kCalls) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModCalls*>(_impl_.body_.calls_); - _impl_.body_.calls_ = nullptr; - return temp; +inline ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE ModSlowFrame::release_report() { + ::google::protobuf::internal::TSanWrite(&_impl_); + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::profile::SlowFrame* released = _impl_.report_; + _impl_.report_ = 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 { - return nullptr; + if (GetArena() != nullptr) { + released = ::google::protobuf::internal::DuplicateIfNonNull(released); + } } + return released; } -inline void HostEvent::unsafe_arena_set_allocated_calls( - ::modlock::host_app::control::ModCalls* 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_body(); - if (value) { - set_has_calls(); - _impl_.body_.calls_ = reinterpret_cast<::google::protobuf::Message*>(value); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.calls) +inline ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE ModSlowFrame::unsafe_arena_release_report() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ModSlowFrame.report) + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::profile::SlowFrame* temp = _impl_.report_; + _impl_.report_ = nullptr; + return temp; } -inline ::modlock::host_app::control::ModCalls* PROTOBUF_NONNULL HostEvent::_internal_mutable_calls() { - if (body_case() != kCalls) { - clear_body(); - set_has_calls(); - _impl_.body_.calls_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModCalls>(GetArena())); +inline ::modlock::wasm::profile::SlowFrame* PROTOBUF_NONNULL ModSlowFrame::_internal_mutable_report() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.report_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::profile::SlowFrame>(GetArena()); + _impl_.report_ = reinterpret_cast<::modlock::wasm::profile::SlowFrame*>(p); } - return reinterpret_cast<::modlock::host_app::control::ModCalls*>(_impl_.body_.calls_); + return _impl_.report_; } -inline ::modlock::host_app::control::ModCalls* PROTOBUF_NONNULL HostEvent::mutable_calls() +inline ::modlock::wasm::profile::SlowFrame* PROTOBUF_NONNULL ModSlowFrame::mutable_report() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ModCalls* _msg = _internal_mutable_calls(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.calls) + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::profile::SlowFrame* _msg = _internal_mutable_report(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModSlowFrame.report) return _msg; } - -// .modlock.host_app.control.ModSlowFrame slow_frame = 11; -inline bool HostEvent::has_slow_frame() const { - return body_case() == kSlowFrame; -} -inline bool HostEvent::_internal_has_slow_frame() const { - return body_case() == kSlowFrame; -} -inline void HostEvent::set_has_slow_frame() { - _impl_._oneof_case_[0] = kSlowFrame; -} -inline void HostEvent::clear_slow_frame() { +inline void ModSlowFrame::set_allocated_report(::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE value) { + ::google::protobuf::Arena* message_arena = GetArena(); ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kSlowFrame) { - if (GetArena() == nullptr) { - delete _impl_.body_.slow_frame_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.slow_frame_); - } - clear_has_body(); + if (message_arena == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.report_); } -} -inline ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE HostEvent::release_slow_frame() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.slow_frame) - if (body_case() == kSlowFrame) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModSlowFrame*>(_impl_.body_.slow_frame_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); + + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::Message*>(value)->GetArena(); + if (message_arena != submessage_arena) { + value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); } - _impl_.body_.slow_frame_ = nullptr; - return temp; + SetHasBit(_impl_._has_bits_[0], 0x00000002U); } else { - return nullptr; + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } + + _impl_.report_ = reinterpret_cast<::modlock::wasm::profile::SlowFrame*>(value); + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModSlowFrame.report) } -inline const ::modlock::host_app::control::ModSlowFrame& HostEvent::_internal_slow_frame() const { - return body_case() == kSlowFrame ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModSlowFrame*>(_impl_.body_.slow_frame_)) - : reinterpret_cast(::modlock::host_app::control::_ModSlowFrame_default_instance_); + +// ------------------------------------------------------------------- + +// PlayerJoined + +// int32 slot = 1; +inline void PlayerJoined::clear_slot() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.slot_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); } -inline const ::modlock::host_app::control::ModSlowFrame& HostEvent::slow_frame() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.slow_frame) - return _internal_slow_frame(); +inline ::int32_t PlayerJoined::slot() const { + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerJoined.slot) + return _internal_slot(); } -inline ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_slow_frame() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.slow_frame) - if (body_case() == kSlowFrame) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModSlowFrame*>(_impl_.body_.slow_frame_); - _impl_.body_.slow_frame_ = nullptr; - return temp; - } else { - return nullptr; - } +inline void PlayerJoined::set_slot(::int32_t value) { + _internal_set_slot(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerJoined.slot) } -inline void HostEvent::unsafe_arena_set_allocated_slow_frame( - ::modlock::host_app::control::ModSlowFrame* 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_body(); - if (value) { - set_has_slow_frame(); - _impl_.body_.slow_frame_ = reinterpret_cast<::google::protobuf::Message*>(value); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.slow_frame) +inline ::int32_t PlayerJoined::_internal_slot() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.slot_; } -inline ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NONNULL HostEvent::_internal_mutable_slow_frame() { - if (body_case() != kSlowFrame) { - clear_body(); - set_has_slow_frame(); - _impl_.body_.slow_frame_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModSlowFrame>(GetArena())); - } - return reinterpret_cast<::modlock::host_app::control::ModSlowFrame*>(_impl_.body_.slow_frame_); +inline void PlayerJoined::_internal_set_slot(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.slot_ = value; } -inline ::modlock::host_app::control::ModSlowFrame* PROTOBUF_NONNULL HostEvent::mutable_slow_frame() + +// string name = 2; +inline void PlayerJoined::clear_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.name_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& PlayerJoined::name() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ModSlowFrame* _msg = _internal_mutable_slow_frame(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.slow_frame) - return _msg; + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerJoined.name) + return _internal_name(); } - -// .modlock.host_app.control.ServiceResult service_applied = 12; -inline bool HostEvent::has_service_applied() const { - return body_case() == kServiceApplied; +template +PROTOBUF_ALWAYS_INLINE void PlayerJoined::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.host_app.control.PlayerJoined.name) } -inline bool HostEvent::_internal_has_service_applied() const { - return body_case() == kServiceApplied; +inline ::std::string* PROTOBUF_NONNULL PlayerJoined::mutable_name() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerJoined.name) + return _s; } -inline void HostEvent::set_has_service_applied() { - _impl_._oneof_case_[0] = kServiceApplied; +inline const ::std::string& PlayerJoined::_internal_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.name_.Get(); } -inline void HostEvent::clear_service_applied() { +inline void PlayerJoined::_internal_set_name(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kServiceApplied) { - if (GetArena() == nullptr) { - delete _impl_.body_.service_applied_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.service_applied_); - } - clear_has_body(); - } + _impl_.name_.Set(value, GetArena()); } -inline ::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE HostEvent::release_service_applied() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.service_applied) - if (body_case() == kServiceApplied) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceResult*>(_impl_.body_.service_applied_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.service_applied_ = nullptr; - return temp; - } else { +inline ::std::string* PROTOBUF_NONNULL PlayerJoined::_internal_mutable_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE PlayerJoined::release_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerJoined.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 const ::modlock::host_app::control::ServiceResult& HostEvent::_internal_service_applied() const { - return body_case() == kServiceApplied ? static_cast(*reinterpret_cast<::modlock::host_app::control::ServiceResult*>(_impl_.body_.service_applied_)) - : reinterpret_cast(::modlock::host_app::control::_ServiceResult_default_instance_); -} -inline const ::modlock::host_app::control::ServiceResult& HostEvent::service_applied() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.service_applied) - return _internal_service_applied(); -} -inline ::modlock::host_app::control::ServiceResult* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_service_applied() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.service_applied) - if (body_case() == kServiceApplied) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ServiceResult*>(_impl_.body_.service_applied_); - _impl_.body_.service_applied_ = nullptr; - return temp; +inline void PlayerJoined::set_allocated_name(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); } else { - return nullptr; + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -} -inline void HostEvent::unsafe_arena_set_allocated_service_applied( - ::modlock::host_app::control::ServiceResult* 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_body(); - if (value) { - set_has_service_applied(); - _impl_.body_.service_applied_ = reinterpret_cast<::google::protobuf::Message*>(value); + _impl_.name_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArena()); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.service_applied) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerJoined.name) } -inline ::modlock::host_app::control::ServiceResult* PROTOBUF_NONNULL HostEvent::_internal_mutable_service_applied() { - if (body_case() != kServiceApplied) { - clear_body(); - set_has_service_applied(); - _impl_.body_.service_applied_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ServiceResult>(GetArena())); - } - return reinterpret_cast<::modlock::host_app::control::ServiceResult*>(_impl_.body_.service_applied_); + +// fixed64 steam_id = 3; +inline void PlayerJoined::clear_steam_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.steam_id_ = ::uint64_t{0u}; + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); } -inline ::modlock::host_app::control::ServiceResult* PROTOBUF_NONNULL HostEvent::mutable_service_applied() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ServiceResult* _msg = _internal_mutable_service_applied(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.service_applied) - return _msg; +inline ::uint64_t PlayerJoined::steam_id() const { + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerJoined.steam_id) + return _internal_steam_id(); } - -// .modlock.host_app.control.ModCallResult called = 13; -inline bool HostEvent::has_called() const { - return body_case() == kCalled; +inline void PlayerJoined::set_steam_id(::uint64_t value) { + _internal_set_steam_id(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerJoined.steam_id) } -inline bool HostEvent::_internal_has_called() const { - return body_case() == kCalled; +inline ::uint64_t PlayerJoined::_internal_steam_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.steam_id_; } -inline void HostEvent::set_has_called() { - _impl_._oneof_case_[0] = kCalled; +inline void PlayerJoined::_internal_set_steam_id(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.steam_id_ = value; } -inline void HostEvent::clear_called() { + +// ------------------------------------------------------------------- + +// PlayerLeft + +// int32 slot = 1; +inline void PlayerLeft::clear_slot() { ::google::protobuf::internal::TSanWrite(&_impl_); - if (body_case() == kCalled) { - if (GetArena() == nullptr) { - delete _impl_.body_.called_; - } else if (::google::protobuf::internal::DebugHardenClearOneofMessageOnArena()) { - ::google::protobuf::internal::MaybePoisonAfterClear(_impl_.body_.called_); - } - clear_has_body(); - } + _impl_.slot_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); } -inline ::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE HostEvent::release_called() { - // @@protoc_insertion_point(field_release:modlock.host_app.control.HostEvent.called) - if (body_case() == kCalled) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModCallResult*>(_impl_.body_.called_); - if (GetArena() != nullptr) { - temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); - } - _impl_.body_.called_ = nullptr; - return temp; - } else { - return nullptr; - } +inline ::int32_t PlayerLeft::slot() const { + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerLeft.slot) + return _internal_slot(); } -inline const ::modlock::host_app::control::ModCallResult& HostEvent::_internal_called() const { - return body_case() == kCalled ? static_cast(*reinterpret_cast<::modlock::host_app::control::ModCallResult*>(_impl_.body_.called_)) - : reinterpret_cast(::modlock::host_app::control::_ModCallResult_default_instance_); +inline void PlayerLeft::set_slot(::int32_t value) { + _internal_set_slot(value); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerLeft.slot) } -inline const ::modlock::host_app::control::ModCallResult& HostEvent::called() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.HostEvent.called) - return _internal_called(); +inline ::int32_t PlayerLeft::_internal_slot() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.slot_; } -inline ::modlock::host_app::control::ModCallResult* PROTOBUF_NULLABLE HostEvent::unsafe_arena_release_called() { - // @@protoc_insertion_point(field_unsafe_arena_release:modlock.host_app.control.HostEvent.called) - if (body_case() == kCalled) { - clear_has_body(); - auto* temp = reinterpret_cast<::modlock::host_app::control::ModCallResult*>(_impl_.body_.called_); - _impl_.body_.called_ = nullptr; - return temp; - } else { - return nullptr; - } +inline void PlayerLeft::_internal_set_slot(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.slot_ = value; } -inline void HostEvent::unsafe_arena_set_allocated_called( - ::modlock::host_app::control::ModCallResult* 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_body(); - if (value) { - set_has_called(); - _impl_.body_.called_ = reinterpret_cast<::google::protobuf::Message*>(value); - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.HostEvent.called) + +// ------------------------------------------------------------------- + +// PlayerMessage + +// string mod = 1; +inline void PlayerMessage::clear_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); } -inline ::modlock::host_app::control::ModCallResult* PROTOBUF_NONNULL HostEvent::_internal_mutable_called() { - if (body_case() != kCalled) { - clear_body(); - set_has_called(); - _impl_.body_.called_ = reinterpret_cast<::google::protobuf::Message*>( - ::google::protobuf::Message::DefaultConstruct<::modlock::host_app::control::ModCallResult>(GetArena())); - } - return reinterpret_cast<::modlock::host_app::control::ModCallResult*>(_impl_.body_.called_); +inline const ::std::string& PlayerMessage::mod() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerMessage.mod) + return _internal_mod(); } -inline ::modlock::host_app::control::ModCallResult* PROTOBUF_NONNULL HostEvent::mutable_called() +template +PROTOBUF_ALWAYS_INLINE void PlayerMessage::set_mod(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.mod_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerMessage.mod) +} +inline ::std::string* PROTOBUF_NONNULL PlayerMessage::mutable_mod() ABSL_ATTRIBUTE_LIFETIME_BOUND { - ::modlock::host_app::control::ModCallResult* _msg = _internal_mutable_called(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.HostEvent.called) - return _msg; + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_mod(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerMessage.mod) + return _s; } - -inline bool HostEvent::has_body() const { - return body_case() != BODY_NOT_SET; +inline const ::std::string& PlayerMessage::_internal_mod() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.mod_.Get(); } -inline void HostEvent::clear_has_body() { - _impl_._oneof_case_[0] = BODY_NOT_SET; +inline void PlayerMessage::_internal_set_mod(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.mod_.Set(value, GetArena()); } -inline HostEvent::BodyCase HostEvent::body_case() const { - return HostEvent::BodyCase(_impl_._oneof_case_[0]); +inline ::std::string* PROTOBUF_NONNULL PlayerMessage::_internal_mutable_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.mod_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE PlayerMessage::release_mod() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerMessage.mod) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.mod_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.mod_.Set("", GetArena()); + } + return released; +} +inline void PlayerMessage::set_allocated_mod(::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_.mod_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { + _impl_.mod_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerMessage.mod) } -// ------------------------------------------------------------------- - -// PlayerChat -// int32 slot = 1; -inline void PlayerChat::clear_slot() { +// int32 slot = 2; +inline void PlayerMessage::clear_slot() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.slot_ = 0; ClearHasBit(_impl_._has_bits_[0], - 0x00000004U); + 0x00000008U); } -inline ::int32_t PlayerChat::slot() const { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerChat.slot) +inline ::int32_t PlayerMessage::slot() const { + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerMessage.slot) return _internal_slot(); } -inline void PlayerChat::set_slot(::int32_t value) { +inline void PlayerMessage::set_slot(::int32_t value) { _internal_set_slot(value); - SetHasBit(_impl_._has_bits_[0], 0x00000004U); - // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerChat.slot) + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerMessage.slot) } -inline ::int32_t PlayerChat::_internal_slot() const { +inline ::int32_t PlayerMessage::_internal_slot() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.slot_; } -inline void PlayerChat::_internal_set_slot(::int32_t value) { +inline void PlayerMessage::_internal_set_slot(::int32_t value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.slot_ = value; } -// string name = 2; -inline void PlayerChat::clear_name() { +// .modlock.host_app.control.MessageKind kind = 3; +inline void PlayerMessage::clear_kind() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.name_.ClearToEmpty(); + _impl_.kind_ = 0; ClearHasBit(_impl_._has_bits_[0], - 0x00000001U); + 0x00000010U); } -inline const ::std::string& PlayerChat::name() const +inline ::modlock::host_app::control::MessageKind PlayerMessage::kind() const { + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerMessage.kind) + return _internal_kind(); +} +inline void PlayerMessage::set_kind(::modlock::host_app::control::MessageKind value) { + _internal_set_kind(value); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerMessage.kind) +} +inline ::modlock::host_app::control::MessageKind PlayerMessage::_internal_kind() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::modlock::host_app::control::MessageKind>(_impl_.kind_); +} +inline void PlayerMessage::_internal_set_kind(::modlock::host_app::control::MessageKind value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.kind_ = value; +} + +// string title = 4; +inline void PlayerMessage::clear_title() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.title_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& PlayerMessage::title() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerChat.name) - return _internal_name(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerMessage.title) + return _internal_title(); } template -PROTOBUF_ALWAYS_INLINE void PlayerChat::set_name(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void PlayerMessage::set_title(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.host_app.control.PlayerChat.name) + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.title_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerMessage.title) } -inline ::std::string* PROTOBUF_NONNULL PlayerChat::mutable_name() +inline ::std::string* PROTOBUF_NONNULL PlayerMessage::mutable_title() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerChat.name) + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_title(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerMessage.title) return _s; } -inline const ::std::string& PlayerChat::_internal_name() const { +inline const ::std::string& PlayerMessage::_internal_title() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.name_.Get(); + return _impl_.title_.Get(); } -inline void PlayerChat::_internal_set_name(const ::std::string& value) { +inline void PlayerMessage::_internal_set_title(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.name_.Set(value, GetArena()); + _impl_.title_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL PlayerChat::_internal_mutable_name() { +inline ::std::string* PROTOBUF_NONNULL PlayerMessage::_internal_mutable_title() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.name_.Mutable( GetArena()); + return _impl_.title_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE PlayerChat::release_name() { +inline ::std::string* PROTOBUF_NULLABLE PlayerMessage::release_title() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerChat.name) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerMessage.title) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.name_.Release(); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.title_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.name_.Set("", GetArena()); + _impl_.title_.Set("", GetArena()); } return released; } -inline void PlayerChat::set_allocated_name(::std::string* PROTOBUF_NULLABLE value) { +inline void PlayerMessage::set_allocated_title(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } - _impl_.name_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArena()); + _impl_.title_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.title_.IsDefault()) { + _impl_.title_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerChat.name) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerMessage.title) } -// string text = 3; -inline void PlayerChat::clear_text() { +// string text = 5; +inline void PlayerMessage::clear_text() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.text_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000002U); + 0x00000004U); } -inline const ::std::string& PlayerChat::text() const +inline const ::std::string& PlayerMessage::text() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerChat.text) + // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerMessage.text) return _internal_text(); } template -PROTOBUF_ALWAYS_INLINE void PlayerChat::set_text(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void PlayerMessage::set_text(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000002U); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); _impl_.text_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerChat.text) + // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerMessage.text) } -inline ::std::string* PROTOBUF_NONNULL PlayerChat::mutable_text() +inline ::std::string* PROTOBUF_NONNULL PlayerMessage::mutable_text() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); ::std::string* _s = _internal_mutable_text(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerChat.text) + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerMessage.text) return _s; } -inline const ::std::string& PlayerChat::_internal_text() const { +inline const ::std::string& PlayerMessage::_internal_text() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.text_.Get(); } -inline void PlayerChat::_internal_set_text(const ::std::string& value) { +inline void PlayerMessage::_internal_set_text(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.text_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL PlayerChat::_internal_mutable_text() { +inline ::std::string* PROTOBUF_NONNULL PlayerMessage::_internal_mutable_text() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.text_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE PlayerChat::release_text() { +inline ::std::string* PROTOBUF_NULLABLE PlayerMessage::release_text() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerChat.text) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerMessage.text) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); auto* released = _impl_.text_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.text_.Set("", GetArena()); } return released; } -inline void PlayerChat::set_allocated_text(::std::string* PROTOBUF_NULLABLE value) { +inline void PlayerMessage::set_allocated_text(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); } _impl_.text_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.text_.IsDefault()) { _impl_.text_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerChat.text) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerMessage.text) } // ------------------------------------------------------------------- -// ModStarted +// ServerReady -// string mod = 1; -inline void ModStarted::clear_mod() { +// string map = 1; +inline void ServerReady::clear_map() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.mod_.ClearToEmpty(); + _impl_.map_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& ModStarted::mod() const +inline const ::std::string& ServerReady::map() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModStarted.mod) - return _internal_mod(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServerReady.map) + return _internal_map(); } template -PROTOBUF_ALWAYS_INLINE void ModStarted::set_mod(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServerReady::set_map(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); - _impl_.mod_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModStarted.mod) + _impl_.map_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServerReady.map) } -inline ::std::string* PROTOBUF_NONNULL ModStarted::mutable_mod() +inline ::std::string* PROTOBUF_NONNULL ServerReady::mutable_map() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_mod(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModStarted.mod) + ::std::string* _s = _internal_mutable_map(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServerReady.map) return _s; } -inline const ::std::string& ModStarted::_internal_mod() const { +inline const ::std::string& ServerReady::_internal_map() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.mod_.Get(); + return _impl_.map_.Get(); } -inline void ModStarted::_internal_set_mod(const ::std::string& value) { +inline void ServerReady::_internal_set_map(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.mod_.Set(value, GetArena()); + _impl_.map_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ModStarted::_internal_mutable_mod() { +inline ::std::string* PROTOBUF_NONNULL ServerReady::_internal_mutable_map() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.mod_.Mutable( GetArena()); + return _impl_.map_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ModStarted::release_mod() { +inline ::std::string* PROTOBUF_NULLABLE ServerReady::release_map() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModStarted.mod) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServerReady.map) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.mod_.Release(); + auto* released = _impl_.map_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.mod_.Set("", GetArena()); + _impl_.map_.Set("", GetArena()); } return released; } -inline void ModStarted::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { +inline void ServerReady::set_allocated_map(::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_.mod_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { - _impl_.mod_.Set("", GetArena()); + _impl_.map_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.map_.IsDefault()) { + _impl_.map_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModStarted.mod) -} - -// bool reloaded = 2; -inline void ModStarted::clear_reloaded() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.reloaded_ = false; - ClearHasBit(_impl_._has_bits_[0], - 0x00000002U); -} -inline bool ModStarted::reloaded() const { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModStarted.reloaded) - return _internal_reloaded(); -} -inline void ModStarted::set_reloaded(bool value) { - _internal_set_reloaded(value); - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModStarted.reloaded) -} -inline bool ModStarted::_internal_reloaded() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.reloaded_; -} -inline void ModStarted::_internal_set_reloaded(bool value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.reloaded_ = value; + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServerReady.map) } // ------------------------------------------------------------------- -// ModLog +// UiChanged // string mod = 1; -inline void ModLog::clear_mod() { +inline void UiChanged::clear_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mod_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& ModLog::mod() const +inline const ::std::string& UiChanged::mod() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModLog.mod) + // @@protoc_insertion_point(field_get:modlock.host_app.control.UiChanged.mod) return _internal_mod(); } template -PROTOBUF_ALWAYS_INLINE void ModLog::set_mod(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void UiChanged::set_mod(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); _impl_.mod_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModLog.mod) + // @@protoc_insertion_point(field_set:modlock.host_app.control.UiChanged.mod) } -inline ::std::string* PROTOBUF_NONNULL ModLog::mutable_mod() +inline ::std::string* PROTOBUF_NONNULL UiChanged::mutable_mod() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); ::std::string* _s = _internal_mutable_mod(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModLog.mod) + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.UiChanged.mod) return _s; } -inline const ::std::string& ModLog::_internal_mod() const { +inline const ::std::string& UiChanged::_internal_mod() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.mod_.Get(); } -inline void ModLog::_internal_set_mod(const ::std::string& value) { +inline void UiChanged::_internal_set_mod(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mod_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ModLog::_internal_mutable_mod() { +inline ::std::string* PROTOBUF_NONNULL UiChanged::_internal_mutable_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.mod_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ModLog::release_mod() { +inline ::std::string* PROTOBUF_NULLABLE UiChanged::release_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModLog.mod) + // @@protoc_insertion_point(field_release:modlock.host_app.control.UiChanged.mod) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } @@ -6907,7 +9385,7 @@ inline ::std::string* PROTOBUF_NULLABLE ModLog::release_mod() { } return released; } -inline void ModLog::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { +inline void UiChanged::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000001U); @@ -6918,119 +9396,172 @@ inline void ModLog::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { _impl_.mod_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModLog.mod) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.UiChanged.mod) } -// string text = 2; -inline void ModLog::clear_text() { +// int32 slot = 2; +inline void UiChanged::clear_slot() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.text_.ClearToEmpty(); + _impl_.slot_ = 0; ClearHasBit(_impl_._has_bits_[0], - 0x00000002U); + 0x00000004U); } -inline const ::std::string& ModLog::text() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModLog.text) - return _internal_text(); +inline ::int32_t UiChanged::slot() const { + // @@protoc_insertion_point(field_get:modlock.host_app.control.UiChanged.slot) + return _internal_slot(); } -template -PROTOBUF_ALWAYS_INLINE void ModLog::set_text(Arg_&& arg, Args_... args) { +inline void UiChanged::set_slot(::int32_t value) { + _internal_set_slot(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:modlock.host_app.control.UiChanged.slot) +} +inline ::int32_t UiChanged::_internal_slot() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.slot_; +} +inline void UiChanged::_internal_set_slot(::int32_t value) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - _impl_.text_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModLog.text) + _impl_.slot_ = value; } -inline ::std::string* PROTOBUF_NONNULL ModLog::mutable_text() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - ::std::string* _s = _internal_mutable_text(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModLog.text) - return _s; + +// .modlock.wasm.ui.Change change = 3; +inline bool UiChanged::has_change() const { + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000002U); + PROTOBUF_ASSUME(!value || _impl_.change_ != nullptr); + return value; } -inline const ::std::string& ModLog::_internal_text() const { +inline const ::modlock::wasm::ui::Change& UiChanged::_internal_change() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.text_.Get(); + const ::modlock::wasm::ui::Change* p = _impl_.change_; + return p != nullptr ? *p : reinterpret_cast(::modlock::wasm::ui::_Change_default_instance_); } -inline void ModLog::_internal_set_text(const ::std::string& value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.text_.Set(value, GetArena()); +inline const ::modlock::wasm::ui::Change& UiChanged::change() const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.UiChanged.change) + return _internal_change(); } -inline ::std::string* PROTOBUF_NONNULL ModLog::_internal_mutable_text() { +inline void UiChanged::unsafe_arena_set_allocated_change( + ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.text_.Mutable( GetArena()); + if (GetArena() == nullptr) { + delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.change_); + } + _impl_.change_ = reinterpret_cast<::modlock::wasm::ui::Change*>(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.host_app.control.UiChanged.change) } -inline ::std::string* PROTOBUF_NULLABLE ModLog::release_text() { +inline ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE UiChanged::release_change() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModLog.text) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { - return nullptr; - } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - auto* released = _impl_.text_.Release(); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.text_.Set("", GetArena()); + ::modlock::wasm::ui::Change* released = _impl_.change_; + _impl_.change_ = 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 void ModLog::set_allocated_text(::std::string* PROTOBUF_NULLABLE value) { +inline ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE UiChanged::unsafe_arena_release_change() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.UiChanged.change) + + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::ui::Change* temp = _impl_.change_; + _impl_.change_ = nullptr; + return temp; +} +inline ::modlock::wasm::ui::Change* PROTOBUF_NONNULL UiChanged::_internal_mutable_change() { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (_impl_.change_ == nullptr) { + auto* p = ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::ui::Change>(GetArena()); + _impl_.change_ = reinterpret_cast<::modlock::wasm::ui::Change*>(p); + } + return _impl_.change_; +} +inline ::modlock::wasm::ui::Change* PROTOBUF_NONNULL UiChanged::mutable_change() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::modlock::wasm::ui::Change* _msg = _internal_mutable_change(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.UiChanged.change) + return _msg; +} +inline void UiChanged::set_allocated_change(::modlock::wasm::ui::Change* 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_.change_); + } + if (value != nullptr) { + ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::Message*>(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_.text_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.text_.IsDefault()) { - _impl_.text_.Set("", GetArena()); - } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModLog.text) + + _impl_.change_ = reinterpret_cast<::modlock::wasm::ui::Change*>(value); + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.UiChanged.change) } // ------------------------------------------------------------------- -// ModFailed +// ServiceReply // string mod = 1; -inline void ModFailed::clear_mod() { +inline void ServiceReply::clear_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mod_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& ModFailed::mod() const +inline const ::std::string& ServiceReply::mod() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModFailed.mod) + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.mod) return _internal_mod(); } template -PROTOBUF_ALWAYS_INLINE void ModFailed::set_mod(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceReply::set_mod(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); _impl_.mod_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModFailed.mod) + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.mod) } -inline ::std::string* PROTOBUF_NONNULL ModFailed::mutable_mod() +inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_mod() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); ::std::string* _s = _internal_mutable_mod(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModFailed.mod) + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.mod) return _s; } -inline const ::std::string& ModFailed::_internal_mod() const { +inline const ::std::string& ServiceReply::_internal_mod() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.mod_.Get(); } -inline void ModFailed::_internal_set_mod(const ::std::string& value) { +inline void ServiceReply::_internal_set_mod(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mod_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ModFailed::_internal_mutable_mod() { +inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.mod_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ModFailed::release_mod() { +inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModFailed.mod) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.mod) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } @@ -7041,7 +9572,7 @@ inline ::std::string* PROTOBUF_NULLABLE ModFailed::release_mod() { } return released; } -inline void ModFailed::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceReply::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000001U); @@ -7052,591 +9583,513 @@ inline void ModFailed::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { _impl_.mod_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModFailed.mod) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.mod) } -// string error = 2; -inline void ModFailed::clear_error() { +// string service = 2; +inline void ServiceReply::clear_service() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.error_.ClearToEmpty(); + _impl_.service_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } -inline const ::std::string& ModFailed::error() const +inline const ::std::string& ServiceReply::service() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModFailed.error) - return _internal_error(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.service) + return _internal_service(); } template -PROTOBUF_ALWAYS_INLINE void ModFailed::set_error(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceReply::set_service(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000002U); - _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModFailed.error) + _impl_.service_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.service) } -inline ::std::string* PROTOBUF_NONNULL ModFailed::mutable_error() +inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_service() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000002U); - ::std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModFailed.error) + ::std::string* _s = _internal_mutable_service(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.service) return _s; } -inline const ::std::string& ModFailed::_internal_error() const { +inline const ::std::string& ServiceReply::_internal_service() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.error_.Get(); + return _impl_.service_.Get(); } -inline void ModFailed::_internal_set_error(const ::std::string& value) { +inline void ServiceReply::_internal_set_service(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.error_.Set(value, GetArena()); + _impl_.service_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ModFailed::_internal_mutable_error() { +inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_service() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.error_.Mutable( GetArena()); + return _impl_.service_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ModFailed::release_error() { +inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_service() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModFailed.error) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.service) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { return nullptr; } ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - auto* released = _impl_.error_.Release(); + auto* released = _impl_.service_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.error_.Set("", GetArena()); + _impl_.service_.Set("", GetArena()); } return released; } -inline void ModFailed::set_allocated_error(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceReply::set_allocated_service(::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_.error_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.error_.IsDefault()) { - _impl_.error_.Set("", GetArena()); + _impl_.service_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.service_.IsDefault()) { + _impl_.service_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModFailed.error) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.service) } -// ------------------------------------------------------------------- - -// ModCalls - -// string mod = 1; -inline void ModCalls::clear_mod() { +// string method = 3; +inline void ServiceReply::clear_method() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.mod_.ClearToEmpty(); + _impl_.method_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000001U); + 0x00000004U); } -inline const ::std::string& ModCalls::mod() const +inline const ::std::string& ServiceReply::method() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCalls.mod) - return _internal_mod(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.method) + return _internal_method(); } template -PROTOBUF_ALWAYS_INLINE void ModCalls::set_mod(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceReply::set_method(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - _impl_.mod_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModCalls.mod) + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.method_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.method) } -inline ::std::string* PROTOBUF_NONNULL ModCalls::mutable_mod() +inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_method() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_mod(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCalls.mod) + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_method(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.method) return _s; } -inline const ::std::string& ModCalls::_internal_mod() const { +inline const ::std::string& ServiceReply::_internal_method() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.mod_.Get(); + return _impl_.method_.Get(); } -inline void ModCalls::_internal_set_mod(const ::std::string& value) { +inline void ServiceReply::_internal_set_method(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.mod_.Set(value, GetArena()); + _impl_.method_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ModCalls::_internal_mutable_mod() { +inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_method() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.mod_.Mutable( GetArena()); + return _impl_.method_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ModCalls::release_mod() { +inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_method() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCalls.mod) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.method) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.mod_.Release(); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.method_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.mod_.Set("", GetArena()); + _impl_.method_.Set("", GetArena()); } return released; } -inline void ModCalls::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceReply::set_allocated_method(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); } - _impl_.mod_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { - _impl_.mod_.Set("", GetArena()); + _impl_.method_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.method_.IsDefault()) { + _impl_.method_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCalls.mod) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.method) } -// .modlock.wasm.profile.CallProfile profile = 2; -inline bool ModCalls::has_profile() const { - bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000002U); - PROTOBUF_ASSUME(!value || _impl_.profile_ != nullptr); - return value; -} -inline const ::modlock::wasm::profile::CallProfile& ModCalls::_internal_profile() const { - ::google::protobuf::internal::TSanRead(&_impl_); - const ::modlock::wasm::profile::CallProfile* p = _impl_.profile_; - return p != nullptr ? *p : reinterpret_cast(::modlock::wasm::profile::_CallProfile_default_instance_); +// bytes payload = 4; +inline void ServiceReply::clear_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.payload_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000008U); } -inline const ::modlock::wasm::profile::CallProfile& ModCalls::profile() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModCalls.profile) - return _internal_profile(); +inline const ::std::string& ServiceReply::payload() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.payload) + return _internal_payload(); } -inline void ModCalls::unsafe_arena_set_allocated_profile( - ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE value) { +template +PROTOBUF_ALWAYS_INLINE void ServiceReply::set_payload(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.profile_); - } - _impl_.profile_ = reinterpret_cast<::modlock::wasm::profile::CallProfile*>(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.host_app.control.ModCalls.profile) + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.payload) } -inline ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE ModCalls::release_profile() { +inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_payload() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + ::std::string* _s = _internal_mutable_payload(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.payload) + return _s; +} +inline const ::std::string& ServiceReply::_internal_payload() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.payload_.Get(); +} +inline void ServiceReply::_internal_set_payload(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - ::modlock::wasm::profile::CallProfile* released = _impl_.profile_; - _impl_.profile_ = 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; + _impl_.payload_.Set(value, GetArena()); } -inline ::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE ModCalls::unsafe_arena_release_profile() { +inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModCalls.profile) - - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - ::modlock::wasm::profile::CallProfile* temp = _impl_.profile_; - _impl_.profile_ = nullptr; - return temp; + return _impl_.payload_.Mutable( GetArena()); } -inline ::modlock::wasm::profile::CallProfile* PROTOBUF_NONNULL ModCalls::_internal_mutable_profile() { +inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - if (_impl_.profile_ == nullptr) { - auto* p = ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::profile::CallProfile>(GetArena()); - _impl_.profile_ = reinterpret_cast<::modlock::wasm::profile::CallProfile*>(p); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.payload) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000008U)) { + return nullptr; } - return _impl_.profile_; -} -inline ::modlock::wasm::profile::CallProfile* PROTOBUF_NONNULL ModCalls::mutable_profile() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - ::modlock::wasm::profile::CallProfile* _msg = _internal_mutable_profile(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModCalls.profile) - return _msg; + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + auto* released = _impl_.payload_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.payload_.Set("", GetArena()); + } + return released; } -inline void ModCalls::set_allocated_profile(::modlock::wasm::profile::CallProfile* PROTOBUF_NULLABLE value) { - ::google::protobuf::Arena* message_arena = GetArena(); +inline void ServiceReply::set_allocated_payload(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.profile_); - } - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::Message*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - SetHasBit(_impl_._has_bits_[0], 0x00000002U); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); } - - _impl_.profile_ = reinterpret_cast<::modlock::wasm::profile::CallProfile*>(value); - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModCalls.profile) + _impl_.payload_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { + _impl_.payload_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.payload) } -// ------------------------------------------------------------------- - -// ModSlowFrame - -// string mod = 1; -inline void ModSlowFrame::clear_mod() { +// string path = 5; +inline void ServiceReply::clear_path() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.mod_.ClearToEmpty(); + _impl_.path_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000001U); + 0x00000010U); } -inline const ::std::string& ModSlowFrame::mod() const +inline const ::std::string& ServiceReply::path() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModSlowFrame.mod) - return _internal_mod(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.path) + return _internal_path(); } template -PROTOBUF_ALWAYS_INLINE void ModSlowFrame::set_mod(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceReply::set_path(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - _impl_.mod_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ModSlowFrame.mod) + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + _impl_.path_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.path) } -inline ::std::string* PROTOBUF_NONNULL ModSlowFrame::mutable_mod() +inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_path() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_mod(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModSlowFrame.mod) + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + ::std::string* _s = _internal_mutable_path(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.path) return _s; } -inline const ::std::string& ModSlowFrame::_internal_mod() const { +inline const ::std::string& ServiceReply::_internal_path() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.mod_.Get(); + return _impl_.path_.Get(); } -inline void ModSlowFrame::_internal_set_mod(const ::std::string& value) { +inline void ServiceReply::_internal_set_path(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.mod_.Set(value, GetArena()); + _impl_.path_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ModSlowFrame::_internal_mutable_mod() { +inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_path() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.mod_.Mutable( GetArena()); + return _impl_.path_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ModSlowFrame::release_mod() { +inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_path() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModSlowFrame.mod) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.path) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000010U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.mod_.Release(); + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + auto* released = _impl_.path_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.mod_.Set("", GetArena()); + _impl_.path_.Set("", GetArena()); } return released; } -inline void ModSlowFrame::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceReply::set_allocated_path(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); } - _impl_.mod_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { - _impl_.mod_.Set("", GetArena()); + _impl_.path_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.path_.IsDefault()) { + _impl_.path_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModSlowFrame.mod) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.path) } -// .modlock.wasm.profile.SlowFrame report = 2; -inline bool ModSlowFrame::has_report() const { - bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000002U); - PROTOBUF_ASSUME(!value || _impl_.report_ != nullptr); - return value; -} -inline const ::modlock::wasm::profile::SlowFrame& ModSlowFrame::_internal_report() const { - ::google::protobuf::internal::TSanRead(&_impl_); - const ::modlock::wasm::profile::SlowFrame* p = _impl_.report_; - return p != nullptr ? *p : reinterpret_cast(::modlock::wasm::profile::_SlowFrame_default_instance_); +// string id = 6; +inline void ServiceReply::clear_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.id_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000020U); } -inline const ::modlock::wasm::profile::SlowFrame& ModSlowFrame::report() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ModSlowFrame.report) - return _internal_report(); +inline const ::std::string& ServiceReply::id() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.id) + return _internal_id(); } -inline void ModSlowFrame::unsafe_arena_set_allocated_report( - ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE value) { +template +PROTOBUF_ALWAYS_INLINE void ServiceReply::set_id(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.report_); - } - _impl_.report_ = reinterpret_cast<::modlock::wasm::profile::SlowFrame*>(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.host_app.control.ModSlowFrame.report) + SetHasBit(_impl_._has_bits_[0], 0x00000020U); + _impl_.id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.id) } -inline ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE ModSlowFrame::release_report() { +inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_id() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000020U); + ::std::string* _s = _internal_mutable_id(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.id) + return _s; +} +inline const ::std::string& ServiceReply::_internal_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.id_.Get(); +} +inline void ServiceReply::_internal_set_id(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - ::modlock::wasm::profile::SlowFrame* released = _impl_.report_; - _impl_.report_ = 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; + _impl_.id_.Set(value, GetArena()); } -inline ::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE ModSlowFrame::unsafe_arena_release_report() { +inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_id() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ModSlowFrame.report) - - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - ::modlock::wasm::profile::SlowFrame* temp = _impl_.report_; - _impl_.report_ = nullptr; - return temp; + return _impl_.id_.Mutable( GetArena()); } -inline ::modlock::wasm::profile::SlowFrame* PROTOBUF_NONNULL ModSlowFrame::_internal_mutable_report() { +inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_id() { ::google::protobuf::internal::TSanWrite(&_impl_); - if (_impl_.report_ == nullptr) { - auto* p = ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::profile::SlowFrame>(GetArena()); - _impl_.report_ = reinterpret_cast<::modlock::wasm::profile::SlowFrame*>(p); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.id) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000020U)) { + return nullptr; } - return _impl_.report_; -} -inline ::modlock::wasm::profile::SlowFrame* PROTOBUF_NONNULL ModSlowFrame::mutable_report() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - ::modlock::wasm::profile::SlowFrame* _msg = _internal_mutable_report(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ModSlowFrame.report) - return _msg; + ClearHasBit(_impl_._has_bits_[0], 0x00000020U); + auto* released = _impl_.id_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.id_.Set("", GetArena()); + } + return released; } -inline void ModSlowFrame::set_allocated_report(::modlock::wasm::profile::SlowFrame* PROTOBUF_NULLABLE value) { - ::google::protobuf::Arena* message_arena = GetArena(); +inline void ServiceReply::set_allocated_id(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.report_); - } - if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::Message*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - SetHasBit(_impl_._has_bits_[0], 0x00000002U); + SetHasBit(_impl_._has_bits_[0], 0x00000020U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ClearHasBit(_impl_._has_bits_[0], 0x00000020U); } - - _impl_.report_ = reinterpret_cast<::modlock::wasm::profile::SlowFrame*>(value); - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ModSlowFrame.report) + _impl_.id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.id_.IsDefault()) { + _impl_.id_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.id) } // ------------------------------------------------------------------- -// PlayerJoined - -// int32 slot = 1; -inline void PlayerJoined::clear_slot() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.slot_ = 0; - ClearHasBit(_impl_._has_bits_[0], - 0x00000004U); -} -inline ::int32_t PlayerJoined::slot() const { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerJoined.slot) - return _internal_slot(); -} -inline void PlayerJoined::set_slot(::int32_t value) { - _internal_set_slot(value); - SetHasBit(_impl_._has_bits_[0], 0x00000004U); - // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerJoined.slot) -} -inline ::int32_t PlayerJoined::_internal_slot() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.slot_; -} -inline void PlayerJoined::_internal_set_slot(::int32_t value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.slot_ = value; -} +// ServiceResult -// string name = 2; -inline void PlayerJoined::clear_name() { +// string id = 1; +inline void ServiceResult::clear_id() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.name_.ClearToEmpty(); + _impl_.id_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& PlayerJoined::name() const +inline const ::std::string& ServiceResult::id() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerJoined.name) - return _internal_name(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceResult.id) + return _internal_id(); } template -PROTOBUF_ALWAYS_INLINE void PlayerJoined::set_name(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceResult::set_id(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.host_app.control.PlayerJoined.name) + _impl_.id_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceResult.id) } -inline ::std::string* PROTOBUF_NONNULL PlayerJoined::mutable_name() +inline ::std::string* PROTOBUF_NONNULL ServiceResult::mutable_id() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_name(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerJoined.name) + ::std::string* _s = _internal_mutable_id(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceResult.id) return _s; } -inline const ::std::string& PlayerJoined::_internal_name() const { +inline const ::std::string& ServiceResult::_internal_id() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.name_.Get(); + return _impl_.id_.Get(); } -inline void PlayerJoined::_internal_set_name(const ::std::string& value) { +inline void ServiceResult::_internal_set_id(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.name_.Set(value, GetArena()); + _impl_.id_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL PlayerJoined::_internal_mutable_name() { +inline ::std::string* PROTOBUF_NONNULL ServiceResult::_internal_mutable_id() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.name_.Mutable( GetArena()); + return _impl_.id_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE PlayerJoined::release_name() { +inline ::std::string* PROTOBUF_NULLABLE ServiceResult::release_id() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerJoined.name) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceResult.id) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.name_.Release(); + auto* released = _impl_.id_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.name_.Set("", GetArena()); + _impl_.id_.Set("", GetArena()); } return released; } -inline void PlayerJoined::set_allocated_name(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceResult::set_allocated_id(::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()); + _impl_.id_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.id_.IsDefault()) { + _impl_.id_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerJoined.name) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceResult.id) } -// fixed64 steam_id = 3; -inline void PlayerJoined::clear_steam_id() { +// string error = 2; +inline void ServiceResult::clear_error() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.steam_id_ = ::uint64_t{0u}; + _impl_.error_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } -inline ::uint64_t PlayerJoined::steam_id() const { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerJoined.steam_id) - return _internal_steam_id(); +inline const ::std::string& ServiceResult::error() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceResult.error) + return _internal_error(); +} +template +PROTOBUF_ALWAYS_INLINE void ServiceResult::set_error(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.error_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceResult.error) } -inline void PlayerJoined::set_steam_id(::uint64_t value) { - _internal_set_steam_id(value); +inline ::std::string* PROTOBUF_NONNULL ServiceResult::mutable_error() + ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000002U); - // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerJoined.steam_id) + ::std::string* _s = _internal_mutable_error(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceResult.error) + return _s; } -inline ::uint64_t PlayerJoined::_internal_steam_id() const { +inline const ::std::string& ServiceResult::_internal_error() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.steam_id_; + return _impl_.error_.Get(); } -inline void PlayerJoined::_internal_set_steam_id(::uint64_t value) { +inline void ServiceResult::_internal_set_error(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.steam_id_ = value; + _impl_.error_.Set(value, GetArena()); } - -// ------------------------------------------------------------------- - -// PlayerLeft - -// int32 slot = 1; -inline void PlayerLeft::clear_slot() { +inline ::std::string* PROTOBUF_NONNULL ServiceResult::_internal_mutable_error() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.slot_ = 0; - ClearHasBit(_impl_._has_bits_[0], - 0x00000001U); -} -inline ::int32_t PlayerLeft::slot() const { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerLeft.slot) - return _internal_slot(); -} -inline void PlayerLeft::set_slot(::int32_t value) { - _internal_set_slot(value); - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerLeft.slot) + return _impl_.error_.Mutable( GetArena()); } -inline ::int32_t PlayerLeft::_internal_slot() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.slot_; +inline ::std::string* PROTOBUF_NULLABLE ServiceResult::release_error() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceResult.error) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.error_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.error_.Set("", GetArena()); + } + return released; } -inline void PlayerLeft::_internal_set_slot(::int32_t value) { +inline void ServiceResult::set_allocated_error(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.slot_ = value; + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.error_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.error_.IsDefault()) { + _impl_.error_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceResult.error) } // ------------------------------------------------------------------- -// PlayerMessage +// Fixture // string mod = 1; -inline void PlayerMessage::clear_mod() { +inline void Fixture::clear_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mod_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& PlayerMessage::mod() const +inline const ::std::string& Fixture::mod() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerMessage.mod) + // @@protoc_insertion_point(field_get:modlock.host_app.control.Fixture.mod) return _internal_mod(); } template -PROTOBUF_ALWAYS_INLINE void PlayerMessage::set_mod(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void Fixture::set_mod(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); _impl_.mod_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerMessage.mod) + // @@protoc_insertion_point(field_set:modlock.host_app.control.Fixture.mod) } -inline ::std::string* PROTOBUF_NONNULL PlayerMessage::mutable_mod() +inline ::std::string* PROTOBUF_NONNULL Fixture::mutable_mod() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); ::std::string* _s = _internal_mutable_mod(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerMessage.mod) + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.Fixture.mod) return _s; } -inline const ::std::string& PlayerMessage::_internal_mod() const { +inline const ::std::string& Fixture::_internal_mod() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.mod_.Get(); } -inline void PlayerMessage::_internal_set_mod(const ::std::string& value) { +inline void Fixture::_internal_set_mod(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mod_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL PlayerMessage::_internal_mutable_mod() { +inline ::std::string* PROTOBUF_NONNULL Fixture::_internal_mutable_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.mod_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE PlayerMessage::release_mod() { +inline ::std::string* PROTOBUF_NULLABLE Fixture::release_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerMessage.mod) + // @@protoc_insertion_point(field_release:modlock.host_app.control.Fixture.mod) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } @@ -7647,7 +10100,7 @@ inline ::std::string* PROTOBUF_NULLABLE PlayerMessage::release_mod() { } return released; } -inline void PlayerMessage::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { +inline void Fixture::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000001U); @@ -7658,303 +10111,314 @@ inline void PlayerMessage::set_allocated_mod(::std::string* PROTOBUF_NULLABLE va if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { _impl_.mod_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerMessage.mod) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.Fixture.mod) } -// int32 slot = 2; -inline void PlayerMessage::clear_slot() { +// string service = 2; +inline void Fixture::clear_service() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.slot_ = 0; + _impl_.service_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000008U); + 0x00000002U); } -inline ::int32_t PlayerMessage::slot() const { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerMessage.slot) - return _internal_slot(); +inline const ::std::string& Fixture::service() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.Fixture.service) + return _internal_service(); } -inline void PlayerMessage::set_slot(::int32_t value) { - _internal_set_slot(value); - SetHasBit(_impl_._has_bits_[0], 0x00000008U); - // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerMessage.slot) +template +PROTOBUF_ALWAYS_INLINE void Fixture::set_service(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.service_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.Fixture.service) } -inline ::int32_t PlayerMessage::_internal_slot() const { +inline ::std::string* PROTOBUF_NONNULL Fixture::mutable_service() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_service(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.Fixture.service) + return _s; +} +inline const ::std::string& Fixture::_internal_service() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.slot_; + return _impl_.service_.Get(); } -inline void PlayerMessage::_internal_set_slot(::int32_t value) { +inline void Fixture::_internal_set_service(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.slot_ = value; + _impl_.service_.Set(value, GetArena()); } - -// .modlock.host_app.control.MessageKind kind = 3; -inline void PlayerMessage::clear_kind() { +inline ::std::string* PROTOBUF_NONNULL Fixture::_internal_mutable_service() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.kind_ = 0; - ClearHasBit(_impl_._has_bits_[0], - 0x00000010U); -} -inline ::modlock::host_app::control::MessageKind PlayerMessage::kind() const { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerMessage.kind) - return _internal_kind(); -} -inline void PlayerMessage::set_kind(::modlock::host_app::control::MessageKind value) { - _internal_set_kind(value); - SetHasBit(_impl_._has_bits_[0], 0x00000010U); - // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerMessage.kind) + return _impl_.service_.Mutable( GetArena()); } -inline ::modlock::host_app::control::MessageKind PlayerMessage::_internal_kind() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return static_cast<::modlock::host_app::control::MessageKind>(_impl_.kind_); +inline ::std::string* PROTOBUF_NULLABLE Fixture::release_service() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.Fixture.service) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.service_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.service_.Set("", GetArena()); + } + return released; } -inline void PlayerMessage::_internal_set_kind(::modlock::host_app::control::MessageKind value) { +inline void Fixture::set_allocated_service(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.kind_ = value; + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.service_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.service_.IsDefault()) { + _impl_.service_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.Fixture.service) } -// string title = 4; -inline void PlayerMessage::clear_title() { +// string method = 3; +inline void Fixture::clear_method() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.title_.ClearToEmpty(); + _impl_.method_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000002U); + 0x00000004U); } -inline const ::std::string& PlayerMessage::title() const +inline const ::std::string& Fixture::method() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerMessage.title) - return _internal_title(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.Fixture.method) + return _internal_method(); } template -PROTOBUF_ALWAYS_INLINE void PlayerMessage::set_title(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void Fixture::set_method(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - _impl_.title_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerMessage.title) + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.method_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.Fixture.method) } -inline ::std::string* PROTOBUF_NONNULL PlayerMessage::mutable_title() +inline ::std::string* PROTOBUF_NONNULL Fixture::mutable_method() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - ::std::string* _s = _internal_mutable_title(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerMessage.title) + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_method(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.Fixture.method) return _s; } -inline const ::std::string& PlayerMessage::_internal_title() const { +inline const ::std::string& Fixture::_internal_method() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.title_.Get(); + return _impl_.method_.Get(); } -inline void PlayerMessage::_internal_set_title(const ::std::string& value) { +inline void Fixture::_internal_set_method(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.title_.Set(value, GetArena()); + _impl_.method_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL PlayerMessage::_internal_mutable_title() { +inline ::std::string* PROTOBUF_NONNULL Fixture::_internal_mutable_method() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.title_.Mutable( GetArena()); + return _impl_.method_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE PlayerMessage::release_title() { +inline ::std::string* PROTOBUF_NULLABLE Fixture::release_method() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerMessage.title) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + // @@protoc_insertion_point(field_release:modlock.host_app.control.Fixture.method) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - auto* released = _impl_.title_.Release(); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.method_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.title_.Set("", GetArena()); + _impl_.method_.Set("", GetArena()); } return released; } -inline void PlayerMessage::set_allocated_title(::std::string* PROTOBUF_NULLABLE value) { +inline void Fixture::set_allocated_method(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); } - _impl_.title_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.title_.IsDefault()) { - _impl_.title_.Set("", GetArena()); + _impl_.method_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.method_.IsDefault()) { + _impl_.method_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerMessage.title) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.Fixture.method) } -// string text = 5; -inline void PlayerMessage::clear_text() { +// bytes payload = 4; +inline void Fixture::clear_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.text_.ClearToEmpty(); + _impl_.payload_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000004U); + 0x00000008U); } -inline const ::std::string& PlayerMessage::text() const +inline const ::std::string& Fixture::payload() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.PlayerMessage.text) - return _internal_text(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.Fixture.payload) + return _internal_payload(); } template -PROTOBUF_ALWAYS_INLINE void PlayerMessage::set_text(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void Fixture::set_payload(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000004U); - _impl_.text_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.PlayerMessage.text) + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.Fixture.payload) } -inline ::std::string* PROTOBUF_NONNULL PlayerMessage::mutable_text() +inline ::std::string* PROTOBUF_NONNULL Fixture::mutable_payload() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000004U); - ::std::string* _s = _internal_mutable_text(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.PlayerMessage.text) + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + ::std::string* _s = _internal_mutable_payload(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.Fixture.payload) return _s; } -inline const ::std::string& PlayerMessage::_internal_text() const { +inline const ::std::string& Fixture::_internal_payload() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.text_.Get(); + return _impl_.payload_.Get(); } -inline void PlayerMessage::_internal_set_text(const ::std::string& value) { +inline void Fixture::_internal_set_payload(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.text_.Set(value, GetArena()); + _impl_.payload_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL PlayerMessage::_internal_mutable_text() { +inline ::std::string* PROTOBUF_NONNULL Fixture::_internal_mutable_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.text_.Mutable( GetArena()); + return _impl_.payload_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE PlayerMessage::release_text() { +inline ::std::string* PROTOBUF_NULLABLE Fixture::release_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.PlayerMessage.text) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + // @@protoc_insertion_point(field_release:modlock.host_app.control.Fixture.payload) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000008U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); - auto* released = _impl_.text_.Release(); + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); + auto* released = _impl_.payload_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.text_.Set("", GetArena()); + _impl_.payload_.Set("", GetArena()); } return released; } -inline void PlayerMessage::set_allocated_text(::std::string* PROTOBUF_NULLABLE value) { +inline void Fixture::set_allocated_payload(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000004U); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + ClearHasBit(_impl_._has_bits_[0], 0x00000008U); } - _impl_.text_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.text_.IsDefault()) { - _impl_.text_.Set("", GetArena()); + _impl_.payload_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { + _impl_.payload_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.PlayerMessage.text) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.Fixture.payload) } -// ------------------------------------------------------------------- - -// ServerReady - -// string map = 1; -inline void ServerReady::clear_map() { +// string source = 5; +inline void Fixture::clear_source() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.map_.ClearToEmpty(); + _impl_.source_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000001U); + 0x00000010U); } -inline const ::std::string& ServerReady::map() const +inline const ::std::string& Fixture::source() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ServerReady.map) - return _internal_map(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.Fixture.source) + return _internal_source(); } template -PROTOBUF_ALWAYS_INLINE void ServerReady::set_map(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void Fixture::set_source(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - _impl_.map_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ServerReady.map) + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + _impl_.source_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.Fixture.source) } -inline ::std::string* PROTOBUF_NONNULL ServerReady::mutable_map() +inline ::std::string* PROTOBUF_NONNULL Fixture::mutable_source() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_map(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServerReady.map) + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + ::std::string* _s = _internal_mutable_source(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.Fixture.source) return _s; } -inline const ::std::string& ServerReady::_internal_map() const { +inline const ::std::string& Fixture::_internal_source() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.map_.Get(); + return _impl_.source_.Get(); } -inline void ServerReady::_internal_set_map(const ::std::string& value) { +inline void Fixture::_internal_set_source(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.map_.Set(value, GetArena()); + _impl_.source_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServerReady::_internal_mutable_map() { +inline ::std::string* PROTOBUF_NONNULL Fixture::_internal_mutable_source() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.map_.Mutable( GetArena()); + return _impl_.source_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServerReady::release_map() { +inline ::std::string* PROTOBUF_NULLABLE Fixture::release_source() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ServerReady.map) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + // @@protoc_insertion_point(field_release:modlock.host_app.control.Fixture.source) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000010U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.map_.Release(); + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + auto* released = _impl_.source_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.map_.Set("", GetArena()); + _impl_.source_.Set("", GetArena()); } return released; } -inline void ServerReady::set_allocated_map(::std::string* PROTOBUF_NULLABLE value) { +inline void Fixture::set_allocated_source(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000001U); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + ClearHasBit(_impl_._has_bits_[0], 0x00000010U); } - _impl_.map_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.map_.IsDefault()) { - _impl_.map_.Set("", GetArena()); + _impl_.source_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.source_.IsDefault()) { + _impl_.source_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServerReady.map) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.Fixture.source) } // ------------------------------------------------------------------- -// UiChanged +// Forward // string mod = 1; -inline void UiChanged::clear_mod() { +inline void Forward::clear_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mod_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& UiChanged::mod() const +inline const ::std::string& Forward::mod() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.UiChanged.mod) + // @@protoc_insertion_point(field_get:modlock.host_app.control.Forward.mod) return _internal_mod(); } template -PROTOBUF_ALWAYS_INLINE void UiChanged::set_mod(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void Forward::set_mod(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); _impl_.mod_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.UiChanged.mod) + // @@protoc_insertion_point(field_set:modlock.host_app.control.Forward.mod) } -inline ::std::string* PROTOBUF_NONNULL UiChanged::mutable_mod() +inline ::std::string* PROTOBUF_NONNULL Forward::mutable_mod() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); ::std::string* _s = _internal_mutable_mod(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.UiChanged.mod) + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.Forward.mod) return _s; } -inline const ::std::string& UiChanged::_internal_mod() const { +inline const ::std::string& Forward::_internal_mod() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.mod_.Get(); } -inline void UiChanged::_internal_set_mod(const ::std::string& value) { +inline void Forward::_internal_set_mod(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mod_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL UiChanged::_internal_mutable_mod() { +inline ::std::string* PROTOBUF_NONNULL Forward::_internal_mutable_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.mod_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE UiChanged::release_mod() { +inline ::std::string* PROTOBUF_NULLABLE Forward::release_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.UiChanged.mod) + // @@protoc_insertion_point(field_release:modlock.host_app.control.Forward.mod) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } @@ -7965,7 +10429,7 @@ inline ::std::string* PROTOBUF_NULLABLE UiChanged::release_mod() { } return released; } -inline void UiChanged::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { +inline void Forward::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000001U); @@ -7976,172 +10440,325 @@ inline void UiChanged::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { _impl_.mod_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.UiChanged.mod) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.Forward.mod) } -// int32 slot = 2; -inline void UiChanged::clear_slot() { +// string service = 2; +inline void Forward::clear_service() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.slot_ = 0; + _impl_.service_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000004U); -} -inline ::int32_t UiChanged::slot() const { - // @@protoc_insertion_point(field_get:modlock.host_app.control.UiChanged.slot) - return _internal_slot(); -} -inline void UiChanged::set_slot(::int32_t value) { - _internal_set_slot(value); - SetHasBit(_impl_._has_bits_[0], 0x00000004U); - // @@protoc_insertion_point(field_set:modlock.host_app.control.UiChanged.slot) + 0x00000002U); } -inline ::int32_t UiChanged::_internal_slot() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.slot_; +inline const ::std::string& Forward::service() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.Forward.service) + return _internal_service(); } -inline void UiChanged::_internal_set_slot(::int32_t value) { +template +PROTOBUF_ALWAYS_INLINE void Forward::set_service(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.slot_ = value; + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.service_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.Forward.service) } - -// .modlock.wasm.ui.Change change = 3; -inline bool UiChanged::has_change() const { - bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000002U); - PROTOBUF_ASSUME(!value || _impl_.change_ != nullptr); - return value; +inline ::std::string* PROTOBUF_NONNULL Forward::mutable_service() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_service(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.Forward.service) + return _s; } -inline const ::modlock::wasm::ui::Change& UiChanged::_internal_change() const { +inline const ::std::string& Forward::_internal_service() const { ::google::protobuf::internal::TSanRead(&_impl_); - const ::modlock::wasm::ui::Change* p = _impl_.change_; - return p != nullptr ? *p : reinterpret_cast(::modlock::wasm::ui::_Change_default_instance_); + return _impl_.service_.Get(); } -inline const ::modlock::wasm::ui::Change& UiChanged::change() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.UiChanged.change) - return _internal_change(); +inline void Forward::_internal_set_service(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.service_.Set(value, GetArena()); } -inline void UiChanged::unsafe_arena_set_allocated_change( - ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE value) { +inline ::std::string* PROTOBUF_NONNULL Forward::_internal_mutable_service() { ::google::protobuf::internal::TSanWrite(&_impl_); - if (GetArena() == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.change_); + return _impl_.service_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE Forward::release_service() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.Forward.service) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; } - _impl_.change_ = reinterpret_cast<::modlock::wasm::ui::Change*>(value); + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.service_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.service_.Set("", GetArena()); + } + return released; +} +inline void Forward::set_allocated_service(::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); } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:modlock.host_app.control.UiChanged.change) -} -inline ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE UiChanged::release_change() { - ::google::protobuf::internal::TSanWrite(&_impl_); - - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - ::modlock::wasm::ui::Change* released = _impl_.change_; - _impl_.change_ = 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); - } + _impl_.service_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.service_.IsDefault()) { + _impl_.service_.Set("", GetArena()); } - return released; + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.Forward.service) } -inline ::modlock::wasm::ui::Change* PROTOBUF_NULLABLE UiChanged::unsafe_arena_release_change() { - ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.UiChanged.change) - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); - ::modlock::wasm::ui::Change* temp = _impl_.change_; - _impl_.change_ = nullptr; - return temp; +// string target = 3; +inline void Forward::clear_target() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.target_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); } -inline ::modlock::wasm::ui::Change* PROTOBUF_NONNULL UiChanged::_internal_mutable_change() { +inline const ::std::string& Forward::target() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.Forward.target) + return _internal_target(); +} +template +PROTOBUF_ALWAYS_INLINE void Forward::set_target(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (_impl_.change_ == nullptr) { - auto* p = ::google::protobuf::Message::DefaultConstruct<::modlock::wasm::ui::Change>(GetArena()); - _impl_.change_ = reinterpret_cast<::modlock::wasm::ui::Change*>(p); - } - return _impl_.change_; + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.target_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.Forward.target) } -inline ::modlock::wasm::ui::Change* PROTOBUF_NONNULL UiChanged::mutable_change() +inline ::std::string* PROTOBUF_NONNULL Forward::mutable_target() ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000002U); - ::modlock::wasm::ui::Change* _msg = _internal_mutable_change(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.UiChanged.change) - return _msg; + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_target(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.Forward.target) + return _s; } -inline void UiChanged::set_allocated_change(::modlock::wasm::ui::Change* PROTOBUF_NULLABLE value) { - ::google::protobuf::Arena* message_arena = GetArena(); +inline const ::std::string& Forward::_internal_target() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.target_.Get(); +} +inline void Forward::_internal_set_target(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (message_arena == nullptr) { - delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.change_); + _impl_.target_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL Forward::_internal_mutable_target() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.target_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE Forward::release_target() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.host_app.control.Forward.target) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + return nullptr; } - + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.target_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.target_.Set("", GetArena()); + } + return released; +} +inline void Forward::set_allocated_target(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { - ::google::protobuf::Arena* submessage_arena = reinterpret_cast<::google::protobuf::Message*>(value)->GetArena(); - if (message_arena != submessage_arena) { - value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena); - } - SetHasBit(_impl_._has_bits_[0], 0x00000002U); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); } + _impl_.target_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.target_.IsDefault()) { + _impl_.target_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.Forward.target) +} - _impl_.change_ = reinterpret_cast<::modlock::wasm::ui::Change*>(value); - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.UiChanged.change) +// ------------------------------------------------------------------- + +// Fixtures + +// repeated .modlock.host_app.control.Fixture fixtures = 1; +inline int Fixtures::_internal_fixtures_size() const { + return _internal_fixtures().size(); +} +inline int Fixtures::fixtures_size() const { + return _internal_fixtures_size(); +} +inline void Fixtures::clear_fixtures() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.fixtures_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000001U); +} +inline ::modlock::host_app::control::Fixture* PROTOBUF_NONNULL Fixtures::mutable_fixtures(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.Fixtures.fixtures) + return _internal_mutable_fixtures()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Fixture>* PROTOBUF_NONNULL Fixtures::mutable_fixtures() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_mutable_list:modlock.host_app.control.Fixtures.fixtures) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_fixtures(); +} +inline const ::modlock::host_app::control::Fixture& Fixtures::fixtures(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.Fixtures.fixtures) + return _internal_fixtures().Get(index); +} +inline ::modlock::host_app::control::Fixture* PROTOBUF_NONNULL Fixtures::add_fixtures() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::modlock::host_app::control::Fixture* _add = + _internal_mutable_fixtures()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add:modlock.host_app.control.Fixtures.fixtures) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Fixture>& Fixtures::fixtures() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:modlock.host_app.control.Fixtures.fixtures) + return _internal_fixtures(); +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Fixture>& +Fixtures::_internal_fixtures() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.fixtures_; +} +inline ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Fixture>* PROTOBUF_NONNULL +Fixtures::_internal_mutable_fixtures() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.fixtures_; +} + +// repeated .modlock.host_app.control.Forward forwards = 2; +inline int Fixtures::_internal_forwards_size() const { + return _internal_forwards().size(); +} +inline int Fixtures::forwards_size() const { + return _internal_forwards_size(); +} +inline void Fixtures::clear_forwards() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.forwards_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000002U); +} +inline ::modlock::host_app::control::Forward* PROTOBUF_NONNULL Fixtures::mutable_forwards(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.Fixtures.forwards) + return _internal_mutable_forwards()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Forward>* PROTOBUF_NONNULL Fixtures::mutable_forwards() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_mutable_list:modlock.host_app.control.Fixtures.forwards) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_forwards(); +} +inline const ::modlock::host_app::control::Forward& Fixtures::forwards(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.host_app.control.Fixtures.forwards) + return _internal_forwards().Get(index); +} +inline ::modlock::host_app::control::Forward* PROTOBUF_NONNULL Fixtures::add_forwards() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::modlock::host_app::control::Forward* _add = + _internal_mutable_forwards()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_add:modlock.host_app.control.Fixtures.forwards) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Forward>& Fixtures::forwards() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:modlock.host_app.control.Fixtures.forwards) + return _internal_forwards(); +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Forward>& +Fixtures::_internal_forwards() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.forwards_; +} +inline ::google::protobuf::RepeatedPtrField<::modlock::host_app::control::Forward>* PROTOBUF_NONNULL +Fixtures::_internal_mutable_forwards() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.forwards_; } // ------------------------------------------------------------------- -// ServiceReply +// ServiceCall -// string mod = 1; -inline void ServiceReply::clear_mod() { +// uint64 id = 1; +inline void ServiceCall::clear_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.id_ = ::uint64_t{0u}; + ClearHasBit(_impl_._has_bits_[0], + 0x00000010U); +} +inline ::uint64_t ServiceCall::id() const { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceCall.id) + return _internal_id(); +} +inline void ServiceCall::set_id(::uint64_t value) { + _internal_set_id(value); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceCall.id) +} +inline ::uint64_t ServiceCall::_internal_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.id_; +} +inline void ServiceCall::_internal_set_id(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.id_ = value; +} + +// string mod = 2; +inline void ServiceCall::clear_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mod_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& ServiceReply::mod() const +inline const ::std::string& ServiceCall::mod() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.mod) + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceCall.mod) return _internal_mod(); } template -PROTOBUF_ALWAYS_INLINE void ServiceReply::set_mod(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceCall::set_mod(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); _impl_.mod_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.mod) + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceCall.mod) } -inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_mod() +inline ::std::string* PROTOBUF_NONNULL ServiceCall::mutable_mod() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); ::std::string* _s = _internal_mutable_mod(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.mod) + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceCall.mod) return _s; } -inline const ::std::string& ServiceReply::_internal_mod() const { +inline const ::std::string& ServiceCall::_internal_mod() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.mod_.Get(); } -inline void ServiceReply::_internal_set_mod(const ::std::string& value) { +inline void ServiceCall::_internal_set_mod(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.mod_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_mod() { +inline ::std::string* PROTOBUF_NONNULL ServiceCall::_internal_mutable_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.mod_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_mod() { +inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_mod() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.mod) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceCall.mod) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } @@ -8152,7 +10769,7 @@ inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_mod() { } return released; } -inline void ServiceReply::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceCall::set_allocated_mod(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000001U); @@ -8163,50 +10780,50 @@ inline void ServiceReply::set_allocated_mod(::std::string* PROTOBUF_NULLABLE val if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.mod_.IsDefault()) { _impl_.mod_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.mod) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceCall.mod) } -// string service = 2; -inline void ServiceReply::clear_service() { +// string service = 3; +inline void ServiceCall::clear_service() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.service_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } -inline const ::std::string& ServiceReply::service() const +inline const ::std::string& ServiceCall::service() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.service) + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceCall.service) return _internal_service(); } template -PROTOBUF_ALWAYS_INLINE void ServiceReply::set_service(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceCall::set_service(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000002U); _impl_.service_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.service) + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceCall.service) } -inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_service() +inline ::std::string* PROTOBUF_NONNULL ServiceCall::mutable_service() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000002U); ::std::string* _s = _internal_mutable_service(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.service) + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceCall.service) return _s; } -inline const ::std::string& ServiceReply::_internal_service() const { +inline const ::std::string& ServiceCall::_internal_service() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.service_.Get(); } -inline void ServiceReply::_internal_set_service(const ::std::string& value) { +inline void ServiceCall::_internal_set_service(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.service_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_service() { +inline ::std::string* PROTOBUF_NONNULL ServiceCall::_internal_mutable_service() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.service_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_service() { +inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_service() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.service) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceCall.service) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { return nullptr; } @@ -8217,7 +10834,7 @@ inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_service() { } return released; } -inline void ServiceReply::set_allocated_service(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceCall::set_allocated_service(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000002U); @@ -8228,50 +10845,50 @@ inline void ServiceReply::set_allocated_service(::std::string* PROTOBUF_NULLABLE if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.service_.IsDefault()) { _impl_.service_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.service) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceCall.service) } -// string method = 3; -inline void ServiceReply::clear_method() { +// string method = 4; +inline void ServiceCall::clear_method() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.method_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000004U); } -inline const ::std::string& ServiceReply::method() const +inline const ::std::string& ServiceCall::method() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.method) + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceCall.method) return _internal_method(); } template -PROTOBUF_ALWAYS_INLINE void ServiceReply::set_method(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceCall::set_method(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000004U); _impl_.method_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.method) + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceCall.method) } -inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_method() +inline ::std::string* PROTOBUF_NONNULL ServiceCall::mutable_method() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000004U); ::std::string* _s = _internal_mutable_method(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.method) + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceCall.method) return _s; } -inline const ::std::string& ServiceReply::_internal_method() const { +inline const ::std::string& ServiceCall::_internal_method() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.method_.Get(); } -inline void ServiceReply::_internal_set_method(const ::std::string& value) { +inline void ServiceCall::_internal_set_method(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.method_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_method() { +inline ::std::string* PROTOBUF_NONNULL ServiceCall::_internal_mutable_method() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.method_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_method() { +inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_method() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.method) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceCall.method) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { return nullptr; } @@ -8282,7 +10899,7 @@ inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_method() { } return released; } -inline void ServiceReply::set_allocated_method(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceCall::set_allocated_method(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000004U); @@ -8293,50 +10910,50 @@ inline void ServiceReply::set_allocated_method(::std::string* PROTOBUF_NULLABLE if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.method_.IsDefault()) { _impl_.method_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.method) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceCall.method) } -// bytes payload = 4; -inline void ServiceReply::clear_payload() { +// bytes payload = 5; +inline void ServiceCall::clear_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.payload_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000008U); } -inline const ::std::string& ServiceReply::payload() const +inline const ::std::string& ServiceCall::payload() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.payload) + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceCall.payload) return _internal_payload(); } template -PROTOBUF_ALWAYS_INLINE void ServiceReply::set_payload(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceCall::set_payload(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000008U); _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.payload) + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceCall.payload) } -inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_payload() +inline ::std::string* PROTOBUF_NONNULL ServiceCall::mutable_payload() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000008U); ::std::string* _s = _internal_mutable_payload(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.payload) + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceCall.payload) return _s; } -inline const ::std::string& ServiceReply::_internal_payload() const { +inline const ::std::string& ServiceCall::_internal_payload() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.payload_.Get(); } -inline void ServiceReply::_internal_set_payload(const ::std::string& value) { +inline void ServiceCall::_internal_set_payload(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.payload_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_payload() { +inline ::std::string* PROTOBUF_NONNULL ServiceCall::_internal_mutable_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.payload_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_payload() { +inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.payload) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceCall.payload) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000008U)) { return nullptr; } @@ -8347,7 +10964,7 @@ inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_payload() { } return released; } -inline void ServiceReply::set_allocated_payload(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceCall::set_allocated_payload(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000008U); @@ -8358,249 +10975,144 @@ inline void ServiceReply::set_allocated_payload(::std::string* PROTOBUF_NULLABLE if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { _impl_.payload_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.payload) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceCall.payload) } -// string path = 5; -inline void ServiceReply::clear_path() { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.path_.ClearToEmpty(); - ClearHasBit(_impl_._has_bits_[0], - 0x00000010U); -} -inline const ::std::string& ServiceReply::path() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.path) - return _internal_path(); -} -template -PROTOBUF_ALWAYS_INLINE void ServiceReply::set_path(Arg_&& arg, Args_... args) { - ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000010U); - _impl_.path_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.path) -} -inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_path() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000010U); - ::std::string* _s = _internal_mutable_path(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.path) - return _s; -} -inline const ::std::string& ServiceReply::_internal_path() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.path_.Get(); -} -inline void ServiceReply::_internal_set_path(const ::std::string& value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.path_.Set(value, GetArena()); -} -inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_path() { - ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.path_.Mutable( GetArena()); -} -inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_path() { - ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.path) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000010U)) { - return nullptr; - } - ClearHasBit(_impl_._has_bits_[0], 0x00000010U); - auto* released = _impl_.path_.Release(); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.path_.Set("", GetArena()); - } - return released; -} -inline void ServiceReply::set_allocated_path(::std::string* PROTOBUF_NULLABLE value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000010U); - } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000010U); - } - _impl_.path_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.path_.IsDefault()) { - _impl_.path_.Set("", GetArena()); - } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.path) -} +// ------------------------------------------------------------------- -// string id = 6; -inline void ServiceReply::clear_id() { +// ServiceAnswer + +// uint64 id = 1; +inline void ServiceAnswer::clear_id() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.id_.ClearToEmpty(); + _impl_.id_ = ::uint64_t{0u}; ClearHasBit(_impl_._has_bits_[0], - 0x00000020U); + 0x00000004U); } -inline const ::std::string& ServiceReply::id() const - ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceReply.id) +inline ::uint64_t ServiceAnswer::id() const { + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceAnswer.id) return _internal_id(); } -template -PROTOBUF_ALWAYS_INLINE void ServiceReply::set_id(Arg_&& arg, Args_... args) { - ::google::protobuf::internal::TSanWrite(&_impl_); - SetHasBit(_impl_._has_bits_[0], 0x00000020U); - _impl_.id_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceReply.id) -} -inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_id() - ABSL_ATTRIBUTE_LIFETIME_BOUND { - SetHasBit(_impl_._has_bits_[0], 0x00000020U); - ::std::string* _s = _internal_mutable_id(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceReply.id) - return _s; +inline void ServiceAnswer::set_id(::uint64_t value) { + _internal_set_id(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceAnswer.id) } -inline const ::std::string& ServiceReply::_internal_id() const { +inline ::uint64_t ServiceAnswer::_internal_id() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.id_.Get(); -} -inline void ServiceReply::_internal_set_id(const ::std::string& value) { - ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.id_.Set(value, GetArena()); -} -inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_id() { - ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.id_.Mutable( GetArena()); -} -inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_id() { - ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceReply.id) - if (!CheckHasBit(_impl_._has_bits_[0], 0x00000020U)) { - return nullptr; - } - ClearHasBit(_impl_._has_bits_[0], 0x00000020U); - auto* released = _impl_.id_.Release(); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.id_.Set("", GetArena()); - } - return released; + return _impl_.id_; } -inline void ServiceReply::set_allocated_id(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceAnswer::_internal_set_id(::uint64_t value) { ::google::protobuf::internal::TSanWrite(&_impl_); - if (value != nullptr) { - SetHasBit(_impl_._has_bits_[0], 0x00000020U); - } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000020U); - } - _impl_.id_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.id_.IsDefault()) { - _impl_.id_.Set("", GetArena()); - } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceReply.id) + _impl_.id_ = value; } -// ------------------------------------------------------------------- - -// ServiceResult - -// string id = 1; -inline void ServiceResult::clear_id() { +// bytes payload = 2; +inline void ServiceAnswer::clear_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.id_.ClearToEmpty(); + _impl_.payload_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& ServiceResult::id() const +inline const ::std::string& ServiceAnswer::payload() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceResult.id) - return _internal_id(); + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceAnswer.payload) + return _internal_payload(); } template -PROTOBUF_ALWAYS_INLINE void ServiceResult::set_id(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceAnswer::set_payload(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); - _impl_.id_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceResult.id) + _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceAnswer.payload) } -inline ::std::string* PROTOBUF_NONNULL ServiceResult::mutable_id() +inline ::std::string* PROTOBUF_NONNULL ServiceAnswer::mutable_payload() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_id(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceResult.id) + ::std::string* _s = _internal_mutable_payload(); + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceAnswer.payload) return _s; } -inline const ::std::string& ServiceResult::_internal_id() const { +inline const ::std::string& ServiceAnswer::_internal_payload() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.id_.Get(); + return _impl_.payload_.Get(); } -inline void ServiceResult::_internal_set_id(const ::std::string& value) { +inline void ServiceAnswer::_internal_set_payload(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.id_.Set(value, GetArena()); + _impl_.payload_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServiceResult::_internal_mutable_id() { +inline ::std::string* PROTOBUF_NONNULL ServiceAnswer::_internal_mutable_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.id_.Mutable( GetArena()); + return _impl_.payload_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServiceResult::release_id() { +inline ::std::string* PROTOBUF_NULLABLE ServiceAnswer::release_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceResult.id) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceAnswer.payload) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.id_.Release(); + auto* released = _impl_.payload_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.id_.Set("", GetArena()); + _impl_.payload_.Set("", GetArena()); } return released; } -inline void ServiceResult::set_allocated_id(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceAnswer::set_allocated_payload(::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_.id_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.id_.IsDefault()) { - _impl_.id_.Set("", GetArena()); + _impl_.payload_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { + _impl_.payload_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceResult.id) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceAnswer.payload) } -// string error = 2; -inline void ServiceResult::clear_error() { +// string error = 3; +inline void ServiceAnswer::clear_error() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.error_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } -inline const ::std::string& ServiceResult::error() const +inline const ::std::string& ServiceAnswer::error() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceResult.error) + // @@protoc_insertion_point(field_get:modlock.host_app.control.ServiceAnswer.error) return _internal_error(); } template -PROTOBUF_ALWAYS_INLINE void ServiceResult::set_error(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceAnswer::set_error(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000002U); _impl_.error_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceResult.error) + // @@protoc_insertion_point(field_set:modlock.host_app.control.ServiceAnswer.error) } -inline ::std::string* PROTOBUF_NONNULL ServiceResult::mutable_error() +inline ::std::string* PROTOBUF_NONNULL ServiceAnswer::mutable_error() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000002U); ::std::string* _s = _internal_mutable_error(); - // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceResult.error) + // @@protoc_insertion_point(field_mutable:modlock.host_app.control.ServiceAnswer.error) return _s; } -inline const ::std::string& ServiceResult::_internal_error() const { +inline const ::std::string& ServiceAnswer::_internal_error() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.error_.Get(); } -inline void ServiceResult::_internal_set_error(const ::std::string& value) { +inline void ServiceAnswer::_internal_set_error(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.error_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServiceResult::_internal_mutable_error() { +inline ::std::string* PROTOBUF_NONNULL ServiceAnswer::_internal_mutable_error() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.error_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServiceResult::release_error() { +inline ::std::string* PROTOBUF_NULLABLE ServiceAnswer::release_error() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceResult.error) + // @@protoc_insertion_point(field_release:modlock.host_app.control.ServiceAnswer.error) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { return nullptr; } @@ -8611,7 +11123,7 @@ inline ::std::string* PROTOBUF_NULLABLE ServiceResult::release_error() { } return released; } -inline void ServiceResult::set_allocated_error(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceAnswer::set_allocated_error(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000002U); @@ -8622,7 +11134,7 @@ inline void ServiceResult::set_allocated_error(::std::string* PROTOBUF_NULLABLE if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.error_.IsDefault()) { _impl_.error_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceResult.error) + // @@protoc_insertion_point(field_set_allocated:modlock.host_app.control.ServiceAnswer.error) } #ifdef __GNUC__ diff --git a/src/host_app/control/control.pb.ts b/src/host_app/control/control.pb.ts index 647254c4..56442156 100644 --- a/src/host_app/control/control.pb.ts +++ b/src/host_app/control/control.pb.ts @@ -61,6 +61,7 @@ export interface ControlRequest { | { value: RolesTable; case: 'roles' } | { value: ServiceReply; case: 'service' } | { value: ModCall; case: 'call' } + | { value: ServiceAnswer; case: 'answer' } } export const ControlRequest: MessageType = @@ -71,6 +72,7 @@ export const ControlRequest: MessageType = [2, 'roles', 11, 0, RolesTable.codec, 'body'], [3, 'service', 11, 0, ServiceReply.codec, 'body'], [4, 'call', 11, 0, ModCall.codec, 'body'], + [5, 'answer', 11, 0, ServiceAnswer.codec, 'body'], ], { decode: ( @@ -122,6 +124,16 @@ export const ControlRequest: MessageType = ), } break + case 5: + m.body = { + case: 'answer', + value: ServiceAnswer.decode( + r, + r.delimited(), + m.body?.case === 'answer' ? m.body.value : {}, + ), + } + break default: r.skip(t) } @@ -149,6 +161,11 @@ export const ControlRequest: MessageType = if (o?.case === 'call' && o.value != null) ModCall.writeField(w, 4, o.value) } + { + const o = m.body + if (o?.case === 'answer' && o.value != null) + ServiceAnswer.writeField(w, 5, o.value) + } }, }, ) @@ -397,6 +414,7 @@ export interface HostEvent { | { value: ModSlowFrame; case: 'slowFrame' } | { value: ServiceResult; case: 'serviceApplied' } | { value: ModCallResult; case: 'called' } + | { value: ServiceCall; case: 'serviceCall' } } export const HostEvent: MessageType = @@ -416,6 +434,7 @@ export const HostEvent: MessageType = [11, 'slow_frame', 11, 0, ModSlowFrame.codec, 'body'], [12, 'service_applied', 11, 0, ServiceResult.codec, 'body'], [13, 'called', 11, 0, ModCallResult.codec, 'body'], + [14, 'service_call', 11, 0, ServiceCall.codec, 'body'], ], { decode: (r: BinaryReader, end: number, m: HostEvent): HostEvent => { @@ -553,6 +572,16 @@ export const HostEvent: MessageType = ), } break + case 14: + m.body = { + case: 'serviceCall', + value: ServiceCall.decode( + r, + r.delimited(), + m.body?.case === 'serviceCall' ? m.body.value : {}, + ), + } + break default: r.skip(t) } @@ -625,6 +654,11 @@ export const HostEvent: MessageType = if (o?.case === 'called' && o.value != null) ModCallResult.writeField(w, 13, o.value) } + { + const o = m.body + if (o?.case === 'serviceCall' && o.value != null) + ServiceCall.writeField(w, 14, o.value) + } }, }, ) @@ -1431,3 +1465,365 @@ export const ServiceResult: MessageType = }, }, ) + +/** + * Fixture is one method's reply from a mod project's service fixture, which + * the controller hands the host at start so the mod's first frame can call it. + * + * @generated from message modlock.host_app.control.Fixture + */ +export interface Fixture { + /** + * Mod is the slug of the mod the reply answers. + */ + mod?: string + /** + * Service and Method select the call this reply answers. + */ + service?: string + method?: string + /** + * Payload is the reply's bytes, opaque to Modlock. + */ + payload?: Uint8Array + /** + * Source names the fixture file, for the host's log. + */ + source?: string +} + +export const Fixture: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.host_app.control.Fixture', + () => [ + [1, 'mod', 9], + [2, 'service', 9], + [3, 'method', 9], + [4, 'payload', 12], + [5, 'source', 9], + ], + { + decode: (r: BinaryReader, end: number, m: Fixture): Fixture => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.mod = r.string() + break + case 2: + m.service = r.string() + break + case 3: + m.method = r.string() + break + case 4: + m.payload = r.bytes() + break + case 5: + m.source = r.string() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: Fixture, w: Writer): void => { + { + const v = m.mod + if (v) w.uint32(10).string(v) + } + { + const v = m.service + if (v) w.uint32(18).string(v) + } + { + const v = m.method + if (v) w.uint32(26).string(v) + } + { + const v = m.payload + if (v != null && v.length !== 0) w.uint32(34).bytes(v) + } + { + const v = m.source + if (v) w.uint32(42).string(v) + } + }, + }, + ) + +/** + * Forward hands one mod's started calls of a service to the controller over + * the control link, in place of a fixture. + * + * @generated from message modlock.host_app.control.Forward + */ +export interface Forward { + /** + * Mod is the slug of the mod whose calls go to the controller. + */ + mod?: string + /** + * Service names the service forwarded. + */ + service?: string + /** + * Target names where the controller sends the calls, for the host's log. + */ + target?: string +} + +export const Forward: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.host_app.control.Forward', + () => [ + [1, 'mod', 9], + [2, 'service', 9], + [3, 'target', 9], + ], + { + decode: (r: BinaryReader, end: number, m: Forward): Forward => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.mod = r.string() + break + case 2: + m.service = r.string() + break + case 3: + m.target = r.string() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: Forward, w: Writer): void => { + { + const v = m.mod + if (v) w.uint32(10).string(v) + } + { + const v = m.service + if (v) w.uint32(18).string(v) + } + { + const v = m.target + if (v) w.uint32(26).string(v) + } + }, + }, + ) + +/** + * Fixtures is the file --fixtures names: every fixture reply of the mods the + * host loads, and the services the controller answers instead. + * + * @generated from message modlock.host_app.control.Fixtures + */ +export interface Fixtures { + fixtures?: Fixture[] + forwards?: Forward[] +} + +export const Fixtures: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.host_app.control.Fixtures', + () => [ + [1, 'fixtures', 11, 1, Fixture.codec], + [2, 'forwards', 11, 1, Forward.codec], + ], + { + decode: (r: BinaryReader, end: number, m: Fixtures): Fixtures => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + ;(m.fixtures ??= []).push(Fixture.decode(r, r.delimited(), {})) + break + case 2: + ;(m.forwards ??= []).push(Forward.decode(r, r.delimited(), {})) + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: Fixtures, w: Writer): void => { + { + const a = m.fixtures + if (a != null) for (const e of a) Fixture.writeField(w, 1, e) + } + { + const a = m.forwards + if (a != null) for (const e of a) Forward.writeField(w, 2, e) + } + }, + }, + ) + +/** + * ServiceCall is one started call of a forwarded service, for the controller + * to answer. + * + * @generated from message modlock.host_app.control.ServiceCall + */ +export interface ServiceCall { + /** + * Id names the call in the Answer that ends it. + */ + id?: bigint + /** + * Mod is the slug of the calling mod. + */ + mod?: string + /** + * Service and Method select the call. + */ + service?: string + method?: string + /** + * Payload is the call's bytes, opaque to Modlock. + */ + payload?: Uint8Array +} + +export const ServiceCall: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.host_app.control.ServiceCall', + () => [ + [1, 'id', 4], + [2, 'mod', 9], + [3, 'service', 9], + [4, 'method', 9], + [5, 'payload', 12], + ], + { + decode: (r: BinaryReader, end: number, m: ServiceCall): ServiceCall => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.id = r.uint64() + break + case 2: + m.mod = r.string() + break + case 3: + m.service = r.string() + break + case 4: + m.method = r.string() + break + case 5: + m.payload = r.bytes() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: ServiceCall, w: Writer): void => { + { + const v = m.id + if (v) w.uint32(8).uint64(v) + } + { + const v = m.mod + if (v) w.uint32(18).string(v) + } + { + const v = m.service + if (v) w.uint32(26).string(v) + } + { + const v = m.method + if (v) w.uint32(34).string(v) + } + { + const v = m.payload + if (v != null && v.length !== 0) w.uint32(42).bytes(v) + } + }, + }, + ) + +/** + * ServiceAnswer ends one forwarded ServiceCall with its reply or an error. + * + * @generated from message modlock.host_app.control.ServiceAnswer + */ +export interface ServiceAnswer { + /** + * Id matches the ServiceCall it ends. + */ + id?: bigint + /** + * Payload is the reply's bytes when Error is empty. + */ + payload?: Uint8Array + /** + * Error, when set, fails the call with this text. + */ + error?: string +} + +export const ServiceAnswer: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.host_app.control.ServiceAnswer', + () => [ + [1, 'id', 4], + [2, 'payload', 12], + [3, 'error', 9], + ], + { + decode: ( + r: BinaryReader, + end: number, + m: ServiceAnswer, + ): ServiceAnswer => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.id = r.uint64() + break + case 2: + m.payload = r.bytes() + break + case 3: + m.error = r.string() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: ServiceAnswer, w: Writer): void => { + { + const v = m.id + if (v) w.uint32(8).uint64(v) + } + { + const v = m.payload + if (v != null && v.length !== 0) w.uint32(18).bytes(v) + } + { + const v = m.error + if (v) w.uint32(26).string(v) + } + }, + }, + ) diff --git a/src/host_app/control/control.proto b/src/host_app/control/control.proto index 6500738c..1111c64d 100644 --- a/src/host_app/control/control.proto +++ b/src/host_app/control/control.proto @@ -30,6 +30,9 @@ message ControlRequest { // Call calls a service a running mod serves; the host answers with a // Called event. ModCall call = 4; + + // Answer ends one ServiceCall the host forwarded. + ServiceAnswer answer = 5; } } @@ -115,6 +118,10 @@ message HostEvent { // Called answers a ModCall. ModCallResult called = 13; + + // ServiceCall asks the controller to answer a mod's started call to a + // service the fixtures forward; an Answer with its id ends it. + ServiceCall service_call = 14; } } @@ -267,3 +274,59 @@ message ServiceResult { // Error is empty when the mod restarted with the new configuration. string error = 2; } + +// Fixture is one method's reply from a mod project's service fixture, which +// the controller hands the host at start so the mod's first frame can call it. +message Fixture { + // Mod is the slug of the mod the reply answers. + string mod = 1; + // Service and Method select the call this reply answers. + string service = 2; + string method = 3; + // Payload is the reply's bytes, opaque to Modlock. + bytes payload = 4; + // Source names the fixture file, for the host's log. + string source = 5; +} + +// Forward hands one mod's started calls of a service to the controller over +// the control link, in place of a fixture. +message Forward { + // Mod is the slug of the mod whose calls go to the controller. + string mod = 1; + // Service names the service forwarded. + string service = 2; + // Target names where the controller sends the calls, for the host's log. + string target = 3; +} + +// Fixtures is the file --fixtures names: every fixture reply of the mods the +// host loads, and the services the controller answers instead. +message Fixtures { + repeated Fixture fixtures = 1; + repeated Forward forwards = 2; +} + +// ServiceCall is one started call of a forwarded service, for the controller +// to answer. +message ServiceCall { + // Id names the call in the Answer that ends it. + uint64 id = 1; + // Mod is the slug of the calling mod. + string mod = 2; + // Service and Method select the call. + string service = 3; + string method = 4; + // Payload is the call's bytes, opaque to Modlock. + bytes payload = 5; +} + +// ServiceAnswer ends one forwarded ServiceCall with its reply or an error. +message ServiceAnswer { + // Id matches the ServiceCall it ends. + uint64 id = 1; + // Payload is the reply's bytes when Error is empty. + bytes payload = 2; + // Error, when set, fails the call with this text. + string error = 3; +} diff --git a/src/host_app/control_link.cc b/src/host_app/control_link.cc index 2c407c7c..0641729e 100644 --- a/src/host_app/control_link.cc +++ b/src/host_app/control_link.cc @@ -204,10 +204,12 @@ void ControlLink::RunRequests(WasmHost& mods) { return; } std::vector requests; + bool closed = false; { std::lock_guard lock(mu_); requests.swap(requests_); pending_.store(false, std::memory_order_release); + closed = closed_; } for (const auto& request : requests) { @@ -265,6 +267,22 @@ void ControlLink::RunRequests(WasmHost& mods) { case control::ControlRequest::kRoles: mods.SetRoles(request.roles()); break; + case control::ControlRequest::kAnswer: { + // End the forwarded call the answer names; an unknown id has ended. + const auto& answer = request.answer(); + const auto found = calls_.find(answer.id()); + if (found == calls_.end()) { + break; + } + auto reply = std::move(found->second); + calls_.erase(found); + if (!answer.error().empty()) { + reply(std::unexpected(answer.error())); + } else { + reply(answer.payload()); + } + break; + } case control::ControlRequest::kCall: { // Call the mod's service and answer with its reply or its error. const auto& call = request.call(); @@ -284,6 +302,39 @@ void ControlLink::RunRequests(WasmHost& mods) { break; } } + + // Once the controller is gone, no answer comes for the calls it holds. + if (closed) { + auto calls = std::move(calls_); + calls_.clear(); + for (auto& [id, reply] : calls) { + reply(std::unexpected(std::string("the program that answers this service has gone"))); + } + } +} + +void ControlLink::Forward(std::string_view mod, std::string_view service, + std::string_view method, std::string_view payload, WasmReply reply) { + // A call with nobody to answer it ends at once. + { + std::lock_guard lock(mu_); + if (closed_) { + reply(std::unexpected(std::string("the program that answers this service has gone"))); + return; + } + } + + // Keep the reply, then ask the controller. + const auto id = ++next_call_; + calls_.insert_or_assign(id, std::move(reply)); + control::HostEvent event; + auto* call = event.mutable_service_call(); + call->set_id(id); + call->set_mod(std::string(mod)); + call->set_service(std::string(service)); + call->set_method(std::string(method)); + call->set_payload(std::string(payload)); + Push(std::move(event)); } void ControlLink::Started(std::string_view mod, bool reloaded) { @@ -419,8 +470,10 @@ void ControlLink::Read() { pending_.store(true, std::memory_order_release); } { + // Wake the engine thread too, so it ends the calls left unanswered. std::lock_guard lock(mu_); closed_ = true; + pending_.store(true, std::memory_order_release); } wake_.notify_one(); } diff --git a/src/host_app/control_link.h b/src/host_app/control_link.h index f66fb3ee..a973029f 100644 --- a/src/host_app/control_link.h +++ b/src/host_app/control_link.h @@ -25,8 +25,8 @@ namespace modlock::host_app { // ControlLink connects modlock-host to the program that started it, such as // modlock dev, with the framing control.proto describes. The host dials the // controller's loopback address, streams mod starts, logs, failures, server -// readiness, player joins and leaves and mod interfaces, and takes reloads -// and the players' roles. +// readiness, player joins and leaves and mod interfaces, and takes reloads, +// the players' roles and the answers to the service calls it forwards. // Requests run on the engine thread through RunRequests. When the controller // disconnects, events are dropped and the host keeps running. class ControlLink final : public WasmHostObserver, public gameinterop::ConnectionEventSink { @@ -48,6 +48,12 @@ class ControlLink final : public WasmHostObserver, public gameinterop::Connectio // runs on the engine thread. void RunRequests(WasmHost& mods); + // Forward sends one mod's started service call to the controller, and ends + // it with the controller's answer in a later RunRequests, or at once when + // the controller is gone. It runs on the engine thread. + void Forward(std::string_view mod, std::string_view service, std::string_view method, + std::string_view payload, WasmReply reply); + void Started(std::string_view mod, bool reloaded) override; void Logged(std::string_view mod, std::string_view text) override; void Failed(std::string_view mod, std::string_view error) override; @@ -63,6 +69,10 @@ class ControlLink final : public WasmHostObserver, public gameinterop::Connectio // replies_ outlives the control link when a host extension still holds it. // All access runs on the engine thread. std::shared_ptr replies_ = std::make_shared(); + // calls_ holds each forwarded call's reply by id until its answer comes, + // and next_call_ numbers the next. Both are on the engine thread. + std::map calls_; + uint64_t next_call_ = 0; explicit ControlLink(intptr_t socket); diff --git a/src/host_app/fixtures.cc b/src/host_app/fixtures.cc new file mode 100644 index 00000000..1d837b9c --- /dev/null +++ b/src/host_app/fixtures.cc @@ -0,0 +1,96 @@ +#include "host_app/fixtures.h" + +#include +#include +#include +#include +#include + +#include "src/host_app/control/control.pb.h" + +namespace modlock::host_app { + +std::expected ProvideFixtures(WasmHost& host, std::string_view data, + Forward forward) { + // Read the replies. + control::Fixtures fixtures; + if (!fixtures.ParseFromArray(data.data(), static_cast(data.size()))) { + return std::unexpected("the fixtures file is malformed"); + } + if (fixtures.forwards_size() > 0 && !forward) { + return std::unexpected("the fixtures forward a service, which needs --control"); + } + + // Keep each service's replies by mod and method, its files by mod, and the + // mods whose calls it forwards with where to. + struct Service { + std::map, std::string, std::less<>> replies; + std::map> sources; + std::map> forwards; + }; + std::map> services; + auto named = [&services](const std::string& name) -> Service& { + auto& service = services[name]; + if (!service) { + service = std::make_shared(); + } + return *service; + }; + for (const auto& fixture : fixtures.fixtures()) { + auto& service = named(fixture.service()); + service.replies.insert_or_assign({fixture.mod(), fixture.method()}, fixture.payload()); + service.sources.insert_or_assign(fixture.mod(), fixture.source()); + } + for (const auto& forwarded : fixtures.forwards()) { + named(forwarded.service()).forwards.insert_or_assign(forwarded.mod(), forwarded.target()); + } + + // Provide each service, answering a mod only from its own fixture. + std::string lines; + for (auto& [name, service] : services) { + for (const auto& [mod, source] : service->sources) { + if (!service->forwards.contains(mod)) { + lines += mod + ": service " + name + ": fixture " + source + "\n"; + } + } + for (const auto& [mod, target] : service->forwards) { + lines += mod + ": service " + name + ": forwarded to " + target + "\n"; + } + auto answer = [service](std::string_view mod, + std::string_view method) -> std::expected { + const auto source = service->sources.find(mod); + if (source == service->sources.end()) { + return std::unexpected("this host has no fixture of this service for " + std::string(mod)); + } + const auto found = service->replies.find(std::pair(std::string(mod), std::string(method))); + if (found == service->replies.end()) { + return std::unexpected("the fixture " + source->second + " has no method " + + std::string(method)); + } + return found->second; + }; + + // A service with no forward answers every call at once. + if (service->forwards.empty()) { + host.Provide(name, [answer](std::string_view mod, std::string_view method, + std::string_view) { return answer(mod, method); }); + continue; + } + + // A forwarded service answers started calls: a forwarded mod's in a later + // frame, and any other mod's from its fixture at once. + host.ProvideLater(name, [service, answer, forward, name](std::string_view mod, + std::string_view method, + std::string_view payload, + WasmReply reply) { + if (service->forwards.contains(mod)) { + forward(mod, name, method, payload, std::move(reply)); + return; + } + reply(answer(mod, method)); + }); + } + return lines; +} + +} // namespace modlock::host_app diff --git a/src/host_app/fixtures.h b/src/host_app/fixtures.h new file mode 100644 index 00000000..70c959fa --- /dev/null +++ b/src/host_app/fixtures.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include +#include + +#include "modlock/wasm_host.h" + +namespace modlock::host_app { + +// Forward hands one mod's started call of a service to whoever answers it in +// a later frame, such as the controller. +using Forward = std::function; + +// ProvideFixtures provides every service the Fixtures message in data names, +// answering each mod's call to a method with that mod's fixture reply. A +// method or a mod the fixtures lack is refused, naming the fixture file. A +// service the message forwards for a mod takes that mod's started calls and +// hands them to forward. It returns one line per service and mod for the +// host's log, or an error for a message that does not parse or that forwards +// with no forward. +[[nodiscard]] std::expected ProvideFixtures(WasmHost& host, + std::string_view data, + Forward forward = {}); + +} // namespace modlock::host_app diff --git a/src/host_app/main.cc b/src/host_app/main.cc index 627059f4..d4e6146d 100644 --- a/src/host_app/main.cc +++ b/src/host_app/main.cc @@ -1,4 +1,6 @@ #include +#include +#include #include #include #include @@ -11,6 +13,7 @@ #include #include "host_app/control_link.h" +#include "host_app/fixtures.h" #include "host_app/game_dump.h" #include "modlock/build.h" #include "modlock/engine_host.h" @@ -36,6 +39,9 @@ void Help() { " --settings PATH Keep players' mod settings in the JSON file PATH\n" " --files DIRECTORY Keep the files mods write in DIRECTORY, one\n" " directory per mod\n" + " --fixtures PATH Answer the services the Fixtures message in PATH names\n" + " with its replies, or over --control where it\n" + " forwards them\n" " --game-data PATH Read signatures and virtual slots from PATH instead\n" " of the game_signatures.txtpb beside the host\n" " --control ADDRESS Report to and take reloads from the controller at\n" @@ -111,6 +117,7 @@ struct Options { std::string_view control; std::filesystem::path settings_file; std::filesystem::path files_directory; + std::filesystem::path fixtures_file; std::filesystem::path dump_directory; std::filesystem::path game_data; modlock::net::LaunchConfig launch; @@ -145,6 +152,8 @@ std::expected SetOption(Options& options, std::string_view argum options.settings_file = value; } else if (argument == "--files") { options.files_directory = value; + } else if (argument == "--fixtures") { + options.fixtures_file = value; } else if (argument == "--dump") { options.dump_directory = value; } else if (argument == "--game-data") { @@ -215,7 +224,7 @@ std::expected ParseOptions(int argc, char** argv) { if (argument != "--plugin" && argument != "--game-dir" && argument != "--hostport" && argument != "--map" && argument != "--engine-args" && argument != "--control" && argument != "--settings" && argument != "--files" && - argument != "--dump" && argument != "--game-data") { + argument != "--fixtures" && argument != "--dump" && argument != "--game-data") { std::cerr << "Unknown option: " << argument << ". Use --help for usage.\n"; return std::unexpected(2); } @@ -295,6 +304,30 @@ int main(int argc, char** argv) { } } + if (!options.fixtures_file.empty()) { + // The fixtures answer before any mod starts, so a mod that needs one + // starts; a forwarded service goes over the control link. + std::ifstream file(options.fixtures_file, std::ios::binary); + if (!file) { + std::cerr << "fixtures: cannot read " << options.fixtures_file.string() << '\n'; + return 1; + } + const std::string data{std::istreambuf_iterator(file), {}}; + modlock::host_app::Forward forward; + if (link) { + forward = [&link](std::string_view mod, std::string_view service, std::string_view method, + std::string_view payload, modlock::WasmReply reply) { + link->Forward(mod, service, method, payload, std::move(reply)); + }; + } + auto provided = modlock::host_app::ProvideFixtures(mods, data, std::move(forward)); + if (!provided) { + std::cerr << "fixtures: " << provided.error() << '\n'; + return 1; + } + std::cout << *provided; + } + // The host destroys plugin instances and libraries before the mods, the // link and engine resources. modlock::host::PluginHost plugins; diff --git a/src/wasm/host_service.gen.h b/src/wasm/host_service.gen.h index 7ec67b33..c4fd0d62 100644 --- a/src/wasm/host_service.gen.h +++ b/src/wasm/host_service.gen.h @@ -781,6 +781,19 @@ class HostService { return std::unexpected("this host does not support CallService"); } + // StartServiceCall calls method of a service the host provides and + // returns at once with a number; the answer arrives in a later frame as a + // ServiceReplied event carrying that number. Every call ends once: with + // the reply, the service's refusal, a timeout or no provider at all. A + // service nobody provides is never asked. The host waits at most 30 + // seconds, or the call's shorter timeout, and drops the mod's waiting + // calls when the mod stops or reloads. A service that answers at once + // answers this way too, in the next frame. + virtual std::expected StartServiceCall( + const StartServiceCallRequest& /*request*/) { + return std::unexpected("this host does not support StartServiceCall"); + } + // CreateEntity creates an entity the server knows by its designer name, // such as npc_trooper_boss or prop_dynamic, with spawn key values and fields // written before it spawns. The world removes it when the world ends; @@ -1782,6 +1795,14 @@ class HostService { } return detail::Answer(host.CallService(request)); }}, + {"StartServiceCall", + [](HostService& host, const std::string& bytes) { + StartServiceCallRequest request; + if (!request.ParseFromString(bytes)) { + return detail::Fail("the StartServiceCall request is malformed"); + } + return detail::Answer(host.StartServiceCall(request)); + }}, {"CreateEntity", [](HostService& host, const std::string& bytes) { entities::EntityOptions request; @@ -2139,6 +2160,11 @@ class ModClient { return Send("Serve", event); } + // ServiceReplied ends one StartServiceCall, in a frame after the call. + std::expected ServiceReplied(const ServiceRepliedEvent& event) { + return Send("ServiceReplied", event); + } + // Damage offers one hit before the game applies it, while the mod asked // for damage. The mod's answer may block the hit or change its amount. std::expected Damage(const combat::DamageEvent& event) { diff --git a/src/wasm/manifest.pb.cc b/src/wasm/manifest.pb.cc index c41a7508..709316a1 100644 --- a/src/wasm/manifest.pb.cc +++ b/src/wasm/manifest.pb.cc @@ -29,6 +29,34 @@ namespace _fl = ::google::protobuf::internal::field_layout; namespace modlock { namespace wasm { +inline constexpr Service::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + name_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + optional_{false} {} + +template +PROTOBUF_CONSTEXPR Service::Service(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Service_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct ServiceDefaultTypeInternal { + PROTOBUF_CONSTEXPR ServiceDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ServiceDefaultTypeInternal() {} + union { + Service _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ServiceDefaultTypeInternal _Service_default_instance_; + inline constexpr Movement::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : _cached_size_{0}, @@ -166,6 +194,7 @@ inline constexpr Manifest::Impl_::Impl_( settings_{}, metrics_{}, boards_{}, + services_{}, slug_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), @@ -219,7 +248,7 @@ const ::uint32_t protodesc_cold) = { 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_._has_bits_), - 17, // hasbit index offset + 18, // 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_), @@ -234,20 +263,29 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.free_for_all_), PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.content_addon_), PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.boards_), - 4, + PROTOBUF_FIELD_OFFSET(::modlock::wasm::Manifest, _impl_.services_), 5, 6, - 11, - 12, 7, + 12, + 13, 8, - 10, + 9, + 11, 0, 1, 2, - 13, - 9, + 14, + 10, 3, + 4, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::Service, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::Service, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::Service, _impl_.optional_), + 0, + 1, 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::modlock::wasm::Movement, _impl_._has_bits_), 5, // hasbit index offset @@ -303,15 +341,17 @@ const ::uint32_t static const ::_pbi::MigrationSchema schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { {0, sizeof(::modlock::wasm::Manifest)}, - {31, sizeof(::modlock::wasm::Movement)}, - {38, sizeof(::modlock::wasm::Definition_PropertiesEntry_DoNotUse)}, - {45, sizeof(::modlock::wasm::Definition_FieldsEntry_DoNotUse)}, - {52, sizeof(::modlock::wasm::Definition_CopyFieldsEntry_DoNotUse)}, - {59, sizeof(::modlock::wasm::Definition_TextFieldsEntry_DoNotUse)}, - {66, sizeof(::modlock::wasm::Definition)}, + {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)}, }; static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { &::modlock::wasm::_Manifest_default_instance_._instance, + &::modlock::wasm::_Service_default_instance_._instance, &::modlock::wasm::_Movement_default_instance_._instance, &::modlock::wasm::_Definition_PropertiesEntry_DoNotUse_default_instance_._instance, &::modlock::wasm::_Definition_FieldsEntry_DoNotUse_default_instance_._instance, @@ -327,7 +367,7 @@ const char descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwa "proto\0327github.com/paralin/modlock/src/wa" "sm/scores/scores.proto\032;github.com/paral" "in/modlock/src/wasm/settings/settings.pr" - "oto\"\305\005\n\010Manifest\022\014\n\004slug\030\001 \001(\t\022\014\n\004name\030\002" + "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" @@ -338,34 +378,36 @@ const char descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwa ".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\"k\n\007Runtime\022\023\n\017R" - "UNTIME_UNKNOWN\020\000\022\020\n\014RUNTIME_WASM\020\001\022\023\n\017RU" - "NTIME_QUICKJS\020\002\022\020\n\014RUNTIME_LUAU\020\003\022\022\n\016RUN" - "TIME_PYTHON\020\004\"\213\001\n\010Language\022\024\n\020LANGUAGE_U" - "NKNOWN\020\000\022\017\n\013LANGUAGE_GO\020\001\022\027\n\023LANGUAGE_TY" - "PESCRIPT\020\002\022\027\n\023LANGUAGE_JAVASCRIPT\020\003\022\021\n\rL" - "ANGUAGE_LUAU\020\004\022\023\n\017LANGUAGE_PYTHON\020\005\"\222\001\n\010" - "Movement\022+\n\005model\030\001 \001(\0162\034.modlock.wasm.M" - "ovement.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\023unpredicted_buttons\"\360\004\n\nDefinition\022" - "+\n\004file\030\001 \001(\0162\035.modlock.wasm.Definition." - "File\022\r\n\005entry\030\002 \001(\t\022<\n\nproperties\030\003 \003(\0132" - "(.modlock.wasm.Definition.PropertiesEntr" - "y\0224\n\006fields\030\004 \003(\0132$.modlock.wasm.Definit" - "ion.FieldsEntry\022=\n\013copy_fields\030\005 \003(\0132(.m" - "odlock.wasm.Definition.CopyFieldsEntry\022=" - "\n\013text_fields\030\006 \003(\0132(.modlock.wasm.Defin" - "ition.TextFieldsEntry\0321\n\017PropertiesEntry" - "\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\002:\0028\001\032-\n\013Fiel" - "dsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\002:\0028\001\032" - "1\n\017CopyFieldsEntry\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\005value\030\002 \001(\t:\0028\001\"l\n\004File\022\022\n\016FILE_AB" - "ILITIES\020\000\022\017\n\013FILE_HEROES\020\001\022\027\n\023FILE_BOT_D" - "IFFICULTY\020\002\022\022\n\016FILE_NPC_UNITS\020\003\022\022\n\016FILE_" - "MODIFIERS\020\004B*Z(github.com/paralin/modloc" - "k/src/wasm;wasmb\006proto3" + "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" }; static const ::_pbi::DescriptorTable* PROTOBUF_NONNULL const descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmanifest_2eproto_deps[3] = { @@ -377,13 +419,13 @@ 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, - 1783, + 1867, 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, - 7, + 8, schemas, file_default_instances, TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmanifest_2eproto::offsets, @@ -463,6 +505,7 @@ PROTOBUF_NDEBUG_INLINE Manifest::Impl_::Impl_( settings_{visibility, arena, from.settings_}, metrics_{visibility, arena, from.metrics_}, boards_{visibility, arena, from.boards_}, + services_{visibility, arena, from.services_}, slug_(arena, from.slug_), name_(arena, from.name_), version_(arena, from.version_), @@ -484,7 +527,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, 0x00000400U)) + _impl_.movement_ = (CheckHasBit(cached_has_bits, 0x00000800U)) ? ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.movement_) : nullptr; ::memcpy(reinterpret_cast(&_impl_) + @@ -505,6 +548,7 @@ PROTOBUF_NDEBUG_INLINE Manifest::Impl_::Impl_( settings_{visibility, arena}, metrics_{visibility, arena}, boards_{visibility, arena}, + services_{visibility, arena}, slug_(arena), name_(arena), version_(arena), @@ -565,6 +609,10 @@ constexpr auto Manifest::InternalNewImpl_() { decltype(Manifest::_impl_.boards_):: InternalGetArenaOffset( ::google::protobuf::Message::internal_visibility()), + PROTOBUF_FIELD_OFFSET(Manifest, _impl_.services_) + + decltype(Manifest::_impl_.services_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), }); if (arena_bits.has_value()) { return ::google::protobuf::internal::MessageCreator::CopyInit( @@ -609,17 +657,17 @@ Manifest::GetClassData() const { return Manifest_class_data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<4, 14, 5, 74, 2> +const ::_pbi::TcParseTable<4, 15, 6, 74, 2> Manifest::_table_ = { { PROTOBUF_FIELD_OFFSET(Manifest, _impl_._has_bits_), 0, // no _extensions_ - 14, 120, // max_field_number, fast_idx_mask + 15, 120, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294950912, // skipmap + 4294934528, // skipmap offsetof(decltype(_table_), field_entries), - 14, // num_field_entries - 5, // num_aux_entries + 15, // num_field_entries + 6, // num_aux_entries offsetof(decltype(_table_), aux_entries), Manifest_class_data_.base(), nullptr, // post_loop_handler @@ -631,35 +679,35 @@ Manifest::_table_ = { {::_pbi::TcParser::MiniParse, {}}, // string slug = 1; {::_pbi::TcParser::FastUS1, - {10, 4, 0, + {10, 5, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.slug_)}}, // string name = 2; {::_pbi::TcParser::FastUS1, - {18, 5, 0, + {18, 6, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.name_)}}, // string version = 3; {::_pbi::TcParser::FastUS1, - {26, 6, 0, + {26, 7, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.version_)}}, // .modlock.wasm.Manifest.Language language = 4; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Manifest, _impl_.language_), 11>(), - {32, 11, 0, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Manifest, _impl_.language_), 12>(), + {32, 12, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.language_)}}, // .modlock.wasm.Manifest.Runtime runtime = 5; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Manifest, _impl_.runtime_), 12>(), - {40, 12, 0, + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Manifest, _impl_.runtime_), 13>(), + {40, 13, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.runtime_)}}, // string entry = 6; {::_pbi::TcParser::FastUS1, - {50, 7, 0, + {50, 8, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.entry_)}}, // string map = 7; {::_pbi::TcParser::FastUS1, - {58, 8, 0, + {58, 9, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.map_)}}, // .modlock.wasm.Movement movement = 8; {::_pbi::TcParser::FastMtS1, - {66, 10, 0, + {66, 11, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.movement_)}}, // repeated .modlock.wasm.Definition definitions = 9; {::_pbi::TcParser::FastMtR1, @@ -674,37 +722,40 @@ Manifest::_table_ = { {90, 2, 3, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.metrics_)}}, // bool free_for_all = 12; - {::_pbi::TcParser::SingularVarintNoZag1(), - {96, 13, 0, + {::_pbi::TcParser::SingularVarintNoZag1(), + {96, 14, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.free_for_all_)}}, // string content_addon = 13; {::_pbi::TcParser::FastUS1, - {106, 9, 0, + {106, 10, 0, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.content_addon_)}}, // repeated .modlock.wasm.scores.Board boards = 14; {::_pbi::TcParser::FastMtR1, {114, 3, 4, PROTOBUF_FIELD_OFFSET(Manifest, _impl_.boards_)}}, - {::_pbi::TcParser::MiniParse, {}}, + // repeated .modlock.wasm.Service services = 15; + {::_pbi::TcParser::FastMtR1, + {122, 4, 5, + PROTOBUF_FIELD_OFFSET(Manifest, _impl_.services_)}}, }}, {{ 65535, 65535 }}, {{ // string slug = 1; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.slug_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.slug_), _Internal::kHasBitsOffset + 5, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string name = 2; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.name_), _Internal::kHasBitsOffset + 5, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.name_), _Internal::kHasBitsOffset + 6, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string version = 3; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.version_), _Internal::kHasBitsOffset + 6, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.version_), _Internal::kHasBitsOffset + 7, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .modlock.wasm.Manifest.Language language = 4; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.language_), _Internal::kHasBitsOffset + 11, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.language_), _Internal::kHasBitsOffset + 12, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, // .modlock.wasm.Manifest.Runtime runtime = 5; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.runtime_), _Internal::kHasBitsOffset + 12, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.runtime_), _Internal::kHasBitsOffset + 13, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, // string entry = 6; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.entry_), _Internal::kHasBitsOffset + 7, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.entry_), _Internal::kHasBitsOffset + 8, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // string map = 7; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.map_), _Internal::kHasBitsOffset + 8, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.map_), _Internal::kHasBitsOffset + 9, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, // .modlock.wasm.Movement movement = 8; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.movement_), _Internal::kHasBitsOffset + 10, 0, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.movement_), _Internal::kHasBitsOffset + 11, 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; @@ -712,11 +763,13 @@ 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 + 13, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.free_for_all_), _Internal::kHasBitsOffset + 14, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, // string content_addon = 13; - {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.content_addon_), _Internal::kHasBitsOffset + 9, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + {PROTOBUF_FIELD_OFFSET(Manifest, _impl_.content_addon_), _Internal::kHasBitsOffset + 10, 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)}, }}, {{ {::_pbi::TcParser::GetTable<::modlock::wasm::Movement>()}, @@ -724,6 +777,7 @@ Manifest::_table_ = { {::_pbi::TcParser::GetTable<::modlock::wasm::settings::Setting>()}, {::_pbi::TcParser::GetTable<::modlock::wasm::metrics::Metric>()}, {::_pbi::TcParser::GetTable<::modlock::wasm::scores::Board>()}, + {::_pbi::TcParser::GetTable<::modlock::wasm::Service>()}, }}, {{ "\25\4\4\7\0\0\5\3\0\0\0\0\0\15\0\0" @@ -757,32 +811,35 @@ PROTOBUF_NOINLINE void Manifest::Clear() { if (CheckHasBitForRepeated(cached_has_bits, 0x00000008U)) { _impl_.boards_.Clear(); } - if (CheckHasBit(cached_has_bits, 0x00000010U)) { - _impl_.slug_.ClearNonDefaultToEmpty(); + if (CheckHasBitForRepeated(cached_has_bits, 0x00000010U)) { + _impl_.services_.Clear(); } if (CheckHasBit(cached_has_bits, 0x00000020U)) { - _impl_.name_.ClearNonDefaultToEmpty(); + _impl_.slug_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000040U)) { - _impl_.version_.ClearNonDefaultToEmpty(); + _impl_.name_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000080U)) { - _impl_.entry_.ClearNonDefaultToEmpty(); + _impl_.version_.ClearNonDefaultToEmpty(); } } - if (BatchCheckHasBit(cached_has_bits, 0x00000700U)) { + if (BatchCheckHasBit(cached_has_bits, 0x00000f00U)) { if (CheckHasBit(cached_has_bits, 0x00000100U)) { - _impl_.map_.ClearNonDefaultToEmpty(); + _impl_.entry_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000200U)) { - _impl_.content_addon_.ClearNonDefaultToEmpty(); + _impl_.map_.ClearNonDefaultToEmpty(); } if (CheckHasBit(cached_has_bits, 0x00000400U)) { + _impl_.content_addon_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000800U)) { ABSL_DCHECK(_impl_.movement_ != nullptr); _impl_.movement_->Clear(); } } - if (BatchCheckHasBit(cached_has_bits, 0x00003800U)) { + if (BatchCheckHasBit(cached_has_bits, 0x00007000U)) { ::memset(&_impl_.language_, 0, static_cast<::size_t>( reinterpret_cast(&_impl_.free_for_all_) - reinterpret_cast(&_impl_.language_)) + sizeof(_impl_.free_for_all_)); @@ -811,7 +868,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[0]; // string slug = 1; - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { if (!this_._internal_slug().empty()) { const ::std::string& _s = this_._internal_slug(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -821,7 +878,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // string name = 2; - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (!this_._internal_name().empty()) { const ::std::string& _s = this_._internal_name(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -831,7 +888,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // string version = 3; - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (!this_._internal_version().empty()) { const ::std::string& _s = this_._internal_version(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -841,7 +898,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // .modlock.wasm.Manifest.Language language = 4; - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { if (this_._internal_language() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( @@ -850,7 +907,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // .modlock.wasm.Manifest.Runtime runtime = 5; - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (this_._internal_runtime() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteEnumToArray( @@ -859,7 +916,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // string entry = 6; - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (!this_._internal_entry().empty()) { const ::std::string& _s = this_._internal_entry(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -869,7 +926,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // string map = 7; - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (!this_._internal_map().empty()) { const ::std::string& _s = this_._internal_map(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -879,7 +936,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // .modlock.wasm.Movement movement = 8; - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( 8, *this_._impl_.movement_, this_._impl_.movement_->GetCachedSize(), target, stream); @@ -925,7 +982,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // bool free_for_all = 12; - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (this_._internal_free_for_all() != 0) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteBoolToArray( @@ -934,7 +991,7 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } // string content_addon = 13; - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (!this_._internal_content_addon().empty()) { const ::std::string& _s = this_._internal_content_addon(); ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( @@ -956,6 +1013,19 @@ ::uint8_t* PROTOBUF_NONNULL Manifest::_InternalSerialize( } } + // repeated .modlock.wasm.Service services = 15; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000010U)) { + for (unsigned i = 0, n = static_cast( + this_._internal_services_size()); + i < n; i++) { + const auto& repfield = this_._internal_services().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 15, repfield, repfield.GetCachedSize(), + target, stream); + } + } + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -1010,71 +1080,78 @@ ::size_t Manifest::ByteSizeLong() const { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } } + // repeated .modlock.wasm.Service services = 15; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000010U)) { + total_size += 1UL * this_._internal_services_size(); + for (const auto& msg : this_._internal_services()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + } // string slug = 1; - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBit(cached_has_bits, 0x00000020U)) { if (!this_._internal_slug().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_slug()); } } // string name = 2; - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (!this_._internal_name().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_name()); } } // string version = 3; - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { 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, 0x00000080U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (!this_._internal_entry().empty()) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( this_._internal_entry()); } } - } - if (BatchCheckHasBit(cached_has_bits, 0x00003f00U)) { // string map = 7; - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { 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, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { 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, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*this_._impl_.movement_); } // .modlock.wasm.Manifest.Language language = 4; - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { 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, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (this_._internal_runtime() != 0) { total_size += 1 + ::_pbi::WireFormatLite::EnumSize(this_._internal_runtime()); } } // bool free_for_all = 12; - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (this_._internal_free_for_all() != 0) { total_size += 2; } @@ -1120,7 +1197,12 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, ::google::protobuf::MessageLite::internal_visibility(), arena, from._internal_boards()); } - if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (CheckHasBitForRepeated(cached_has_bits, 0x00000010U)) { + _this->_internal_mutable_services()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_services()); + } + if (CheckHasBit(cached_has_bits, 0x00000020U)) { if (!from._internal_slug().empty()) { _this->_internal_set_slug(from._internal_slug()); } else { @@ -1129,7 +1211,7 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (CheckHasBit(cached_has_bits, 0x00000040U)) { if (!from._internal_name().empty()) { _this->_internal_set_name(from._internal_name()); } else { @@ -1138,7 +1220,7 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000040U)) { + if (CheckHasBit(cached_has_bits, 0x00000080U)) { if (!from._internal_version().empty()) { _this->_internal_set_version(from._internal_version()); } else { @@ -1147,7 +1229,9 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000080U)) { + } + if (BatchCheckHasBit(cached_has_bits, 0x00007f00U)) { + if (CheckHasBit(cached_has_bits, 0x00000100U)) { if (!from._internal_entry().empty()) { _this->_internal_set_entry(from._internal_entry()); } else { @@ -1156,9 +1240,7 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - } - if (BatchCheckHasBit(cached_has_bits, 0x00003f00U)) { - if (CheckHasBit(cached_has_bits, 0x00000100U)) { + if (CheckHasBit(cached_has_bits, 0x00000200U)) { if (!from._internal_map().empty()) { _this->_internal_set_map(from._internal_map()); } else { @@ -1167,7 +1249,7 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000200U)) { + if (CheckHasBit(cached_has_bits, 0x00000400U)) { if (!from._internal_content_addon().empty()) { _this->_internal_set_content_addon(from._internal_content_addon()); } else { @@ -1176,7 +1258,7 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, } } } - if (CheckHasBit(cached_has_bits, 0x00000400U)) { + if (CheckHasBit(cached_has_bits, 0x00000800U)) { ABSL_DCHECK(from._impl_.movement_ != nullptr); if (_this->_impl_.movement_ == nullptr) { _this->_impl_.movement_ = ::google::protobuf::Message::CopyConstruct(arena, *from._impl_.movement_); @@ -1184,17 +1266,17 @@ void Manifest::MergeImpl(::google::protobuf::MessageLite& to_msg, _this->_impl_.movement_->MergeFrom(*from._impl_.movement_); } } - if (CheckHasBit(cached_has_bits, 0x00000800U)) { + if (CheckHasBit(cached_has_bits, 0x00001000U)) { if (from._internal_language() != 0) { _this->_impl_.language_ = from._impl_.language_; } } - if (CheckHasBit(cached_has_bits, 0x00001000U)) { + if (CheckHasBit(cached_has_bits, 0x00002000U)) { if (from._internal_runtime() != 0) { _this->_impl_.runtime_ = from._impl_.runtime_; } } - if (CheckHasBit(cached_has_bits, 0x00002000U)) { + if (CheckHasBit(cached_has_bits, 0x00004000U)) { if (from._internal_free_for_all() != 0) { _this->_impl_.free_for_all_ = from._impl_.free_for_all_; } @@ -1223,6 +1305,7 @@ void Manifest::InternalSwap(Manifest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) _impl_.settings_.InternalSwap(&other->_impl_.settings_); _impl_.metrics_.InternalSwap(&other->_impl_.metrics_); _impl_.boards_.InternalSwap(&other->_impl_.boards_); + _impl_.services_.InternalSwap(&other->_impl_.services_); ::_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); @@ -1242,6 +1325,314 @@ ::google::protobuf::Metadata Manifest::GetMetadata() const { } // =================================================================== +class Service::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Service, _impl_._has_bits_); +}; + +Service::Service(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Service_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.Service) +} +PROTOBUF_NDEBUG_INLINE Service::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::Service& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + name_(arena, from.name_) {} + +Service::Service( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Service& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Service_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Service* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.optional_ = from._impl_.optional_; + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.Service) +} +PROTOBUF_NDEBUG_INLINE Service::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + name_(arena) {} + +inline void Service::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.optional_ = {}; +} +Service::~Service() { + // @@protoc_insertion_point(destructor:modlock.wasm.Service) + SharedDtor(*this); +} +inline void Service::SharedDtor(MessageLite& self) { + Service& 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 Service::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Service(arena); +} +constexpr auto Service::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(Service), + alignof(Service)); +} +constexpr auto Service::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Service_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &Service::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Service::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Service::ByteSizeLong, + &Service::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Service, _impl_._cached_size_), + false, + }, + &Service::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmanifest_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Service_class_data_ = + Service::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Service::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Service_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Service_class_data_.tc_table); + return Service_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 0, 33, 2> +Service::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Service, _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 + Service_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::Service>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // bool optional = 2; + {::_pbi::TcParser::SingularVarintNoZag1(), + {16, 1, 0, + PROTOBUF_FIELD_OFFSET(Service, _impl_.optional_)}}, + // string name = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(Service, _impl_.name_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string name = 1; + {PROTOBUF_FIELD_OFFSET(Service, _impl_.name_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // bool optional = 2; + {PROTOBUF_FIELD_OFFSET(Service, _impl_.optional_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + }}, + // no aux_entries + {{ + "\24\4\0\0\0\0\0\0" + "modlock.wasm.Service" + "name" + }}, +}; +PROTOBUF_NOINLINE void Service::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.Service) + ::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(); + } + _impl_.optional_ = false; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Service::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Service& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Service::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Service& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.Service) + ::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.Service.name"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // bool optional = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_optional() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 2, this_._internal_optional(), 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.Service) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Service::ByteSizeLong(const MessageLite& base) { + const Service& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Service::ByteSizeLong() const { + const Service& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.Service) + ::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)) { + // 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()); + } + } + // bool optional = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_optional() != 0) { + total_size += 2; + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Service::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.Service) + 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_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_optional() != 0) { + _this->_impl_.optional_ = from._impl_.optional_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Service::CopyFrom(const Service& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.Service) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Service::InternalSwap(Service* 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_.optional_, other->_impl_.optional_); +} + +::google::protobuf::Metadata Service::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + class Movement::_Internal { public: using HasBits = diff --git a/src/wasm/manifest.pb.go b/src/wasm/manifest.pb.go index c05c8bee..5c84dae2 100644 --- a/src/wasm/manifest.pb.go +++ b/src/wasm/manifest.pb.go @@ -256,6 +256,11 @@ type Manifest struct { // Boards are the rankings the mod reports scores to through the host's // scores service. Boards []*scores.Board `protobuf:"bytes,14,rep,name=boards,proto3" json:"boards,omitempty"` + // Services are the services the mod calls with CallService, by name only; + // the host learns no methods. A host refuses to start a mod when a service + // 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"` } func (x *Manifest) Reset() { @@ -362,6 +367,43 @@ func (x *Manifest) GetBoards() []*scores.Board { return nil } +func (x *Manifest) GetServices() []*Service { + if x != nil { + return x.Services + } + return nil +} + +// Service names one service a mod calls. +type Service struct { + unknownFields []byte + // Name is the service's name as CallService names it, such as + // "example.drills.v1". + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Optional marks a service the mod runs without. Unset, the mod needs it. + Optional bool `protobuf:"varint,2,opt,name=optional,proto3" json:"optional,omitempty"` +} + +func (x *Service) Reset() { + *x = Service{} +} + +func (*Service) ProtoMessage() {} + +func (x *Service) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Service) GetOptional() bool { + if x != nil { + return x.Optional + } + return false +} + // Movement selects the movement model heroes walk and jump with. type Movement struct { unknownFields []byte @@ -595,6 +637,7 @@ func (m *Manifest) CloneVT() *Manifest { r.Settings = protobuf_go_lite.CloneVTSlice(m.Settings) r.Metrics = protobuf_go_lite.CloneVTSlice(m.Metrics) r.Boards = protobuf_go_lite.CloneVTSlice(m.Boards) + r.Services = protobuf_go_lite.CloneVTSlice(m.Services) if len(m.unknownFields) > 0 { r.unknownFields = slices.Clone(m.unknownFields) } @@ -605,6 +648,23 @@ func (m *Manifest) CloneMessageVT() protobuf_go_lite.CloneMessage { return m.CloneVT() } +func (m *Service) CloneVT() *Service { + if m == nil { + return (*Service)(nil) + } + r := new(Service) + r.Name = m.Name + r.Optional = m.Optional + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *Service) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + func (m *Movement) CloneVT() *Movement { if m == nil { return (*Movement)(nil) @@ -691,6 +751,9 @@ func (this *Manifest) EqualVT(that *Manifest) bool { if !protobuf_go_lite.EqualVTSliceImplicit(this.Boards, that.Boards, func() *scores.Board { return &scores.Board{} }) { return false } + if !protobuf_go_lite.EqualVTSliceImplicit(this.Services, that.Services, func() *Service { return &Service{} }) { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -702,6 +765,29 @@ func (this *Manifest) EqualMessageVT(thatMsg any) bool { return this.EqualVT(that) } +func (this *Service) EqualVT(that *Service) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Name != that.Name { + return false + } + if this.Optional != that.Optional { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *Service) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*Service) + if !ok { + return false + } + return this.EqualVT(that) +} + func (this *Movement) EqualVT(that *Movement) bool { if this == that { return true @@ -942,6 +1028,17 @@ func (x *Manifest) MarshalProtoJSON(s *json.MarshalState) { } s.WriteArrayEnd() } + if len(x.Services) > 0 || s.HasField("services") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("services") + s.WriteArrayStart() + var wroteElement bool + for _, element := range x.Services { + s.WriteMoreIf(&wroteElement) + element.MarshalProtoJSON(s.WithField("services")) + } + s.WriteArrayEnd() + } s.WriteObjectEnd() } @@ -1065,6 +1162,24 @@ func (x *Manifest) UnmarshalProtoJSON(s *json.UnmarshalState) { } x.Boards = append(x.Boards, v) }) + case "services": + s.AddField("services") + if s.ReadNil() { + x.Services = nil + return + } + s.ReadArray(func() { + if s.ReadNil() { + x.Services = append(x.Services, nil) + return + } + v := &Service{} + v.UnmarshalProtoJSON(s.WithField("services", false)) + if s.Err() != nil { + return + } + x.Services = append(x.Services, v) + }) } }) } @@ -1074,6 +1189,56 @@ func (x *Manifest) UnmarshalJSON(b []byte) error { return json.DefaultUnmarshalerConfig.Unmarshal(b, x) } +// MarshalProtoJSON marshals the Service message to JSON. +func (x *Service) 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.Optional || s.HasField("optional") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("optional") + s.WriteBool(x.Optional) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the Service to JSON. +func (x *Service) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the Service message from JSON. +func (x *Service) 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 "optional": + s.AddField("optional") + x.Optional = s.ReadBool() + } + }) +} + +// UnmarshalJSON unmarshals the Service from JSON. +func (x *Service) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the Movement_Model to JSON. func (x Movement_Model) MarshalProtoJSON(s *json.MarshalState) { s.WriteEnum(int32(x), Movement_Model_name) @@ -1575,6 +1740,18 @@ func (m *Manifest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.unknownFields != nil { i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) } + if len(m.Services) > 0 { + for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Services[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x7a + } + } if len(m.Boards) > 0 { for iNdEx := len(m.Boards) - 1; iNdEx >= 0; iNdEx-- { size, err := m.Boards[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) @@ -1681,6 +1858,48 @@ func (m *Manifest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Service) 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 *Service) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Service) 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.Optional { + i = protobuf_go_lite.EncodeBool(dAtA, i, m.Optional) + 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 *Movement) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -1860,6 +2079,22 @@ func (m *Manifest) SizeVT() (n int) { l = e.SizeVT() n += protobuf_go_lite.SizeMessage(1, l) } + for _, e := range m.Services { + l = e.SizeVT() + n += protobuf_go_lite.SizeMessage(1, l) + } + n += len(m.unknownFields) + return n +} + +func (m *Service) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Name) + n += protobuf_go_lite.SizeBoolNonZero(1, m.Optional) n += len(m.unknownFields) return n } @@ -2011,6 +2246,18 @@ func (x *Manifest) MarshalProtoText() string { } protobuf_go_lite.TextWriteListEnd(&sb) } + if len(x.Services) > 0 { + protobuf_go_lite.TextWriteListStart(&sb, initialLen, "services") + for i, v := range x.Services { + protobuf_go_lite.TextWriteListSeparator(&sb, i) + if v == nil { + protobuf_go_lite.TextWriteTextMarshaler(&sb, &Service{}) + } else { + protobuf_go_lite.TextWriteTextMarshaler(&sb, v) + } + } + protobuf_go_lite.TextWriteListEnd(&sb) + } return protobuf_go_lite.TextFinishMessage(&sb) } @@ -2018,6 +2265,24 @@ func (x *Manifest) String() string { return x.MarshalProtoText() } +func (x *Service) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "Service") + if x.Name != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "name") + protobuf_go_lite.TextWriteString(&sb, x.Name) + } + if x.Optional != false { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "optional") + protobuf_go_lite.TextWriteBool(&sb, x.Optional) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *Service) String() string { + return x.MarshalProtoText() +} + func (x Movement_Model) MarshalProtoText() string { return x.String() } @@ -2357,6 +2622,82 @@ func (m *Manifest) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) + } + msgStart, postIndex, err := protobuf_go_lite.DecodeLengthDelimited(dAtA, iNdEx) + if err != nil { + return err + } + m.Services = append(m.Services, &Service{}) + if err := m.Services[len(m.Services)-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 *Service) 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: Service: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Service: 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 Optional", wireType) + } + var v bool + v, iNdEx, err = protobuf_go_lite.DecodeVarintBool(dAtA, iNdEx) + if err != nil { + return err + } + m.Optional = bool(v) 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 f8fc5464..7f09d032 100644 --- a/src/wasm/manifest.pb.h +++ b/src/wasm/manifest.pb.h @@ -100,6 +100,10 @@ class Movement; struct MovementDefaultTypeInternal; MODLOCK_API extern MovementDefaultTypeInternal _Movement_default_instance_; MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Movement_class_data_; +class Service; +struct ServiceDefaultTypeInternal; +MODLOCK_API extern ServiceDefaultTypeInternal _Service_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Service_class_data_; } // namespace wasm } // namespace modlock namespace google { @@ -281,6 +285,213 @@ inline bool Definition_File_Parse( // ------------------------------------------------------------------- +class MODLOCK_API Service final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.Service) */ { + public: + inline Service() : Service(nullptr) {} + ~Service() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(Service* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Service)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR Service(::google::protobuf::internal::ConstantInitialized); + + inline Service(const Service& from) : Service(nullptr, from) {} + inline Service(Service&& from) noexcept + : Service(nullptr, ::std::move(from)) {} + inline Service& operator=(const Service& from) { + CopyFrom(from); + return *this; + } + inline Service& operator=(Service&& 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 Service& default_instance() { + return *reinterpret_cast( + &_Service_default_instance_); + } + static constexpr int kIndexInFileMessages = 1; + friend void swap(Service& a, Service& b) { a.Swap(&b); } + inline void Swap(Service* 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(Service* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Service* 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 Service& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const Service& from) { Service::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(Service* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.Service"; } + + explicit Service(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Service(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Service& from); + Service( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Service&& from) noexcept + : Service(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, + kOptionalFieldNumber = 2, + }; + // 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: + // bool optional = 2; + void clear_optional() ; + bool optional() const; + void set_optional(bool value); + + private: + bool _internal_optional() const; + void _internal_set_optional(bool value); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.Service) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 0, 33, + 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 Service& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + bool optional_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fmanifest_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull Service_class_data_; +// ------------------------------------------------------------------- + class MODLOCK_API Movement final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:modlock.wasm.Movement) */ { public: @@ -336,7 +547,7 @@ class MODLOCK_API Movement final : public ::google::protobuf::Message return *reinterpret_cast( &_Movement_default_instance_); } - static constexpr int kIndexInFileMessages = 1; + static constexpr int kIndexInFileMessages = 2; friend void swap(Movement& a, Movement& b) { a.Swap(&b); } inline void Swap(Movement* PROTOBUF_NONNULL other) { if (other == this) return; @@ -714,7 +925,7 @@ class MODLOCK_API Definition final : public ::google::protobuf::Message return *reinterpret_cast( &_Definition_default_instance_); } - static constexpr int kIndexInFileMessages = 6; + static constexpr int kIndexInFileMessages = 7; friend void swap(Definition& a, Definition& b) { a.Swap(&b); } inline void Swap(Definition* PROTOBUF_NONNULL other) { if (other == this) return; @@ -1162,6 +1373,7 @@ class MODLOCK_API Manifest final : public ::google::protobuf::Message kSettingsFieldNumber = 10, kMetricsFieldNumber = 11, kBoardsFieldNumber = 14, + kServicesFieldNumber = 15, kSlugFieldNumber = 1, kNameFieldNumber = 2, kVersionFieldNumber = 3, @@ -1241,6 +1453,23 @@ class MODLOCK_API Manifest final : public ::google::protobuf::Message const ::modlock::wasm::scores::Board& boards(int index) const; ::modlock::wasm::scores::Board* PROTOBUF_NONNULL add_boards(); const ::google::protobuf::RepeatedPtrField<::modlock::wasm::scores::Board>& boards() const; + // repeated .modlock.wasm.Service services = 15; + int services_size() const; + private: + int _internal_services_size() const; + + public: + void clear_services() ; + ::modlock::wasm::Service* PROTOBUF_NONNULL mutable_services(int index); + ::google::protobuf::RepeatedPtrField<::modlock::wasm::Service>* PROTOBUF_NONNULL mutable_services(); + + private: + const ::google::protobuf::RepeatedPtrField<::modlock::wasm::Service>& _internal_services() const; + ::google::protobuf::RepeatedPtrField<::modlock::wasm::Service>* PROTOBUF_NONNULL _internal_mutable_services(); + public: + const ::modlock::wasm::Service& services(int index) const; + ::modlock::wasm::Service* PROTOBUF_NONNULL add_services(); + const ::google::protobuf::RepeatedPtrField<::modlock::wasm::Service>& services() const; // string slug = 1; void clear_slug() ; const ::std::string& slug() const; @@ -1380,8 +1609,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, 14, - 5, 74, + static const ::google::protobuf::internal::TcParseTable<4, 15, + 6, 74, 2> _table_; @@ -1406,6 +1635,7 @@ class MODLOCK_API Manifest final : public ::google::protobuf::Message ::google::protobuf::RepeatedPtrField< ::modlock::wasm::settings::Setting > settings_; ::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::internal::ArenaStringPtr slug_; ::google::protobuf::internal::ArenaStringPtr name_; ::google::protobuf::internal::ArenaStringPtr version_; @@ -1445,7 +1675,7 @@ inline void Manifest::clear_slug() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.slug_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000010U); + 0x00000020U); } inline const ::std::string& Manifest::slug() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -1455,13 +1685,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], 0x00000010U); + SetHasBit(_impl_._has_bits_[0], 0x00000020U); _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], 0x00000010U); + SetHasBit(_impl_._has_bits_[0], 0x00000020U); ::std::string* _s = _internal_mutable_slug(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.slug) return _s; @@ -1481,10 +1711,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], 0x00000010U)) { + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000020U)) { return nullptr; } - ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + ClearHasBit(_impl_._has_bits_[0], 0x00000020U); auto* released = _impl_.slug_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.slug_.Set("", GetArena()); @@ -1494,9 +1724,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], 0x00000010U); + SetHasBit(_impl_._has_bits_[0], 0x00000020U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000010U); + ClearHasBit(_impl_._has_bits_[0], 0x00000020U); } _impl_.slug_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.slug_.IsDefault()) { @@ -1510,7 +1740,7 @@ inline void Manifest::clear_name() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.name_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000020U); + 0x00000040U); } inline const ::std::string& Manifest::name() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -1520,13 +1750,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], 0x00000020U); + SetHasBit(_impl_._has_bits_[0], 0x00000040U); _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], 0x00000020U); + SetHasBit(_impl_._has_bits_[0], 0x00000040U); ::std::string* _s = _internal_mutable_name(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.name) return _s; @@ -1546,10 +1776,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], 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_.name_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.name_.Set("", GetArena()); @@ -1559,9 +1789,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], 0x00000020U); + SetHasBit(_impl_._has_bits_[0], 0x00000040U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000020U); + ClearHasBit(_impl_._has_bits_[0], 0x00000040U); } _impl_.name_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.name_.IsDefault()) { @@ -1575,7 +1805,7 @@ inline void Manifest::clear_version() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.version_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000040U); + 0x00000080U); } inline const ::std::string& Manifest::version() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -1585,13 +1815,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], 0x00000040U); + SetHasBit(_impl_._has_bits_[0], 0x00000080U); _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], 0x00000040U); + SetHasBit(_impl_._has_bits_[0], 0x00000080U); ::std::string* _s = _internal_mutable_version(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.version) return _s; @@ -1611,10 +1841,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], 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_.version_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.version_.Set("", GetArena()); @@ -1624,9 +1854,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], 0x00000040U); + SetHasBit(_impl_._has_bits_[0], 0x00000080U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000040U); + ClearHasBit(_impl_._has_bits_[0], 0x00000080U); } _impl_.version_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.version_.IsDefault()) { @@ -1640,7 +1870,7 @@ inline void Manifest::clear_language() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.language_ = 0; ClearHasBit(_impl_._has_bits_[0], - 0x00000800U); + 0x00001000U); } inline ::modlock::wasm::Manifest_Language Manifest::language() const { // @@protoc_insertion_point(field_get:modlock.wasm.Manifest.language) @@ -1648,7 +1878,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], 0x00000800U); + SetHasBit(_impl_._has_bits_[0], 0x00001000U); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.language) } inline ::modlock::wasm::Manifest_Language Manifest::_internal_language() const { @@ -1665,7 +1895,7 @@ inline void Manifest::clear_runtime() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.runtime_ = 0; ClearHasBit(_impl_._has_bits_[0], - 0x00001000U); + 0x00002000U); } inline ::modlock::wasm::Manifest_Runtime Manifest::runtime() const { // @@protoc_insertion_point(field_get:modlock.wasm.Manifest.runtime) @@ -1673,7 +1903,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], 0x00001000U); + SetHasBit(_impl_._has_bits_[0], 0x00002000U); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.runtime) } inline ::modlock::wasm::Manifest_Runtime Manifest::_internal_runtime() const { @@ -1690,7 +1920,7 @@ inline void Manifest::clear_entry() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.entry_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000080U); + 0x00000100U); } inline const ::std::string& Manifest::entry() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -1700,13 +1930,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], 0x00000080U); + SetHasBit(_impl_._has_bits_[0], 0x00000100U); _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], 0x00000080U); + SetHasBit(_impl_._has_bits_[0], 0x00000100U); ::std::string* _s = _internal_mutable_entry(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.entry) return _s; @@ -1726,10 +1956,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], 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_.entry_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.entry_.Set("", GetArena()); @@ -1739,9 +1969,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], 0x00000080U); + SetHasBit(_impl_._has_bits_[0], 0x00000100U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000080U); + ClearHasBit(_impl_._has_bits_[0], 0x00000100U); } _impl_.entry_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.entry_.IsDefault()) { @@ -1755,7 +1985,7 @@ inline void Manifest::clear_map() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.map_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000100U); + 0x00000200U); } inline const ::std::string& Manifest::map() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -1765,13 +1995,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], 0x00000100U); + SetHasBit(_impl_._has_bits_[0], 0x00000200U); _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], 0x00000100U); + SetHasBit(_impl_._has_bits_[0], 0x00000200U); ::std::string* _s = _internal_mutable_map(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.map) return _s; @@ -1791,10 +2021,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], 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_.map_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.map_.Set("", GetArena()); @@ -1804,9 +2034,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], 0x00000100U); + SetHasBit(_impl_._has_bits_[0], 0x00000200U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000100U); + ClearHasBit(_impl_._has_bits_[0], 0x00000200U); } _impl_.map_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.map_.IsDefault()) { @@ -1817,7 +2047,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], 0x00000400U); + bool value = CheckHasBit(_impl_._has_bits_[0], 0x00000800U); PROTOBUF_ASSUME(!value || _impl_.movement_ != nullptr); return value; } @@ -1825,7 +2055,7 @@ inline void Manifest::clear_movement() { ::google::protobuf::internal::TSanWrite(&_impl_); if (_impl_.movement_ != nullptr) _impl_.movement_->Clear(); ClearHasBit(_impl_._has_bits_[0], - 0x00000400U); + 0x00000800U); } inline const ::modlock::wasm::Movement& Manifest::_internal_movement() const { ::google::protobuf::internal::TSanRead(&_impl_); @@ -1844,16 +2074,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], 0x00000400U); + SetHasBit(_impl_._has_bits_[0], 0x00000800U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000400U); + ClearHasBit(_impl_._has_bits_[0], 0x00000800U); } // @@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], 0x00000400U); + ClearHasBit(_impl_._has_bits_[0], 0x00000800U); ::modlock::wasm::Movement* released = _impl_.movement_; _impl_.movement_ = nullptr; if (::google::protobuf::internal::DebugHardenForceCopyInRelease()) { @@ -1873,7 +2103,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], 0x00000400U); + ClearHasBit(_impl_._has_bits_[0], 0x00000800U); ::modlock::wasm::Movement* temp = _impl_.movement_; _impl_.movement_ = nullptr; return temp; @@ -1888,7 +2118,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], 0x00000400U); + SetHasBit(_impl_._has_bits_[0], 0x00000800U); ::modlock::wasm::Movement* _msg = _internal_mutable_movement(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.movement) return _msg; @@ -1905,9 +2135,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], 0x00000400U); + SetHasBit(_impl_._has_bits_[0], 0x00000800U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000400U); + ClearHasBit(_impl_._has_bits_[0], 0x00000800U); } _impl_.movement_ = reinterpret_cast<::modlock::wasm::Movement*>(value); @@ -2075,7 +2305,7 @@ inline void Manifest::clear_free_for_all() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.free_for_all_ = false; ClearHasBit(_impl_._has_bits_[0], - 0x00002000U); + 0x00004000U); } inline bool Manifest::free_for_all() const { // @@protoc_insertion_point(field_get:modlock.wasm.Manifest.free_for_all) @@ -2083,7 +2313,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], 0x00002000U); + SetHasBit(_impl_._has_bits_[0], 0x00004000U); // @@protoc_insertion_point(field_set:modlock.wasm.Manifest.free_for_all) } inline bool Manifest::_internal_free_for_all() const { @@ -2100,7 +2330,7 @@ inline void Manifest::clear_content_addon() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.content_addon_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], - 0x00000200U); + 0x00000400U); } inline const ::std::string& Manifest::content_addon() const ABSL_ATTRIBUTE_LIFETIME_BOUND { @@ -2110,13 +2340,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], 0x00000200U); + SetHasBit(_impl_._has_bits_[0], 0x00000400U); _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], 0x00000200U); + SetHasBit(_impl_._has_bits_[0], 0x00000400U); ::std::string* _s = _internal_mutable_content_addon(); // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.content_addon) return _s; @@ -2136,10 +2366,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], 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_.content_addon_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { _impl_.content_addon_.Set("", GetArena()); @@ -2149,9 +2379,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], 0x00000200U); + SetHasBit(_impl_._has_bits_[0], 0x00000400U); } else { - ClearHasBit(_impl_._has_bits_[0], 0x00000200U); + ClearHasBit(_impl_._has_bits_[0], 0x00000400U); } _impl_.content_addon_.SetAllocated(value, GetArena()); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.content_addon_.IsDefault()) { @@ -2210,6 +2440,156 @@ Manifest::_internal_mutable_boards() { return &_impl_.boards_; } +// repeated .modlock.wasm.Service services = 15; +inline int Manifest::_internal_services_size() const { + return _internal_services().size(); +} +inline int Manifest::services_size() const { + return _internal_services_size(); +} +inline void Manifest::clear_services() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.services_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000010U); +} +inline ::modlock::wasm::Service* PROTOBUF_NONNULL Manifest::mutable_services(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:modlock.wasm.Manifest.services) + return _internal_mutable_services()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::modlock::wasm::Service>* PROTOBUF_NONNULL Manifest::mutable_services() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000010U); + // @@protoc_insertion_point(field_mutable_list:modlock.wasm.Manifest.services) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_services(); +} +inline const ::modlock::wasm::Service& Manifest::services(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.Manifest.services) + return _internal_services().Get(index); +} +inline ::modlock::wasm::Service* PROTOBUF_NONNULL Manifest::add_services() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::modlock::wasm::Service* _add = + _internal_mutable_services()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000010U); + // @@protoc_insertion_point(field_add:modlock.wasm.Manifest.services) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::wasm::Service>& Manifest::services() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:modlock.wasm.Manifest.services) + return _internal_services(); +} +inline const ::google::protobuf::RepeatedPtrField<::modlock::wasm::Service>& +Manifest::_internal_services() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.services_; +} +inline ::google::protobuf::RepeatedPtrField<::modlock::wasm::Service>* PROTOBUF_NONNULL +Manifest::_internal_mutable_services() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.services_; +} + +// ------------------------------------------------------------------- + +// Service + +// string name = 1; +inline void Service::clear_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.name_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& Service::name() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.Service.name) + return _internal_name(); +} +template +PROTOBUF_ALWAYS_INLINE void Service::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.Service.name) +} +inline ::std::string* PROTOBUF_NONNULL Service::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.Service.name) + return _s; +} +inline const ::std::string& Service::_internal_name() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.name_.Get(); +} +inline void Service::_internal_set_name(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.name_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL Service::_internal_mutable_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.name_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE Service::release_name() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.Service.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 Service::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.Service.name) +} + +// bool optional = 2; +inline void Service::clear_optional() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.optional_ = false; + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline bool Service::optional() const { + // @@protoc_insertion_point(field_get:modlock.wasm.Service.optional) + return _internal_optional(); +} +inline void Service::set_optional(bool value) { + _internal_set_optional(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:modlock.wasm.Service.optional) +} +inline bool Service::_internal_optional() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.optional_; +} +inline void Service::_internal_set_optional(bool value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.optional_ = value; +} + // ------------------------------------------------------------------- // Movement diff --git a/src/wasm/manifest.pb.ts b/src/wasm/manifest.pb.ts index e6ea40ef..6973d3ae 100644 --- a/src/wasm/manifest.pb.ts +++ b/src/wasm/manifest.pb.ts @@ -91,6 +91,13 @@ export interface Manifest { * scores service. */ boards?: Board[] + /** + * Services are the services the mod calls with CallService, by name only; + * the host learns no methods. A host refuses to start a mod when a service + * it needs has no provider, and starts it without an optional one, whose + * calls then fail. + */ + services?: Service[] } export const Manifest: MessageType = @@ -111,6 +118,7 @@ export const Manifest: MessageType = [12, 'free_for_all', 8], [13, 'content_addon', 9], [14, 'boards', 11, 1, Board.codec], + [15, 'services', 11, 1, Service.codec], ], { decode: (r: BinaryReader, end: number, m: Manifest): Manifest => { @@ -162,6 +170,9 @@ export const Manifest: MessageType = case 14: ;(m.boards ??= []).push(Board.decode(r, r.delimited(), {})) break + case 15: + ;(m.services ??= []).push(Service.decode(r, r.delimited(), {})) + break default: r.skip(t) } @@ -225,6 +236,10 @@ export const Manifest: MessageType = const a = m.boards if (a != null) for (const e of a) Board.writeField(w, 14, e) } + { + const a = m.services + if (a != null) for (const e of a) Service.writeField(w, 15, e) + } }, }, ) @@ -321,6 +336,61 @@ export const Manifest_Language_Enum = /* @__PURE__ */ createEnumType( ], ) +/** + * Service names one service a mod calls. + * + * @generated from message modlock.wasm.Service + */ +export interface Service { + /** + * Name is the service's name as CallService names it, such as + * "example.drills.v1". + */ + name?: string + /** + * Optional marks a service the mod runs without. Unset, the mod needs it. + */ + optional?: boolean +} + +export const Service: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.Service', + () => [ + [1, 'name', 9], + [2, 'optional', 8], + ], + { + decode: (r: BinaryReader, end: number, m: Service): Service => { + 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.optional = r.bool() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: Service, w: Writer): void => { + { + const v = m.name + if (v) w.uint32(10).string(v) + } + { + const v = m.optional + if (v) w.uint32(16).bool(v) + } + }, + }, + ) + /** * Movement selects the movement model heroes walk and jump with. * diff --git a/src/wasm/manifest.proto b/src/wasm/manifest.proto index aff3d274..f763ec04 100644 --- a/src/wasm/manifest.proto +++ b/src/wasm/manifest.proto @@ -106,6 +106,22 @@ message Manifest { // Boards are the rankings the mod reports scores to through the host's // scores service. repeated modlock.wasm.scores.Board boards = 14; + + // Services are the services the mod calls with CallService, by name only; + // the host learns no methods. A host refuses to start a mod when a service + // it needs has no provider, and starts it without an optional one, whose + // calls then fail. + repeated Service services = 15; +} + +// Service names one service a mod calls. +message Service { + // Name is the service's name as CallService names it, such as + // "example.drills.v1". + string name = 1; + + // Optional marks a service the mod runs without. Unset, the mod needs it. + bool optional = 2; } // Movement selects the movement model heroes walk and jump with. diff --git a/src/wasm/service_calls.cc b/src/wasm/service_calls.cc new file mode 100644 index 00000000..a77ae5fd --- /dev/null +++ b/src/wasm/service_calls.cc @@ -0,0 +1,93 @@ +//go:build deps_only + +#include "wasm/service_calls.h" + +#include + +namespace modlock::wasm { + +ServiceCalls::ServiceCalls() : shared_(std::make_shared()) {} + +std::expected ServiceCalls::Start( + std::chrono::milliseconds timeout) { + // Bound the wait, and the calls a mod holds between frames. + if (timeout <= std::chrono::milliseconds::zero() || timeout > kMaxTimeout) { + timeout = kMaxTimeout; + } + const auto call = next_; + { + std::lock_guard held(shared_->lock); + if (shared_->calls.size() >= kMaxCalls) { + return std::unexpected("the mod already holds " + std::to_string(kMaxCalls) + + " service calls"); + } + shared_->calls.emplace(call, Call{.deadline = std::chrono::steady_clock::now() + timeout}); + } + ++next_; + + // The reply reaches the calls only while this instance holds them, and + // ends the call once. + std::weak_ptr reached = shared_; + WasmReply reply = [reached, call](std::expected answer) { + auto shared = reached.lock(); + if (!shared) { + return; + } + ServiceRepliedEvent event; + event.set_call(call); + if (answer) { + event.set_payload(std::move(*answer)); + } else { + event.set_failure(SERVICE_FAILURE_REFUSED); + event.set_error(std::move(answer.error())); + } + End(*shared, call, std::move(event)); + }; + return Started{.call = call, .reply = std::move(reply)}; +} + +void ServiceCalls::Fail(uint64_t call, ServiceFailure failure, std::string error) { + ServiceRepliedEvent event; + event.set_call(call); + event.set_failure(failure); + event.set_error(std::move(error)); + End(*shared_, call, std::move(event)); +} + +std::vector ServiceCalls::Take(std::chrono::steady_clock::time_point now) { + // Collect the ended calls and those past their deadline, in call order. + std::vector ended; + std::lock_guard held(shared_->lock); + for (auto it = shared_->calls.begin(); it != shared_->calls.end();) { + if (it->second.ended) { + ended.push_back(std::move(*it->second.ended)); + } else if (now >= it->second.deadline) { + ServiceRepliedEvent event; + event.set_call(it->first); + event.set_failure(SERVICE_FAILURE_TIMEOUT); + event.set_error("the service did not answer in time"); + ended.push_back(std::move(event)); + } else { + ++it; + continue; + } + it = shared_->calls.erase(it); + } + return ended; +} + +void ServiceCalls::Drop() { + // A fresh table leaves the replies still out holding nothing they reach. + shared_ = std::make_shared(); +} + +void ServiceCalls::End(Shared& shared, uint64_t call, ServiceRepliedEvent event) { + std::lock_guard held(shared.lock); + auto found = shared.calls.find(call); + if (found == shared.calls.end() || found->second.ended) { + return; + } + found->second.ended = std::move(event); +} + +} // namespace modlock::wasm diff --git a/src/wasm/service_calls.h b/src/wasm/service_calls.h new file mode 100644 index 00000000..ba61f527 --- /dev/null +++ b/src/wasm/service_calls.h @@ -0,0 +1,76 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "modlock/wasm_host.h" +#include "src/wasm/wasm.pb.h" + +namespace modlock::wasm { + +// ServiceCalls holds one mod's started service calls until each ends: with +// the provider's answer or refusal, a timeout, or no provider. The host's +// frame thread starts and takes calls; a provider may answer from any +// thread, once. Dropping the calls ends the instance's waits without an +// event, and an answer to a dropped call does nothing. +class ServiceCalls { + public: + // kMaxTimeout bounds how long a call waits, and kMaxCalls how many calls a + // mod holds between frames, ended or waiting. + static constexpr std::chrono::milliseconds kMaxTimeout{30'000}; + static constexpr size_t kMaxCalls = 256; + + // Started numbers one call and gives the provider the reply that ends it. + struct Started { + uint64_t call = 0; + WasmReply reply; + }; + + ServiceCalls(); + + // Start numbers a call that waits timeout, at most kMaxTimeout, or zero + // for kMaxTimeout. It refuses a call past kMaxCalls. + [[nodiscard]] std::expected Start(std::chrono::milliseconds timeout); + + // Fail ends call at once with failure and error, as when nobody provides + // its service. + void Fail(uint64_t call, ServiceFailure failure, std::string error); + + // Take returns the calls that ended by now, oldest first, and forgets + // them. + [[nodiscard]] std::vector Take(std::chrono::steady_clock::time_point now); + + // Drop forgets every call, so the answers still to come do nothing. + void Drop(); + + private: + // Call is one started call: its deadline and, once it ended, its event. + struct Call { + std::chrono::steady_clock::time_point deadline; + std::optional ended; + }; + + // Shared is what the replies reach: the calls by number, under a lock, + // since a provider may answer from another thread. + struct Shared { + mutable std::mutex lock; + std::map calls; + }; + + // End records event as call's ending, unless it already ended or was + // forgotten. + static void End(Shared& shared, uint64_t call, ServiceRepliedEvent event); + + std::shared_ptr shared_; + uint64_t next_ = 1; +}; + +} // namespace modlock::wasm diff --git a/src/wasm/ui.cc b/src/wasm/ui.cc index 77be50da..e04236bb 100644 --- a/src/wasm/ui.cc +++ b/src/wasm/ui.cc @@ -5,7 +5,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -335,6 +337,26 @@ float Fit(float value, float min, float max, float step) { return std::clamp(value, min, max); } +// IsActionName reports whether name can name a layout's press: one to 64 +// letters, digits, '_', '-' and '.'. +bool IsActionName(std::string_view name) { + return !name.empty() && name.size() <= 64 && std::ranges::all_of(name, [](unsigned char c) { + return std::isalnum(c) != 0 || c == '_' || c == '-' || c == '.'; + }); +} + +// IsUtf8 reports whether text is well-formed UTF-8. +bool IsUtf8(std::string_view text) { + while (!text.empty()) { + const auto size = CharacterSize(static_cast(text[0])); + if (size == 0 || size > text.size() || !ReadCharacter(text, size)) { + return false; + } + text.remove_prefix(size); + } + return true; +} + } // namespace std::expected UiTrees::Apply(int32_t slot, const ui::Change& change) { @@ -504,7 +526,65 @@ std::expected UiTrees::Input(int32_t slot, std::s return event; } +std::expected UiTrees::Action( + int32_t slot, std::string_view line, std::chrono::steady_clock::time_point now) { + // Split the line into the layout node, the action and the payload. + const auto first = line.find(' '); + const auto node = line.substr(0, first); + const auto rest = first == std::string_view::npos ? std::string_view() : line.substr(first + 1); + const auto second = rest.find(' '); + const auto action = rest.substr(0, second); + const auto encoded = + second == std::string_view::npos ? std::string_view() : rest.substr(second + 1); + + // Refuse a press from a layout the player's tree does not show. + auto tree = trees_.find(slot); + if (tree == trees_.end()) { + return std::unexpected("shows no layout " + std::string(node)); + } + auto shown = tree->second.find(node); + if (shown == tree->second.end() || shown->second.kind != ui::KIND_LAYOUT) { + return std::unexpected("shows no layout " + std::string(node)); + } + if (!IsActionName(action)) { + return std::unexpected("layout " + std::string(node) + " cannot press that name"); + } + if (encoded.size() > (kActionPayload * 4 + 2) / 3) { + return std::unexpected("layout " + std::string(node) + " sent a payload over " + + std::to_string(kActionPayload) + " bytes"); + } + const auto payload = DecodeBase64Url(encoded); + if (!payload || payload->size() > kActionPayload || !IsUtf8(*payload)) { + return std::unexpected("layout " + std::string(node) + + " sent a payload that is not short UTF-8"); + } + + // Refill the player's presses for the time since their last, and spend one. + auto [pace, fresh] = paces_.try_emplace(slot); + if (fresh) { + pace->second.when = now; + } + const std::chrono::duration since = now - pace->second.when; + pace->second.presses = std::min( + kActionBurst, pace->second.presses + std::max(0.0, since.count()) * kActionsPerSecond); + pace->second.when = std::max(now, pace->second.when); + if (pace->second.presses < 1) { + return std::unexpected("layout " + std::string(node) + " pressed faster than " + + std::format("{}", kActionsPerSecond) + " a second"); + } + pace->second.presses -= 1; + + // The engine named the player, so the press is theirs. + ui::UiPressEvent event; + event.set_player(slot); + event.set_node(std::string(node)); + event.set_action(std::string(action)); + event.set_payload(*payload); + return event; +} + bool UiTrees::Drop(int32_t slot) { + paces_.erase(slot); if (trees_.erase(slot) == 0) { return false; } @@ -520,6 +600,7 @@ std::vector UiTrees::Clear() { } trees_.clear(); left_.clear(); + paces_.clear(); return slots; } diff --git a/src/wasm/ui.h b/src/wasm/ui.h index a2f33c7c..69ebc3a5 100644 --- a/src/wasm/ui.h +++ b/src/wasm/ui.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -41,6 +42,24 @@ class UiTrees { std::string_view node, std::string_view value) const; + // Action checks a press a layout's script sent, as a player's game sends + // it: " " and then the payload's UTF-8 in unpadded + // base64url, which an empty payload leaves off. It returns the event the + // mod hears from slot, the player the engine names, while slot's tree shows + // the layout node and the player keeps under kActionsPerSecond presses a + // second after a burst of kActionBurst. A name, a payload or a pace past + // those is refused, and so is every press once the tree is gone. + [[nodiscard]] std::expected Action( + int32_t slot, std::string_view line, std::chrono::steady_clock::time_point now); + + // kActionPayload is the most bytes of payload a layout's press carries. + static constexpr size_t kActionPayload = 180; + + // kActionBurst and kActionsPerSecond bound the presses one player's + // layouts send: a burst, then a steady pace. + static constexpr double kActionBurst = 8; + static constexpr double kActionsPerSecond = 4; + // Drop forgets slot's tree when its player leaves, and reports whether it // held any node. bool Drop(int32_t slot); @@ -74,6 +93,16 @@ class UiTrees { std::map>> trees_; // left_ holds the slots whose player left since their last reset. std::set left_; + + // Pace is what one player's layouts have left of their presses: the + // presses they may still send, as of when. + struct Pace { + double presses = kActionBurst; + std::chrono::steady_clock::time_point when; + }; + + // paces_ maps each slot that pressed through a layout to its pace. + std::map paces_; }; } // namespace modlock::wasm diff --git a/src/wasm/ui/ui.pb.cc b/src/wasm/ui/ui.pb.cc index 44f98bd0..e44fa39e 100644 --- a/src/wasm/ui/ui.pb.cc +++ b/src/wasm/ui/ui.pb.cc @@ -62,6 +62,12 @@ inline constexpr UiPressEvent::Impl_::Impl_( node_( &::google::protobuf::internal::fixed_address_empty_string, ::_pbi::ConstantInitialized()), + action_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + payload_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), player_{0} {} template @@ -1231,11 +1237,15 @@ const ::uint32_t 0, 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::modlock::wasm::ui::UiPressEvent, _impl_._has_bits_), - 5, // hasbit index offset + 7, // hasbit index offset PROTOBUF_FIELD_OFFSET(::modlock::wasm::ui::UiPressEvent, _impl_.player_), PROTOBUF_FIELD_OFFSET(::modlock::wasm::ui::UiPressEvent, _impl_.node_), - 1, + PROTOBUF_FIELD_OFFSET(::modlock::wasm::ui::UiPressEvent, _impl_.action_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::ui::UiPressEvent, _impl_.payload_), + 3, 0, + 1, + 2, 0x085, // bitmap PROTOBUF_FIELD_OFFSET(::modlock::wasm::ui::UiInputEvent, _impl_._has_bits_), PROTOBUF_FIELD_OFFSET(::modlock::wasm::ui::UiInputEvent, _impl_._oneof_case_[0]), @@ -1290,8 +1300,8 @@ static const ::_pbi::MigrationSchema {359, sizeof(::modlock::wasm::ui::Region)}, {370, sizeof(::modlock::wasm::ui::Screen)}, {375, sizeof(::modlock::wasm::ui::UiPressEvent)}, - {382, sizeof(::modlock::wasm::ui::UiInputEvent)}, - {401, sizeof(::modlock::wasm::ui::UiRequest)}, + {386, sizeof(::modlock::wasm::ui::UiInputEvent)}, + {405, sizeof(::modlock::wasm::ui::UiRequest)}, }; static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { &::modlock::wasm::ui::_Node_VariablesEntry_DoNotUse_default_instance_._instance, @@ -1432,64 +1442,65 @@ const char descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwa ".Region\022\r\n\005addon\030\004 \001(\t\022\022\n\ngeneration\030\005 \001" "(\004\"B\n\006Region\022\014\n\004left\030\001 \001(\002\022\013\n\003top\030\002 \001(\002\022" "\r\n\005width\030\003 \001(\002\022\016\n\006height\030\004 \001(\002\".\n\006Screen" - "\022$\n\005trees\030\001 \003(\0132\025.modlock.wasm.ui.Tree\"," + "\022$\n\005trees\030\001 \003(\0132\025.modlock.wasm.ui.Tree\"M" "\n\014UiPressEvent\022\016\n\006player\030\001 \001(\005\022\014\n\004node\030\002" - " \001(\t\"\240\001\n\014UiInputEvent\022\016\n\006player\030\001 \001(\005\022\014\n" - "\004node\030\002 \001(\t\022\016\n\004text\030\003 \001(\tH\000\022\020\n\006number\030\004 " - "\001(\002H\000\022\014\n\002on\030\005 \001(\010H\000\022\020\n\006choice\030\006 \001(\rH\000\022\'\n" - "\005wheel\030\007 \001(\0132\026.modlock.wasm.ui.WheelH\000B\007" - "\n\005value\"D\n\tUiRequest\022\016\n\006player\030\001 \001(\005\022\'\n\006" - "change\030\002 \001(\0132\027.modlock.wasm.ui.Change*\230\001" - "\n\007Scaling\022\023\n\017SCALING_DEFAULT\020\000\022\017\n\013SCALIN" - "G_FIT\020\001\022\021\n\rSCALING_COVER\020\002\022\023\n\017SCALING_ST" - "RETCH\020\003\022\025\n\021SCALING_FIT_WIDTH\020\004\022\026\n\022SCALIN" - "G_FIT_HEIGHT\020\005\022\020\n\014SCALING_NONE\020\006*\215\001\n\010Her" - "oLook\022\023\n\017HERO_LOOK_SMALL\020\000\022\022\n\016HERO_LOOK_" - "CARD\020\001\022\022\n\016HERO_LOOK_ICON\020\002\022\026\n\022HERO_LOOK_" - "VERTICAL\020\003\022\025\n\021HERO_LOOK_TOP_BAR\020\004\022\025\n\021HER" - "O_LOOK_MINIMAP\020\005*\256\002\n\007HudPart\022\024\n\020HUD_PART" - "_UNKNOWN\020\000\022\025\n\021HUD_PART_LEVEL_UP\020\001\022\027\n\023HUD" - "_PART_OWN_HEALTH\020\002\022\024\n\020HUD_PART_TOP_BAR\020\003" - "\022\021\n\rHUD_PART_AMMO\020\004\022\022\n\016HUD_PART_SOULS\020\005\022" - "\024\n\020HUD_PART_MINIMAP\020\006\022\026\n\022HUD_PART_ABILIT" - "IES\020\007\022\023\n\017HUD_PART_STATUS\020\010\022\022\n\016HUD_PART_S" - "TATS\020\t\022\030\n\024HUD_PART_HERO_PICKER\020\n\022\035\n\031HUD_" - "PART_BROKER_COUNTDOWN\020\013\022\020\n\014HUD_PART_ALL\020" - "\014*\236\001\n\004Kind\022\016\n\nKIND_PANEL\020\000\022\016\n\nKIND_LABEL" - "\020\001\022\016\n\nKIND_IMAGE\020\002\022\017\n\013KIND_BUTTON\020\003\022\017\n\013K" - "IND_LAYOUT\020\004\022\016\n\nKIND_ROUTE\020\005\022\023\n\017KIND_HER" - "O_IMAGE\020\006\022\016\n\nKIND_INPUT\020\007\022\017\n\013KIND_AVATAR" - "\020\010*p\n\010Overflow\022\024\n\020OVERFLOW_DEFAULT\020\000\022\023\n\017" - "OVERFLOW_SQUISH\020\001\022\021\n\rOVERFLOW_CLIP\020\002\022\023\n\017" - "OVERFLOW_SCROLL\020\003\022\021\n\rOVERFLOW_SHOW\020\004*\215\001\n" - "\rGradientShape\022\027\n\023GRADIENT_SHAPE_DOWN\020\000\022" - "\030\n\024GRADIENT_SHAPE_RIGHT\020\001\022\025\n\021GRADIENT_SH" - "APE_UP\020\002\022\027\n\023GRADIENT_SHAPE_LEFT\020\003\022\031\n\025GRA" - "DIENT_SHAPE_RADIAL\020\004*\236\001\n\006Weight\022\022\n\016WEIGH" - "T_DEFAULT\020\000\022\017\n\013WEIGHT_THIN\020\001\022\020\n\014WEIGHT_L" - "IGHT\020\002\022\021\n\rWEIGHT_NORMAL\020\003\022\021\n\rWEIGHT_MEDI" - "UM\020\004\022\024\n\020WEIGHT_SEMI_BOLD\020\005\022\017\n\013WEIGHT_BOL" - "D\020\006\022\020\n\014WEIGHT_BLACK\020\007*w\n\014TextOverflow\022\031\n" - "\025TEXT_OVERFLOW_DEFAULT\020\000\022\032\n\026TEXT_OVERFLO" - "W_ELLIPSIS\020\001\022\030\n\024TEXT_OVERFLOW_SHRINK\020\002\022\026" - "\n\022TEXT_OVERFLOW_CLIP\020\003*R\n\nDecoration\022\023\n\017" - "DECORATION_NONE\020\000\022\030\n\024DECORATION_UNDERLIN" - "E\020\001\022\025\n\021DECORATION_STRIKE\020\002*\\\n\006Easing\022\023\n\017" - "EASING_EASE_OUT\020\000\022\022\n\016EASING_EASE_IN\020\001\022\026\n" - "\022EASING_EASE_IN_OUT\020\002\022\021\n\rEASING_LINEAR\020\003" - "*G\n\004Face\022\020\n\014FACE_DEFAULT\020\000\022\r\n\tFACE_BODY\020" - "\001\022\016\n\nFACE_BLOCK\020\002\022\016\n\nFACE_SERIF\020\003*]\n\004Flo" - "w\022\r\n\tFLOW_NONE\020\000\022\r\n\tFLOW_DOWN\020\001\022\016\n\nFLOW_" - "RIGHT\020\002\022\022\n\016FLOW_DOWN_WRAP\020\003\022\023\n\017FLOW_RIGH" - "T_WRAP\020\004*9\n\005Align\022\017\n\013ALIGN_START\020\000\022\020\n\014AL" - "IGN_CENTER\020\001\022\r\n\tALIGN_END\020\002B+Z)github.co" - "m/paralin/modlock/src/wasm/ui;uib\006proto3" + " \001(\t\022\016\n\006action\030\003 \001(\t\022\017\n\007payload\030\004 \001(\t\"\240\001" + "\n\014UiInputEvent\022\016\n\006player\030\001 \001(\005\022\014\n\004node\030\002" + " \001(\t\022\016\n\004text\030\003 \001(\tH\000\022\020\n\006number\030\004 \001(\002H\000\022\014" + "\n\002on\030\005 \001(\010H\000\022\020\n\006choice\030\006 \001(\rH\000\022\'\n\005wheel\030" + "\007 \001(\0132\026.modlock.wasm.ui.WheelH\000B\007\n\005value" + "\"D\n\tUiRequest\022\016\n\006player\030\001 \001(\005\022\'\n\006change\030" + "\002 \001(\0132\027.modlock.wasm.ui.Change*\230\001\n\007Scali" + "ng\022\023\n\017SCALING_DEFAULT\020\000\022\017\n\013SCALING_FIT\020\001" + "\022\021\n\rSCALING_COVER\020\002\022\023\n\017SCALING_STRETCH\020\003" + "\022\025\n\021SCALING_FIT_WIDTH\020\004\022\026\n\022SCALING_FIT_H" + "EIGHT\020\005\022\020\n\014SCALING_NONE\020\006*\215\001\n\010HeroLook\022\023" + "\n\017HERO_LOOK_SMALL\020\000\022\022\n\016HERO_LOOK_CARD\020\001\022" + "\022\n\016HERO_LOOK_ICON\020\002\022\026\n\022HERO_LOOK_VERTICA" + "L\020\003\022\025\n\021HERO_LOOK_TOP_BAR\020\004\022\025\n\021HERO_LOOK_" + "MINIMAP\020\005*\256\002\n\007HudPart\022\024\n\020HUD_PART_UNKNOW" + "N\020\000\022\025\n\021HUD_PART_LEVEL_UP\020\001\022\027\n\023HUD_PART_O" + "WN_HEALTH\020\002\022\024\n\020HUD_PART_TOP_BAR\020\003\022\021\n\rHUD" + "_PART_AMMO\020\004\022\022\n\016HUD_PART_SOULS\020\005\022\024\n\020HUD_" + "PART_MINIMAP\020\006\022\026\n\022HUD_PART_ABILITIES\020\007\022\023" + "\n\017HUD_PART_STATUS\020\010\022\022\n\016HUD_PART_STATS\020\t\022" + "\030\n\024HUD_PART_HERO_PICKER\020\n\022\035\n\031HUD_PART_BR" + "OKER_COUNTDOWN\020\013\022\020\n\014HUD_PART_ALL\020\014*\236\001\n\004K" + "ind\022\016\n\nKIND_PANEL\020\000\022\016\n\nKIND_LABEL\020\001\022\016\n\nK" + "IND_IMAGE\020\002\022\017\n\013KIND_BUTTON\020\003\022\017\n\013KIND_LAY" + "OUT\020\004\022\016\n\nKIND_ROUTE\020\005\022\023\n\017KIND_HERO_IMAGE" + "\020\006\022\016\n\nKIND_INPUT\020\007\022\017\n\013KIND_AVATAR\020\010*p\n\010O" + "verflow\022\024\n\020OVERFLOW_DEFAULT\020\000\022\023\n\017OVERFLO" + "W_SQUISH\020\001\022\021\n\rOVERFLOW_CLIP\020\002\022\023\n\017OVERFLO" + "W_SCROLL\020\003\022\021\n\rOVERFLOW_SHOW\020\004*\215\001\n\rGradie" + "ntShape\022\027\n\023GRADIENT_SHAPE_DOWN\020\000\022\030\n\024GRAD" + "IENT_SHAPE_RIGHT\020\001\022\025\n\021GRADIENT_SHAPE_UP\020" + "\002\022\027\n\023GRADIENT_SHAPE_LEFT\020\003\022\031\n\025GRADIENT_S" + "HAPE_RADIAL\020\004*\236\001\n\006Weight\022\022\n\016WEIGHT_DEFAU" + "LT\020\000\022\017\n\013WEIGHT_THIN\020\001\022\020\n\014WEIGHT_LIGHT\020\002\022" + "\021\n\rWEIGHT_NORMAL\020\003\022\021\n\rWEIGHT_MEDIUM\020\004\022\024\n" + "\020WEIGHT_SEMI_BOLD\020\005\022\017\n\013WEIGHT_BOLD\020\006\022\020\n\014" + "WEIGHT_BLACK\020\007*w\n\014TextOverflow\022\031\n\025TEXT_O" + "VERFLOW_DEFAULT\020\000\022\032\n\026TEXT_OVERFLOW_ELLIP" + "SIS\020\001\022\030\n\024TEXT_OVERFLOW_SHRINK\020\002\022\026\n\022TEXT_" + "OVERFLOW_CLIP\020\003*R\n\nDecoration\022\023\n\017DECORAT" + "ION_NONE\020\000\022\030\n\024DECORATION_UNDERLINE\020\001\022\025\n\021" + "DECORATION_STRIKE\020\002*\\\n\006Easing\022\023\n\017EASING_" + "EASE_OUT\020\000\022\022\n\016EASING_EASE_IN\020\001\022\026\n\022EASING" + "_EASE_IN_OUT\020\002\022\021\n\rEASING_LINEAR\020\003*G\n\004Fac" + "e\022\020\n\014FACE_DEFAULT\020\000\022\r\n\tFACE_BODY\020\001\022\016\n\nFA" + "CE_BLOCK\020\002\022\016\n\nFACE_SERIF\020\003*]\n\004Flow\022\r\n\tFL" + "OW_NONE\020\000\022\r\n\tFLOW_DOWN\020\001\022\016\n\nFLOW_RIGHT\020\002" + "\022\022\n\016FLOW_DOWN_WRAP\020\003\022\023\n\017FLOW_RIGHT_WRAP\020" + "\004*9\n\005Align\022\017\n\013ALIGN_START\020\000\022\020\n\014ALIGN_CEN" + "TER\020\001\022\r\n\tALIGN_END\020\002B+Z)github.com/paral" + "in/modlock/src/wasm/ui;uib\006proto3" }; static ::absl::once_flag descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fui_2fui_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fui_2fui_2eproto = { false, false, - 6440, + 6473, descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fui_2fui_2eproto, "github.com/paralin/modlock/src/wasm/ui/ui.proto", &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fui_2fui_2eproto_once, @@ -11986,7 +11997,9 @@ PROTOBUF_NDEBUG_INLINE UiPressEvent::Impl_::Impl_( [[maybe_unused]] const ::modlock::wasm::ui::UiPressEvent& from_msg) : _has_bits_{from._has_bits_}, _cached_size_{0}, - node_(arena, from.node_) {} + node_(arena, from.node_), + action_(arena, from.action_), + payload_(arena, from.payload_) {} UiPressEvent::UiPressEvent( ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, @@ -12009,7 +12022,9 @@ PROTOBUF_NDEBUG_INLINE UiPressEvent::Impl_::Impl_( [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) : _cached_size_{0}, - node_(arena) {} + node_(arena), + action_(arena), + payload_(arena) {} inline void UiPressEvent::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { new (&_impl_) Impl_(internal_visibility(), arena); @@ -12027,6 +12042,8 @@ inline void UiPressEvent::SharedDtor(MessageLite& self) { this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); ABSL_DCHECK(this_.GetArena() == nullptr); this_._impl_.node_.Destroy(); + this_._impl_.action_.Destroy(); + this_._impl_.payload_.Destroy(); this_._impl_.~Impl_(); } @@ -12073,16 +12090,16 @@ UiPressEvent::GetClassData() const { return UiPressEvent_class_data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 0, 41, 2> +const ::_pbi::TcParseTable<2, 4, 0, 54, 2> UiPressEvent::_table_ = { { PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_._has_bits_), 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask + 4, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap + 4294967280, // skipmap offsetof(decltype(_table_), field_entries), - 2, // num_field_entries + 4, // num_field_entries 0, // num_aux_entries offsetof(decltype(_table_), field_names), // no aux_entries UiPressEvent_class_data_.base(), @@ -12092,27 +12109,41 @@ UiPressEvent::_table_ = { ::_pbi::TcParser::GetTable<::modlock::wasm::ui::UiPressEvent>(), // to_prefetch #endif // PROTOBUF_PREFETCH_PARSE_TABLE }, {{ + // string payload = 4; + {::_pbi::TcParser::FastUS1, + {34, 2, 0, + PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_.payload_)}}, + // int32 player = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UiPressEvent, _impl_.player_), 3>(), + {8, 3, 0, + PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_.player_)}}, // string node = 2; {::_pbi::TcParser::FastUS1, {18, 0, 0, PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_.node_)}}, - // int32 player = 1; - {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(UiPressEvent, _impl_.player_), 1>(), - {8, 1, 0, - PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_.player_)}}, + // string action = 3; + {::_pbi::TcParser::FastUS1, + {26, 1, 0, + PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_.action_)}}, }}, {{ 65535, 65535 }}, {{ // int32 player = 1; - {PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_.player_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + {PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_.player_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, // string node = 2; {PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_.node_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string action = 3; + {PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_.action_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string payload = 4; + {PROTOBUF_FIELD_OFFSET(UiPressEvent, _impl_.payload_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, }}, // no aux_entries {{ - "\34\0\4\0\0\0\0\0" + "\34\0\4\6\7\0\0\0" "modlock.wasm.ui.UiPressEvent" "node" + "action" + "payload" }}, }; PROTOBUF_NOINLINE void UiPressEvent::Clear() { @@ -12123,8 +12154,16 @@ PROTOBUF_NOINLINE void UiPressEvent::Clear() { (void) cached_has_bits; cached_has_bits = _impl_._has_bits_[0]; - if (CheckHasBit(cached_has_bits, 0x00000001U)) { - _impl_.node_.ClearNonDefaultToEmpty(); + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.node_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.action_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + _impl_.payload_.ClearNonDefaultToEmpty(); + } } _impl_.player_ = 0; _impl_._has_bits_.Clear(); @@ -12151,7 +12190,7 @@ ::uint8_t* PROTOBUF_NONNULL UiPressEvent::_InternalSerialize( cached_has_bits = this_._impl_._has_bits_[0]; // int32 player = 1; - if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (CheckHasBit(cached_has_bits, 0x00000008U)) { if (this_._internal_player() != 0) { target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<1>( @@ -12169,6 +12208,26 @@ ::uint8_t* PROTOBUF_NONNULL UiPressEvent::_InternalSerialize( } } + // string action = 3; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_action().empty()) { + const ::std::string& _s = this_._internal_action(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.ui.UiPressEvent.action"); + target = stream->WriteStringMaybeAliased(3, _s, target); + } + } + + // string payload = 4; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_payload().empty()) { + const ::std::string& _s = this_._internal_payload(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.ui.UiPressEvent.payload"); + target = stream->WriteStringMaybeAliased(4, _s, target); + } + } + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -12194,7 +12253,7 @@ ::size_t UiPressEvent::ByteSizeLong() const { ::_pbi::Prefetch5LinesFrom7Lines(&this_); cached_has_bits = this_._impl_._has_bits_[0]; - if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { // string node = 2; if (CheckHasBit(cached_has_bits, 0x00000001U)) { if (!this_._internal_node().empty()) { @@ -12202,8 +12261,22 @@ ::size_t UiPressEvent::ByteSizeLong() const { this_._internal_node()); } } - // int32 player = 1; + // string action = 3; if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_action().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_action()); + } + } + // string payload = 4; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_payload().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_payload()); + } + } + // int32 player = 1; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { if (this_._internal_player() != 0) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( this_._internal_player()); @@ -12228,7 +12301,7 @@ void UiPressEvent::MergeImpl(::google::protobuf::MessageLite& to_msg, (void)cached_has_bits; cached_has_bits = from._impl_._has_bits_[0]; - if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { if (CheckHasBit(cached_has_bits, 0x00000001U)) { if (!from._internal_node().empty()) { _this->_internal_set_node(from._internal_node()); @@ -12239,6 +12312,24 @@ void UiPressEvent::MergeImpl(::google::protobuf::MessageLite& to_msg, } } if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_action().empty()) { + _this->_internal_set_action(from._internal_action()); + } else { + if (_this->_impl_.action_.IsDefault()) { + _this->_internal_set_action(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!from._internal_payload().empty()) { + _this->_internal_set_payload(from._internal_payload()); + } else { + if (_this->_impl_.payload_.IsDefault()) { + _this->_internal_set_payload(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { if (from._internal_player() != 0) { _this->_impl_.player_ = from._impl_.player_; } @@ -12264,6 +12355,8 @@ void UiPressEvent::InternalSwap(UiPressEvent* PROTOBUF_RESTRICT PROTOBUF_NONNULL _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.node_, &other->_impl_.node_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.action_, &other->_impl_.action_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.payload_, &other->_impl_.payload_, arena); swap(_impl_.player_, other->_impl_.player_); } diff --git a/src/wasm/ui/ui.pb.go b/src/wasm/ui/ui.pb.go index 37772a27..d4743f06 100644 --- a/src/wasm/ui/ui.pb.go +++ b/src/wasm/ui/ui.pb.go @@ -236,8 +236,8 @@ const ( // button takes clicks only while the player has a cursor. Kind_KIND_BUTTON Kind = 3 // KIND_LAYOUT loads the node's layout from the mod's content addon, whose - // script runs in the player's game and talks to the mod through its own - // console commands. Only a host that has reviewed the mod's content loads + // script runs in the player's game and sends presses back to the mod, as + // UiPressEvent's action and payload, or its own console commands. Only a host that has reviewed the mod's content loads // it; Modlock's renderer draws an empty panel. Kind_KIND_LAYOUT Kind = 4 // KIND_ROUTE draws nothing: it hands its data to every layout of the mod @@ -2482,13 +2482,21 @@ func (x *Screen) GetTrees() []*Tree { return nil } -// UiPressEvent reports a press on a button in a player's interface. +// UiPressEvent reports a press on a button in a player's interface, or a +// press a layout's script sent with an action and a payload. type UiPressEvent struct { unknownFields []byte // Player is the player who pressed. Player int32 `protobuf:"varint,1,opt,name=player,proto3" json:"player,omitempty"` - // Node is the id of the pressed button. + // Node is the id of the pressed button, or of the layout whose script + // sent the press. Node string `protobuf:"bytes,2,opt,name=node,proto3" json:"node,omitempty"` + // Action names a layout's press, as its script sent it: one to 64 + // letters, digits, '_', '-' and '.'. It is empty for a button's press. + Action string `protobuf:"bytes,3,opt,name=action,proto3" json:"action,omitempty"` + // Payload is the text a layout's press carries, which the layout library + // writes as JSON: valid UTF-8 of at most 180 bytes. + Payload string `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` } func (x *UiPressEvent) Reset() { @@ -2511,6 +2519,20 @@ func (x *UiPressEvent) GetNode() string { return "" } +func (x *UiPressEvent) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +func (x *UiPressEvent) GetPayload() string { + if x != nil { + return x.Payload + } + return "" +} + // UiInputEvent reports a change the player made to an input in their // interface, with the value as the host checked it. type UiInputEvent struct { @@ -3276,6 +3298,8 @@ func (m *UiPressEvent) CloneVT() *UiPressEvent { r := new(UiPressEvent) r.Player = m.Player r.Node = m.Node + r.Action = m.Action + r.Payload = m.Payload if len(m.unknownFields) > 0 { r.unknownFields = slices.Clone(m.unknownFields) } @@ -4362,6 +4386,12 @@ func (this *UiPressEvent) EqualVT(that *UiPressEvent) bool { if this.Node != that.Node { return false } + if this.Action != that.Action { + return false + } + if this.Payload != that.Payload { + return false + } return string(this.unknownFields) == string(that.unknownFields) } @@ -7424,6 +7454,16 @@ func (x *UiPressEvent) MarshalProtoJSON(s *json.MarshalState) { s.WriteObjectField("node") s.WriteString(x.Node) } + if x.Action != "" || s.HasField("action") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("action") + s.WriteString(x.Action) + } + if x.Payload != "" || s.HasField("payload") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("payload") + s.WriteString(x.Payload) + } s.WriteObjectEnd() } @@ -7447,6 +7487,12 @@ func (x *UiPressEvent) UnmarshalProtoJSON(s *json.UnmarshalState) { case "node": s.AddField("node") x.Node = s.ReadString() + case "action": + s.AddField("action") + x.Action = s.ReadString() + case "payload": + s.AddField("payload") + x.Payload = s.ReadString() } }) } @@ -9525,6 +9571,16 @@ func (m *UiPressEvent) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m.unknownFields != nil { i = protobuf_go_lite.EncodeRawBytes(dAtA, i, m.unknownFields) } + if len(m.Payload) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Payload) + i-- + dAtA[i] = 0x22 + } + if len(m.Action) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Action) + i-- + dAtA[i] = 0x1a + } if len(m.Node) > 0 { i = protobuf_go_lite.EncodeString(dAtA, i, m.Node) i-- @@ -10282,6 +10338,8 @@ func (m *UiPressEvent) SizeVT() (n int) { _ = l n += protobuf_go_lite.SizeVarintNonZero(1, m.Player) n += protobuf_go_lite.SizeStringNonEmpty(1, m.Node) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Action) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Payload) n += len(m.unknownFields) return n } @@ -11379,6 +11437,14 @@ func (x *UiPressEvent) MarshalProtoText() string { protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "node") protobuf_go_lite.TextWriteString(&sb, x.Node) } + if x.Action != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "action") + protobuf_go_lite.TextWriteString(&sb, x.Action) + } + if x.Payload != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "payload") + protobuf_go_lite.TextWriteString(&sb, x.Payload) + } return protobuf_go_lite.TextFinishMessage(&sb) } @@ -14277,6 +14343,26 @@ func (m *UiPressEvent) UnmarshalVT(dAtA []byte) error { return err } m.Node = v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Action = v + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Payload = v default: iNdEx = preIndex skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:]) diff --git a/src/wasm/ui/ui.pb.h b/src/wasm/ui/ui.pb.h index 5f08b38c..bc72ebdb 100644 --- a/src/wasm/ui/ui.pb.h +++ b/src/wasm/ui/ui.pb.h @@ -1111,6 +1111,8 @@ class MODLOCK_API UiPressEvent final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { kNodeFieldNumber = 2, + kActionFieldNumber = 3, + kPayloadFieldNumber = 4, kPlayerFieldNumber = 1, }; // string node = 2; @@ -1127,6 +1129,36 @@ class MODLOCK_API UiPressEvent final : public ::google::protobuf::Message PROTOBUF_ALWAYS_INLINE void _internal_set_node(const ::std::string& value); ::std::string* PROTOBUF_NONNULL _internal_mutable_node(); + public: + // string action = 3; + void clear_action() ; + const ::std::string& action() const; + template + void set_action(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_action(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_action(); + void set_allocated_action(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_action() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_action(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_action(); + + public: + // string payload = 4; + void clear_payload() ; + const ::std::string& payload() const; + template + void set_payload(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_payload(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_payload(); + void set_allocated_payload(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_payload() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_payload(); + public: // int32 player = 1; void clear_player() ; @@ -1142,8 +1174,8 @@ class MODLOCK_API UiPressEvent final : public ::google::protobuf::Message private: class _Internal; friend class ::google::protobuf::internal::TcParser; - static const ::google::protobuf::internal::TcParseTable<1, 2, - 0, 41, + static const ::google::protobuf::internal::TcParseTable<2, 4, + 0, 54, 2> _table_; @@ -1165,6 +1197,8 @@ class MODLOCK_API UiPressEvent final : public ::google::protobuf::Message ::google::protobuf::internal::HasBits<1> _has_bits_; ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::internal::ArenaStringPtr node_; + ::google::protobuf::internal::ArenaStringPtr action_; + ::google::protobuf::internal::ArenaStringPtr payload_; ::int32_t player_; PROTOBUF_TSAN_DECLARE_MEMBER }; @@ -14732,7 +14766,7 @@ inline void UiPressEvent::clear_player() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.player_ = 0; ClearHasBit(_impl_._has_bits_[0], - 0x00000002U); + 0x00000008U); } inline ::int32_t UiPressEvent::player() const { // @@protoc_insertion_point(field_get:modlock.wasm.ui.UiPressEvent.player) @@ -14740,7 +14774,7 @@ inline ::int32_t UiPressEvent::player() const { } inline void UiPressEvent::set_player(::int32_t value) { _internal_set_player(value); - SetHasBit(_impl_._has_bits_[0], 0x00000002U); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); // @@protoc_insertion_point(field_set:modlock.wasm.ui.UiPressEvent.player) } inline ::int32_t UiPressEvent::_internal_player() const { @@ -14817,6 +14851,136 @@ inline void UiPressEvent::set_allocated_node(::std::string* PROTOBUF_NULLABLE va // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ui.UiPressEvent.node) } +// string action = 3; +inline void UiPressEvent::clear_action() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.action_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& UiPressEvent::action() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.ui.UiPressEvent.action) + return _internal_action(); +} +template +PROTOBUF_ALWAYS_INLINE void UiPressEvent::set_action(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.action_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.ui.UiPressEvent.action) +} +inline ::std::string* PROTOBUF_NONNULL UiPressEvent::mutable_action() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_action(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.ui.UiPressEvent.action) + return _s; +} +inline const ::std::string& UiPressEvent::_internal_action() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.action_.Get(); +} +inline void UiPressEvent::_internal_set_action(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.action_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL UiPressEvent::_internal_mutable_action() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.action_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE UiPressEvent::release_action() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.ui.UiPressEvent.action) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.action_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.action_.Set("", GetArena()); + } + return released; +} +inline void UiPressEvent::set_allocated_action(::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_.action_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.action_.IsDefault()) { + _impl_.action_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ui.UiPressEvent.action) +} + +// string payload = 4; +inline void UiPressEvent::clear_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.payload_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); +} +inline const ::std::string& UiPressEvent::payload() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.ui.UiPressEvent.payload) + return _internal_payload(); +} +template +PROTOBUF_ALWAYS_INLINE void UiPressEvent::set_payload(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.payload_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.ui.UiPressEvent.payload) +} +inline ::std::string* PROTOBUF_NONNULL UiPressEvent::mutable_payload() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_payload(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.ui.UiPressEvent.payload) + return _s; +} +inline const ::std::string& UiPressEvent::_internal_payload() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.payload_.Get(); +} +inline void UiPressEvent::_internal_set_payload(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.payload_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL UiPressEvent::_internal_mutable_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.payload_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE UiPressEvent::release_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.ui.UiPressEvent.payload) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.payload_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.payload_.Set("", GetArena()); + } + return released; +} +inline void UiPressEvent::set_allocated_payload(::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_.payload_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { + _impl_.payload_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ui.UiPressEvent.payload) +} + // ------------------------------------------------------------------- // UiInputEvent diff --git a/src/wasm/ui/ui.pb.ts b/src/wasm/ui/ui.pb.ts index 7660c8f1..92e0467e 100644 --- a/src/wasm/ui/ui.pb.ts +++ b/src/wasm/ui/ui.pb.ts @@ -252,8 +252,8 @@ export enum Kind { /** * KIND_LAYOUT loads the node's layout from the mod's content addon, whose - * script runs in the player's game and talks to the mod through its own - * console commands. Only a host that has reviewed the mod's content loads + * script runs in the player's game and sends presses back to the mod, as + * UiPressEvent's action and payload, or its own console commands. Only a host that has reviewed the mod's content loads * it; Modlock's renderer draws an empty panel. */ LAYOUT = 4, @@ -3238,7 +3238,8 @@ export const Screen: MessageType = ) /** - * UiPressEvent reports a press on a button in a player's interface. + * UiPressEvent reports a press on a button in a player's interface, or a + * press a layout's script sent with an action and a payload. * * @generated from message modlock.wasm.ui.UiPressEvent */ @@ -3248,9 +3249,20 @@ export interface UiPressEvent { */ player?: number /** - * Node is the id of the pressed button. + * Node is the id of the pressed button, or of the layout whose script + * sent the press. */ node?: string + /** + * Action names a layout's press, as its script sent it: one to 64 + * letters, digits, '_', '-' and '.'. It is empty for a button's press. + */ + action?: string + /** + * Payload is the text a layout's press carries, which the layout library + * writes as JSON: valid UTF-8 of at most 180 bytes. + */ + payload?: string } export const UiPressEvent: MessageType = @@ -3259,6 +3271,8 @@ export const UiPressEvent: MessageType = () => [ [1, 'player', 5], [2, 'node', 9], + [3, 'action', 9], + [4, 'payload', 9], ], { decode: (r: BinaryReader, end: number, m: UiPressEvent): UiPressEvent => { @@ -3272,6 +3286,12 @@ export const UiPressEvent: MessageType = case 2: m.node = r.string() break + case 3: + m.action = r.string() + break + case 4: + m.payload = r.string() + break default: r.skip(t) } @@ -3287,6 +3307,14 @@ export const UiPressEvent: MessageType = const v = m.node if (v) w.uint32(18).string(v) } + { + const v = m.action + if (v) w.uint32(26).string(v) + } + { + const v = m.payload + if (v) w.uint32(34).string(v) + } }, }, ) diff --git a/src/wasm/ui/ui.proto b/src/wasm/ui/ui.proto index 13a7b5ac..ebc474c9 100644 --- a/src/wasm/ui/ui.proto +++ b/src/wasm/ui/ui.proto @@ -367,8 +367,8 @@ enum Kind { KIND_BUTTON = 3; // KIND_LAYOUT loads the node's layout from the mod's content addon, whose - // script runs in the player's game and talks to the mod through its own - // console commands. Only a host that has reviewed the mod's content loads + // script runs in the player's game and sends presses back to the mod, as + // UiPressEvent's action and payload, or its own console commands. Only a host that has reviewed the mod's content loads // it; Modlock's renderer draws an empty panel. KIND_LAYOUT = 4; @@ -895,13 +895,23 @@ message Screen { repeated Tree trees = 1; } -// UiPressEvent reports a press on a button in a player's interface. +// UiPressEvent reports a press on a button in a player's interface, or a +// press a layout's script sent with an action and a payload. message UiPressEvent { // Player is the player who pressed. int32 player = 1; - // Node is the id of the pressed button. + // Node is the id of the pressed button, or of the layout whose script + // sent the press. string node = 2; + + // Action names a layout's press, as its script sent it: one to 64 + // letters, digits, '_', '-' and '.'. It is empty for a button's press. + string action = 3; + + // Payload is the text a layout's press carries, which the layout library + // writes as JSON: valid UTF-8 of at most 180 bytes. + string payload = 4; } // UiInputEvent reports a change the player made to an input in their diff --git a/src/wasm/wasm.pb.cc b/src/wasm/wasm.pb.cc index 51327801..0060be2e 100644 --- a/src/wasm/wasm.pb.cc +++ b/src/wasm/wasm.pb.cc @@ -56,6 +56,40 @@ struct WorldEventDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WorldEventDefaultTypeInternal _WorldEvent_default_instance_; +inline constexpr StartServiceCallRequest::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + service_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + method_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + payload_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + timeout_milliseconds_{0u} {} + +template +PROTOBUF_CONSTEXPR StartServiceCallRequest::StartServiceCallRequest(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(StartServiceCallRequest_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct StartServiceCallRequestDefaultTypeInternal { + PROTOBUF_CONSTEXPR StartServiceCallRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~StartServiceCallRequestDefaultTypeInternal() {} + union { + StartServiceCallRequest _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StartServiceCallRequestDefaultTypeInternal _StartServiceCallRequest_default_instance_; + inline constexpr StartResult::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : _cached_size_{0}, @@ -148,6 +182,63 @@ struct ServiceReplyDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ServiceReplyDefaultTypeInternal _ServiceReply_default_instance_; +inline constexpr ServiceRepliedEvent::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + payload_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + error_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + call_{::uint64_t{0u}}, + failure_{static_cast< ::modlock::wasm::ServiceFailure >(0)} {} + +template +PROTOBUF_CONSTEXPR ServiceRepliedEvent::ServiceRepliedEvent(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(ServiceRepliedEvent_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct ServiceRepliedEventDefaultTypeInternal { + PROTOBUF_CONSTEXPR ServiceRepliedEventDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ServiceRepliedEventDefaultTypeInternal() {} + union { + ServiceRepliedEvent _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ServiceRepliedEventDefaultTypeInternal _ServiceRepliedEvent_default_instance_; + +inline constexpr ServiceCallStarted::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + call_{::uint64_t{0u}} {} + +template +PROTOBUF_CONSTEXPR ServiceCallStarted::ServiceCallStarted(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(ServiceCallStarted_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(::_pbi::ConstantInitialized()) { +} +struct ServiceCallStartedDefaultTypeInternal { + PROTOBUF_CONSTEXPR ServiceCallStartedDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~ServiceCallStartedDefaultTypeInternal() {} + union { + ServiceCallStarted _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ServiceCallStartedDefaultTypeInternal _ServiceCallStarted_default_instance_; + inline constexpr ServiceCall::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : _cached_size_{0}, @@ -452,8 +543,8 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MODLOCK_API PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FrameEventDefaultTypeInternal _FrameEvent_default_instance_; } // namespace wasm } // namespace modlock -static constexpr const ::_pb::EnumDescriptor* PROTOBUF_NONNULL* PROTOBUF_NULLABLE - file_level_enum_descriptors_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto = nullptr; +static const ::_pb::EnumDescriptor* PROTOBUF_NONNULL + file_level_enum_descriptors_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto[1]; static constexpr const ::_pb::ServiceDescriptor* PROTOBUF_NONNULL* PROTOBUF_NULLABLE file_level_service_descriptors_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto = nullptr; const ::uint32_t @@ -564,6 +655,33 @@ const ::uint32_t PROTOBUF_FIELD_OFFSET(::modlock::wasm::ServiceReply, _impl_.payload_), 0, 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::StartServiceCallRequest, _impl_._has_bits_), + 7, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::StartServiceCallRequest, _impl_.service_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::StartServiceCallRequest, _impl_.method_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::StartServiceCallRequest, _impl_.payload_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::StartServiceCallRequest, _impl_.timeout_milliseconds_), + 0, + 1, + 2, + 3, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::ServiceCallStarted, _impl_._has_bits_), + 4, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::ServiceCallStarted, _impl_.call_), + 0, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::modlock::wasm::ServiceRepliedEvent, _impl_._has_bits_), + 7, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::modlock::wasm::ServiceRepliedEvent, _impl_.call_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::ServiceRepliedEvent, _impl_.payload_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::ServiceRepliedEvent, _impl_.failure_), + PROTOBUF_FIELD_OFFSET(::modlock::wasm::ServiceRepliedEvent, _impl_.error_), + 2, + 0, + 3, + 1, + 0x081, // bitmap PROTOBUF_FIELD_OFFSET(::modlock::wasm::LogRequest, _impl_._has_bits_), 4, // hasbit index offset PROTOBUF_FIELD_OFFSET(::modlock::wasm::LogRequest, _impl_.message_), @@ -596,9 +714,12 @@ static const ::_pbi::MigrationSchema {85, sizeof(::modlock::wasm::WorldEvent)}, {90, sizeof(::modlock::wasm::ServiceCall)}, {99, sizeof(::modlock::wasm::ServiceReply)}, - {104, sizeof(::modlock::wasm::LogRequest)}, - {109, sizeof(::modlock::wasm::ServerCommandRequest)}, - {114, sizeof(::modlock::wasm::PrecacheOptions)}, + {104, sizeof(::modlock::wasm::StartServiceCallRequest)}, + {115, sizeof(::modlock::wasm::ServiceCallStarted)}, + {120, sizeof(::modlock::wasm::ServiceRepliedEvent)}, + {131, sizeof(::modlock::wasm::LogRequest)}, + {136, sizeof(::modlock::wasm::ServerCommandRequest)}, + {141, sizeof(::modlock::wasm::PrecacheOptions)}, }; static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { &::modlock::wasm::_Call_default_instance_._instance, @@ -613,6 +734,9 @@ static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { &::modlock::wasm::_WorldEvent_default_instance_._instance, &::modlock::wasm::_ServiceCall_default_instance_._instance, &::modlock::wasm::_ServiceReply_default_instance_._instance, + &::modlock::wasm::_StartServiceCallRequest_default_instance_._instance, + &::modlock::wasm::_ServiceCallStarted_default_instance_._instance, + &::modlock::wasm::_ServiceRepliedEvent_default_instance_._instance, &::modlock::wasm::_LogRequest_default_instance_._instance, &::modlock::wasm::_ServerCommandRequest_default_instance_._instance, &::modlock::wasm::_PrecacheOptions_default_instance_._instance, @@ -663,312 +787,326 @@ const char descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwa "d\030\001 \001(\010\"\031\n\nWorldEvent\022\013\n\003map\030\001 \001(\t\"\?\n\013Se" "rviceCall\022\017\n\007service\030\001 \001(\t\022\016\n\006method\030\002 \001" "(\t\022\017\n\007payload\030\003 \001(\014\"\037\n\014ServiceReply\022\017\n\007p" - "ayload\030\001 \001(\014\"\035\n\nLogRequest\022\017\n\007message\030\001 " - "\001(\t\"\'\n\024ServerCommandRequest\022\017\n\007command\030\001" - " \001(\t\"4\n\017PrecacheOptions\022\016\n\006heroes\030\001 \003(\t\022" - "\021\n\tresources\030\002 \003(\t2\305O\n\004Host\0224\n\003Log\022\030.mod" - "lock.wasm.LogRequest\032\023.modlock.wasm.Empt" - "y\022H\n\rServerCommand\022\".modlock.wasm.Server" - "CommandRequest\032\023.modlock.wasm.Empty\022>\n\004C" - "hat\022!.modlock.wasm.effects.ChatRequest\032\023" - ".modlock.wasm.Empty\022J\n\nCenterText\022\'.modl" - "ock.wasm.effects.CenterTextRequest\032\023.mod" - "lock.wasm.Empty\022F\n\010Announce\022%.modlock.wa" - "sm.effects.AnnounceRequest\032\023.modlock.was" - "m.Empty\022>\n\010Precache\022\035.modlock.wasm.Preca" - "cheOptions\032\023.modlock.wasm.Empty\022E\n\007Playe" - "rs\022\023.modlock.wasm.Empty\032%.modlock.wasm.p" - "layers.PlayersResponse\022O\n\004Pawn\022#.modlock" - ".wasm.players.PlayerRequest\032\".modlock.wa" - "sm.players.PawnResponse\022d\n\rPlayerSetting" - "\022+.modlock.wasm.settings.PlayerSettingRe" - "quest\032&.modlock.wasm.settings.SettingRes" - "ponse\022W\n\020SetPlayerSetting\022..modlock.wasm" - ".settings.SetPlayerSettingRequest\032\023.modl" - "ock.wasm.Empty\022H\n\tAddMetric\022&.modlock.wa" - "sm.metrics.AddMetricRequest\032\023.modlock.wa" - "sm.Empty\022I\n\010ReadFile\022\035.modlock.wasm.Read" - "FileRequest\032\036.modlock.wasm.ReadFileRespo" - "nse\022@\n\tWriteFile\022\036.modlock.wasm.WriteFil" - "eRequest\032\023.modlock.wasm.Empty\022L\n\nHoldRel" - "oad\022).modlock.wasm.abilities.HoldReloadR" - "equest\032\023.modlock.wasm.Empty\022<\n\007Handoff\022\034" - ".modlock.wasm.HandoffRequest\032\023.modlock.w" - "asm.Empty\022A\n\tHandedOff\022\023.modlock.wasm.Em" - "pty\032\037.modlock.wasm.HandedOffResponse\022H\n\r" - "PlayerHandoff\022\".modlock.wasm.HandoffPlay" - "erRequest\032\023.modlock.wasm.Empty\022W\n\017Player" - "HandedOff\022#.modlock.wasm.players.PlayerR" - "equest\032\037.modlock.wasm.HandedOffResponse\022" - "Y\n\nSelectHero\022\'.modlock.wasm.players.Sel" - "ectHeroRequest\032\".modlock.wasm.players.He" - "roResponse\022D\n\010Spectate\022#.modlock.wasm.pl" - "ayers.PlayerRequest\032\023.modlock.wasm.Empty" - "\022@\n\005Watch\022\".modlock.wasm.players.WatchRe" - "quest\032\023.modlock.wasm.Empty\022J\n\nFreeCamera" - "\022\'.modlock.wasm.players.FreeCameraReques" - "t\032\023.modlock.wasm.Empty\022F\n\nMoveCamera\022#.m" - "odlock.wasm.players.CameraOptions\032\023.modl" - "ock.wasm.Empty\022L\n\013ClearCamera\022(.modlock." - "wasm.players.ClearCameraRequest\032\023.modloc" - "k.wasm.Empty\022C\n\007Unwatch\022#.modlock.wasm.p" + "ayload\030\001 \001(\014\"i\n\027StartServiceCallRequest\022" + "\017\n\007service\030\001 \001(\t\022\016\n\006method\030\002 \001(\t\022\017\n\007payl" + "oad\030\003 \001(\014\022\034\n\024timeout_milliseconds\030\004 \001(\r\"" + "\"\n\022ServiceCallStarted\022\014\n\004call\030\001 \001(\004\"r\n\023S" + "erviceRepliedEvent\022\014\n\004call\030\001 \001(\004\022\017\n\007payl" + "oad\030\002 \001(\014\022-\n\007failure\030\003 \001(\0162\034.modlock.was" + "m.ServiceFailure\022\r\n\005error\030\004 \001(\t\"\035\n\nLogRe" + "quest\022\017\n\007message\030\001 \001(\t\"\'\n\024ServerCommandR" + "equest\022\017\n\007command\030\001 \001(\t\"4\n\017PrecacheOptio" + "ns\022\016\n\006heroes\030\001 \003(\t\022\021\n\tresources\030\002 \003(\t*\205\001" + "\n\016ServiceFailure\022\030\n\024SERVICE_FAILURE_NONE" + "\020\000\022\033\n\027SERVICE_FAILURE_REFUSED\020\001\022\033\n\027SERVI" + "CE_FAILURE_TIMEOUT\020\002\022\037\n\033SERVICE_FAILURE_" + "UNAVAILABLE\020\0032\242P\n\004Host\0224\n\003Log\022\030.modlock." + "wasm.LogRequest\032\023.modlock.wasm.Empty\022H\n\r" + "ServerCommand\022\".modlock.wasm.ServerComma" + "ndRequest\032\023.modlock.wasm.Empty\022>\n\004Chat\022!" + ".modlock.wasm.effects.ChatRequest\032\023.modl" + "ock.wasm.Empty\022J\n\nCenterText\022\'.modlock.w" + "asm.effects.CenterTextRequest\032\023.modlock." + "wasm.Empty\022F\n\010Announce\022%.modlock.wasm.ef" + "fects.AnnounceRequest\032\023.modlock.wasm.Emp" + "ty\022>\n\010Precache\022\035.modlock.wasm.PrecacheOp" + "tions\032\023.modlock.wasm.Empty\022E\n\007Players\022\023." + "modlock.wasm.Empty\032%.modlock.wasm.player" + "s.PlayersResponse\022O\n\004Pawn\022#.modlock.wasm" + ".players.PlayerRequest\032\".modlock.wasm.pl" + "ayers.PawnResponse\022d\n\rPlayerSetting\022+.mo" + "dlock.wasm.settings.PlayerSettingRequest" + "\032&.modlock.wasm.settings.SettingResponse" + "\022W\n\020SetPlayerSetting\022..modlock.wasm.sett" + "ings.SetPlayerSettingRequest\032\023.modlock.w" + "asm.Empty\022H\n\tAddMetric\022&.modlock.wasm.me" + "trics.AddMetricRequest\032\023.modlock.wasm.Em" + "pty\022I\n\010ReadFile\022\035.modlock.wasm.ReadFileR" + "equest\032\036.modlock.wasm.ReadFileResponse\022@" + "\n\tWriteFile\022\036.modlock.wasm.WriteFileRequ" + "est\032\023.modlock.wasm.Empty\022L\n\nHoldReload\022)" + ".modlock.wasm.abilities.HoldReloadReques" + "t\032\023.modlock.wasm.Empty\022<\n\007Handoff\022\034.modl" + "ock.wasm.HandoffRequest\032\023.modlock.wasm.E" + "mpty\022A\n\tHandedOff\022\023.modlock.wasm.Empty\032\037" + ".modlock.wasm.HandedOffResponse\022H\n\rPlaye" + "rHandoff\022\".modlock.wasm.HandoffPlayerReq" + "uest\032\023.modlock.wasm.Empty\022W\n\017PlayerHande" + "dOff\022#.modlock.wasm.players.PlayerReques" + "t\032\037.modlock.wasm.HandedOffResponse\022Y\n\nSe" + "lectHero\022\'.modlock.wasm.players.SelectHe" + "roRequest\032\".modlock.wasm.players.HeroRes" + "ponse\022D\n\010Spectate\022#.modlock.wasm.players" + ".PlayerRequest\032\023.modlock.wasm.Empty\022@\n\005W" + "atch\022\".modlock.wasm.players.WatchRequest" + "\032\023.modlock.wasm.Empty\022J\n\nFreeCamera\022\'.mo" + "dlock.wasm.players.FreeCameraRequest\032\023.m" + "odlock.wasm.Empty\022F\n\nMoveCamera\022#.modloc" + "k.wasm.players.CameraOptions\032\023.modlock.w" + "asm.Empty\022L\n\013ClearCamera\022(.modlock.wasm." + "players.ClearCameraRequest\032\023.modlock.was" + "m.Empty\022C\n\007Unwatch\022#.modlock.wasm.player" + "s.PlayerRequest\032\023.modlock.wasm.Empty\022C\n\007" + "Respawn\022#.modlock.wasm.players.PlayerReq" + "uest\032\023.modlock.wasm.Empty\022J\n\nChangeTeam\022" + "\'.modlock.wasm.players.ChangeTeamRequest" + "\032\023.modlock.wasm.Empty\022F\n\nClearItems\022#.mo" + "dlock.wasm.players.PlayerRequest\032\023.modlo" + "ck.wasm.Empty\022B\n\006Freeze\022#.modlock.wasm.p" + "layers.FreezeRequest\032\023.modlock.wasm.Empt" + "y\022J\n\016RestoreStamina\022#.modlock.wasm.playe" + "rs.PlayerRequest\032\023.modlock.wasm.Empty\022J\n" + "\nSetStamina\022\'.modlock.wasm.players.SetSt" + "aminaRequest\032\023.modlock.wasm.Empty\022T\n\016Ref" + "reshAbility\022-.modlock.wasm.abilities.Ref" + "reshAbilityRequest\032\023.modlock.wasm.Empty\022" + "[\n\tAbilities\022#.modlock.wasm.players.Play" + "erRequest\032).modlock.wasm.abilities.Abili" + "tiesResponse\022I\n\nSetAbility\022&.modlock.was" + "m.abilities.AbilityOptions\032\023.modlock.was" + "m.Empty\022H\n\010GiveItem\022\'.modlock.wasm.abili" + "ties.GiveItemRequest\032\023.modlock.wasm.Empt" + "y\022F\n\007BuyItem\022&.modlock.wasm.abilities.Bu" + "yItemRequest\032\023.modlock.wasm.Empty\022P\n\014Tra" + "inAbility\022+.modlock.wasm.abilities.Train" + "AbilityRequest\032\023.modlock.wasm.Empty\022`\n\tH" + "eroBuild\022(.modlock.wasm.abilities.HeroBu" + "ildRequest\032).modlock.wasm.abilities.Hero" + "BuildResponse\022T\n\016ReplaceAbility\022-.modloc" + "k.wasm.abilities.ReplaceAbilityRequest\032\023" + ".modlock.wasm.Empty\022P\n\014HoldModifier\022+.mo" + "dlock.wasm.abilities.HoldModifierRequest" + "\032\023.modlock.wasm.Empty\022P\n\014GiveModifier\022+." + "modlock.wasm.abilities.GiveModifierReque" + "st\032\023.modlock.wasm.Empty\022G\n\010Teleport\022&.mo" + "dlock.wasm.movement.TeleportRequest\032\023.mo" + "dlock.wasm.Empty\022E\n\007Zipline\022%.modlock.wa" + "sm.movement.ZiplineRequest\032\023.modlock.was" + "m.Empty\022K\n\nMovePlayer\022(.modlock.wasm.mov" + "ement.MovePlayerRequest\032\023.modlock.wasm.E" + "mpty\022A\n\005Steer\022#.modlock.wasm.movement.St" + "eerRequest\032\023.modlock.wasm.Empty\022A\n\005Drive" + "\022#.modlock.wasm.movement.DriveRequest\032\023." + "modlock.wasm.Empty\022L\n\013AdjustSouls\022(.modl" + "ock.wasm.players.AdjustSoulsRequest\032\023.mo" + "dlock.wasm.Empty\022\\\n\023AdjustAbilityPoints\022" + "0.modlock.wasm.players.AdjustAbilityPoin" + "tsRequest\032\023.modlock.wasm.Empty\022P\n\rStarti" + "ngSouls\022*.modlock.wasm.players.StartingS" + "oulsRequest\032\023.modlock.wasm.Empty\022H\n\tRese" + "tHero\022&.modlock.wasm.players.ResetHeroRe" + "quest\032\023.modlock.wasm.Empty\022>\n\004Heal\022!.mod" + "lock.wasm.players.HealRequest\032\023.modlock." + "wasm.Empty\022P\n\005Sound\022\".modlock.wasm.effec" + "ts.SoundRequest\032#.modlock.wasm.effects.S" + "oundResponse\022L\n\013RestoreHero\022(.modlock.wa" + "sm.players.RestoreHeroRequest\032\023.modlock." + "wasm.Empty\022N\n\014ScreenEffect\022).modlock.was" + "m.effects.ScreenEffectRequest\032\023.modlock." + "wasm.Empty\022X\n\021ClearScreenEffect\022..modloc" + "k.wasm.effects.ClearScreenEffectRequest\032" + "\023.modlock.wasm.Empty\022N\n\014SilenceVoice\022).m" + "odlock.wasm.effects.SilenceVoiceRequest\032" + "\023.modlock.wasm.Empty\022Z\n\022SilencePlayerVoi" + "ce\022/.modlock.wasm.effects.SilencePlayerV" + "oiceRequest\032\023.modlock.wasm.Empty\022V\n\tRead" + "Field\022%.modlock.wasm.fields.ReadFieldReq" + "uest\032\".modlock.wasm.fields.FieldResponse" + "\022f\n\021ReadModifierField\022-.modlock.wasm.fie" + "lds.ReadModifierFieldRequest\032\".modlock.w" + "asm.fields.FieldResponse\022I\n\nWriteField\022&" + ".modlock.wasm.fields.WriteFieldRequest\032\023" + ".modlock.wasm.Empty\022^\n\rReadFieldList\022%.m" + "odlock.wasm.fields.ReadFieldRequest\032&.mo" + "dlock.wasm.fields.FieldListResponse\022Q\n\016W" + "riteFieldList\022*.modlock.wasm.fields.Writ" + "eFieldListRequest\032\023.modlock.wasm.Empty\022_" + "\n\013EntityClass\022$.modlock.wasm.entities.En" + "tityRequest\032*.modlock.wasm.entities.Enti" + "tyClassResponse\022]\n\nEntityName\022$.modlock." + "wasm.entities.EntityRequest\032).modlock.wa" + "sm.entities.EntityNameResponse\022e\n\016Entity" + "Position\022$.modlock.wasm.entities.EntityR" + "equest\032-.modlock.wasm.entities.EntityPos" + "itionResponse\022e\n\rModifierState\022,.modlock" + ".wasm.abilities.ModifierStateRequest\032&.m" + "odlock.wasm.abilities.ActiveResponse\022\\\n\t" + "Modifiers\022$.modlock.wasm.entities.Entity" + "Request\032).modlock.wasm.abilities.Modifie" + "rsResponse\022Z\n\021HoldModifierState\0220.modloc" + "k.wasm.abilities.HoldModifierStateReques" + "t\032\023.modlock.wasm.Empty\022H\n\rSetFreeForAll\022" + "\".modlock.wasm.SetFreeForAllRequest\032\023.mo" + "dlock.wasm.Empty\022J\n\016SetTeamSeating\022#.mod" + "lock.wasm.SetTeamSeatingRequest\032\023.modloc" + "k.wasm.Empty\022W\n\013CreateModel\022\".modlock.wa" + "sm.objects.ModelOptions\032$.modlock.wasm.o" + "bjects.ObjectResponse\022U\n\nCreateText\022!.mo" + "dlock.wasm.objects.TextOptions\032$.modlock" + ".wasm.objects.ObjectResponse\022]\n\016CreatePa" + "rticle\022%.modlock.wasm.objects.ParticleOp" + "tions\032$.modlock.wasm.objects.ObjectRespo" + "nse\022S\n\tCreateFog\022 .modlock.wasm.objects." + "FogOptions\032$.modlock.wasm.objects.Object" + "Response\022J\n\nMoveObject\022\'.modlock.wasm.ob" + "jects.MoveObjectRequest\032\023.modlock.wasm.E" + "mpty\022D\n\007SetText\022$.modlock.wasm.objects.S" + "etTextRequest\032\023.modlock.wasm.Empty\022T\n\017Se" + "tObjectHidden\022,.modlock.wasm.objects.Set" + "ObjectHiddenRequest\032\023.modlock.wasm.Empty" + "\022V\n\020ShowObjectOnlyTo\022-.modlock.wasm.obje" + "cts.ShowObjectOnlyToRequest\032\023.modlock.wa" + "sm.Empty\022K\n\017ShowObjectToAll\022#.modlock.wa" + "sm.objects.ObjectRequest\032\023.modlock.wasm." + "Empty\022H\n\014RemoveObject\022#.modlock.wasm.obj" + "ects.ObjectRequest\032\023.modlock.wasm.Empty\022" + "Z\n\014ObjectEntity\022#.modlock.wasm.objects.O" + "bjectRequest\032%.modlock.wasm.entities.Ent" + "ityResponse\022M\n\006AddBot\022 .modlock.wasm.pla" + "yers.BotOptions\032!.modlock.wasm.players.B" + "otResponse\022E\n\tRemoveBot\022#.modlock.wasm.p" "layers.PlayerRequest\032\023.modlock.wasm.Empt" - "y\022C\n\007Respawn\022#.modlock.wasm.players.Play" - "erRequest\032\023.modlock.wasm.Empty\022J\n\nChange" - "Team\022\'.modlock.wasm.players.ChangeTeamRe" - "quest\032\023.modlock.wasm.Empty\022F\n\nClearItems" - "\022#.modlock.wasm.players.PlayerRequest\032\023." - "modlock.wasm.Empty\022B\n\006Freeze\022#.modlock.w" - "asm.players.FreezeRequest\032\023.modlock.wasm" - ".Empty\022J\n\016RestoreStamina\022#.modlock.wasm." - "players.PlayerRequest\032\023.modlock.wasm.Emp" - "ty\022J\n\nSetStamina\022\'.modlock.wasm.players." - "SetStaminaRequest\032\023.modlock.wasm.Empty\022T" - "\n\016RefreshAbility\022-.modlock.wasm.abilitie" - "s.RefreshAbilityRequest\032\023.modlock.wasm.E" - "mpty\022[\n\tAbilities\022#.modlock.wasm.players" - ".PlayerRequest\032).modlock.wasm.abilities." - "AbilitiesResponse\022I\n\nSetAbility\022&.modloc" - "k.wasm.abilities.AbilityOptions\032\023.modloc" - "k.wasm.Empty\022H\n\010GiveItem\022\'.modlock.wasm." - "abilities.GiveItemRequest\032\023.modlock.wasm" - ".Empty\022F\n\007BuyItem\022&.modlock.wasm.abiliti" - "es.BuyItemRequest\032\023.modlock.wasm.Empty\022P" - "\n\014TrainAbility\022+.modlock.wasm.abilities." - "TrainAbilityRequest\032\023.modlock.wasm.Empty" - "\022`\n\tHeroBuild\022(.modlock.wasm.abilities.H" - "eroBuildRequest\032).modlock.wasm.abilities" - ".HeroBuildResponse\022T\n\016ReplaceAbility\022-.m" - "odlock.wasm.abilities.ReplaceAbilityRequ" - "est\032\023.modlock.wasm.Empty\022P\n\014HoldModifier" - "\022+.modlock.wasm.abilities.HoldModifierRe" - "quest\032\023.modlock.wasm.Empty\022P\n\014GiveModifi" - "er\022+.modlock.wasm.abilities.GiveModifier" - "Request\032\023.modlock.wasm.Empty\022G\n\010Teleport" - "\022&.modlock.wasm.movement.TeleportRequest" - "\032\023.modlock.wasm.Empty\022E\n\007Zipline\022%.modlo" - "ck.wasm.movement.ZiplineRequest\032\023.modloc" - "k.wasm.Empty\022K\n\nMovePlayer\022(.modlock.was" - "m.movement.MovePlayerRequest\032\023.modlock.w" - "asm.Empty\022A\n\005Steer\022#.modlock.wasm.moveme" - "nt.SteerRequest\032\023.modlock.wasm.Empty\022A\n\005" - "Drive\022#.modlock.wasm.movement.DriveReque" - "st\032\023.modlock.wasm.Empty\022L\n\013AdjustSouls\022(" - ".modlock.wasm.players.AdjustSoulsRequest" - "\032\023.modlock.wasm.Empty\022\\\n\023AdjustAbilityPo" - "ints\0220.modlock.wasm.players.AdjustAbilit" - "yPointsRequest\032\023.modlock.wasm.Empty\022P\n\rS" - "tartingSouls\022*.modlock.wasm.players.Star" - "tingSoulsRequest\032\023.modlock.wasm.Empty\022H\n" - "\tResetHero\022&.modlock.wasm.players.ResetH" - "eroRequest\032\023.modlock.wasm.Empty\022>\n\004Heal\022" - "!.modlock.wasm.players.HealRequest\032\023.mod" - "lock.wasm.Empty\022P\n\005Sound\022\".modlock.wasm." - "effects.SoundRequest\032#.modlock.wasm.effe" - "cts.SoundResponse\022L\n\013RestoreHero\022(.modlo" - "ck.wasm.players.RestoreHeroRequest\032\023.mod" - "lock.wasm.Empty\022N\n\014ScreenEffect\022).modloc" - "k.wasm.effects.ScreenEffectRequest\032\023.mod" - "lock.wasm.Empty\022X\n\021ClearScreenEffect\022..m" - "odlock.wasm.effects.ClearScreenEffectReq" - "uest\032\023.modlock.wasm.Empty\022N\n\014SilenceVoic" - "e\022).modlock.wasm.effects.SilenceVoiceReq" - "uest\032\023.modlock.wasm.Empty\022Z\n\022SilencePlay" - "erVoice\022/.modlock.wasm.effects.SilencePl" - "ayerVoiceRequest\032\023.modlock.wasm.Empty\022V\n" - "\tReadField\022%.modlock.wasm.fields.ReadFie" - "ldRequest\032\".modlock.wasm.fields.FieldRes" - "ponse\022f\n\021ReadModifierField\022-.modlock.was" - "m.fields.ReadModifierFieldRequest\032\".modl" - "ock.wasm.fields.FieldResponse\022I\n\nWriteFi" - "eld\022&.modlock.wasm.fields.WriteFieldRequ" - "est\032\023.modlock.wasm.Empty\022^\n\rReadFieldLis" - "t\022%.modlock.wasm.fields.ReadFieldRequest" - "\032&.modlock.wasm.fields.FieldListResponse" - "\022Q\n\016WriteFieldList\022*.modlock.wasm.fields" - ".WriteFieldListRequest\032\023.modlock.wasm.Em" - "pty\022_\n\013EntityClass\022$.modlock.wasm.entiti" - "es.EntityRequest\032*.modlock.wasm.entities" - ".EntityClassResponse\022]\n\nEntityName\022$.mod" - "lock.wasm.entities.EntityRequest\032).modlo" - "ck.wasm.entities.EntityNameResponse\022e\n\016E" - "ntityPosition\022$.modlock.wasm.entities.En" - "tityRequest\032-.modlock.wasm.entities.Enti" - "tyPositionResponse\022e\n\rModifierState\022,.mo" - "dlock.wasm.abilities.ModifierStateReques" - "t\032&.modlock.wasm.abilities.ActiveRespons" - "e\022\\\n\tModifiers\022$.modlock.wasm.entities.E" - "ntityRequest\032).modlock.wasm.abilities.Mo" - "difiersResponse\022Z\n\021HoldModifierState\0220.m" - "odlock.wasm.abilities.HoldModifierStateR" - "equest\032\023.modlock.wasm.Empty\022H\n\rSetFreeFo" - "rAll\022\".modlock.wasm.SetFreeForAllRequest" - "\032\023.modlock.wasm.Empty\022J\n\016SetTeamSeating\022" - "#.modlock.wasm.SetTeamSeatingRequest\032\023.m" - "odlock.wasm.Empty\022W\n\013CreateModel\022\".modlo" - "ck.wasm.objects.ModelOptions\032$.modlock.w" - "asm.objects.ObjectResponse\022U\n\nCreateText" - "\022!.modlock.wasm.objects.TextOptions\032$.mo" - "dlock.wasm.objects.ObjectResponse\022]\n\016Cre" - "ateParticle\022%.modlock.wasm.objects.Parti" - "cleOptions\032$.modlock.wasm.objects.Object" - "Response\022S\n\tCreateFog\022 .modlock.wasm.obj" - "ects.FogOptions\032$.modlock.wasm.objects.O" - "bjectResponse\022J\n\nMoveObject\022\'.modlock.wa" - "sm.objects.MoveObjectRequest\032\023.modlock.w" - "asm.Empty\022D\n\007SetText\022$.modlock.wasm.obje" - "cts.SetTextRequest\032\023.modlock.wasm.Empty\022" - "T\n\017SetObjectHidden\022,.modlock.wasm.object" - "s.SetObjectHiddenRequest\032\023.modlock.wasm." - "Empty\022V\n\020ShowObjectOnlyTo\022-.modlock.wasm" - ".objects.ShowObjectOnlyToRequest\032\023.modlo" - "ck.wasm.Empty\022K\n\017ShowObjectToAll\022#.modlo" - "ck.wasm.objects.ObjectRequest\032\023.modlock." - "wasm.Empty\022H\n\014RemoveObject\022#.modlock.was" - "m.objects.ObjectRequest\032\023.modlock.wasm.E" - "mpty\022Z\n\014ObjectEntity\022#.modlock.wasm.obje" - "cts.ObjectRequest\032%.modlock.wasm.entitie" - "s.EntityResponse\022M\n\006AddBot\022 .modlock.was" - "m.players.BotOptions\032!.modlock.wasm.play" - "ers.BotResponse\022E\n\tRemoveBot\022#.modlock.w" - "asm.players.PlayerRequest\032\023.modlock.wasm" - ".Empty\022=\n\nBlockInput\022\032.modlock.wasm.Inpu" - "tRequest\032\023.modlock.wasm.Empty\022I\n\020BlockPl" - "ayerInput\022 .modlock.wasm.PlayerInputRequ" - "est\032\023.modlock.wasm.Empty\022>\n\005Press\022 .modl" - "ock.wasm.PlayerInputRequest\032\023.modlock.wa" - "sm.Empty\022=\n\nWatchInput\022\032.modlock.wasm.In" - "putRequest\032\023.modlock.wasm.Empty\022B\n\nRemap" - "Input\022\037.modlock.wasm.RemapInputRequest\032\023" - ".modlock.wasm.Empty\0225\n\002Ui\022\032.modlock.wasm" - ".ui.UiRequest\032\023.modlock.wasm.Empty\022D\n\013Ca" - "llService\022\031.modlock.wasm.ServiceCall\032\032.m" - "odlock.wasm.ServiceReply\022[\n\014CreateEntity" - "\022$.modlock.wasm.entities.EntityOptions\032%" - ".modlock.wasm.entities.EntityResponse\022Z\n" - "\tFireInput\022\'.modlock.wasm.entities.FireI" - "nputRequest\032$.modlock.wasm.entities.Aliv" - "eResponse\022Z\n\014RemoveEntity\022$.modlock.wasm" - ".entities.EntityRequest\032$.modlock.wasm.e" - "ntities.AliveResponse\022W\n\020ShowEntityOnlyT" - "o\022..modlock.wasm.entities.ShowEntityOnly" - "ToRequest\032\023.modlock.wasm.Empty\022L\n\017ShowEn" - "tityToAll\022$.modlock.wasm.entities.Entity" - "Request\032\023.modlock.wasm.Empty\022I\n\010SpawnNpc" - "\022\035.modlock.wasm.npcs.NpcOptions\032\036.modloc" - "k.wasm.npcs.NpcResponse\022M\n\007ReadNpc\022\035.mod" - "lock.wasm.npcs.NpcRequest\032#.modlock.wasm" - ".npcs.NpcStateResponse\022R\n\007MoveNpc\022!.modl" - "ock.wasm.npcs.MoveNpcRequest\032$.modlock.w" - "asm.entities.AliveResponse\022\\\n\014SetNpcHeal" - "th\022&.modlock.wasm.npcs.SetNpcHealthReque" - "st\032$.modlock.wasm.entities.AliveResponse" - "\022P\n\tRemoveNpc\022\035.modlock.wasm.npcs.NpcReq" + "y\022=\n\nBlockInput\022\032.modlock.wasm.InputRequ" + "est\032\023.modlock.wasm.Empty\022I\n\020BlockPlayerI" + "nput\022 .modlock.wasm.PlayerInputRequest\032\023" + ".modlock.wasm.Empty\022>\n\005Press\022 .modlock.w" + "asm.PlayerInputRequest\032\023.modlock.wasm.Em" + "pty\022=\n\nWatchInput\022\032.modlock.wasm.InputRe" + "quest\032\023.modlock.wasm.Empty\022B\n\nRemapInput" + "\022\037.modlock.wasm.RemapInputRequest\032\023.modl" + "ock.wasm.Empty\0225\n\002Ui\022\032.modlock.wasm.ui.U" + "iRequest\032\023.modlock.wasm.Empty\022D\n\013CallSer" + "vice\022\031.modlock.wasm.ServiceCall\032\032.modloc" + "k.wasm.ServiceReply\022[\n\020StartServiceCall\022" + "%.modlock.wasm.StartServiceCallRequest\032 " + ".modlock.wasm.ServiceCallStarted\022[\n\014Crea" + "teEntity\022$.modlock.wasm.entities.EntityO" + "ptions\032%.modlock.wasm.entities.EntityRes" + "ponse\022Z\n\tFireInput\022\'.modlock.wasm.entiti" + "es.FireInputRequest\032$.modlock.wasm.entit" + "ies.AliveResponse\022Z\n\014RemoveEntity\022$.modl" + "ock.wasm.entities.EntityRequest\032$.modloc" + "k.wasm.entities.AliveResponse\022W\n\020ShowEnt" + "ityOnlyTo\022..modlock.wasm.entities.ShowEn" + "tityOnlyToRequest\032\023.modlock.wasm.Empty\022L" + "\n\017ShowEntityToAll\022$.modlock.wasm.entitie" + "s.EntityRequest\032\023.modlock.wasm.Empty\022I\n\010" + "SpawnNpc\022\035.modlock.wasm.npcs.NpcOptions\032" + "\036.modlock.wasm.npcs.NpcResponse\022M\n\007ReadN" + "pc\022\035.modlock.wasm.npcs.NpcRequest\032#.modl" + "ock.wasm.npcs.NpcStateResponse\022R\n\007MoveNp" + "c\022!.modlock.wasm.npcs.MoveNpcRequest\032$.m" + "odlock.wasm.entities.AliveResponse\022\\\n\014Se" + "tNpcHealth\022&.modlock.wasm.npcs.SetNpcHea" + "lthRequest\032$.modlock.wasm.entities.Alive" + "Response\022P\n\tRemoveNpc\022\035.modlock.wasm.npc" + "s.NpcRequest\032$.modlock.wasm.entities.Ali" + "veResponse\022a\n\014CreatePickup\022*.modlock.was" + "m.entities.CreatePickupRequest\032%.modlock" + ".wasm.entities.PickupResponse\022[\n\rPickupP" + "resent\022$.modlock.wasm.entities.PickupReq" "uest\032$.modlock.wasm.entities.AliveRespon" - "se\022a\n\014CreatePickup\022*.modlock.wasm.entiti" - "es.CreatePickupRequest\032%.modlock.wasm.en" - "tities.PickupResponse\022[\n\rPickupPresent\022$" - ".modlock.wasm.entities.PickupRequest\032$.m" - "odlock.wasm.entities.AliveResponse\022Z\n\014Re" - "movePickup\022$.modlock.wasm.entities.Picku" - "pRequest\032$.modlock.wasm.entities.AliveRe" - "sponse\022c\n\014FindEntities\022*.modlock.wasm.en" - "tities.FindEntitiesRequest\032\'.modlock.was" - "m.entities.EntitiesResponse\022o\n\022FindEntit" - "iesByName\0220.modlock.wasm.entities.FindEn" - "titiesByNameRequest\032\'.modlock.wasm.entit" - "ies.EntitiesResponse\022d\n\016RemoveEntities\022," - ".modlock.wasm.entities.RemoveEntitiesReq" - "uest\032$.modlock.wasm.entities.CountRespon" - "se\0224\n\010ClearMap\022\023.modlock.wasm.Empty\032\023.mo" - "dlock.wasm.Empty\022>\n\006Damage\022\037.modlock.was" - "m.combat.HitOptions\032\023.modlock.wasm.Empty" - "\022C\n\nKillEntity\022 .modlock.wasm.combat.Kil" - "lOptions\032\023.modlock.wasm.Empty\022N\n\005Trace\022!" - ".modlock.wasm.combat.TraceOptions\032\".modl" - "ock.wasm.combat.TraceResponse\022I\n\013Restore" - "Npcs\022%.modlock.wasm.npcs.RestoreNpcsRequ" - "est\032\023.modlock.wasm.Empty\0228\n\005Pause\022\032.modl" - "ock.wasm.PauseRequest\032\023.modlock.wasm.Emp" - "ty\022C\n\nMatchClock\022\023.modlock.wasm.Empty\032 ." - "modlock.wasm.MatchClockResponse\022J\n\016HoldM" - "atchClock\022#.modlock.wasm.HoldMatchClockR" - "equest\032\023.modlock.wasm.Empty\0227\n\004Rift\022\023.mo" - "dlock.wasm.Empty\032\032.modlock.wasm.RiftResp" - "onse\022@\n\tStartRift\022\036.modlock.wasm.StartRi" - "ftRequest\032\023.modlock.wasm.Empty\022K\n\nMoveEn" - "tity\022(.modlock.wasm.entities.MoveEntityR" - "equest\032\023.modlock.wasm.Empty\022K\n\nPushEntit" - "y\022(.modlock.wasm.entities.PushEntityRequ" - "est\032\023.modlock.wasm.Empty\022X\n\tEmitSound\022&." - "modlock.wasm.effects.EmitSoundRequest\032#." - "modlock.wasm.effects.SoundResponse\022L\n\013Ad" - "justSound\022(.modlock.wasm.effects.AdjustS" - "oundRequest\032\023.modlock.wasm.Empty\022H\n\tStop" - "Sound\022&.modlock.wasm.effects.StopSoundRe" - "quest\032\023.modlock.wasm.Empty\022@\n\004Kill\022#.mod" - "lock.wasm.players.PlayerRequest\032\023.modloc" - "k.wasm.Empty\022M\n\013SetVelocity\022).modlock.wa" - "sm.movement.SetVelocityRequest\032\023.modlock" - ".wasm.Empty\022M\n\007Buttons\022#.modlock.wasm.pl" - "ayers.PlayerRequest\032\035.modlock.wasm.Butto" - "nsResponse\022Q\n\rWatchMovement\022+.modlock.wa" - "sm.movement.WatchMovementRequest\032\023.modlo" - "ck.wasm.Empty\022O\n\020WatchProjectiles\022&.modl" - "ock.wasm.combat.ProjectileOptions\032\023.modl" - "ock.wasm.Empty\022\\\n\022HoldEntityModifier\0221.m" - "odlock.wasm.abilities.HoldEntityModifier" - "Request\032\023.modlock.wasm.Empty\022\\\n\022GiveEnti" - "tyModifier\0221.modlock.wasm.abilities.Give" - "EntityModifierRequest\032\023.modlock.wasm.Emp" - "ty2\251\016\n\003Mod\022<\n\005Start\022\030.modlock.wasm.Start" - "Event\032\031.modlock.wasm.StartResult\0226\n\005Fram" - "e\022\030.modlock.wasm.FrameEvent\032\023.modlock.wa" - "sm.Empty\022B\n\007Command\022\032.modlock.wasm.Comma" - "ndEvent\032\033.modlock.wasm.CommandResult\0224\n\004" - "Chat\022\027.modlock.wasm.ChatEvent\032\023.modlock." - "wasm.Empty\0226\n\005World\022\030.modlock.wasm.World" - "Event\032\023.modlock.wasm.Empty\022=\n\007UiPress\022\035." - "modlock.wasm.ui.UiPressEvent\032\023.modlock.w" - "asm.Empty\022=\n\007UiInput\022\035.modlock.wasm.ui.U" - "iInputEvent\032\023.modlock.wasm.Empty\022>\n\005Serv" - "e\022\031.modlock.wasm.ServiceCall\032\032.modlock.w" - "asm.ServiceReply\022M\n\006Damage\022 .modlock.was" - "m.combat.DamageEvent\032!.modlock.wasm.comb" - "at.DamageResult\022A\n\007Damaged\022!.modlock.was" - "m.combat.DamagedEvent\032\023.modlock.wasm.Emp" - "ty\022=\n\006Killed\022\036.modlock.wasm.combat.KillE" - "vent\032\023.modlock.wasm.Empty\022L\n\013AbilityCast" - "\022(.modlock.wasm.abilities.AbilityCastEve" - "nt\032\023.modlock.wasm.Empty\022M\n\rModifierFired" - "\022\'.modlock.wasm.combat.ModifierFiredEven" - "t\032\023.modlock.wasm.Empty\022=\n\006Healed\022\036.modlo" - "ck.wasm.combat.HealEvent\032\023.modlock.wasm." - "Empty\022D\n\014LevelChanged\022\037.modlock.wasm.com" - "bat.LevelEvent\032\023.modlock.wasm.Empty\022=\n\005M" - "elee\022\037.modlock.wasm.combat.MeleeEvent\032\023." - "modlock.wasm.Empty\022\?\n\007Parried\022\037.modlock." - "wasm.combat.ParryEvent\032\023.modlock.wasm.Em" - "pty\0226\n\005Input\022\030.modlock.wasm.InputEvent\032\023" - ".modlock.wasm.Empty\022D\n\010Restored\022#.modloc" - "k.wasm.players.RestoredEvent\032\023.modlock.w" - "asm.Empty\022I\n\014NpcsRestored\022$.modlock.wasm" - ".npcs.NpcsRestoredEvent\032\023.modlock.wasm.E" - "mpty\022\?\n\006Launch\022 .modlock.wasm.combat.Lau" - "nchEvent\032\023.modlock.wasm.Empty\022\?\n\006Impact\022" - " .modlock.wasm.combat.ImpactEvent\032\023.modl" - "ock.wasm.Empty\022A\n\006Landed\022\".modlock.wasm." - "movement.LandedEvent\032\023.modlock.wasm.Empt" - "y\022Q\n\016SettingChanged\022*.modlock.wasm.setti" - "ngs.SettingChangedEvent\032\023.modlock.wasm.E" - "mpty\022L\n\014PlayerJoined\022\'.modlock.wasm.play" - "ers.PlayerJoinedEvent\032\023.modlock.wasm.Emp" - "ty\022H\n\nPlayerLeft\022%.modlock.wasm.players." - "PlayerLeftEvent\032\023.modlock.wasm.Empty\022P\n\016" - "PlayersChanged\022).modlock.wasm.players.Pl" - "ayersChangedEvent\032\023.modlock.wasm.EmptyB*" - "Z(github.com/paralin/modlock/src/wasm;wa" - "smb\006proto3" + "se\022Z\n\014RemovePickup\022$.modlock.wasm.entiti" + "es.PickupRequest\032$.modlock.wasm.entities" + ".AliveResponse\022c\n\014FindEntities\022*.modlock" + ".wasm.entities.FindEntitiesRequest\032\'.mod" + "lock.wasm.entities.EntitiesResponse\022o\n\022F" + "indEntitiesByName\0220.modlock.wasm.entitie" + "s.FindEntitiesByNameRequest\032\'.modlock.wa" + "sm.entities.EntitiesResponse\022d\n\016RemoveEn" + "tities\022,.modlock.wasm.entities.RemoveEnt" + "itiesRequest\032$.modlock.wasm.entities.Cou" + "ntResponse\0224\n\010ClearMap\022\023.modlock.wasm.Em" + "pty\032\023.modlock.wasm.Empty\022>\n\006Damage\022\037.mod" + "lock.wasm.combat.HitOptions\032\023.modlock.wa" + "sm.Empty\022C\n\nKillEntity\022 .modlock.wasm.co" + "mbat.KillOptions\032\023.modlock.wasm.Empty\022N\n" + "\005Trace\022!.modlock.wasm.combat.TraceOption" + "s\032\".modlock.wasm.combat.TraceResponse\022I\n" + "\013RestoreNpcs\022%.modlock.wasm.npcs.Restore" + "NpcsRequest\032\023.modlock.wasm.Empty\0228\n\005Paus" + "e\022\032.modlock.wasm.PauseRequest\032\023.modlock." + "wasm.Empty\022C\n\nMatchClock\022\023.modlock.wasm." + "Empty\032 .modlock.wasm.MatchClockResponse\022" + "J\n\016HoldMatchClock\022#.modlock.wasm.HoldMat" + "chClockRequest\032\023.modlock.wasm.Empty\0227\n\004R" + "ift\022\023.modlock.wasm.Empty\032\032.modlock.wasm." + "RiftResponse\022@\n\tStartRift\022\036.modlock.wasm" + ".StartRiftRequest\032\023.modlock.wasm.Empty\022K" + "\n\nMoveEntity\022(.modlock.wasm.entities.Mov" + "eEntityRequest\032\023.modlock.wasm.Empty\022K\n\nP" + "ushEntity\022(.modlock.wasm.entities.PushEn" + "tityRequest\032\023.modlock.wasm.Empty\022X\n\tEmit" + "Sound\022&.modlock.wasm.effects.EmitSoundRe" + "quest\032#.modlock.wasm.effects.SoundRespon" + "se\022L\n\013AdjustSound\022(.modlock.wasm.effects" + ".AdjustSoundRequest\032\023.modlock.wasm.Empty" + "\022H\n\tStopSound\022&.modlock.wasm.effects.Sto" + "pSoundRequest\032\023.modlock.wasm.Empty\022@\n\004Ki" + "ll\022#.modlock.wasm.players.PlayerRequest\032" + "\023.modlock.wasm.Empty\022M\n\013SetVelocity\022).mo" + "dlock.wasm.movement.SetVelocityRequest\032\023" + ".modlock.wasm.Empty\022M\n\007Buttons\022#.modlock" + ".wasm.players.PlayerRequest\032\035.modlock.wa" + "sm.ButtonsResponse\022Q\n\rWatchMovement\022+.mo" + "dlock.wasm.movement.WatchMovementRequest" + "\032\023.modlock.wasm.Empty\022O\n\020WatchProjectile" + "s\022&.modlock.wasm.combat.ProjectileOption" + "s\032\023.modlock.wasm.Empty\022\\\n\022HoldEntityModi" + "fier\0221.modlock.wasm.abilities.HoldEntity" + "ModifierRequest\032\023.modlock.wasm.Empty\022\\\n\022" + "GiveEntityModifier\0221.modlock.wasm.abilit" + "ies.GiveEntityModifierRequest\032\023.modlock." + "wasm.Empty2\363\016\n\003Mod\022<\n\005Start\022\030.modlock.wa" + "sm.StartEvent\032\031.modlock.wasm.StartResult" + "\0226\n\005Frame\022\030.modlock.wasm.FrameEvent\032\023.mo" + "dlock.wasm.Empty\022B\n\007Command\022\032.modlock.wa" + "sm.CommandEvent\032\033.modlock.wasm.CommandRe" + "sult\0224\n\004Chat\022\027.modlock.wasm.ChatEvent\032\023." + "modlock.wasm.Empty\0226\n\005World\022\030.modlock.wa" + "sm.WorldEvent\032\023.modlock.wasm.Empty\022=\n\007Ui" + "Press\022\035.modlock.wasm.ui.UiPressEvent\032\023.m" + "odlock.wasm.Empty\022=\n\007UiInput\022\035.modlock.w" + "asm.ui.UiInputEvent\032\023.modlock.wasm.Empty" + "\022>\n\005Serve\022\031.modlock.wasm.ServiceCall\032\032.m" + "odlock.wasm.ServiceReply\022H\n\016ServiceRepli" + "ed\022!.modlock.wasm.ServiceRepliedEvent\032\023." + "modlock.wasm.Empty\022M\n\006Damage\022 .modlock.w" + "asm.combat.DamageEvent\032!.modlock.wasm.co" + "mbat.DamageResult\022A\n\007Damaged\022!.modlock.w" + "asm.combat.DamagedEvent\032\023.modlock.wasm.E" + "mpty\022=\n\006Killed\022\036.modlock.wasm.combat.Kil" + "lEvent\032\023.modlock.wasm.Empty\022L\n\013AbilityCa" + "st\022(.modlock.wasm.abilities.AbilityCastE" + "vent\032\023.modlock.wasm.Empty\022M\n\rModifierFir" + "ed\022\'.modlock.wasm.combat.ModifierFiredEv" + "ent\032\023.modlock.wasm.Empty\022=\n\006Healed\022\036.mod" + "lock.wasm.combat.HealEvent\032\023.modlock.was" + "m.Empty\022D\n\014LevelChanged\022\037.modlock.wasm.c" + "ombat.LevelEvent\032\023.modlock.wasm.Empty\022=\n" + "\005Melee\022\037.modlock.wasm.combat.MeleeEvent\032" + "\023.modlock.wasm.Empty\022\?\n\007Parried\022\037.modloc" + "k.wasm.combat.ParryEvent\032\023.modlock.wasm." + "Empty\0226\n\005Input\022\030.modlock.wasm.InputEvent" + "\032\023.modlock.wasm.Empty\022D\n\010Restored\022#.modl" + "ock.wasm.players.RestoredEvent\032\023.modlock" + ".wasm.Empty\022I\n\014NpcsRestored\022$.modlock.wa" + "sm.npcs.NpcsRestoredEvent\032\023.modlock.wasm" + ".Empty\022\?\n\006Launch\022 .modlock.wasm.combat.L" + "aunchEvent\032\023.modlock.wasm.Empty\022\?\n\006Impac" + "t\022 .modlock.wasm.combat.ImpactEvent\032\023.mo" + "dlock.wasm.Empty\022A\n\006Landed\022\".modlock.was" + "m.movement.LandedEvent\032\023.modlock.wasm.Em" + "pty\022Q\n\016SettingChanged\022*.modlock.wasm.set" + "tings.SettingChangedEvent\032\023.modlock.wasm" + ".Empty\022L\n\014PlayerJoined\022\'.modlock.wasm.pl" + "ayers.PlayerJoinedEvent\032\023.modlock.wasm.E" + "mpty\022H\n\nPlayerLeft\022%.modlock.wasm.player" + "s.PlayerLeftEvent\032\023.modlock.wasm.Empty\022P" + "\n\016PlayersChanged\022).modlock.wasm.players." + "PlayersChangedEvent\032\023.modlock.wasm.Empty" + "B*Z(github.com/paralin/modlock/src/wasm;" + "wasmb\006proto3" }; static const ::_pbi::DescriptorTable* PROTOBUF_NONNULL const descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto_deps[16] = { @@ -993,13 +1131,13 @@ static ::absl::once_flag descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto = { false, false, - 13970, + 14532, descriptor_table_protodef_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto, "github.com/paralin/modlock/src/wasm/wasm.proto", &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto_once, descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto_deps, 16, - 15, + 18, schemas, file_default_instances, TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto::offsets, @@ -1008,6 +1146,12 @@ PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_github_2ecom_2 }; namespace modlock { namespace wasm { +const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL ServiceFailure_descriptor() { + ::google::protobuf::internal::AssignDescriptors(&descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto); + return file_level_enum_descriptors_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto[0]; +} +PROTOBUF_CONSTINIT const uint32_t ServiceFailure_internal_data_[] = { + 262144u, 0u, }; // =================================================================== class Call::_Internal { @@ -4969,6 +5113,1037 @@ ::google::protobuf::Metadata ServiceReply::GetMetadata() const { } // =================================================================== +class StartServiceCallRequest::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _impl_._has_bits_); +}; + +StartServiceCallRequest::StartServiceCallRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, StartServiceCallRequest_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.StartServiceCallRequest) +} +PROTOBUF_NDEBUG_INLINE StartServiceCallRequest::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::StartServiceCallRequest& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + service_(arena, from.service_), + method_(arena, from.method_), + payload_(arena, from.payload_) {} + +StartServiceCallRequest::StartServiceCallRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const StartServiceCallRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, StartServiceCallRequest_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + StartServiceCallRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.timeout_milliseconds_ = from._impl_.timeout_milliseconds_; + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.StartServiceCallRequest) +} +PROTOBUF_NDEBUG_INLINE StartServiceCallRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + service_(arena), + method_(arena), + payload_(arena) {} + +inline void StartServiceCallRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.timeout_milliseconds_ = {}; +} +StartServiceCallRequest::~StartServiceCallRequest() { + // @@protoc_insertion_point(destructor:modlock.wasm.StartServiceCallRequest) + SharedDtor(*this); +} +inline void StartServiceCallRequest::SharedDtor(MessageLite& self) { + StartServiceCallRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.service_.Destroy(); + this_._impl_.method_.Destroy(); + this_._impl_.payload_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL StartServiceCallRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) StartServiceCallRequest(arena); +} +constexpr auto StartServiceCallRequest::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(StartServiceCallRequest), + alignof(StartServiceCallRequest)); +} +constexpr auto StartServiceCallRequest::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_StartServiceCallRequest_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &StartServiceCallRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &StartServiceCallRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &StartServiceCallRequest::ByteSizeLong, + &StartServiceCallRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _impl_._cached_size_), + false, + }, + &StartServiceCallRequest::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull StartServiceCallRequest_class_data_ = + StartServiceCallRequest::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +StartServiceCallRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&StartServiceCallRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(StartServiceCallRequest_class_data_.tc_table); + return StartServiceCallRequest_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 4, 0, 58, 2> +StartServiceCallRequest::_table_ = { + { + PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _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 + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + StartServiceCallRequest_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::StartServiceCallRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // uint32 timeout_milliseconds = 4; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(StartServiceCallRequest, _impl_.timeout_milliseconds_), 3>(), + {32, 3, 0, + PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _impl_.timeout_milliseconds_)}}, + // string service = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _impl_.service_)}}, + // string method = 2; + {::_pbi::TcParser::FastUS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _impl_.method_)}}, + // bytes payload = 3; + {::_pbi::TcParser::FastBS1, + {26, 2, 0, + PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _impl_.payload_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string service = 1; + {PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _impl_.service_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // string method = 2; + {PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _impl_.method_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // bytes payload = 3; + {PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _impl_.payload_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)}, + // uint32 timeout_milliseconds = 4; + {PROTOBUF_FIELD_OFFSET(StartServiceCallRequest, _impl_.timeout_milliseconds_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt32)}, + }}, + // no aux_entries + {{ + "\44\7\6\0\0\0\0\0" + "modlock.wasm.StartServiceCallRequest" + "service" + "method" + }}, +}; +PROTOBUF_NOINLINE void StartServiceCallRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.StartServiceCallRequest) + ::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, 0x00000007U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.service_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.method_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + _impl_.payload_.ClearNonDefaultToEmpty(); + } + } + _impl_.timeout_milliseconds_ = 0u; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL StartServiceCallRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const StartServiceCallRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL StartServiceCallRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const StartServiceCallRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.StartServiceCallRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string service = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_service().empty()) { + const ::std::string& _s = this_._internal_service(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.StartServiceCallRequest.service"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // string method = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_method().empty()) { + const ::std::string& _s = this_._internal_method(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.StartServiceCallRequest.method"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // bytes payload = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_payload().empty()) { + const ::std::string& _s = this_._internal_payload(); + target = stream->WriteBytesMaybeAliased(3, _s, target); + } + } + + // uint32 timeout_milliseconds = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_timeout_milliseconds() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray( + 4, this_._internal_timeout_milliseconds(), 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.StartServiceCallRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t StartServiceCallRequest::ByteSizeLong(const MessageLite& base) { + const StartServiceCallRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t StartServiceCallRequest::ByteSizeLong() const { + const StartServiceCallRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.StartServiceCallRequest) + ::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)) { + // string service = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_service().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_service()); + } + } + // string method = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_method().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_method()); + } + } + // bytes payload = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_payload().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this_._internal_payload()); + } + } + // uint32 timeout_milliseconds = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_timeout_milliseconds() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne( + this_._internal_timeout_milliseconds()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void StartServiceCallRequest::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.StartServiceCallRequest) + 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 (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_service().empty()) { + _this->_internal_set_service(from._internal_service()); + } else { + if (_this->_impl_.service_.IsDefault()) { + _this->_internal_set_service(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_method().empty()) { + _this->_internal_set_method(from._internal_method()); + } else { + if (_this->_impl_.method_.IsDefault()) { + _this->_internal_set_method(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!from._internal_payload().empty()) { + _this->_internal_set_payload(from._internal_payload()); + } else { + if (_this->_impl_.payload_.IsDefault()) { + _this->_internal_set_payload(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (from._internal_timeout_milliseconds() != 0) { + _this->_impl_.timeout_milliseconds_ = from._impl_.timeout_milliseconds_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void StartServiceCallRequest::CopyFrom(const StartServiceCallRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.StartServiceCallRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void StartServiceCallRequest::InternalSwap(StartServiceCallRequest* 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_.service_, &other->_impl_.service_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.method_, &other->_impl_.method_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.payload_, &other->_impl_.payload_, arena); + swap(_impl_.timeout_milliseconds_, other->_impl_.timeout_milliseconds_); +} + +::google::protobuf::Metadata StartServiceCallRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class ServiceCallStarted::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ServiceCallStarted, _impl_._has_bits_); +}; + +ServiceCallStarted::ServiceCallStarted(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ServiceCallStarted_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.ServiceCallStarted) +} +ServiceCallStarted::ServiceCallStarted( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ServiceCallStarted& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ServiceCallStarted_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 ServiceCallStarted::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0} {} + +inline void ServiceCallStarted::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.call_ = {}; +} +ServiceCallStarted::~ServiceCallStarted() { + // @@protoc_insertion_point(destructor:modlock.wasm.ServiceCallStarted) + SharedDtor(*this); +} +inline void ServiceCallStarted::SharedDtor(MessageLite& self) { + ServiceCallStarted& 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 ServiceCallStarted::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ServiceCallStarted(arena); +} +constexpr auto ServiceCallStarted::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::ZeroInit(sizeof(ServiceCallStarted), + alignof(ServiceCallStarted)); +} +constexpr auto ServiceCallStarted::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_ServiceCallStarted_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &ServiceCallStarted::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ServiceCallStarted::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ServiceCallStarted::ByteSizeLong, + &ServiceCallStarted::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ServiceCallStarted, _impl_._cached_size_), + false, + }, + &ServiceCallStarted::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ServiceCallStarted_class_data_ = + ServiceCallStarted::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ServiceCallStarted::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ServiceCallStarted_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ServiceCallStarted_class_data_.tc_table); + return ServiceCallStarted_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<0, 1, 0, 0, 2> +ServiceCallStarted::_table_ = { + { + PROTOBUF_FIELD_OFFSET(ServiceCallStarted, _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 + ServiceCallStarted_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::ServiceCallStarted>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // uint64 call = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(ServiceCallStarted, _impl_.call_), 0>(), + {8, 0, 0, + PROTOBUF_FIELD_OFFSET(ServiceCallStarted, _impl_.call_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // uint64 call = 1; + {PROTOBUF_FIELD_OFFSET(ServiceCallStarted, _impl_.call_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + }}, + // no aux_entries + {{ + }}, +}; +PROTOBUF_NOINLINE void ServiceCallStarted::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.ServiceCallStarted) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.call_ = ::uint64_t{0u}; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ServiceCallStarted::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ServiceCallStarted& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ServiceCallStarted::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ServiceCallStarted& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.ServiceCallStarted) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // uint64 call = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (this_._internal_call() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 1, this_._internal_call(), 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.ServiceCallStarted) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ServiceCallStarted::ByteSizeLong(const MessageLite& base) { + const ServiceCallStarted& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ServiceCallStarted::ByteSizeLong() const { + const ServiceCallStarted& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.ServiceCallStarted) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + { + // uint64 call = 1; + cached_has_bits = this_._impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (this_._internal_call() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_call()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ServiceCallStarted::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.ServiceCallStarted) + 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_call() != 0) { + _this->_impl_.call_ = from._impl_.call_; + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ServiceCallStarted::CopyFrom(const ServiceCallStarted& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.ServiceCallStarted) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ServiceCallStarted::InternalSwap(ServiceCallStarted* 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_.call_, other->_impl_.call_); +} + +::google::protobuf::Metadata ServiceCallStarted::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class ServiceRepliedEvent::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_._has_bits_); +}; + +ServiceRepliedEvent::ServiceRepliedEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ServiceRepliedEvent_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:modlock.wasm.ServiceRepliedEvent) +} +PROTOBUF_NDEBUG_INLINE ServiceRepliedEvent::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::ServiceRepliedEvent& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + payload_(arena, from.payload_), + error_(arena, from.error_) {} + +ServiceRepliedEvent::ServiceRepliedEvent( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const ServiceRepliedEvent& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, ServiceRepliedEvent_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + ServiceRepliedEvent* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, call_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, call_), + offsetof(Impl_, failure_) - + offsetof(Impl_, call_) + + sizeof(Impl_::failure_)); + + // @@protoc_insertion_point(copy_constructor:modlock.wasm.ServiceRepliedEvent) +} +PROTOBUF_NDEBUG_INLINE ServiceRepliedEvent::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + payload_(arena), + error_(arena) {} + +inline void ServiceRepliedEvent::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, call_), + 0, + offsetof(Impl_, failure_) - + offsetof(Impl_, call_) + + sizeof(Impl_::failure_)); +} +ServiceRepliedEvent::~ServiceRepliedEvent() { + // @@protoc_insertion_point(destructor:modlock.wasm.ServiceRepliedEvent) + SharedDtor(*this); +} +inline void ServiceRepliedEvent::SharedDtor(MessageLite& self) { + ServiceRepliedEvent& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.payload_.Destroy(); + this_._impl_.error_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL ServiceRepliedEvent::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) ServiceRepliedEvent(arena); +} +constexpr auto ServiceRepliedEvent::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(ServiceRepliedEvent), + alignof(ServiceRepliedEvent)); +} +constexpr auto ServiceRepliedEvent::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_ServiceRepliedEvent_default_instance_._instance, + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + &ServiceRepliedEvent::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &ServiceRepliedEvent::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &ServiceRepliedEvent::ByteSizeLong, + &ServiceRepliedEvent::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_._cached_size_), + false, + }, + &ServiceRepliedEvent::kDescriptorMethods, + &descriptor_table_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ServiceRepliedEvent_class_data_ = + ServiceRepliedEvent::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +ServiceRepliedEvent::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&ServiceRepliedEvent_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(ServiceRepliedEvent_class_data_.tc_table); + return ServiceRepliedEvent_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 4, 0, 46, 2> +ServiceRepliedEvent::_table_ = { + { + PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _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 + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + ServiceRepliedEvent_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::modlock::wasm::ServiceRepliedEvent>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // string error = 4; + {::_pbi::TcParser::FastUS1, + {34, 1, 0, + PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_.error_)}}, + // uint64 call = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(ServiceRepliedEvent, _impl_.call_), 2>(), + {8, 2, 0, + PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_.call_)}}, + // bytes payload = 2; + {::_pbi::TcParser::FastBS1, + {18, 0, 0, + PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_.payload_)}}, + // .modlock.wasm.ServiceFailure failure = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(ServiceRepliedEvent, _impl_.failure_), 3>(), + {24, 3, 0, + PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_.failure_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // uint64 call = 1; + {PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_.call_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUInt64)}, + // bytes payload = 2; + {PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_.payload_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)}, + // .modlock.wasm.ServiceFailure failure = 3; + {PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_.failure_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kOpenEnum)}, + // string error = 4; + {PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_.error_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\40\0\0\0\5\0\0\0" + "modlock.wasm.ServiceRepliedEvent" + "error" + }}, +}; +PROTOBUF_NOINLINE void ServiceRepliedEvent::Clear() { +// @@protoc_insertion_point(message_clear_start:modlock.wasm.ServiceRepliedEvent) + ::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_.payload_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.error_.ClearNonDefaultToEmpty(); + } + } + if (BatchCheckHasBit(cached_has_bits, 0x0000000cU)) { + ::memset(&_impl_.call_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.failure_) - + reinterpret_cast(&_impl_.call_)) + sizeof(_impl_.failure_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL ServiceRepliedEvent::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const ServiceRepliedEvent& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL ServiceRepliedEvent::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const ServiceRepliedEvent& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:modlock.wasm.ServiceRepliedEvent) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // uint64 call = 1; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_call() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray( + 1, this_._internal_call(), target); + } + } + + // bytes payload = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_payload().empty()) { + const ::std::string& _s = this_._internal_payload(); + target = stream->WriteBytesMaybeAliased(2, _s, target); + } + } + + // .modlock.wasm.ServiceFailure failure = 3; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_failure() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 3, this_._internal_failure(), target); + } + } + + // string error = 4; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_error().empty()) { + const ::std::string& _s = this_._internal_error(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "modlock.wasm.ServiceRepliedEvent.error"); + target = stream->WriteStringMaybeAliased(4, _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.ServiceRepliedEvent) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t ServiceRepliedEvent::ByteSizeLong(const MessageLite& base) { + const ServiceRepliedEvent& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t ServiceRepliedEvent::ByteSizeLong() const { + const ServiceRepliedEvent& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:modlock.wasm.ServiceRepliedEvent) + ::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)) { + // bytes payload = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_payload().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this_._internal_payload()); + } + } + // string error = 4; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_error().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_error()); + } + } + // uint64 call = 1; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_call() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( + this_._internal_call()); + } + } + // .modlock.wasm.ServiceFailure failure = 3; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_failure() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this_._internal_failure()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void ServiceRepliedEvent::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.ServiceRepliedEvent) + 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 (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_payload().empty()) { + _this->_internal_set_payload(from._internal_payload()); + } else { + if (_this->_impl_.payload_.IsDefault()) { + _this->_internal_set_payload(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_error().empty()) { + _this->_internal_set_error(from._internal_error()); + } else { + if (_this->_impl_.error_.IsDefault()) { + _this->_internal_set_error(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (from._internal_call() != 0) { + _this->_impl_.call_ = from._impl_.call_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (from._internal_failure() != 0) { + _this->_impl_.failure_ = from._impl_.failure_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void ServiceRepliedEvent::CopyFrom(const ServiceRepliedEvent& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:modlock.wasm.ServiceRepliedEvent) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void ServiceRepliedEvent::InternalSwap(ServiceRepliedEvent* 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_.payload_, &other->_impl_.payload_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.error_, &other->_impl_.error_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_.failure_) + + sizeof(ServiceRepliedEvent::_impl_.failure_) + - PROTOBUF_FIELD_OFFSET(ServiceRepliedEvent, _impl_.call_)>( + reinterpret_cast(&_impl_.call_), + reinterpret_cast(&other->_impl_.call_)); +} + +::google::protobuf::Metadata ServiceRepliedEvent::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + class LogRequest::_Internal { public: using HasBits = diff --git a/src/wasm/wasm.pb.go b/src/wasm/wasm.pb.go index d5d2faf7..4b8a40ad 100644 --- a/src/wasm/wasm.pb.go +++ b/src/wasm/wasm.pb.go @@ -9,12 +9,58 @@ import ( io "io" math "math" slices "slices" + strconv "strconv" protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite" json "github.com/aperturerobotics/protobuf-go-lite/json" movement "github.com/paralin/modlock/src/wasm/movement" ) +// ServiceFailure says why a service call ended without an answer. +type ServiceFailure int32 + +const ( + // SERVICE_FAILURE_NONE is an answered call. + ServiceFailure_SERVICE_FAILURE_NONE ServiceFailure = 0 + // SERVICE_FAILURE_REFUSED is a call the service answered with an error. + ServiceFailure_SERVICE_FAILURE_REFUSED ServiceFailure = 1 + // SERVICE_FAILURE_TIMEOUT is a call that waited out its timeout. + ServiceFailure_SERVICE_FAILURE_TIMEOUT ServiceFailure = 2 + // SERVICE_FAILURE_UNAVAILABLE is a call to a service nobody provides + // here, or one more than the host keeps waiting for a mod. + ServiceFailure_SERVICE_FAILURE_UNAVAILABLE ServiceFailure = 3 +) + +// Enum value maps for ServiceFailure. +var ( + ServiceFailure_name = map[int32]string{ + 0: "SERVICE_FAILURE_NONE", + 1: "SERVICE_FAILURE_REFUSED", + 2: "SERVICE_FAILURE_TIMEOUT", + 3: "SERVICE_FAILURE_UNAVAILABLE", + } + ServiceFailure_value = map[string]int32{ + "SERVICE_FAILURE_NONE": 0, + "SERVICE_FAILURE_REFUSED": 1, + "SERVICE_FAILURE_TIMEOUT": 2, + "SERVICE_FAILURE_UNAVAILABLE": 3, + } +) + +func (x ServiceFailure) Enum() *ServiceFailure { + p := new(ServiceFailure) + *p = x + return p +} + +func (x ServiceFailure) String() string { + name, valid := ServiceFailure_name[int32(x)] + if valid { + return name + } + return strconv.Itoa(int(x)) +} + // Call is one method call across the boundary: a mod calling the game // through modlock.host_call, or the game delivering an event through the // mod's modlock_event export. @@ -486,6 +532,123 @@ func (x *ServiceReply) GetPayload() []byte { return nil } +// StartServiceCallRequest calls one method of a service the host provides, +// to be answered in a later frame. +type StartServiceCallRequest struct { + unknownFields []byte + // Service names the service, such as "arena.match". + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + // Method names the method within the service. + Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` + // Payload is the call's argument. + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + // TimeoutMilliseconds is how long the mod waits for the answer; zero or + // more than 30 seconds waits 30 seconds. + TimeoutMilliseconds uint32 `protobuf:"varint,4,opt,name=timeout_milliseconds,json=timeoutMilliseconds,proto3" json:"timeoutMilliseconds,omitempty"` +} + +func (x *StartServiceCallRequest) Reset() { + *x = StartServiceCallRequest{} +} + +func (*StartServiceCallRequest) ProtoMessage() {} + +func (x *StartServiceCallRequest) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *StartServiceCallRequest) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *StartServiceCallRequest) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *StartServiceCallRequest) GetTimeoutMilliseconds() uint32 { + if x != nil { + return x.TimeoutMilliseconds + } + return 0 +} + +// ServiceCallStarted numbers a started service call. +type ServiceCallStarted struct { + unknownFields []byte + // Call is the number the call's ServiceReplied event carries, unique for + // the mod's instance. + Call uint64 `protobuf:"varint,1,opt,name=call,proto3" json:"call,omitempty"` +} + +func (x *ServiceCallStarted) Reset() { + *x = ServiceCallStarted{} +} + +func (*ServiceCallStarted) ProtoMessage() {} + +func (x *ServiceCallStarted) GetCall() uint64 { + if x != nil { + return x.Call + } + return 0 +} + +// ServiceRepliedEvent ends one started service call. +type ServiceRepliedEvent struct { + unknownFields []byte + // Call is the number StartServiceCall returned. + Call uint64 `protobuf:"varint,1,opt,name=call,proto3" json:"call,omitempty"` + // Payload is the answer, when failure is none. + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + // Failure says why the call ended without an answer. + Failure ServiceFailure `protobuf:"varint,3,opt,name=failure,proto3" json:"failure,omitempty"` + // Error describes the failure. + Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *ServiceRepliedEvent) Reset() { + *x = ServiceRepliedEvent{} +} + +func (*ServiceRepliedEvent) ProtoMessage() {} + +func (x *ServiceRepliedEvent) GetCall() uint64 { + if x != nil { + return x.Call + } + return 0 +} + +func (x *ServiceRepliedEvent) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *ServiceRepliedEvent) GetFailure() ServiceFailure { + if x != nil { + return x.Failure + } + return ServiceFailure_SERVICE_FAILURE_NONE +} + +func (x *ServiceRepliedEvent) GetError() string { + if x != nil { + return x.Error + } + return "" +} + // LogRequest carries one log line. type LogRequest struct { unknownFields []byte @@ -771,6 +934,60 @@ func (m *ServiceReply) CloneMessageVT() protobuf_go_lite.CloneMessage { return m.CloneVT() } +func (m *StartServiceCallRequest) CloneVT() *StartServiceCallRequest { + if m == nil { + return (*StartServiceCallRequest)(nil) + } + r := new(StartServiceCallRequest) + r.Service = m.Service + r.Method = m.Method + r.TimeoutMilliseconds = m.TimeoutMilliseconds + r.Payload = protobuf_go_lite.CloneBytes(m.Payload) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *StartServiceCallRequest) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *ServiceCallStarted) CloneVT() *ServiceCallStarted { + if m == nil { + return (*ServiceCallStarted)(nil) + } + r := new(ServiceCallStarted) + r.Call = m.Call + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *ServiceCallStarted) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + +func (m *ServiceRepliedEvent) CloneVT() *ServiceRepliedEvent { + if m == nil { + return (*ServiceRepliedEvent)(nil) + } + r := new(ServiceRepliedEvent) + r.Call = m.Call + r.Failure = m.Failure + r.Error = m.Error + r.Payload = protobuf_go_lite.CloneBytes(m.Payload) + if len(m.unknownFields) > 0 { + r.unknownFields = slices.Clone(m.unknownFields) + } + return r +} + +func (m *ServiceRepliedEvent) CloneMessageVT() protobuf_go_lite.CloneMessage { + return m.CloneVT() +} + func (m *LogRequest) CloneVT() *LogRequest { if m == nil { return (*LogRequest)(nil) @@ -1129,6 +1346,84 @@ func (this *ServiceReply) EqualMessageVT(thatMsg any) bool { return this.EqualVT(that) } +func (this *StartServiceCallRequest) EqualVT(that *StartServiceCallRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Service != that.Service { + return false + } + if this.Method != that.Method { + return false + } + if !protobuf_go_lite.EqualBytes(this.Payload, that.Payload) { + return false + } + if this.TimeoutMilliseconds != that.TimeoutMilliseconds { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *StartServiceCallRequest) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*StartServiceCallRequest) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *ServiceCallStarted) EqualVT(that *ServiceCallStarted) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Call != that.Call { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ServiceCallStarted) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*ServiceCallStarted) + if !ok { + return false + } + return this.EqualVT(that) +} + +func (this *ServiceRepliedEvent) EqualVT(that *ServiceRepliedEvent) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Call != that.Call { + return false + } + if !protobuf_go_lite.EqualBytes(this.Payload, that.Payload) { + return false + } + if this.Failure != that.Failure { + return false + } + if this.Error != that.Error { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *ServiceRepliedEvent) EqualMessageVT(thatMsg any) bool { + that, ok := thatMsg.(*ServiceRepliedEvent) + if !ok { + return false + } + return this.EqualVT(that) +} + func (this *LogRequest) EqualVT(that *LogRequest) bool { if this == that { return true @@ -1192,6 +1487,46 @@ func (this *PrecacheOptions) EqualMessageVT(thatMsg any) bool { return this.EqualVT(that) } +// MarshalProtoJSON marshals the ServiceFailure to JSON. +func (x ServiceFailure) MarshalProtoJSON(s *json.MarshalState) { + s.WriteEnum(int32(x), ServiceFailure_name) +} + +// MarshalText marshals the ServiceFailure to text. +func (x ServiceFailure) MarshalText() ([]byte, error) { + return []byte(json.GetEnumString(int32(x), ServiceFailure_name)), nil +} + +// MarshalJSON marshals the ServiceFailure to JSON. +func (x ServiceFailure) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the ServiceFailure from JSON. +func (x *ServiceFailure) UnmarshalProtoJSON(s *json.UnmarshalState) { + v := s.ReadEnum(ServiceFailure_value) + if err := s.Err(); err != nil { + s.SetErrorf("could not read ServiceFailure enum: %v", err) + return + } + *x = ServiceFailure(v) +} + +// UnmarshalText unmarshals the ServiceFailure from text. +func (x *ServiceFailure) UnmarshalText(b []byte) error { + i, err := json.ParseEnumString(string(b), ServiceFailure_value) + if err != nil { + return err + } + *x = ServiceFailure(i) + return nil +} + +// UnmarshalJSON unmarshals the ServiceFailure from JSON. +func (x *ServiceFailure) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + // MarshalProtoJSON marshals the Call message to JSON. func (x *Call) MarshalProtoJSON(s *json.MarshalState) { if x == nil { @@ -1919,29 +2254,44 @@ func (x *ServiceReply) UnmarshalJSON(b []byte) error { return json.DefaultUnmarshalerConfig.Unmarshal(b, x) } -// MarshalProtoJSON marshals the LogRequest message to JSON. -func (x *LogRequest) MarshalProtoJSON(s *json.MarshalState) { +// MarshalProtoJSON marshals the StartServiceCallRequest message to JSON. +func (x *StartServiceCallRequest) MarshalProtoJSON(s *json.MarshalState) { if x == nil { s.WriteNil() return } s.WriteObjectStart() var wroteField bool - if x.Message != "" || s.HasField("message") { + if x.Service != "" || s.HasField("service") { s.WriteMoreIf(&wroteField) - s.WriteObjectField("message") - s.WriteString(x.Message) + s.WriteObjectField("service") + s.WriteString(x.Service) + } + if x.Method != "" || s.HasField("method") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("method") + s.WriteString(x.Method) + } + if len(x.Payload) > 0 || s.HasField("payload") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("payload") + s.WriteBytes(x.Payload) + } + if x.TimeoutMilliseconds != 0 || s.HasField("timeoutMilliseconds") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("timeoutMilliseconds") + s.WriteUint32(x.TimeoutMilliseconds) } s.WriteObjectEnd() } -// MarshalJSON marshals the LogRequest to JSON. -func (x *LogRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON marshals the StartServiceCallRequest to JSON. +func (x *StartServiceCallRequest) MarshalJSON() ([]byte, error) { return json.DefaultMarshalerConfig.Marshal(x) } -// UnmarshalProtoJSON unmarshals the LogRequest message from JSON. -func (x *LogRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { +// UnmarshalProtoJSON unmarshals the StartServiceCallRequest message from JSON. +func (x *StartServiceCallRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { if s.ReadNil() { return } @@ -1949,41 +2299,50 @@ func (x *LogRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { switch key { default: s.Skip() // ignore unknown field - case "message": - s.AddField("message") - x.Message = s.ReadString() + case "service": + s.AddField("service") + x.Service = s.ReadString() + case "method": + s.AddField("method") + x.Method = s.ReadString() + case "payload": + s.AddField("payload") + x.Payload = s.ReadBytes() + case "timeout_milliseconds", "timeoutMilliseconds": + s.AddField("timeout_milliseconds") + x.TimeoutMilliseconds = s.ReadUint32() } }) } -// UnmarshalJSON unmarshals the LogRequest from JSON. -func (x *LogRequest) UnmarshalJSON(b []byte) error { +// UnmarshalJSON unmarshals the StartServiceCallRequest from JSON. +func (x *StartServiceCallRequest) UnmarshalJSON(b []byte) error { return json.DefaultUnmarshalerConfig.Unmarshal(b, x) } -// MarshalProtoJSON marshals the ServerCommandRequest message to JSON. -func (x *ServerCommandRequest) MarshalProtoJSON(s *json.MarshalState) { +// MarshalProtoJSON marshals the ServiceCallStarted message to JSON. +func (x *ServiceCallStarted) MarshalProtoJSON(s *json.MarshalState) { if x == nil { s.WriteNil() return } s.WriteObjectStart() var wroteField bool - if x.Command != "" || s.HasField("command") { + if x.Call != 0 || s.HasField("call") { s.WriteMoreIf(&wroteField) - s.WriteObjectField("command") - s.WriteString(x.Command) + s.WriteObjectField("call") + s.WriteUint64(x.Call) } s.WriteObjectEnd() } -// MarshalJSON marshals the ServerCommandRequest to JSON. -func (x *ServerCommandRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON marshals the ServiceCallStarted to JSON. +func (x *ServiceCallStarted) MarshalJSON() ([]byte, error) { return json.DefaultMarshalerConfig.Marshal(x) } -// UnmarshalProtoJSON unmarshals the ServerCommandRequest message from JSON. -func (x *ServerCommandRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { +// UnmarshalProtoJSON unmarshals the ServiceCallStarted message from JSON. +func (x *ServiceCallStarted) UnmarshalProtoJSON(s *json.UnmarshalState) { if s.ReadNil() { return } @@ -1991,9 +2350,159 @@ func (x *ServerCommandRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { switch key { default: s.Skip() // ignore unknown field - case "command": - s.AddField("command") - x.Command = s.ReadString() + case "call": + s.AddField("call") + x.Call = s.ReadUint64() + } + }) +} + +// UnmarshalJSON unmarshals the ServiceCallStarted from JSON. +func (x *ServiceCallStarted) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the ServiceRepliedEvent message to JSON. +func (x *ServiceRepliedEvent) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Call != 0 || s.HasField("call") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("call") + s.WriteUint64(x.Call) + } + if len(x.Payload) > 0 || s.HasField("payload") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("payload") + s.WriteBytes(x.Payload) + } + if x.Failure != 0 || s.HasField("failure") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("failure") + x.Failure.MarshalProtoJSON(s) + } + if x.Error != "" || s.HasField("error") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("error") + s.WriteString(x.Error) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the ServiceRepliedEvent to JSON. +func (x *ServiceRepliedEvent) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the ServiceRepliedEvent message from JSON. +func (x *ServiceRepliedEvent) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "call": + s.AddField("call") + x.Call = s.ReadUint64() + case "payload": + s.AddField("payload") + x.Payload = s.ReadBytes() + case "failure": + s.AddField("failure") + x.Failure.UnmarshalProtoJSON(s) + case "error": + s.AddField("error") + x.Error = s.ReadString() + } + }) +} + +// UnmarshalJSON unmarshals the ServiceRepliedEvent from JSON. +func (x *ServiceRepliedEvent) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the LogRequest message to JSON. +func (x *LogRequest) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Message != "" || s.HasField("message") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("message") + s.WriteString(x.Message) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the LogRequest to JSON. +func (x *LogRequest) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the LogRequest message from JSON. +func (x *LogRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "message": + s.AddField("message") + x.Message = s.ReadString() + } + }) +} + +// UnmarshalJSON unmarshals the LogRequest from JSON. +func (x *LogRequest) UnmarshalJSON(b []byte) error { + return json.DefaultUnmarshalerConfig.Unmarshal(b, x) +} + +// MarshalProtoJSON marshals the ServerCommandRequest message to JSON. +func (x *ServerCommandRequest) MarshalProtoJSON(s *json.MarshalState) { + if x == nil { + s.WriteNil() + return + } + s.WriteObjectStart() + var wroteField bool + if x.Command != "" || s.HasField("command") { + s.WriteMoreIf(&wroteField) + s.WriteObjectField("command") + s.WriteString(x.Command) + } + s.WriteObjectEnd() +} + +// MarshalJSON marshals the ServerCommandRequest to JSON. +func (x *ServerCommandRequest) MarshalJSON() ([]byte, error) { + return json.DefaultMarshalerConfig.Marshal(x) +} + +// UnmarshalProtoJSON unmarshals the ServerCommandRequest message from JSON. +func (x *ServerCommandRequest) UnmarshalProtoJSON(s *json.UnmarshalState) { + if s.ReadNil() { + return + } + s.ReadObject(func(key string) { + switch key { + default: + s.Skip() // ignore unknown field + case "command": + s.AddField("command") + x.Command = s.ReadString() } }) } @@ -2631,6 +3140,147 @@ func (m *ServiceReply) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *StartServiceCallRequest) 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 *StartServiceCallRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StartServiceCallRequest) 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.TimeoutMilliseconds != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.TimeoutMilliseconds)) + i-- + dAtA[i] = 0x20 + } + if len(m.Payload) > 0 { + i = protobuf_go_lite.EncodeBytes(dAtA, i, m.Payload) + i-- + dAtA[i] = 0x1a + } + if len(m.Method) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Method) + i-- + dAtA[i] = 0x12 + } + if len(m.Service) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Service) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ServiceCallStarted) 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 *ServiceCallStarted) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ServiceCallStarted) 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.Call != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Call)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ServiceRepliedEvent) 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 *ServiceRepliedEvent) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ServiceRepliedEvent) 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.Error) > 0 { + i = protobuf_go_lite.EncodeString(dAtA, i, m.Error) + i-- + dAtA[i] = 0x22 + } + if m.Failure != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Failure)) + i-- + dAtA[i] = 0x18 + } + if len(m.Payload) > 0 { + i = protobuf_go_lite.EncodeBytes(dAtA, i, m.Payload) + i-- + dAtA[i] = 0x12 + } + if m.Call != 0 { + i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Call)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *LogRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -2863,48 +3513,87 @@ func (m *ChatEvent) SizeVT() (n int) { return n } -func (m *CommandResult) SizeVT() (n int) { +func (m *CommandResult) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeBoolNonZero(1, m.Claimed) + n += len(m.unknownFields) + return n +} + +func (m *WorldEvent) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Map) + n += len(m.unknownFields) + return n +} + +func (m *ServiceCall) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Service) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Method) + n += protobuf_go_lite.SizeBytesNonEmpty(1, m.Payload) + n += len(m.unknownFields) + return n +} + +func (m *ServiceReply) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - n += protobuf_go_lite.SizeBoolNonZero(1, m.Claimed) + n += protobuf_go_lite.SizeBytesNonEmpty(1, m.Payload) n += len(m.unknownFields) return n } -func (m *WorldEvent) SizeVT() (n int) { +func (m *StartServiceCallRequest) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - n += protobuf_go_lite.SizeStringNonEmpty(1, m.Map) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Service) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Method) + n += protobuf_go_lite.SizeBytesNonEmpty(1, m.Payload) + n += protobuf_go_lite.SizeVarintNonZero(1, m.TimeoutMilliseconds) n += len(m.unknownFields) return n } -func (m *ServiceCall) SizeVT() (n int) { +func (m *ServiceCallStarted) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - n += protobuf_go_lite.SizeStringNonEmpty(1, m.Service) - n += protobuf_go_lite.SizeStringNonEmpty(1, m.Method) - n += protobuf_go_lite.SizeBytesNonEmpty(1, m.Payload) + n += protobuf_go_lite.SizeVarintNonZero(1, m.Call) n += len(m.unknownFields) return n } -func (m *ServiceReply) SizeVT() (n int) { +func (m *ServiceRepliedEvent) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l + n += protobuf_go_lite.SizeVarintNonZero(1, m.Call) n += protobuf_go_lite.SizeBytesNonEmpty(1, m.Payload) + n += protobuf_go_lite.SizeVarintNonZero(1, m.Failure) + n += protobuf_go_lite.SizeStringNonEmpty(1, m.Error) n += len(m.unknownFields) return n } @@ -2943,6 +3632,10 @@ func (m *PrecacheOptions) SizeVT() (n int) { return n } +func (x ServiceFailure) MarshalProtoText() string { + return x.String() +} + func (x *Call) MarshalProtoText() string { var sb protobuf_go_lite.TextBuilder initialLen := protobuf_go_lite.TextStartMessage(&sb, "Call") @@ -3223,6 +3916,72 @@ func (x *ServiceReply) String() string { return x.MarshalProtoText() } +func (x *StartServiceCallRequest) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "StartServiceCallRequest") + if x.Service != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "service") + protobuf_go_lite.TextWriteString(&sb, x.Service) + } + if x.Method != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "method") + protobuf_go_lite.TextWriteString(&sb, x.Method) + } + if len(x.Payload) != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "payload") + protobuf_go_lite.TextWriteBytes(&sb, x.Payload) + } + if x.TimeoutMilliseconds != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "timeout_milliseconds") + protobuf_go_lite.TextWriteUint(&sb, x.TimeoutMilliseconds) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *StartServiceCallRequest) String() string { + return x.MarshalProtoText() +} + +func (x *ServiceCallStarted) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "ServiceCallStarted") + if x.Call != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "call") + protobuf_go_lite.TextWriteUint(&sb, x.Call) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *ServiceCallStarted) String() string { + return x.MarshalProtoText() +} + +func (x *ServiceRepliedEvent) MarshalProtoText() string { + var sb protobuf_go_lite.TextBuilder + initialLen := protobuf_go_lite.TextStartMessage(&sb, "ServiceRepliedEvent") + if x.Call != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "call") + protobuf_go_lite.TextWriteUint(&sb, x.Call) + } + if len(x.Payload) != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "payload") + protobuf_go_lite.TextWriteBytes(&sb, x.Payload) + } + if x.Failure != 0 { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "failure") + protobuf_go_lite.TextWriteStringer(&sb, ServiceFailure(x.Failure)) + } + if x.Error != "" { + protobuf_go_lite.TextWriteFieldPrefix(&sb, initialLen, "error") + protobuf_go_lite.TextWriteString(&sb, x.Error) + } + return protobuf_go_lite.TextFinishMessage(&sb) +} + +func (x *ServiceRepliedEvent) String() string { + return x.MarshalProtoText() +} + func (x *LogRequest) MarshalProtoText() string { var sb protobuf_go_lite.TextBuilder initialLen := protobuf_go_lite.TextStartMessage(&sb, "LogRequest") @@ -4158,6 +4917,219 @@ func (m *ServiceReply) UnmarshalVT(dAtA []byte) error { return nil } +func (m *StartServiceCallRequest) 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: StartServiceCallRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StartServiceCallRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Service = v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Method = v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, dAtA, iNdEx) + if err != nil { + return err + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutMilliseconds", wireType) + } + m.TimeoutMilliseconds = 0 + m.TimeoutMilliseconds, 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 *ServiceCallStarted) 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: ServiceCallStarted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceCallStarted: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Call", wireType) + } + m.Call = 0 + m.Call, iNdEx, err = protobuf_go_lite.DecodeVarint(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 *ServiceRepliedEvent) 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: ServiceRepliedEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceRepliedEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Call", wireType) + } + m.Call = 0 + m.Call, 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 Payload", wireType) + } + m.Payload, iNdEx, err = protobuf_go_lite.DecodeBytesAppend(m.Payload, dAtA, iNdEx) + if err != nil { + return err + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType) + } + m.Failure = 0 + var _v uint64 + _v, iNdEx, err = protobuf_go_lite.DecodeVarint(dAtA, iNdEx) + m.Failure = ServiceFailure(_v) + if err != nil { + return err + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var v string + v, iNdEx, err = protobuf_go_lite.DecodeString(dAtA, iNdEx) + if err != nil { + return err + } + m.Error = 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 *LogRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/src/wasm/wasm.pb.h b/src/wasm/wasm.pb.h index d59e81bf..66060e31 100644 --- a/src/wasm/wasm.pb.h +++ b/src/wasm/wasm.pb.h @@ -31,6 +31,7 @@ #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/generated_enum_reflection.h" #include "google/protobuf/unknown_field_set.h" #include "abilities/abilities.pb.h" #include "combat/combat.pb.h" @@ -73,6 +74,8 @@ MODLOCK_API extern const ::google::protobuf::internal::DescriptorTable descripto } // extern "C" namespace modlock { namespace wasm { +enum ServiceFailure : int; +extern const uint32_t ServiceFailure_internal_data_[]; class Call; struct CallDefaultTypeInternal; MODLOCK_API extern CallDefaultTypeInternal _Call_default_instance_; @@ -117,6 +120,14 @@ class ServiceCall; struct ServiceCallDefaultTypeInternal; MODLOCK_API extern ServiceCallDefaultTypeInternal _ServiceCall_default_instance_; MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull ServiceCall_class_data_; +class ServiceCallStarted; +struct ServiceCallStartedDefaultTypeInternal; +MODLOCK_API extern ServiceCallStartedDefaultTypeInternal _ServiceCallStarted_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull ServiceCallStarted_class_data_; +class ServiceRepliedEvent; +struct ServiceRepliedEventDefaultTypeInternal; +MODLOCK_API extern ServiceRepliedEventDefaultTypeInternal _ServiceRepliedEvent_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull ServiceRepliedEvent_class_data_; class ServiceReply; struct ServiceReplyDefaultTypeInternal; MODLOCK_API extern ServiceReplyDefaultTypeInternal _ServiceReply_default_instance_; @@ -129,6 +140,10 @@ class StartResult; struct StartResultDefaultTypeInternal; MODLOCK_API extern StartResultDefaultTypeInternal _StartResult_default_instance_; MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull StartResult_class_data_; +class StartServiceCallRequest; +struct StartServiceCallRequestDefaultTypeInternal; +MODLOCK_API extern StartServiceCallRequestDefaultTypeInternal _StartServiceCallRequest_default_instance_; +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull StartServiceCallRequest_class_data_; class WorldEvent; struct WorldEventDefaultTypeInternal; MODLOCK_API extern WorldEventDefaultTypeInternal _WorldEvent_default_instance_; @@ -137,11 +152,52 @@ MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull WorldEvent_ } // namespace modlock namespace google { namespace protobuf { +template <> +internal::EnumTraitsT<::modlock::wasm::ServiceFailure_internal_data_> + internal::EnumTraitsImpl::value<::modlock::wasm::ServiceFailure>; } // namespace protobuf } // namespace google namespace modlock { namespace wasm { +enum ServiceFailure : int { + SERVICE_FAILURE_NONE = 0, + SERVICE_FAILURE_REFUSED = 1, + SERVICE_FAILURE_TIMEOUT = 2, + SERVICE_FAILURE_UNAVAILABLE = 3, + ServiceFailure_INT_MIN_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::min(), + ServiceFailure_INT_MAX_SENTINEL_DO_NOT_USE_ = + ::std::numeric_limits<::int32_t>::max(), +}; + +extern const uint32_t ServiceFailure_internal_data_[]; +inline constexpr ServiceFailure ServiceFailure_MIN = + static_cast(0); +inline constexpr ServiceFailure ServiceFailure_MAX = + static_cast(3); +inline bool ServiceFailure_IsValid(int value) { + return 0 <= value && value <= 3; +} +inline constexpr int ServiceFailure_ARRAYSIZE = 3 + 1; +const ::google::protobuf::EnumDescriptor* PROTOBUF_NONNULL ServiceFailure_descriptor(); +template +const ::std::string& ServiceFailure_Name(T value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to ServiceFailure_Name()."); + return ServiceFailure_Name(static_cast(value)); +} +template <> +inline const ::std::string& ServiceFailure_Name(ServiceFailure value) { + return ::google::protobuf::internal::NameOfDenseEnum( + static_cast(value)); +} +inline bool ServiceFailure_Parse( + ::absl::string_view name, ServiceFailure* PROTOBUF_NONNULL value) { + return ::google::protobuf::internal::ParseNamedEnum(ServiceFailure_descriptor(), name, + value); +} // =================================================================== @@ -343,6 +399,247 @@ class MODLOCK_API WorldEvent final : public ::google::protobuf::Message MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull WorldEvent_class_data_; // ------------------------------------------------------------------- +class MODLOCK_API StartServiceCallRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.StartServiceCallRequest) */ { + public: + inline StartServiceCallRequest() : StartServiceCallRequest(nullptr) {} + ~StartServiceCallRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(StartServiceCallRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(StartServiceCallRequest)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR StartServiceCallRequest(::google::protobuf::internal::ConstantInitialized); + + inline StartServiceCallRequest(const StartServiceCallRequest& from) : StartServiceCallRequest(nullptr, from) {} + inline StartServiceCallRequest(StartServiceCallRequest&& from) noexcept + : StartServiceCallRequest(nullptr, ::std::move(from)) {} + inline StartServiceCallRequest& operator=(const StartServiceCallRequest& from) { + CopyFrom(from); + return *this; + } + inline StartServiceCallRequest& operator=(StartServiceCallRequest&& 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 StartServiceCallRequest& default_instance() { + return *reinterpret_cast( + &_StartServiceCallRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = 12; + friend void swap(StartServiceCallRequest& a, StartServiceCallRequest& b) { a.Swap(&b); } + inline void Swap(StartServiceCallRequest* 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(StartServiceCallRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + StartServiceCallRequest* 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 StartServiceCallRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const StartServiceCallRequest& from) { StartServiceCallRequest::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(StartServiceCallRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.StartServiceCallRequest"; } + + explicit StartServiceCallRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + StartServiceCallRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const StartServiceCallRequest& from); + StartServiceCallRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, StartServiceCallRequest&& from) noexcept + : StartServiceCallRequest(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 { + kServiceFieldNumber = 1, + kMethodFieldNumber = 2, + kPayloadFieldNumber = 3, + kTimeoutMillisecondsFieldNumber = 4, + }; + // string service = 1; + void clear_service() ; + const ::std::string& service() const; + template + void set_service(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_service(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_service(); + void set_allocated_service(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_service() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_service(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_service(); + + public: + // string method = 2; + void clear_method() ; + const ::std::string& method() const; + template + void set_method(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_method(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_method(); + void set_allocated_method(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_method() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_method(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_method(); + + public: + // bytes payload = 3; + void clear_payload() ; + const ::std::string& payload() const; + template + void set_payload(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_payload(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_payload(); + void set_allocated_payload(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_payload() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_payload(); + + public: + // uint32 timeout_milliseconds = 4; + void clear_timeout_milliseconds() ; + ::uint32_t timeout_milliseconds() const; + void set_timeout_milliseconds(::uint32_t value); + + private: + ::uint32_t _internal_timeout_milliseconds() const; + void _internal_set_timeout_milliseconds(::uint32_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.StartServiceCallRequest) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 4, + 0, 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 StartServiceCallRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr service_; + ::google::protobuf::internal::ArenaStringPtr method_; + ::google::protobuf::internal::ArenaStringPtr payload_; + ::uint32_t timeout_milliseconds_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull StartServiceCallRequest_class_data_; +// ------------------------------------------------------------------- + class MODLOCK_API StartResult final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:modlock.wasm.StartResult) */ { public: @@ -1103,30 +1400,30 @@ class MODLOCK_API ServiceReply final : public ::google::protobuf::Message MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull ServiceReply_class_data_; // ------------------------------------------------------------------- -class MODLOCK_API ServiceCall final : public ::google::protobuf::Message -/* @@protoc_insertion_point(class_definition:modlock.wasm.ServiceCall) */ { +class MODLOCK_API ServiceRepliedEvent final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.ServiceRepliedEvent) */ { public: - inline ServiceCall() : ServiceCall(nullptr) {} - ~ServiceCall() PROTOBUF_FINAL; + inline ServiceRepliedEvent() : ServiceRepliedEvent(nullptr) {} + ~ServiceRepliedEvent() PROTOBUF_FINAL; #if defined(PROTOBUF_CUSTOM_VTABLE) - void operator delete(ServiceCall* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + void operator delete(ServiceRepliedEvent* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { SharedDtor(*msg); - ::google::protobuf::internal::SizedDelete(msg, sizeof(ServiceCall)); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ServiceRepliedEvent)); } #endif template - explicit PROTOBUF_CONSTEXPR ServiceCall(::google::protobuf::internal::ConstantInitialized); + explicit PROTOBUF_CONSTEXPR ServiceRepliedEvent(::google::protobuf::internal::ConstantInitialized); - inline ServiceCall(const ServiceCall& from) : ServiceCall(nullptr, from) {} - inline ServiceCall(ServiceCall&& from) noexcept - : ServiceCall(nullptr, ::std::move(from)) {} - inline ServiceCall& operator=(const ServiceCall& from) { + inline ServiceRepliedEvent(const ServiceRepliedEvent& from) : ServiceRepliedEvent(nullptr, from) {} + inline ServiceRepliedEvent(ServiceRepliedEvent&& from) noexcept + : ServiceRepliedEvent(nullptr, ::std::move(from)) {} + inline ServiceRepliedEvent& operator=(const ServiceRepliedEvent& from) { CopyFrom(from); return *this; } - inline ServiceCall& operator=(ServiceCall&& from) noexcept { + inline ServiceRepliedEvent& operator=(ServiceRepliedEvent&& from) noexcept { if (this == &from) return *this; if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { InternalSwap(&from); @@ -1154,13 +1451,13 @@ class MODLOCK_API ServiceCall final : public ::google::protobuf::Message static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { return default_instance().GetMetadata().reflection; } - static const ServiceCall& default_instance() { - return *reinterpret_cast( - &_ServiceCall_default_instance_); + static const ServiceRepliedEvent& default_instance() { + return *reinterpret_cast( + &_ServiceRepliedEvent_default_instance_); } - static constexpr int kIndexInFileMessages = 10; - friend void swap(ServiceCall& a, ServiceCall& b) { a.Swap(&b); } - inline void Swap(ServiceCall* PROTOBUF_NONNULL other) { + static constexpr int kIndexInFileMessages = 14; + friend void swap(ServiceRepliedEvent& a, ServiceRepliedEvent& b) { a.Swap(&b); } + inline void Swap(ServiceRepliedEvent* PROTOBUF_NONNULL other) { if (other == this) return; if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { InternalSwap(other); @@ -1168,7 +1465,7 @@ class MODLOCK_API ServiceCall final : public ::google::protobuf::Message ::google::protobuf::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(ServiceCall* PROTOBUF_NONNULL other) { + void UnsafeArenaSwap(ServiceRepliedEvent* PROTOBUF_NONNULL other) { if (other == this) return; ABSL_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); @@ -1176,13 +1473,13 @@ class MODLOCK_API ServiceCall final : public ::google::protobuf::Message // implements Message ---------------------------------------------- - ServiceCall* PROTOBUF_NONNULL New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { - return ::google::protobuf::Message::DefaultConstruct(arena); + ServiceRepliedEvent* 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 ServiceCall& from); + void CopyFrom(const ServiceRepliedEvent& from); using ::google::protobuf::Message::MergeFrom; - void MergeFrom(const ServiceCall& from) { ServiceCall::MergeImpl(*this, from); } + void MergeFrom(const ServiceRepliedEvent& from) { ServiceRepliedEvent::MergeImpl(*this, from); } private: static void MergeImpl(::google::protobuf::MessageLite& to_msg, @@ -1218,17 +1515,17 @@ class MODLOCK_API ServiceCall final : public ::google::protobuf::Message private: void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); static void SharedDtor(MessageLite& self); - void InternalSwap(ServiceCall* PROTOBUF_NONNULL other); + void InternalSwap(ServiceRepliedEvent* PROTOBUF_NONNULL other); private: template friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); - static ::absl::string_view FullMessageName() { return "modlock.wasm.ServiceCall"; } + static ::absl::string_view FullMessageName() { return "modlock.wasm.ServiceRepliedEvent"; } - explicit ServiceCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); - ServiceCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ServiceCall& from); - ServiceCall( - ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ServiceCall&& from) noexcept - : ServiceCall(arena) { + explicit ServiceRepliedEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ServiceRepliedEvent(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ServiceRepliedEvent& from); + ServiceRepliedEvent( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ServiceRepliedEvent&& from) noexcept + : ServiceRepliedEvent(arena) { *this = ::std::move(from); } const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; @@ -1245,22 +1542,448 @@ class MODLOCK_API ServiceCall final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { - kServiceFieldNumber = 1, - kMethodFieldNumber = 2, - kPayloadFieldNumber = 3, + kPayloadFieldNumber = 2, + kErrorFieldNumber = 4, + kCallFieldNumber = 1, + kFailureFieldNumber = 3, }; - // string service = 1; - void clear_service() ; - const ::std::string& service() const; + // bytes payload = 2; + void clear_payload() ; + const ::std::string& payload() const; template - void set_service(Arg_&& arg, Args_... args); - ::std::string* PROTOBUF_NONNULL mutable_service(); - [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_service(); - void set_allocated_service(::std::string* PROTOBUF_NULLABLE value); + void set_payload(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_payload(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_payload(); + void set_allocated_payload(::std::string* PROTOBUF_NULLABLE value); private: - const ::std::string& _internal_service() const; - PROTOBUF_ALWAYS_INLINE void _internal_set_service(const ::std::string& value); + const ::std::string& _internal_payload() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_payload(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_payload(); + + public: + // string error = 4; + void clear_error() ; + const ::std::string& error() const; + template + void set_error(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_error(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_error(); + void set_allocated_error(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_error() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_error(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_error(); + + public: + // uint64 call = 1; + void clear_call() ; + ::uint64_t call() const; + void set_call(::uint64_t value); + + private: + ::uint64_t _internal_call() const; + void _internal_set_call(::uint64_t value); + + public: + // .modlock.wasm.ServiceFailure failure = 3; + void clear_failure() ; + ::modlock::wasm::ServiceFailure failure() const; + void set_failure(::modlock::wasm::ServiceFailure value); + + private: + ::modlock::wasm::ServiceFailure _internal_failure() const; + void _internal_set_failure(::modlock::wasm::ServiceFailure value); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.ServiceRepliedEvent) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 4, + 0, 46, + 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 ServiceRepliedEvent& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr payload_; + ::google::protobuf::internal::ArenaStringPtr error_; + ::uint64_t call_; + int failure_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull ServiceRepliedEvent_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API ServiceCallStarted final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.ServiceCallStarted) */ { + public: + inline ServiceCallStarted() : ServiceCallStarted(nullptr) {} + ~ServiceCallStarted() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ServiceCallStarted* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ServiceCallStarted)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR ServiceCallStarted(::google::protobuf::internal::ConstantInitialized); + + inline ServiceCallStarted(const ServiceCallStarted& from) : ServiceCallStarted(nullptr, from) {} + inline ServiceCallStarted(ServiceCallStarted&& from) noexcept + : ServiceCallStarted(nullptr, ::std::move(from)) {} + inline ServiceCallStarted& operator=(const ServiceCallStarted& from) { + CopyFrom(from); + return *this; + } + inline ServiceCallStarted& operator=(ServiceCallStarted&& 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 ServiceCallStarted& default_instance() { + return *reinterpret_cast( + &_ServiceCallStarted_default_instance_); + } + static constexpr int kIndexInFileMessages = 13; + friend void swap(ServiceCallStarted& a, ServiceCallStarted& b) { a.Swap(&b); } + inline void Swap(ServiceCallStarted* 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(ServiceCallStarted* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ServiceCallStarted* 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 ServiceCallStarted& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ServiceCallStarted& from) { ServiceCallStarted::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(ServiceCallStarted* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.ServiceCallStarted"; } + + explicit ServiceCallStarted(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ServiceCallStarted(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ServiceCallStarted& from); + ServiceCallStarted( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ServiceCallStarted&& from) noexcept + : ServiceCallStarted(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 { + kCallFieldNumber = 1, + }; + // uint64 call = 1; + void clear_call() ; + ::uint64_t call() const; + void set_call(::uint64_t value); + + private: + ::uint64_t _internal_call() const; + void _internal_set_call(::uint64_t value); + + public: + // @@protoc_insertion_point(class_scope:modlock.wasm.ServiceCallStarted) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<0, 1, + 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 ServiceCallStarted& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::uint64_t call_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_github_2ecom_2fparalin_2fmodlock_2fsrc_2fwasm_2fwasm_2eproto; +}; + +MODLOCK_API extern const ::google::protobuf::internal::ClassDataFull ServiceCallStarted_class_data_; +// ------------------------------------------------------------------- + +class MODLOCK_API ServiceCall final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:modlock.wasm.ServiceCall) */ { + public: + inline ServiceCall() : ServiceCall(nullptr) {} + ~ServiceCall() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(ServiceCall* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(ServiceCall)); + } +#endif + + template + explicit PROTOBUF_CONSTEXPR ServiceCall(::google::protobuf::internal::ConstantInitialized); + + inline ServiceCall(const ServiceCall& from) : ServiceCall(nullptr, from) {} + inline ServiceCall(ServiceCall&& from) noexcept + : ServiceCall(nullptr, ::std::move(from)) {} + inline ServiceCall& operator=(const ServiceCall& from) { + CopyFrom(from); + return *this; + } + inline ServiceCall& operator=(ServiceCall&& 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 ServiceCall& default_instance() { + return *reinterpret_cast( + &_ServiceCall_default_instance_); + } + static constexpr int kIndexInFileMessages = 10; + friend void swap(ServiceCall& a, ServiceCall& b) { a.Swap(&b); } + inline void Swap(ServiceCall* 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(ServiceCall* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ServiceCall* 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 ServiceCall& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const ServiceCall& from) { ServiceCall::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(ServiceCall* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "modlock.wasm.ServiceCall"; } + + explicit ServiceCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + ServiceCall(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const ServiceCall& from); + ServiceCall( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, ServiceCall&& from) noexcept + : ServiceCall(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 { + kServiceFieldNumber = 1, + kMethodFieldNumber = 2, + kPayloadFieldNumber = 3, + }; + // string service = 1; + void clear_service() ; + const ::std::string& service() const; + template + void set_service(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_service(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_service(); + void set_allocated_service(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_service() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_service(const ::std::string& value); ::std::string* PROTOBUF_NONNULL _internal_mutable_service(); public: @@ -1387,7 +2110,7 @@ class MODLOCK_API ServerCommandRequest final : public ::google::protobuf::Messag return *reinterpret_cast( &_ServerCommandRequest_default_instance_); } - static constexpr int kIndexInFileMessages = 13; + static constexpr int kIndexInFileMessages = 16; friend void swap(ServerCommandRequest& a, ServerCommandRequest& b) { a.Swap(&b); } inline void Swap(ServerCommandRequest* PROTOBUF_NONNULL other) { if (other == this) return; @@ -1794,7 +2517,7 @@ class MODLOCK_API PrecacheOptions final : public ::google::protobuf::Message return *reinterpret_cast( &_PrecacheOptions_default_instance_); } - static constexpr int kIndexInFileMessages = 14; + static constexpr int kIndexInFileMessages = 17; friend void swap(PrecacheOptions& a, PrecacheOptions& b) { a.Swap(&b); } inline void Swap(PrecacheOptions* PROTOBUF_NONNULL other) { if (other == this) return; @@ -2020,7 +2743,7 @@ class MODLOCK_API LogRequest final : public ::google::protobuf::Message return *reinterpret_cast( &_LogRequest_default_instance_); } - static constexpr int kIndexInFileMessages = 12; + static constexpr int kIndexInFileMessages = 15; friend void swap(LogRequest& a, LogRequest& b) { a.Swap(&b); } inline void Swap(LogRequest* PROTOBUF_NONNULL other) { if (other == this) return; @@ -4589,129 +5312,397 @@ inline void CommandResult::set_claimed(bool value) { SetHasBit(_impl_._has_bits_[0], 0x00000001U); // @@protoc_insertion_point(field_set:modlock.wasm.CommandResult.claimed) } -inline bool CommandResult::_internal_claimed() const { - ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.claimed_; +inline bool CommandResult::_internal_claimed() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.claimed_; +} +inline void CommandResult::_internal_set_claimed(bool value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.claimed_ = value; +} + +// ------------------------------------------------------------------- + +// WorldEvent + +// string map = 1; +inline void WorldEvent::clear_map() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.map_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& WorldEvent::map() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.WorldEvent.map) + return _internal_map(); +} +template +PROTOBUF_ALWAYS_INLINE void WorldEvent::set_map(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.map_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.WorldEvent.map) +} +inline ::std::string* PROTOBUF_NONNULL WorldEvent::mutable_map() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_map(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.WorldEvent.map) + return _s; +} +inline const ::std::string& WorldEvent::_internal_map() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.map_.Get(); +} +inline void WorldEvent::_internal_set_map(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.map_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL WorldEvent::_internal_mutable_map() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.map_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE WorldEvent::release_map() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.WorldEvent.map) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.map_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.map_.Set("", GetArena()); + } + return released; +} +inline void WorldEvent::set_allocated_map(::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_.map_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.map_.IsDefault()) { + _impl_.map_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.WorldEvent.map) +} + +// ------------------------------------------------------------------- + +// ServiceCall + +// string service = 1; +inline void ServiceCall::clear_service() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.service_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& ServiceCall::service() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.ServiceCall.service) + return _internal_service(); +} +template +PROTOBUF_ALWAYS_INLINE void ServiceCall::set_service(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.service_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.ServiceCall.service) +} +inline ::std::string* PROTOBUF_NONNULL ServiceCall::mutable_service() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_service(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.ServiceCall.service) + return _s; +} +inline const ::std::string& ServiceCall::_internal_service() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.service_.Get(); +} +inline void ServiceCall::_internal_set_service(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.service_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ServiceCall::_internal_mutable_service() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.service_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_service() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.ServiceCall.service) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.service_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.service_.Set("", GetArena()); + } + return released; +} +inline void ServiceCall::set_allocated_service(::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_.service_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.service_.IsDefault()) { + _impl_.service_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ServiceCall.service) +} + +// string method = 2; +inline void ServiceCall::clear_method() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.method_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& ServiceCall::method() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.ServiceCall.method) + return _internal_method(); +} +template +PROTOBUF_ALWAYS_INLINE void ServiceCall::set_method(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.method_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.ServiceCall.method) +} +inline ::std::string* PROTOBUF_NONNULL ServiceCall::mutable_method() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_method(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.ServiceCall.method) + return _s; +} +inline const ::std::string& ServiceCall::_internal_method() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.method_.Get(); +} +inline void ServiceCall::_internal_set_method(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.method_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ServiceCall::_internal_mutable_method() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.method_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_method() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.ServiceCall.method) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.method_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.method_.Set("", GetArena()); + } + return released; +} +inline void ServiceCall::set_allocated_method(::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_.method_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.method_.IsDefault()) { + _impl_.method_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ServiceCall.method) +} + +// bytes payload = 3; +inline void ServiceCall::clear_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.payload_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); +} +inline const ::std::string& ServiceCall::payload() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.ServiceCall.payload) + return _internal_payload(); +} +template +PROTOBUF_ALWAYS_INLINE void ServiceCall::set_payload(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.ServiceCall.payload) +} +inline ::std::string* PROTOBUF_NONNULL ServiceCall::mutable_payload() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_payload(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.ServiceCall.payload) + return _s; +} +inline const ::std::string& ServiceCall::_internal_payload() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.payload_.Get(); +} +inline void ServiceCall::_internal_set_payload(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.payload_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ServiceCall::_internal_mutable_payload() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.payload_.Mutable( GetArena()); } -inline void CommandResult::_internal_set_claimed(bool value) { +inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.claimed_ = value; + // @@protoc_insertion_point(field_release:modlock.wasm.ServiceCall.payload) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.payload_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.payload_.Set("", GetArena()); + } + return released; +} +inline void ServiceCall::set_allocated_payload(::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_.payload_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { + _impl_.payload_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ServiceCall.payload) } // ------------------------------------------------------------------- -// WorldEvent +// ServiceReply -// string map = 1; -inline void WorldEvent::clear_map() { +// bytes payload = 1; +inline void ServiceReply::clear_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.map_.ClearToEmpty(); + _impl_.payload_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& WorldEvent::map() const +inline const ::std::string& ServiceReply::payload() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.wasm.WorldEvent.map) - return _internal_map(); + // @@protoc_insertion_point(field_get:modlock.wasm.ServiceReply.payload) + return _internal_payload(); } template -PROTOBUF_ALWAYS_INLINE void WorldEvent::set_map(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceReply::set_payload(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); - _impl_.map_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.wasm.WorldEvent.map) + _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.ServiceReply.payload) } -inline ::std::string* PROTOBUF_NONNULL WorldEvent::mutable_map() +inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_payload() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); - ::std::string* _s = _internal_mutable_map(); - // @@protoc_insertion_point(field_mutable:modlock.wasm.WorldEvent.map) + ::std::string* _s = _internal_mutable_payload(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.ServiceReply.payload) return _s; } -inline const ::std::string& WorldEvent::_internal_map() const { +inline const ::std::string& ServiceReply::_internal_payload() const { ::google::protobuf::internal::TSanRead(&_impl_); - return _impl_.map_.Get(); + return _impl_.payload_.Get(); } -inline void WorldEvent::_internal_set_map(const ::std::string& value) { +inline void ServiceReply::_internal_set_payload(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); - _impl_.map_.Set(value, GetArena()); + _impl_.payload_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL WorldEvent::_internal_mutable_map() { +inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - return _impl_.map_.Mutable( GetArena()); + return _impl_.payload_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE WorldEvent::release_map() { +inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.wasm.WorldEvent.map) + // @@protoc_insertion_point(field_release:modlock.wasm.ServiceReply.payload) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } ClearHasBit(_impl_._has_bits_[0], 0x00000001U); - auto* released = _impl_.map_.Release(); + auto* released = _impl_.payload_.Release(); if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { - _impl_.map_.Set("", GetArena()); + _impl_.payload_.Set("", GetArena()); } return released; } -inline void WorldEvent::set_allocated_map(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceReply::set_allocated_payload(::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_.map_.SetAllocated(value, GetArena()); - if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.map_.IsDefault()) { - _impl_.map_.Set("", GetArena()); + _impl_.payload_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { + _impl_.payload_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.wasm.WorldEvent.map) + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ServiceReply.payload) } // ------------------------------------------------------------------- -// ServiceCall +// StartServiceCallRequest // string service = 1; -inline void ServiceCall::clear_service() { +inline void StartServiceCallRequest::clear_service() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.service_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& ServiceCall::service() const +inline const ::std::string& StartServiceCallRequest::service() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.wasm.ServiceCall.service) + // @@protoc_insertion_point(field_get:modlock.wasm.StartServiceCallRequest.service) return _internal_service(); } template -PROTOBUF_ALWAYS_INLINE void ServiceCall::set_service(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void StartServiceCallRequest::set_service(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); _impl_.service_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.wasm.ServiceCall.service) + // @@protoc_insertion_point(field_set:modlock.wasm.StartServiceCallRequest.service) } -inline ::std::string* PROTOBUF_NONNULL ServiceCall::mutable_service() +inline ::std::string* PROTOBUF_NONNULL StartServiceCallRequest::mutable_service() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); ::std::string* _s = _internal_mutable_service(); - // @@protoc_insertion_point(field_mutable:modlock.wasm.ServiceCall.service) + // @@protoc_insertion_point(field_mutable:modlock.wasm.StartServiceCallRequest.service) return _s; } -inline const ::std::string& ServiceCall::_internal_service() const { +inline const ::std::string& StartServiceCallRequest::_internal_service() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.service_.Get(); } -inline void ServiceCall::_internal_set_service(const ::std::string& value) { +inline void StartServiceCallRequest::_internal_set_service(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.service_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServiceCall::_internal_mutable_service() { +inline ::std::string* PROTOBUF_NONNULL StartServiceCallRequest::_internal_mutable_service() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.service_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_service() { +inline ::std::string* PROTOBUF_NULLABLE StartServiceCallRequest::release_service() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.wasm.ServiceCall.service) + // @@protoc_insertion_point(field_release:modlock.wasm.StartServiceCallRequest.service) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } @@ -4722,7 +5713,7 @@ inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_service() { } return released; } -inline void ServiceCall::set_allocated_service(::std::string* PROTOBUF_NULLABLE value) { +inline void StartServiceCallRequest::set_allocated_service(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000001U); @@ -4733,50 +5724,50 @@ inline void ServiceCall::set_allocated_service(::std::string* PROTOBUF_NULLABLE if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.service_.IsDefault()) { _impl_.service_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ServiceCall.service) + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.StartServiceCallRequest.service) } // string method = 2; -inline void ServiceCall::clear_method() { +inline void StartServiceCallRequest::clear_method() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.method_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000002U); } -inline const ::std::string& ServiceCall::method() const +inline const ::std::string& StartServiceCallRequest::method() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.wasm.ServiceCall.method) + // @@protoc_insertion_point(field_get:modlock.wasm.StartServiceCallRequest.method) return _internal_method(); } template -PROTOBUF_ALWAYS_INLINE void ServiceCall::set_method(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void StartServiceCallRequest::set_method(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000002U); _impl_.method_.Set(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.wasm.ServiceCall.method) + // @@protoc_insertion_point(field_set:modlock.wasm.StartServiceCallRequest.method) } -inline ::std::string* PROTOBUF_NONNULL ServiceCall::mutable_method() +inline ::std::string* PROTOBUF_NONNULL StartServiceCallRequest::mutable_method() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000002U); ::std::string* _s = _internal_mutable_method(); - // @@protoc_insertion_point(field_mutable:modlock.wasm.ServiceCall.method) + // @@protoc_insertion_point(field_mutable:modlock.wasm.StartServiceCallRequest.method) return _s; } -inline const ::std::string& ServiceCall::_internal_method() const { +inline const ::std::string& StartServiceCallRequest::_internal_method() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.method_.Get(); } -inline void ServiceCall::_internal_set_method(const ::std::string& value) { +inline void StartServiceCallRequest::_internal_set_method(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.method_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServiceCall::_internal_mutable_method() { +inline ::std::string* PROTOBUF_NONNULL StartServiceCallRequest::_internal_mutable_method() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.method_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_method() { +inline ::std::string* PROTOBUF_NULLABLE StartServiceCallRequest::release_method() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.wasm.ServiceCall.method) + // @@protoc_insertion_point(field_release:modlock.wasm.StartServiceCallRequest.method) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { return nullptr; } @@ -4787,7 +5778,7 @@ inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_method() { } return released; } -inline void ServiceCall::set_allocated_method(::std::string* PROTOBUF_NULLABLE value) { +inline void StartServiceCallRequest::set_allocated_method(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000002U); @@ -4798,50 +5789,50 @@ inline void ServiceCall::set_allocated_method(::std::string* PROTOBUF_NULLABLE v if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.method_.IsDefault()) { _impl_.method_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ServiceCall.method) + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.StartServiceCallRequest.method) } // bytes payload = 3; -inline void ServiceCall::clear_payload() { +inline void StartServiceCallRequest::clear_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.payload_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000004U); } -inline const ::std::string& ServiceCall::payload() const +inline const ::std::string& StartServiceCallRequest::payload() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.wasm.ServiceCall.payload) + // @@protoc_insertion_point(field_get:modlock.wasm.StartServiceCallRequest.payload) return _internal_payload(); } template -PROTOBUF_ALWAYS_INLINE void ServiceCall::set_payload(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void StartServiceCallRequest::set_payload(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000004U); _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.wasm.ServiceCall.payload) + // @@protoc_insertion_point(field_set:modlock.wasm.StartServiceCallRequest.payload) } -inline ::std::string* PROTOBUF_NONNULL ServiceCall::mutable_payload() +inline ::std::string* PROTOBUF_NONNULL StartServiceCallRequest::mutable_payload() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000004U); ::std::string* _s = _internal_mutable_payload(); - // @@protoc_insertion_point(field_mutable:modlock.wasm.ServiceCall.payload) + // @@protoc_insertion_point(field_mutable:modlock.wasm.StartServiceCallRequest.payload) return _s; } -inline const ::std::string& ServiceCall::_internal_payload() const { +inline const ::std::string& StartServiceCallRequest::_internal_payload() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.payload_.Get(); } -inline void ServiceCall::_internal_set_payload(const ::std::string& value) { +inline void StartServiceCallRequest::_internal_set_payload(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.payload_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServiceCall::_internal_mutable_payload() { +inline ::std::string* PROTOBUF_NONNULL StartServiceCallRequest::_internal_mutable_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.payload_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_payload() { +inline ::std::string* PROTOBUF_NULLABLE StartServiceCallRequest::release_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.wasm.ServiceCall.payload) + // @@protoc_insertion_point(field_release:modlock.wasm.StartServiceCallRequest.payload) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { return nullptr; } @@ -4852,7 +5843,7 @@ inline ::std::string* PROTOBUF_NULLABLE ServiceCall::release_payload() { } return released; } -inline void ServiceCall::set_allocated_payload(::std::string* PROTOBUF_NULLABLE value) { +inline void StartServiceCallRequest::set_allocated_payload(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000004U); @@ -4863,54 +5854,133 @@ inline void ServiceCall::set_allocated_payload(::std::string* PROTOBUF_NULLABLE if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { _impl_.payload_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ServiceCall.payload) + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.StartServiceCallRequest.payload) +} + +// uint32 timeout_milliseconds = 4; +inline void StartServiceCallRequest::clear_timeout_milliseconds() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.timeout_milliseconds_ = 0u; + ClearHasBit(_impl_._has_bits_[0], + 0x00000008U); +} +inline ::uint32_t StartServiceCallRequest::timeout_milliseconds() const { + // @@protoc_insertion_point(field_get:modlock.wasm.StartServiceCallRequest.timeout_milliseconds) + return _internal_timeout_milliseconds(); +} +inline void StartServiceCallRequest::set_timeout_milliseconds(::uint32_t value) { + _internal_set_timeout_milliseconds(value); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_set:modlock.wasm.StartServiceCallRequest.timeout_milliseconds) +} +inline ::uint32_t StartServiceCallRequest::_internal_timeout_milliseconds() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.timeout_milliseconds_; +} +inline void StartServiceCallRequest::_internal_set_timeout_milliseconds(::uint32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.timeout_milliseconds_ = value; } // ------------------------------------------------------------------- -// ServiceReply +// ServiceCallStarted -// bytes payload = 1; -inline void ServiceReply::clear_payload() { +// uint64 call = 1; +inline void ServiceCallStarted::clear_call() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.call_ = ::uint64_t{0u}; + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline ::uint64_t ServiceCallStarted::call() const { + // @@protoc_insertion_point(field_get:modlock.wasm.ServiceCallStarted.call) + return _internal_call(); +} +inline void ServiceCallStarted::set_call(::uint64_t value) { + _internal_set_call(value); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_set:modlock.wasm.ServiceCallStarted.call) +} +inline ::uint64_t ServiceCallStarted::_internal_call() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.call_; +} +inline void ServiceCallStarted::_internal_set_call(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.call_ = value; +} + +// ------------------------------------------------------------------- + +// ServiceRepliedEvent + +// uint64 call = 1; +inline void ServiceRepliedEvent::clear_call() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.call_ = ::uint64_t{0u}; + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); +} +inline ::uint64_t ServiceRepliedEvent::call() const { + // @@protoc_insertion_point(field_get:modlock.wasm.ServiceRepliedEvent.call) + return _internal_call(); +} +inline void ServiceRepliedEvent::set_call(::uint64_t value) { + _internal_set_call(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:modlock.wasm.ServiceRepliedEvent.call) +} +inline ::uint64_t ServiceRepliedEvent::_internal_call() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.call_; +} +inline void ServiceRepliedEvent::_internal_set_call(::uint64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.call_ = value; +} + +// bytes payload = 2; +inline void ServiceRepliedEvent::clear_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.payload_.ClearToEmpty(); ClearHasBit(_impl_._has_bits_[0], 0x00000001U); } -inline const ::std::string& ServiceReply::payload() const +inline const ::std::string& ServiceRepliedEvent::payload() const ABSL_ATTRIBUTE_LIFETIME_BOUND { - // @@protoc_insertion_point(field_get:modlock.wasm.ServiceReply.payload) + // @@protoc_insertion_point(field_get:modlock.wasm.ServiceRepliedEvent.payload) return _internal_payload(); } template -PROTOBUF_ALWAYS_INLINE void ServiceReply::set_payload(Arg_&& arg, Args_... args) { +PROTOBUF_ALWAYS_INLINE void ServiceRepliedEvent::set_payload(Arg_&& arg, Args_... args) { ::google::protobuf::internal::TSanWrite(&_impl_); SetHasBit(_impl_._has_bits_[0], 0x00000001U); _impl_.payload_.SetBytes(static_cast(arg), args..., GetArena()); - // @@protoc_insertion_point(field_set:modlock.wasm.ServiceReply.payload) + // @@protoc_insertion_point(field_set:modlock.wasm.ServiceRepliedEvent.payload) } -inline ::std::string* PROTOBUF_NONNULL ServiceReply::mutable_payload() +inline ::std::string* PROTOBUF_NONNULL ServiceRepliedEvent::mutable_payload() ABSL_ATTRIBUTE_LIFETIME_BOUND { SetHasBit(_impl_._has_bits_[0], 0x00000001U); ::std::string* _s = _internal_mutable_payload(); - // @@protoc_insertion_point(field_mutable:modlock.wasm.ServiceReply.payload) + // @@protoc_insertion_point(field_mutable:modlock.wasm.ServiceRepliedEvent.payload) return _s; } -inline const ::std::string& ServiceReply::_internal_payload() const { +inline const ::std::string& ServiceRepliedEvent::_internal_payload() const { ::google::protobuf::internal::TSanRead(&_impl_); return _impl_.payload_.Get(); } -inline void ServiceReply::_internal_set_payload(const ::std::string& value) { +inline void ServiceRepliedEvent::_internal_set_payload(const ::std::string& value) { ::google::protobuf::internal::TSanWrite(&_impl_); _impl_.payload_.Set(value, GetArena()); } -inline ::std::string* PROTOBUF_NONNULL ServiceReply::_internal_mutable_payload() { +inline ::std::string* PROTOBUF_NONNULL ServiceRepliedEvent::_internal_mutable_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); return _impl_.payload_.Mutable( GetArena()); } -inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_payload() { +inline ::std::string* PROTOBUF_NULLABLE ServiceRepliedEvent::release_payload() { ::google::protobuf::internal::TSanWrite(&_impl_); - // @@protoc_insertion_point(field_release:modlock.wasm.ServiceReply.payload) + // @@protoc_insertion_point(field_release:modlock.wasm.ServiceRepliedEvent.payload) if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { return nullptr; } @@ -4921,7 +5991,7 @@ inline ::std::string* PROTOBUF_NULLABLE ServiceReply::release_payload() { } return released; } -inline void ServiceReply::set_allocated_payload(::std::string* PROTOBUF_NULLABLE value) { +inline void ServiceRepliedEvent::set_allocated_payload(::std::string* PROTOBUF_NULLABLE value) { ::google::protobuf::internal::TSanWrite(&_impl_); if (value != nullptr) { SetHasBit(_impl_._has_bits_[0], 0x00000001U); @@ -4932,7 +6002,97 @@ inline void ServiceReply::set_allocated_payload(::std::string* PROTOBUF_NULLABLE if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.payload_.IsDefault()) { _impl_.payload_.Set("", GetArena()); } - // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ServiceReply.payload) + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ServiceRepliedEvent.payload) +} + +// .modlock.wasm.ServiceFailure failure = 3; +inline void ServiceRepliedEvent::clear_failure() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.failure_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000008U); +} +inline ::modlock::wasm::ServiceFailure ServiceRepliedEvent::failure() const { + // @@protoc_insertion_point(field_get:modlock.wasm.ServiceRepliedEvent.failure) + return _internal_failure(); +} +inline void ServiceRepliedEvent::set_failure(::modlock::wasm::ServiceFailure value) { + _internal_set_failure(value); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_set:modlock.wasm.ServiceRepliedEvent.failure) +} +inline ::modlock::wasm::ServiceFailure ServiceRepliedEvent::_internal_failure() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return static_cast<::modlock::wasm::ServiceFailure>(_impl_.failure_); +} +inline void ServiceRepliedEvent::_internal_set_failure(::modlock::wasm::ServiceFailure value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.failure_ = value; +} + +// string error = 4; +inline void ServiceRepliedEvent::clear_error() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.error_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& ServiceRepliedEvent::error() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:modlock.wasm.ServiceRepliedEvent.error) + return _internal_error(); +} +template +PROTOBUF_ALWAYS_INLINE void ServiceRepliedEvent::set_error(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.error_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:modlock.wasm.ServiceRepliedEvent.error) +} +inline ::std::string* PROTOBUF_NONNULL ServiceRepliedEvent::mutable_error() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_error(); + // @@protoc_insertion_point(field_mutable:modlock.wasm.ServiceRepliedEvent.error) + return _s; +} +inline const ::std::string& ServiceRepliedEvent::_internal_error() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.error_.Get(); +} +inline void ServiceRepliedEvent::_internal_set_error(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.error_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL ServiceRepliedEvent::_internal_mutable_error() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.error_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE ServiceRepliedEvent::release_error() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:modlock.wasm.ServiceRepliedEvent.error) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.error_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.error_.Set("", GetArena()); + } + return released; +} +inline void ServiceRepliedEvent::set_allocated_error(::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_.error_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.error_.IsDefault()) { + _impl_.error_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:modlock.wasm.ServiceRepliedEvent.error) } // ------------------------------------------------------------------- @@ -5230,6 +6390,19 @@ PrecacheOptions::_internal_mutable_resources() { } // namespace modlock +namespace google { +namespace protobuf { + +template <> +struct is_proto_enum<::modlock::wasm::ServiceFailure> : std::true_type {}; +template <> +inline const EnumDescriptor* PROTOBUF_NONNULL GetEnumDescriptor<::modlock::wasm::ServiceFailure>() { + return ::modlock::wasm::ServiceFailure_descriptor(); +} + +} // namespace protobuf +} // namespace google + // @@protoc_insertion_point(global_scope) #include "google/protobuf/port_undef.inc" diff --git a/src/wasm/wasm.pb.ts b/src/wasm/wasm.pb.ts index c2d5a5c7..0ff58cf5 100644 --- a/src/wasm/wasm.pb.ts +++ b/src/wasm/wasm.pb.ts @@ -2,6 +2,7 @@ // @generated from file github.com/paralin/modlock/src/wasm/wasm.proto (package modlock.wasm, syntax proto3) /* eslint-disable */ +import { createEnumType } from '@aptre/protobuf-es-lite/enum' import type { MessageType } from '@aptre/protobuf-es-lite/message' import { createMessageType } from '@aptre/protobuf-es-lite/message' import type { @@ -11,6 +12,44 @@ import type { import type { InteractionKind } from './movement/movement.pb.js' import { InteractionKind_Enum, MovementSample } from './movement/movement.pb.js' +/** + * ServiceFailure says why a service call ended without an answer. + * + * @generated from enum modlock.wasm.ServiceFailure + */ +export enum ServiceFailure { + /** + * SERVICE_FAILURE_NONE is an answered call. + */ + NONE = 0, + + /** + * SERVICE_FAILURE_REFUSED is a call the service answered with an error. + */ + REFUSED = 1, + + /** + * SERVICE_FAILURE_TIMEOUT is a call that waited out its timeout. + */ + TIMEOUT = 2, + + /** + * SERVICE_FAILURE_UNAVAILABLE is a call to a service nobody provides + * here, or one more than the host keeps waiting for a mod. + */ + UNAVAILABLE = 3, +} + +export const ServiceFailure_Enum = /* @__PURE__ */ createEnumType( + 'modlock.wasm.ServiceFailure', + [ + [0, 'SERVICE_FAILURE_NONE'], + [1, 'SERVICE_FAILURE_REFUSED'], + [2, 'SERVICE_FAILURE_TIMEOUT'], + [3, 'SERVICE_FAILURE_UNAVAILABLE'], + ], +) + /** * Call is one method call across the boundary: a mod calling the game * through modlock.host_call, or the game delivering an event through the @@ -812,6 +851,217 @@ export const ServiceReply: MessageType = }, ) +/** + * StartServiceCallRequest calls one method of a service the host provides, + * to be answered in a later frame. + * + * @generated from message modlock.wasm.StartServiceCallRequest + */ +export interface StartServiceCallRequest { + /** + * Service names the service, such as "arena.match". + */ + service?: string + /** + * Method names the method within the service. + */ + method?: string + /** + * Payload is the call's argument. + */ + payload?: Uint8Array + /** + * TimeoutMilliseconds is how long the mod waits for the answer; zero or + * more than 30 seconds waits 30 seconds. + */ + timeoutMilliseconds?: number +} + +export const StartServiceCallRequest: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.StartServiceCallRequest', + () => [ + [1, 'service', 9], + [2, 'method', 9], + [3, 'payload', 12], + [4, 'timeout_milliseconds', 13], + ], + { + decode: ( + r: BinaryReader, + end: number, + m: StartServiceCallRequest, + ): StartServiceCallRequest => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.service = r.string() + break + case 2: + m.method = r.string() + break + case 3: + m.payload = r.bytes() + break + case 4: + m.timeoutMilliseconds = r.uint32() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: StartServiceCallRequest, w: Writer): void => { + { + const v = m.service + if (v) w.uint32(10).string(v) + } + { + const v = m.method + if (v) w.uint32(18).string(v) + } + { + const v = m.payload + if (v != null && v.length !== 0) w.uint32(26).bytes(v) + } + { + const v = m.timeoutMilliseconds + if (v) w.uint32(32).uint32(v) + } + }, + }, + ) + +/** + * ServiceCallStarted numbers a started service call. + * + * @generated from message modlock.wasm.ServiceCallStarted + */ +export interface ServiceCallStarted { + /** + * Call is the number the call's ServiceReplied event carries, unique for + * the mod's instance. + */ + call?: bigint +} + +export const ServiceCallStarted: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.ServiceCallStarted', + () => [[1, 'call', 4]], + { + decode: ( + r: BinaryReader, + end: number, + m: ServiceCallStarted, + ): ServiceCallStarted => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.call = r.uint64() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: ServiceCallStarted, w: Writer): void => { + { + const v = m.call + if (v) w.uint32(8).uint64(v) + } + }, + }, + ) + +/** + * ServiceRepliedEvent ends one started service call. + * + * @generated from message modlock.wasm.ServiceRepliedEvent + */ +export interface ServiceRepliedEvent { + /** + * Call is the number StartServiceCall returned. + */ + call?: bigint + /** + * Payload is the answer, when failure is none. + */ + payload?: Uint8Array + /** + * Failure says why the call ended without an answer. + */ + failure?: ServiceFailure + /** + * Error describes the failure. + */ + error?: string +} + +export const ServiceRepliedEvent: MessageType = + /* @__PURE__ */ createMessageType( + 'modlock.wasm.ServiceRepliedEvent', + () => [ + [1, 'call', 4], + [2, 'payload', 12], + [3, 'failure', 14, 0, ServiceFailure_Enum], + [4, 'error', 9], + ], + { + decode: ( + r: BinaryReader, + end: number, + m: ServiceRepliedEvent, + ): ServiceRepliedEvent => { + while (r.pos < end) { + const t = r.tag() + if ((t & 7) === 4) return m + switch (t >>> 3) { + case 1: + m.call = r.uint64() + break + case 2: + m.payload = r.bytes() + break + case 3: + m.failure = r.int32() + break + case 4: + m.error = r.string() + break + default: + r.skip(t) + } + } + return m + }, + encode: (m: ServiceRepliedEvent, w: Writer): void => { + { + const v = m.call + if (v) w.uint32(8).uint64(v) + } + { + const v = m.payload + if (v != null && v.length !== 0) w.uint32(18).bytes(v) + } + { + const v = m.failure + if (v) w.uint32(24).int32(v) + } + { + const v = m.error + if (v) w.uint32(34).string(v) + } + }, + }, + ) + /** * LogRequest carries one log line. * diff --git a/src/wasm/wasm.proto b/src/wasm/wasm.proto index e7a5cc7b..d929fae9 100644 --- a/src/wasm/wasm.proto +++ b/src/wasm/wasm.proto @@ -569,6 +569,16 @@ service Host { // service defines the payload's encoding. rpc CallService(ServiceCall) returns (ServiceReply); + // StartServiceCall calls method of a service the host provides and + // returns at once with a number; the answer arrives in a later frame as a + // ServiceReplied event carrying that number. Every call ends once: with + // the reply, the service's refusal, a timeout or no provider at all. A + // service nobody provides is never asked. The host waits at most 30 + // seconds, or the call's shorter timeout, and drops the mod's waiting + // calls when the mod stops or reloads. A service that answers at once + // answers this way too, in the next frame. + rpc StartServiceCall(StartServiceCallRequest) returns (ServiceCallStarted); + // CreateEntity creates an entity the server knows by its designer name, // such as npc_trooper_boss or prop_dynamic, with spawn key values and fields // written before it spawns. The world removes it when the world ends; @@ -777,6 +787,9 @@ service Mod { // Serve calls a service the mod serves from the host. rpc Serve(ServiceCall) returns (ServiceReply); + // ServiceReplied ends one StartServiceCall, in a frame after the call. + rpc ServiceReplied(ServiceRepliedEvent) returns (Empty); + // Damage offers one hit before the game applies it, while the mod asked // for damage. The mod's answer may block the hit or change its amount. rpc Damage(modlock.wasm.combat.DamageEvent) returns (modlock.wasm.combat.DamageResult); @@ -1000,6 +1013,58 @@ message ServiceReply { bytes payload = 1; } +// StartServiceCallRequest calls one method of a service the host provides, +// to be answered in a later frame. +message StartServiceCallRequest { + // Service names the service, such as "arena.match". + string service = 1; + + // Method names the method within the service. + string method = 2; + + // Payload is the call's argument. + bytes payload = 3; + + // TimeoutMilliseconds is how long the mod waits for the answer; zero or + // more than 30 seconds waits 30 seconds. + uint32 timeout_milliseconds = 4; +} + +// ServiceCallStarted numbers a started service call. +message ServiceCallStarted { + // Call is the number the call's ServiceReplied event carries, unique for + // the mod's instance. + uint64 call = 1; +} + +// ServiceFailure says why a service call ended without an answer. +enum ServiceFailure { + // SERVICE_FAILURE_NONE is an answered call. + SERVICE_FAILURE_NONE = 0; + // SERVICE_FAILURE_REFUSED is a call the service answered with an error. + SERVICE_FAILURE_REFUSED = 1; + // SERVICE_FAILURE_TIMEOUT is a call that waited out its timeout. + SERVICE_FAILURE_TIMEOUT = 2; + // SERVICE_FAILURE_UNAVAILABLE is a call to a service nobody provides + // here, or one more than the host keeps waiting for a mod. + SERVICE_FAILURE_UNAVAILABLE = 3; +} + +// ServiceRepliedEvent ends one started service call. +message ServiceRepliedEvent { + // Call is the number StartServiceCall returned. + uint64 call = 1; + + // Payload is the answer, when failure is none. + bytes payload = 2; + + // Failure says why the call ended without an answer. + ServiceFailure failure = 3; + + // Error describes the failure. + string error = 4; +} + // LogRequest carries one log line. message LogRequest { // Message is the text to log, without a trailing newline. diff --git a/src/wasm/wasm_host.cc b/src/wasm/wasm_host.cc index 1eb19111..95d7e01a 100644 --- a/src/wasm/wasm_host.cc +++ b/src/wasm/wasm_host.cc @@ -100,6 +100,14 @@ void WasmHost::Provide(std::string service, WasmExtension extension) { } } +void WasmHost::ProvideLater(std::string service, WasmLateExtension extension) { + if (extension) { + impl_->late_extensions.insert_or_assign(std::move(service), std::move(extension)); + } else { + impl_->late_extensions.erase(service); + } +} + void WasmHost::KeepSettings(WasmSettings* settings) { impl_->settings = settings ? settings : &impl_->kept; } diff --git a/src/wasm/wasm_plugin.cc b/src/wasm/wasm_plugin.cc index 80739870..e9caae1b 100644 --- a/src/wasm/wasm_plugin.cc +++ b/src/wasm/wasm_plugin.cc @@ -242,6 +242,21 @@ std::expected WasmPlugin::Input(int32_t slot, std::string_vie return {}; } +std::expected WasmPlugin::Action(int32_t slot, std::string_view line) { + // Refuse a press the running mod's layout did not send. + if (!instance_) { + return std::unexpected(name_ + " is not running"); + } + auto event = ui_.Action(slot, line, std::chrono::steady_clock::now()); + if (!event) { + return std::unexpected(name_ + " " + event.error()); + } + + // Deliver the press to the mod. + static_cast(mod_.UiPress(*event)); + return {}; +} + std::expected WasmPlugin::Serve(const wasm::ServiceCall& call) { auto reply = mod_.Serve(call); if (!reply) { @@ -251,6 +266,17 @@ std::expected WasmPlugin::Serve(const wasm::ServiceCal } std::expected WasmPlugin::Begin(bool reloaded) { + // A mod whose needed service nobody here provides does not start, and the + // error names the service. + for (const auto& service : manifest_.services()) { + if (!service.optional() && !host_.extensions.contains(service.name()) && + !host_.late_extensions.contains(service.name())) { + auto error = "the mod needs service " + service.name() + ", which nobody provides here"; + Failed(error); + return std::unexpected(std::move(error)); + } + } + // Start the mod and learn which events it consumes. wasm::StartEvent event; for (const auto& arg : args_) { @@ -301,7 +327,10 @@ void WasmPlugin::Halt() { Untune(untuned_); tuned_ = false; - // Drop the movement, the subscriptions and the game state. + // Drop the movement, the subscriptions, the started service calls and + // the game state. + service_calls_.Drop(); + host_.Notify([&](WasmHostObserver& observer) { observer.Halted(name_); }); movement_.reset(); hero_slots_.clear(); Unsubscribe(); @@ -519,6 +548,9 @@ void WasmPlugin::Tick() { ReportCalls(); } + // End the started service calls that ended, which need no game. + DeliverServiceReplies(); + // Run the game's frame work, and deliver the frame to a mod that wants it. if (GameOpen()) { Play(); diff --git a/src/wasm/wasm_plugin.h b/src/wasm/wasm_plugin.h index 8ee94163..b977efdc 100644 --- a/src/wasm/wasm_plugin.h +++ b/src/wasm/wasm_plugin.h @@ -32,6 +32,7 @@ #include "wasm/metrics.h" #include "wasm/player_scope.h" #include "wasm/runtime.h" +#include "wasm/service_calls.h" #include "wasm/settings.h" #include "wasm/ui.h" @@ -49,6 +50,9 @@ struct Mods { std::map> plugins; // extensions holds the services the host provides, by name. std::map> extensions; + // late_extensions holds the services the host answers in a later frame, + // by name. + std::map> late_extensions; // settings keeps players' settings: kept unless the host was given a // keeper. FileSettings kept; @@ -92,6 +96,8 @@ class PluginGame final : public wasm::Game { std::expected Players() override; std::expected CallService( const wasm::ServiceCall& request) override; + std::expected StartServiceCall( + const wasm::StartServiceCallRequest& request) override; std::expected PlayerSetting( const wasm::settings::PlayerSettingRequest& request) override; std::expected SetPlayerSetting( @@ -212,6 +218,11 @@ class WasmPlugin final : public Plugin { // it. std::expected Input(int32_t slot, std::string_view line); + // Action delivers a press a layout the mod shows the player in slot sent: + // line is the layout's id, the action and the payload as UiTrees::Action + // reads them. + std::expected Action(int32_t slot, std::string_view line); + // Serve delivers one call to a service the mod serves and returns its answer. std::expected Serve(const wasm::ServiceCall& call); @@ -224,6 +235,11 @@ class WasmPlugin final : public Plugin { // CallService answers the mod's call to a service the host provides. std::expected CallService(const wasm::ServiceCall& call); + // StartServiceCall starts the mod's call to a service the host provides, + // which a later frame ends with a ServiceReplied event. + std::expected StartServiceCall( + const wasm::StartServiceCallRequest& request); + // PlayerSetting returns the value of the setting named key for the player // in slot: the kept value while the manifest still accepts it, and the // default otherwise. @@ -351,6 +367,9 @@ class WasmPlugin final : public Plugin { // DeliverGameEvents passes on the button changes and ended restores the // game queued. void DeliverGameEvents(); + // DeliverServiceReplies tells the mod of each started service call that + // ended. + void DeliverServiceReplies(); void Unsubscribe(); // Move installs the manifest's movement model on the server. void Move(); @@ -519,6 +538,10 @@ class WasmPlugin final : public Plugin { std::string slowest_report_; wasm::profile::SlowFrame slowest_frame_; + // service_calls_ holds the running instance's started service calls until + // a frame delivers their ends. + wasm::ServiceCalls service_calls_; + // calls_ counts the mod's host calls since calls_reported_, the last time // they went to the observers. wasm::CallProfile calls_; diff --git a/src/wasm/wasm_plugin_calls.cc b/src/wasm/wasm_plugin_calls.cc index 1ea30099..a782672c 100644 --- a/src/wasm/wasm_plugin_calls.cc +++ b/src/wasm/wasm_plugin_calls.cc @@ -25,6 +25,11 @@ constexpr std::string_view kPressCommand = "modlockpress "; // with the value as UiTrees::Input reads it. constexpr std::string_view kInputCommand = "modlockinput "; +// kActionCommand starts the console command a mod's layout script sends to +// press back to its mod: "modlockaction [payload]", +// with the rest as UiTrees::Action reads it. +constexpr std::string_view kActionCommand = "modlockaction "; + // kHandoffLimit is the most bytes of handoff state a mod holds for the game // or for one player. constexpr size_t kHandoffLimit = 64 * 1024; @@ -160,6 +165,19 @@ bool WasmPlugin::Command(int32_t slot, std::string_view raw_line) { return true; } + if (line.starts_with(kActionCommand)) { + // A layout's press names this mod, then its layout, action and payload. + const auto sent = line.substr(kActionCommand.size()); + const auto space = sent.find(' '); + if (space == std::string_view::npos || sent.substr(0, space) != slug_) { + return false; + } + if (auto refused = Action(slot, sent.substr(space + 1)); !refused) { + Log(refused.error()); + } + return true; + } + // Then the free for all, then the mod, may claim the command. if (game_.FreeForAllCommand(line)) { return true; @@ -287,6 +305,10 @@ std::expected WasmPlugin::CallService( // Find the service, ask it, and wrap its answer. auto found = host_.extensions.find(call.service()); if (found == host_.extensions.end()) { + if (host_.late_extensions.contains(call.service())) { + return std::unexpected("the service " + call.service() + + " answers only calls started with StartServiceCall"); + } return std::unexpected("this host provides no service " + call.service()); } auto answer = found->second(name_, call.method(), call.payload()); @@ -298,6 +320,30 @@ std::expected WasmPlugin::CallService( return reply; } +std::expected WasmPlugin::StartServiceCall( + const wasm::StartServiceCallRequest& request) { + // Number the call; a mod holding too many is refused at once. + auto started = service_calls_.Start(std::chrono::milliseconds(request.timeout_milliseconds())); + if (!started) { + return std::unexpected(started.error()); + } + wasm::ServiceCallStarted reply; + reply.set_call(started->call); + + // Hand the call to the service's late extension, or answer it now from + // its extension. A service nobody provides is never asked. + const auto& service = request.service(); + if (auto late = host_.late_extensions.find(service); late != host_.late_extensions.end()) { + late->second(name_, request.method(), request.payload(), std::move(started->reply)); + } else if (auto found = host_.extensions.find(service); found != host_.extensions.end()) { + started->reply(found->second(name_, request.method(), request.payload())); + } else { + service_calls_.Fail(started->call, wasm::SERVICE_FAILURE_UNAVAILABLE, + "this host provides no service " + service); + } + return reply; +} + std::expected WasmPlugin::PlayerSetting(int32_t slot, std::string_view key) { const auto* setting = wasm::FindSetting(manifest_, key); @@ -443,10 +489,14 @@ uint64_t WasmPlugin::SteamId(int32_t slot) { bool PluginGame::AnswersWithoutGame(std::string_view method) { // Keep this list to the host calls this class overrides. - static constexpr std::array kMethods = { - "Log", "Ui", "CallService", "PlayerSetting", "SetPlayerSetting", "AddMetric", - "HoldReload", "Handoff", "HandedOff", "PlayerHandoff", "PlayerHandedOff", "ReadFile", - "WriteFile", + static constexpr std::array kMethods = { + "Log", "Ui", + "CallService", "StartServiceCall", + "PlayerSetting", "SetPlayerSetting", + "AddMetric", "HoldReload", + "Handoff", "HandedOff", + "PlayerHandoff", "PlayerHandedOff", + "ReadFile", "WriteFile", }; return std::ranges::find(kMethods, method) != kMethods.end(); } @@ -496,6 +546,11 @@ std::expected PluginGame::CallService( return plugin_.CallService(request); } +std::expected PluginGame::StartServiceCall( + const wasm::StartServiceCallRequest& request) { + return plugin_.StartServiceCall(request); +} + std::expected PluginGame::PlayerSetting( const wasm::settings::PlayerSettingRequest& request) { // Read the setting and wrap it. diff --git a/src/wasm/wasm_plugin_events.cc b/src/wasm/wasm_plugin_events.cc index a8ad4bca..a5ccc808 100644 --- a/src/wasm/wasm_plugin_events.cc +++ b/src/wasm/wasm_plugin_events.cc @@ -615,6 +615,16 @@ void WasmPlugin::DeliverGameEvents() { } } +void WasmPlugin::DeliverServiceReplies() { + for (const auto& replied : service_calls_.Take(std::chrono::steady_clock::now())) { + // Tell the mod of each ended call while it runs. + if (!instance_) { + return; + } + static_cast(mod_.ServiceReplied(replied)); + } +} + void WasmPlugin::Unsubscribe() { // Drop the player and combat subscriptions. players_.Reset(); diff --git a/tests/host_fixtures_test.cc b/tests/host_fixtures_test.cc new file mode 100644 index 00000000..0a3e2aa7 --- /dev/null +++ b/tests/host_fixtures_test.cc @@ -0,0 +1,332 @@ +// Contract tests for a mod's needed services and the host's fixtures: a mod +// whose needed service nobody provides does not start and its failure names +// the service, an optional one starts the mod, a fixture handed to the host +// at start answers each method with its reply, for its own mod only, and a +// forwarded service reaches the controller over the control link and ends +// with its answer. +#ifndef _WIN32 +#include +#include +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gtest/gtest.h" +#include "host_app/control_link.h" +#include "host_app/fixtures.h" +#include "modlock/wasm_host.h" +#include "src/host_app/control/control.pb.h" + +namespace { + +using modlock::PluginContext; +using modlock::WasmHost; +using modlock::WasmHostObserver; + +// Failures records the failures the host's mods report. +class Failures final : public WasmHostObserver { + public: + void Started(std::string_view, bool) override {} + void Logged(std::string_view, std::string_view) override {} + void Failed(std::string_view, std::string_view error) override { seen.emplace_back(error); } + void Ui(std::string_view, int32_t, const modlock::wasm::ui::Change&) override {} + + std::vector seen; +}; + +// Build stages the test mod under a mod.json that names services. +class Build { + public: + explicit Build(std::string_view services) + : root_(std::filesystem::temp_directory_path() / "modlock-host-fixtures-test") { + std::filesystem::remove_all(root_); + std::filesystem::create_directories(root_); + std::filesystem::copy_file(EXTENSION_GO_WASM, root_ / "mod.wasm"); + std::ofstream(root_ / "mod.json") + << R"({"slug":"extension-go","runtime":"RUNTIME_WASM","entry":"mod.wasm","services":)" << services << "}"; + } + ~Build() { std::filesystem::remove_all(root_); } + Build(const Build&) = delete; + Build& operator=(const Build&) = delete; + + const std::filesystem::path& Path() const { return root_; } + + private: + std::filesystem::path root_; +}; + +// Fixtures encodes one reply of service shout for mod. +std::string Fixtures(std::string_view mod) { + modlock::host_app::control::Fixtures fixtures; + auto* fixture = fixtures.add_fixtures(); + fixture->set_mod(std::string(mod)); + fixture->set_service("shout"); + fixture->set_method("say"); + fixture->set_payload(R"({"said":"hi"})"); + fixture->set_source("services/shout.json"); + return fixtures.SerializeAsString(); +} + +TEST(HostFixtures, ANeededServiceNobodyProvidesStopsTheStart) { + // With nothing provided, the mod that needs shout does not start, and its + // failure names the service. + Build build(R"([{"name":"shout"},{"name":"ghost","optional":true}])"); + WasmHost host({}); + Failures failures; + host.Observe(&failures); + auto plugin = host.Load(build.Path(), PluginContext{.check_only = true}); + ASSERT_TRUE(plugin) << plugin.error(); + EXPECT_FALSE((*plugin)->Start()); + ASSERT_EQ(failures.seen.size(), 1u); + EXPECT_EQ(failures.seen[0], "the mod needs service shout, which nobody provides here"); + + // A service answered later counts as provided; the optional ghost does not + // hold the start. + host.ProvideLater("shout", [](std::string_view, std::string_view, std::string_view, + modlock::WasmReply reply) { reply(std::string("late")); }); + EXPECT_TRUE((*plugin)->Start()); + (*plugin)->Stop(); + host.Unobserve(&failures); +} + +TEST(HostFixtures, AFixtureAnswersItsModsCalls) { + // The fixture provides shout, so the mod that needs it starts, and the host + // logs who answers. + Build build(R"([{"name":"shout"}])"); + WasmHost host({}); + auto provided = modlock::host_app::ProvideFixtures(host, Fixtures("extension-go")); + ASSERT_TRUE(provided) << provided.error(); + EXPECT_EQ(*provided, "extension-go: service shout: fixture services/shout.json\n"); + auto plugin = host.Load(build.Path(), PluginContext{.check_only = true}); + ASSERT_TRUE(plugin) << plugin.error(); + ASSERT_TRUE((*plugin)->Start()); + + // A method's call gets its reply; a method the fixture lacks is refused, + // naming the file. + auto answer = host.Call("extension-go", "echo", "say", ""); + ASSERT_TRUE(answer) << answer.error(); + EXPECT_EQ(*answer, R"({"said":"hi"})"); + auto missing = host.Call("extension-go", "echo", "sing", ""); + ASSERT_FALSE(missing); + EXPECT_EQ(missing.error(), "the fixture services/shout.json has no method sing"); + (*plugin)->Stop(); +} + +TEST(HostFixtures, AFixtureAnswersNoOtherMod) { + // Another mod's fixture of the same service does not answer this one. + Build build(R"([{"name":"shout","optional":true}])"); + WasmHost host({}); + ASSERT_TRUE(modlock::host_app::ProvideFixtures(host, Fixtures("arena"))); + auto plugin = host.Load(build.Path(), PluginContext{.check_only = true}); + ASSERT_TRUE(plugin) << plugin.error(); + ASSERT_TRUE((*plugin)->Start()); + auto refused = host.Call("extension-go", "echo", "say", ""); + ASSERT_FALSE(refused); + EXPECT_EQ(refused.error(), "this host has no fixture of this service for extension-go"); + (*plugin)->Stop(); + + // A file that is not a Fixtures message provides nothing. + EXPECT_FALSE(modlock::host_app::ProvideFixtures(host, "\xff\xff\xff")); +} + +// Forwarded encodes a fixture of shout for arena and a forward of it for +// extension-go. +std::string Forwarded() { + modlock::host_app::control::Fixtures fixtures; + fixtures.ParseFromString(Fixtures("arena")); + auto* forward = fixtures.add_forwards(); + forward->set_mod("extension-go"); + forward->set_service("shout"); + forward->set_target("https://service.test"); + return fixtures.SerializeAsString(); +} + +TEST(HostFixtures, AForwardedServiceTakesItsModsStartedCalls) { + // Forwarding without a forward is refused. + WasmHost host({}); + ASSERT_FALSE(modlock::host_app::ProvideFixtures(host, Forwarded())); + + // The forward takes the mod's started call, and the log names its target. + Build build(R"([{"name":"shout"}])"); + std::vector calls; + std::vector replies; + auto provided = modlock::host_app::ProvideFixtures( + host, Forwarded(), + [&](std::string_view mod, std::string_view service, std::string_view method, + std::string_view payload, modlock::WasmReply reply) { + calls.push_back(std::string(mod) + " " + std::string(service) + " " + + std::string(method) + " " + std::string(payload)); + replies.push_back(std::move(reply)); + }); + ASSERT_TRUE(provided) << provided.error(); + EXPECT_EQ(*provided, + "arena: service shout: fixture services/shout.json\n" + "extension-go: service shout: forwarded to https://service.test\n"); + auto plugin = host.Load(build.Path(), PluginContext{.check_only = true}); + ASSERT_TRUE(plugin) << plugin.error(); + ASSERT_TRUE((*plugin)->Start()); + ASSERT_TRUE(host.Call("extension-go", "later", "start", "shout|say|hi|0")); + ASSERT_EQ(calls, std::vector{"extension-go shout say hi"}); + + // Its answer ends the call in the next frame. + replies[0](std::string("HI")); + (*plugin)->Tick(); + auto ended = host.Call("extension-go", "later", "ended", ""); + ASSERT_TRUE(ended) << ended.error(); + EXPECT_EQ(*ended, "hi HI"); + (*plugin)->Stop(); +} + +#ifndef _WIN32 +// Controller is a loopback controller that one control link dials. +class Controller { + public: + Controller() { + listener_ = ::socket(AF_INET, SOCK_STREAM, 0); + sockaddr_in address{}; + address.sin_family = AF_INET; + address.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + socklen_t size = sizeof(address); + ::bind(listener_, reinterpret_cast(&address), size); + ::listen(listener_, 1); + ::getsockname(listener_, reinterpret_cast(&address), &size); + port_ = ntohs(address.sin_port); + } + ~Controller() { + Hangup(); + ::close(listener_); + } + Controller(const Controller&) = delete; + Controller& operator=(const Controller&) = delete; + + std::string Address() const { return "127.0.0.1:" + std::to_string(port_); } + void Accept() { conn_ = ::accept(listener_, nullptr, nullptr); } + void Hangup() { + if (conn_ >= 0) { + ::close(conn_); + conn_ = -1; + } + } + + // Next reads the link's next event. + modlock::host_app::control::HostEvent Next() { + std::array header{}; + Read(reinterpret_cast(header.data()), header.size()); + const uint32_t size = header[0] | header[1] << 8 | header[2] << 16 | header[3] << 24; + std::string data(size, '\0'); + Read(data.data(), data.size()); + modlock::host_app::control::HostEvent event; + event.ParseFromString(data); + return event; + } + + // Send writes one request to the link. + void Send(const modlock::host_app::control::ControlRequest& request) { + const auto data = request.SerializeAsString(); + const auto size = static_cast(data.size()); + const std::array header{static_cast(size), static_cast(size >> 8), + static_cast(size >> 16), static_cast(size >> 24)}; + ::send(conn_, header.data(), header.size(), 0); + ::send(conn_, data.data(), data.size(), 0); + } + + private: + void Read(char* data, size_t size) { + while (size > 0) { + const auto got = ::recv(conn_, data, size, 0); + ASSERT_GT(got, 0); + data += got; + size -= static_cast(got); + } + } + + int listener_ = -1; + int conn_ = -1; + uint16_t port_ = 0; +}; + +// Until runs the link's requests until done reports true, for two seconds at +// most. +bool Until(modlock::host_app::ControlLink& link, WasmHost& host, const std::function& done) { + const auto deadline = std::chrono::steady_clock::now() + std::chrono::seconds(2); + while (std::chrono::steady_clock::now() < deadline) { + link.RunRequests(host); + if (done()) { + return true; + } + std::this_thread::sleep_for(std::chrono::milliseconds(5)); + } + return false; +} + +TEST(HostFixtures, TheControlLinkAsksTheControllerAndEndsTheCallWithItsAnswer) { + // Dial a controller. + Controller controller; + auto dialed = modlock::host_app::ControlLink::Dial(controller.Address()); + ASSERT_TRUE(dialed) << dialed.error(); + controller.Accept(); + auto& link = **dialed; + WasmHost host({}); + + // A forwarded call reaches the controller with its id and fields. + std::vector> ended; + const auto keep = [&ended](std::expected answer) { + ended.push_back(std::move(answer)); + }; + link.Forward("drills", "example.drills.v1", "read", R"({"key":"slide"})", keep); + auto event = controller.Next(); + ASSERT_TRUE(event.has_service_call()); + const auto call = event.service_call(); + EXPECT_EQ(call.mod(), "drills"); + EXPECT_EQ(call.service(), "example.drills.v1"); + EXPECT_EQ(call.method(), "read"); + EXPECT_EQ(call.payload(), R"({"key":"slide"})"); + + // An answer for another id does nothing; the call's own answer ends it. + modlock::host_app::control::ControlRequest stray; + stray.mutable_answer()->set_id(call.id() + 7); + controller.Send(stray); + modlock::host_app::control::ControlRequest answer; + answer.mutable_answer()->set_id(call.id()); + answer.mutable_answer()->set_payload(R"({"name":"Slide"})"); + controller.Send(answer); + ASSERT_TRUE(Until(link, host, [&] { return !ended.empty(); })); + ASSERT_EQ(ended.size(), 1u); + ASSERT_TRUE(ended[0]) << ended[0].error(); + EXPECT_EQ(*ended[0], R"({"name":"Slide"})"); + + // An error answer fails the call with its text. + link.Forward("drills", "example.drills.v1", "save", "{}", keep); + const auto second = controller.Next().service_call(); + modlock::host_app::control::ControlRequest refused; + refused.mutable_answer()->set_id(second.id()); + refused.mutable_answer()->set_error("Only the mod's developers may call it"); + controller.Send(refused); + ASSERT_TRUE(Until(link, host, [&] { return ended.size() == 2; })); + ASSERT_FALSE(ended[1]); + EXPECT_EQ(ended[1].error(), "Only the mod's developers may call it"); + + // A call left unanswered when the controller goes ends with that, and so + // does a call made after. + link.Forward("drills", "example.drills.v1", "read", "{}", keep); + controller.Next(); + controller.Hangup(); + ASSERT_TRUE(Until(link, host, [&] { return ended.size() == 3; })); + EXPECT_EQ(ended[2].error(), "the program that answers this service has gone"); + link.Forward("drills", "example.drills.v1", "read", "{}", keep); + ASSERT_EQ(ended.size(), 4u); + EXPECT_EQ(ended[3].error(), "the program that answers this service has gone"); +} +#endif + +} // namespace diff --git a/tests/wasm/extension-go/main.go b/tests/wasm/extension-go/main.go index 2dd6c6ae..ddf0db96 100644 --- a/tests/wasm/extension-go/main.go +++ b/tests/wasm/extension-go/main.go @@ -8,11 +8,17 @@ // which makes the calls a host's call profile must count: an allowed and a // refused console command, a refused file name, more distinct files than the // profile keeps, and a method the host does not have; and the crash service, -// which panics and so stops the mod. +// which panics and so stops the mod; and the later service, whose "start" +// starts a call to the service, method and payload its payload names, +// separated by "|", with a timeout in milliseconds after them, and whose +// "ended" lists the calls that ended so far, one line each. package main import ( + "errors" "strconv" + "strings" + "time" "unsafe" "github.com/paralin/modlock/mod" @@ -28,6 +34,9 @@ func hostCall(data unsafe.Pointer, size uint32) uint32 //go:wasmimport modlock host_read func hostRead(data unsafe.Pointer, size uint32) +// ended lists the later service's calls that ended, in order. +var ended []string + // init registers the service before the host starts the mod. func init() { mod.Serve("echo", func(method string, payload []byte) ([]byte, error) { @@ -62,6 +71,23 @@ func init() { } return nil, nil }) + mod.Serve("later", func(method string, payload []byte) ([]byte, error) { + if method == "ended" { + return []byte(strings.Join(ended, "\n")), nil + } + parts := strings.Split(string(payload), "|") + timeout, _ := strconv.Atoi(parts[3]) + mod.CallServiceLater(parts[0], parts[1], []byte(parts[2]), time.Duration(timeout)*time.Millisecond, func(reply []byte, err error) { + var failed *mod.ServiceError + switch { + case errors.As(err, &failed): + ended = append(ended, parts[2]+" "+failed.Failure.String()+": "+failed.Message) + default: + ended = append(ended, parts[2]+" "+string(reply)) + } + }) + return nil, nil + }) mod.Serve("crash", func(string, []byte) ([]byte, error) { panic("crash") }) diff --git a/tests/wasm_host_test.cc b/tests/wasm_host_test.cc index 235ccb38..3df6a2c6 100644 --- a/tests/wasm_host_test.cc +++ b/tests/wasm_host_test.cc @@ -9,12 +9,14 @@ #include "modlock/wasm_host.h" #include +#include #include #include #include #include #include #include +#include #include #include "gtest/gtest.h" @@ -47,6 +49,9 @@ class Events final : public WasmHostObserver { void Held(std::string_view, bool held) override { seen.push_back(held ? "held" : "released"); } + // Halted keeps how many events came before each halt. + void Halted(std::string_view) override { halted.push_back(seen.size()); } + void Called(std::string_view mod, const modlock::wasm::profile::CallProfile& reported) override { if (mod == "extension-go") { calls.MergeFrom(reported); @@ -64,6 +69,7 @@ class Events final : public WasmHostObserver { } std::vector seen; + std::vector halted; modlock::wasm::profile::CallProfile calls; }; @@ -188,6 +194,89 @@ TEST(WasmHost, ModsAndHostCallEachOthersServices) { } } +TEST(WasmHost, StartedServiceCallsEndInALaterFrame) { + // Load the test mod with the shout service, answered at once, and the + // slow service, which keeps each call's reply for later. + WasmHost host({}); + Events events; + host.Observe(&events); + host.Provide("shout", Shout); + std::vector kept; + host.ProvideLater("slow", [&](std::string_view mod, std::string_view method, + std::string_view payload, modlock::WasmReply reply) { + EXPECT_EQ(mod, "extension-go"); + EXPECT_EQ(method, "wait"); + kept.push_back(std::move(reply)); + }); + auto plugin = host.Load(EXTENSION_GO_WASM, PluginContext{.check_only = true}); + ASSERT_TRUE(plugin) << plugin.error(); + ASSERT_TRUE((*plugin)->Start()); + const auto start = [&](std::string_view call) { + auto started = host.Call("extension-go", "later", "start", call); + ASSERT_TRUE(started) << started.error(); + }; + const auto ended = [&] { + auto answer = host.Call("extension-go", "later", "ended", ""); + return answer ? *answer : "error: " + answer.error(); + }; + + // Nothing ends during the call, not even an answer the service gave at + // once; the next frame ends the answered, the refused and the call to a + // service nobody provides, which is never asked. + start("shout|say|hi|0"); + start("shout|refuse|no|0"); + start("nobody|any|lost|0"); + start("slow|wait|first|0"); + start("slow|wait|second|20"); + EXPECT_EQ(ended(), ""); + (*plugin)->Tick(); + EXPECT_EQ(ended(), + "hi SAY:HI\n" + "no SERVICE_FAILURE_REFUSED: extension-go may not refuse\n" + "lost SERVICE_FAILURE_UNAVAILABLE: this host provides no service nobody"); + ASSERT_EQ(kept.size(), 2u); + + // A late answer ends its call in the frame after it, and a call past its + // timeout ends with the timeout; its reply afterwards does nothing. + kept[0]("FIRST"); + std::this_thread::sleep_for(std::chrono::milliseconds(40)); + (*plugin)->Tick(); + kept[1]("SECOND"); + (*plugin)->Tick(); + EXPECT_EQ(ended(), + "hi SAY:HI\n" + "no SERVICE_FAILURE_REFUSED: extension-go may not refuse\n" + "lost SERVICE_FAILURE_UNAVAILABLE: this host provides no service nobody\n" + "first FIRST\n" + "second SERVICE_FAILURE_TIMEOUT: the service did not answer in time"); + + // A late service refuses the call that expects an answer at once. + auto unary = host.Call("extension-go", "echo", "say", "hi"); + ASSERT_TRUE(unary); + host.Provide("shout", nullptr); + host.ProvideLater( + "shout", [](std::string_view, std::string_view, std::string_view, modlock::WasmReply) {}); + auto refused = host.Call("extension-go", "echo", "say", "hi"); + ASSERT_FALSE(refused); + EXPECT_EQ(refused.error(), "the service shout answers only calls started with StartServiceCall"); + + // A mod that stops holds nothing: the reply to a call its last build left + // does not reach the next one. + start("slow|wait|left|0"); + ASSERT_EQ(kept.size(), 3u); + // The host hears the halt before the next build starts, so it can forget + // the calls first. + ASSERT_TRUE(host.Reload(EXTENSION_GO_WASM)); + EXPECT_EQ(events.seen, (std::vector{"started", "reloaded"})); + EXPECT_EQ(events.halted, (std::vector{1})); + kept[2]("LEFT"); + (*plugin)->Tick(); + EXPECT_EQ(ended(), ""); + (*plugin)->Stop(); + EXPECT_EQ(events.halted, (std::vector{1, 2})); + host.Unobserve(&events); +} + TEST(PlayerScope, LimitedScopeRulesOnlyItsPlayersHits) { // A limited scope hears hits among its players, blocks hits that cross to // another player, and leaves others' hits alone. A hit with one player, diff --git a/tests/wasm_instance_test.cc b/tests/wasm_instance_test.cc index 714e69e8..5a7bc2d5 100644 --- a/tests/wasm_instance_test.cc +++ b/tests/wasm_instance_test.cc @@ -23,6 +23,8 @@ using modlock::wasm::Limits; using modlock::wasm::LogRequest; using modlock::wasm::Reply; using modlock::wasm::Runtime; +using modlock::wasm::ServiceCallStarted; +using modlock::wasm::ServiceRepliedEvent; using modlock::wasm::StartEvent; using modlock::wasm::StartResult; using modlock::wasm::effects::ChatRequest; @@ -352,6 +354,129 @@ TEST(WasmInstance, PythonModAnswersEvents) { EXPECT_EQ(Parse(recorder.calls[1].request()).message(), "first frame at tick 7"); } +// LaterCalls answers each StartServiceCall with the next number from 7, and +// keeps every call and the lines the mod logs. +struct LaterCalls { + std::vector calls; + std::vector logged; + uint64_t next = 7; + + Instance::HostCall Answer() { + return [this](const Call& call) { + calls.push_back(call); + Reply reply; + if (call.method() == "StartServiceCall") { + ServiceCallStarted started; + started.set_call(next++); + reply.set_response(started.SerializeAsString()); + } else if (call.method() == "Log") { + logged.push_back(Parse(call.request()).message()); + } + return reply; + }; + } +}; + +// Replied returns the ServiceReplied event ending call with payload, or with +// failure and error. +Call Replied(uint64_t call, std::string payload, + modlock::wasm::ServiceFailure failure = modlock::wasm::SERVICE_FAILURE_NONE, + std::string error = {}) { + ServiceRepliedEvent event; + event.set_call(call); + event.set_payload(std::move(payload)); + event.set_failure(failure); + event.set_error(std::move(error)); + return Event("ServiceReplied", event); +} + +// ExpectLaterCalls checks a mod that starts two calls to example.drills.v1 +// and logs how each ends: the first answered, the second refused, and a +// reply for a call it never made ignored. +void ExpectLaterCalls(Instance& instance, LaterCalls& host) { + // Both calls reached the host with their method, payload and timeout. + ASSERT_EQ(host.calls.size(), 2); + for (const auto& call : host.calls) { + EXPECT_EQ(call.method(), "StartServiceCall"); + } + const auto first = Parse(host.calls[0].request()); + EXPECT_EQ(first.service(), "example.drills.v1"); + EXPECT_EQ(first.method(), "List"); + EXPECT_EQ(first.payload(), "map"); + EXPECT_EQ(first.timeout_milliseconds(), 2500); + host.calls.clear(); + + // The answer reaches the first call's function, the refusal the second's. + ASSERT_TRUE(instance.Deliver(Replied(8, "", modlock::wasm::SERVICE_FAILURE_REFUSED, "no"))); + ASSERT_TRUE(instance.Deliver(Replied(7, "two"))); + ASSERT_TRUE(instance.Deliver(Replied(7, "again"))); + ASSERT_TRUE(instance.Deliver(Replied(99, "stray"))); + EXPECT_EQ(host.logged, (std::vector{"8 refused no", "7 reply two"})); +} + +TEST(WasmInstance, LuauCallServiceLaterEndsEachCallOnce) { + // Load the Luau runtime with a mod that starts two calls. + Runtime runtime; + LaterCalls host; + auto instance = Instance::Load(runtime, ReadFile(LUAU_WASM), Limits{}, host.Answer()); + ASSERT_TRUE(instance) << instance.error(); + const std::string library = LUAU_LIBRARY; + StartEvent start; + start.set_source(Zip({ + {"main.luau", R"( +local modlock = require("@modlock") + +modlock.callServiceLater("example.drills.v1", "List", "map", function(reply, error, failure) + modlock.log("7 " .. (reply and ("reply " .. reply) or (failure .. " " .. (error or "")))) +end, 2.5) +modlock.callServiceLater("example.drills.v1", "Get", "", function(reply, error, failure) + modlock.log("8 " .. (reply and ("reply " .. reply) or (failure .. " " .. (error or "")))) +end) +)"}, + {"@modlock/init.luau", Text(library + "/init.luau")}, + {"@modlock/wire.luau", Text(library + "/wire.luau")}, + })); + auto started = (*instance)->Deliver(Event("Start", start)); + ASSERT_TRUE(started) << started.error(); + ASSERT_EQ(started->error(), ""); + ExpectLaterCalls(**instance, host); +} + +TEST(WasmInstance, PythonCallServiceLaterEndsEachCallOnce) { + // Load the Python runtime with a mod that starts two calls. + Runtime runtime; + LaterCalls host; + auto instance = Instance::Load(runtime, ReadFile(PYTHON_WASM), Limits{}, host.Answer()); + ASSERT_TRUE(instance) << instance.error(); + const std::string library = PYTHON_LIBRARY; + StartEvent start; + start.set_source(Zip({ + {"main.py", R"( +import modlock + + +def ended(number): + def done(reply, error, failure): + if reply is not None: + modlock.log(f"{number} reply {reply.decode()}") + else: + modlock.log(f"{number} {failure} {error}") + return done + + +modlock.call_service_later("example.drills.v1", "List", b"map", ended(7), 2.5) +modlock.call_service_later("example.drills.v1", "Get", b"", ended(8)) +)"}, + {"modlock/__init__.py", Text(library + "/__init__.py")}, + {"modlock/heroes.py", Text(library + "/heroes.py")}, + {"modlock/wire.py", Text(library + "/wire.py")}, + })); + auto started = (*instance)->Deliver(Event("Start", start)); + ASSERT_TRUE(started) << started.error(); + ASSERT_EQ(started->error(), ""); + ExpectLaterCalls(**instance, host); +} + TEST(WasmInstance, TrapStopsTheMod) { // Load a mod whose handler traps. Runtime runtime; diff --git a/tests/wasm_ui_test.cc b/tests/wasm_ui_test.cc index 30350413..373aff14 100644 --- a/tests/wasm_ui_test.cc +++ b/tests/wasm_ui_test.cc @@ -1,8 +1,10 @@ // Contract tests for a mod's interface trees: changes apply in order, a change // that breaks a limit leaves the tree as it was, layouts and style sheets stay // inside the mod's addon, only a shown button takes presses, and only a value a -// shown input can hold reaches the mod. A departed player's slot takes only a -// reset. +// shown input can hold reaches the mod, and a layout's press reaches it only +// from the player whose tree shows the layout, small and at a player's pace. A +// departed player's slot takes only a reset. +#include #include #include "gtest/gtest.h" @@ -266,4 +268,97 @@ TEST(UiTrees, ForgetsPlayers) { EXPECT_TRUE(trees.Clear().empty()); } +// ShowLayout returns a change that shows the layout node id. +Change ShowLayout(std::string id) { + auto change = Set(std::move(id), modlock::wasm::ui::KIND_LAYOUT); + change.mutable_set(0)->set_layout("board.xml"); + return change; +} + +// kStart is when a test's presses begin. +const auto kStart = std::chrono::steady_clock::time_point(std::chrono::hours(1)); + +TEST(UiTrees, TakesALayoutsPressFromThePlayerWhoseTreeShowsIt) { + // Slot 3's tree shows the layout; slot 4's does not. + UiTrees trees; + ASSERT_TRUE(trees.Apply(3, ShowLayout("card"))); + ASSERT_TRUE(trees.Apply(3, Set("ready", modlock::wasm::ui::KIND_BUTTON))); + ASSERT_TRUE(trees.Apply(4, Set("card", modlock::wasm::ui::KIND_BUTTON))); + + // The press carries the slot the engine named, whatever its line says, and + // its payload's text: "eyJ2b3RlIjoxfQ" is {"vote":1}. + auto press = trees.Action(3, "card vote eyJ2b3RlIjoxfQ", kStart); + ASSERT_TRUE(press) << press.error(); + EXPECT_EQ(press->player(), 3); + EXPECT_EQ(press->node(), "card"); + EXPECT_EQ(press->action(), "vote"); + EXPECT_EQ(press->payload(), R"({"vote":1})"); + auto bare = trees.Action(3, "card close", kStart); + ASSERT_TRUE(bare) << bare.error(); + EXPECT_EQ(bare->player(), 3); + EXPECT_EQ(bare->payload(), ""); + + // Another player, a button, a missing layout or a bad name is refused. + EXPECT_FALSE(trees.Action(4, "card vote eyJ2b3RlIjoxfQ", kStart)); + EXPECT_FALSE(trees.Action(3, "ready vote", kStart)); + EXPECT_FALSE(trees.Action(3, "shop vote", kStart)); + for (const char* line : {"card", "card ", "card a;quit", "card a/b", "card vote !!"}) { + EXPECT_FALSE(trees.Action(3, line, kStart)) << line; + } +} + +TEST(UiTrees, RefusesALayoutsOversizedPayload) { + UiTrees trees; + ASSERT_TRUE(trees.Apply(3, ShowLayout("card"))); + + // 180 bytes of payload pass; 181 do not, nor does text that is not UTF-8. + const auto encode = [](size_t bytes) { + // "QUFB" is "AAA"; a tail of one or two bytes is "QQ" or "QUE". + std::string encoded; + for (size_t at = 0; at + 3 <= bytes; at += 3) { + encoded += "QUFB"; + } + encoded += bytes % 3 == 1 ? "QQ" : bytes % 3 == 2 ? "QUE" : ""; + return encoded; + }; + auto most = trees.Action(3, "card keep " + encode(UiTrees::kActionPayload), kStart); + ASSERT_TRUE(most) << most.error(); + EXPECT_EQ(most->payload(), std::string(UiTrees::kActionPayload, 'A')); + EXPECT_FALSE(trees.Action(3, "card keep " + encode(UiTrees::kActionPayload + 1), kStart)); + EXPECT_FALSE(trees.Action(3, "card keep " + encode(3000), kStart)); + EXPECT_FALSE(trees.Action(3, "card keep _w", kStart)); +} + +TEST(UiTrees, KeepsEachPlayersLayoutPressesToAPace) { + UiTrees trees; + ASSERT_TRUE(trees.Apply(3, ShowLayout("card"))); + ASSERT_TRUE(trees.Apply(4, ShowLayout("card"))); + + // A burst passes and the next press at once is refused, for that player only. + for (int i = 0; i < static_cast(UiTrees::kActionBurst); ++i) { + EXPECT_TRUE(trees.Action(3, "card watch", kStart)) << i; + } + EXPECT_FALSE(trees.Action(3, "card watch", kStart)); + EXPECT_TRUE(trees.Action(4, "card watch", kStart)); + + // A quarter second later one more press passes. + const auto later = kStart + std::chrono::milliseconds(250); + EXPECT_TRUE(trees.Action(3, "card watch", later)); + EXPECT_FALSE(trees.Action(3, "card watch", later)); +} + +TEST(UiTrees, TakesNoLayoutPressOnceTheModStops) { + // A stopping mod clears every tree, so its layouts' presses go nowhere. + UiTrees trees; + ASSERT_TRUE(trees.Apply(3, ShowLayout("card"))); + ASSERT_TRUE(trees.Action(3, "card close", kStart)); + EXPECT_EQ(trees.Clear(), std::vector{3}); + EXPECT_FALSE(trees.Action(3, "card close", kStart)); + + // A player who leaves takes their layout's presses with them. + ASSERT_TRUE(trees.Apply(5, ShowLayout("card"))); + EXPECT_TRUE(trees.Drop(5)); + EXPECT_FALSE(trees.Action(5, "card close", kStart)); +} + } // namespace