- Home /
Question by
phatpixels · Jul 30, 2018 at 05:04 AM ·
networkingnetworkplayeripnetworkviewid
`The legacy networking system has been removed in Unity 2018.2. Use Unity Multiplayer and NetworkIdentity instead.'
Hello, upgrading to 2018.2 rendered the below script obsolete, Network.player.ipAddress, seems it needs updating but i cant seem to work out how to do it. If i find a solution i will post it back here, any help in the meantime would be greatly appreciated. Please help.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
using UnityEngine.Networking.NetworkSystem;
using System;
public class NetworkServerUI : MonoBehaviour {
void OnGUI () {
string ipaddress = Network.player.ipAddress;
GUI.Box (new Rect (10, Screen.height - 50, 100, 50), ipaddress);
GUI.Label (new Rect (20, Screen.height - 35, 100, 20), "Status:" + NetworkServer.active);
GUI.Label (new Rect (20, Screen.height - 20, 100, 20), "Connected:" + NetworkServer.connections.Count);
}
void Start () {
NetworkServer.Listen (25000);
NetworkServer.RegisterHandler (777, ServerRecieveMessage);
}
Comment
Best Answer
Answer by OrcaAndo · Jul 30, 2018 at 05:34 AM
I use this code. https://code.i-harness.com/ja/q/67ce81