function channel_msg_sd_list($fp, $rdata, $account, $player) { if (preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s(.*)\\s:!sd list\\s$/i', $rdata, $msg)) { global $sds; $nick = $msg[1]; $user = $msg[2]; $host = $msg[3]; $channel = $msg[4]; echo_r('[SD_LIST] by ' . $nick . ' in ' . $channel); $refresh_per_hour = 250 * Globals::getGameSpeed($player->getGameID()); $refresh_per_sec = $refresh_per_hour / 3600; fputs($fp, 'PRIVMSG ' . $channel . ' :The following supply/demand list has been recorded:' . EOL); fputs($fp, 'PRIVMSG ' . $channel . ' :Sector Amount' . EOL); foreach ($sds as $sd) { if ($sd[3] == $channel) { $seconds_since_refresh = time() - $sd[2]; if ($seconds_since_refresh < 0) { $seconds_since_refresh = 0; } $amt_to_add = floor($seconds_since_refresh * $refresh_per_sec); if ($sd[1] + $amt_to_add > 4000) { fputs($fp, 'PRIVMSG ' . $channel . ' : ' . sprintf('%4s', $sd[0]) . ' ' . sprintf('%4s', 'full') . EOL); } else { fputs($fp, 'PRIVMSG ' . $channel . ' : ' . sprintf('%4s', $sd[0]) . ' ' . sprintf('%4s', $sd[1] + $amt_to_add) . EOL); } } } return true; } }
$template->assign('PageTopic', 'Ship Dealer'); $db->query('SELECT ship_type_id FROM location JOIN location_sells_ships USING (location_type_id) WHERE sector_id = ' . $db->escapeNumber($player->getSectorID()) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND location_type_id = ' . $db->escapeNumber($var['LocationID'])); $shipsSold = array(); if ($db->getNumRows() > 0) { $container = create_container('skeleton.php', 'shop_ship.php'); transfer('LocationID'); while ($db->nextRecord()) { $shipTypeID = $db->getField('ship_type_id'); $shipsSold[$shipTypeID] =& AbstractSmrShip::getBaseShip(Globals::getGameType($player->getGameID()), $shipTypeID); $container['ship_id'] = $shipTypeID; $container['level_needed'] = $shipsSold[$shipTypeID]['Level']; $shipsSoldHREF[$shipTypeID] = SmrSession::getNewHREF($container); } } $template->assign('ShipsSold', $shipsSold); $template->assign('ShipsSoldHREF', $shipsSoldHREF); if (isset($var['ship_id'])) { $compareShip = AbstractSmrShip::getBaseShip(Globals::getGameType($player->getGameID()), $var['ship_id']); $compareShip['RealSpeed'] = $compareShip['Speed'] * Globals::getGameSpeed($player->getGameID()); $compareShip['Turns'] = round($player->getTurns() * $compareShip['Speed'] / $ship->getSpeed()); $container = create_container('shop_ship_processing.php'); transfer('LocationID'); transfer('ship_id'); $compareShip['BuyHREF'] = SmrSession::getNewHREF($container); $template->assign('CompareShip', $compareShip); }
<?php //general info define('MAX_TURNS', Globals::getGameSpeed($player->getGameID()) * 400); $limit = 10; define('MAXIMUM_FLEET_SIZE', $limit); //result info define('SHIELD_DMG_DONE', 0); define('DRONE_DMG_DONE', 1); define('ARMOUR_DMG_DONE', 2); define('DRONES_FIRED', 3); define('RESULT_OF_WEAPON', 4); define('TARGET', 5); define('DRONES_HIT_BEHIND_SHIELDS', 6); //result[4] define('NORMAL_HIT', 0); define('SHIELD_ON_DRONES', 1); define('ARMOUR_ON_SHIELD', 2); define('PORT_DEAD', 3); define('FINAL_HIT', 4); define('WEAPON_MISS', 5); define('ALREADY_DEAD', 6); define('SHIELD_ON_ARMOUR', 7); //player array info define('PLAYER_ID', 0); define('PLAYER_NAME', 1); define('ALLIANCE_ID', 2); define('RACE_ID', 3); define('CREDITS', 4); define('TURNS', 5); define('ALIGNMENT', 6);
?> </td> </tr> <tr> <td align="right">Game Type</td> <td> </td> <td align="left"><?php echo Globals::getGameType($StatsGameID); ?> </td> </tr> <tr> <td align="right">Game Speed</td> <td> </td> <td align="left"><?php echo Globals::getGameSpeed($StatsGameID); ?> </td> </tr> <tr> <td align="right">Credits Needed</td> <td> </td> <td align="left"><?php echo number_format(Globals::getGameCreditsRequired($StatsGameID)); ?> </td> </tr> <tr> <td align="right">Stats Ignored</td> <td> </td> <td align="left"><?php