DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • October 16, 2018, 10:15:35 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Trouble With Pet Shop on 1.1.2  (Read 687 times)
0 Members and 1 Guest are viewing this topic.
TGTarheel
Codemeister
****
Offline Offline

Posts: 460


View Profile
« 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?
Logged
TGTarheel
Codemeister
****
Offline Offline

Posts: 460


View Profile
« Reply #1 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.
« Last Edit: January 09, 2018, 08:24:49 PM by TGTarheel » Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1745


View Profile
« Reply #2 on: January 13, 2018, 08:22:50 AM »

Try out my modified Pet Shop v4.0.1 module. Smiley
Logged

Check My Modules for the latest versions.
TGTarheel
Codemeister
****
Offline Offline

Posts: 460


View Profile
« Reply #3 on: January 13, 2018, 01:11:31 PM »

Try out my modified Pet Shop v4.0.1 module. Smiley

Thanks.
Checking it out now.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
41 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search