Version: 2017.2

NetworkMigrationManager.OnServerReconnectPlayer

切换到手册
protected void OnServerReconnectPlayer (Networking.NetworkConnection newConnection, GameObject oldPlayer, int oldConnectionId, short playerControllerId);
protected void OnServerReconnectPlayer (Networking.NetworkConnection newConnection, GameObject oldPlayer, int oldConnectionId, short playerControllerId, Networking.NetworkReader extraMessageReader);

参数

newConnection 新客户端的连接。
oldPlayer 与此客户端关联的玩家对象。
oldConnectionId 此客户端在旧主机上的 connectionId。
playerControllerId 重新加入的玩家的 playerControllerId。
extraMessageReader 其他消息数据(可选)。

描述

当来自旧主机的客户端重新连接新主机时,在新主机上调用的虚拟函数。

此函数的基类版本会调用 ReconnectPlayerForConnection() 来连接新客户端。

不需要从此函数内调用 ReconnectPlayerForConnection,这一操作可以异步进行。

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