Camera Fix - PlusEmulator

Results 1 to 7 of 7
  1. #1
    Member ZoekGamer is offline
    MemberRank
    Dec 2015 Join Date
    En tu mirada.Location
    66Posts

    Camera Fix - PlusEmulator

    Hello I did not want to do this topic but nobody tells me how to do it
    The problem is


    I use the swf posted in the topic and I keep getting this error
    any solution?

    PD: Already if someone has it and it works I would spend the source ?
    any solution?


  2. #2
    Member Tyson is offline
    MemberRank
    Jul 2016 Join Date
    68Posts

    Re: Camera Fix - PlusEmulator

    No one is helping anymore these days, they keep their shit for themselves. Egoistic bastards.


    Sent from my iPhone using Tapatalk

  3. #3
    Enthusiast Seat Ibiza is offline
    MemberRank
    Jan 2016 Join Date
    25Posts

    Re: Camera Fix - PlusEmulator

    We need to find out whether its a webserver or emulator issue. In Chrome open the Web Developer Tools (F12) and take a screenshot of the "network" tab while you are taking a camera photo and waiting.

  4. #4
    Member ZoekGamer is offline
    MemberRank
    Dec 2015 Join Date
    En tu mirada.Location
    66Posts

    Re: Camera Fix - PlusEmulator

    Quote Originally Posted by Seat Ibiza View Post
    We need to find out whether its a webserver or emulator issue. In Chrome open the Web Developer Tools (F12) and take a screenshot of the "network" tab while you are taking a camera photo and waiting.
    look :








    stays in loading and not see the photo

  5. #5
    Enthusiast Seat Ibiza is offline
    MemberRank
    Jan 2016 Join Date
    25Posts

    Re: Camera Fix - PlusEmulator

    Okay, the image is being sent to the webserver.

    In the webserver files:
    - Sure you have set up the sql connection details correct?
    - Sure you inserted the required tables?
    - Be sure that the PHP-Code has access to "public/preview/" and "public/purchased" folder.


    If so, there's a condition in upload_photo.php which could make problems.

    "|| (CURRENT_TIMESTAMP - round($_GET['t'] / 1000) > TIMESTAMP_MAX_DELAY)" in line 43.Delete this part of the condition and save your file, try again.

  6. #6
    Member ZoekGamer is offline
    MemberRank
    Dec 2015 Join Date
    En tu mirada.Location
    66Posts

    Re: Camera Fix - PlusEmulator

    Quote Originally Posted by Seat Ibiza View Post
    Okay, the image is being sent to the webserver.

    In the webserver files:
    - Sure you have set up the sql connection details correct?
    - Sure you inserted the required tables?
    - Be sure that the PHP-Code has access to "public/preview/" and "public/purchased" folder.


    If so, there's a condition in upload_photo.php which could make problems.

    "|| (CURRENT_TIMESTAMP - round($_GET['t'] / 1000) > TIMESTAMP_MAX_DELAY)" in line 43.Delete this part of the condition and save your file, try again.
    -My connection yes.
    -Yes inserted sql tables and item id and swf.
    -Well done

    upload_photo code:
    PHP Code:
    <?php

    /**
     * Camera upload script
     * (use custom SWF)
     *
     * Requires PHP GD
     * @author Steve Winfield
    **/

    define  ('IN_APP'true);
    require (
    'global.php');

    header ('Content-Type: text/plain');

    define ('MAX_DATA_LEN',                       409000);
    define ('TIMESTAMP_MAX_DELAY',                5);
    define ('MAX_TIMESTAMP_SPAN_SINCE_LAST_PIC',  2);

    define ('PIC_DEF_WIDTH',  320);
    define ('PIC_DEF_HEIGHT'320);

    function 
    exitScript() {
        exit (
    '-1');
    }

    function 
    generateChecksum($seed) {
        return 
    bcmod(bcmod(bcmul(bcadd($seed109), 125), 2796203), 151);
    }

    function 
    sendRCONCommand($command$data) {
        
    $rconData $command chr(1) . implode(':'$data);
        
    $rcon socket_create(AF_INETSOCK_STREAMgetprotobyname('tcp'));

        
    socket_connect($rconSERVER_RCON_HOSTSERVER_RCON_PORT);
        
    socket_send($rcon$rconDatastrlen($rconData), MSG_DONTROUTE);
        
    socket_close($rcon);
    }

    $requestHeaders getallheaders();

    if (
    $_SERVER['REQUEST_METHOD'] != 'POST' || $_SERVER['CONTENT_TYPE'] != 'application/octet-stream; charset=UTF-8'
          
    || !isset($_GET['t'])
          || !isset(
    $_GET['userId'])
          || !
    initializePDO()) {
        
    exitScript();
    }

    $userId intval($_GET['userId']);

    $stm $PDO->prepare('SELECT username FROM users WHERE id = ' $userId ' AND online = \'1\' ' . (DEBUG_MODE '' 'AND ip_last = :IP'));
    $stm->bindParam(':IP'$_SERVER['REMOTE_ADDR']);
    $stm->execute();

    if (!(
    $userRow $stm->fetch(PDO::FETCH_ASSOC))) {
        
    exitScript();
    }

    $compressedInput file_get_contents('php://input'falsenull0MAX_DATA_LEN);

    if (empty(
    $compressedInput)) {
        
    exitScript();
    }

    $image = @zlib_decode($compressedInput);

    if (
    $image == null) {
        
    exitScript();
    }

    $clientChecksum ord(substr($image, -1));
    $serverChecksum generateChecksum($_GET['t']);

    if (
    $clientChecksum != $serverChecksum) {
        
    exitScript();
    }

    $image imagecreatefromstring(substr($image0strlen($image) - 1));

    if (
    $image === false || imagesx($image) != PIC_DEF_WIDTH || imagesy($image) != PIC_DEF_HEIGHT) {
        
    exitScript();
    }

    $stm $PDO->prepare('SELECT NULL FROM camera_photos WHERE creator_id = ' $userId ' AND (' CURRENT_TIMESTAMP ' - created_at) < ' MAX_TIMESTAMP_SPAN_SINCE_LAST_PIC);
    $stm->execute();

    if (
    $stm->fetch()) {
        
    exitScript();
    }

    $stm $PDO->prepare('INSERT INTO camera_photos (creator_id, creator_name, file_state, file_name, reports, deleted, ip_address, created_at) VALUES (' $userId ', :username, \'preview\', \'\', 0, \'0\', :IP, ' CURRENT_TIMESTAMP ')');
    $stm->bindParam(':username'$userRow['username']);
    $stm->bindParam(':IP'$_SERVER['REMOTE_ADDR']);
    $stm->execute();

    $stm $PDO->prepare('SELECT id FROM camera_photos WHERE creator_id = ' $userId ' ORDER BY id DESC LIMIT 1');
    $stm->execute();

    if (!(
    $photoId $stm->fetchColumn())) {
        
    exitScript();
    }

    $photoFileName $userId '-' $photoId;

    $stm $PDO->prepare('UPDATE camera_photos SET file_name = \'' $photoFileName '\' WHERE id = ' $photoId);
    $stm->execute();

    // Notify server
    sendRCONCommand('add_preview', array(
        
    $photoId,
        
    $userId,
        
    intval($_GET['t'])
    ));

    imagepng($imagePUBLIC_PREVIEW_PATH $photoFileName '.png');
    exit    (
    $photoId);
    and look :



    - - - Updated - - -

    and... my global.php

    PHP Code:
    <?php

    /**
     * @author Steve Winfield
    **/

    if (!defined('IN_APP')) {
        exit;
    }

    define ('CURRENT_TIMESTAMP'time());

    define ('PUBLIC_PATH''public/');
    define ('PUBLIC_PREVIEW_PATH'PUBLIC_PATH '/preview/');
    define ('PUBLIC_PURCHASED_PATH'PUBLIC_PATH '/purchased/');

    define ('MYSQL_HOST''188.164.192.83');
    define ('MYSQL_USER''root');
    define ('MYSQL_PASS''******(mypassword)');
    define ('MYSQL_DB',   'hplays');

    define ('SERVER_RCON_HOST''188.164.192.83');
    define ('SERVER_RCON_PORT'30002);

    define ('DEBUG_MODE'false);

    if (isset(
    $_SERVER['HTTP_CF_CONNECTING_IP'])) {
        
    $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
    }

    $PDO null;

    function 
    initializePDO() {
        global 
    $PDO;

        try {
            
    $PDO = [MENTION=841155]New[/MENTIONPDO('mysql:host=' MYSQL_HOST ';dbname=' MYSQL_DBMYSQL_USERMYSQL_PASS, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
            return 
    true;
        } catch (
    PDOException $ex) {
            return 
    false;
        }
    }

  7. #7
    Member ZoekGamer is offline
    MemberRank
    Dec 2015 Join Date
    En tu mirada.Location
    66Posts

    Re: Camera Fix - PlusEmulator

    Firefox RED :


    @Seat Ibiza Helpme please please.



Advertisement