Axiomaltd's Forum Posts

  • Guys, does anyone can help me to setup personal scirra multiplayer server? need step-by-step guide. Where to stro it? amazon or google cloud, or my own PC. what is needed to be setup, to have an adress (like standart c2 ws://scirramultiplayer.com ) what i need to do?Please, HELP!

  • Guys, does anybody know how can i do it?

  • up

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley?

  • Up

  • Hello guys! Does anybody knows how we can send and recieve files in project? as a target- how to send and recieve pictures from one device to another one?

  • have you any solutions for this trouble?

  • so, what do i must to do, for host, to make him connect to signalling server?

  • here is what load.php returns in ajax.last data

    {"c2dictionary":true,"data":{"vin":"123123123","year":"2015","mod":"A-classe","phone":"123","fio":"olejjon123","mark":"mercedes","count":1}}

    here, is the code to retrive this data

    $r1 = mysql_query("SELECT data FROM `data` WHERE `login`='".$login."' AND `pass`='".$pass."'");

    $result = mysql_fetch_array($r1);

    $r1=$result['data'];

    echo $r1;

    and dictionary must load json.ajax.lastdata. but he didn't do it. all keys are 0 =(((

    here is the code, that sending to DB dictionary.asjsonstring from c2 project:

    $q1 = mysql_query("SELECT login FROM `data` WHERE `login`='".$login."'");

    $loginb = mysql_fetch_array($q1);

    $loginbd=$loginb['login'];

    if($loginbd == $login){

    echo("sorry,it's already here.");

    exit();

    }

    else

    $result2 = mysql_query ("INSERT INTO data (login,pass,data) VALUES('$login','$pass','$data')");

    //$data is the dictionary.jsonstring which is sent by ajax.

    if ($result2=='TRUE')

    {

    echo "success";

    }

    else {

    echo "error";

    }

  • exactly nothing work as should be. ajax post dictionary.asjson, in database dict.json looks like {quot;quot and some values and so on}. in my code i didn't understand where and what i must to place or write. no injection protection is correnctly needed. just, help with the code, to make it work.

  • but here one little thing===>>>

    code for posting to php:

    <?php

    //?????????? ? ?????????? ?????? ??? ??????? ? ??

    $mysql_host = "localhost";

    $mysql_database = "123123123";

    $mysql_user = "123123123";

    $mysql_password = "123123123";

    $link = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die("???????? ?????...");

    mysql_select_db($mysql_database, $link) or die ("??...");//???????????? ? ????

    Header('Access-Control-Allow-Origin: *');

    Header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");

    Header("Content-Type: text/html; charset=UTF-8");

    if (isset($_POST['login'])) { $login = $_POST['login']; if ($login == '') { unset($login);} }

    if (isset($_POST['pass'])) { $pass=$_POST['pass']; if ($pass =='') { unset($pass);} }

    if (isset($_POST['data'])) { $data=$_POST['data']; if ($data =='') { unset($data);} }

    if (empty($login) or empty($pass) or empty($data))

    {

    echo ("?? ????? ?? ??? ??????????, ????????? ??? ????!");

    exit();

    }

    $login = stripslashes($login);

    $login = htmlspecialchars($login);

    $pass = stripslashes($pass);

    $pass = htmlspecialchars($pass);

    $data = stripslashes($data);

    $data = htmlspecialchars($data);

    $login = trim($login);

    $pass = trim($pass);

    $data = trim($data);

    $q1 = mysql_query("SELECT login FROM `data` WHERE `login`='".$login."'");

    $loginb = mysql_fetch_array($q1);

    $loginbd=$loginb['login'];

    if($loginbd == $login){

    echo("????????, ????????? ???? ????? ??? ???????????????.");

    exit();

    }

    else

    $result2 = mysql_query ("INSERT INTO data (login,pass,data) VALUES('$login','$pass','$data')");

    if ($result2=='TRUE')

    {

    echo "?? ??????? ????????????????!";

    }

    else {

    echo "??????! ?? ?? ????????????????.";

    }

    ?>

    and the code to retrive data to c2dictionary:

    <?php

    //?????????? ? ?????????? ?????? ??? ??????? ? ??

    $mysql_host = "localhost";

    $mysql_database = "123123123";

    $mysql_user = "123123123";

    $mysql_password = "123123123";

    $link = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die("???????? ?????...");

    mysql_select_db($mysql_database, $link) or die ("??...");//???????????? ? ????

    Header('Access-Control-Allow-Origin: *');

    Header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");

    Header("Content-Type: text/html; charset=UTF-8");

    //????????? ??????? ???????????? ??????

    if (isset($_POST['loglog'])) { $login = $_POST['loglog']; if ($login == '') { unset($login);} }

    if (isset($_POST['passwordlog'])) { $pass=$_POST['passwordlog']; if ($pass =='') { unset($pass);} }

    if (empty($login) or empty($pass))

    {

    echo ("?? ????? ?? ??? ??????????, ????????? ??? ????!");

    exit();

    }

    $login = stripslashes($login);

    $login = htmlspecialchars($login);

    $pass = stripslashes($pass);

    $pass = htmlspecialchars($pass);

    $data = stripslashes($data);

    $data = htmlspecialchars($data);

    $login = trim($login);

    $pass = trim($pass);

    $data = trim($data);

    //????????? ??????? ?????????? ????????

    if(isset($login) && isset($pass)){

    //?????? ? ?? ?? ????????? ?????? ??????

    $q1 = mysql_query("SELECT login FROM `data` WHERE `login`='".$login."' AND `pass`='".$pass."'");

    $loginb = mysql_fetch_array($q1);

    $loginbd=$loginb['login'];

    $q2 = mysql_query("SELECT pass FROM `data` WHERE `login`='".$login."' AND `pass`='".$pass."'");

    $passwordb = mysql_fetch_array($q2);

    $passwordbd=$passwordb['pass'];

    if($passwordbd == $pass){

    $r1 = mysql_query("SELECT data FROM `data` WHERE `login`='".$login."' AND `pass`='".$pass."'");

    $row = mysql_fetch_array($r1); // ?? ? ??????

    $arr = array('c2dictionary' => 'true',

    'data' => array('vin' => $row['vin'], 'year' => $row['year'],'mod' => $row['mod'],'phone' => $row['phone'],'fio' => $row['fio'],'mark' => $row['mark'])); // ?????? ???????? ?????? ???????

    echo json_encode($arr);

    }

    //???? ?? ?????? ?????? ?? ??????? 1qqqq

    else{

    echo '? ???? ??? ?? ??????? ?????????';

    }

    }

    ?>

    and here is the question - where i'm mistayken? no data recieve at all =((((

  • thanx man ) really helps!

  • i'm already seen them. but the problem is - how separate data, that c2 recieves via ajax, how to correctly put it to the array, and how LIST can create seperate item for each data in array?

  • UP

  • o-no, you don't understand me. i can create room (usig my android smart), and peer can see them via cellular or wifi connection. but, when peer join room - nothing happens =( messages didn't recieving by anybody. looks like both of them (peer and host) lost their connection. but, when i go back, i can see the same room agan. that's weird. and for this moment multiplayer is working onli on local network. Please, help me!!!