Пример #1
0
 public static function all()
 {
     $data = ClanFactory::allData();
     $clans = array();
     foreach ($data as $clan_info) {
         $clans[] = self::fleshOutFromData($clan_info, new Clan());
     }
     return $clans;
 }
Пример #2
0
 public function getClan()
 {
     return ClanFactory::clanOfMember($this->id());
 }
Пример #3
0
if ($error = init($private, $alive)) {
    display_error($error);
} else {
    $command = in('command');
    $to = in('to');
    // The target of the message, if any were specified.
    $to = $to ? $to : get_setting('last_messaged');
    $to_clan = in('toclan');
    $messenger = in('messenger');
    // naive spam detection attempt
    $message = in('message', null, null);
    // Unfiltered input for this message.
    $target_id = (int) in('target_id') ? (int) in('target_id') : ($to ? get_user_id($to) : null);
    // Id takes precedence
    $ninja = new Player(self_char_id());
    $clan = ClanFactory::clanOfMember($ninja);
    $has_clan = $clan ? true : false;
    $page = in('page', 1, 'non_negative_int');
    $limit = 25;
    $offset = non_negative_int(($page - 1) * $limit);
    $delete = in('delete');
    $informational = in('informational');
    $type = in('type');
    // Clan chat or normal messages.
    $type = restrict_to($type, array(0, 1));
    $message_sent_to = null;
    // Names or name to display.
    $message_to = null;
    // strings clan or individual if sent to those respectively.
    if ($target_id) {
        $to = get_char_name($target_id);
Пример #4
0
 function testGetClanObjectNumericRating()
 {
     $this->markTestIncomplete('Clan rating is not yet implemented');
     $p1 = new Player($this->char_id);
     $clan = ClanFactory::find($this->clan_id);
     $this->assertTrue($clan->addMember($p1, $p1));
     $this->assertTrue($clan->addMember($p2 = new Player($this->char_id_2), $p1));
     $this->assertTrue($clan->rating());
 }