Skip to content

Commit

Permalink
* Guild halls system[?]
Browse files Browse the repository at this point in the history
* Fixed NPC voices
* Updated schemas, manager & recreated sqlite database


git-svn-id: file:///usr/local/src/otland/tfssvnrepo/trunk@1897 c161f52b-5830-4e7a-bee0-5dea2c17262e
  • Loading branch information
tayandenga committed May 16, 2009
1 parent 30a201a commit c65a49a
Show file tree
Hide file tree
Showing 16 changed files with 303 additions and 131 deletions.
1 change: 1 addition & 0 deletions config.lua
Expand Up @@ -118,6 +118,7 @@
housePriceAsRent = "no"
housePriceEachSquare = 1000
houseRentPeriod = "never"
guildHalls = "no"

-- Item usage
timeBetweenActions = 200
Expand Down
1 change: 1 addition & 0 deletions configmanager.cpp
Expand Up @@ -250,6 +250,7 @@ bool ConfigManager::load()
m_confNumber[DEATH_CONTAINER] = getGlobalNumber("deathContainerId", 1987);
m_confBool[PREMIUM_SKIP_WAIT] = getGlobalBool("premiumPlayerSkipWaitList", "no");
m_confNumber[MAXIMUM_DOOR_LEVEL] = getGlobalNumber("maximumDoorLevel", 500);
m_confBool[GUILD_HALLS] = getGlobalBool("guildHalls", "no");

m_loaded = true;
return true;
Expand Down
1 change: 1 addition & 0 deletions configmanager.h
Expand Up @@ -228,6 +228,7 @@ class ConfigManager
BUFFER_SPELL_FAILURE,
CONFIM_OUTDATED_VERSION,
PREMIUM_SKIP_WAIT,
GUILD_HALLS,
LAST_BOOL_CONFIG /* this must be the last one */
};

Expand Down
50 changes: 47 additions & 3 deletions databasemanager.cpp
Expand Up @@ -615,16 +615,60 @@ uint32_t DatabaseManager::updateDatabase()
case 12:
{
std::cout << "> Updating database to version: 13..." << std::endl;
switch(db->getDatabaseEngine())
{
case DATABASE_ENGINE_MYSQL:
{
std::string queryList[] = {
"ALTER TABLE `houses` ADD `doors` INT UNSIGNED NOT NULL DEFAULT 0;",
"ALTER TABLE `houses` ADD `beds` INT UNSIGNED NOT NULL DEFAULT 0;",
"ALTER TABLE `houses` ADD `guild` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE;"
};
for(uint32_t i = 0; i < sizeof(queryList) / sizeof(std::string); i++)
db->executeQuery(queryList[i]);

break;
}

case DATABASE_ENGINE_SQLITE:
{
std::string queryList[] = {
"ALTER TABLE `houses` ADD `doors` INTEGER NOT NULL DEFAULT 0;",
"ALTER TABLE `houses` ADD `beds` INTEGER NOT NULL DEFAULT 0;",
"ALTER TABLE `houses` ADD `guild` BOOLEAN NOT NULL DEFAULT FALSE;"
};
for(uint32_t i = 0; i < sizeof(queryList) / sizeof(std::string); i++)
db->executeQuery(queryList[i]);

break;
}

case DATABASE_ENGINE_POSTGRESQL:
default:
{
//TODO
break;
}
}

registerDatabaseConfig("db_version", 13);
return 13;
}

case 13:
{
std::cout << "> Updating database to version: 14..." << std::endl;
if(db->
std::string queryList[] = {
"ALTER TABLE `accounts` DROP KEY `group_id`;",
"ALTER TABLE `houses` ADD `doors` INT ;",
"ALTER TABLE `players` DROP KEY `group_id`;",
"DROP TABLE `groups`;"
};
for(uint32_t i = 0; i < sizeof(queryList) / sizeof(std::string); i++)
db->executeQuery(queryList[i]);

registerDatabaseConfig("db_version", 13);
return 13;
registerDatabaseConfig("db_version", 14);
return 14;
}

default:
Expand Down
Binary file modified forgottenserver.s3db
Binary file not shown.

0 comments on commit c65a49a

Please sign in to comment.