Version: 2017.1

ClientScene.SendReconnectMessage

매뉴얼로 전환
public static bool SendReconnectMessage (Networking.MessageBase extraMessage);

파라미터

extraMessage Any extra data to send.

반환

bool Returns true if the send succeeded.

설명

Send a reconnect message to the new host, used during host migration.

An example usage might be that if you decide to spawn your own player and not use the built in "Auto Create Player" property in the NetworkManager together with HostMigration, you would need to send a reconnect message when your client reconnects. The code below illustrates such an example were we OnClientConnect check if we where disconnected from the host and in that case we send the reconnect message.

using UnityEngine;
using UnityEngine.Networking;

public class NetworkManagerEx : NetworkManager { public override void OnClientConnect(NetworkConnection conn) { base.OnClientConnect(conn);

if (migrationManager.disconnectedFromHost) { ClientScene.SendReconnectMessage(null); } } }