예제 #1
0
function alliance_discovered_a_member($user_id, $alliance_id)
{
    assert(is_numeric($user_id));
    assert(is_numeric($alliance_id));
    $tmp = user_get_knownspecies($user_id);
    $knownusers = csl_merge_fields("", $tmp['csl_friend_id']);
    $knownusers = csl_merge_fields($knownusers, $tmp['csl_neutral_id']);
    $knownusers = csl_merge_fields($knownusers, $tmp['csl_enemy_id']);
    sort($knownusers, SORT_NUMERIC);
    $result = sql_query("SELECT * FROM g_users WHERE alliance_id=" . $alliance_id);
    $user = sql_fetchrow($result);
    if (in_array($user['user_id'], $knownusers)) {
        return true;
    }
    return false;
}
예제 #2
0
function load_current_ffn($uid)
{
    assert(is_numeric($uid));
    global $current_ffn;
    $current_ffn = array();
    $tmp = user_get_knownspecies($uid);
    $current_ffn['uid'] = $uid;
    $current_ffn['csl_neutral_id'] = csl($tmp['csl_neutral_id']);
    $current_ffn['csl_enemy_id'] = csl($tmp['csl_enemy_id']);
    $current_ffn['csl_friend_id'] = csl($tmp['csl_friend_id']);
}