Example #1
0
	public function
	getSpyAttackLogsCount() {
		return SpyLog::getAttackLogsCount($this->id);
	}
Example #2
0
$filter = array(
	'id'     => FILTER_VALIDATE_INT | FILTER_SANITIZE_NUMBER_INT,
	'isview' => FILTER_VALIDATE_INT | FILTER_SANITIZE_NUMBER_INT,
);

$filtered  = filter_input_array(INPUT_POST, $filter);
$filteredG = filter_input_array(INPUT_GET, $filter);

$id        = $filteredG['id'];
$t->isView = $filteredG['isview'] ? true : false;

try {

	if ($id) {
		$spylog = new SpyLog();
		$spylog->get($id);
		
		$attackerCanSee = $user->id == $spylog->attackerId;
		$targetCanSee   = ($user->id == $spylog->targetId) and ($spylog->type == 1 or $spylog->isSuccess == 0);
		
		if ($attackerCanSee) {
			$t->target = new User();
			$t->target->get($spylog->targetId);
			$t->attacker = $user;
		}
		else if($targetCanSee) {
			$t->attacker = new User();
			$t->attacker->get($spylog->attackerId);
			$t->target = $user;
		}
Example #3
0
	exit;
}

$target = new User();
$target->get($uid);

if ($target->area != $user->area) {
	header("Location: stats.php?uid=$uid&e=7");
	exit;
}
else if (!IP::canAttack($user, $target)) {
	header("Location: stats.php?uid=$uid&e=8");
	exit;
}

$spylog = new SpyLog();
$spylog->attackerId       = $user->id;
$spylog->targetId         = $target->id;
$spylog->time             = time();
$spylog->attackerStrength = $user->CA;
$spylog->targetStrength   = $target->CA;
$spylog->spies            = 1;

if ($user->CA > $target->CA) {
		$spylog->isSuccess = 1;
		
		$spylog->sasoldiers      = spiedValue($target->sasoldiers, $user, $target);
		$spylog->samercs         = spiedValue($target->samercs, $user, $target);
		$spylog->dasoldiers      = spiedValue($target->dasoldiers, $user, $target);
		$spylog->damercs         = spiedValue($target->damercs, $user, $target);
		$spylog->uu              = spiedValue($target->uu, $user, $target);