Dragon-Scourge/mapmini.php
Jamin Blount 035a48fbfe Beta 3 Build 14
2.26.2006 - Build 14 (Pete Rose):
- The poor sods who are stuck on dial-up can now select to not show the
minimap in their account settings.
- Fixed a problem with guild names in paneltop.
- Fixed minor bug in account settings that caused a server error when
not changing your password.
- Manually logging out of the game now resets your onlinetime so you no
longer appear in Who's Online.
- Letting a duel time out after it's been accepted now counts against
your duelling wins/losses.
- Overhauled dorow() to allow forcing array indexes by a specific
column. Modified several functions accordingly.
- Guild Honor is now shown correctly on the main Guild Hall page
immediately after an update.
- Guild shoutboxes now add the guild ID from userrow instead of in the
GET request. More secure.
- Guild minimim join/start levels are now admin-editable in controlrow.
- updateuserrow() now array_maps addslashes to allow apostrophes in item
names.
2017-02-05 11:54:46 -06:00

64 lines
2.4 KiB
PHP

<?php // mapmini.php :: minimap flash controller.
include("lib.php");
include("globals.php");
$perpix = 100 / ($worldrow["size"] * 2);
$text = "&";
// First do towns.
$towns = dorow(doquery("SELECT * FROM {{table}} WHERE world='".$worldrow["id"]."'", "towns"));
$text .= "towns=".sizeof($towns)."&";
$count = 0;
foreach($towns as $a=>$b) {
$lat = $b["latitude"];
$lon = $b["longitude"];
if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 50 + ceil(($lat * -1) * $perpix); }
if ($lon >= 0) { $x = 50 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); }
$text .= "town".$count."_x=".$x."&";
$text .= "town".$count."_y=".$y."&";
$count++;
}
// Then do your character.
$lat = $userrow["latitude"];
$lon = $userrow["longitude"];
if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 50 + ceil(($lat * -1) * $perpix); }
if ($lon >= 0) { $x = 50 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); }
$text .= "player_x=".$x."&";
$text .= "player_y=".$y."&";
// Then do everyone else.
$users = dorow(doquery("SELECT * FROM {{table}} WHERE world='".$worldrow["id"]."' AND UNIX_TIMESTAMP(onlinetime) >= '".(time()-600)."' AND id != '".$userrow["id"]."'", "users"), "id");
$text .= "users=".count($users)."&";
$count = 0;
if ($users != false) {
foreach ($users as $a => $b) {
$lat = $b["latitude"];
$lon = $b["longitude"];
if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 50 + ceil(($lat * -1) * $perpix); }
if ($lon >= 0) { $x = 50 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); }
$text .= "user".$count."_x=".$x."&";
$text .= "user".$count."_y=".$y."&";
$count++;
}
}
// Then do quests.
if ($userrow["story"] != "0" && $userrow["story"] != "9999") {
$lat = $userrow["storylat"];
$lon = $userrow["storylon"];
if ($lat >= 0) { $y = ceil(($worldrow["size"] - $lat) * $perpix); } else { $y = 250 + ceil(($lat * -1) * $perpix); }
if ($lon >= 0) { $x = 250 + ceil($lon * $perpix); } else { $x = ceil(($worldrow["size"] + $lon) * $perpix); }
$text .= "story=1&";
$text .= "story_x=".$x."&";
$text .= "story_y=".$y."&";
$text .= "story_name=Quest&";
} else { $text .= "story=0&"; }
echo($text);
?>