mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 03:53:04 +00:00
replace obsolete methods from CmdLineUtils with new ones
This commit is contained in:
parent
0a61efe388
commit
54144bf56a
2 changed files with 8 additions and 12 deletions
|
@ -19,21 +19,17 @@ namespace SanAndreasUnity.Net
|
|||
for (int i = 0; i < this.numFramesToWait; i++)
|
||||
yield return null;
|
||||
|
||||
ushort portNum = (ushort)NetManager.defaultListenPortNumber;
|
||||
CmdLineUtils.GetUshortArgument("portNum", ref portNum);
|
||||
ushort portNum = CmdLineUtils.GetUshortArgumentOrDefault(
|
||||
"portNum", (ushort)NetManager.defaultListenPortNumber);
|
||||
|
||||
string sceneName = "Main";
|
||||
CmdLineUtils.GetArgument("scene", ref sceneName);
|
||||
string sceneName = CmdLineUtils.GetStringArgumentOrDefault("scene", "Main");
|
||||
|
||||
ushort maxNumPlayers = (ushort)NetManager.maxNumPlayers;
|
||||
CmdLineUtils.GetUshortArgument("maxNumPlayers", ref maxNumPlayers);
|
||||
ushort maxNumPlayers = CmdLineUtils.GetUshortArgumentOrDefault(
|
||||
"maxNumPlayers", (ushort)NetManager.maxNumPlayers);
|
||||
|
||||
string serverIp = "127.0.0.1";
|
||||
CmdLineUtils.GetArgument("serverIp", ref serverIp);
|
||||
string serverIp = CmdLineUtils.GetStringArgumentOrDefault("serverIp", "127.0.0.1");
|
||||
|
||||
string gameModeName = null;
|
||||
CmdLineUtils.GetArgument("gameMode", ref gameModeName);
|
||||
if (!string.IsNullOrWhiteSpace(gameModeName))
|
||||
if (CmdLineUtils.TryGetStringArgument("gameMode", out string gameModeName))
|
||||
{
|
||||
var gameModeInfo = GameModeManager.Instance.GameModes.FirstOrDefault(gm => gm.Name == gameModeName);
|
||||
if (gameModeInfo != null)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 24a4145919b8b6e444b8b3e65d245a0c86da105a
|
||||
Subproject commit 6efa03e952899d656fe731a820c9057a5dc5b129
|
Loading…
Reference in a new issue