1
0

Fixed type-casting-related warnings.

This commit is contained in:
Mattes D
2016-08-24 21:45:03 +02:00
parent 6c57cc389c
commit d2e8643607
42 changed files with 145 additions and 211 deletions

View File

@@ -27,14 +27,29 @@ int main(int argc, char ** argv)
cLogger::InitiateMultithreading();
int ListenPort = (argc > 1) ? atoi(argv[1]) : 25564;
int ConnectPort = (argc > 2) ? atoi(argv[2]) : 25565;
printf("Initializing ProtoProxy. Listen port %d, connect port %d.\n", ListenPort, ConnectPort);
UInt16 ListenPort = 25564;
UInt16 ConnectPort = 25565;
if (argc > 1)
{
if (!StringToInteger(argv[1], ListenPort))
{
LOGERROR("Invalid argument 1, expected port number, got \"%s\". Aborting.", argv[1]);
return 1;
}
if (argc > 2)
{
if (!StringToInteger(argv[2], ConnectPort))
{
LOGERROR("Invalid argument 2, expected port number, got \"%s\". Aborting.", argv[2]);
return 2;
}
}
}
cServer Server;
int res = Server.Init(ListenPort, ConnectPort);
if (res != 0)
{
printf("Server initialization failed: %d", res);
LOGERROR("Server initialization failed: %d", res);
return res;
}