Ejemplo n.º 1
0
 function testGetClanThatAMemberBelongsTo()
 {
     $p1 = new Player($this->char_id);
     $clan = ClanFactory::find($this->clan_id);
     $this->assertTrue($clan->addMember($p1, $p1));
     $clan_final = ClanFactory::clanOfMember($p1);
     $this->assertTrue($clan_final->hasMember($p1->id()));
 }
Ejemplo n.º 2
0
 public function getClan()
 {
     return ClanFactory::clanOfMember($this->id());
 }
Ejemplo n.º 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);