diff --git a/sql/realmd.sql b/sql/realmd.sql index 15baf7fc5..e9d5bf478 100644 --- a/sql/realmd.sql +++ b/sql/realmd.sql @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `realmd_db_version`; CREATE TABLE `realmd_db_version` ( - `required_9746_01_realmd_realmlist` bit(1) default NULL + `required_9748_01_realmd_realmlist` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB'; -- @@ -157,7 +157,7 @@ CREATE TABLE `realmlist` ( `address` varchar(32) NOT NULL default '127.0.0.1', `port` int(11) NOT NULL default '8085', `icon` tinyint(3) unsigned NOT NULL default '0', - `realmflags` tinyint(3) unsigned NOT NULL default '0' COMMENT 'Supported masks: 0x1 (invalid, not show in realm list), 0x4 (show version and build), 0x20 (new players), 0x40 (recommended)', + `realmflags` tinyint(3) unsigned NOT NULL default '2' COMMENT 'Supported masks: 0x1 (invalid, not show in realm list), 0x2 (offline, set by mangosd), 0x4 (show version and build), 0x20 (new players), 0x40 (recommended)', `timezone` tinyint(3) unsigned NOT NULL default '0', `allowedSecurityLevel` tinyint(3) unsigned NOT NULL default '0', `population` float unsigned NOT NULL default '0', diff --git a/sql/updates/9748_01_realmd_realmlist.sql b/sql/updates/9748_01_realmd_realmlist.sql new file mode 100644 index 000000000..fc89904d1 --- /dev/null +++ b/sql/updates/9748_01_realmd_realmlist.sql @@ -0,0 +1,12 @@ +ALTER TABLE realmd_db_version CHANGE COLUMN required_9746_01_realmd_realmlist required_9748_01_realmd_realmlist bit; + +ALTER TABLE realmlist + CHANGE COLUMN realmflags realmflags tinyint(3) unsigned NOT NULL default '2' + COMMENT 'Supported masks: 0x1 (invalid, not show in realm list), 0x2 (offline, set by mangosd), 0x4 (show version and build), 0x20 (new players), 0x40 (recommended)'; + + +UPDATE realmlist + SET realmflags = realmflags & ~(0x01 | 0x04 | 0x20 | 0x40) ; + +UPDATE realmlist + SET realmflags = realmflags | 0x02; diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index d2f6af195..fd6025eb0 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -120,6 +120,7 @@ pkgdata_DATA = \ 9735_02_mangos_spell_chain.sql \ 9746_01_realmd_realmlist.sql \ 9747_01_mangos_battleground_template.sql \ + 9748_01_realmd_realmlist.sql \ README ## Additional files to include when running 'make dist' @@ -220,4 +221,5 @@ EXTRA_DIST = \ 9735_02_mangos_spell_chain.sql \ 9746_01_realmd_realmlist.sql \ 9747_01_mangos_battleground_template.sql \ + 9748_01_realmd_realmlist.sql \ README diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 678f424db..7748a73a4 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1985,7 +1985,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe spellProto->Id == 60218) // Essence of Gossamer { // Max absorb stored in 1 dummy effect - uint32 max_absorb = spellProto->CalculateSimpleValue(EFFECT_INDEX_1); + int32 max_absorb = spellProto->CalculateSimpleValue(EFFECT_INDEX_1); if (max_absorb < currentAbsorb) currentAbsorb = max_absorb; break; diff --git a/src/mangosd/Master.cpp b/src/mangosd/Master.cpp index 19c86fc4e..4bb67e2d5 100644 --- a/src/mangosd/Master.cpp +++ b/src/mangosd/Master.cpp @@ -218,7 +218,7 @@ int Master::Run() { std::string builds = AcceptableClientBuildsListStr(); loginDatabase.escape_string(builds); - loginDatabase.PExecute("UPDATE realmlist SET color = 0, population = 0, realmbuilds = '%s' WHERE id = '%d'", builds.c_str(), realmID); + loginDatabase.PExecute("UPDATE realmlist SET realmflags = realmflags & ~(%u), population = 0, realmbuilds = '%s' WHERE id = '%d'", REALM_FLAG_OFFLINE, builds.c_str(), realmID); } ACE_Based::Thread* cliThread = NULL; @@ -337,7 +337,7 @@ int Master::Run() } ///- Set server offline in realmlist - loginDatabase.PExecute("UPDATE realmlist SET color = 2 WHERE id = '%d'",realmID); + loginDatabase.PExecute("UPDATE realmlist SET realmflags = realmflags | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID); ///- Remove signal handling before leaving _UnhookSignals(); diff --git a/src/realmd/RealmList.cpp b/src/realmd/RealmList.cpp index 3e6bb3c52..e3318f444 100644 --- a/src/realmd/RealmList.cpp +++ b/src/realmd/RealmList.cpp @@ -82,8 +82,6 @@ void RealmList::Initialize(uint32 updateInterval) void RealmList::UpdateRealm( uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags realmflags, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, const char* builds) { - realmflags = RealmFlags(realmflags | REALM_FLAG_SPECIFYBUILD); - ///- Create new if not exist or update existed Realm& realm = m_realms[name]; @@ -92,7 +90,7 @@ void RealmList::UpdateRealm( uint32 ID, const std::string& name, const std::stri realm.realmflags = realmflags; realm.timezone = timezone; realm.allowedSecurityLevel = allowedSecurityLevel; - realm.populationLevel = popu; + realm.populationLevel = popu; Tokens tokens = StrSplit(builds, " "); Tokens::iterator iter; @@ -155,10 +153,10 @@ void RealmList::UpdateRealms(bool init) uint8 realmflags = fields[5].GetUInt8(); - if (realmflags & ~(REALM_FLAG_NEW_PLAYERS|REALM_FLAG_RECOMMENDED|REALM_FLAG_SPECIFYBUILD)) + if (realmflags & ~(REALM_FLAG_OFFLINE|REALM_FLAG_NEW_PLAYERS|REALM_FLAG_RECOMMENDED|REALM_FLAG_SPECIFYBUILD)) { - sLog.outError("Realm allowed have only NEWPLAYERS (mask 0x20), or RECOMENDED (mask 0x40), or SPECIFICBUILD (mask 0x04) flags in DB"); - realmflags &= (REALM_FLAG_NEW_PLAYERS|REALM_FLAG_RECOMMENDED|REALM_FLAG_SPECIFYBUILD); + sLog.outError("Realm allowed have only OFFLINE Mask 0x2), or NEWPLAYERS (mask 0x20), or RECOMENDED (mask 0x40), or SPECIFICBUILD (mask 0x04) flags in DB"); + realmflags &= (REALM_FLAG_OFFLINE|REALM_FLAG_NEW_PLAYERS|REALM_FLAG_RECOMMENDED|REALM_FLAG_SPECIFYBUILD); } UpdateRealm( diff --git a/src/realmd/RealmList.h b/src/realmd/RealmList.h index fb79b92fb..dab01f794 100644 --- a/src/realmd/RealmList.h +++ b/src/realmd/RealmList.h @@ -25,19 +25,6 @@ #include "Common.h" -enum RealmFlags -{ - REALM_FLAG_NONE = 0x00, - REALM_FLAG_INVALID = 0x01, - REALM_FLAG_OFFLINE = 0x02, - REALM_FLAG_SPECIFYBUILD = 0x04, // client will show realm version in RealmList screen in form "RealmName (major.minor.revision.build)" - REALM_FLAG_UNK1 = 0x08, - REALM_FLAG_UNK2 = 0x10, - REALM_FLAG_NEW_PLAYERS = 0x20, - REALM_FLAG_RECOMMENDED = 0x40, - REALM_FLAG_FULL = 0x80 -}; - struct RealmBuildInfo { int build; diff --git a/src/shared/Common.h b/src/shared/Common.h index 2e88513f5..91032c807 100644 --- a/src/shared/Common.h +++ b/src/shared/Common.h @@ -179,6 +179,20 @@ enum AccountTypes SEC_CONSOLE = 4 // must be always last in list, accounts must have less security level always also }; +// Used in mangosd/realmd +enum RealmFlags +{ + REALM_FLAG_NONE = 0x00, + REALM_FLAG_INVALID = 0x01, + REALM_FLAG_OFFLINE = 0x02, + REALM_FLAG_SPECIFYBUILD = 0x04, // client will show realm version in RealmList screen in form "RealmName (major.minor.revision.build)" + REALM_FLAG_UNK1 = 0x08, + REALM_FLAG_UNK2 = 0x10, + REALM_FLAG_NEW_PLAYERS = 0x20, + REALM_FLAG_RECOMMENDED = 0x40, + REALM_FLAG_FULL = 0x80 +}; + enum LocaleConstant { LOCALE_enUS = 0, // also enGB diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e74155731..f40395df2 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9747" + #define REVISION_NR "9748" #endif // __REVISION_NR_H__ diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index 61713e720..c2d13a695 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -2,5 +2,5 @@ #define __REVISION_SQL_H__ #define REVISION_DB_CHARACTERS "required_9702_01_characters_item" #define REVISION_DB_MANGOS "required_9747_01_mangos_battleground_template" - #define REVISION_DB_REALMD "required_9746_01_realmd_realmlist" + #define REVISION_DB_REALMD "required_9748_01_realmd_realmlist" #endif // __REVISION_SQL_H__