Skip to content

EngineInterface.BaseInterface ​

GameDataNativeCacheKind 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public enum GameDataNativeCacheKind

标识可由框架显式请求刷新的 native GameData 缓存类型。

枚举值 ​

  • Unit
  • Actor
  • ActorModel
  • ActorSound
  • ActorEffect
  • AdvancedAnimation

IAdminOperationMessageProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IAdminOperationMessageProvider

后台 operation 消息提供器,由服务端 Host 注入。

事件 ​

OnAdminOperationMessageReceived 双端 ​

csharp
event Action<AdminOperationMessage>? OnAdminOperationMessageReceived

收到后台 operation 消息时触发。

IAdPlaybackProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IAdPlaybackProvider

客户端激励视频广告播放 provider,由框架和原生平台桥接层实现。

备注

普通项目代码不需要直接实现或调用该接口;请在服务端使用 GameCore.AdvertisingSystem.Ads.ShowRewardedVideoAsync。

方法 ​

ShowRewardedVideo 双端 ​

csharp
RewardedVideoAdPlaybackResult ShowRewardedVideo(string extra)

请求原生平台 SDK 播放激励视频广告。

  • extra — 服务端生成的广告验证标识。

返回: 客户端播放请求结果。

IAdVerificationChannelProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IAdVerificationChannelProvider

Host 侧激励视频广告验证 provider,由框架和原生服务端桥接层实现。

备注

普通项目代码不需要直接实现或调用该接口;请在服务端使用 GameCore.AdvertisingSystem.Ads.ShowRewardedVideoAsync。 Host 层会在内部构造保留的 TapADN 验证通道,项目不应使用通用 ServerChannel 拼接广告验证频道。

方法 ​

SubscribeAdVerification 双端 ​

csharp
bool SubscribeAdVerification(long userId, string extra)

为指定用户和广告请求订阅 TapADN 验证通道。

  • userId — 玩家对应的平台用户 ID。
  • extra — 服务端生成的广告验证标识。

返回: 是否成功订阅验证通道。

UnsubscribeAdVerification 双端 ​

csharp
bool UnsubscribeAdVerification(long userId, string extra)

取消指定用户和广告请求的 TapADN 验证通道订阅。

  • userId — 玩家对应的平台用户 ID。
  • extra — 服务端生成的广告验证标识。

返回: 是否成功取消订阅验证通道。

事件 ​

OnAdVerified 双端 ​

csharp
event Action<long, string>? OnAdVerified

Host 解析并匹配到 TapADN 验证消息后触发。参数依次为用户 ID 和广告验证标识。

IClientArgProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IClientArgProvider

客户端启动参数读取接口。 由 ClientInterfaceDefinition 提供实现,通过 WASM import 读取宿主环境参数。

方法 ​

HasArg 双端 ​

csharp
bool HasArg(string name)

判断是否存在指定启动参数。

GetArg 双端 ​

csharp
string GetArg(string name)

读取启动参数值。若不存在则返回空字符串。

IClientEnvironmentProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IClientEnvironmentProvider

Provides client environment features for GameCore.ClientEnvironment.ClientEnvironment.

备注

Game project code normally uses ClientEnvironment instead of calling this interface directly.

方法 ​

TryOpenUrl 双端 ​

csharp
bool TryOpenUrl(Uri url)

Requests the client to open an allowed external URL or app link.

SetClipboardText 双端 ​

csharp
void SetClipboardText(string text)

Sets the local clipboard text.

GetClipboardText 双端 ​

csharp
string GetClipboardText()

Gets the local clipboard text.

GetDefaultCulture 双端 ​

csharp
CultureInfo GetDefaultCulture()

Gets the default culture used by the project on this client.

GetSystemCulture 双端 ​

csharp
CultureInfo GetSystemCulture()

Gets the culture reported by the player's operating system or platform account.

GetLocalizationCulture 双端 ​

csharp
CultureInfo GetLocalizationCulture()

Gets the current culture used by client-side localization.

SetLocalizationCulture 双端 ​

csharp
void SetLocalizationCulture(CultureInfo culture)

Sets the current culture used by client-side localization.

GetNetworkInfo 双端 ​

csharp
ClientNetworkInfo GetNetworkInfo()

Gets the current local network status.

GetPowerInfo 双端 ​

csharp
ClientPowerInfo GetPowerInfo()

Gets the current local power status.

GetBatteryInfo 双端 ​

csharp
ClientBatteryInfo GetBatteryInfo()

Gets the current local battery details.

GetDiagnostics 双端 ​

csharp
ClientDiagnosticsSnapshot GetDiagnostics()

Gets a read-only diagnostics snapshot for the local client.

RequestClientLogUpload 双端 ​

csharp
bool RequestClientLogUpload(string projectId)

Requests an upload of the local client logs for the specified project.

IClientPlatformProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IClientPlatformProvider

客户端能力 9 的平台服务。快照采用 UTF-8 JSON 传输。

方法 ​

GetDisplays 双端 ​

csharp
string GetDisplays()

GetWindow 双端 ​

csharp
string GetWindow()

GetSurface 双端 ​

csharp
string GetSurface()

GetDisplayDpi 双端 ​

csharp
string GetDisplayDpi(int display)

SDL 上报的显示器 DPI,可能是系统估算值;不可用时返回 JSON null。

GetAndroidScreenMetrics 双端 ​

csharp
string GetAndroidScreenMetrics()

仅 Android:屏幕像素、物理 DPI 与窗口 dp 配置;其它平台返回 JSON null。

GetIOSScreenMetrics 双端 ​

csharp
string GetIOSScreenMetrics()

仅 iOS:UIScreen 原生像素、point、scale 和 SDL 估算 DPI;其它平台返回 JSON null。

SetWindowMode 双端 ​

csharp
int SetWindowMode(int width, int height, int mode, int display, int refreshRate)

ControlWindow 双端 ​

csharp
int ControlWindow(int operation, int x, int y)

SetSurfaceSize 双端 ​

csharp
int SetSurfaceSize(int width, int height)

RestoreSurface 双端 ​

csharp
int RestoreSurface()

RequestOrientation 双端 ​

csharp
int RequestOrientation(int orientation)

SetAllowedOrientations 双端 ​

csharp
int SetAllowedOrientations(int directions)

SetHomeIndicator 双端 ​

csharp
int SetHomeIndicator(int behavior)

GetFrameTiming 双端 ​

csharp
string GetFrameTiming()

SetFrameTiming 双端 ​

csharp
int SetFrameTiming(int setting, double value)

GetDevice 双端 ​

csharp
string GetDevice()

GetDiagnostics 双端 ​

csharp
string GetDiagnostics()

DiagnosticCommand 双端 ​

csharp
int DiagnosticCommand(int operation, string name)

GetFileChecksum 双端 ​

csharp
string GetFileChecksum(string path, int algorithm, bool raw)

GetResourceChecksum 双端 ​

csharp
string GetResourceChecksum(string path, int algorithm)

StartScan 双端 ​

csharp
int StartScan()

PollScan 双端 ​

csharp
string PollScan()

CancelScan 双端 ​

csharp
int CancelScan()

RequestExit 双端 ​

csharp
int RequestExit(bool embeddedSdk)

CreateProjectShortcut 双端 ​

csharp
int CreateProjectShortcut()

ReloadFontMap 双端 ​

csharp
int ReloadFontMap()

SendTelemetry 双端 ​

csharp
int SendTelemetry(string name, string fieldsJson, bool error)

RecordStage 双端 ​

csharp
int RecordStage(string key, string name, int operation)

SetLagThresholds 双端 ​

csharp
int SetLagThresholds(uint ping, uint largePing)

GetGamepads 双端 ​

csharp
string GetGamepads()

SetEventsEnabled 双端 ​

csharp
void SetEventsEnabled(bool enabled)

SetOption 双端 ​

csharp
int SetOption(string key, string valueJson, int scope, int mode)

GetOption 双端 ​

csharp
string GetOption(string key, int scope)

GenerateQrCode 双端 ​

csharp
string GenerateQrCode(string text, int correction)

GetDependencies 双端 ​

csharp
string GetDependencies()

事件 ​

Changed 双端 ​

csharp
event Action<string>? Changed

IClientSettingsProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IClientSettingsProvider

Runtime service backing GameCore.ClientSettings.ClientSettings.

方法 ​

TryGetBool 双端 ​

csharp
bool TryGetBool(string key, int scope, out bool value)

TryGetFloat 双端 ​

csharp
bool TryGetFloat(string key, int scope, out float value)

TryGetString 双端 ​

csharp
bool TryGetString(string key, int scope, out string? value)

SetBool 双端 ​

csharp
void SetBool(string key, bool value, int scope)

SetFloat 双端 ​

csharp
void SetFloat(string key, float value, int scope)

SetString 双端 ​

csharp
void SetString(string key, string value, int scope)

GetGraphicsPreset 双端 ​

csharp
int GetGraphicsPreset()

SetGraphicsPreset 双端 ​

csharp
void SetGraphicsPreset(int preset)

GetMaxFrameRate 双端 ​

csharp
int GetMaxFrameRate()

SetMaxFrameRate 双端 ​

csharp
void SetMaxFrameRate(int frameRate)

GetRenderResolution 双端 ​

csharp
int GetRenderResolution()

SetRenderResolution 双端 ​

csharp
void SetRenderResolution(int resolution)

GetSceneQuality 双端 ​

csharp
int GetSceneQuality()

SetSceneQuality 双端 ​

csharp
void SetSceneQuality(int quality)

GetParticleQuality 双端 ​

csharp
int GetParticleQuality()

SetParticleQuality 双端 ​

csharp
void SetParticleQuality(int quality)

GetDynamicLightsEnabled 双端 ​

csharp
bool GetDynamicLightsEnabled()

SetDynamicLightsEnabled 双端 ​

csharp
void SetDynamicLightsEnabled(bool enabled)

GetHdrEnabled 双端 ​

csharp
bool GetHdrEnabled()

SetHdrEnabled 双端 ​

csharp
void SetHdrEnabled(bool enabled)

GetAntiAliasingEnabled 双端 ​

csharp
bool GetAntiAliasingEnabled()

SetAntiAliasingEnabled 双端 ​

csharp
void SetAntiAliasingEnabled(bool enabled)

GetCharacterOcclusionSilhouetteEnabled 双端 ​

csharp
bool GetCharacterOcclusionSilhouetteEnabled()

SetCharacterOcclusionSilhouetteEnabled 双端 ​

csharp
void SetCharacterOcclusionSilhouetteEnabled(bool enabled)

GetAudioVolume 双端 ​

csharp
int GetAudioVolume(int channel)

SetAudioVolume 双端 ​

csharp
void SetAudioVolume(int channel, int volume)

GetAudioEnabled 双端 ​

csharp
bool GetAudioEnabled(int channel)

SetAudioEnabled 双端 ​

csharp
void SetAudioEnabled(int channel, bool enabled)

IGameDataNativeCacheProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IGameDataNativeCacheProvider

提供对 native GameData 缓存刷新标记的访问。

备注

该接口由宿主环境实现,框架通过它把“某个 GameData 条目后续需要重新导出到 native”的请求传给 C++ 侧。

方法 ​

SetNativeCacheRefresh 双端 ​

csharp
void SetNativeCacheRefresh(GameDataNativeCacheKind kind, int linkId, bool refresh)

设置指定 GameData 条目的 native 缓存刷新请求状态。

  • kind — 缓存类型。
  • linkId — GameLink 的本地哈希。
  • refresh — 为 true 时,请求下次 native 读取时重建缓存;为 false 时,清除此请求。

IListItemRecord 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IListItemRecord

属性 ​

UserId 双端 ​

csharp
public long UserId { get; }

Gets the unique identifier for the user.

ListKey 双端 ​

csharp
public string ListKey { get; }

Gets the unique key of the list that this item belongs to. This key is used to identify the list in which the item is stored.

ItemUUID 双端 ​

csharp
public long ItemUUID { get; }

Gets the unique identifier for the list item. The UUID is universally unique across all lists and users, which means it can be used to query or reference this item across different contexts.

Value 双端 ​

csharp
public byte[] Value { get; }

ValueType 双端 ​

csharp
public CloudDataListItemValueType ValueType { get; }

Gets the payload type of the list item value.

Utf8Value 双端 ​

csharp
public string Utf8Value { get; }

Gets the value decoded as a UTF-8 string.

DoubleValue 双端 ​

csharp
public double DoubleValue { get; }

Gets the value decoded as a double.

ValueSpan 双端 ​

csharp
public ReadOnlySpan<byte> ValueSpan { get; }

Gets a read-only span of bytes representing the value.

备注

This property is useful for scenarios where direct access to the raw byte representation of the value is required, such as serialization, hashing, or low-level processing. The caller should ensure the span is not accessed after the owning object is disposed or goes out of scope.

LastUpdateTime 双端 ​

csharp
public DateTime LastUpdateTime { get; }

The last update time of the list item record, it will be reported as a local DateTime using the local timezone.

方法 ​

TryGetUtf8Value 双端 ​

csharp
bool TryGetUtf8Value(out string value)

Tries to get the value as a UTF-8 string when the payload is tagged as UTF-8.

TryGetDoubleValue 双端 ​

csharp
bool TryGetDoubleValue(out double value)

Tries to get the value as a double when the payload is tagged as Double.

ILobbyProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface ILobbyProvider

方法 ​

LeaveAndJoinOpenGame 双端 ​

csharp
bool LeaveAndJoinOpenGame(OpenGameRef openGame)

TryGetCurrentOpenGameRef 双端 ​

csharp
bool TryGetCurrentOpenGameRef(out OpenGameRef? openGame)

IMoverData 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IMoverData

属性 ​

DoStaticCollision 双端 ​

csharp
public bool DoStaticCollision { get; }

StaticMask 双端 ​

csharp
public StaticCollisionMask StaticMask { get; }

DoImpactEntity 双端 ​

csharp
public bool DoImpactEntity { get; }

ImpactSearchRadius 双端 ​

csharp
public float ImpactSearchRadius { get; }

FinishArriveRadius 双端 ​

csharp
public float FinishArriveRadius { get; }

ImpactSameTargetInterval 双端 ​

csharp
public TimeSpan? ImpactSameTargetInterval { get; set; }

IMoverDataOrbit 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IMoverDataOrbit : IMoverData

属性 ​

OrbitAngularVelocity 双端 ​

csharp
public float OrbitAngularVelocity { get; }

The orbital angular velocity that controls how fast the entity orbits around the target.

备注

This defines the angular velocity for orbital movement around the target, measured in degrees per second. Positive values create counterclockwise orbit, negative values create clockwise orbit.

OrbitRadius 双端 ​

csharp
public float OrbitRadius { get; }

The orbit radius that defines the distance from the target center to the orbiting entity.

备注

This determines how far from the target the entity will orbit. The radius can be dynamic, allowing for spiral movements or changing orbital distances over time.

OrbitRelativeToTargetFacing 双端 ​

csharp
public bool OrbitRelativeToTargetFacing { get; }

Whether the orbital angle should be offset by the orbit target's facing direction.

备注

When true, the orbital position will be calculated relative to the target's current facing direction, causing the orbit to rotate with the target. When false, the orbit maintains fixed world coordinates.

SelfRotationRate 双端 ​

csharp
public float SelfRotationRate { get; }

The self-rotation rate that controls how fast the orbiting entity rotates around its own axis.

备注

This defines the angular velocity for the entity's self-rotation while orbiting, measured in degrees per second. Self-rotation is independent of orbital movement and can create spinning effects during orbit.

SelfRotationRelativeToTarget 双端 ​

csharp
public bool SelfRotationRelativeToTarget { get; }

Whether the entity's self-rotation should be offset by the orbit target's facing direction.

备注

When true, the entity's self-rotation will be relative to the orbit target's current facing direction, creating synchronized rotational behavior. When false, self-rotation uses absolute world coordinates.

InitialFacing 双端 ​

csharp
public float? InitialFacing { get; }

The initial facing direction for the orbiting entity when it begins orbital movement.

备注

When specified, determines the starting facing orientation of the orbiting entity. If null, the entity retains its current facing direction when orbit begins. Note: this controls the entity's own facing direction, not its position on the orbit circle (which is calculated from the entity's current position).

OrbitHeight 双端 ​

csharp
public float OrbitHeight { get; }

The orbital height that defines the vertical offset of the orbiting entity relative to the target.

备注

This controls the height at which the entity orbits around the target. Combined with HeightRelativeToTarget, it allows for both absolute and relative height positioning in orbital movement patterns.

HeightRelativeToTarget 双端 ​

csharp
public bool HeightRelativeToTarget { get; }

Whether the orbit height is calculated relative to the target's height.

备注

When true, OrbitHeight represents an offset relative to the target's current height position. When false, it represents an absolute world height coordinate for the orbital plane.

AlwaysVisibleToOrbitTarget 双端 ​

csharp
public bool AlwaysVisibleToOrbitTarget { get; }

Whether the orbiting entity should always remain visible to the orbit target.

备注

When true, even if the orbiting entity is of another team or faction, it will remain visible to the target.

IMoverDataTarget 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IMoverDataTarget : IMoverData

属性 ​

Speed 双端 ​

csharp
public float Speed { get; }

Acceleration 双端 ​

csharp
public float? Acceleration { get; }

MinSpeed 双端 ​

csharp
public float? MinSpeed { get; }

MaxSpeed 双端 ​

csharp
public float? MaxSpeed { get; }

LaunchHeight 双端 ​

csharp
public float? LaunchHeight { get; }

TargetHeight 双端 ​

csharp
public float? TargetHeight { get; }

TargetHeightIsAbsolute 双端 ​

csharp
public bool TargetHeightIsAbsolute { get; }

ParabolaApex 双端 ​

csharp
public float? ParabolaApex { get; }

ParabolaLandingHeight 双端 ​

csharp
public float? ParabolaLandingHeight { get; }

TurnToDirection 双端 ​

csharp
public bool TurnToDirection { get; }

TurnToVelocity 双端 ​

csharp
public bool TurnToVelocity { get; }

StickToGround 双端 ​

csharp
public bool StickToGround { get; }

INameRecord 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface INameRecord

属性 ​

Name 双端 ​

csharp
public string Name { get; }

Description 双端 ​

csharp
public string Description { get; }

IOperationMailProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IOperationMailProvider

Provides the host bridge used by server-side operation mail queries.

备注

This interface is implemented by the runtime host. Game code should use GameCore.OperationMail.OperationMailApi instead of calling the provider directly.

方法 ​

QueryGlobalOperationMails 双端 ​

csharp
bool QueryGlobalOperationMails(UTF8String mapName, UTF8String env, UTF8String now, long requestId)

Sends a fixed backend query for global operation mails.

  • mapName — The published map name to query.
  • env — The backend environment name.
  • now — The current time formatted as a SQL datetime string.
  • requestId — The request id used to match the async response.

返回: true if the host accepted the request; otherwise, false.

QueryUserOperationMails 双端 ​

csharp
bool QueryUserOperationMails(long userId, UTF8String mapName, UTF8String env, UTF8String now, long requestId)

Sends a fixed backend query for operation mails addressed to one user.

  • userId — The platform user id.
  • mapName — The published map name to query.
  • env — The backend environment name.
  • now — The current time formatted as a SQL datetime string.
  • requestId — The request id used to match the async response.

返回: true if the host accepted the request; otherwise, false.

事件 ​

QueryResultArrived 双端 ​

csharp
event Action<long, OperationMailQueryResult>? QueryResultArrived

Raised when the host returns an operation mail query result.

IPaymentChannelProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IPaymentChannelProvider

支付频道提供器接口。由 C++ Host 层实现频道名构造和安全验证, WASM 沙盒内只需提供 userId 即可订阅/取消订阅支付通知。

备注

确认消息的回调频道会由 C++ 层验证前缀,防止伪造。

方法 ​

SubscribePayment 双端 ​

csharp
bool SubscribePayment(long userId)

为指定用户订阅支付通知频道。

  • userId — 用户 ID (User.UserId)

返回: 订阅是否成功

UnsubscribePayment 双端 ​

csharp
bool UnsubscribePayment(long userId)

取消订阅指定用户的支付通知频道。

  • userId — 用户 ID

返回: 取消订阅是否成功

SendConfirmation 双端 ​

csharp
bool SendConfirmation(string callbackChannel, long msgId, bool status)

向 XdPayServer 发送支付确认。C++ 层构造 MsgPack 并验证回调频道前缀合法性。

  • callbackChannel — XdPayServer 指定的回调频道
  • msgId — 支付通知的消息 ID(原样回传)
  • status — 确认状态(true=成功)

返回: 发送是否成功

事件 ​

OnPaymentReceived 双端 ​

csharp
event Action<long, ReadOnlySpan<byte>>? OnPaymentReceived

收到支付通知时触发。参数为 (userId, rawMsgPackData)。

IPaymentConsumptionProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IPaymentConsumptionProvider

服务端查询当前项目用户星火币累计消耗的宿主桥。

方法 ​

QueryCurrentProjectConsumptionAsync 双端 ​

csharp
Task<long?> QueryCurrentProjectConsumptionAsync(long userId)

查询当前游戏局用户在当前项目中已结算的星火币累计消耗。

  • userId — 游戏用户 ID。

返回: 累计消耗;查询失败时返回 null。

IPaymentProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IPaymentProvider

客户端支付平台接口。 由 ClientInterfaceDefinition 提供实现,通过 WASM import 调用原生平台 SDK 发起支付。

方法 ​

GetCurrentBalance 双端 ​

csharp
long? GetCurrentBalance()

查询当前客户端登录用户的星火币余额。 仅允许查询当前用户,返回 null 表示查询失败。

RequestPayment 双端 ​

csharp
bool RequestPayment(string productId, string productName, string productDesc, int price, string serverId, string extra)

请求平台支付。客户端调用后,触发原生支付 SDK。 支付完成后支付服务器发送通知到服务端。

  • productId — 商品标识(对应 goods_config.Link)
  • productName — 商品显示名称
  • productDesc — 商品描述
  • price — 价格(星火币数量)
  • serverId — 服务器/游戏标识(GAME_ID)
  • extra — 附加数据(透传给支付回调)

返回: 请求是否成功发出(不代表支付成功)

IPieAnimationPreparationProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IPieAnimationPreparationProvider

Process-local editor animation preparation; unavailable in published clients.

方法 ​

Request 双端 ​

csharp
string Request(string modelPrefabPath, string sourceAnimationPath, bool force, bool query)

IPurchaseStatProvider 仅服务端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IPurchaseStatProvider

购买统计提供器。由 Host 层将受限的购买统计写入平台后台。

方法 ​

EmitBuyStat 仅服务端 ​

csharp
bool EmitBuyStat(long userId, string itemLink, string costLink, int count, int price, bool isRealMoney)

写入后台商品购买统计。

  • userId — 购买用户 ID。
  • itemLink — 商品 ID / link。
  • costLink — 消耗资源 ID / link。
  • count — 购买数量。
  • price — 商品单价。
  • isRealMoney — 是否为星火币消耗。

返回: 是否成功提交到统计通道。

IQuitCurrentGameProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IQuitCurrentGameProvider

方法 ​

QuitCurrentGame 双端 ​

csharp
bool QuitCurrentGame()

ISensitiveWordFilterProvider 仅服务端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface ISensitiveWordFilterProvider

Provides access to the Host sensitive-word filter.

方法 ​

FilterSensitiveWords 仅服务端 ​

csharp
(bool WasFiltered, string FilteredText) FilterSensitiveWords(string text)

Filters sensitive words in the specified text.

  • text — The text to filter.

返回: A tuple containing whether any text was replaced and the filtered text.

IServerChannelProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IServerChannelProvider

Provides channel-based messaging functionality for communication between multiple server instances of the same game.

备注

Channel isolation is enforced at the C++ host layer — the host automatically prefixes all channel names with a project-specific identifier, preventing cross-game interference. Use cases: Cross-server state synchronization Server-wide event notifications Distributed game logic coordination Global announcements across all game servers

方法 ​

PublishMessage 双端 ​

csharp
bool PublishMessage(string channel, ReadOnlySpan<byte> message)

Publishes a message to the specified channel.

  • channel — The name of the channel to publish to.
  • message — The message content as a byte array.

返回: true if the message was successfully queued for publishing; otherwise, false.

Subscribe 双端 ​

csharp
bool Subscribe(string channel)

Subscribes to messages from the specified channel.

  • channel — The name of the channel to subscribe to.

返回: true if the subscription was successfully initiated; otherwise, false.

Unsubscribe 双端 ​

csharp
bool Unsubscribe(string channel)

Unsubscribes from the specified channel.

  • channel — The name of the channel to unsubscribe from.

返回: true if the unsubscription was successful; otherwise, false.

事件 ​

OnChannelMessage 双端 ​

csharp
event Action<string, ReadOnlySpan<byte>>? OnChannelMessage

Occurs when a message is received from any subscribed channel.

ISkillTestSequenceActorProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface ISkillTestSequenceActorProvider

Optional debug-only bridge for native Sequence actors before playback.

方法 ​

Observe 双端 ​

csharp
void Observe(Func<int, string, uint, bool, bool> observer, Func<int, int, bool> owns)

Wrap 双端 ​

csharp
IViewAsyncActorController Wrap(int actorId)

IUserCappedDataRecord 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IUserCappedDataRecord : IUserKeyRecord<IUserCappedDataRecord>

属性 ​

Value 双端 ​

csharp
public long Value { get; }

Cap 双端 ​

csharp
public long Cap { get; }

LastUpdateTime 双端 ​

csharp
public DateTime LastUpdateTime { get; }

Get the last update time of the record, this includes the time when the record was reset by the reset option. This uses the local time zone of the server.

ResetOption 双端 ​

csharp
public UserDataResetOption? ResetOption { get; }

IUserCloudDataProvider 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IUserCloudDataProvider

方法 ​

QueryDataBatch 双端 ​

csharp
bool QueryDataBatch(long[] userIds, UTF8String[] keys, long requestId)

QueryCurrencyBatch 双端 ​

csharp
bool QueryCurrencyBatch(long[] userIds, UTF8String[] keys, long requestId)

QueryCappedDataBatch 双端 ​

csharp
bool QueryCappedDataBatch(long[] userIds, UTF8String[] keys, long requestId)

QueryNameClaimedStatus 双端 ​

csharp
bool QueryNameClaimedStatus(UTF8String key, UTF8String name, long requestId)

QueryClaimedNames 双端 ​

csharp
bool QueryClaimedNames(UTF8String key, UTF8String nameContains, long requestId)

QueryListItems 双端 ​

csharp
bool QueryListItems(long userId, UTF8String listKey, int? maxCount, long requestId)

ScanListItems 双端 ​

csharp
bool ScanListItems(long userId, UTF8String listKey, int maxCount, long? beforeItemUuid, long requestId)

Scans list items before the exclusive item UUID cursor in descending item UUID order.

QueryListItem 双端 ​

csharp
bool QueryListItem(long itemUuid, long requestId)

ExecuteTransaction 双端 ​

csharp
bool ExecuteTransaction(IEnumerable<TransactionOperation> operations, VarChar255 description, long requestId)

QueryUserNameBatch 双端 ​

csharp
bool QueryUserNameBatch(long[] userIds, long requestId)

事件 ​

ResultArrived 双端 ​

csharp
event Action<long, UserCloudDataResult>? ResultArrived

QueryDataBatchResultArrived 双端 ​

csharp
event Action<long, IEnumerable<IUserDataBatchQueryResult>>? QueryDataBatchResultArrived

QueryUserNameBatchResultArrived 双端 ​

csharp
event Action<long, IEnumerable<IUserDataBatchQueryResult>>? QueryUserNameBatchResultArrived

QueryCurrencyBatchResultArrived 双端 ​

csharp
event Action<long, IEnumerable<IUserCurrencyRecord>>? QueryCurrencyBatchResultArrived

QueryCappedDataBatchResultArrived 双端 ​

csharp
event Action<long, IEnumerable<IUserCappedDataRecord>>? QueryCappedDataBatchResultArrived

QueryNameClaimedStatusResultArrived 双端 ​

csharp
event Action<long, NameClaimStatus>? QueryNameClaimedStatusResultArrived

QueryClaimedNamesResultArrived 双端 ​

csharp
event Action<long, IEnumerable<INameRecord>>? QueryClaimedNamesResultArrived

QueryListItemsResultArrived 双端 ​

csharp
event Action<long, IEnumerable<IListItemRecord>>? QueryListItemsResultArrived

IUserCurrencyRecord 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IUserCurrencyRecord : IUserKeyRecord<IUserCurrencyRecord>

属性 ​

Value 双端 ​

csharp
public long Value { get; }

The value of the currency record.

IUserDataBatchQueryResult 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IUserDataBatchQueryResult

属性 ​

UserId 双端 ​

csharp
public long UserId { get; }

BigIntDataSet 双端 ​

csharp
public IEnumerable<IKeyValueBigInt> BigIntDataSet { get; }

BlobDataSet 双端 ​

csharp
public IEnumerable<IKeyValueBlob> BlobDataSet { get; }

VarCharDataSet 双端 ​

csharp
public IEnumerable<IKeyValueString> VarCharDataSet { get; }

BlobData 双端 ​

csharp
public Dictionary<string, byte[]> BlobData { get; }

Blob 数据字典。实现应使用大小写不敏感的 key 比较,以兼容云数据存储侧的 key 命中语义。

VarCharData 双端 ​

csharp
public Dictionary<string, string> VarCharData { get; }

VarChar 数据字典。实现应使用大小写不敏感的 key 比较,以兼容云数据存储侧的 key 命中语义。

BigIntData 双端 ​

csharp
public Dictionary<string, long> BigIntData { get; }

BigInt 数据字典。实现应使用大小写不敏感的 key 比较,以兼容云数据存储侧的 key 命中语义。

Utf8BlobData 双端 ​

csharp
public Dictionary<string, string> Utf8BlobData { get; }

以 blob 存储、包头 tag=Utf8 的字符串数据(与 VarCharData 不同:后者是原生 varchar255 子系统,前者是 blob 子系统里的长字符串)。 实现应使用大小写不敏感的 key 比较,以兼容云数据存储侧的 key 命中语义。

DoubleBlobData 双端 ​

csharp
public Dictionary<string, double> DoubleBlobData { get; }

以 blob 存储、包头 tag=Double 的双精度浮点数据。 实现应使用大小写不敏感的 key 比较,以兼容云数据存储侧的 key 命中语义。

IUserKeyRecord 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IUserKeyRecord<TSelf> where TSelf : IUserKeyRecord<TSelf>

属性 ​

UserId 双端 ​

csharp
public long UserId { get; }

Key 双端 ​

csharp
public string Key { get; }

IUserNameRecord 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IUserNameRecord

属性 ​

UserId 双端 ​

csharp
public long UserId { get; }

Name 双端 ​

csharp
public string Name { get; }

IUserSessionHandoffProvider 仅服务端 ​

命名空间 EngineInterface.BaseInterface

csharp
public interface IUserSessionHandoffProvider

同用户游戏局切换清理的运行时接入点。

备注

这是 WasiCore 运行时和引擎之间的基础设施接口,项目代码通常不需要直接实现。 项目需要注册清理逻辑时,请使用 GameCore.GameSystem.UserSessionHandoff.RegisterCleanup。

方法 ​

CompleteUserSessionHandoff 仅服务端 ​

csharp
void CompleteUserSessionHandoff(long requestId)

通知运行时本次旧游戏局清理流程已经结束。

备注

这是运行时内部完成信号,不向项目代码提供进房准入控制。

事件 ​

OnUserSessionHandoffRequested 仅服务端 ​

csharp
event Action<long, long>? OnUserSessionHandoffRequested

当前游戏局需要为同一用户切换到同游戏其他游戏局执行清理时触发。

RewardedVideoAdPlaybackResult 双端 ​

命名空间 EngineInterface.BaseInterface

csharp
public enum RewardedVideoAdPlaybackResult

客户端激励视频广告播放请求结果。

枚举值 ​

  • RequestFailed — 客户端未能成功发起广告播放请求。
  • VerificationRequired — 广告播放请求已发出,需要等待服务端平台验证。
  • Completed — 平台 SDK 已返回可视为完成的本地结果。