mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Merge remote branch 'origin/master' into 330
This commit is contained in:
commit
7b1e8cae76
13 changed files with 80 additions and 44 deletions
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
DROP TABLE IF EXISTS `character_db_version`;
|
||||
CREATE TABLE `character_db_version` (
|
||||
`required_9630_01_characters_characters` bit(1) default NULL
|
||||
`required_9632_01_characters_characters` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
||||
|
||||
--
|
||||
|
|
@ -254,6 +254,7 @@ CREATE TABLE `characters` (
|
|||
`exploredZones` longtext,
|
||||
`equipmentCache` longtext,
|
||||
`ammoId` int(10) UNSIGNED NOT NULL default '0',
|
||||
`knownTitles` longtext,
|
||||
PRIMARY KEY (`guid`),
|
||||
KEY `idx_account` (`account`),
|
||||
KEY `idx_online` (`online`),
|
||||
|
|
|
|||
9
sql/updates/9632_01_characters_characters.sql
Normal file
9
sql/updates/9632_01_characters_characters.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
ALTER TABLE character_db_version CHANGE COLUMN required_9630_01_characters_characters required_9632_01_characters_characters bit;
|
||||
|
||||
ALTER TABLE characters
|
||||
ADD COLUMN `knownTitles` longtext AFTER ammoId;
|
||||
|
||||
UPDATE characters, data_backup
|
||||
SET characters.knownTitles = SUBSTRING(data_backup.data,
|
||||
length(SUBSTRING_INDEX(data_backup.data, ' ', 626))+2,
|
||||
length(SUBSTRING_INDEX(data_backup.data, ' ', 631+1))- length(SUBSTRING_INDEX(data_backup.data, ' ', 626)) - 1);
|
||||
|
|
@ -92,6 +92,7 @@ pkgdata_DATA = \
|
|||
9611_01_characters.sql \
|
||||
9622_01_mangos_gameobject.sql \
|
||||
9630_01_characters_characters.sql \
|
||||
9632_01_characters_characters.sql \
|
||||
README
|
||||
|
||||
## Additional files to include when running 'make dist'
|
||||
|
|
@ -164,4 +165,5 @@ EXTRA_DIST = \
|
|||
9611_01_characters.sql \
|
||||
9622_01_mangos_gameobject.sql \
|
||||
9630_01_characters_characters.sql \
|
||||
9632_01_characters_characters.sql \
|
||||
README
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ bool LoginQueryHolder::Initialize()
|
|||
"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost,"
|
||||
"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty,"
|
||||
"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk,"
|
||||
"health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
"health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGROUP, "SELECT groupId FROM group_member WHERE memberGuid ='%u'", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include "SharedDefines.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
static eConfigFLoatValues const qualityToRate[MAX_ITEM_QUALITY] = {
|
||||
static eConfigFloatValues const qualityToRate[MAX_ITEM_QUALITY] = {
|
||||
CONFIG_FLOAT_RATE_DROP_ITEM_POOR, // ITEM_QUALITY_POOR
|
||||
CONFIG_FLOAT_RATE_DROP_ITEM_NORMAL, // ITEM_QUALITY_NORMAL
|
||||
CONFIG_FLOAT_RATE_DROP_ITEM_UNCOMMON, // ITEM_QUALITY_UNCOMMON
|
||||
|
|
|
|||
|
|
@ -14685,7 +14685,7 @@ void Player::_LoadExploredZones(const char* data)
|
|||
{
|
||||
if(!data)
|
||||
return;
|
||||
|
||||
|
||||
Tokens tokens = StrSplit(data, " ");
|
||||
|
||||
if(tokens.size() != 128)
|
||||
|
|
@ -14699,6 +14699,24 @@ void Player::_LoadExploredZones(const char* data)
|
|||
}
|
||||
}
|
||||
|
||||
void Player::_LoadKnownTitles(const char* data)
|
||||
{
|
||||
if(!data)
|
||||
return;
|
||||
|
||||
Tokens tokens = StrSplit(data, " ");
|
||||
|
||||
if(tokens.size() != 6)
|
||||
return;
|
||||
|
||||
Tokens::iterator iter;
|
||||
int index;
|
||||
for (iter = tokens.begin(), index = 0; index < 6; ++iter, ++index)
|
||||
{
|
||||
m_uint32Values[PLAYER__FIELD_KNOWN_TITLES + index] = atol((*iter).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11
|
||||
|
|
@ -14709,8 +14727,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
//"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty,"
|
||||
// 39 40 41 42 43 44 45 46 47 48 49
|
||||
//"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk,"
|
||||
// 50 51 52 53 54 55 56 57 58 59 60 61 62
|
||||
//"health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
// 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
||||
//"health, power1, power2, power3, power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
QueryResult *result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM);
|
||||
|
||||
if(!result)
|
||||
|
|
@ -14759,6 +14777,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
SetUInt32Value(PLAYER_XP, fields[7].GetUInt32());
|
||||
|
||||
_LoadExploredZones(fields[60].GetString());
|
||||
_LoadKnownTitles(fields[63].GetString());
|
||||
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE);
|
||||
SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f);
|
||||
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
|
||||
|
|
@ -16276,7 +16295,7 @@ void Player::SaveToDB()
|
|||
"trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, "
|
||||
"death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, "
|
||||
"todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, "
|
||||
"power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId) VALUES ("
|
||||
"power4, power5, power6, power7, specCount, activeSpec, exploredZones, equipmentCache, ammoId, knownTitles) VALUES ("
|
||||
<< GetGUIDLow() << ", "
|
||||
<< GetSession()->GetAccountId() << ", '"
|
||||
<< sql_name << "', "
|
||||
|
|
@ -16391,8 +16410,12 @@ void Player::SaveToDB()
|
|||
}
|
||||
|
||||
ss << "',";
|
||||
ss << GetUInt32Value(PLAYER_AMMO_ID);
|
||||
ss << ")";
|
||||
ss << GetUInt32Value(PLAYER_AMMO_ID) << ", '";
|
||||
for(uint32 i = 0; i < 6; ++i )
|
||||
{
|
||||
ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i) << " ";
|
||||
}
|
||||
ss << "')";
|
||||
|
||||
CharacterDatabase.Execute( ss.str().c_str() );
|
||||
|
||||
|
|
|
|||
|
|
@ -2326,6 +2326,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
void _LoadBGData(QueryResult* result);
|
||||
void _LoadGlyphs(QueryResult *result);
|
||||
void _LoadExploredZones(const char* data);
|
||||
void _LoadKnownTitles(const char* data);
|
||||
|
||||
/*********************************************************/
|
||||
/*** SAVE SYSTEM ***/
|
||||
|
|
|
|||
|
|
@ -1961,7 +1961,7 @@ void World::LoadDBVersion()
|
|||
m_CreatureEventAIVersion = "Unknown creature EventAI.";
|
||||
}
|
||||
|
||||
void World::setConfig(eConfigUint32Values index, char const* fieldname, uint32 defvalue)
|
||||
void World::setConfig(eConfigUInt32Values index, char const* fieldname, uint32 defvalue)
|
||||
{
|
||||
setConfig(index, sConfig.GetIntDefault(fieldname,defvalue));
|
||||
}
|
||||
|
|
@ -1971,7 +1971,7 @@ void World::setConfig(eConfigInt32Values index, char const* fieldname, int32 def
|
|||
setConfig(index, sConfig.GetIntDefault(fieldname,defvalue));
|
||||
}
|
||||
|
||||
void World::setConfig(eConfigFLoatValues index, char const* fieldname, float defvalue)
|
||||
void World::setConfig(eConfigFloatValues index, char const* fieldname, float defvalue)
|
||||
{
|
||||
setConfig(index, sConfig.GetFloatDefault(fieldname,defvalue));
|
||||
}
|
||||
|
|
@ -1981,7 +1981,7 @@ void World::setConfig( eConfigBoolValues index, char const* fieldname, bool defv
|
|||
setConfig(index, sConfig.GetBoolDefault(fieldname,defvalue));
|
||||
}
|
||||
|
||||
void World::setConfigPos(eConfigUint32Values index, char const* fieldname, uint32 defvalue)
|
||||
void World::setConfigPos(eConfigUInt32Values index, char const* fieldname, uint32 defvalue)
|
||||
{
|
||||
setConfig(index, fieldname, defvalue);
|
||||
if (int32(getConfig(index)) < 0)
|
||||
|
|
@ -1991,7 +1991,7 @@ void World::setConfigPos(eConfigUint32Values index, char const* fieldname, uint3
|
|||
}
|
||||
}
|
||||
|
||||
void World::setConfigPos(eConfigFLoatValues index, char const* fieldname, float defvalue)
|
||||
void World::setConfigPos(eConfigFloatValues index, char const* fieldname, float defvalue)
|
||||
{
|
||||
setConfig(index, fieldname, defvalue);
|
||||
if (getConfig(index) < 0.0f)
|
||||
|
|
@ -2001,7 +2001,7 @@ void World::setConfigPos(eConfigFLoatValues index, char const* fieldname, float
|
|||
}
|
||||
}
|
||||
|
||||
void World::setConfigMin(eConfigUint32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue)
|
||||
void World::setConfigMin(eConfigUInt32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue)
|
||||
{
|
||||
setConfig(index, fieldname, defvalue);
|
||||
if (getConfig(index) < minvalue)
|
||||
|
|
@ -2021,7 +2021,7 @@ void World::setConfigMin(eConfigInt32Values index, char const* fieldname, int32
|
|||
}
|
||||
}
|
||||
|
||||
void World::setConfigMin(eConfigFLoatValues index, char const* fieldname, float defvalue, float minvalue)
|
||||
void World::setConfigMin(eConfigFloatValues index, char const* fieldname, float defvalue, float minvalue)
|
||||
{
|
||||
setConfig(index, fieldname, defvalue);
|
||||
if (getConfig(index) < minvalue)
|
||||
|
|
@ -2031,7 +2031,7 @@ void World::setConfigMin(eConfigFLoatValues index, char const* fieldname, float
|
|||
}
|
||||
}
|
||||
|
||||
void World::setConfigMinMax(eConfigUint32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue, uint32 maxvalue)
|
||||
void World::setConfigMinMax(eConfigUInt32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue, uint32 maxvalue)
|
||||
{
|
||||
setConfig(index, fieldname, defvalue);
|
||||
if (getConfig(index) < minvalue)
|
||||
|
|
@ -2061,7 +2061,7 @@ void World::setConfigMinMax(eConfigInt32Values index, char const* fieldname, int
|
|||
}
|
||||
}
|
||||
|
||||
void World::setConfigMinMax(eConfigFLoatValues index, char const* fieldname, float defvalue, float minvalue, float maxvalue)
|
||||
void World::setConfigMinMax(eConfigFloatValues index, char const* fieldname, float defvalue, float minvalue, float maxvalue)
|
||||
{
|
||||
setConfig(index, fieldname, defvalue);
|
||||
if (getConfig(index) < minvalue)
|
||||
|
|
@ -2076,7 +2076,7 @@ void World::setConfigMinMax(eConfigFLoatValues index, char const* fieldname, flo
|
|||
}
|
||||
}
|
||||
|
||||
bool World::configNoReload(bool reload, eConfigUint32Values index, char const* fieldname, uint32 defvalue)
|
||||
bool World::configNoReload(bool reload, eConfigUInt32Values index, char const* fieldname, uint32 defvalue)
|
||||
{
|
||||
if (!reload)
|
||||
return true;
|
||||
|
|
@ -2100,7 +2100,7 @@ bool World::configNoReload(bool reload, eConfigInt32Values index, char const* fi
|
|||
return false;
|
||||
}
|
||||
|
||||
bool World::configNoReload(bool reload, eConfigFLoatValues index, char const* fieldname, float defvalue)
|
||||
bool World::configNoReload(bool reload, eConfigFloatValues index, char const* fieldname, float defvalue)
|
||||
{
|
||||
if (!reload)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ enum WorldTimers
|
|||
};
|
||||
|
||||
/// Configuration elements
|
||||
enum eConfigUint32Values
|
||||
enum eConfigUInt32Values
|
||||
{
|
||||
CONFIG_UINT32_COMPRESSION = 0,
|
||||
CONFIG_UINT32_INTERVAL_SAVE,
|
||||
|
|
@ -184,7 +184,7 @@ enum eConfigInt32Values
|
|||
};
|
||||
|
||||
/// Server config
|
||||
enum eConfigFLoatValues
|
||||
enum eConfigFloatValues
|
||||
{
|
||||
CONFIG_FLOAT_RATE_HEALTH = 0,
|
||||
CONFIG_FLOAT_RATE_POWER_MANA,
|
||||
|
|
@ -491,15 +491,15 @@ class World
|
|||
|
||||
void UpdateSessions( uint32 diff );
|
||||
|
||||
/// et a server configuration element (see #eConfigFLoatValues)
|
||||
void setConfig(eConfigFLoatValues index,float value) { m_configFloatValues[index]=value; }
|
||||
/// Get a server configuration element (see #eConfigFLoatValues)
|
||||
float getConfig(eConfigFLoatValues rate) const { return m_configFloatValues[rate]; }
|
||||
/// et a server configuration element (see #eConfigFloatValues)
|
||||
void setConfig(eConfigFloatValues index,float value) { m_configFloatValues[index]=value; }
|
||||
/// Get a server configuration element (see #eConfigFloatValues)
|
||||
float getConfig(eConfigFloatValues rate) const { return m_configFloatValues[rate]; }
|
||||
|
||||
/// Set a server configuration element (see #eConfigUint32Values)
|
||||
void setConfig(eConfigUint32Values index, uint32 value) { m_configUint32Values[index]=value; }
|
||||
/// Get a server configuration element (see #eConfigUint32Values)
|
||||
uint32 getConfig(eConfigUint32Values index) const { return m_configUint32Values[index]; }
|
||||
/// Set a server configuration element (see #eConfigUInt32Values)
|
||||
void setConfig(eConfigUInt32Values index, uint32 value) { m_configUint32Values[index]=value; }
|
||||
/// Get a server configuration element (see #eConfigUInt32Values)
|
||||
uint32 getConfig(eConfigUInt32Values index) const { return m_configUint32Values[index]; }
|
||||
|
||||
/// Set a server configuration element (see #eConfigInt32Values)
|
||||
void setConfig(eConfigInt32Values index, int32 value) { m_configInt32Values[index]=value; }
|
||||
|
|
@ -562,21 +562,21 @@ class World
|
|||
void InitDailyQuestResetTime();
|
||||
void ResetDailyQuests();
|
||||
private:
|
||||
void setConfig(eConfigUint32Values index, char const* fieldname, uint32 defvalue);
|
||||
void setConfig(eConfigUInt32Values index, char const* fieldname, uint32 defvalue);
|
||||
void setConfig(eConfigInt32Values index, char const* fieldname, int32 defvalue);
|
||||
void setConfig(eConfigFLoatValues index, char const* fieldname, float defvalue);
|
||||
void setConfig(eConfigFloatValues index, char const* fieldname, float defvalue);
|
||||
void setConfig(eConfigBoolValues index, char const* fieldname, bool defvalue);
|
||||
void setConfigPos(eConfigUint32Values index, char const* fieldname, uint32 defvalue);
|
||||
void setConfigPos(eConfigFLoatValues index, char const* fieldname, float defvalue);
|
||||
void setConfigMin(eConfigUint32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue);
|
||||
void setConfigPos(eConfigUInt32Values index, char const* fieldname, uint32 defvalue);
|
||||
void setConfigPos(eConfigFloatValues index, char const* fieldname, float defvalue);
|
||||
void setConfigMin(eConfigUInt32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue);
|
||||
void setConfigMin(eConfigInt32Values index, char const* fieldname, int32 defvalue, int32 minvalue);
|
||||
void setConfigMin(eConfigFLoatValues index, char const* fieldname, float defvalue, float minvalue);
|
||||
void setConfigMinMax(eConfigUint32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue, uint32 maxvalue);
|
||||
void setConfigMin(eConfigFloatValues index, char const* fieldname, float defvalue, float minvalue);
|
||||
void setConfigMinMax(eConfigUInt32Values index, char const* fieldname, uint32 defvalue, uint32 minvalue, uint32 maxvalue);
|
||||
void setConfigMinMax(eConfigInt32Values index, char const* fieldname, int32 defvalue, int32 minvalue, int32 maxvalue);
|
||||
void setConfigMinMax(eConfigFLoatValues index, char const* fieldname, float defvalue, float minvalue, float maxvalue);
|
||||
bool configNoReload(bool reload, eConfigUint32Values index, char const* fieldname, uint32 defvalue);
|
||||
void setConfigMinMax(eConfigFloatValues index, char const* fieldname, float defvalue, float minvalue, float maxvalue);
|
||||
bool configNoReload(bool reload, eConfigUInt32Values index, char const* fieldname, uint32 defvalue);
|
||||
bool configNoReload(bool reload, eConfigInt32Values index, char const* fieldname, int32 defvalue);
|
||||
bool configNoReload(bool reload, eConfigFLoatValues index, char const* fieldname, float defvalue);
|
||||
bool configNoReload(bool reload, eConfigFloatValues index, char const* fieldname, float defvalue);
|
||||
bool configNoReload(bool reload, eConfigBoolValues index, char const* fieldname, bool defvalue);
|
||||
|
||||
static volatile bool m_stopEvent;
|
||||
|
|
|
|||
|
|
@ -691,7 +691,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
|
|||
|
||||
return HandleAuthSession (*new_pct);
|
||||
case CMSG_KEEP_ALIVE:
|
||||
DEBUG_LOG ("CMSG_KEEP_ALIVE ,size: %d", new_pct->size ());
|
||||
DEBUG_LOG ("CMSG_KEEP_ALIVE ,size: "SIZEFMTD" ", new_pct->size ());
|
||||
|
||||
return 0;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -276,11 +276,11 @@ void AuthSocket::OnRead()
|
|||
(table[i].status == STATUS_CONNECTED ||
|
||||
(_authed && table[i].status == STATUS_AUTHED)))
|
||||
{
|
||||
DEBUG_LOG("[Auth] got data for cmd %u ibuf length %u", (uint32)_cmd, ibuf.GetLength());
|
||||
DEBUG_LOG("[Auth] got data for cmd %u ibuf length "SIZEFMTD" ", (uint32)_cmd, ibuf.GetLength());
|
||||
|
||||
if (!(*this.*table[i].handler)())
|
||||
{
|
||||
DEBUG_LOG("Command handler failed for cmd %u ibuf length %u", (uint32)_cmd, ibuf.GetLength());
|
||||
DEBUG_LOG("Command handler failed for cmd %u ibuf length "SIZEFMTD" ", (uint32)_cmd, ibuf.GetLength());
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9630"
|
||||
#define REVISION_NR "9632"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __REVISION_SQL_H__
|
||||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_9630_01_characters_characters"
|
||||
#define REVISION_DB_CHARACTERS "required_9632_01_characters_characters"
|
||||
#define REVISION_DB_MANGOS "required_9622_01_mangos_gameobject"
|
||||
#define REVISION_DB_REALMD "required_9010_01_realmd_realmlist"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue