/**
	 * @param int $fid - forums user id
	 * @param int $gid - game user id
	 * @param int $from - bann beginn
	 * @param int $till - bann ends
	 * @param int $level - Bann is active for: Forum (1), Game (2) or both (0)
	 * @param string $unbannedby - User is Unbanned by
	 * @param string $unbannip - IP from Unbanner
	 * @return int
	 */
	public static function add($fid, $gid, $from, $till, $unbannedby, $unbannip, $level = 0) {
		$sql = 'INSERT INTO ' . self::getFullTableName() . ' (
			banned_fid,
			banned_gid,
			banned_from,
			banned_till,
			level,
			unbannedby,
			unbannip,
			date
		) VALUES (
			:fid,
			:gid,
			:from,
			:till,
			:level,
			:unbannedby,
			:unbannip,
			:date
		)';

		return SQL::execute(self::getConnection(), $sql,
			array(
				"fid" => $fid,
				"gid" => $gid,
				"from" => $from,
				"level" => $level,
				"till" => $till,
				"unbannedby" => $unbannedby,
				"unbannip" => $unbannip,
				"date" => common_functions::currentdate(),
			)
		);
	}
示例#2
0
include_once '../classes/common_functions.php';
$user = User::getUser($_SESSION['userID']);
$PlayerNetIncome = $user->getNetIncome();
$PlayerIncome = $user->getIncome();
$playerCash = $user->getCash();
$playerStamina = $user->getStamina();
$playerHealth = $user->getHealth();
$playerEnergy = $user->getEnergy();
$playerStaminaMax = $user->getStaminaMax();
$playerHealthMax = $user->getHealthMax();
$playerEnergyMax = $user->getEnergyMax();
$PlayerUpkeep = $user->getUpkeep();
$updatedCash = 0;
$request_timer = '';
$increment_value = '';
$fn = new common_functions();
if (isset($_GET)) {
    if (!isset($_GET['operation'])) {
        if (isset($_GET['request_timer']) && $_GET['request_timer'] == "income_timer") {
            $increment_value = $_GET['increment_value'];
            $request_timer = $_GET['request_timer'];
            //if(UserTimers::incrementIncomeTimer($_SESSION['userID'], $increment_value)){
            if (UserTimers::updateIncomeTimer($_SESSION['userID'])) {
                if ($PlayerNetIncome > 0) {
                    $updatedCash = $playerCash + $PlayerNetIncome;
                } else {
                    $userUpkeepItemsDetails = Item::getUserUpkeepItems($_SESSION['userID']);
                    $allUpkeepItems = array();
                    foreach ($userUpkeepItemsDetails as $item) {
                        array_push($allUpkeepItems, array('type' => 'item', 'id' => $item->getID(), 'upkeep' => $item->getUpkeep(), 'quantity' => $item->getQuantity(), 'price' => $item->getPrice()));
                    }
示例#3
0
<?php

ob_start();
session_start();
include_once "../classes/ConnectionFactory.php";
include_once "../properties/constants.php";
include_once "../properties/serverproperties.php";
include_once "../classes/User.php";
include_once "../classes/Item.php";
include_once "../classes/Utils.php";
include_once "../classes/common_functions.php";
include_once '../googlecheckout/google_checkout.php';
$fn = new common_functions();
$userID = $_SESSION['userID'];
$user = User::getUser($userID);
$update_cash = $fn->get('update_cash');
$diamonds = $fn->get('diamonds');
$refill = $fn->get('refill');
$attack_type = $fn->get('attack_type');
$userID = $fn->get('userID');
$itemID = $fn->get('itemID');
$itemType = $fn->get('itemType');
$missionID = $fn->get('missionID');
$cityID = $fn->get('cityID');
$add_soldier = $fn->get('add_soldier');
$stolen_goods = $fn->get('stolen_goods');
$blackmarket_goods = $fn->get('blackmarket_goods');
$updateDiamond = $fn->get('update_diamond');
$request_quantity = $fn->get('request_quantity');
$quantity = $fn->get('quantity');
$previousQuanity = $fn->get('previousQuanity');
示例#4
0
<?php

include_once "../properties/serverproperties.php";
include_once "../classes/Bounty.php";
include_once "../classes/User.php";
require_once '../classes/common_functions.php';
$fn = new common_functions();
session_start();
$userID = $_SESSION['userID'];
//echo '<br/>';
$serverRoot;
$targetID = $fn->get('targetID');
//echo '<br/>';
$payment = $fn->get('bountyAmount');
$payment = $payment - ceil($payment * 0.1);
//echo '<br/>';
//echo '<br/>';
$userBounty = User::getUser($userID);
$targetName = $userBounty->getName();
if ($payment > $userBounty->getCash()) {
    header("Location: {$serverRoot}externalplayerprofile.php?error=notEnoughCashForBounty&userID={$targetID}");
} else {
    if ($userBounty->checkSameUsersInAgency($userID, $targetID) == true) {
        $_SESSION['sameAgencyUser'] = true;
        header("Location: {$serverRoot}externalplayerprofile.php?error=sameAgencyUser&userID={$targetID}");
    } else {
        $bounty = Bounty::createBounty($userID, $targetID, $payment);
        if (!$bounty) {
            //echo '!$bounty found';
            $fn->redirect("{$serverRoot}externalplayerprofile.php?error=unKnownError&userID={$targetID}");
        }
示例#5
0
<?php

session_start();
include_once "../classes/User.php";
include_once "../classes/RealEstate.php";
include_once "../properties/serverproperties.php";
include_once '../properties/constants.php';
include_once '../classes/UserTimers.php';
include_once "../classes/Item.php";
include_once '../classes/common_functions.php';
$fn = new common_functions();
$actionToDo = $_REQUEST['actionToDo'];
$userCash = $_REQUEST['userCash'];
$reID = $_REQUEST['realEstateID'];
$realEstate = RealEstate::getRealEstate($reID);
$incomeChange = $realEstate->getIncome();
$purchasePrice = $_REQUEST['purchasePrice'];
$quantity = 1;
$userOwnedQuantity = 0;
$user = User::getUser($_SESSION['userID']);
if (isset($_GET['quantity'])) {
    $quantity = $_GET['quantity'];
    $userOwnedQuantity = $_GET['previousQuanity'];
    $totalQuantity = $quantity + $userOwnedQuantity;
    if ($quantity > 1) {
        $originalPrice = $_GET['originalPrice'];
        $totalPurchasePrice = 0;
        for ($i = $userOwnedQuantity + 1; $i <= $totalQuantity; $i++) {
            $price = $originalPrice + INCREASE_REAL_ESTATE_PERCENTAGE * $originalPrice * $i;
            $totalPurchasePrice += $price;
        }
示例#6
0
session_start();
/*
 * Main aplication file
 */
require_once 'config.php';
require_once 'constants.php';
require_once 'classes/common_functions.php';
require_once 'classes/UserTimers.php';
include_once 'classes/RealEstate.php';
include_once "properties/stringconstants.php";
include_once "properties/constants.php";
//include_once("googlecheckout/google_checkout.php");
//if(!isset($_SESSION['userID'])){
//    header("Location: {$serverRoot}index.php");
//}
$fn = new common_functions();
$user = User::getUser($_SESSION['userID']);
//if (!$user) {
//	// Redirect to error page
//	header("Location: {$serverRoot}errorpage.html");
//	exit;
//}
$playerName = $user->getName();
$playerLevel = $user->getLevel();
$playerType = $user->getType();
$playerCash = $user->getCash();
$playerStamina = $user->getStamina();
$playerHealth = $user->getHealth();
$playerEnergy = $user->getEnergy();
$playerStaminaMax = $user->getStaminaMax();
$playerHealthMax = $user->getHealthMax();