public override void OnLobbyServerPlayerRemoved(NetworkConnection conn, short playerControllerId) { Debug.Log("On Lobby server remove lobby player"); for (int i = 0; i < lobbySlots.Length; ++i) { PlayerLobby p = lobbySlots[i] as PlayerLobby; if (p != null) { p.RpcUpdatePlayerLobby(); } } if (ServerLog.instance != null) { ServerLog.instance.Log("Player lobby : ID " + conn.connectionId + " removed"); } }
public override void OnLobbyServerDisconnect(NetworkConnection conn) { Debug.Log("On lobby disconnect"); if (ServerLog.instance != null) { ServerLog.instance.Log("Player lobby:" + conn.address + " disconnected"); } for (int i = 0; i < lobbySlots.Length; ++i) { PlayerLobby p = lobbySlots[i] as PlayerLobby; if (p != null) { p.RpcUpdatePlayerLobby(); } } }
// Server Callback public override GameObject OnLobbyServerCreateLobbyPlayer(NetworkConnection conn, short playerControllerId) { Debug.Log("On Lobby server create lobby player"); GameObject obj = Instantiate(lobbyPlayerPrefab.gameObject) as GameObject; for (int i = 0; i < lobbySlots.Length; ++i) { PlayerLobby p = lobbySlots[i] as PlayerLobby; if (p != null) { p.RpcUpdatePlayerLobby(); } } if (ServerLog.instance != null) { ServerLog.instance.Log("Player lobby:" + conn.address + " created"); } return(obj); }