服务器就绪

Note: The content on this page pertains to Game Server Hosting (Multiplay) available on the Unity Cloud Dashboard. If you’re using Game Server Hosting (Clanforge), refer to the Game Server Hosting (Clanforge) documentation.

游戏服务器并不总是准备好开始托管比赛或让玩家在进程启动时连接。它们可能有一个初始化过程要运行,用于加载资产或连接到外部服务。

游戏服务器就绪是一项功能,允许游戏服务器通过游戏服务器 SDK让游戏服务器托管知道(并扩展到控制玩家连接的匹配器或服务)何时准备好接受玩家以及何时不再准备好接受玩家。该过程的具体流程取决于您是使用适用于 Unity 的游戏服务器托管 SDK还是适用于 Unreal Engine 的游戏服务器托管 SDK

该功能使游戏服务器能够在玩家尝试连接之前完成其启动逻辑。没有此功能,启动时间长的游戏服务器可能会拒绝尝试连接的玩家,从而导致糟糕的体验。

游戏服务器托管分配系统仅在游戏服务器在线并宣布自己已准备好时才将其视为满足分配。

游戏服务器就绪是与构建配置关联的属性。要建立就绪状态,必须在创建构建配置时进行配置。

Tip: Game server readiness can also function as an indication of server health. You can implement health checks at start-up and only flag a server as ready if it passes all health checks. This way, you ensure that Game Server Hosting doesn’t use a potentially unhealthy server to fulfill an allocation.

以下流程图说明了服务器就绪状态如何融入分配流程