it is now possible to assign a char from an offline user into a clanfight. Additionally the clan fight coordinators may kick chars from a clan challenge. Both actions will result into a notify pm. As there is a limit of the maximum amount of chars that can be assigned from offline users (also they have to be in free state) it is possible for the owner to give its okay when coming online.
$qry = db_query('SELECT user.id AS user_id, chars.id AS char_id, user.nickname AS user_name, chars.name AS char_name FROM user inner join chars on user.id = chars.besitzer where clan = 769 and user.id NOT IN (Select besitzer from chars inner join clan_challenge_participants on chars.id = clan_challenge_participants.char_id WHERE clan_challenge_id = '.$clan_challenge_id.' and clan_id = '.$user['clan'].')');
// block the user actions so we can ensure he won't register multiple of its chars here!
$resource = 'User:'.$user['id'];
$ressource = 'User:'.$user['id'];
if(!semaphoreUP($ressource)) {
return 'Du kannst den Char nicht an dem Kampf teilnehmen lassen, da du scheinbar gerade auch mit was anderem beschäftigt bist, versuche es bitte nochmal!';
// okay we now have a complete competition and the challenge is closed :)
return calculateChallenge($clan_challenge_id);
}
if($forced) {
sendMessage($requestor['nickname'], $char['besitzer'], 'Clanfightteilnahme', 'Dein Char ' . $char['name'] . ' wurde zu einem Clanfight hinzugezogen, du kannst ihn im Clanfight Menü abmelden oder dein OK geben, damit evtl. weitere Chars von offline Usern hinzugefügt werden können!');
}
return NULL;
}
@ -695,8 +718,11 @@ function leaveChallenge($clan_challenge_id, array $user, $charid) {
@ -19,12 +19,17 @@ function getUser($userid, $buffer_enabled = true) {
}
// Wenn Char nicht im Puffer ist, oder nicht gepuffert werden soll
if ($GLOBALS['user_buffered_instances'][$userid] == null || !$buffer_enabled) {
$user = mysql_fetch_assoc(mysql_query('SELECT * FROM user WHERE id = '.$userid));
$user = mysql_fetch_assoc(db_query('SELECT *, online_zeit between TIMESTAMPADD(Minute, -15, now()) and now() as online FROM user WHERE id = '.$userid));