public bool FindNewHost (out Networking.NetworkSystem.PeerInfoMessage newHostInfo, out bool youAreNewHost);

Parameters

newHostInfoInformation about the new host, including the IP address.
youAreNewHostTrue if this client is to be the new host.

Returns

bool True if able to pick a new host.

Description

This is a utility function to pick one of the peers in the game as the new host.

This function implements the default host-choosing strategy of picking the peer with the lowest connectionId on the server.

Applications are not required to use this function to choose the new host. They can use any method they want. The choice does not have to be made synchronously, so it is possible to communicate with an external service to choose the new host.

However, the default UI of the NetworkMigrationManager calls into this function.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961