map & tooltips, saimod player, saimod creature
This commit is contained in:
parent
92bb23e4f9
commit
95a9996255
@ -16,7 +16,8 @@ class api_mojotrollz extends \SYSTEM\API\api_system {
|
||||
throw new ERROR("You need to be logged in to view this ressource.");}
|
||||
$creature = creature::data($entry);
|
||||
return $creature;}
|
||||
public static function call_map($filter = null){
|
||||
return map::positions($filter);
|
||||
}
|
||||
public static function call_positions($type,$map=null,$entry=null){
|
||||
return map::positions($type,$map,$entry);}
|
||||
public static function call_tooltip($type,$id){
|
||||
return tooltip::html($type,$id);}
|
||||
}
|
||||
|
||||
27
mojotrollz/api/api_mojotrollz.sql
Normal file
27
mojotrollz/api/api_mojotrollz.sql
Normal file
@ -0,0 +1,27 @@
|
||||
-- sys api
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 0, 0, -1, NULL, 'call', NULL);
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (11, 0, 0, 10, NULL, 'action', NULL);
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (20, 0, 2, 11, 'login', 'username', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (21, 0, 2, 11, 'login', 'password_sha', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (22, 0, 2, 11, 'login', 'password_md5', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (23, 0, 2, 11, 'check', 'rightid', 'UINT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (24, 0, 2, 11, 'create', 'username', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (25, 0, 2, 11, 'create', 'password_sha', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (26, 0, 2, 11, 'create', 'email', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (27, 0, 2, 11, 'create', 'locale', 'LANG');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (30, 0, 2, 10, 'files', 'cat', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (31, 0, 3, 10, 'files', 'id', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (40, 0, 2, 10, 'text', 'request', 'STRING');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (41, 0, 2, 10, 'text', 'lang', 'LANG');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (50, 0, 2, 10, 'pages', 'group', 'UINT');
|
||||
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (100, 0, 3, 10, 'charcreation', 'json', 'JSON');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (132, 0, 2, 10, 'quest', 'entry', 'INT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (133, 0, 2, 10, 'creature', 'entry', 'INT');
|
||||
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (140, 0, 2, 10, 'positions', 'type', 'INT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (141, 0, 3, 10, 'positions', 'map', 'INT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (142, 0, 3, 10, 'positions', 'entry', 'INT');
|
||||
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (150, 0, 2, 10, 'tooltip', 'type', 'INT');
|
||||
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (151, 0, 2, 10, 'tooltip', 'id', 'INT');
|
||||
@ -6,4 +6,6 @@
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/quest');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/quest/qq','DBD');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/tags');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/tags/qq','DBD');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/tags/qq','DBD');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/tooltip');
|
||||
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/tooltip/qq','DBD');
|
||||
9
mojotrollz/api/database/database_elements.php
Normal file
9
mojotrollz/api/database/database_elements.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
class database_elements {
|
||||
const DB_CREATURE = 1;
|
||||
const DB_OBJECT = 2;
|
||||
const DB_ITEM = 3;
|
||||
const DB_QUEST = 4;
|
||||
const DB_SPELL = 5;
|
||||
const DB_PLAYER = 6;
|
||||
}
|
||||
@ -115,4 +115,17 @@ function wow_spell(){
|
||||
style: 'qtip-wiki'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function wow_tooltip_close(container){
|
||||
container.innerHTML = '';}
|
||||
function wow_tooltip(container,type,id,x,y){
|
||||
$.ajax({type : 'GET',
|
||||
url : './api.php?call=tooltip&type='+type+'&id='+id,
|
||||
success : function(data) {
|
||||
container.innerHTML = data;
|
||||
container.style.left=x+15 + "px";
|
||||
container.style.top=y-60 + "px";
|
||||
}
|
||||
});
|
||||
}
|
||||
11
mojotrollz/api/database/tooltip/qq/TOOLTIP_CREATURE.php
Normal file
11
mojotrollz/api/database/tooltip/qq/TOOLTIP_CREATURE.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class TOOLTIP_CREATURE extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
'',
|
||||
'SELECT guid FROM creature WHERE guid = ? LIMIT 1;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
11
mojotrollz/api/database/tooltip/qq/TOOLTIP_OBJECT.php
Normal file
11
mojotrollz/api/database/tooltip/qq/TOOLTIP_OBJECT.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class TOOLTIP_OBJECT extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
'',
|
||||
'SELECT guid FROM gameobject WHERE guid = ? LIMIT 1;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
11
mojotrollz/api/database/tooltip/qq/TOOLTIP_PLAYER.php
Normal file
11
mojotrollz/api/database/tooltip/qq/TOOLTIP_PLAYER.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class TOOLTIP_PLAYER extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
'',
|
||||
'SELECT guid, name, race, class, gender, level FROM characters WHERE guid = ? AND deleteInfos_Account IS NULL LIMIT 1;',
|
||||
new \DBD\mangos_chars()
|
||||
);}}
|
||||
|
||||
21
mojotrollz/api/database/tooltip/tooltip.php
Normal file
21
mojotrollz/api/database/tooltip/tooltip.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
class tooltip {
|
||||
public static function html($type,$id){
|
||||
switch($type){
|
||||
case database_elements::DB_CREATURE:
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PAPI(),'database/tooltip/tpl/tooltip_creature.tpl'), \DBD\TOOLTIP_CREATURE::Q1(array($id)));
|
||||
case database_elements::DB_OBJECT:
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PAPI(),'database/tooltip/tpl/tooltip_object.tpl'), \DBD\TOOLTIP_OBJECT::Q1(array($id)));
|
||||
case database_elements::DB_ITEM:
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PAPI(),'database/tooltip/tpl/tooltip_item.tpl'), \DBD\TOOLTIP_ITEM::Q1(array($id)));
|
||||
case database_elements::DB_QUEST:
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PAPI(),'database/tooltip/tpl/tooltip_quest.tpl'), \DBD\TOOLTIP_QUEST::Q1(array($id)));
|
||||
case database_elements::DB_SPELL:
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PAPI(),'database/tooltip/tpl/tooltip_spell.tpl'), \DBD\TOOLTIP_SPELL::Q1(array($id)));
|
||||
case database_elements::DB_PLAYER:
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PAPI(),'database/tooltip/tpl/tooltip_player.tpl'), \DBD\TOOLTIP_PLAYER::Q1(array($id)));
|
||||
default:
|
||||
throw new ERROR('Wrong Type');
|
||||
}
|
||||
}
|
||||
}
|
||||
5
mojotrollz/api/database/tooltip/tpl/tooltip_creature.tpl
Normal file
5
mojotrollz/api/database/tooltip/tpl/tooltip_creature.tpl
Normal file
@ -0,0 +1,5 @@
|
||||
Player: ${name}(${guid})<br/>
|
||||
Race: ${race}<br/>
|
||||
Class: ${class}<br/>
|
||||
Gender: ${gender}<br/>
|
||||
Level: ${level}
|
||||
5
mojotrollz/api/database/tooltip/tpl/tooltip_object.tpl
Normal file
5
mojotrollz/api/database/tooltip/tpl/tooltip_object.tpl
Normal file
@ -0,0 +1,5 @@
|
||||
Player: ${name}(${guid})<br/>
|
||||
Race: ${race}<br/>
|
||||
Class: ${class}<br/>
|
||||
Gender: ${gender}<br/>
|
||||
Level: ${level}
|
||||
5
mojotrollz/api/database/tooltip/tpl/tooltip_player.tpl
Normal file
5
mojotrollz/api/database/tooltip/tpl/tooltip_player.tpl
Normal file
@ -0,0 +1,5 @@
|
||||
Player: ${name}(${guid})<br/>
|
||||
Race: ${race}<br/>
|
||||
Class: ${class}<br/>
|
||||
Gender: ${gender}<br/>
|
||||
Level: ${level}
|
||||
@ -1,4 +1,11 @@
|
||||
#map {
|
||||
.map_element{
|
||||
position: relative;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
background-image: url(http://www.mojotrollz.eu/web/mojotrollz/api.php?call=files&cat=map&id=position.gif);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
.map {
|
||||
margin-left: 0px;
|
||||
margin-top: 0px;
|
||||
margin-right: 0px;
|
||||
@ -8,31 +15,10 @@
|
||||
background-color: #000000;
|
||||
height: 450px;
|
||||
width: 600px;
|
||||
}
|
||||
.map_element{
|
||||
position: relative;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
background-image: url(http://www.mojotrollz.eu/web/mojotrollz/api.php?call=files&cat=map&id=position.gif);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
#map_world {
|
||||
height: 450px;
|
||||
width: 600px;
|
||||
background-image: url(http://www.mojotrollz.eu/web/mojotrollz/api.php?call=files&cat=map&id=azeroth.jpg);
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
z-index: 10;
|
||||
}
|
||||
#map_pointsWorld {
|
||||
position: absolute;
|
||||
height: 732px;
|
||||
width: 966px;
|
||||
left: 50%;
|
||||
margin-left: -483px;
|
||||
z-index: 100;
|
||||
}
|
||||
#map_tooltip {
|
||||
.map_tooltips {
|
||||
border: 0px solid #aaaaaa;
|
||||
padding: 0px;
|
||||
position: relative;
|
||||
|
||||
@ -164,38 +164,6 @@ function getMultiText(multitext, onClick)
|
||||
return data;
|
||||
}
|
||||
|
||||
function tip(object, type, onClick,x,y)
|
||||
{
|
||||
var t, data;
|
||||
var tipxy;
|
||||
t=document.getElementById("map_tooltip");
|
||||
switch(type)
|
||||
{
|
||||
case 2:
|
||||
tipxy = new _coord();
|
||||
tipxy.x = x+15;
|
||||
tipxy.y = y-60;
|
||||
t.innerHTML='<table width="120" border="0" cellspacing="0" cellpadding="0" class=\'tip_worldinfo\'\>'+object+'</table\>';
|
||||
break;
|
||||
case 1:
|
||||
if(onClick || t.innerHTML == '')
|
||||
{
|
||||
data = getMultiText(object.multi_text, onClick);
|
||||
t.innerHTML='<table border=\'0\' cellspacing=\'0\' cellpadding=\'0\'\><tr class=\'tip_header\'\><td colspan=\'7\'\>'+object.zone+'</td\></tr\><tr class=\'tip_head_text\'\><td align=\'center\'\>#</td\><td\> name</td\><td width=\'25\' align=\'center\'\>level</td\><td colspan=\'2\'\>race</td\><td colspan=\'2\'\> class</td\></tr\>'+data+'<\/table\>';
|
||||
}
|
||||
tipxy = get_tipxy(t.offsetWidth, t.offsetHeight, pointx, pointy);
|
||||
break;
|
||||
case 0:
|
||||
if(object.faction) {color='#D2321E';}
|
||||
else {color='#0096BE';}
|
||||
t.innerHTML='<table width=\'100\' border=\'0\' cellspacing=\'0\' cellpadding=\'0\'\><tr class=\'tip_text\'\><td\> '+object.name+' </td\></tr\><tr bgcolor=\''+color+'\'\><td height=\'1px\'\></td\></tr\><tr\><td\><table width=100% border=\'0\' cellspacing=\'0\' cellpadding=\'3\'\><tr class=\'tip_text\'\><td\>'+object.single_text+'</td\></tr\><\/table\></td\></tr\><\/table\>';
|
||||
tipxy = get_tipxy(t.offsetWidth, t.offsetHeight, pointx, pointy);
|
||||
break;
|
||||
}
|
||||
t.style.left=tipxy.x + "px";
|
||||
t.style.top=tipxy.y + "px";
|
||||
}
|
||||
|
||||
function get_player_position(x,y,m)
|
||||
{
|
||||
pos = new _pos();
|
||||
@ -462,22 +430,32 @@ function show(data)
|
||||
}
|
||||
}
|
||||
|
||||
function tooltip_close(){
|
||||
t=document.getElementById("map_tooltip");
|
||||
t.innerHTML = '';
|
||||
function map(type,entry){
|
||||
$('#tabs_maps a').click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).tab('show');
|
||||
map_positions(type,$(this).attr('map'),entry);
|
||||
});
|
||||
map_positions(type,0,entry);
|
||||
}
|
||||
|
||||
function map()
|
||||
{
|
||||
function map_positions(type,map,entry){
|
||||
$('#map_positions_'+map).html('');
|
||||
$.ajax({type : 'GET',
|
||||
url : './api.php?call=map',
|
||||
url : './api.php?call=positions&type='+type+'&map='+map+'&entry='+entry,
|
||||
success : function(data) {
|
||||
if(data.status){
|
||||
for (var i in data.result) {
|
||||
x = data.result[i].x*0.01+125;
|
||||
y = data.result[i].y*0.01+250;
|
||||
$('#map_positions').append('<div '+'onMouseMove="tip(\'<tr\><td\><img src=\\\'hordeicon.gif\\\'\></td\><td\><b style=\\\'color: rgb(210,50,30);\\\'\>:</b\> <b\>5</b\></td\></tr\><tr\><td\><img src=\\\'allianceicon.gif\\\'\></td\><td\><b style=\\\'color: rgb(0,150,190);\\\'\>:</b\> <b\>10</b\></td\></tr\>\',2,false,'+x+','+y+');" onMouseOut="tooltip_close()"'+
|
||||
'class="map_element" x="'+x+'" y="'+y+'" style="left: '+x+'px; top: '+y+'px;"></div>')
|
||||
x = data.result[i].x*0.0025+100;
|
||||
y = data.result[i].y*0.0025+100;
|
||||
$('#map_positions_'+map).append('<div '+
|
||||
'onMouseMove="wow_tooltip(map_tooltips_'+map+','+type+','+data.result[i].id+','+x+','+y+');" '+
|
||||
'onMouseOut="wow_tooltip_close(map_tooltips_'+map+')" '+
|
||||
'class="map_element" '+
|
||||
'x="'+x+'" '+
|
||||
'y="'+y+'" '+
|
||||
'style="left: '+x+'px; top: '+y+'px;">'+
|
||||
'</div>')
|
||||
}
|
||||
}else{
|
||||
alert('Problem: '+data);}
|
||||
|
||||
@ -1,18 +1,76 @@
|
||||
<?php
|
||||
class map {
|
||||
public static function generate(){
|
||||
public static function generate($type,$entry=null){
|
||||
$res = NULL;
|
||||
switch($type){
|
||||
case database_elements::DB_CREATURE:
|
||||
if($entry == null){
|
||||
throw new ERROR('Problem');}
|
||||
$res = \DBD\MAP_CREATURES_MAPS::QQ(array($entry));
|
||||
break;
|
||||
case database_elements::DB_OBJECT:
|
||||
if($entry == null){
|
||||
throw new ERROR('Problem');}
|
||||
$res = \DBD\MAP_OBJECTS_MAPS::QQ(array($entry));
|
||||
break;
|
||||
case database_elements::DB_ITEM:
|
||||
throw new ERROR('Incompatible Type - Item & Position');
|
||||
case database_elements::DB_QUEST:
|
||||
break;
|
||||
case database_elements::DB_SPELL:
|
||||
throw new ERROR('Incompatible Type - Spell & Position');
|
||||
case database_elements::DB_PLAYER:
|
||||
$res = \DBD\MAP_PLAYERS_MAPS::QQ();
|
||||
break;
|
||||
default:
|
||||
throw new ERROR('Wrong Type');
|
||||
}
|
||||
$vars = array();
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PAPI(),'map/tpl/map.tpl'), $vars);
|
||||
$vars['tabs'] = $vars['tabs_content'] = '';
|
||||
$active = true;
|
||||
while($map = $res->next()){
|
||||
$map['active'] = $active ? 'active' : '';
|
||||
$vars['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PAPI(),'map/tpl/maps_tab.tpl'), $map);
|
||||
$vars['tabs_content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PAPI(),'map/tpl/map.tpl'), $map);
|
||||
$active = false;
|
||||
}
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PAPI(),'map/tpl/maps.tpl'), $vars);
|
||||
}
|
||||
|
||||
public static function positions($filter = null){
|
||||
return self::players($filter);}
|
||||
|
||||
private static function players($filter = null){
|
||||
return JsonResult::toString(\DBD\MAP_PLAYERS::QA());}
|
||||
private static function objects($filter = null){
|
||||
public static function positions($type,$map=null,$entry=null){
|
||||
switch($type){
|
||||
case database_elements::DB_CREATURE:
|
||||
return self::creatures($map,$entry);
|
||||
case database_elements::DB_OBJECT:
|
||||
return self::objects($map,$entry);
|
||||
case database_elements::DB_ITEM:
|
||||
throw new ERROR('Incompatible Type - Item & Position');
|
||||
case database_elements::DB_QUEST:
|
||||
return self::quests($map,$entry);
|
||||
case database_elements::DB_SPELL:
|
||||
throw new ERROR('Incompatible Type - Spell & Position');
|
||||
case database_elements::DB_PLAYER:
|
||||
return self::players($map);
|
||||
default:
|
||||
throw new ERROR('Wrong Type');
|
||||
}
|
||||
}
|
||||
private static function creatures($filter = null){
|
||||
private static function players($map=null){
|
||||
if($map == null){
|
||||
return JsonResult::toString(\DBD\MAP_PLAYERS_MAPS::QA());}
|
||||
return JsonResult::toString(\DBD\MAP_PLAYERS::QA(array($map)));}
|
||||
private static function objects($map=null,$entry=null){
|
||||
if($entry == null){
|
||||
throw new ERROR('Problem');}
|
||||
if($map == null){
|
||||
return JsonResult::toString(\DBD\MAP_OBJECTS_MAPS::QA(array($entry)));}
|
||||
return JsonResult::toString(\DBD\MAP_OBJECTS::QA(array($map,$entry)));}
|
||||
private static function creatures($map=null,$entry=null){
|
||||
if($entry == null){
|
||||
throw new ERROR('Problem');}
|
||||
if($map == null){
|
||||
return JsonResult::toString(\DBD\MAP_CREATURES_MAPS::QA(array($entry)));}
|
||||
return JsonResult::toString(\DBD\MAP_CREATURES::QA(array($map,$entry)));}
|
||||
private static function quests($map=null,$entry=null){
|
||||
}
|
||||
|
||||
public static function zone($map,$x1,$y1){
|
||||
|
||||
15
mojotrollz/api/map/qq/MAP_CREATURES.php
Normal file
15
mojotrollz/api/map/qq/MAP_CREATURES.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class MAP_CREATURES extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT guid as id,map,position_x as x,position_y as y,position_z as z,orientation as o, value as map_name FROM creature'.
|
||||
' LEFT JOIN host_mojotrollz.mojotrollz_tags_value ON host_mojotrollz.mojotrollz_tags_value.id = map'.
|
||||
' WHERE type=1 AND map=? AND creature.id=? LIMIT 100;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
15
mojotrollz/api/map/qq/MAP_CREATURES_MAPS.php
Normal file
15
mojotrollz/api/map/qq/MAP_CREATURES_MAPS.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class MAP_CREATURES_MAPS extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT map, value as map_name FROM creature'.
|
||||
' LEFT JOIN host_mojotrollz.mojotrollz_tags_value ON host_mojotrollz.mojotrollz_tags_value.id = map'.
|
||||
' WHERE type=1 AND creature.id=? GROUP BY map;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
15
mojotrollz/api/map/qq/MAP_OBJECTS.php
Normal file
15
mojotrollz/api/map/qq/MAP_OBJECTS.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class MAP_OBJECTS extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT guid as id,map,position_x as x,position_y as y,position_z as z,orientation as o, value as map_name FROM gameobject'.
|
||||
' LEFT JOIN host_mojotrollz.mojotrollz_tags_value ON id = map'.
|
||||
' WHERE type=1 AND map = ? AND entry=? LIMIT 100;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
15
mojotrollz/api/map/qq/MAP_OBJECTS_MAPS.php
Normal file
15
mojotrollz/api/map/qq/MAP_OBJECTS_MAPS.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class MAP_PLAYERS_MAPS extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT map, value as map_name FROM gameobject'.
|
||||
' LEFT JOIN host_mojotrollz.mojotrollz_tags_value ON id = map'.
|
||||
' WHERE type=1 AND creature.id=? GROUP BY map;',
|
||||
new \DBD\mangos_world()
|
||||
);}}
|
||||
|
||||
@ -1,13 +1,15 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class MAP_PLAYERS extends \SYSTEM\DB\QQ {
|
||||
class MAP_PLAYERS extends \SYSTEM\DB\QP {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT guid as id,map,position_x as x,position_y as y,position_z as z,orientation as o FROM characters WHERE map = 1;',
|
||||
'SELECT guid as id,map,position_x as x,position_y as y,position_z as z,orientation as o, value as map_name FROM characters'.
|
||||
' LEFT JOIN host_mojotrollz.mojotrollz_tags_value ON id = map'.
|
||||
' WHERE type=1 AND map = ? AND deleteInfos_Account IS NULL LIMIT 100;',
|
||||
new \DBD\mangos_chars()
|
||||
);}}
|
||||
|
||||
|
||||
15
mojotrollz/api/map/qq/MAP_PLAYERS_MAPS.php
Normal file
15
mojotrollz/api/map/qq/MAP_PLAYERS_MAPS.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace DBD;
|
||||
|
||||
class MAP_PLAYERS_MAPS extends \SYSTEM\DB\QQ {
|
||||
protected static function query(){
|
||||
return new \SYSTEM\DB\QQuery(get_class(),
|
||||
//pg
|
||||
'',
|
||||
//mys
|
||||
'SELECT map, value as map_name FROM characters'.
|
||||
' LEFT JOIN host_mojotrollz.mojotrollz_tags_value ON id = map'.
|
||||
' WHERE type=1 AND deleteInfos_Account IS NULL GROUP BY map;',
|
||||
new \DBD\mangos_chars()
|
||||
);}}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div id="map">
|
||||
<div id="map_world">
|
||||
<div id="map_positions"></div>
|
||||
<div id="map_tooltip"></div>
|
||||
<div class="tab-pane ${active}" id="tab_map_${map}">
|
||||
<div class="map" id="map_${map}" style="background-image: url(http://www.mojotrollz.eu/web/mojotrollz/api.php?call=files&cat=map&id=${map_name}.png);">
|
||||
<div class="map_positions" id="map_positions_${map}"></div>
|
||||
<div class="map_tooltips" id="map_tooltips_${map}"></div>
|
||||
</div>
|
||||
</div>
|
||||
8
mojotrollz/api/map/tpl/maps.tpl
Normal file
8
mojotrollz/api/map/tpl/maps.tpl
Normal file
@ -0,0 +1,8 @@
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs" id="tabs_maps">
|
||||
${tabs}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
${tabs_content}
|
||||
</div>
|
||||
</div>
|
||||
1
mojotrollz/api/map/tpl/maps_tab.tpl
Normal file
1
mojotrollz/api/map/tpl/maps_tab.tpl
Normal file
@ -0,0 +1 @@
|
||||
<li class="${active}"><a href="#tab_map_${map}" map="${map}">${map_name}</a></li>
|
||||
@ -6,8 +6,9 @@ function init_saimod_mojotrollz_db_creature(){
|
||||
});
|
||||
});
|
||||
$('.sai_table_row').click(function(){
|
||||
$('#content-wrapper').load(SAI_ENDPOINT + 'sai_mod=saimod_mojotrollz_db_creature&action=creature&id=' + $(this).attr('sai_table_row'),function(){
|
||||
|
||||
var entry = $(this).attr('sai_table_row');
|
||||
$('#content-wrapper').load(SAI_ENDPOINT + 'sai_mod=saimod_mojotrollz_db_creature&action=creature&id=' + entry,function(){
|
||||
map(1,entry);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ class saimod_mojotrollz_db_creature extends \SYSTEM\SAI\SaiModule {
|
||||
'\DBD\DB_CREATURE_TEMPLATE_CREATURE_AI_SCRIPTS' => array('key' => 'Entry', 'caption' => 'AI Scripts'),
|
||||
'\DBD\DB_CREATURE_TEMPLATE_CREATURE_MOVEMENT_TEMPLATE' => array('key' => 'Entry', 'caption' => 'Movement Template'),));
|
||||
|
||||
$result = '<table class="sai_table">';
|
||||
$result = map::generate(1,$id).'<table class="sai_table">';
|
||||
$base_row = \DBD\DB_CREATURE_TEMPLATE_CREATURE::Q1(array($id));
|
||||
foreach($base_row as $key=>$value){
|
||||
$result .= '<tr><td>'.$key.'</td><td>'.$value.'</td></tr>';}
|
||||
@ -153,6 +153,9 @@ class saimod_mojotrollz_db_creature extends \SYSTEM\SAI\SaiModule {
|
||||
public static function right_public(){return false;}
|
||||
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
|
||||
public static function sai_mod_saimod_mojotrollz_db_creature_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array(
|
||||
\SYSTEM\WEBPATH(new PSAI(),'saimod_mojotrollz_db_creature/saimod_mojotrollz_db_creature.js')));}
|
||||
public static function sai_mod_saimod_mojotrollz_db_creature_flag_css(){}
|
||||
\SYSTEM\WEBPATH(new PAPI(),'database/js/wow.js'),
|
||||
\SYSTEM\WEBPATH(new PAPI(),'map/js/map.js'),
|
||||
\SYSTEM\WEBPATH(new PSAI(),'saimod_mojotrollz_db_creature/saimod_mojotrollz_db_creature.js')));}
|
||||
public static function sai_mod_saimod_mojotrollz_db_creature_flag_css(){return \SYSTEM\LOG\JsonResult::toString(array(
|
||||
\SYSTEM\WEBPATH(new PAPI(),'map/css/map.css')));}
|
||||
}
|
||||
@ -1,3 +1,3 @@
|
||||
function init_saimod_mojotrollz_db_player(){
|
||||
map();
|
||||
map(6,-1);
|
||||
}
|
||||
@ -2,19 +2,20 @@
|
||||
class saimod_mojotrollz_db_player extends \SYSTEM\SAI\SaiModule {
|
||||
public static function sai_mod_saimod_mojotrollz_db_player(){
|
||||
$con = new \SYSTEM\DB\Connection(new \DBD\mangos_chars());
|
||||
$res = $con->query('SELECT * FROM characters LIMIT 100;');
|
||||
$res = $con->query('SELECT * FROM characters WHERE deleteInfos_Account IS NULL LIMIT 100;');
|
||||
$vars = array();
|
||||
$elements = '';
|
||||
while($row = $res->next()){
|
||||
$elements .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_mojotrollz_db_player/tpl/player.tpl'), $row);}
|
||||
$vars['elements'] = $elements;
|
||||
$vars['map'] = map::generate();
|
||||
$vars['map'] = map::generate(6);
|
||||
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new PSAI(),'saimod_mojotrollz_db_player/tpl/players.tpl'), $vars);
|
||||
}
|
||||
public static function html_li_menu(){return '<li><a href="#" saimenu="saimod_mojotrollz_db_player">DB:Players</a></li><li class="divider"></li>';}
|
||||
public static function right_public(){return false;}
|
||||
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
|
||||
public static function sai_mod_saimod_mojotrollz_db_player_flag_js(){return \SYSTEM\LOG\JsonResult::toString(array(
|
||||
\SYSTEM\WEBPATH(new PAPI(),'database/js/wow.js'),
|
||||
\SYSTEM\WEBPATH(new PAPI(),'map/js/map.js'),
|
||||
\SYSTEM\WEBPATH(new PSAI(),'saimod_mojotrollz_db_player/js/saimod_mojotrollz_db_player.js')
|
||||
));}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user