DragonPrime - LoGD Resource Community

Coding Support => Coding Support Desk => Topic started by: TGTarheel on January 09, 2018, 07:41:27 PM



Title: Trouble With Pet Shop on 1.1.2
Post by: TGTarheel on January 09, 2018, 07:41:27 PM
So I managed to get myself a test server, and i am slowly putting things on and fixing anything broken... So far, nothing major till now.

The Pet Shop does not work.  It did not inject the extra pets into the pets database.

It did not wrote to the database the pet when I tried to create one manually.

So i came here, and checked the original file.  There is a _macosx file, but I do not think it does anything...it is like just an extra copy of the program itself.

At any rate, I was looking for anything in the original zip that I might not have put on my own system, and I find nothing.
The pet shop shows in the village.

The pet editor shows up in the grotto

Nothing will make it add pets though.

So there are never any pets for sale.

It said, when installing, that it was creating the database table and apparently did so.  But all no avail.

I cannot seem to make pet shop run on 1.1.2 - wondering if this is a known issue with 1.1.2 or is there something else I don't seem to know about?


Title: Re: Trouble With Pet Shop on 1.1.2
Post by: TGTarheel on January 09, 2018, 07:56:14 PM
here is code for the install on the petshop.  I am suspecting it is not REALLY creating the database at all, just says it is...is there something wrong in the code here
Code:
function petshop_install(){
if (db_table_exists(db_prefix("pets"))) {
$sql = "Select petattack FROM ".db_prefix("pets")." LIMIT 1";
$result = mysql_query($sql);
   if (!$result) db_query("ALTER TABLE ".db_prefix("pets")." ADD `petattack` tinyint(3) NOT NULL default '0'");
   $sql = "Select attacktype FROM ".db_prefix("pets")." LIMIT 1";
$result = mysql_query($sql);
   if (!$result) db_query("ALTER TABLE ".db_prefix("pets")." ADD `attacktype` tinyint(3) NOT NULL default '0'");
   $sql = "Select mindamage FROM ".db_prefix("pets")." LIMIT 1";
$result = mysql_query($sql);
   if (!$result) db_query("ALTER TABLE ".db_prefix("pets")." ADD `mindamage` int(11) NOT NULL default '0'");
   $sql = "Select maxdamage FROM ".db_prefix("pets")." LIMIT 1";
$result = mysql_query($sql);
   if (!$result) db_query("ALTER TABLE ".db_prefix("pets")." ADD `maxdamage` int(11) NOT NULL default '0'");
   $sql = "Select petturns FROM ".db_prefix("pets")." LIMIT 1";
$result = mysql_query($sql);
   if (!$result) db_query("ALTER TABLE ".db_prefix("pets")." ADD `petturns` int(11) NOT NULL default '0'");

}else{
output("`6Installing the pets database now.`n");
output("`6Presto. Done.`n`n");
$sql = array(
"CREATE TABLE ".db_prefix("pets")." (petid INT(11) NOT NULL AUTO_INCREMENT ,petname VARCHAR(25) DEFAULT 'Unknown' NOT NULL ,petbreed TINYINT(3) DEFAULT '0' NOT NULL ,valuegold INT(11) DEFAULT '0' NOT NULL ,valuegems INT(11) DEFAULT '0' NOT NULL, upkeepgold INT(11) DEFAULT '0' NOT NULL ,upkeepgems INT(11) DEFAULT '0' NOT NULL ,petdk INT(11) DEFAULT '0' NOT NULL ,petcharm INT(11) DEFAULT '0' NOT NULL,petdesc VARCHAR(100) NOT NULL,newdaymsg VARCHAR(100) NOT NULL,villagemsg VARCHAR(100) NOT NULL,gardenmsg VARCHAR(100) NOT NULL,battlemsg VARCHAR(100) NOT NULL,petattack TINYINT(3) DEFAULT '0' NOT NULL, attacktype tinyint(3) default '0' NOT NULL, mindamage INT(11) DEFAULT '0' NOT NULL, maxdamage INT(11) DEFAULT '0' NOT NULL, petturns INT(11) DEFAULT '0' NOT NULL, PRIMARY KEY (petid)) TYPE = InnoDB;",
);
foreach ($sql as $statement) {
db_query($statement);
}
}
module_addhook("biostat");
module_addhook("village");
module_addhook("village-desc");
module_addhook("charstats");
module_addhook("superuser");
module_addhook("dragonkill");
module_addhook("training-victory");
module_addhook("training-defeat");
module_addhook("battle");
module_addhook("battle-victory");
module_addhook("battle-defeat");
module_addhook("fightnav-specialties");
module_addhook("apply-specialties");
module_addhook("newday");
module_addhook("changesetting");
module_addhook("forest");
module_addhook("gardens");
module_addhook("inn-desc");
return true;
}

Now obviously, on first install, it is jumping down to
Code:
}else{
output("`6Installing the pets database now.`n");
output("`6Presto. Done.`n`n");
$sql = array(
"CREATE TABLE ".db_prefix("pets")." (petid INT(11) NOT NULL AUTO_INCREMENT ,petname VARCHAR(25) DEFAULT 'Unknown' NOT NULL ,petbreed TINYINT(3) DEFAULT '0' NOT NULL ,valuegold INT(11) DEFAULT '0' NOT NULL ,valuegems INT(11) DEFAULT '0' NOT NULL, upkeepgold INT(11) DEFAULT '0' NOT NULL ,upkeepgems INT(11) DEFAULT '0' NOT NULL ,petdk INT(11) DEFAULT '0' NOT NULL ,petcharm INT(11) DEFAULT '0' NOT NULL,petdesc VARCHAR(100) NOT NULL,newdaymsg VARCHAR(100) NOT NULL,villagemsg VARCHAR(100) NOT NULL,gardenmsg VARCHAR(100) NOT NULL,battlemsg VARCHAR(100) NOT NULL,petattack TINYINT(3) DEFAULT '0' NOT NULL, attacktype tinyint(3) default '0' NOT NULL, mindamage INT(11) DEFAULT '0' NOT NULL, maxdamage INT(11) DEFAULT '0' NOT NULL, petturns INT(11) DEFAULT '0' NOT NULL, PRIMARY KEY (petid)) TYPE = InnoDB;",
);
foreach ($sql as $statement) {
db_query($statement);
}
}
module_addhook("biostat");
module_addhook("village");
module_addhook("village-desc");
module_addhook("charstats");
module_addhook("superuser");
module_addhook("dragonkill");
module_addhook("training-victory");
module_addhook("training-defeat");
module_addhook("battle");
module_addhook("battle-victory");
module_addhook("battle-defeat");
module_addhook("fightnav-specialties");
module_addhook("apply-specialties");
module_addhook("newday");
module_addhook("changesetting");
module_addhook("forest");
module_addhook("gardens");
module_addhook("inn-desc");
return true;
So whatever is wrong has to be in that section of it.


Title: Re: Trouble With Pet Shop on 1.1.2
Post by: MarcTheSlayer on January 13, 2018, 08:22:50 AM
Try out my modified Pet Shop v4.0.1 (http://dragonprime.net/index.php?topic=10079.0) module. :)


Title: Re: Trouble With Pet Shop on 1.1.2
Post by: TGTarheel on January 13, 2018, 01:11:31 PM
Try out my modified Pet Shop v4.0.1 (http://dragonprime.net/index.php?topic=10079.0) module. :)

Thanks.
Checking it out now.

© 2018 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines