select_db($Config['Mangos']['DatabaseRealmd']); $DbResult = $Database->query('SELECT COUNT(*) FROM account'); $Row = $DbResult->fetch_array(); $AccountCount = $Row[0]; $Database2 = new Database($Config['CheckRegistration']['Host'], $Config['CheckRegistration']['User'], $Config['CheckRegistration']['Password'], $Config['CheckRegistration']['Database']); $Database2->charset($Config['CheckRegistration']['Charset']); $DbResult = $Database2->query('SELECT MAX(avg) FROM `data_wow_players` WHERE measure=5 AND level=0 AND time (NOW() - INTERVAL 1 DAY)'); $Row = $DbResult->fetch_array(); $YesterdayMaxPlayers = $Row[0]; $AllowedRegistrationCountPerDay = $Config['Mangos']['RequiredOnlinePlayers'] - $YesterdayMaxPlayers; if($AllowedRegistrationCountPerDay < 0) $AllowedRegistrationCountPerDay = 0; $ConfigFile = fopen('reg_config.php', 'w+'); fputs($ConfigFile, ''."\n"); fclose($ConfigFile); ?>