mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[8364] Implement possibility reset client cache data from server side.
Implemented 2 way set cache data "version":
* New db_version.cache_id field let set cache data version by DB content creators.
This can be used for content releases by seting some unique value at each release.
This value used by default.
* New mangosd.conf config option let set (overwrite DB value) or use 0 for ignore.
This can be used by serever admin for reset cache at some local changes.
Note: values use at client login and then must be unique for long period time to avoid ignored
at login some long not connected client with old same cache version value.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
fdfc235faa
commit
4aee78d2fb
7 changed files with 35 additions and 4 deletions
|
|
@ -23,7 +23,8 @@ DROP TABLE IF EXISTS `db_version`;
|
|||
CREATE TABLE `db_version` (
|
||||
`version` varchar(120) default NULL,
|
||||
`creature_ai_version` varchar(120) default NULL,
|
||||
`required_8361_01_mangos_spell_bonus_data` bit(1) default NULL
|
||||
`cache_id` int(10) default '0',
|
||||
`required_8364_01_mangos_db_version` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||
|
||||
--
|
||||
|
|
|
|||
4
sql/updates/8364_01_mangos_db_version.sql
Normal file
4
sql/updates/8364_01_mangos_db_version.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
ALTER TABLE db_version CHANGE COLUMN required_8361_01_mangos_spell_bonus_data required_8364_01_mangos_db_version bit;
|
||||
|
||||
ALTER TABLE db_version
|
||||
ADD COLUMN cache_id int(10) default '0' AFTER creature_ai_version;
|
||||
|
|
@ -81,6 +81,7 @@ pkgdata_DATA = \
|
|||
8339_02_characters_character_battleground_data.sql \
|
||||
8342_01_mangos_spell_proc_event.sql \
|
||||
8361_01_mangos_spell_bonus_data.sql \
|
||||
8364_01_mangos_db_version.sql \
|
||||
README
|
||||
|
||||
## Additional files to include when running 'make dist'
|
||||
|
|
@ -142,4 +143,5 @@ EXTRA_DIST = \
|
|||
8339_02_characters_character_battleground_data.sql \
|
||||
8342_01_mangos_spell_proc_event.sql \
|
||||
8361_01_mangos_spell_bonus_data.sql \
|
||||
8364_01_mangos_db_version.sql \
|
||||
README
|
||||
|
|
|
|||
|
|
@ -237,6 +237,11 @@ World::AddSession_ (WorldSession* s)
|
|||
s->SendPacket (&packet);
|
||||
|
||||
s->SendAddonsInfo();
|
||||
|
||||
WorldPacket pkt(SMSG_CLIENTCACHE_VERSION, 4);
|
||||
pkt << uint32(sWorld.getConfig(CONFIG_CLIENTCACHE_VERSION));
|
||||
s->SendPacket(&pkt);
|
||||
|
||||
s->SendTutorialsData();
|
||||
|
||||
UpdateMaxSessionCounters ();
|
||||
|
|
@ -867,7 +872,7 @@ void World::LoadConfigSettings(bool reload)
|
|||
m_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfig.GetIntDefault("MaxOverspeedPings",2);
|
||||
if(m_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && m_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2)
|
||||
{
|
||||
sLog.outError("MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check. Set to 2.",m_configs[CONFIG_MAX_OVERSPEED_PINGS]);
|
||||
sLog.outError("MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check). Set to 2.",m_configs[CONFIG_MAX_OVERSPEED_PINGS]);
|
||||
m_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2;
|
||||
}
|
||||
|
||||
|
|
@ -954,6 +959,15 @@ void World::LoadConfigSettings(bool reload)
|
|||
|
||||
m_configs[CONFIG_OFFHAND_CHECK_AT_TALENTS_RESET] = sConfig.GetBoolDefault("OffhandCheckAtTalentsReset", false);
|
||||
|
||||
if(int clientCacheId = sConfig.GetIntDefault("ClientCacheVersion", 0))
|
||||
{
|
||||
// overwrite DB/old value
|
||||
if(clientCacheId > 0)
|
||||
m_configs[CONFIG_CLIENTCACHE_VERSION] = clientCacheId;
|
||||
else
|
||||
sLog.outError("ClientCacheVersion can't be negative %d, ignored.", clientCacheId);
|
||||
}
|
||||
|
||||
m_configs[CONFIG_INSTANT_LOGOUT] = sConfig.GetIntDefault("InstantLogout", SEC_MODERATOR);
|
||||
|
||||
m_VisibleUnitGreyDistance = sConfig.GetFloatDefault("Visibility.Distance.Grey.Unit", 1);
|
||||
|
|
@ -2115,13 +2129,16 @@ void World::UpdateMaxSessionCounters()
|
|||
|
||||
void World::LoadDBVersion()
|
||||
{
|
||||
QueryResult* result = WorldDatabase.Query("SELECT version, creature_ai_version FROM db_version LIMIT 1");
|
||||
QueryResult* result = WorldDatabase.Query("SELECT version, creature_ai_version, cache_id FROM db_version LIMIT 1");
|
||||
if(result)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
m_DBVersion = fields[0].GetCppString();
|
||||
m_CreatureEventAIVersion = fields[1].GetCppString();
|
||||
|
||||
// will be overwrite by config values if different and non-0
|
||||
m_configs[CONFIG_CLIENTCACHE_VERSION] = fields[2].GetUInt32();
|
||||
delete result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ enum WorldConfigs
|
|||
CONFIG_ARENA_SEASON_ID,
|
||||
CONFIG_ARENA_SEASON_IN_PROGRESS,
|
||||
CONFIG_OFFHAND_CHECK_AT_TALENTS_RESET,
|
||||
CONFIG_CLIENTCACHE_VERSION,
|
||||
CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -569,6 +569,11 @@ LogColors = ""
|
|||
# Default: 0 - recheck offhand slot weapon only at zone update
|
||||
# 1 - recheck offhand slot weapon at talent reset also
|
||||
#
|
||||
#
|
||||
# ClientCacheVersion
|
||||
# Client resets cache if WDB files' version is not equal to this value.
|
||||
# Default: 0 (no real meaning)
|
||||
#
|
||||
# Event.Announce
|
||||
# Default: 0 (false)
|
||||
# 1 (true)
|
||||
|
|
@ -627,6 +632,7 @@ MailDeliveryDelay = 3600
|
|||
SkillChance.Prospecting = 0
|
||||
SkillChance.Milling = 0
|
||||
OffhandCheckAtTalentsReset = 0
|
||||
ClientCacheVersion = 0
|
||||
Event.Announce = 0
|
||||
BeepAtStart = 1
|
||||
Motd = "Welcome to the Massive Network Game Object Server."
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8363"
|
||||
#define REVISION_NR "8364"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue