Skip to content

Commit fda6999

Browse files
committed
Clean up
1 parent 13960e3 commit fda6999

File tree

4 files changed

+12
-53
lines changed

4 files changed

+12
-53
lines changed

com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -976,19 +976,6 @@ public NetworkPrefabHandler PrefabHandler
976976
internal NetworkConnectionManager ConnectionManager = new NetworkConnectionManager();
977977
internal NetworkMessageManager MessageManager = null;
978978

979-
// internal struct Override<T>
980-
// {
981-
// private T m_Value;
982-
// public bool Overidden { get; private set; }
983-
// internal T Value
984-
// {
985-
// get { return Overidden ? m_Value : default(T); }
986-
// set { Overidden = true; m_Value = value; }
987-
// }
988-
// };
989-
//
990-
// internal Override<ushort> PortOverride;
991-
992979
/// <summary>
993980
/// Determines if the NetworkManager's GameObject is parented under another GameObject and
994981
/// notifies the user that this is not allowed for the NetworkManager.
@@ -1168,8 +1155,6 @@ internal void Initialize(bool server)
11681155
return;
11691156
}
11701157

1171-
//ParseCommandLineOptions();
1172-
11731158
if (NetworkConfig.NetworkTransport == null)
11741159
{
11751160
if (NetworkLog.CurrentLogLevel <= LogLevel.Error)
@@ -1740,40 +1725,6 @@ private void OnDestroy()
17401725
#endif
17411726
}
17421727

1743-
// // Command line options
1744-
// private const string k_OverridePortArg = "-port";
1745-
//
1746-
// private string GetArg(string[] commandLineArgs, string arg)
1747-
// {
1748-
// var argIndex = Array.IndexOf(commandLineArgs, arg);
1749-
// if (argIndex >= 0 && argIndex < commandLineArgs.Length - 1)
1750-
// {
1751-
// return commandLineArgs[argIndex + 1];
1752-
// }
1753-
//
1754-
// return null;
1755-
// }
1756-
//
1757-
// private void ParseArg<T>(string arg, ref Override<T> value)
1758-
// {
1759-
// if (GetArg(Environment.GetCommandLineArgs(), arg) is string argValue)
1760-
// {
1761-
// value.Value = (T)Convert.ChangeType(argValue, typeof(T));
1762-
// }
1763-
// }
1764-
//
1765-
// private void ParseCommandLineOptions()
1766-
// {
1767-
// #if UNITY_SERVER && UNITY_DEDICATED_SERVER_ARGUMENTS_PRESENT
1768-
// if ( UnityEngine.DedicatedServer.Arguments.Port != null)
1769-
// {
1770-
// PortOverride.Value = (ushort)UnityEngine.DedicatedServer.Arguments.Port;
1771-
// }
1772-
// #else
1773-
// ParseArg(k_OverridePortArg, ref PortOverride);
1774-
// #endif
1775-
// }
1776-
17771728
#if UNITY_EDITOR
17781729
internal static INetworkManagerHelper NetworkManagerHelper;
17791730

com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,10 +824,10 @@ private void ParseCommandLineOptions()
824824
{
825825
#if UNITY_SERVER && UNITY_DEDICATED_SERVER_ARGUMENTS_PRESENT
826826

827-
Debug.Log("This is happening 1");
828-
if ( UnityEngine.DedicatedServer.Arguments.Port != null)
827+
Debug.Log("UNITY_DEDICATED_SERVER_ARGUMENTS_PRESENT");
828+
if (UnityEngine.DedicatedServer.Arguments.Port != null)
829829
{
830-
Debug.Log("This is happening 2");
830+
Debug.Log("UnityEngine.DedicatedServer.Arguments.Port is not null");
831831
PortOverride.Value = (ushort)UnityEngine.DedicatedServer.Arguments.Port;
832832
}
833833
#else
@@ -851,7 +851,7 @@ public void SetConnectionData(string ipv4Address, ushort port, string listenAddr
851851
Debug.Log($"Already has command line option set. Using connection data set to {ipv4Address}:{port}");
852852
}
853853

854-
ConnectionData.Port = port;
854+
port = ConnectionData.Port;
855855
}
856856
else
857857
{

testproject/Packages/manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"com.unity.addressables": "2.7.4",
55
"com.unity.ai.navigation": "2.0.9",
66
"com.unity.collab-proxy": "2.9.3",
7+
"com.unity.dedicated-server": "1.6.1",
78
"com.unity.ide.rider": "3.0.38",
89
"com.unity.ide.visualstudio": "2.0.25",
910
"com.unity.mathematics": "1.3.3",

testproject/Packages/packages-lock.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@
5555
},
5656
"url": "https://packages.unity.com"
5757
},
58+
"com.unity.dedicated-server": {
59+
"version": "1.6.1",
60+
"depth": 0,
61+
"source": "registry",
62+
"dependencies": {},
63+
"url": "https://packages.unity.com"
64+
},
5865
"com.unity.ext.nunit": {
5966
"version": "2.0.5",
6067
"depth": 1,

0 commit comments

Comments
 (0)