corrade-http-templates

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 76  →  ?path2? @ 77
/renderAvatarsMap/README.txt
@@ -9,18 +9,24 @@
* A WebGL enabled browser: Chome, Opera, Firefox, Safari...
* A webserver.
* PHP version 5 and beyond.
* the gd extension (libgd).
* the curl extension.
* the PHP gd extension (libgd).
* the PHP curl extension.
* PHP composer.
 
-:[ Setup ]:-
 
1.) Rename "config.php.dist" to "config.php" and edit "config.php"
to reflect your settings in Corrade.ini
2.) Enable the Corrade permissions for your configured group:
1.) Run the following command inside the directory:
 
composer require was/utilities:dev-trunk
 
in order to install all the requirements.
2.) Rename "config.php.dist" to "config.php" and edit "config.php"
to reflect your Corrade settings.
3.) Enable the Corrade permissions for your configured group:
* land
* interact
3.) Place the all the files in a directory on your webserver.
4.) Navigate to renderMapAvatars.html and enjoy.
4.) Place the all the files in a directory on your webserver.
5.) Navigate to renderMapAvatars.html and enjoy.
 
-:[ References ]:-
 
/renderAvatarsMap/composer.json
@@ -0,0 +1,9 @@
{
"repositories": [{
"type": "composer",
"url": "https://satis.grimore.org"
}],
"require": {
"was/utilities": "dev-trunk"
}
}
/renderAvatarsMap/composer.lock
@@ -0,0 +1,42 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "88cc596af12877df24911e220bc2ae74",
"packages": [
{
"name": "was/utilities",
"version": "dev-trunk",
"source": {
"type": "svn",
"url": "https://svn.grimore.org/was.php",
"reference": "/trunk/@11"
},
"type": "library",
"license": [
"GNU GPLv3"
],
"authors": [
{
"name": "Wizardry and Steamworks",
"email": "office@grimore.org"
}
],
"description": "Wizardry and Steamworks Utilities and Tools",
"time": "2022-03-11T21:35:58+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"was/utilities": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.0.0"
}
/renderAvatarsMap/config.php.dist
@@ -6,5 +6,3 @@
$PASSWORD = 'mypassword';
# Set this to Corrade's HTTP Server URL.
$URL = 'http://corrade.internal.server:8080';
 
?>
/renderAvatarsMap/functions.php
@@ -1,75 +1,8 @@
<?php
 
###########################################################################
## Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 ##
###########################################################################
function wasKeyValueGet($key, $data) {
return array_reduce(
explode(
"&",
$data
),
function($o, $p) {
$x = explode("=", $p);
return array_shift($x) != $o ? $o : array_shift($x);
},
$key
);
}
 
///////////////////////////////////////////////////////////////////////////
// Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 //
///////////////////////////////////////////////////////////////////////////
function wasCSVToArray($csv) {
$l = array();
$s = array();
$m = "";
for ($i = 0; $i < strlen($csv); ++$i) {
switch ($csv[$i]) {
case ',':
if (sizeof($s) == 0 || !current($s) == '"') {
array_push($l, $m);
$m = "";
break;
}
$m .= $csv[$i];
continue;
case '"':
if ($i + 1 < strlen($csv) && $csv[$i] == $csv[$i + 1]) {
$m .= $csv[$i];
++$i;
break;
}
if (sizeof($s) == 0|| !current($s) == $csv[$i]) {
array_push($s, $csv[$i]);
continue;
}
array_pop($s);
break;
default:
$m .= $csv[$i];
break;
}
}
array_push($l, $m);
return $l;
}
 
///////////////////////////////////////////////////////////////////////////
// Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 //
///////////////////////////////////////////////////////////////////////////
function wasArrayStride($a, $s) {
return array_filter($a,
function($e, $i) use($s) {
return $i % $s == 0;
},
ARRAY_FILTER_USE_BOTH
);
}
 
///////////////////////////////////////////////////////////////////////////
// Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 //
///////////////////////////////////////////////////////////////////////////
function wasColorHash($a) {
$hash = sha1($a);
$size = strlen($hash);
@@ -79,25 +12,6 @@
substr($hash, $size-2, 2);
}
 
###########################################################################
## Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 ##
###########################################################################
function mapValueToRange($value, $xMin, $xMax, $yMin, $yMax) {
return $yMin + (
(
$yMax - $yMin
)
*
(
$value - $xMin
)
/
(
$xMax - $xMin
)
);
}
 
function hex2RGB($hexStr, $returnAsString = false, $seperator = ',') {
$hexStr = preg_replace("/[^0-9A-Fa-f]/", '', $hexStr);
$rgbArray = array();
/renderAvatarsMap/generateTerrainHeightMap.php
@@ -14,8 +14,9 @@
###########################################################################
 
# The configuration file for this script containing the settings.
require_once("config.php");
require_once('functions.php');
require_once('config.php');
require_once('vendor/was/utilities/src/formats/kvp/kvp.php');
require_once('vendor/was/utilities/src/mathematics/algebra.php');
 
###########################################################################
## INTERNALS ##
/renderAvatarsMap/getAvatars.php
@@ -20,8 +20,12 @@
###########################################################################
 
# The configuration file for this script containing the settings.
require_once("config.php");
require_once("functions.php");
require_once('config.php');
require_once('vendor/was/utilities/src/formats/kvp/kvp.php');
require_once('vendor/was/utilities/src/formats/csv/csv.php');
require_once('vendor/was/utilities/src/collections/arrays/arrays.php');
require_once('vendor/was/utilities/src/mathematics/algebra.php');
require_once('functions.php');
 
###########################################################################
## INTERNALS ##
/renderAvatarsMap/getMapHeight.php
@@ -13,7 +13,7 @@
 
# The configuration file for this script containing the settings.
require_once('config.php');
require_once('functions.php');
require_once('vendor/was/utilities/src/formats/kvp/kvp.php');
 
###########################################################################
## INTERNALS ##
/renderAvatarsMap/getMapTexture.php
@@ -14,7 +14,8 @@
 
# The configuration file for this script containing the settings.
require_once('config.php');
require_once('functions.php');
require_once('vendor/was/utilities/src/formats/kvp/kvp.php');
require_once('vendor/was/utilities/src/formats/csv/csv.php');
 
###########################################################################
## INTERNALS ##