void GatherCmdArgs() { InsightArgs args = new InsightArgs(); if (args.IsProvided("-NetworkAddress")) { Debug.Log("[Args] - NetworkAddress: " + args.NetworkAddress); NetworkAddress = args.NetworkAddress; } if (args.IsProvided("-NetworkPort")) { Debug.Log("[Args] - NetworkPort: " + args.NetworkPort); NetworkPort = (ushort)args.NetworkPort; networkManagerTelepathyTransport.port = (ushort)args.NetworkPort; } if (args.IsProvided("-SceneName")) { Debug.Log("[Args] - SceneName: " + args.SceneName); GameScene = args.SceneName; SceneManager.LoadScene(args.SceneName); } if (args.IsProvided("-UniqueID")) { Debug.Log("[Args] - UniqueID: " + args.UniqueID); UniqueID = args.UniqueID; } MaxPlayers = networkManager.maxConnections; //Start NetworkManager networkManager.StartServer(); }
void GatherCmdArgs() { InsightArgs args = new InsightArgs(); if (args.IsProvided("-NetworkAddress")) { Debug.Log("[Args] - NetworkAddress: " + args.NetworkAddress); NetworkAddress = args.NetworkAddress; NetworkManager.singleton.networkAddress = NetworkAddress; } if (args.IsProvided("-NetworkPort")) { Debug.Log("[Args] - NetworkPort: " + args.NetworkPort); NetworkPort = (ushort)args.NetworkPort; if (networkManagerTransport is MultiplexTransport) { ushort startPort = NetworkPort; foreach (Transport transport in (networkManagerTransport as MultiplexTransport).transports) { SetPort(transport, startPort++); } } else { SetPort(networkManagerTransport, NetworkPort); } } if (args.IsProvided("-SceneName")) { Debug.Log("[Args] - SceneName: " + args.SceneName); GameScene = args.SceneName; SceneManager.LoadScene(args.SceneName); } if (args.IsProvided("-UniqueID")) { Debug.Log("[Args] - UniqueID: " + args.UniqueID); UniqueID = args.UniqueID; } MaxPlayers = NetworkManager.singleton.maxConnections; //Start NetworkManager NetworkManager.singleton.StartServer(); }
private void GatherCmdArgs() { var args = new InsightArgs(); if (args.IsProvided(ArgNames.UniqueId)) { Debug.Log("[Args] - UniqueID: " + args.UniqueId); uniqueId = args.UniqueId; } if (args.IsProvided(ArgNames.NetworkAddress)) { Debug.Log("[Args] - NetworkAddress: " + args.NetworkAddress); networkAddress = args.NetworkAddress; netManager.networkAddress = networkAddress; } if (args.IsProvided(ArgNames.NetworkPort)) { Debug.Log("[Args] - NetworkPort: " + args.NetworkPort); networkPort = (ushort)args.NetworkPort; if (transport.GetType().GetField("port") != null) { transport.GetType().GetField("port") .SetValue(transport, (ushort)args.NetworkPort); } } if (args.IsProvided(ArgNames.GameName)) { Debug.Log("[Args] - GameName: " + args.GameName); gameName = args.GameName; } if (args.IsProvided(ArgNames.MinPlayers)) { Debug.Log("[Args] - MinPlayers: " + args.MinPlayers); minPlayers = args.MinPlayers; } if (args.IsProvided(ArgNames.MaxPlayers)) { Debug.Log("[Args] - MaxPlayers: " + args.MaxPlayers); maxPlayers = args.MaxPlayers; } }
void GatherCmdArgs() { InsightArgs args = new InsightArgs(); if (args.IsProvided("-NetworkAddress")) { logger.Log("[Args] - NetworkAddress: " + args.NetworkAddress); NetworkAddress = args.NetworkAddress; } if (args.IsProvided("-NetworkPort")) { logger.Log("[Args] - NetworkPort: " + args.NetworkPort); NetworkPort = (ushort)args.NetworkPort; if (networkManagerTransport.GetType().GetField("port") != null) { networkManagerTransport.GetType().GetField("port").SetValue(networkManagerTransport, (ushort)args.NetworkPort); } //For IgnoranceTransport if (networkManagerTransport.GetType().GetField("CommunicationPort") != null) { networkManagerTransport.GetType().GetField("CommunicationPort").SetValue(networkManagerTransport, (ushort)args.NetworkPort); } } if (args.IsProvided("-SceneName")) { logger.Log("[Args] - SceneName: " + args.SceneName); GameScene = args.SceneName; SceneManager.LoadScene(args.SceneName); } if (args.IsProvided("-UniqueID")) { logger.Log("[Args] - UniqueID: " + args.UniqueID); UniqueID = args.UniqueID; } MaxPlayers = NetworkManager.singleton.maxConnections; //Start NetworkManager NetworkManager.singleton.StartServer(); }