载入中...
搜索中...
未找到
GameplayControlJson.cpp
浏览该文件的文档.
19 Diagnostic::error(DiagnosticCode::ParseError, "gameplay control value must be an object", std::move(path)));
56 return Result<void>::failure(Diagnostic::error(DiagnosticCode::ParseError, "unknown gameplay control field",
74 Diagnostic::error(DiagnosticCode::ParseError, "gameplay request requires a session", "request.session"));
82 auto subjects = member(*object.value(), "controlledSubjects", Value::Type::Array, "request.session");
96 Diagnostic::error(DiagnosticCode::ParseError, "unknown gameplay access profile", "request.session.access"));
129 Diagnostic::error(DiagnosticCode::NotFound, "gameplay provider domain was not found", "request.domain"));
145 DiagnosticCode::Conflict, "several gameplay providers claim that instance", "request.instance"));
147 DiagnosticCode::Conflict, "multiple gameplay providers publish the same domain and none claims that instance",
163 Value::object({{"id", Value(action.id.format())}, {"parameterSchema", std::move(action.parameterSchema)}}));
168 return Value::object({{"acceptedTick", Value(static_cast<std::int64_t>(receipt.acceptedTick.value()))},
198 static const std::set<std::string> allowed{"afterSequence", "command", "deltaNanoseconds", "domain",
209 DiagnosticCode::Unsupported, "unsupported gameplay control request schema", "request.schemaVersion"));
275 Value::object({{"domain", Value(std::move(entry.first))}, {"instances", std::move(entry.second)}}));
287 Value::object({{"catalogs", Value(std::move(encoded))}, {"unenumerable", Value(std::move(missing))}})));
308 auto result = target.value()->availableGameplayActions(access.value(), instance.value(), actor.value());
310 return Result<Value>::success(Value::object({{"actions", encodeActions(std::move(result).takeValue())}}));
327 auto expectedRevision = uintMember(*commandObject.value(), "expectedRevision", "request.command");
336 DiagnosticCode::ParseError, "submit command requires parameters", "request.command.parameters"));
352 return Result<Value>::success(Value::object({{"receipt", encodeReceipt(std::move(result).takeValue())}}));
360 return Result<Value>::failure(Diagnostic::error(DiagnosticCode::ParseError, "delta must be non-negative",
362 SimulationStep step{SimulationTick(tick.value()), Duration::fromNanoseconds(delta.value()->asInt())};
372 return Result<Value>::success(Value::object({{"events", encodeEvents(std::move(result).takeValue())}}));
375 Diagnostic::error(DiagnosticCode::Unsupported, "unsupported gameplay control operation", "request.op"));
Versioned JSON facade shared by scripting, MCP and scenario tooling.
Optional companion surface for gameplay providers that can enumerate instances.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static constexpr Duration fromNanoseconds(std::int64_t nanoseconds) noexcept
Construct an exact duration from nanoseconds.
Definition Time.h:55
Optional read-only discovery surface implemented beside a gameplay provider.
Definition GameplayInstanceCatalog.h:32
static std::optional< LogicalId > parse(std::string_view text)
Parses a scoped logical name.
Definition Identity.cpp:37
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static SubjectRef fromPersistentId(PersistentId id) noexcept
Wrap a persistent identity without changing its bytes.
Definition SubjectRef.h:32
@ String
@ Array
@ Int64
static std::optional< Id128 > parse(std::string_view text) noexcept
Parses canonical UUID text.
Definition Identity.h:150
constexpr std::uint64_t value() const noexcept
Returns the underlying value at an explicit protocol boundary.
Definition StrongUint64.h:26
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
Definition Database.h:27
eve::SimulationStep SimulationStep
Compatibility alias for the common injected simulation step.
Definition SimulationBackend.h:111
@ NotFound
@ Unsupported
@ ParseError
@ Conflict
Result< Value > executeGameplayControlRequest(const Value &request)
Routes one versioned owning request to the uniquely matching gameplay provider.
Definition GameplayControlJson.cpp:221
Result< std::string > executeGameplayControlJson(std::string_view requestJson)
Parse, execute and serialize one gameplay-control JSON request.
Definition GameplayControlJson.cpp:378
@ PlayerEquivalent
@ TestDriver
@ DeveloperCheat
detail::StrongUint64< detail::SimulationTickTag > SimulationTick
Deterministic simulation time step; it is not wall-clock time.
Definition Time.h:31