Exemplo n.º 1
0
    $error_str = $cw['message_sent'] . ".";
    //send message to central forum
} elseif ($target_id == -99 || $target_id == -50) {
    if ($user['login_id'] == OWNER_ID) {
        //server admin
        $sender_name = "<b class=\"b1\">" . $p_user['login_name'] . "</b> (" . $cw['server_admin'] . ")";
    } elseif ($user['login_id'] == 1) {
        //admin
        $sender_name = "<b class=\"b1\">" . $cw['admin'] . "</b> - ({$game_info['admin_name']} - {$game_info['name']})";
    } else {
        //regular player
        $sender_name = "<b class=\"b1\">" . $p_user['login_name'] . "</b> - {$game_info['name']}";
    }
    dbn("insert into se_central_messages (timestamp, forum_id, sender_id, sender_name, text, game_id) values(" . time() . ", '{$target_id}', '{$user['login_id']}', '{$sender_name}', '" . mysql_escape_string(substr($text, 0, 5000)) . "', '{$game_info['game_id']}')");
    $error_str = $st[911];
} else {
    send_message($target_id, $text);
    send_templated_email($target_id, 'message');
    $error_str = $st[912];
}
if ($target_id == -1 || $target_id == -50) {
    $error_str .= "<br /><br /><a href='forum.php?target_id={$target_id}'>" . $cw['back_forum'] . "</a>";
} elseif ($target_id == -2) {
    $error_str .= "<br /><br /><a href='clan.php'>" . $st[913] . "</a>";
} elseif ($target_id == -5) {
    $error_str .= "<br /><br /><a href='forum.php?target_id=-5&amp;clan_id={$clan_id}'>" . $st[914] . "</a>";
} elseif ($target_id != -99) {
    $error_str .= "<br /><br /><a href='mpage.php'>" . $st[915] . "</a>";
}
// print page
print_page($cw['send_message'], $error_str);
Exemplo n.º 2
0
             $temp_attack_ship_list .= "<tr><td bgcolor=#221111>Destroyed</td><td bgcolor=#221111>" . $ships_involved_str[$player_id]['lost'] . "</td></tr>";
             $temp_attack_ship_list .= "<tr><td bgcolor=#112211>Survived</td><td bgcolor=#112211>" . $ships_involved_str[$player_id]['survived'] . "</td></tr>";
             $temp_attack_ship_list .= "</table>";
             //a defending ship
         } else {
             //add the defending ships to a variable to be put into the ship list later.
             $temp_defend_ship_list .= "<p /><hr width=20%><p />" . make_table(array("<center>{$player['login_name_link']}</center>", "Lost: {$player['ships_lost']}, Survived: " . substr_count($ships_involved_str[$player_id]['survived'], "<br />")));
             $temp_defend_ship_list .= "<tr><td bgcolor=#221111>Destroyed</td><td bgcolor=#221111>" . $ships_involved_str[$player_id]['lost'] . "</td></tr>";
             $temp_defend_ship_list .= "<tr><td bgcolor=#112211>Survived</td><td bgcolor=#112211>" . $ships_involved_str[$player_id]['survived'] . "</td></tr>";
             $temp_defend_ship_list .= "</table>";
         }
         //end of 'if' for attacking or defening ship.
         //send the message to looping player.
         if ($simulate_attack == 0) {
             send_message($player_id, $short_str);
             send_templated_email($player_id, 'attack');
         }
         //prepare to print the list to the user.
         $targets_involved_ships .= $temp_defend_ship_list;
     }
     //end of not-the-player 'if'
     //make an sql query to update the database with at the end of the process.
     //this will update all user aspects related combat (including new ship id's and locations if any!).
     $update_users_sql[] = "update {$db_name}_users set ships_killed_points = ships_killed_points + '{$player['ship_points_killed']}', ships_lost_points = ships_lost_points + '{$player['ship_points_lost']}', ships_killed = ships_killed + '{$player['ships_killed']}', ships_lost = ships_lost + '{$player['ships_lost']}', fighters_killed = fighters_killed + '{$player['fighters_killed']}', fighters_lost = fighters_lost + '{$player['fighters_lost']}', last_attack_by = '{$last_attack}', last_attack = '" . time() . "', location = '{$player['location']}', ship_id = '{$player['ship_id']}' " . $lost_ep_update . " where login_id = '{$player_id}'";
     $players_array[$player_id] = $player;
 }
 //end of 'foreach' processing players.
 //start of table listing to the player all the ships involved in the combat.
 $tech_str .= $st[1825];
 $tech_str .= make_table(array("<center>" . $st[1826] . "</center>", "Lost: {$players_array[$user['login_id']]['ships_lost']}", $cw['Survived'] . ":" . substr_count($ships_involved_str[$user['login_id']]['survived'], "<br />")));
 $tech_str .= "<tr><td bgcolor=#221111>" . $cw['Destroyed'] . "</td><td bgcolor=#221111>" . $ships_involved_str[$user['login_id']]['lost'] . "</td></tr>";