• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Houses wont appear in database

GM Venom

Active Member
Joined
Jan 28, 2013
Messages
145
Reaction score
28
Hello.

My world-house.xml works perfectly fine.
The house pallette in map editor works perfectly and in-game i can see all the house names + owner.

I can set owner in-game, but when i restart the house is owned by Nobody.

The "houses" table in mysql database is empty which means that it doesnt load in the house file at startup.


Anyone know what the problem can be?


Please help me!
 
check your config file, check your map editor settings (if it is bind with house.xml file, sometimes they show up houses even they didnt load xml)
did you edit source? which server version do you use?
custom map or offical one?
 
check your config file, check your map editor settings (if it is bind with house.xml file, sometimes they show up houses even they didnt load xml)
did you edit source? which server version do you use?
custom map or offical one?

I can't set a house.xml path ... only a map path and data-dir path.
I am using Avesta and its a rl map
 
do me a favor, rename the house file to anyother name, and start the server again, take a look at console if it gives a error (Could not load houses...)
and then rename it back to what it was and take a look if it still gives that error, it shouldnt give a error now, please reply after u tested..
 
do me a favor, rename the house file to anyother name, and start the server again, take a look at console if it gives a error (Could not load houses...)
and then rename it back to what it was and take a look if it still gives that error, it shouldnt give a error now, please reply after u tested..

Its saying failed to load external entity data/world/world-house.xml
warning could not load house data.

EDIT: when i added the house file back, i dont get any errors
 
Do you have sources?
check this in your source:
Code:
bool IOMapSerialize::saveHouseInfo(Map* map)
{
   Database* db = Database::getInstance();
   DBQuery query;
   DBTransaction transaction(db);

   if(!transaction.begin())
     return false;

   if(!db->executeQuery("DELETE FROM `houses`")){
     return false;
   }

   DBInsert stmt(db);

   stmt.setQuery("INSERT INTO `houses` (`id`, `owner`, `paid`, `warnings`, `lastwarning`, `name`, `town`, `size`, `rent`) VALUES ");

   for(HouseMap::iterator it = Houses::getInstance().getHouseBegin(); it != Houses::getInstance().getHouseEnd(); ++it){
     House* house = it->second;

     query << house->getHouseId() << ", " << house->getHouseOwner() << ", "
     << house->getPaidUntil() << ", " << house->getPayRentWarnings() << ", " << house->getLastWarning() << ", " << db->escapeString(house->getName()) << ", " << house->getTownId() << ", " << house->getHouseTileSize() << ", " << house->getRent();

     if(!stmt.addRow(query)){
       return false;
     }
   }

   if(!stmt.execute()){
     return false;
   }

   stmt.setQuery("INSERT INTO `house_lists` (`house_id`, `listid`, `list`) VALUES ");

   for(HouseMap::iterator it = Houses::getInstance().getHouseBegin(); it != Houses::getInstance().getHouseEnd(); ++it){
     House* house = it->second;

     std::string listText;
     if(house->getAccessList(GUEST_LIST, listText) && listText != ""){
       query << house->getHouseId() << ", " << GUEST_LIST << ", " << db->escapeString(listText);

       if(!stmt.addRow(query)){
         return false;
       }
     }
     if(house->getAccessList(SUBOWNER_LIST, listText) && listText != ""){
       query << house->getHouseId() << ", " << SUBOWNER_LIST << ", " << db->escapeString(listText);

       if(!stmt.addRow(query)){
         return false;
       }
     }

     for(HouseDoorList::iterator it = house->getHouseDoorBegin(); it != house->getHouseDoorEnd(); ++it){
       const Door* door = *it;
       if(door->getAccessList(listText) && listText != ""){
         query << house->getHouseId() << ", " << door->getDoorId() << ", " << db->escapeString(listText);

         if(!stmt.addRow(query)){
           return false;
         }
       }
     }
   }

   if(!stmt.execute()){
     return false;
   }

   return transaction.commit();
}

may look different its from my source, edited it..
 
Do you have sources?
check this in your source:
Code:
bool IOMapSerialize::saveHouseInfo(Map* map)
{
   Database* db = Database::getInstance();
   DBQuery query;
   DBTransaction transaction(db);

   if(!transaction.begin())
     return false;

   if(!db->executeQuery("DELETE FROM `houses`")){
     return false;
   }

   DBInsert stmt(db);

   stmt.setQuery("INSERT INTO `houses` (`id`, `owner`, `paid`, `warnings`, `lastwarning`, `name`, `town`, `size`, `rent`) VALUES ");

   for(HouseMap::iterator it = Houses::getInstance().getHouseBegin(); it != Houses::getInstance().getHouseEnd(); ++it){
     House* house = it->second;

     query << house->getHouseId() << ", " << house->getHouseOwner() << ", "
     << house->getPaidUntil() << ", " << house->getPayRentWarnings() << ", " << house->getLastWarning() << ", " << db->escapeString(house->getName()) << ", " << house->getTownId() << ", " << house->getHouseTileSize() << ", " << house->getRent();

     if(!stmt.addRow(query)){
       return false;
     }
   }

   if(!stmt.execute()){
     return false;
   }

   stmt.setQuery("INSERT INTO `house_lists` (`house_id`, `listid`, `list`) VALUES ");

   for(HouseMap::iterator it = Houses::getInstance().getHouseBegin(); it != Houses::getInstance().getHouseEnd(); ++it){
     House* house = it->second;

     std::string listText;
     if(house->getAccessList(GUEST_LIST, listText) && listText != ""){
       query << house->getHouseId() << ", " << GUEST_LIST << ", " << db->escapeString(listText);

       if(!stmt.addRow(query)){
         return false;
       }
     }
     if(house->getAccessList(SUBOWNER_LIST, listText) && listText != ""){
       query << house->getHouseId() << ", " << SUBOWNER_LIST << ", " << db->escapeString(listText);

       if(!stmt.addRow(query)){
         return false;
       }
     }

     for(HouseDoorList::iterator it = house->getHouseDoorBegin(); it != house->getHouseDoorEnd(); ++it){
       const Door* door = *it;
       if(door->getAccessList(listText) && listText != ""){
         query << house->getHouseId() << ", " << door->getDoorId() << ", " << db->escapeString(listText);

         if(!stmt.addRow(query)){
           return false;
         }
       }
     }
   }

   if(!stmt.execute()){
     return false;
   }

   return transaction.commit();
}

may look different its from my source, edited it..


i dont have sources.
can you tell me every code that is house related in your config.lua?

is there a string for setting house.xml file direction or something? idk
 
Back
Top