public int GetHealth()
{
// Returns:
// 1 = sim is up and accepting http requests. The heartbeat has
// stopped and the sim is probably locked up, but a remote
// admin restart may succeed
//
// 2 = Sim is up and the heartbeat is running. The sim is likely
// usable for people within and logins _may_ work
//
// 3 = We have seen a new user enter within the past 4 minutes
// which can be seen as positive confirmation of sim health
//
int health=1; // Start at 1, means we're up
if ((Util.EnvironmentTickCountSubtract(m_lastUpdate)) < 1000)
health+=1;
else
return health;
// A login in the last 4 mins? We can't be doing too badly
//
if ((Util.EnvironmentTickCountSubtract(m_LastLogin)) < 240000)
health++;
else
return health;
CheckHeartbeat();
return health;
}