Urho3D/bin/Data/Scripts/Utilities/Network.as
2015-01-18 21:31:13 +08:00

40 lines
1.0 KiB
ActionScript

bool runServer = false;
bool runClient = false;
String serverAddress;
uint16 serverPort = 1234;
String userName;
bool nobgm = false;
void ParseNetworkArguments()
{
Array<String>@ arguments = GetArguments();
for (uint i = 0; i < arguments.length; ++i)
{
String argument = arguments[i].ToLower();
if (argument[0] == '-')
{
argument = argument.Substring(1);
if (argument == "server")
{
runServer = true;
runClient = false;
}
else if (argument == "address")
{
runClient = true;
runServer = false;
serverAddress = arguments[i + 1];
++i;
}
else if (argument == "username")
{
userName = arguments[i + 1];
++i;
}
else if (argument == "nobgm")
nobgm = true;
}
}
}