Working on NetManager 2

This commit is contained in:
in0finite 2019-04-23 16:08:08 +02:00
parent 0979cabd51
commit 076257b82c

View file

@ -9,7 +9,9 @@ namespace SanAndreasUnity.Net
public static int defaultListenPortNumber { get { return 7777; } }
public static int listenPortNumber { get { return NetworkServer.listenPort; } }
public static int listenPortNumber { get { return telepathyTransport.port; } }
public static TelepathyTransport telepathyTransport { get { return ((TelepathyTransport)Transport.activeTransport); } }
public static string onlineScene {
get {
@ -121,8 +123,9 @@ namespace SanAndreasUnity.Net
private static void CheckIfOnlineSceneIsAssigned() {
if (string.IsNullOrEmpty (NetManager.onlineScene))
throw new System.Exception ("Online scene is not assigned");
// we won't use scene management from NetworkManager
// if (string.IsNullOrEmpty (NetManager.onlineScene))
// throw new System.Exception ("Online scene is not assigned");
}
@ -130,18 +133,10 @@ namespace SanAndreasUnity.Net
private static void SetupNetworkManger( string ip, int port ) {
NetworkManager.singleton.networkAddress = ip;
NetworkManager.singleton.networkPort = port;
telepathyTransport.port = (ushort) port;
}
public static NetworkClient GetClient() {
return NetworkManager.singleton.client;
}
}
}