<?php require_once '../htdocs/config.inc'; require_once LIB . 'Default/SmrMySqlDatabase.class.inc'; require_once LIB . 'Default/Globals.class.inc'; require_once LIB . 'Default/SmrPort.class.inc'; $db = new SmrMySqlDatabase(); $db->query('SELECT account_id,sector_id,game_id FROM player_visited_port'); while ($db->nextRecord()) { SmrPort::getCachedPort($db->getInt('game_id'), $db->getInt('sector_id'), $db->getInt('account_id'))->addCachePort($db->getInt('account_id')); SmrPort::clearCache(); }
// end here if we are alone in the alliance if (empty($alliance_ids)) { create_error('Who exactly are you sharing maps with?'); } $unvisitedSectors = array(0); // get the sectors the user hasn't visited yet $db->query('SELECT sector_id FROM player_visited_sector WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id = ' . $db->escapeNumber($player->getAccountID())); while ($db->nextRecord()) { $unvisitedSectors[] = $db->getInt('sector_id'); } // delete all visited sectors from the table of all our alliance mates $db->query('DELETE FROM player_visited_sector WHERE account_id IN (' . $db->escapeArray($alliance_ids) . ') AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND sector_id NOT IN (' . $db->escapeArray($unvisitedSectors) . ')'); // free some memory unset($unvisitedSectors); // get a list of all visited ports $db->query('SELECT sector_id FROM player_visited_port WHERE account_id = ' . $db->escapeNumber($player->getAccountID()) . ' AND game_id = ' . $db->escapeNumber($player->getGameID())); while ($db->nextRecord()) { $cachedPort =& SmrPort::getCachedPort($player->getGameID(), $db->getInt('sector_id'), $player->getAccountID()); $cachedPort->addCachePorts($alliance_ids); } forward(create_container('skeleton.php', 'alliance_roster.php'));