*some fixes

* fixed installing samples when for example Rook Sample already exist and other samples not
* fixed some mysql error when character you trying to create already exist
* fixed signature fonts finding path
* removed DEFAULT '' for TEXT field. It didn't worked under some systems like MAC OS X.
* moved news adding at installation from schema.sql to finish.php
* removed some unused cities field from myaac_spells table
* some optimizations
This commit is contained in:
slawkens
2017-08-23 17:00:41 +02:00
parent 55e8507cac
commit 45f988c420
187 changed files with 2065 additions and 133 deletions

View File

@@ -710,16 +710,11 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa
}
else
{
echo 'Here you can see and edit the information about your character.<br/>If you do not want to specify a certain field, just leave it blank.<br/><br/><form action="?subtopic=accountmanagement&action=changecomment" method="post" ><div class="TableContainer" > <table class="Table5" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Edit Character Information</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$template_path.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr><td class="LabelV" >Name:</td><td style="width:80%;" >'.$player_name.'</td></tr><tr><td class="LabelV" >Hide Account:</td><td>';
if($player->getCustomField("hidden") == 1) {
echo '<input type="checkbox" name="accountvisible" id="accountvisible" value="1" checked="checked">';
}
else
{
echo '<input type="checkbox" name="accountvisible" id="accountvisible" value="1" >';
}
echo '<label for="accountvisible"> check to hide your account information</label>';
echo 'Here you can see and edit the information about your character.<br/>If you do not want to specify a certain field, just leave it blank.<br/><br/><form action="?subtopic=accountmanagement&action=changecomment" method="post" ><div class="TableContainer" > <table class="Table5" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Edit Character Information</div> <span class="CaptionVerticalRight" style="background-image:url('.$template_path.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$template_path.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$template_path.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$template_path.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$template_path.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr><td class="LabelV" >Name:</td><td style="width:80%;" >'.$player_name.'</td></tr><tr><td class="LabelV" >Hide Account:</td><td>
<input type="hidden" value="0" name="accountvisible">
<input type="checkbox" name="accountvisible" id="accountvisible" value="1" ' . ($player->getCustomField("hidden") == 1 ? ' checked="checked"' : '') . '>
<label for="accountvisible"> check to hide your account information</label>';
if((int)$player->getCustomField('group_id') > 1)
echo ' (you will be also hidden on the Team page!)';
@@ -1023,19 +1018,25 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa
else
$newchar_vocation = $config['character_samples'][0];
if(count($config['character_towns']) > 1)
{
if(empty($newchar_town))
if(count($config['character_towns']) > 1) {
if(!isset($newchar_town))
$newchar_errors[] = 'Please select a town for your character.';
}
else
else {
$newchar_town = $config['character_towns'][0];
}
if(empty($newchar_errors))
{
$exist = new OTS_Player();
$exist->find($newchar_name);
if($exist->isLoaded()) {
$newchar_errors[] .= 'Character with this name already exist.';
}
if(empty($newchar_errors)) {
$error = '';
if(!admin() && !check_name_new_char($newchar_name, $error))
if(!admin() && !check_name_new_char($newchar_name, $error)) {
$newchar_errors[] = $error;
}
if($newchar_sex != 1 && $newchar_sex != "0")
$newchar_errors[] = 'Sex must be equal <b>0 (female)</b> or <b>1 (male)</b>.';
if(!in_array($newchar_town, $config['character_towns']))
@@ -1074,19 +1075,19 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa
if($newchar_sex == "0")
$char_to_copy->setLookType(136);
$player = $ots->createObject('Player');
$player->setName($newchar_name);
$player->setAccount($account_logged);
//$player->setGroupId($char_to_copy->getGroup()->getId());
$player->setName($newchar_name);
$player->setAccount($account_logged);
//$player->setGroupId($char_to_copy->getGroup()->getId());
$player->setGroupId(1);
$player->setSex($newchar_sex);
$player->setVocation($char_to_copy->getVocation());
$player->setSex($newchar_sex);
$player->setVocation($char_to_copy->getVocation());
if(fieldExist('promotion', 'players'))
$player->setPromotion($char_to_copy->getPromotion());
if(fieldExist('direction', 'players'))
$player->setDirection($char_to_copy->getDirection());
$player->setConditions($char_to_copy->getConditions());
$player->setConditions($char_to_copy->getConditions());
$rank = $char_to_copy->getRank();
if($rank->isLoaded()) {
$player->setRank($char_to_copy->getRank());
@@ -1095,26 +1096,26 @@ Please enter your account name and your password.<br/><a href="?subtopic=createa
if(fieldExist('lookaddons', 'players'))
$player->setLookAddons($char_to_copy->getLookAddons());
$player->setTownId($newchar_town);
$player->setExperience($char_to_copy->getExperience());
$player->setLevel($char_to_copy->getLevel());
$player->setMagLevel($char_to_copy->getMagLevel());
$player->setHealth($char_to_copy->getHealth());
$player->setHealthMax($char_to_copy->getHealthMax());
$player->setMana($char_to_copy->getMana());
$player->setManaMax($char_to_copy->getManaMax());
$player->setManaSpent($char_to_copy->getManaSpent());
$player->setSoul($char_to_copy->getSoul());
$player->setTownId($newchar_town);
$player->setExperience($char_to_copy->getExperience());
$player->setLevel($char_to_copy->getLevel());
$player->setMagLevel($char_to_copy->getMagLevel());
$player->setHealth($char_to_copy->getHealth());
$player->setHealthMax($char_to_copy->getHealthMax());
$player->setMana($char_to_copy->getMana());
$player->setManaMax($char_to_copy->getManaMax());
$player->setManaSpent($char_to_copy->getManaSpent());
$player->setSoul($char_to_copy->getSoul());
for($skill = POT::SKILL_FIRST; $skill <= POT::SKILL_LAST; $skill++)
$player->setSkill($skill, 10);
$player->setLookBody($char_to_copy->getLookBody());
$player->setLookFeet($char_to_copy->getLookFeet());
$player->setLookHead($char_to_copy->getLookHead());
$player->setLookLegs($char_to_copy->getLookLegs());
$player->setLookType($char_to_copy->getLookType());
$player->setCap($char_to_copy->getCap());
$player->setLookBody($char_to_copy->getLookBody());
$player->setLookFeet($char_to_copy->getLookFeet());
$player->setLookHead($char_to_copy->getLookHead());
$player->setLookLegs($char_to_copy->getLookLegs());
$player->setLookType($char_to_copy->getLookType());
$player->setCap($char_to_copy->getCap());
$player->setBalance(0);
$player->setPosX(0);
$player->setPosY(0);

View File

@@ -140,7 +140,8 @@ if(isset($_POST['reload_monsters']) && $canEdit)
if(!in_array($name, $names_added)) {
try {
$db->query("INSERT INTO myaac_monsters (hide_creature, name, mana, exp, health, speed_lvl, use_haste, voices, immunities, summonable, convinceable, race, gfx_name, file_path) VALUES (0, ".$db->quote($name).", '".$mana."', '".$exp."', '".$health."', '".$speed_lvl."', '".$use_haste."', ".$db->quote($voices_string).", ".$db->quote($immunities_string).", '".$flags['summonable']."', '".$flags['convinceable']."', '".$race."', ".$db->quote($gfx_name).", " . $db->quote($allmonsters->currentFile()) . ")");
$db->query("INSERT INTO `myaac_monsters` (`hide_creature`, `name`, `mana`, `exp`, `health`, `speed_lvl`, `use_haste`, `voices`, `immunities`, `summonable`, `convinceable`, `race`, `gfx_name`, `file_path`) VALUES (0, " . $db->quote($name) . ", " . $db->quote(empty($mana) ? 0 : $mana) . ", " . $db->quote($exp) . ", " . $db->quote($health) . ", " . $db->quote($speed_lvl) . ", " . $db->quote($use_haste) . ", " . $db->quote($voices_string) . ", " . $db->quote($immunities_string) . ", " . $db->quote($flags['summonable'] > 0 ? 1 : 0) . ", " . $db->quote($flags['convinceable'] > 0 ? 1 : 0) . ", ".$db->quote($race).", ".$db->quote($gfx_name).", " . $db->quote($allmonsters->currentFile()) . ")");
success("Added: ".$name."<br/>");
}
catch(PDOException $error) {
@@ -172,25 +173,25 @@ if(empty($_REQUEST['creature']))
$desc = " DESC";
}
if($order == 'name') {
$whereandorder = ' ORDER BY name'.$desc;
$whereandorder = ' ORDER BY name'.$desc;
}
elseif($order == 'exp') {
$whereandorder = ' ORDER BY exp'.$desc.', name';
$whereandorder = ' ORDER BY exp'.$desc.', name';
}
elseif($order == 'health') {
$whereandorder = ' ORDER BY health'.$desc.', name';
$whereandorder = ' ORDER BY health'.$desc.', name';
}
elseif($order == 'summonable') {
$whereandorder = ' AND summonable = 1 ORDER BY mana'.$desc;
$whereandorder = ' AND summonable = 1 ORDER BY mana'.$desc;
}
elseif($order == 'convinceable') {
$whereandorder = ' AND convinceable = 1 ORDER BY mana'.$desc;
$whereandorder = ' AND convinceable = 1 ORDER BY mana'.$desc;
}
elseif($order == 'race') {
$whereandorder = ' ORDER BY race'.$desc.', name';
$whereandorder = ' ORDER BY race'.$desc.', name';
}
else {
$whereandorder = ' ORDER BY name';
$whereandorder = ' ORDER BY name';
}
//send query to database
$monsters = $db->query('SELECT * FROM '.$db->tableName(TABLE_PREFIX . 'monsters').' WHERE hide_creature != 1'.$whereandorder);
@@ -208,7 +209,7 @@ if(empty($_REQUEST['creature']))
if($order == 'exp' && !isset($_REQUEST['desc'])) {
echo '<TD class="white"><B><a href="?subtopic=creatures&order=exp&desc=1"><font class="white">Experience<br/>DESC</a></B></TD>';
} else {
echo '<TD class="white"><B><a href="?subtopic=creatures&order=exp"><font class="white">Experience</a></B></TD>';
echo '<TD class="white"><B><a href="?subtopic=creatures&order=exp"><font class="white">Experience</a></B></TD>';
}
if($order == 'summonable' && !isset($_REQUEST['desc'])) {
echo '<TD class="white"><B><a href="?subtopic=creatures&order=summonable&desc=1"><font class="white">Summonable<br/>Mana DESC</a></B></TD>';
@@ -329,4 +330,4 @@ else
}
//back button
echo '<br/></br><center><form action="?subtopic=creatures" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
?>
?>

View File

@@ -69,8 +69,8 @@ if(isset($_POST['reload_spells']) && $canEdit)
$type = 2;
$count = $spell->getConjureCount();
try {
$db->query("INSERT INTO myaac_spells (spell, name, words, type, mana, level, maglevel, soul, premium, vocations, conjure_count, hidden) VALUES ('".$spell_txt."', '".$name."', '".$spell_txt."', '".$type."', '".$mana."', '".$lvl."', '".$mlvl."', '".$soul."', '".$pacc."', '".$vocations_to_db."', '".$count."', '".$hide_spell."')");
success("Added: ".$name."<br>");
$db->query('INSERT INTO myaac_spells (spell, name, words, type, mana, level, maglevel, soul, premium, vocations, conjure_count, hidden) VALUES (' . $db->quote($spell_txt) . ', ' . $db-quote($name) . ', ' . $db->quote($spell_txt) , ', ' . $db->quote($type) . ', ' . $db->quote($mana) . ', ' . $db->quote($lvl) . ', ' . $db->quote($mlvl) . ', ' . $db->quote($soul) . ', ' . $db>quote($pacc) . ', ' . $db->quote($vocations_to_db) . ', ' . $db->quote($count) . ', ' . $db->quote($hide_spell) . ')');
success("Added: " . $name . "<br>");
}
catch(PDOException $error) {
warning('Error while adding spell (' . $name . '): ' . $error->getMessage());