/// <summary>
/// Starts the server thread.
/// </summary>
internal int Start()
{
int dbStatus = database.TestConnection();
if (dbStatus == 1)
{
listenAbort = false;
listenThread = new Thread(new ThreadStart(ListenForClients));
listenThread.Start();
Log("Server started", 0);
}
else
{
switch (dbStatus)
{
case -1:
Log("DATABASE ERROR: Can't connect to specified host", 0);
break;
case -2:
Log("DATABASE ERROR: Access Denied", 0);
break;
default:
Log("DATABASE ERROR: Can't connect to database", 0);
break;
}
Log("Server not started", 0);
}
return(dbStatus);
}