if ($i == $home_sector_id) {
        continue;
    }
    $db->query('INSERT INTO player_visited_sector (account_id, game_id, sector_id) VALUES (' . $db->escapeNumber(SmrSession::$account_id) . ', ' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber($i) . ')');
}
$db->query('INSERT INTO player_has_stats (account_id, game_id) VALUES (' . $db->escapeNumber(SmrSession::$account_id) . ', ' . $db->escapeNumber($gameID) . ')');
// update stats
$db->query('UPDATE account_has_stats SET games_joined = games_joined + 1 WHERE account_id = ' . $db->escapeNumber($account->getAccountID()));
// is this our first game?
$db->query('SELECT * FROM account_has_stats WHERE account_id = ' . $db->escapeNumber($account->getAccountID()));
if ($db->nextRecord() && $db->getInt('games_joined') == 1) {
    //we are a newb set our alliance to be Newbie Help Allaince
    $db->query('UPDATE player SET alliance_id = ' . $db->escapeNumber(NHA_ID) . ' WHERE account_id = ' . $db->escapeNumber($account->getAccountID()) . ' AND game_id = ' . $db->escapeNumber($gameID));
    $db->query('INSERT INTO player_has_alliance_role (game_id, account_id, role_id,alliance_id) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber($account->getAccountID()) . ', 2,' . $db->escapeNumber(NHA_ID) . ')');
    //we need to send them some messages
    $message = 'Welcome to Space Merchant Realms, this message is to get you underway with information to start you off in the game. All newbie and beginner rated player are placed into a teaching alliance run by a Veteran player who is experienced enough to answer all your questions and give you a helping hand at learning the basics of the game.<br /><br />
	Apart from your leader (denoted with a star on your alliance roster) there are various other ways to get information and help. Newbie helpers are players in Blue marked on the Current Players List which you can view by clicking the link on the left-hand side of the screen that says "Current Players". Also you can visit the SMR Wiki via a link on the left which gives detailed information on all aspects fo the game.<br /><br />
	SMR is a very community orientated game and as such there is an IRC Chat server setup for people to talk with each other and coordinate your alliances. There is a link on the left which will take you directly to the main SMR room where people come to hang out and chat. You can also get help in the game in the #smr room. You can access this by typing /join #smr-help in the server window. If you prefer to use a dedicated program to access IRC Chat rather than a browser you can goto http://www.mirc.com which is a good shareware program (asks to register the program after 30 days but you can still use it after 30 days so you won\'t get cut off from using it) or http://www.xchat.org which is a free alternative. In the options of either program you will need to enter the server information to access the server. Add a new server and enter the server address irc.coldfront.net using port 6667. Once connected you can use the /join command to join #smr (/join #smr) or any other room on the server as normal.<br /><br />
	Apart from this you can view the webboard via a link on the left to join in community chat and conversations, ask questions for help and make suggestions for the game in various forums.<br /><br />
	To get underway, click the alliance link on the left where you can get more information on 	how to get started on the alliance message board which will get you into your alliance chat 	on IRC so you can get started and have your questions answered.<br /><br />Depending on the size and resolution of your monitor the default font size may be too large or small. This can be changed using the preferences link on the left panel.';
    SmrPlayer::sendMessageFromAdmin($gameID, $account->getAccountID(), $message);
}
if ($race_id == RACE_ALSKANT) {
    // Give Alskants 250 personal relations to start.
    $player =& SmrPlayer::getPlayer($account->getAccountID(), $gameID);
    $RACES =& Globals::getRaces();
    foreach ($RACES as $raceID => $raceInfo) {
        $player->setRelations(250, $raceID);
    }
}
forward(create_container('skeleton.php', 'game_play.php'));
    }
    $container['OffenderBanPoints'] = $_REQUEST['offenderBanPoints'];
    if (!empty($offendedReply)) {
        $container['PreviewOffended'] = $offendedReply;
    }
    $container['OffendedBanPoints'] = $_REQUEST['offendedBanPoints'];
    forward($container);
}
if (isset($offenderReply) && $offenderReply != '') {
    SmrPlayer::sendMessageFromAdmin($var['game_id'], $var['offender'], $offenderReply);
    //do we have points?
    if ($_REQUEST['offenderBanPoints']) {
        $suspicion = 'Inappropriate In-Game Message';
        $offenderAccount =& SmrAccount::getAccount($var['offender']);
        $offenderAccount->addPoints($_REQUEST['offenderBanPoints'], $account, 7, $suspicion);
    }
}
if (isset($_REQUEST['offendedReply'])) {
    $offendedReply = $_REQUEST['offendedReply'];
}
if (isset($offendedReply) && $offendedReply != '') {
    //next message
    SmrPlayer::sendMessageFromAdmin($var['game_id'], $var['offended'], $offendedReply);
    //do we have points?
    if ($_REQUEST['offendedBanPoints']) {
        $suspicion = 'Inappropriate In-Game Message';
        $offenderAccount =& SmrAccount::getAccount($var['offended']);
        $offenderAccount->addPoints($_REQUEST['offendedBanPoints'], $account, 7, $suspicion);
    }
}
forward(create_container('skeleton.php', 'notify_view.php'));
<?php

$message = trim($_REQUEST['message']);
if ($_REQUEST['action'] == 'Preview message') {
    $container = create_container('skeleton.php', 'box_reply.php');
    $container['BanPoints'] = $_REQUEST['BanPoints'];
    transfer('game_id');
    transfer('sender_id');
    $container['Preview'] = $message;
    forward($container);
}
if (!empty($message)) {
    SmrPlayer::sendMessageFromAdmin($var['game_id'], $var['sender_id'], $_REQUEST['message']);
    //do we have points?
    if ($_REQUEST['BanPoints']) {
        $suspicion = 'Inappropriate Actions';
        $senderAccount =& SmrAccount::getAccount($var['sender_id']);
        $senderAccount->addPoints($_REQUEST['BanPoints'], $account, 7, $suspicion);
    }
}
forward(create_container('skeleton.php', 'box_view.php'));
<?php

$message = trim($_REQUEST['message']);
$expire = $_REQUEST['expire'];
if ($_REQUEST['action'] == 'Preview message') {
    $container = create_container('skeleton.php', 'admin_message_send.php');
    transfer('SendGameID');
    $container['preview'] = $message;
    $container['expire'] = $expire;
    forward($container);
}
$account_id = $_REQUEST['account_id'];
$game_id = $var['SendGameID'];
if (!empty($account_id) || $game_id == 20000) {
    if ($expire > 0) {
        $expire = $expire * 3600 + TIME;
    }
    if ($game_id != 20000) {
        SmrPlayer::sendMessageFromAdmin($game_id, $account_id, $message, $expire);
    } else {
        //send to all players
        $db->query('SELECT game_id,account_id FROM player');
        while ($db->nextRecord()) {
            SmrPlayer::sendMessageFromAdmin($db->getField('game_id'), $db->getField('account_id'), $message, $expire);
        }
    }
}
$container = create_container('skeleton.php', 'admin_tools.php');
$container['msg'] = '<span class="green">SUCCESS: </span>Your message has been sent.';
forward($container);