Compare commits
No commits in common. "cd9ca9500f1b16a6e7e9ce0dd0021b3604c4db0e" and "95a12398e1c35def83cb2438e55ba00814a9f0b2" have entirely different histories.
cd9ca9500f
...
95a12398e1
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,5 +0,0 @@
|
|||
engine
|
||||
scratch
|
||||
maps/binary_kitchen
|
||||
maps/rc3-Continent
|
||||
maps/world-map-starterkit
|
|
@ -157,7 +157,7 @@
|
|||
{
|
||||
"name":"exitUrl",
|
||||
"type":"string",
|
||||
"value":"cellar\/01\/01.php#start"
|
||||
"value":"cellar\/01\/01.json#start"
|
||||
}],
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
|
|
|
@ -4,5 +4,7 @@
|
|||
RewriteEngine On
|
||||
|
||||
# replace name.number.php --> name.php
|
||||
RewriteRule ^(.+)\.\d+\.php$ $1.php
|
||||
#RewriteRule ^(.+)\.\d+\.php$ $1.php
|
||||
|
||||
# replace name.number.php --> uncache.php?taget=name
|
||||
RewriteRule ^(.+)\.\d+\.php$ uncache.php?target=$1
|
|
@ -229,7 +229,7 @@
|
|||
{
|
||||
"name":"playAudio",
|
||||
"type":"string",
|
||||
"value":"switch.php"
|
||||
"value":"switch.mp3"
|
||||
}],
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
|
|
|
@ -28,11 +28,7 @@ file_put_contents("$sub"."/01_closed.json", $data);
|
|||
$data = file_get_contents("01.json");
|
||||
$data = str_replace("01.php#", "$sub"."/"."01.php#", $data);
|
||||
|
||||
// Patch php filenames with timestamps to defeat cache
|
||||
// destination.php --> destination.number.php
|
||||
$tstamp = round(microtime(true)*100); # 0.01 sec resolution
|
||||
$data = str_replace(".php", ".".$tstamp.".php", $data);
|
||||
|
||||
header("Expires: 0");
|
||||
header('Content-type: application/json');
|
||||
echo($data);
|
||||
exit;
|
||||
|
|
|
@ -229,7 +229,7 @@
|
|||
{
|
||||
"name":"playAudio",
|
||||
"type":"string",
|
||||
"value":"switch.php"
|
||||
"value":"switch.mp3"
|
||||
}],
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
|
|
|
@ -7,11 +7,7 @@ $switch = $state["switch"];
|
|||
# Load open/closed level depending on switch
|
||||
$data = file_get_contents( $switch ? "01.json" : "01_closed.json");
|
||||
|
||||
// Patch php filenames with timestamps to defeat cache
|
||||
// destination.php --> destination.number.php
|
||||
$tstamp = round(microtime(true)*100); # 0.01 sec resolution
|
||||
$data = str_replace(".php", ".".$tstamp.".php", $data);
|
||||
|
||||
header("Expires: 0");
|
||||
header('Content-type: application/json');
|
||||
echo($data);
|
||||
exit;
|
||||
|
|
|
@ -2,10 +2,5 @@
|
|||
$state = json_decode(file_get_contents("state.json"), true);
|
||||
$state["switch"] = 1;
|
||||
file_put_contents("state.json", json_encode($state));
|
||||
|
||||
# Load current level and patch exits to target the copy
|
||||
$data = file_get_contents("switch.mp3");
|
||||
header('Content-type: audio/mpeg');
|
||||
echo($data);
|
||||
exit;
|
||||
?>
|
8
maps/ir/cellar/01/testcookie.php
Normal file
8
maps/ir/cellar/01/testcookie.php
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
if (isset($_COOKIE["TestCookie"]))
|
||||
echo "TestCookie=".$_COOKIE["TestCookie"];
|
||||
|
||||
$cookieval = "cookie_".time();
|
||||
setcookie("TestCookie", $cookieval, time()+3600*24);
|
||||
exit;
|
||||
?>
|
39
maps/ir/cellar/01/uncache.php
Normal file
39
maps/ir/cellar/01/uncache.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
// Workadventure cache destroyer
|
||||
|
||||
// URL rewrite rule calls us with the original filename in URL paramter "target"
|
||||
if (!isset($_GET['target'])) {
|
||||
echo("No target");
|
||||
exit;
|
||||
}
|
||||
$target = $_GET["target"];
|
||||
|
||||
if (file_exists($target.".php"))
|
||||
{
|
||||
// If a PHP file target.php exists:
|
||||
// Run that file and capture its output
|
||||
ob_start();
|
||||
include $target.".php";
|
||||
ob_end_flush();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If no PHP file target.php exists:
|
||||
// Load contents from target.json
|
||||
if (!file_exists($target.".json"))
|
||||
{
|
||||
echo($target.".json"." not found.");
|
||||
exit;
|
||||
}
|
||||
$data = str_replace(".php#", ".".$tstamp.".php#", $data); // Patch php-exits to prevent caching
|
||||
}
|
||||
|
||||
// Replace map exit names with timestamps:
|
||||
// destination.php#start --> destination.number.php#start
|
||||
$tstamp = round(microtime(true)*100); # 0.01 sec resolution
|
||||
$data = str_replace(".php#", ".".$tstamp.".php#", $data); // Patch php-exits to prevent caching
|
||||
header("Expires: 0");
|
||||
header('Content-type: application/json');
|
||||
echo($data);
|
||||
exit;
|
||||
?>
|
|
@ -4,5 +4,7 @@
|
|||
RewriteEngine On
|
||||
|
||||
# replace name.number.php --> name.php
|
||||
RewriteRule ^(.+)\.\d+\.php$ $1.php
|
||||
#RewriteRule ^(.+)\.\d+\.php$ $1.php
|
||||
|
||||
# replace name.number.php --> uncache.php?taget=name
|
||||
RewriteRule ^(.+)\.\d+\.php$ uncache.php?target=$1
|
|
@ -8,6 +8,7 @@ exec("python genmaze.py ".$name);
|
|||
$data = file_get_contents($name);
|
||||
$data = str_replace(".php#", ".".$tstamp.".php#", $data); // Patch php-exits to prevent caching
|
||||
|
||||
header("Expires: 0");
|
||||
header('Content-type: application/json');
|
||||
echo($data);
|
||||
exit;
|
||||
|
|
|
@ -3,6 +3,7 @@ $tstamp = round(microtime(true)*100); // 0.01 sec resolution
|
|||
$data = file_get_contents('left.json');
|
||||
$data = str_replace(".php#", ".".$tstamp.".php#", $data); // Patch php-exits to prevent caching
|
||||
|
||||
header("Expires: 0");
|
||||
header('Content-type: application/json');
|
||||
echo($data);
|
||||
exit;
|
|
@ -2,6 +2,7 @@
|
|||
$data = file_get_contents('right.json');
|
||||
$tstamp = round(microtime(true)*100); # 0.01 sec resolution
|
||||
$data = str_replace(".php#", ".".$tstamp.".php#", $data); // Patch php-exits to prevent caching
|
||||
header("Expires: 0");
|
||||
header('Content-type: application/json');
|
||||
echo($data);
|
||||
exit;
|
|
@ -2,36 +2,36 @@
|
|||
// Workadventure cache destroyer
|
||||
|
||||
// URL rewrite rule calls us with the original filename in URL paramter "target"
|
||||
if (!isset($_GET['target'])) {
|
||||
if (!isset($_GET['target'])) {
|
||||
echo("No target");
|
||||
exit;
|
||||
}
|
||||
$target = $_GET["target"];
|
||||
|
||||
if (file_exists($target.".php")) {
|
||||
if (file_exists($target.".php"))
|
||||
{
|
||||
// If a PHP file target.php exists:
|
||||
// Run that file and capture its output
|
||||
ob_start();
|
||||
include $target.".php";
|
||||
ob_end_flush();
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
// If no PHP file target.php exists:
|
||||
// Load contents from target.json
|
||||
if (file_exists($target.".json"))
|
||||
$data = file_get_contents($target.".json");
|
||||
else {
|
||||
if (!file_exists($target.".json"))
|
||||
{
|
||||
echo($target.".json"." not found.");
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Replace map exit names with timestamps:
|
||||
// destination.php#start --> destination.number.php#start
|
||||
$tstamp = round(microtime(true)*100); # 0.01 sec resolution
|
||||
$data = str_replace(".php#", ".".$tstamp.".php#", $data); // Patch php-exits to prevent caching
|
||||
|
||||
header("Expires: 0");
|
||||
header('Content-type: application/json');
|
||||
echo($data);
|
||||
exit;
|
||||
|
|
|
@ -3,12 +3,13 @@
|
|||
"height": 4300,
|
||||
"width": 2
|
||||
},
|
||||
"activeFile": "garden.json",
|
||||
"activeFile": "cellar/01/01.json",
|
||||
"expandedProjectPaths": [
|
||||
"randmaze",
|
||||
"cellar/01",
|
||||
"tiles",
|
||||
".",
|
||||
"cellar/01"
|
||||
"cellar",
|
||||
"randmaze"
|
||||
],
|
||||
"file.lastUsedOpenFilter": "Alle Dateien (*)",
|
||||
"fileStates": {
|
||||
|
@ -86,10 +87,10 @@
|
|||
},
|
||||
"cellar.json": {
|
||||
"scale": 1.5,
|
||||
"selectedLayer": 9,
|
||||
"selectedLayer": 3,
|
||||
"viewCenter": {
|
||||
"x": 3826.333333333333,
|
||||
"y": 127.66666666666669
|
||||
"x": 3478.333333333333,
|
||||
"y": 176.3333333333333
|
||||
}
|
||||
},
|
||||
"cellar.json#cija": {
|
||||
|
@ -100,7 +101,7 @@
|
|||
},
|
||||
"cellar/01/01.json": {
|
||||
"scale": 1,
|
||||
"selectedLayer": 10,
|
||||
"selectedLayer": 0,
|
||||
"viewCenter": {
|
||||
"x": 553.5,
|
||||
"y": 550.5
|
||||
|
@ -111,9 +112,9 @@
|
|||
},
|
||||
"cellar/01/01_closed.json": {
|
||||
"scale": 0.8465435606060606,
|
||||
"selectedLayer": 12,
|
||||
"selectedLayer": 0,
|
||||
"viewCenter": {
|
||||
"x": 527.4388947927736,
|
||||
"x": 528.6201689132502,
|
||||
"y": 401.0425639017842
|
||||
}
|
||||
},
|
||||
|
@ -144,10 +145,10 @@
|
|||
},
|
||||
"garden.json": {
|
||||
"scale": 0.5,
|
||||
"selectedLayer": 18,
|
||||
"selectedLayer": 10,
|
||||
"viewCenter": {
|
||||
"x": 453,
|
||||
"y": 1021
|
||||
"x": 497,
|
||||
"y": 1023
|
||||
}
|
||||
},
|
||||
"garden.json#cija": {
|
||||
|
@ -190,7 +191,7 @@
|
|||
"selectedLayer": 6,
|
||||
"viewCenter": {
|
||||
"x": 511.0390289839908,
|
||||
"y": 527.61326776185
|
||||
"y": 527.0607931359214
|
||||
}
|
||||
},
|
||||
"gmaze/gmaze.json#cija": {
|
||||
|
@ -245,8 +246,8 @@
|
|||
"scale": 1.5,
|
||||
"selectedLayer": 6,
|
||||
"viewCenter": {
|
||||
"x": 207.66666666666666,
|
||||
"y": 208.3333333333333
|
||||
"x": 207.66666666666663,
|
||||
"y": 208
|
||||
}
|
||||
},
|
||||
"gmaze/right.json#cija": {
|
||||
|
@ -432,11 +433,11 @@
|
|||
"scaleInDock": 1
|
||||
},
|
||||
"lobby.json": {
|
||||
"scale": 0.33,
|
||||
"selectedLayer": 10,
|
||||
"scale": 0.75,
|
||||
"selectedLayer": 9,
|
||||
"viewCenter": {
|
||||
"x": 1022.7272727272727,
|
||||
"y": 512.121212121212
|
||||
"x": 911.3333333333334,
|
||||
"y": 434
|
||||
}
|
||||
},
|
||||
"lobby.json#mapUtilities": {
|
||||
|
@ -781,7 +782,7 @@
|
|||
"selectedLayer": 8,
|
||||
"viewCenter": {
|
||||
"x": 287.5,
|
||||
"y": 288
|
||||
"y": 287.5
|
||||
}
|
||||
},
|
||||
"warp.json#ir_logo_set": {
|
||||
|
@ -863,24 +864,23 @@
|
|||
"warp.json",
|
||||
"cellar/01/01.json",
|
||||
"tiles/mapUtilities.json",
|
||||
"cellar/01/01_closed.json",
|
||||
"tiles/cija.json"
|
||||
"cellar/01/01_closed.json"
|
||||
],
|
||||
"project": "ir.tiled-project",
|
||||
"property.type": "string",
|
||||
"recentFiles": [
|
||||
"cellar.json",
|
||||
"lobby.json",
|
||||
"tiles/cija.json",
|
||||
"garden.json",
|
||||
"warp.json",
|
||||
"cellar/01/01_closed.json",
|
||||
"tiles/mapUtilities.json",
|
||||
"cellar/01/01.json",
|
||||
"warp.json",
|
||||
"garden.json",
|
||||
"cellar/01/02_open.json",
|
||||
"cellar/01/02_closed.json",
|
||||
"gmaze/gmaze.json",
|
||||
"tiles/warntape.json"
|
||||
"tiles/warntape.json",
|
||||
"gmaze/gmaze__template.json"
|
||||
],
|
||||
"tileset.lastUsedFormat": "json"
|
||||
}
|
||||
|
|
21
rc3_notes.md
21
rc3_notes.md
|
@ -162,13 +162,20 @@
|
|||
* Workaround: Dynamische einamalige Dateinamen für Maps
|
||||
* Nachteil: Jeder Spieler bekommt eine andere Map, kein Multiplayer mehr
|
||||
* Funktioniert nur für Maps, nicht für Audio-Events
|
||||
* Implementierung:
|
||||
* Implementierung A:
|
||||
(1) Wenn eine Karte map.php aufgerufen wird:
|
||||
* Lade map.json
|
||||
* Ersetze alle Exit-URLs der Form dest.php#start --> dest.timestamp.php#start
|
||||
(dest.json wird so gelassen, damit man wieder in Multiplayer-Maps zurück kann).
|
||||
(2) URL-Rewrite rule via .htaccess: Entferne timestamp
|
||||
RewriteRule ^(.+)\.\d+\.php$ $1.php
|
||||
* Implementierung B (timestamp-patching ausgelagert in eigenes file):
|
||||
(1) URL-Rewrite: Entferne timestamp und übergebe Mapnamen an uncache.php via URL-Parameter
|
||||
RewriteRule ^(.+)\.\d+\.php$ uncache.php?target=$1
|
||||
(2) In uncache.php:
|
||||
* Wenn es target.php gibt, dann rufe diese auf und fange ihren output ab.
|
||||
* sonst lade target.json
|
||||
* Patch Exit-URLS mit timestamp.
|
||||
|
||||
|
||||
* Cache deaktivieren Engineseitig:
|
||||
|
@ -221,16 +228,4 @@
|
|||
Für lokale Tests: Domains in /etc/hosts bzw. C:/windows/system32/drivers/etc/hosts eintragen
|
||||
|
||||
|
||||
https://xn--han-7ka.de/s/b3SKomnirgisMc9
|
||||
https://play.workadventu.re/_/global/devlol-systems.pages.devlol.org/vspace-workadv/vspace.json
|
||||
Du kannst dich gern mit mir vernetzen alexander@m4h.network bzw. alexander.stellmach@ose-germany.de
|
||||
https://nemo.jstsmthrgk.eu/files/rc3graph.svg
|
||||
https://play.workadventu.re/_/global/simondueckert.github.io/nuedigital/map.json
|
||||
https://miro.com/app/board/o9J_laWLPI8=/
|
||||
https://gitlab.com/fediventure/workadventure/-/tree/feature/federation/
|
||||
https://gitlab.com/fediventure/fediventure/-/issues/2
|
||||
https://git.devlol.org/devlol-systems/vspace-workadv/-/blob/master/.gitlab-ci.yml
|
||||
https://obs.ninja/?view=8iiMHZa
|
||||
https://github.com/tehwalris/vertiled
|
||||
https://miro.com/app/board/o9J_laWLPI8=/
|
||||
|
Loading…
Reference in New Issue
Block a user