
5 - Networking behaviors - GameSalad Customer Service
https://help.gamesalad.com/gamesalad-cookbook/7-using-pro-features/7-05-networking-behaviors-2/PRO users now have access to networking behaviors which opens up new options for game and app creation! You can now add asynchronous multiplayer to games! This allows for turn-based gameplay between two or more participants. Gaming is just the start. These behaviors also allow you to create client/server apps, store […]
Comments
Hi there! What you need to do is replace the following text with your server's directory and ensure that both the directory and file are set to permission 777.
<?php
error_reporting(E_ALL);
if (!empty($_POST))
{
$paramsFile = '/your_directory_path/params.txt';
$sigFile = '/your_directory_path/sig.txt';
$sig = $_POST["sig"]; // this is the SHA1 checksum
$params = $_POST["params"]; // This is the Json data you can work with
$result = file_put_contents($paramsFile, $params);
$result = file_put_contents($sigFile, $sig);
echo '{"Status":"Success"}';
// if there is a failure, return '{"Status":"Fail"}'
}
else
{
$paramsFile = '/your_directory_path/params.txt';
$result = file_get_contents($paramsFile);
if ($result === FALSE)
{
echo '';
}
else
{
echo $result;
}
}
?>
GameSalad Templates and Custom Development at the Official Marketplace: http://gshelper.com
Thank you so much, also important to note to place the PHP script file inside the same folder that you're writing the params and sig file.