public function __construct($name = null, $description = null, $id = null)
 {
     parent::__construct($name, $description, $id);
     $this->m = new Mongo("mongodb://" . $this->dbuser . ":" . $this->dbpassword . "@localhost");
     $this->db = $this->m->selectDB('bingo');
     $this->doctrinemodel = \Utility\DoctrineConnect::GetInstance(__DIR__ . '/../../cache')->Doctrinemodel;
 }
Exemplo n.º 2
0
*/
// check parameter..
$userid = $_GET["snuid"];
$currencyCount = $_GET["currency"];
$key = "TcH4cJZBzYUSFDh65skH";
/* This script is a starter - template for the Offerpal Callback URL. It will require updating to interact with your Databases
       For more details on the Callback URL go to: http://docs.offerpalmedia.com/integration/callback
       For additional Security information please go to: http://docs.offerpalmedia.com/integration/callback/offerpalSECURE
*/
$str = $_REQUEST["id"] . ":" . $_REQUEST["snuid"] . ":" . $_REQUEST["currency"] . ":" . $key;
if ($userid == null || $currencyCount == null) {
    __reportError();
}
if ($_REQUEST["verifier"] == md5($str)) {
    // Process, accept callback
    $doctrinemodel = \Utility\DoctrineConnect::GetInstance(__DIR__ . '/../cache')->Doctrinemodel;
    $user = $doctrinemodel->createQueryBuilder('Models\\User')->field('_id')->equals($userid)->getQuery()->getSingleResult();
    if ($user == null) {
        __reportError();
        return;
    }
    $user->AddToken($currencyCount);
    $doctrinemodel->flush();
    __reportOK();
} else {
    // Not match, reject.
    __reportError();
}
function __reportError()
{
    header('HTTP/1.0 403 Forbidden');
<?php

error_reporting(E_ALL);
require_once 'gtcclibrary/odmconfig.php';
require_once 'gtcclibrary/dbconfig.php';
use Utility\DoctrineConnect;
use Utility\CommonUtility;
require_once 'gtcclibrary/odmconfig.php';
include_once 'gtcclibrary/Crypt/BingoCrypt.php';
include 'gtcclibrary/InitData.ini.php';
use Doctrine\Common\ClassLoader, Doctrine\Common\Annotations\AnnotationReader, Doctrine\Common\Annotations\IndexedReader, Doctrine\ODM\MongoDB\DocumentManager, Doctrine\MongoDB\Connection, Doctrine\ODM\MongoDB\Configuration, Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;
$docConnector = DoctrineConnect::GetInstance(__DIR__ . '/../cache');
$sfcity = $docConnector->Doctrinemodel->getRepository('Models\\GameRoom')->findOneBy(array('cityId' => 1));
echo 'Loading city: ' . $sfcity->getName() . PHP_EOL;
$bc = new BingoCrypt();
// add another 3 users for test city level...
for ($i = 1; $i < 11; $i++) {
    echo 'Setup power test user: '******'player' . $i . PHP_EOL;
    $newUser = new Models\User('player' . $i, base64_encode($bc->encrypt('player' . $i)));
    $newUser->plusXp(10000);
    $newUser->plusCoin(10000);
    $newUser->plusToken(10000);
    $newUser->plusKeys(10000);
    $docConnector->Doctrinemodel->persist($newUser);
}
$docConnector->Doctrinemodel->flush();
// Add Powerup
$users = $docConnector->Doctrinemodel->createQueryBuilder('Models\\User')->getQuery()->execute()->toArray();
foreach ($users as $user) {
    $docConnector->Doctrinemodel->refresh($user);
    addPowerUpToUser($docConnector->Doctrinemodel, $PowerupTypes, $user, 100);
 public function __construct()
 {
     $this->doctrinemodel = \Utility\DoctrineConnect::GetInstance(__DIR__ . '/../../cache')->Doctrinemodel;
     $this->Logger = new \Utility\KLogger('D:\\wamp\\logs\\gtcclibrary\\amfservice.log', \Utility\GlobalConfiguration::GetInstance()->Config[\Constant\SectionType::Logging][\Constant\ConfigKey::LoggingLevel]);
 }