能力

文档版本 v0.1.0-beta.3在 GitHub 上查看源文件

本页是 OmsiLaunch 0.1.0-beta3 英文原始页面 的译文。英文页面为规范文本:如有出入,以英文页面和代码为准。

本页是 OmsiLaunch 0.1.0-beta3 功能的规范清单,依据 PublicCapabilityRegistry(src/OmsiLaunch.Api/PublicCapabilityRegistry.cs)、插件中的运行时实现(src/OmsiLaunch.Plugin/CurrentRuntimeControl.cs 和 src/OmsiLaunch.Interop/OmsiRuntimeReaders.cs)以及 OmsiLaunchService.GetCapabilitiesAsync 整理而成。对每项能力,本页列出其分类、本文档统一使用的稳定性级别、是否需要处于 Running 状态的会话、是否会修改 OMSI、参数与结果键、错误以及运行时验证证据。如何调用操作(CLI 路由、API 信封(envelope)、超时、句柄)见运行时控制;证据表见运行时验证状态。

分类与稳定性#

PublicCapabilityClassification 有四个取值。它们与稳定性术语的对应关系如下,证据不完整之处会降级:

分类含义稳定性
PublicStableBeta公开,属于 Beta 契约,经运行时验证STABLE_BETA(注明之处降级为 PARTIAL)
PublicExperimental公开,可能变更,经运行时验证或经静态验证EXPERIMENTAL(注明之处降级为 PARTIAL)
InternalOnly研究用原语;无法通过公共 API 或 CLI 访问INTERNAL
Unsupported可被识别以用于诊断,但会被拒绝或不存在UNAVAILABLE

PublicCapabilityKind 区分 Read、Write、Action 和 Event。每项运行时能力都需要处于 Running 状态的会话以及精确匹配的配置 Omsi23004_692EBFBF(注册表中的 RequiresSession / RequiresExactProfile);创建会话的会话能力需要精确匹配的配置,但不需要会话。

运行时结果是字符串字典。以 internal_ 开头或以 _address、_pointer、_vmt 结尾的键会在 API 边界处被移除(ScrubInternalValues),本页不予列出。下文各操作表中的结果键是产品实际返回的精确键集合:它们是在真实会话中执行每个公开操作后采集的(运行时收尾文档采集,会话 f51dcb59-a723-4570-b6c5-b61e628a7993,situations\Linie 5.osn;列表行写作 <row>.<n>.<field>)。

操作失败的报告方式(CurrentRuntimeControl.Execute):

失败ErrorCodeValues
注册表拒绝(未知操作或 internal.* 操作、缺少必需参数)OL_E_RUNTIME_OPERATION_UNKNOWN、OL_E_RUNTIME_ARGUMENT_REQUIRED无
产品有意的拒绝(weather.set)具体错误码(OL_E_RUNTIME_SETTING_NOT_PERSISTENT)detail(一句说明)
D3D 失败具体的 OL_E_D3D_* 错误码detail、native_status
任何其他插件端失败(失效句柄、未知名称、值超出范围、无玩家车辆……)OL_E_RUNTIME_OPERATION_FAILEDdetail(以具体错误码开头,例如 OL_E_RUNTIME_OBJECT_HANDLE_STALE 或 OL_E_RUNTIME_VALUE_OUT_OF_RANGE (Parameter 'minute'))、exception(.NET 类型名)
结果无法放入 64 KiB 邮箱OL_E_RUNTIME_RESPONSE_TOO_LARGE(有界列表则改为缩短,见时刻表、司机、车票)无

各表的 Errors 列列出具体错误码;按上文所述,从 ErrorCode 或 Values.detail 的第一个标记读取。

会话能力#

能力分类稳定性类型API 路由CLI 路由修改验证
session.planPublicStableBetaSTABLE_BETAActionPlanSessionAsync/plan、/validate否RUNTIME_PASS(每个经验证的会话都以规划开始)
session.startPublicStableBetaSTABLE_BETAActionStartSessionAsync启动参数文件系统(事务)、进程RUNTIME_PASS(NEW_MAP Grundorf、SAVED_SITUATION Berlin-Spandau)
session.statusPublicStableBetaSTABLE_BETAReadGetStatusAsyncsession status否RUNTIME_PASS
session.stopPublicStableBetaSTABLE_BETAActionStopAsync / CloseAsyncsession stop、托盘、Ctrl+C进程(TerminateProcess)、文件系统(还原)RUNTIME_PASS;协作式关闭未实现
session.recoverPublicStableBetaSTABLE_BETAActionRecoverPendingAsync/recovery-status、/recover文件系统(还原)RUNTIME_PASS:提前退出恢复(RV-008)、所有者被终止后在下次启动时提前恢复(S05)、还原失败后执行 /recover(F01)、在租约下、存在孤立 OMSI 时以及在 PID 之前的时间窗口内拒绝(S04、S04b)
events.readPublicExperimentalEXPERIMENTALEventGetStatusAsync().RuntimeEvents、控制命令 session.eventsevents read、events watch否RUNTIME_PASS;仅保存最新值的遥测槽可能丢失突发事件

运行时能力(注册表条目)#

能力分类稳定性类型操作句柄验证
time.readPublicStableBetaSTABLE_BETAReadtime.readRUNTIME_PASS(会话 e5454061)
time.setPublicExperimentalEXPERIMENTALWritetime.setRUNTIME_PASS(写入、SetTime、回读)
weather.readPublicStableBetaSTABLE_BETAReadweather.readRUNTIME_PASS
weather.setUnsupportedUNAVAILABLEWriteweather.setRUNTIME_REJECTED:始终返回 OL_E_RUNTIME_SETTING_NOT_PERSISTENT(会话 50a1f1ec)
weather.actual.readPublicExperimentalEXPERIMENTALReadweather.actual.readRUNTIME_PASS
map.readPublicStableBetaSTABLE_BETAReadmap.readRUNTIME_PASS:已在修正后的地图槽上重新验证(会话 9dd62626-94c6-4cd7-bb6f-0288327696f4,Grundorf),并在文档采集中于 Berlin-Spandau 上读取
camera.readPublicStableBetaSTABLE_BETAReadcamera.readRUNTIME_PASS
camera.setPublicExperimentalEXPERIMENTALWritecamera.setRUNTIME_PASS(FOV 写入与回读)
camera.lockPublicExperimentalEXPERIMENTALActioncamera.lock、camera.unlock使用来自已保存情景的 PlayerVehicle 时 RUNTIME_PASS(运行时收尾 CAM01,family 0、2 和 1 并回读,随后解锁)。注册表自身的 RuntimeValidation 字符串仍为 STATICALLY_VALIDATED(产品自报信息,本版本未更新)
vehicles.listPublicStableBetaSTABLE_BETAReadroad-vehicles.listRoadVehicleRUNTIME_PASS
vehicles.getPublicStableBetaSTABLE_BETAReadroad-vehicle.readRoadVehicleRUNTIME_PASS;自然移除后的失效检测(RV-002)没有安全的运行时触发方式,已通过离线验证
vehicles.summaryPublicStableBetaSTABLE_BETAReadroad-vehicles.readRUNTIME_PASS
vehicles.spawnPublicExperimentalEXPERIMENTALActionroad-vehicles.spawnRoadVehicleRUNTIME_PASS RV-003(会话 5f641c8d,2 -> 3,句柄 rv-000003)
vehicles.place-randomPublicExperimentalEXPERIMENTALActionroad-vehicles.place-randomRUNTIME_PASS(集合 2 -> 4)
player.readPublicStableBetaSTABLE_BETAReadplayer-vehicle.readRoadVehicleRUNTIME_PASS:headless 启动时为 present=false,使用已保存情景时为完整快照
humans.listPublicExperimentalEXPERIMENTALReadhumans.listHumanRUNTIME_PASS
humans.getPublicExperimentalEXPERIMENTALReadhuman.readHumanRUNTIME_PASS
humans.summaryPublicExperimentalEXPERIMENTALReadhumans.readRUNTIME_PASS
timetable.readPublicStableBetaSTABLE_BETAReadtimetable.read 以及 timetable.*.list / timetable.logs.read 系列RUNTIME_PASS(线路轨迹条目:Grundorf 上 91 条记录)
scripts.numericPublicExperimentalEXPERIMENTALWritevehicle.variables.list、vehicle.variable.get、vehicle.variable.setRoadVehicleRUNTIME_PASS(Refresh_Strings 0 -> 1 -> 0)
scripts.string.readPublicExperimentalEXPERIMENTALReadvehicle.string-variables.list、vehicle.string-variable.getRoadVehicleRUNTIME_PASS(仅读取;写入见 BI-004)
constantsPublicStableBetaSTABLE_BETAReadvehicle.constants.list、vehicle.constant.getRoadVehicleRUNTIME_PASS
curvesPublicStableBetaSTABLE_BETAReadvehicle.curves.list、vehicle.curve.evaluateRoadVehicleRUNTIME_PASS
hof.readPublicStableBetaSTABLE_BETAReadvehicle.hofs.readRoadVehicleRUNTIME_PASS
drivers.readPublicExperimentalEXPERIMENTALReaddrivers.readRUNTIME_PASS
tickets.readPublicExperimentalEXPERIMENTALReadtickets.readRUNTIME_PASS
d3d.texturePublicExperimentalEXPERIMENTALActiond3d.status、d3d.texture.create、d3d.texture.describe、d3d.texture.update、d3d.texture.releaseD3DTexturecreate/describe/update/release 均为 RUNTIME_PASS;已释放句柄与失效句柄在重新创建后及跨会话时均被拒绝(H02);设备重置时代次失效(RV-007、D01;lost 状态本身未被触发)
internal.make-basicInternalOnlyINTERNALActioninternal.road-vehicles.make-basic非公开。ExecuteRuntimeAsync 在查找任何会话之前即以 OL_E_RUNTIME_OPERATION_UNKNOWN 拒绝它;CLI 没有对应路由。
calendar.set-actual-date-timeUnsupportedUNAVAILABLEWrite无UNSUPPORTED(BI-002)
player.assign-headlessUnsupportedUNAVAILABLEAction无UNSUPPORTED(BI-007)

internal.road-vehicles.make-basic 属于 INTERNAL:它存在于插件中供研究使用(会返回一个原生地址),在 API 边界处以及本地控制平面中都会被拒绝,二者都会先依据 PublicRuntimeOperationIds 校验操作名称。

公开运行时操作#

以下是公开前端可以转发的操作 ID 的精确列表(PublicCapabilityRegistry.PublicRuntimeOperationIds)。每个操作都要求 SessionState.Running;均不记入事务日志,也不会被还原。必需参数由注册表在使用邮箱之前强制检查(OL_E_RUNTIME_ARGUMENT_REQUIRED);可选参数由插件校验。所有操作通用的失败码:OL_E_RUNTIME_OPERATION_UNKNOWN(不在此列表中)、OL_E_SESSION_NOT_RUNNING、OL_E_RUNTIME_SESSION_MISMATCH、OL_E_RUNTIME_CHANNEL_BUSY、OL_E_RUNTIME_CHANNEL_CLOSED、OL_E_RUNTIME_REQUEST_TIMEOUT、OL_E_RUNTIME_REQUEST_ID_REUSED、OL_E_RUNTIME_RESPONSE_INVALID、OL_E_RUNTIME_RESPONSE_TOO_LARGE、OL_E_RUNTIME_OPERATION_UNAVAILABLE(插件没有实现)、OL_E_RUNTIME_OPERATION_FAILED(进程内意外异常;带有 detail 和 exception 值)。

时间#

操作类型参数结果键错误
time.readRead无hour、minute、second、day、month、year
time.setWrite可选 hour(0..23)、minute(0..59)、second(0..59.999,小数);至少一个经过配置化的 SetTime 之后的 time.read 键OL_E_RUNTIME_ARGUMENT_REQUIRED、OL_E_RUNTIME_VALUE_OUT_OF_RANGE、OL_E_TIME_APPLY_FAILED

天气#

操作类型参数结果键错误
weather.readRead无fog_density、lightness、primary_light_factor、secondary_light_factor、ambient_light_factor、cloud_type、cloud_transparency、precipitation_set、wet_ground、wind_speed、wind_direction、relative_humidity、absolute_humidity、temperature、dew_point、pressure、precipitation、precipitation_rate
weather.setWrite任意无始终返回 OL_E_RUNTIME_SETTING_NOT_PERSISTENT(参数为空时:OL_E_RUNTIME_ARGUMENT_REQUIRED)。OMSI 会在下一次天气更新时覆盖两个已配置化的风力候选值。
weather.actual.readRead无active、icao、last_downloaded、invalid_icao、counter、process

地图#

操作类型参数结果键错误
map.readRead无loaded、loaded_tiles、left_hand_traffic、name、filename、friendly_name、description、max_speed、year_start、year_end

摄像机#

操作类型参数结果键错误
camera.readRead无family(0 司机、1 乘客、2 外部、3 地图)、name、field_of_view、normal_field_of_view、distance
camera.setWrite可选 family(0..3)、field_of_view(10..170);至少一个camera.read 的键OL_E_RUNTIME_ARGUMENT_REQUIRED、OL_E_RUNTIME_VALUE_OUT_OF_RANGE
camera.lockAction必需 family(0..3);可选 preset(0..255,仅用于 family 0 或 1)locked(true)、family、preset、head_look(preserved)、field_of_view(preserved)OL_E_RUNTIME_ARGUMENT_REQUIRED、OL_E_RUNTIME_VALUE_OUT_OF_RANGE、OL_E_CAMERA_PRESET_FAMILY_UNSUPPORTED、OL_E_RUNTIME_PLAYER_VEHICLE_UNAVAILABLE。该策略每 100 ms 重新应用一次,直至 camera.unlock;重新应用失败时,每种不同的错误发出一次 camera.lock.degraded 事件。
camera.unlockAction无locked(false)

道路车辆与玩家#

操作类型参数结果键错误
road-vehicles.readRead无count、ai_collection、player_index(OMSI 原始的玩家车辆索引,按读取值报告;要判断是否存在玩家车辆,请使用 player-vehicle.read 的 present)
road-vehicles.listRead无count、vehicle.<n>.handle(rv-NNNNNN)
road-vehicle.readRead必需 handlehandle、runtime_index、tile、marked_for_killing、traffic_type、position_x、position_y、position_z、rotation_x、rotation_y、rotation_z、rotation_w、steering、tacho、ground_speed、kilometres、throttle、brake、clutch、ai_enabled、ai_mode、ai_light、ai_interior_light、ai_indicator_left、ai_indicator_right、ai_brake_lightOL_E_RUNTIME_OBJECT_HANDLE_REQUIRED、OL_E_RUNTIME_OBJECT_HANDLE_STALE
player-vehicle.readRead无present(OMSI 没有玩家车辆时为 false);为 true 时:player_index 加上 road-vehicle.read 的全部键
road-vehicles.spawnAction必需 model(规范形式 Vehicles\...\*.bus,最多 240 个字符,不含 ..,必须存在于安装目录之下)bus、created_handle、before_count、after_count、delta_count、raw_native_return、identity_validationOL_E_RUNTIME_ARGUMENT_REQUIRED、OL_E_RUNTIME_BUS_IDENTITY_INVALID、OL_E_MAKEVEHICLE_BUS_NOT_FOUND、OL_E_MAKEVEHICLE_DELTA_ZERO、OL_E_MAKEVEHICLE_DELTA_MULTIPLE、OL_E_MAKEVEHICLE_NATIVE_FAILED、OL_E_RUNTIME_CREATED_OBJECT_INVALID、OL_E_RUNTIME_CREATED_OBJECT_NOT_IN_COLLECTION。不会分配 PlayerVehicle。耗时数秒;请使用 30 s 的客户端超时。
road-vehicles.place-randomAction可选 ai_type(0..255,默认 0)、group(0..65535,默认 1)、type(-1..65535,默认 -1)、scheduled(0..1,默认 0)、tour(0..65535,默认 0)、line(0..65535,默认 0)raw_return、before_count、after_count、delta_count、identity_validation(native-placement-return-is-diagnostic-only)OL_E_RUNTIME_VALUE_OUT_OF_RANGE、OL_E_PLACE_RANDOM_BUS_FAILED

人物对象#

操作类型参数结果键错误
humans.readRead无count
humans.listRead无count、human.<n>.handle(hb-NNNNNN)
human.readRead必需 handlehandle、runtime_index、human_index、tile、marked_for_killing、collision_type、position_x、position_y、position_z、target_x、target_y、target_z、target_station、pre_target_station、departure、enter_bus_at、seat_bus、seat_station、ticket_type、ticket_index、ticket_ready、state、speed、bus_index、station、ai_mode、ai_mode_ex、ai_sub_mode、collision_stateOL_E_RUNTIME_OBJECT_HANDLE_REQUIRED、OL_E_RUNTIME_OBJECT_HANDLE_STALE

时刻表、司机、车票#

有界列表结果带有 count(OMSI 中的全部记录数)、returned_count(本次回复中的行数)和 truncated(有行被省略时为 true)。返回的行始终是前 returned_count 条记录,从 0 开始编号。行数上限为:tracks、trips、lines、rv-files、bus stops、station links、tours 和 profiles 为 128,tour entries 为 256,track entries 为 512;当按该上限允许的行数仍超出 64 KiB 邮箱时(例如 Berlin-Spandau 上的线路轨迹条目和班次条目),插件会丢弃末尾的行直至回复能够放入,并报告较小的 returned_count 及 truncated=true(文档审计 BUG-05;修复之前,这两个列表会以 OL_E_RUNTIME_RESPONSE_TOO_LARGE 失败)。timetable.logs.read 不是有界列表:它返回每一条日志条目,包含数百条记录的日志会超出邮箱,并以 OL_E_RUNTIME_RESPONSE_TOO_LARGE 失败。

操作类型参数结果键错误
timetable.readRead无invalid(true/false),以及记录数 tracks、trips、bus_stops、station_links、lines、rv_files
timetable.tracks.listRead无count、returned_count、truncated;track.<n>.filename、track.<n>.path、track.<n>.entries、track.<n>.length
timetable.trips.listRead无count、returned_count、truncated;trip.<n>.filename、trip.<n>.chrono_origin、trip.<n>.target、trip.<n>.line、trip.<n>.track_index、trip.<n>.track_name、trip.<n>.bus_stops、trip.<n>.profiles、trip.<n>.train_reverse、trip.<n>.invalid
timetable.lines.listRead无count、returned_count、truncated;line.<n>.name、line.<n>.chrono_origin、line.<n>.priority、line.<n>.tours、line.<n>.user_allowed
timetable.rv-files.listRead无count、returned_count、truncated;rv_file.<n>.line、rv_file.<n>.number_tours、rv_file.<n>.start_date_rel_2000、rv_file.<n>.end_date_rel_2000、rv_file.<n>.type_line_files、rv_file.<n>.type_line_probability、rv_file.<n>.type_tours
timetable.track-entries.listRead无count、returned_count、truncated;track_entry.<n>.track_index、track_entry.<n>.id、track_entry.<n>.path_index_on_object、track_entry.<n>.path_tile、track_entry.<n>.path_index、track_entry.<n>.relative_distance、track_entry.<n>.distance、track_entry.<n>.valid、track_entry.<n>.path_order_check、track_entry.<n>.allowed_fstrn、track_entry.<n>.chrono_origin、track_entry.<n>.bad_chronos
timetable.bus-stops.listRead无count、returned_count、truncated;bus_stop.<n>.name、bus_stop.<n>.supplement、bus_stop.<n>.tile、bus_stop.<n>.id、bus_stop.<n>.parent_id、bus_stop.<n>.preset_alighting、bus_stop.<n>.index、bus_stop.<n>.starting_links、bus_stop.<n>.ending_links、bus_stop.<n>.chrono_origin
timetable.station-links.listRead无count、returned_count、truncated;station_link.<n>.length、station_link.<n>.start_bus_stop_id、station_link.<n>.end_bus_stop_id、station_link.<n>.start_bus_stop、station_link.<n>.end_bus_stop、station_link.<n>.chrono_origin、station_link.<n>.valid、station_link.<n>.visible、station_link.<n>.track_entries、station_link.<n>.start_track_entry、station_link.<n>.end_track_entry
timetable.tours.listRead无count、returned_count、truncated;tour.<n>.line_index、tour.<n>.name、tour.<n>.ai_group、tour.<n>.ai_group_index、tour.<n>.ai_type、tour.<n>.completed_day、tour.<n>.entries、tour.<n>.has_normal_vehicle、tour.<n>.invalid、tour.<n>.vehicle_indices、tour.<n>.vehicle_reservations
timetable.profiles.listRead无count、returned_count、truncated;profile.<n>.trip_index、profile.<n>.name、profile.<n>.service_trip、profile.<n>.stop_times、profile.<n>.total_time、profile.<n>.track_entry_times
timetable.tour-entries.listRead无count、returned_count、truncated;tour_entry.<n>.line_index、tour_entry.<n>.tour_index、tour_entry.<n>.trip、tour_entry.<n>.trip_index、tour_entry.<n>.profile_index、tour_entry.<n>.start_time、tour_entry.<n>.end_time、tour_entry.<n>.smooth_transition
timetable.logs.readRead无count;log.<n>.bus_stop、log.<n>.estimated_arrival、log.<n>.estimated_departure、log.<n>.actual_arrival、log.<n>.actual_departure、log.<n>.arrival_ok、log.<n>.departure_ok(全部条目;无上限)日志较长时为 OL_E_RUNTIME_RESPONSE_TOO_LARGE
drivers.readRead无count、selected_index;driver.<n>.filename、driver.<n>.name、driver.<n>.gender、driver.<n>.bus_stops、driver.<n>.crashes、driver.<n>.passengers、driver.<n>.tickets、driver.<n>.cash
tickets.readRead无filename、voice_path、stamper_factor、buy_factor、chattiness、whinge_factor、count;ticket.<n>.name、ticket.<n>.display_name、ticket.<n>.value、ticket.<n>.maximum_stations、ticket.<n>.day_ticket

车辆脚本、常量、曲线、HOF(按句柄)#

操作类型参数结果键错误
vehicle.variables.listRead必需 handlehandle、count、returned_count、truncated(上限 512)、name.<n>OL_E_RUNTIME_OBJECT_HANDLE_REQUIRED、OL_E_RUNTIME_OBJECT_HANDLE_STALE、OL_E_RUNTIME_SCRIPT_OBJECT_UNAVAILABLE
vehicle.variable.getRead必需 handle、namehandle、name、valueOL_E_RUNTIME_VARIABLE_NOT_FOUND、OL_E_RUNTIME_VARIABLE_UNAVAILABLE
vehicle.variable.setWrite必需 handle、name、value(有限浮点数)handle、name、requested_value、value(回读值)OL_E_RUNTIME_VALUE_OUT_OF_RANGE、OL_E_RUNTIME_VARIABLE_NOT_FOUND
vehicle.string-variables.listRead必需 handlehandle、count、returned_count、truncated(上限 512)、name.<n>OL_E_RUNTIME_OBJECT_HANDLE_REQUIRED、OL_E_RUNTIME_OBJECT_HANDLE_STALE、OL_E_RUNTIME_SCRIPT_OBJECT_UNAVAILABLE
vehicle.string-variable.getRead必需 handle、namehandle、name、valueOL_E_RUNTIME_STRING_VARIABLE_NOT_FOUND
vehicle.constants.listRead必需 handlehandle、count、name.<n>OL_E_RUNTIME_CONSTANTS_UNAVAILABLE
vehicle.constant.getRead必需 handle、namehandle、name、valueOL_E_RUNTIME_CONSTANT_NOT_FOUND
vehicle.curves.listRead必需 handlehandle、count、name.<n>
vehicle.curve.evaluateRead必需 handle、name、x(有限浮点数;缺少 x 或 x 非数值时为 OL_E_RUNTIME_ARGUMENT_REQUIRED)handle、name、x、value(线性插值)OL_E_RUNTIME_CURVE_NOT_FOUND、OL_E_RUNTIME_CURVE_EMPTY、OL_E_RUNTIME_CURVE_INVALID、OL_E_RUNTIME_CURVE_DEGENERATE
vehicle.hofs.readRead必需 handlehandle、count、hof.<n>.name、hof.<n>.service_tripOL_E_RUNTIME_HOF_UNAVAILABLE

Direct3D 9#

D3D 操作通过原生桥在 OMSI 的主线程/渲染线程上执行。纹理句柄的格式为 d3dtex-<sessionId N>-<16 hex digits>。

操作类型参数结果键错误
d3d.statusRead无available、native_status、query_interface_hresult、cooperative_level_hresult、execution_thread_id、owned_device_references、state(NOT_READY、READY、LOST、RESETTING、STOPPING、STOPPED)、transition、generation、live_textures、reset_hook_installed、last_reset_thread_id、binding
d3d.texture.createAction必需 width(1..4096)、height(1..4096)、format(A8R8G8B8、X8R8G8B8、R5G6B5、X1R5G5B5、A1R5G5B5、A4R4G4B4、A8、L8、A8L8);可选 levels(0..16,默认 1)handle、state(LIVE、RELEASED、STALE)、device_state、generation、width、height、format、levels、level、level_width、level_height、hresult、execution_thread_idOL_E_D3D_INVALID_ARGUMENT、OL_E_D3D_INVALID_TEXTURE_FORMAT、OL_E_D3D_NOT_READY、OL_E_D3D_DEVICE_LOST、OL_E_D3D_RESET_IN_PROGRESS、OL_E_D3D_NATIVE_CALL_FAILED
d3d.texture.describeRead必需 handle;可选 level(0..15,默认 0)d3d.texture.create 的 13 个键,对应所请求的 levelOL_E_D3D_STALE_RESOURCE_HANDLE、OL_E_D3D_RESOURCE_RELEASED,以及 create 的错误
d3d.texture.updateAction必需 handle、width(1..4096)、height(1..4096)、pixels_base64(解码后最多 48 KiB);可选 level(0..15,默认 0)、x(0..4095,默认 0)、y(0..4095,默认 0)更新之后的 d3d.texture.create 的 13 个键OL_E_D3D_INVALID_PIXEL_BUFFER,以及 describe 的错误
d3d.texture.releaseAction必需 handled3d.texture.create 的 13 个键,其中 state = RELEASED重复释放时为 OL_E_D3D_RESOURCE_RELEASED,OL_E_D3D_STALE_RESOURCE_HANDLE

失败的 D3D 操作会返回 detail 和 native_status 值。D3DRuntimeApi 扩展方法(GetD3DStatusAsync、CreateD3DTextureAsync、DescribeD3DTextureAsync、UpdateD3DTextureAsync、ReleaseD3DTextureAsync)为 API 使用方封装了这些操作。

GetCapabilitiesAsync 名称#

IOmsiLaunch.GetCapabilitiesAsync(InstallationSpec) 返回一个由 Capability(Name, Available, EvidenceState, Reason) 记录组成的静态列表,描述宿主对该安装实例的看法。这些名称是一套独立于上文注册表 ID 的、粒度更粗的术语;注册表是操作的契约,能力列表则是面向集成方的机器可读摘要。二者的关系见最后一列。

名称可用证据关系
runtime.current-windows-x64取决于平台STATICALLY_VALIDATED兼容性
runtime.command-channeltrueSTATICALLY_VALIDATED运行时邮箱
runtime.time.read、runtime.time.writetrueRUNTIME_VALIDATEDtime.read、time.set
runtime.time.actual-date-time.writefalseRELEASE_IF_CLOSEDcalendar.set-actual-date-time
runtime.map.readtrueRUNTIME_VALIDATEDmap.read
runtime.weather.read、runtime.weather.actual.readtrueRUNTIME_VALIDATEDweather.read、weather.actual.read
runtime.weather.writefalseRUNTIME_PARTIALweather.set(被拒绝)
runtime.camera.read、runtime.camera.writetrueRUNTIME_VALIDATEDcamera.read、camera.set
runtime.d3d.status、runtime.d3d.texture.create、runtime.d3d.texture.update、runtime.d3d.texture.describe、runtime.d3d.texture.releasetrueRUNTIME_VALIDATEDd3d.*
runtime.d3d.lifecycle.resettrueIMPLEMENTED_NOT_RUNTIME_VALIDATEDRV-007。该列表是固定的自报清单:在运行时收尾轮次观察到 resetting/restored 状态转换(D01)之后,此条目并未更新;证据见运行时验证状态
runtime.road-vehicles.read、runtime.road-vehicles.spawn、runtime.road-vehicles.place-randomtrueRUNTIME_VALIDATEDroad-vehicles.*
runtime.vehicle.variable.writetrueRUNTIME_VALIDATEDvehicle.variable.set
runtime.humans.read、runtime.timetable.read、runtime.timetable.track-entries.readtrueRUNTIME_VALIDATEDhumans.*、timetable.*
world.new-map、world.presented-entrypoint、world.saved-situationtrueRUNTIME_VALIDATEDsession.start 的世界模式
world.entrypoint-identityfalseRUNTIME_PARTIALBI-001
world.last-map-statefalseUNSUPPORTED_FOR_CURRENT_PROFILELastMapState(/last)
world.date.explicit、world.date.system、world.time.explicit、world.time.systemfalseSTATICALLY_PARTIAL/date、/time、/year;请求它们会使计划不可运行
weather.preset、weather.icao、weather.real-currentfalseSTATICALLY_PARTIAL/weather*;请求它们会使计划不可运行
player-vehicle.model、player-vehicle.repaint、player-vehicle.hof、player-vehicle.fleet-number、player-vehicle.registrationfalseSTATICALLY_PARTIAL/vehicle 及相关参数;请求它们会使计划不可运行
configuration.options.semantictrueSTATICALLY_VALIDATED/set、配置档 settings(RV-005 运行时)
input.keyboard.patch、input.controller.active-ffscaletrueSTATICALLY_VALIDATED已有文档解析器;InputSpec 不会被会话应用(BI-005)
input.controller.axis-buttonsfalseSTATICALLY_PARTIALBI-005
content.maps、content.situations、content.vehicles、content.repaints、content.hofs、content.fleet-registration-sourcestrueSTATICALLY_VALIDATEDDiscoverAsync、/list

此外,规划器还会在 SessionPlan.RequiredCapabilities 和 SessionPlan.UnsupportedRequestedFeatures 中报告每个计划的能力(runtime.current-windows-x64、transaction.exact-restore、omsi.profile.OMSI23004、world.new-map、world.presented-entrypoint、world.entrypoint-identity、world.saved-situation、boot.headless-start、internet-textures.disabled、world.explicit-date、world.explicit-time、world.explicit-year、weather、player-vehicle.*、input.keyboard、input.controller、content.*)。

已知限制#

  • 句柄的作用域为会话;地址复用通过对象指纹检测(车辆为 VMT 加定义指针,人物对象为 VMT 加 human 索引),并报告为 OL_E_RUNTIME_OBJECT_HANDLE_STALE。残余盲区:在两次列表读取之间,于同一地址重新创建的同类、同定义对象与原对象无法区分。
  • 结果受 64 KiB 邮箱限制;有界列表会被截断并带有 truncated=true;timetable.logs.read 不是有界列表,可能以 OL_E_RUNTIME_RESPONSE_TOO_LARGE 失败。
  • 不支持跨图块的车辆重新定位,不支持字符串变量写入,不支持日历写入,不支持天气写入,不支持 headless 模式下的 PlayerVehicle 分配。见已知限制。