Page MenuHomeCode

No OneTemporary

diff --git a/README b/README
--- a/README
+++ b/README
@@ -1,164 +1,164 @@
ZzzzzzZ zz
Z z z The spatial gallery / social network / lounge
z z (c) 2010, Dereckson, some rights reserved.
z zzzzz zzzzz
z z z z z 0.1 alpha technical preview
z zzzzzzz z z
z z z z Last update hypership time: 5.096
z Z z z z z
ZzzzzzZ zzzzz zzzzzz
=========
INSTALL
=========
* Zed is a PHP 5.3 application.
* You can import dev/schema-mysql.sql as original SQL schema
* The configuration file is includes/config.php
* Files are cached in 3 directories of the cache folder, sets appropriate
write permissions to:
compiled openid sessions
* Zed needs but doesn't include in its code the Janrain OpenID PHP libraries:
http://www.janrain.com/openid-enabled - http://github.com/openid/php-openid
Put the Auth folder somewhere in your include_dir path.
- bcmath and GDM php extensions are recommended (required?) for OpenID.
- Our dev environment outputs a white page without error if GDM isn't here.
+ bcmath and GMP php extensions are recommended (required?) for OpenID.
+ Our dev environment outputs a white page without error if GMP isn't here.
If you don't wish to enable OpenID, replace your includes/login.php by
- http://bitbucket.org/dereckson/zed/src/0ffd1b08f33c/includes/login.php
+ http://hg.dereckson.be/zed/src/0ffd1b08f33c/includes/login.php
* Another used PHP extension is the WDDX one, to store session information in
a human-readable format, easier to debug.
If you don't want that, comment the following line from includes/config.php:
ini_set('session.serialize_handler', 'wddx');
=========
UPGRADE
=========
* For our main prod install, we use a script exporting last repo revision with
hg archive and applying a patch to config.php.
===========
LOCATIONS
===========
* Global location is a 9 letters code
<B,S> <body or spaceship id> <place where you are in this body/spaceship>
zerofilled 5 digits zerofilled 3 digits
You can also find 6 digits expressions e.g. B00001 is the hypership
* Local location varies of the place.
- On hypership core (B00001002): Sector C<0-8> Level <z> Zone <x-y>
- 0 is the gravity center
- 1-8 the 8 cubes surrounding it: 1-4 below, 5-8 above
- On the ship tower (B00001001): Sector T<z> Couloir <1-6>
- z is the level
- couloir depends of your x, y position (polar coordinates could help)
=================
HYPERSHIP TIME?
=================
* The amount of days since hypership launch, July 3rd 2010 00:00 UTC
* So the decimal part is like internet time, but in GMT and not CET/CEST
===============
SIDE PROJECTS
===============
* A pazaak game, to have something to play
* Will be an Arzakon client
=================
I WANT TO HELP!
=================
* You can create new SmartLine commands
* You can translate it in a new language
Start point: http://zed.dereckson.be/lang/en/core.conf
* You can code a bit of adventure, places description, stuff to do
as long you don't transform it in ogame clone (we're building a community
who want or don't want to play, but not a mechanic game)
and as long no money is involved (if you ask why, read Iain M. Banks novels)
in the hypership (in far asteroids, orbitals, planets you do what you want)
============
KNOWN BUGS
============
* Javascript get_hypership_time will returns 5.94 instead 5.094
Some %03d to add in /js/misc.js
* The floater rendering adds a black line under Opera
dojox.layout.floatingPane bug, need to check with last dojo version
* API /location query will break indent on location->body->location
beautify XML code to improve
* do.php allows any local location move, discarding FrL status
* The upload artwork dojo form can't be closed under Opera
=======================
API - General methods
=======================
* /api.php/time
Returns hypership time
Public access
* /api.php/perso/<perso_id>
Returns perso object
Created only to test extensively recursivity of api xml output
It's disabled since 10.811 on zed.dereckson.be, if you need an alternative,
open a bug report with the fields you need. Ship API should be able to manage
inventory if user is on. Ship API must also be able to get/set custom flags.
Requires a key
* /api.php/location/<location code or name>
Returns location object
Tip: to get the full name, use string eg /api.php/location/Zeta?format=string
Requires a key
* GET/POST API parameters
- key
API key, ask it at zed at dereckson be, object [DEV] api key request
- format
- preview print_r representation, so you've an idea of the object
- json json_encode() output
- php serialize() output
- wddx WDDX were an early universal serialization attempt
- xml XML document
- string output "as is" (or if it's an object, calls __toString())
============
API - Ship
=============
* /api.php/ship/authenticate/<perso nickname>
=================
ACKNOWLEDGEMENT
=================
Elfix, to have let me figure a regexp correction, instead to throw away regexp
validation for places local location.
diff --git a/apps/hotglue/config.inc.php b/apps/hotglue/config.inc.php
--- a/apps/hotglue/config.inc.php
+++ b/apps/hotglue/config.inc.php
@@ -1,91 +1,111 @@
<?php
/**
* These are the default configuration settings of this hotglue
* installation. Do not edit this file directly but overwrite specific
* variables by setting them in the user-config.inc.php file, which
* will not be overwritten by future updates.
*/
error_reporting(E_ALL); // see php documentation
// try to include user configuration
@include('user-config.inc.php');
+/**
+ * Gets the server URL
+ * @todo find a way to detect https:// on non standard port
+ *
+ * @return string the server URL
+ */
+function get_server_url () {
+ switch ($port = $_SERVER['SERVER_PORT']) {
+ case '80':
+ return "http://$_SERVER[SERVER_NAME]";
+
+ case '443':
+ return "https://$_SERVER[SERVER_NAME]";
+
+ default:
+ return "http://$_SERVER[SERVER_NAME]:$_SERVER[SERVER_PORT]";
+ }
+}
+
+
// otherwise fall back to these defaults
@define('ALWAYS_PROMPT_CREATE_PAGE', false); // invoke the "create page" controller when trying to access a non-existing page even if the user is not logged in yet (otherwise they receive a 404)
@define('AUTH_METHOD', 'none'); // can be digest, basic or none
@define('AUTH_USER', 'admin');
@define('AUTH_PASSWORD', 'changeme');
-@define('BASE_URL', 'http://zed51.dereckson.be/apps/hotglue/');
+@define('BASE_URL', get_server_url() . '/apps/hotglue/');
@define('CACHE_TIME', 60*60); // cache time in seconds (zero to disable)
@define('CONTENT_DIR', 'content'); // content directory, must be writable
@define('DEFAULT_PAGE', 'start');
@define('FAVICON', 'img/favicon.ico'); // can be empty or an absolute url
@define('HOTGLUE_VERSION', '0.99.1'); // expected api.version.patchlevel
@define('IE8_COMPAT', true); // try to be compatible with internet explorer 8 in viewing mode
@define('JQUERY', 'js/jquery-1.4.4.min.js');// can be an absolute url
@define('LOCK_TIME', 5000); // maximum time in ms to wait for an object lock
@define('LOG_FILE', 'content/log.txt'); // log file, must be writable
@define('LOG_LEVEL', 'warn'); // minimum log level (can be error, warn, info, debug)
@define('SHORT_URLS', false); // use short urls
@define('SHOW_FRONTEND_ERRORS', true);
@define('SITE_NAME', 'hotglue 1.0');
@define('SNAPSHOT_MAX_AGE', 60*60*24*7); // auto- revisions are automatically deleted after n seconds (zero to disable)
@define('SNAPSHOT_MIN_AGE', 60*60); // auto- revisions are created every n seconds (zero to disable)
@define('USE_MIN_FILES', true); // use minified files if possible (see also JQUERY define)
// default modules
@define('IMAGE_JPEG_QUAL', 80); // quality for jpeg resizing (0 < 100)
@define('IMAGE_PNG_QUAL', 5); // quality for png resizing (9 < 0)
@define('IMAGE_RESIZING', true); // resize uploaded images on the server (needs gd installed)
@define('IMAGE_UPLOAD_RESIZE_LARGER', '120%'); // automatically resize uploaded image when larger than n% of window width or height (set to 0% to disable)
@define('IMAGE_UPLOAD_RESIZE_TO', '80%'); // target size in n% of window width or height
@define('OBJECT_DEFAULT_COLORS', '#61b9cf #ff00ff #ffff00'); // default colors for new objects (space-separated string)
@define('PAGE_DEFAULT_GRID_X', 50); // default grid x spacing in px
@define('PAGE_DEFAULT_GRID_Y', 50); // default grid y spacing in px
@define('PAGE_GUIDES_X', ''); // show a grid line after n horizontal px (space-separated string)
@define('PAGE_GUIDES_Y', ''); // show a grid line after n vertical px (space-separated string)
@define('PAGES_NEED_AUTH', true); // page browser needs authentication
@define('REVISIONS_NEED_AUTH', true); // revisions browser needs authentication
@define('TEXT_AUTO_BR', true); // automatically add <br> elements for newlines
@define('VIDEO_START_ON_CLICK', true); // start video on click when autoplay is off
/**
* use this function to get the site's base url
*
* @return string base url (not html-encoded)
*/
function base_url()
{
global $base_url_cached;
//dieprint_r("Hello, we're in base_url and the cached value is $base_url_cached");
$temp = BASE_URL;
if (!empty($temp)) {
return $temp;
} elseif (!isset($base_url_cached)) {
if (empty($_SERVER['HTTPS'])) {
$base_url_cached = 'http://'.$_SERVER['HTTP_HOST'];
if ($_SERVER['SERVER_PORT'] != '80') {
$base_url_cached .= $_SERVER['SERVER_PORT'];
}
} else {
$base_url_cached = 'https://'.$_SERVER['HTTP_HOST'];
if ($_SERVER['SERVER_PORT'] != '443') {
$base_url_cached .= $_SERVER['SERVER_PORT'];
}
}
$base_url_cached .= dirname($_SERVER['PHP_SELF']);
// make sure we have a trailing slash at the end
if (substr($base_url_cached, -1) != '/') {
$base_url_cached .= '/';
}
}
return $base_url_cached;
}
?>
diff --git a/content/scenes/B00001001.tpl b/content/scenes/B00001001.tpl
--- a/content/scenes/B00001001.tpl
+++ b/content/scenes/B00001001.tpl
@@ -1,177 +1,212 @@
<!--
Global location: B00001001
-->
<!-- Tower navigation and passage CSS -->
<style>
body {
overflow: hidden;
}
/* Tower map */
#tower {
background-image: url({$SCENE_URL}/{$CurrentPerso->location_global}/all.png);
background-position: left;
background-repeat: no-repeat;
height: 442px;
}
#tower_hl {
position: relative;
}
/* Passage */
#passage {
width: 960px;
height: 401px;
background-image: url({$SCENE_URL}/{$CurrentPerso->location_global}/couloir/bay/void.png);
background-position: top left;
background-repeat: no-repeat;
}
#passage_left {
position: relative;
background-image: url({$SCENE_URL}/{$CurrentPerso->location_global}/couloir/GoLeft.png);
width: 38px;
height: 38px;
}
#passage_right {
position: relative;
background-image: url({$SCENE_URL}/{$CurrentPerso->location_global}/couloir/GoRight.png);
width: 38px;
height: 38px;
}
#passage_gallery ul {
position: relative;
top: 145px;
left: 120px;
margin-top: inherit;
margin-bottom: inherit;
}
#passage_gallery li {
display: block;
float: left;
margin-right: 60px;
width: 170px;
height: 170px;
padding: 4px 4px;
background-image: url({$SCENE_URL}/{$CurrentPerso->location_global}/couloir/frame.png);
background-repeat: no-repeat;
background-position: top left;
}
#screen {
position: absolute;
left: 10%;
top: 10%;
width: 80%;
height: 80%;
}
#screen img {
position: absolute;
cursor: pointer;
visibility: hidden;
width: 0px;
height: 0px;
}
#screen .tvover {
border: solid #343434;
opacity: 1;
filter: alpha(opacity=100);
}
#screen .tvout {
border: solid #fff;
opacity: 0.7;
}
#bankImages {
display: none;
}
#uploadDialog label {
color: black;
}
+
+ /* Couloir info */
+ #couloir_info {
+ background-image: url({$SCENE_URL}/{$CurrentPerso->location_global}/couloir/info.png);
+ height: 42px;
+ padding-top: 20px;
+ color: black;
+ }
+
+ #couloir_info a {
+ color: white;
+ }
+
+ #couloir_info a:hover {
+ font-weight: 900;
+ }
+
+ #domain_name {
+ margin-left: 1em;
+ }
</style>
<!-- Javascript bits: dojo -->
<script>
dojo.require("dojo.parser");
dojo.require("dijit.Dialog");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.TextBox");
</script>
<!-- Tower -->
<!--<div id="tower"></div>-->
<!-- Navigation -->
{$loc = explode('C', $CurrentPerso->location_local)}{$loc[0] = substr($loc[0], 1)}
<div class="grid_7 alpha">
{#Sector#} T<span id="TowerFloor">{$loc[0]}</span>
</div>
<div class="grid_2" style="text-align: center">
{#Couloir#} <span id="TowerCouloir">{$loc[1]}</span>
</div>
<div class="grid_7 omega" style="text-align: right">
<a href="{if $loc[0] == 1}#{else}/do.php/set_local_location/T{$loc[0] - 1}C{$loc[1]}?redirectTo={get_url()}{/if}" onClick="passage.goUp(); return false;">{#GoUp#}</a> | <a href="/do.php/set_local_location/T{$loc[0] + 1}C{$loc[1]}?redirectTo={get_url()}" onClick="passage.goDown(); return false;">{#GoDown#}</a>
</div>
<!-- Passage -->
<div class="grid_16 alpha omega">
<div id="passage">
<div id="passage_gallery"></div>
<!-- Navigation -->
</div>
</div>
+ <div class="clear"></div>
+
+
+ <!-- Info -->
+ <div id="couloir_info">
+ <div class="grid_6 prefix_2 alpha">
+ <span id="domain_name">{#FreeDomain#}</span>
+ </div>
+ <div class="grid_6 suffix_2 omega" style="text-align: right">
+ <span id="domain_owner">{sprintf(#ClaimDomain#, '#')}</span>
+ </div>
+ <div class="clear"></div>
+ </div>
+
+ <div class="clear"></div>
<!-- Upload dialog -->
<div dojoType="dijit.Dialog" id="uploadDialog" style="display: none;" title="{#UploadNewArtwork#}">
<p>{#UploadNewArtworkDescription#}</p>
<form method="post" id="test" action="{get_xhr_hashed_url('upload_content', {$CurrentPerso->location_global})}?redirectTo={get_url()}" enctype="multipart/form-data">
<input type="hidden" id="location_local" name="location_local" value='{$CurrentPerso->location_local}' />
<input type="hidden" id="i" name="location_k" value="-1">
<div class="row">
<label for="artwork" class="firstLabel">{#UploadNewArtworkPicture#} (max. {ini_get('upload_max_filesize')})</label>
<input type="file" name="artwork" id="artwork" class="long" />
</div>
<div class="row">
<label for="title" class="firstLabel">{#UploadNewArtworkTitle#}</label>
<input dojoType="dijit.form.TextBox" name="title" id="title" type="text" class="long" />
</div>
<div class="row center">
<button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type="submit" value="Save" />OK</button>
</div>
</form>
</div>
<!-- Javascript bits: script.aculo.us -->
<script src="{#StaticContentURL#}/js/prototype.js"></script>
<script src="{#StaticContentURL#}/js/effects.js"></script>
<!-- Javascript bits: tower and couloir/passage/corridor/gallery/whatNameYouGiveToIt -->
<script src="{$SCENE_URL}/{$CurrentPerso->location_global}/tower.js"></script>
<script>
//Initializes tower map
//tower.hl = '{$SCENE_URL}/{$CurrentPerso->location_global}/hl.png';
//tower.highlight(1);
//Initializes passage view
passage.bayPath = '{$SCENE_URL}/{$CurrentPerso->location_global}/couloir/bay/';
passage.initialize('{$location->global}', '{$CurrentPerso->location_local}');
//Initializes gallery
gallery.initialize('{#StaticContentURL#}', '{get_xhr_hashed_url('get_content', {$CurrentPerso->location_global})}');
- </script>
\ No newline at end of file
+ </script>
diff --git a/content/scenes/B00001001/couloir/info.png b/content/scenes/B00001001/couloir/info.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9bfa42138a0400e7d3610e3221729ddd8eea5707
GIT binary patch
literal 5059
zc$|G$e>~IM|9{W#{Jz~J-DsqgUmHTkXbB-IDH>ui4BMD7#+F2NuTm<6qI)Njj4RB~
z{0!F$6(+x>C_hHoMt<b`p8M&3zmM<ZaX;@rwsX$=^?aV!d7X1!=Xu`0o^-a8lin!}
z0DzqRv7;^kAld+yEu|#D-w$~tBKW65ws9w)Ci;^p7!nph`4KN*q4s!80M-SI@rw@o
z3u^(Qpg31|vb)o9gf9`Vj}hAFN8v*O;bUPH6^ii<#*(2IumLy%Qe(cRUIU8rLu$Ag
zJHeeot+9c)V^k9MG}YPFmm2JA=BHt03AKnqfCP9f83T>NhY-RMQAmwVUIbVcHp4Wa
zn<nI7q{iP)xjUVN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{#f~GF%F3jf{*K4v%gJs|sB>EdBYbg}Hg5rpIt~gyV2!n03?q
zAQ-RRPwo`eYfWyva<ukS6D?7VXK#&HR#x_YaPMAJ-PuB~+X^9MGVfFp9J6^d9MUvT
zWq&N`Wuc3%Oz0LB6%`D!h!=YT4~`UaX1v8H!L5njBB3S_cNKN_Oj;qTKo171R}mX$
z#Y3Ow<>xnR&^VhHDQ@jv8)rSaBgJ=Nmlf9<TU)Ojr)U;EH~f^EEqEOM?dwNws*c+>
z$e|h_L}L7itEQOao1%Zab)xi#xMYNzM^Rs!hlfYb(cj&Ed)f3%IdQZ(H8mA}n8{>r
zjmtR<^r^c`jvGYuXoM(N;ayc(yM)mNl5I(8e*_G@OFBX{ul^ob7NAOB+!dEJH75FY
zo`>Q!&f4uhdrFlhpEaJYxGC@3&UMH(KG^T^nXMI198v0GODf0iCv9t58x#Cd;`sMP
nOY?2`N+g3lZ6WSGw;>`6h`Aa|1jN~R3E$b<I3Hym@rnN*6Sn!r
diff --git a/content/scenes/B00001002.tpl b/content/scenes/B00001002.tpl
--- a/content/scenes/B00001002.tpl
+++ b/content/scenes/B00001002.tpl
@@ -1,64 +1,56 @@
<!--
Global location: B00001002
-->
-
<div class="grid_7 alpha">
{$xyz = explode(',', substr($CurrentPerso->location_local, 1, -1))}
{$x = $xyz[0]}{$y = $xyz[1]}{$z = $xyz[2]}
- Sector C<span id="sector">{GeoOctocube::get_sector($x, $y, $z)}</span>
+ {#Sector#} C<span id="sector">{GeoOctocube::get_sector($x, $y, $z)}</span>
</div>
<div class="grid_2" style="text-align: center;">
- Zone <span id="area">{abs($x)}-{abs($y)}</span>
+ {#Zone#} <span id="area">{abs($x)}-{abs($y)}</span>
</div>
<div class="grid_7 omega" style="text-align: right; margin-bottom: 1em;">
- Niveau <span id="level">{abs($z)}</span>
+ {#Level#} <span id="level">{abs($z)}</span>
</div>
<div class="clear"></div>
{if $zone}
{if $zone->type == "hotglue"}
<!-- Content iframe -->
<script type="text/javascript">
function hijacklinks(iframe){
var as = iframe.contentDocument.getElementsByTagName('a');
for(i=0;i<as.length;i++){
as[i].setAttribute('target','_parent');
}
}
</script>
<iframe src="/apps/hotglue/?zone_{$zone->id}" width="960" height="600" id="content_iframe" frameborder="0" scrolling="no" style="margin-bottom: 1em" onload="hijacklinks(this)"></iframe>
{else}
-{print_r($zone)}
+<p>{#CantRender#}</p>
+{dprint_r($zone)}
{/if}
{else}
<div class="content_wrapper">
- <h1>HyperShip builder</h1>
+ <h1>{#Builder#}</h1>
<div class="grid_9 suffix_1 content alpha">
- <h2>This area is buildable.</h2>
- <p>You can take over this part of the ship, transform it and design it as you want.</p>
- <p>To start, you can:</p>
- <ul>
- <li>Create a 960px wide picture with your scene background.</li>
- <li>Define which parts of your picture are exits to another zone or level.</li>
- </ul>
- <p>If you want, you will also able to:</p>
- <ul>
- <li>Add descriptions to part of the area (like in the 90s adventure games)</li>
- <li>Create a textual scenario (like in 80s choose your own adventure books)</li>
- <li>Enhance the area with javascript or HTML5 (like in 2010)</li>
- </ul>
+ {#BuildInfo#}
</div>
<div class="grid_6 omega">
- <p><a href="{get_url('builder')}">Start to build</a></p>
+ <p><a href="{get_url('builder')}">{#StartBuild#}</a></p>
+
+ <p><a href="{get_url('do.php')}/local_move/0,1,0?redirectTo=/">{#GoNorth#}</a><br />
+ <a href="{get_url('do.php')}/local_move/1,0,0?redirectTo=/">{#GoEast#}</a><br />
+ <a href="{get_url('do.php')}/local_move/0,-1,0?redirectTo=/">{#GoSouth#}</a><br />
+ <a href="{get_url('do.php')}/local_move/-1,0,0?redirectTo=/">{#GoWest#}</a></p>
- <p><a href="{get_url('do.php')}/local_move/0,1,0?redirectTo=/">Go north</a><br />
- <a href="{get_url('do.php')}/local_move/1,0,0?redirectTo=/">Go east</a><br />
- <a href="{get_url('do.php')}/local_move/0,-1,0?redirectTo=/">Go south</a><br />
- <a href="{get_url('do.php')}/local_move/-1,0,0?redirectTo=/">Go west</a></p>
-
- <p><a href="{get_url('do.php')}/local_move/0,0,1?redirectTo=/">Climb up</a><br />
- <a href="{get_url('do.php')}/local_move/0,0,-1?redirectTo=/">Climb down</a></p>
+ <p><a href="{get_url('do.php')}/local_move/0,0,1?redirectTo=/">{#GoUp#}</a><br />
+ <a href="{get_url('do.php')}/local_move/0,0,-1?redirectTo=/">{#GoDown#}</a></p>
+
+ <p><a href="{get_url('builder', 'map')}">{#ViewMap#}</a></p>
+
+ <p><a href="{get_xhr_hashed_url('global_move', 'B00001001', 'T2C3')}?redirectTo={get_url()}">{#GoTower#}</a></p>
</div>
<div class="clear fixclear"></div>
</div>
-{/if}
\ No newline at end of file
+{/if}
diff --git a/content/scenes/B00001002_C0.tpl b/content/scenes/B00001002_C0.tpl
--- a/content/scenes/B00001002_C0.tpl
+++ b/content/scenes/B00001002_C0.tpl
@@ -1,34 +1,34 @@
<!--
Global location: B00001002
Local location: (0, 0, 0)
-->
<div class="grid_7 alpha">
- Sector C<span id="sector">0</span>
+ {#Sector#} C<span id="sector">0</span>
</div>
<div class="grid_9 omega" style="text-align: right; margin-bottom: 1em;">
- HyperShip core
+ {#Core#}
</div>
<div class="clear"></div>
<div class="content_wrapper">
- <h1>HyperShip core</h1>
+ <h1>{#Core#}</h1>
<div class="grid_9 suffix_1 content alpha">
- <h2>You're in the HyperShip core.</h2>
- <p>This area is the real center of the HyperShip.</p>
- <h2>Ship navigation control</h2>
- <p><strong>Current location:</strong> {$location}</p>
+ <h2>{#YouAreInCore#}</h2>
+ {#CoreInfo#}
+ <h2>{#ShipNavigationControl#}</h2>
+ <p><strong>{#CurrentLocation#}{#_t#}</strong> {$location}</p>
</div>
<div class="grid_6 omega">
<p><a href="{get_url('do.php')}/local_move/-1,1,-1?redirectTo=/">C1</a><br>
<a href="{get_url('do.php')}/local_move/1,1,-1?redirectTo=/">C2</a><br>
<a href="{get_url('do.php')}/local_move/-1,-1,-1?redirectTo=/">C3</a><br>
<a href="{get_url('do.php')}/local_move/1,-1,-1?redirectTo=/">C4</a><br></p>
<p><a href="{get_url('do.php')}/local_move/-1,1,1?redirectTo=/">C5</a><br>
<a href="{get_url('do.php')}/local_move/1,1,1?redirectTo=/">C6</a><br>
<a href="{get_url('do.php')}/local_move/-1,-1,1?redirectTo=/">C7</a><br>
<a href="{get_url('do.php')}/local_move/1,-1,1?redirectTo=/">C8</a><br></p>
</div>
<div class="clear fixclear"></div>
-</div>
\ No newline at end of file
+</div>
diff --git a/controllers/builder.php b/controllers/builder.php
--- a/controllers/builder.php
+++ b/controllers/builder.php
@@ -1,77 +1,137 @@
<?php
/**
* Builder
*
* Zed. The immensity of stars. The HyperShip. The people.
*
* (c) 2010, Dereckson, some rights reserved.
* Released under BSD license.
*
* @package Zed
* @subpackage Controllers
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @copyright 2010 Sébastien Santoro aka Dereckson
* @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
* @version 0.1
* @link http://scherzo.dereckson.be/doc/zed
* @link http://zed.dereckson.be/
* @filesource
+ */
+
+require_once('includes/content/zone.php');
+
+//
+// Helper methods
+//
+
+/**
+ * Determines if a specified location is buildable
+ *
+ * @param GeoLocation $location the location to check
+ * @param string if the location isn't buidable, a textual description of why.
+ * @return bool true if the location is buildable ; otherwise, false
*
* @todo create a build.xml document to set what's buildable, and by who
*/
-
-//
-// Temporary initialization code, to allow some build during the Zed alphatest
-//
+function is_buildable ($location, &$error = '') {
+ //We currently allow build only in the hypership tower and core.
+ if (!$location->body->hypership) {
+ $error = "You can only invoke the HyperShip builder facilities inside the HyperShip.";
+ return false;
+ }
-$build_location = $CurrentPerso->location;
-$build_mode = 'hotglue';
-if (!$build_location->body->hypership) {
- message_die("You can only invoke the HyperShip builder facilities inside the HyperShip.");
-}
+ //if ($build_location->place->code == "001") {
+ // //Don't allow custom builds in the corridor (T?C?)
+ //}
-if ($build_location->place->code == "003") {
- message_die("Bays aren't buildable.");
+ if ($build_location->place->code == "003") {
+ message_die("Bays aren't buildable.");
+ return false;
+ }
+
+ return true;
}
//
-// Prepare zone
+// Determines mode and initializes resources
//
-//TODO: get local zone
-include('includes/content/zone.php');
-if (true) {
- //Gets or creates a new zone at build location
- $zone = ContentZone::at($build_location->global, $build_location->local, true);
- $zone->title = "Sandbox hotglue zone for $build_location->global $build_location->local";
- $zone->type = 'hotglue';
- $zone->save_to_database();
+switch ($build_mode = $url[1]) {
+ case 'map':
+ require_once('includes/geo/octocube.php');
+
+ $build_mode = 'map';
+
+ //Get zones at this floor
+ if ($CurrentPerso->location->global == 'B00001002') {
+ $point = GeoPoint3D::fromString($CurrentPerso->location->local);
+ $sector = GeoOctocube::get_sector_from_point3D($point);
+ $pattern = GeoOctocube::get_rlike_pattern_from_sector($sector, $point->z);
+ $zones = ContentZone::search($CurrentPerso->location->global, $pattern, true);
+ } else {
+ message_die(GENERAL_ERROR, "Can't map this area.", "Builder :: Map");
+ }
+
+ //Template
+ define('DOJO', true);
+ $smarty->assign('zones', $zones);
+ $template = "builder_map.tpl";
+
+ break;
+
+ case '':
+ case 'hotglue':
+ //Temporary initialization code, to allow some build during the Zed alphatest
+ $build_location = $CurrentPerso->location;
+ $build_mode = 'hotglue';
+
+ $error = '';
+ if (!is_buildable($build_location, $error)) {
+ message_die(GENERAL_ERROR, $error, "Can't build");
+ }
+
+ //Gets or creates a new zone at build location
+ $zone = ContentZone::at($build_location->global, $build_location->local, true);
+ switch ($zone->type) {
+ case 'hotglue':
+ //All rulez
+ break;
+
+ case '':
+ //New zone
+ $zone->title = "Sandbox hotglue zone for $build_location->global $build_location->local";
+ $zone->type = 'hotglue';
+ $zone->save_to_database();
+ break;
+
+ default:
+ message_die("This isn't a zone managed by hotglue.");
+ }
+ unset($error);
+
+ //Template
+ $smarty->assign('location', $build_location);
+ $smarty->assign('zone', $zone);
+ $smarty->assign('IFRAME_SRC', '/apps/hotglue/?zone_' . $zone->id . '/edit');
+ $template = 'builder_hotglue.tpl';
+ break;
+
+ default:
+ message_die(GENERAL_ERROR, "Unknown build mode: $build_mode");
}
//
// HTML output
//
-
//Serves header
$smarty->assign('PAGE_TITLE', 'Builder');
include('header.php');
-//Hotglue iframe
-$smarty->assign('location', $build_location);
-$smarty->assign('zone', $zone);
-switch ($build_mode) {
- case 'hotglue':
- $smarty->assign('IFRAME_SRC', '/apps/hotglue/?zone_' . $zone->id . '/edit');
- $smarty->display('builder_hotglue.tpl');
- break;
+//Serves content
+$smarty->display($template);
- default:
- message_die(GENERAL_ERROR, "Unknown build mode: $build_mode");
- break;
-}
-
-//Servers footer
+//Serves footer
include('footer.php');
?>
diff --git a/img/map/map-kub-top-build.png b/img/map/map-kub-top-build.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e41566a4dba1d15a17374d765add8718b725ddb8
GIT binary patch
literal 1438
zc%17D@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=k|nMYCBgY=CFO}lsSJ)O`AMk?
zp1FzXsX?iUDV2pMQ*9U+m=!WZB1$5BeXNr6bM+EIYV;~{3m8Da#=fE;F*!T6L?J0P
zJu}Z%>HY5gN(z}Nwo2iqz6QPp&Z!xh9#uuD!Bu`C$yM3OmMKd1b_zBXRzL%CQ%e#R
zDspr3imfVamB8j&0ofp7eI*63l9Fs&C5WRUd;=7m^NUgyO!W+OlMT!a6wD0u42@09
z&CPWbj0_A7^bL&k4UKdS&8>`$tPBhkpg;*|TTx1yRgjAt)Gi>;Rw<*Tq`*pFzr4I$
zuiRKKzbIYb(9+TpWQLKEE>MMTab;dfVufyAu`<jAm(=3qqRfJl%=|nB5I->~zqG_w
zNeSkK+yc0<dBxCR0tT3VMPh-zp`L+0l0si!{7Q3k;i`*Ef>P7)t1b?yEJ)Q4N-fSW
zElLJPT$(aSbAgp}QEFmIeo;t%ehw@Y12XbU@{2R_3lyA#O%=j3^HTE5i@~aWeXTt6
zic1pnl2bihY?Xi_dYPFiR+g@=riMnwCI+rf&W47r1{M}(j;>}V<}OACPA-<_t}wkW
z`N^fZsd*(Zy(tL2ra1M25&}ebYEfocYK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zc
zEJabUwzkF|KKyRi?RLikfdFJhMtONTJRVPaQt|rwdVXPHVXWlN9o23)%=-HJ5(^8D
ze-DSlba;3ekw_G`Zx_RAwIUD*q&^esbUKOW`MhskE)}KpPpww_M{8^A4|co#o58_B
zOievPEEa>JDA4J2sdr#yW#yL7=lfuJdHHogVc|koSJ#h6pE#$}iT3t(ghC<A%*<eM
zaq&U{#@O3CV6)kN6Gid;?Ck82*=*iA-n;E~JJf15>g($<IXQ`7Fo>q6rZ+ZDC<T$o
z+dIH<oKjX+ws<UlUPh~^s6b0g%ejpziUNs9kdjGAMEcLWp?vB1@n`vESq32lgb+|d
zAQAHJ^}tnwQ3^sR2t5?0M<CY%aM)W4N+l5KP?%7fegH*L{;`}80!j%a>Cgp2r1SzX
zCWFuus|leXL^^su8H%(3&?9?~drT=g<wV+s;G*IpZB_AQW!1F+r0ev=<A&pZ0Pd!b
a=YIo2s~m1LuV`)n0000<MNUMnLSTZql^c`*
diff --git a/img/map/zone-edit.png b/img/map/zone-edit.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2c729ba905cc55c706819322f126f4232bcc5a50
GIT binary patch
literal 483
zc%17D@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Y)RhkE)4%c
zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPiw+x>g?<NMN?LZ;P64!_l=ltB<
z)VvY~=c3falGGH1^30M91$R&1fbd2>aiCRpo-U3d5r^MSKbza^AkaErcUFUURL7A<
zyC4?rz~-l{@hcNFm1+w-qyrd*j1Nq5X6cia`NO<h-0jh!r?tlK4KvCZsv>mQ8Kwle
zOFwezxGXm<o4MfHr?OXnL#~C*JfOTV?ktn$)6Zgeq#o{_EACq8HR;J#o|eQP6DmYp
z=U2}AFE~Buk-bFvvc<a@Pi?Bv?t1h%>dxmqi-TT03;E8?c7DFleC}sT423d}qhdHd
zin1L19WzhtCUfSjxQ^q6JPiASPML4&ShcF@v4w>UU-OQizBjhL{iZLm`hB&)X4!_g
zYysnrlQs?4q<mPE+<e;@w_H<L^f~!b)4FWOBMM0d^A&p-N@BZrsTq8B{hq_LAa~aM
z1Am2N6)JMMXDyR#%~}*Vhkb_XJ|@K@-rsht`)%VeE%lq(!js;a);?>P-{j1Het)Io
WEhoA67ybi-o59o7&t;ucLK6UANxd`x
diff --git a/img/map/zone-goto.png b/img/map/zone-goto.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b533ec58cfa437690e920d8737ae93f8bb1def41
GIT binary patch
literal 584
zc$@)90=NB%P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igl9
z4jd{aJoR1x000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}0004_Nkl<Z
zSi|j?J8r^25QcvuE|5cTHcA?L?@E*oQmQ~nDkMM%5x5M8NEy##?G(1jVj)=Dk(@}3
zG}>mp|F>g%9z6gVI<!6j%;$5{h4^qdG*9T*ItS?230K|2Ltbsa&Vf-B1@E=i{%!<H
zGsgVNo<H*qJOCa5|0fZJSe9i_r`-U!G=+-5scR2#I-Q>5I39)F8c-EDr%+Ld2T)Dl
z<MH@)Fc^H^1t`VurC#S!I2EWms1t}Pv;e3+Ypq2b$D?X}=mE&C6^)WUilVEjRYjqy
zP?xVFnnyt|eYsqo>q1rMW<OAFw${QJgDlG%r!-B$%wX}H8B(mJ6VXlapx@Aku+~CV
zFGN@vO!+Dv2oYhmTHO^7$^$;cWHJG>{5TaLBp?<rGm?a`*=&NugA<VtF`d4Eh4LGV
z6w#n_*tgqluz0OZ=tIojW*}w=6IcWy0{Tj@+wE$J*G|Pg#QS0aB8D&{NfPWo_O-<u
z)dC-4y<UTea5x+qi8n4rKE&~OY%JcY8u}1zhMQL9xD;(OS+(v5+KzRPj;Po5c>WEk
W*K<wEyJfZj0000<MNUMnLSTZZ)#|(e
diff --git a/js/builder/map.js b/js/builder/map.js
new file mode 100644
--- /dev/null
+++ b/js/builder/map.js
@@ -0,0 +1,103 @@
+/* -------------------------------------------------------------
+ Zed
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ Author: Dereckson
+ Tags: map
+ Filename: map.js
+ Version: 1.0
+ Created: 2010-12-23
+ Updated: 2010-12-23
+ Licence: Dual licensed: BSD and Creative Commons BY 3.0.
+ Dependencies: dojo
+ ------------------------------------------------------------- */
+/**
+ * Map
+ */
+var map = {
+ id: null,
+ zones: null,
+ bounds: null,
+
+ init: function (id, zones) {
+ map.id = id;
+ map.zones = zones;
+ map.render();
+ },
+
+ /**
+ * Get coordinates
+ *
+ * @returns An array [x, y, z]
+ */
+ get_coordinates: function (expr) {
+ var coordinates = expr.substring(1, expr.length - 1).split(', ');
+ return [parseInt(coordinates[0]), parseInt(coordinates[1]), parseInt(coordinates[2])];
+ },
+
+ /**
+ * Calculates the zones bounds and stores the result in bounds property
+ */
+ calculate_bounds: function () {
+ var start = map.get_coordinates(map.zones[0][0]);
+ map.bounds = [
+ [start[0], start[0]],
+ [start[1], start[1]],
+ [start[2], start[2]]
+ ];
+ for (i = 1 ; i < map.zones.length ; i++) {
+ point = map.get_coordinates(map.zones[i][0]);
+ if (point[0] < map.bounds[0][0]) map.bounds[0][0] = point[0];
+ if (point[1] < map.bounds[1][0]) map.bounds[1][0] = point[1];
+ if (point[2] < map.bounds[2][0]) map.bounds[2][0] = point[2];
+ if (point[0] > map.bounds[0][1]) map.bounds[0][1] = point[0];
+ if (point[1] > map.bounds[1][1]) map.bounds[1][1] = point[1];
+ if (point[2] > map.bounds[2][1]) map.bounds[2][1] = point[2];
+ }
+ },
+
+ render_zone: function (x, y, z) {
+ var location = "(" + x + ", " + y + ", " + z + ")";
+ for (i = 0 ; i < map.zones.length ; i++) {
+ if (location == map.zones[i][0]) {
+ return '<span class="zone zone-edit" id="zone-' + map.zones[i][1] + '" onMouseOut="map.reset_info()" onMouseOver="map.set_info(\'' + location + '\')" onClick="map.menu_edit(\'' + location + '\', ' + map.zones[i][1] + ');"><img src="/img/map/map-kub-top.png" alt="Built" /></span>';
+ }
+ }
+ return '<span class="zone zone-build" onMouseOut="map.reset_info()" onMouseOver="map.set_info(\'' + location + '\')" onClick="map.menu_build(\'' + location + '\');"><img src="/img/map/map-kub-top-build.png" alt="Build" /></span>';
+ },
+
+ render: function () {
+ map.calculate_bounds();
+ var html = "";
+ z = map.bounds[2][0];
+ for (y = map.bounds[1][1] ; y >= map.bounds[1][0] ; y--) {
+ for (x = map.bounds[0][0] ; x <= map.bounds[0][1] ; x++) {
+ html += '<div class="grid_1">' + map.render_zone(x, y, z) + "</div>";
+ }
+ html += '</div><div class="clear fixclear"></div>';
+ dojo.byId(map.id).innerHTML = html;
+ }
+ },
+
+ menu_edit: function (local_location, zone_id) {
+ //alert("Goto or edit #" + zone_id);
+ //map/zone-edit.png
+ //map/zone-goto.png
+ window.location = "/do.php/set_local_location/" + local_location + "?redirectTo=/";
+ },
+
+ menu_build: function (local_location) {
+ //alert("Build at " + local_location);
+ //map/zone-build.png
+ //window.location = "/do.php/set_local_location/" + escape(local_location) + "?redirectTo=/builder";
+ window.location = "/do.php/set_local_location/" + local_location + "?redirectTo=/";
+ },
+
+ set_info: function (local_location) {
+ coord = map.get_coordinates(local_location);
+ dojo.byId("info_area").innerHTML = 'Zone <span id="area">' + Math.abs(coord[0]) + '-' + Math.abs(coord[1]) + '</span>';
+ },
+
+ reset_info: function () {
+ dojo.byId("info_area").innerHTML = "&nbsp;";
+ }
+}
diff --git a/lang/en/scenes.conf b/lang/en/scenes.conf
--- a/lang/en/scenes.conf
+++ b/lang/en/scenes.conf
@@ -1,21 +1,51 @@
#Zed language config file - scenes
#Language: English
#Code: en
#Author: Dereckson
###
### Hypership tower
###
[B00001001]
Tower = Tour
Floor = Floor
Sector = Sector
Couloir = Couloir
GoUp = Climb up
GoDown = Climb down
UploadNewArtwork = "Upload new artwork"
UploadNewArtworkDescription = "This frame is free. You can display here your artwork or any other artwork you like."
UploadNewArtworkPicture = "Picture"
-UploadNewArtworkTitle = "Title"
\ No newline at end of file
+UploadNewArtworkTitle = "Title"
+
+FreeDomain = "These sleeping quarters are free."
+ClaimDomain = 'You can <a href="%s">claim</a> them.'
+
+[B00001002]
+Sector = Sector
+Zone = Zone
+Level = Niveau
+
+Builder = HyperShip builder
+BuildInfo = <h2>This area is buildable.</h2><p>You can take over this part of the ship, transform it and design it as you want.</p><p>To start, you can:</p><ul> <li>Create a 960px wide picture with your scene background.</li><li>Define which parts of your picture are exits to another zone or level.</li></ul><p>If you want, you will also able to:</p><ul><li>Add descriptions to part of the area (like in the 90s adventure games)</li><li>Create a textual scenario (like in 80s choose your own adventure books)</li><li>Enhance the area with javascript or HTML5 (like in 2010)</li></ul>
+
+StartBuild = Start to build
+GoNorth = Go north
+GoEast = Go east
+GoSouth = Go south
+GoWest = Go west
+GoUp = Climb up
+GoDown = Climb down
+ViewMap = Print the level map
+GoTower = Go to the tower
+
+CantRender = Unable to render this zone:
+
+Core = HyperShip core
+YouAreInCore = You're in the HyperShip core.
+CoreInfo = <p>This area is the real center of the HyperShip.</p>
+
+ShipNavigationControl = Ship navigation control
+CurrentLocation = Current location
diff --git a/skins/zed/builder_map.tpl b/skins/zed/builder_map.tpl
new file mode 100644
--- /dev/null
+++ b/skins/zed/builder_map.tpl
@@ -0,0 +1,49 @@
+ <div class="grid_7 alpha">
+{$xyz = explode(',', substr($CurrentPerso->location_local, 1, -1))}
+{$x = $xyz[0]}{$y = $xyz[1]}{$z = $xyz[2]}
+ Sector C<span id="sector">{GeoOctocube::get_sector($x, $y, $z)}</span>
+ </div>
+ <div class="grid_2" style="text-align: center;" id="info_area">
+ Zone <span id="area">{abs($x)}-{abs($y)}</span>
+ </div>
+ <div class="grid_7 omega" style="text-align: right; margin-bottom: 1em;">
+ Niveau <span id="level">{abs($z)}</span>
+ </div>
+
+ <div class="clear"></div>
+
+ <!-- Map -->
+{if $zones}
+ <div id="map"></div>
+ <style>
+ .zone-build img {
+ opacity: 0.10;
+ }
+ </style>
+ <script type="text/javascript" src="/js/builder/map.js"></script>
+ <script>
+ var zones = [
+{foreach from=$zones item=zone name=zones}
+ ['{$zone->location_local}', {$zone->id}, '{$zone->type}', '{$zone->params}']{if !$smarty.foreach.zones.last},{/if}
+
+{/foreach}
+ ];
+ dojo.ready(function() {
+ map.init('map', zones);
+ });
+ </script>
+ <noscript>
+ <p>You've zones at:</p>
+ <ul>
+{foreach from=$zones item=zone}
+ <li>{$zone->location_local}</li>
+{/foreach}
+ </ul>
+ <p>A patch for a pure HTML renderer to print a map without javascript is welcome.</p>
+ </noscript>
+{else}
+ <div class="grid_16 alpha omega">
+ <div class="notify">This area is empty.</div>
+ </div>
+ <div class="clear"></div>
+{/if}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Nov 3, 21:48 (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
21241
Default Alt Text
(51 KB)

Event Timeline