mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-10 14:44:17 +00:00
Working on NetManager 2
This commit is contained in:
parent
0979cabd51
commit
076257b82c
1 changed files with 7 additions and 12 deletions
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue