aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp49
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h22
-rwxr-xr-xsrc/server/game/Instances/InstanceSaveMgr.cpp1
-rwxr-xr-xsrc/server/game/Maps/Map.cpp34
-rwxr-xr-xsrc/server/game/Maps/MapManager.cpp48
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/CharacterHandler.cpp4
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/MovementHandler.cpp4
-rwxr-xr-xsrc/server/shared/Database/Implementation/CharacterDatabase.h10
8 files changed, 136 insertions, 36 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 935b9ad4b70..81b3b6a2170 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -1514,6 +1514,17 @@ void Player::Update(uint32 p_time)
UpdateEnchantTime(p_time);
UpdateHomebindTime(p_time);
+ if (!_instanceResetTimes.empty())
+ {
+ for (InstanceTimeMap::iterator itr = _instanceResetTimes.begin(); itr != _instanceResetTimes.end();)
+ {
+ if (itr->second < now)
+ _instanceResetTimes.erase(itr++);
+ else
+ ++itr;
+ }
+ }
+
// group update
SendUpdateToOutOfRangeGroupMembers();
@@ -1948,7 +1959,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// If the map is not created, assume it is possible to enter it.
// It will be created in the WorldPortAck.
Map *map = sMapMgr->FindMap(mapid);
- if (!map || map->CanEnter(this))
+ if (!map || map->CanEnter(this))
{
//lets reset near teleport flag if it wasn't reset during chained teleports
SetSemaphoreTeleportNear(false);
@@ -16300,6 +16311,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[45].GetUInt16());
_LoadBoundInstances(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES));
+ _LoadInstanceTimeRestrictions(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES));
_LoadBGData(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADBGDATA));
MapEntry const * mapEntry = sMapStore.LookupEntry(mapId);
@@ -17632,7 +17644,8 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu
{
if (itr != m_boundInstances[difficulty].end())
{
- if (!unload) CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%u' AND instance = '%u'", GetGUIDLow(), itr->second.save->GetInstanceId());
+ if (!unload)
+ CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%u' AND instance = '%u'", GetGUIDLow(), itr->second.save->GetInstanceId());
itr->second.save->RemovePlayer(this); // save can become invalid
m_boundInstances[difficulty].erase(itr++);
}
@@ -18120,6 +18133,7 @@ void Player::SaveToDB()
_SaveEquipmentSets(trans);
GetSession()->SaveTutorialsData(trans); // changed only while character in game
_SaveGlyphs(trans);
+ _SaveInstanceTimeRestrictions(trans);
// check if stats should only be saved on logout
// save stats can be out of transaction
@@ -24463,3 +24477,34 @@ float Player::GetAverageItemLevel()
return ((float)sum) / count;
}
+
+void Player::_LoadInstanceTimeRestrictions(PreparedQueryResult result)
+{
+ if (!result)
+ return;
+
+ do
+ {
+ Field* fields = result->Fetch();
+ _instanceResetTimes.insert(InstanceTimeMap::value_type(fields[0].GetUInt32(), fields[1].GetUInt64()));
+ } while (result->NextRow());
+}
+
+void Player::_SaveInstanceTimeRestrictions(SQLTransaction& trans)
+{
+ if (_instanceResetTimes.empty())
+ return;
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES);
+ stmt->setUInt32(0, GetSession()->GetAccountId());
+ trans->Append(stmt);
+
+ for (InstanceTimeMap::const_iterator itr = _instanceResetTimes.begin(); itr != _instanceResetTimes.end(); ++itr)
+ {
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_ACCOUNT_INSTANCE_LOCK_TIMES);
+ stmt->setUInt32(0, GetSession()->GetAccountId());
+ stmt->setUInt32(1, itr->first);
+ stmt->setUInt64(2, itr->second);
+ trans->Append(stmt);
+ }
+}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index caabac6d4a2..ac28ccf89d3 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -133,6 +133,9 @@ struct SpellCooldown
typedef std::map<uint32, SpellCooldown> SpellCooldowns;
+#define MAX_INSTANCES_PER_HOUR 5
+typedef UNORDERED_MAP<uint32 /*instanceId*/, time_t/*releaseTime*/> InstanceTimeMap;
+
enum TrainerSpellState
{
TRAINER_SPELL_GREEN = 0,
@@ -794,7 +797,8 @@ enum PlayerLoginQueryIndex
PLAYER_LOGIN_QUERY_LOADARENASTATS = 28,
PLAYER_LOGIN_QUERY_LOADBANNED = 29,
PLAYER_LOGIN_QUERY_LOADQUESTSTATUSREW = 30,
- MAX_PLAYER_LOGIN_QUERY = 31
+ PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES = 31,
+ MAX_PLAYER_LOGIN_QUERY,
};
enum PlayerDelayedOperations
@@ -2303,6 +2307,18 @@ class Player : public Unit, public GridObject<Player>
static void ConvertInstancesToGroup(Player *player, Group *group = NULL, uint64 player_guid = 0);
bool Satisfy(AccessRequirement const* ar, uint32 target_map, bool report = false);
bool CheckInstanceLoginValid();
+ bool CheckInstanceCount(uint32 instanceId) const
+ {
+ if (_instanceResetTimes.size() < MAX_INSTANCES_PER_HOUR)
+ return true;
+ return _instanceResetTimes.find(instanceId) != _instanceResetTimes.end();
+ }
+
+ void AddInstanceEnterTime(uint32 instanceId, time_t enterTime)
+ {
+ if (_instanceResetTimes.find(instanceId) == _instanceResetTimes.end())
+ _instanceResetTimes.insert(InstanceTimeMap::value_type(instanceId, enterTime + HOUR));
+ }
// last used pet number (for BG's)
uint32 GetLastPetNumber() const { return m_lastpetnumber; }
@@ -2449,6 +2465,7 @@ class Player : public Unit, public GridObject<Player>
void _LoadBGData(PreparedQueryResult result);
void _LoadGlyphs(PreparedQueryResult result);
void _LoadTalents(PreparedQueryResult result);
+ void _LoadInstanceTimeRestrictions(PreparedQueryResult result);
/*********************************************************/
/*** SAVE SYSTEM ***/
@@ -2468,6 +2485,7 @@ class Player : public Unit, public GridObject<Player>
void _SaveGlyphs(SQLTransaction& trans);
void _SaveTalents(SQLTransaction& trans);
void _SaveStats(SQLTransaction& trans);
+ void _SaveInstanceTimeRestrictions(SQLTransaction& trans);
void _SetCreateBits(UpdateMask *updateMask, Player *target) const;
void _SetUpdateBits(UpdateMask *updateMask, Player *target) const;
@@ -2700,6 +2718,8 @@ class Player : public Unit, public GridObject<Player>
uint32 m_timeSyncTimer;
uint32 m_timeSyncClient;
uint32 m_timeSyncServer;
+
+ InstanceTimeMap _instanceResetTimes;
};
void AddItemsSetItem(Player*player,Item *item);
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp
index b6f9981d0df..30fc849cf6a 100755
--- a/src/server/game/Instances/InstanceSaveMgr.cpp
+++ b/src/server/game/Instances/InstanceSaveMgr.cpp
@@ -278,6 +278,7 @@ void InstanceSaveManager::CleanupAndPackInstances()
CharacterDatabase.DirectExecute("ALTER TABLE instance ADD newid INT UNSIGNED AUTO_INCREMENT, ADD INDEX(newid)");
// Update old ids
+ CharacterDatabase.DirectExecute("UPDATE account_instance_times AS tmp LEFT JOIN instance ON tmp.instanceId = instance.id SET tmp.instance = instance.newid WHERE tmp.instanceId > 0");
CharacterDatabase.DirectExecute("UPDATE corpse AS tmp LEFT JOIN instance ON tmp.instance = instance.id SET tmp.instance = instance.newid WHERE tmp.instance > 0");
CharacterDatabase.DirectExecute("UPDATE character_instance AS tmp LEFT JOIN instance ON tmp.instance = instance.id SET tmp.instance = instance.newid WHERE tmp.instance > 0");
CharacterDatabase.DirectExecute("UPDATE group_instance AS tmp LEFT JOIN instance ON tmp.instance = instance.id SET tmp.instance = instance.newid WHERE tmp.instance > 0");
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index cf26daed48a..c4187ff626f 100755
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -2283,6 +2283,12 @@ bool InstanceMap::Add(Player *player)
// Dungeon only code
if (IsDungeon())
{
+ Group *group = player->GetGroup();
+
+ // increase current instances (hourly limit)
+ if (!group || !group->isLFGGroup())
+ player->AddInstanceEnterTime(GetInstanceId(), time(NULL));
+
// get or create an instance save for the map
InstanceSave *mapSave = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
if (!mapSave)
@@ -2304,27 +2310,27 @@ bool InstanceMap::Add(Player *player)
}
else
{
- Group *pGroup = player->GetGroup();
- if (pGroup)
+ if (group)
{
// solo saves should be reset when entering a group
- InstanceGroupBind *groupBind = pGroup->GetBoundInstance(this);
+ InstanceGroupBind *groupBind = group->GetBoundInstance(this);
if (playerBind)
{
- sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(pGroup->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
- if (groupBind) sLog->outError("InstanceMap::Add: the group is bound to the instance %d,%d,%d,%d,%d,%d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
+ sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
+ if (groupBind)
+ sLog->outError("InstanceMap::Add: the group is bound to the instance %d,%d,%d,%d,%d,%d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
//ASSERT(false);
return false;
}
// bind to the group or keep using the group save
if (!groupBind)
- pGroup->BindToInstance(mapSave, false);
+ group->BindToInstance(mapSave, false);
else
{
// cannot jump to a different instance without resetting it
if (groupBind->save != mapSave)
{
- sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d,%d,%d but he is in group %d which is bound to instance %d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(pGroup->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
+ sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d,%d,%d but he is in group %d which is bound to instance %d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
if (mapSave)
sLog->outError("MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
else
@@ -2339,10 +2345,12 @@ bool InstanceMap::Add(Player *player)
// players also become permanently bound when they enter
if (groupBind->perm)
{
- WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4);
- data << uint32(0);
+ WorldPacket data(SMSG_INSTANCE_LOCK_WARNING_QUERY, 9);
+ data << uint32(60000);
+ data << uint32(i_data ? i_data->GetCompletedEncounterMask() : 0);
+ data << uint8(0);
player->GetSession()->SendPacket(&data);
- player->BindToInstance(mapSave, true);
+ player->SetPendingBind(mapSave, 60000);
}
}
}
@@ -2528,8 +2536,10 @@ void InstanceMap::SetResetSchedule(bool on)
if (IsDungeon() && !HavePlayers() && !IsRaidOrHeroicDungeon())
{
InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
- if (!save) sLog->outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, no save available for instance %d of %d", on ? "on" : "off", GetInstanceId(), GetId());
- else sInstanceSaveMgr->ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId()));
+ if (!save)
+ sLog->outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, no save available for instance %d of %d", on ? "on" : "off", GetInstanceId(), GetId());
+ else
+ sInstanceSaveMgr->ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId()));
}
}
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp
index 7b6d0a64460..2317f2296f1 100755
--- a/src/server/game/Maps/MapManager.cpp
+++ b/src/server/game/Maps/MapManager.cpp
@@ -146,7 +146,7 @@ Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const
bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
{
- const MapEntry *entry = sMapStore.LookupEntry(mapid);
+ MapEntry const* entry = sMapStore.LookupEntry(mapid);
if (!entry)
return false;
@@ -176,13 +176,13 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
if (player->isGameMaster())
return true;
- const char *mapName = entry->name[player->GetSession()->GetSessionDbcLocale()];
+ char const* mapName = entry->name[player->GetSession()->GetSessionDbcLocale()];
- Group* pGroup = player->GetGroup();
+ Group* group = player->GetGroup();
if (entry->IsRaid())
{
// can only enter in a raid group
- if ((!pGroup || !pGroup->isRaidGroup()) && !sWorld->getBoolConfig(CONFIG_INSTANCE_IGNORE_RAID))
+ if ((!group || !group->isRaidGroup()) && !sWorld->getBoolConfig(CONFIG_INSTANCE_IGNORE_RAID))
{
// probably there must be special opcode, because client has this string constant in GlobalStrings.lua
// TODO: this is not a good place to send the message
@@ -194,21 +194,20 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
if (!player->isAlive())
{
- if (Corpse *corpse = player->GetCorpse())
+ if (Corpse* corpse = player->GetCorpse())
{
// let enter in ghost mode in instance that connected to inner instance with corpse
- uint32 instance_map = corpse->GetMapId();
+ uint32 corpseMap = corpse->GetMapId();
do
{
- if (instance_map == mapid)
+ if (corpseMap == mapid)
break;
- InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(instance_map);
- instance_map = instance ? instance->parent : 0;
- }
- while (instance_map);
+ InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(corpseMap);
+ corpseMap = instance ? instance->parent : 0;
+ } while (corpseMap);
- if (!instance_map)
+ if (!corpseMap)
{
WorldPacket data(SMSG_CORPSE_NOT_IN_INSTANCE);
player->GetSession()->SendPacket(&data);
@@ -222,12 +221,12 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
}
//Get instance where player's group is bound & its map
- if (pGroup)
+ if (group)
{
- InstanceGroupBind* boundedInstance = pGroup->GetBoundInstance(entry);
- if (boundedInstance && boundedInstance->save)
- if (Map *boundedMap = sMapMgr->FindMap(mapid,boundedInstance->save->GetInstanceId()))
- if (!loginCheck && !boundedMap->CanEnter(player))
+ InstanceGroupBind* boundInstance = group->GetBoundInstance(entry);
+ if (boundInstance && boundInstance->save)
+ if (Map* boundMap = sMapMgr->FindMap(mapid, boundInstance->save->GetInstanceId()))
+ if (!loginCheck && !boundMap->CanEnter(player))
return false;
/*
This check has to be moved to InstanceMap::CanEnter()
@@ -241,6 +240,21 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
}*/
}
+ // players are only allowed to enter 5 instances per hour
+ if (entry->IsDungeon() && (!player->GetGroup() || (player->GetGroup() && !player->GetGroup()->isLFGGroup())))
+ {
+ uint32 instaceIdToCheck = 0;
+ if (InstanceSave* save = player->GetInstanceSave(mapid, entry->IsRaid()))
+ instaceIdToCheck = save->GetInstanceId();
+
+ // instanceId can never be 0 - will not be found
+ if (!player->CheckInstanceCount(instaceIdToCheck))
+ {
+ player->SendTransferAborted(mapid, TRANSFER_ABORT_TOO_MANY_INSTANCES);
+ return false;
+ }
+ }
+
//Other requirements
return player->Satisfy(sObjectMgr->GetAccessRequirement(mapid, targetDifficulty), mapid, true);
}
diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
index 6a43bbc7dfd..ca7efa7c032 100755
--- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
@@ -190,6 +190,10 @@ bool LoginQueryHolder::Initialize()
stmt->setUInt32(0, lowGuid);
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUSREW, stmt);
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_ACCOUNT_INSTANCELOCKTIMES);
+ stmt->setUInt32(0, m_accountId);
+ res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES, stmt);
+
return res;
}
diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp
index ef825691f82..4c0c8f1fb2f 100755
--- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp
@@ -151,11 +151,11 @@ void WorldSession::HandleMoveWorldportAckOpcode()
if (mInstance)
{
Difficulty diff = GetPlayer()->GetDifficulty(mEntry->IsRaid());
- if (MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID,diff))
+ if (MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID, diff))
{
if (mapDiff->resetTime)
{
- if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->MapID,diff))
+ if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->MapID, diff))
{
uint32 timeleft = uint32(timeReset - time(NULL));
GetPlayer()->SendInstanceResetWarning(mEntry->MapID, diff, timeleft);
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h
index af0420123c0..35ab26b3e76 100755
--- a/src/server/shared/Database/Implementation/CharacterDatabase.h
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.h
@@ -92,6 +92,7 @@ enum CharacterDatabaseStatements
CHAR_LOAD_PLAYER_ARENASTATS,
CHAR_LOAD_PLAYER_BANNED,
CHAR_LOAD_PLAYER_QUESTSTATUSREW,
+ CHAR_LOAD_ACCOUNT_INSTANCELOCKTIMES,
CHAR_LOAD_ACCOUNT_DATA,
CHAR_LOAD_PLAYER_MAILITEMS,
CHAR_LOAD_AUCTION_ITEMS,
@@ -122,6 +123,8 @@ enum CharacterDatabaseStatements
CHAR_UPDATE_GIFT_OWNER,
CHAR_DEL_GIFT,
CHAR_GET_ACCOUNT_BY_NAME,
+ CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES,
+ CHAR_ADD_ACCOUNT_INSTANCE_LOCK_TIMES,
CHAR_ADD_GUILD,
CHAR_DEL_GUILD,
@@ -247,7 +250,7 @@ static const PreparedStatementTable CharacterDatabasePreparedStatements[] =
"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk,"
"health, power1, power2, power3, power4, power5, power6, power7, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters WHERE guid = ?", CONNECTION_ASYNC},
{CHAR_LOAD_PLAYER_GROUP, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC},
- {CHAR_LOAD_PLAYER_BOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC},
+ {CHAR_LOAD_PLAYER_BOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime, extended FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC},
{CHAR_LOAD_PLAYER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, "
"base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM character_aura WHERE guid = ?", CONNECTION_ASYNC},
{CHAR_LOAD_PLAYER_SPELLS, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?", CONNECTION_ASYNC},
@@ -280,6 +283,7 @@ static const PreparedStatementTable CharacterDatabasePreparedStatements[] =
{CHAR_LOAD_PLAYER_ARENASTATS, "SELECT slot, personal_rating, matchmaker_rating FROM character_arena_stats WHERE guid = ? ORDER BY slot ASC", CONNECTION_ASYNC},
{CHAR_LOAD_PLAYER_BANNED, "SELECT guid FROM character_banned WHERE guid = ? AND active = 1", CONNECTION_ASYNC},
{CHAR_LOAD_PLAYER_QUESTSTATUSREW, "SELECT quest FROM character_queststatus_rewarded WHERE guid = ?", CONNECTION_ASYNC},
+ {CHAR_LOAD_ACCOUNT_INSTANCELOCKTIMES, "SELECT instanceId, releaseTime FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC},
// End LoginQueryHolder content
{CHAR_LOAD_PLAYER_ACTIONS_SPEC, "SELECT button, action, type FROM character_action WHERE guid = ? AND spec = ? ORDER BY button", CONNECTION_SYNCH},
@@ -313,6 +317,8 @@ static const PreparedStatementTable CharacterDatabasePreparedStatements[] =
{CHAR_UPDATE_GIFT_OWNER, "UPDATE character_gifts SET guid = ? WHERE item_guid = ?", CONNECTION_ASYNC},
{CHAR_DEL_GIFT, "DELETE FROM character_gifts WHERE item_guid = ?", CONNECTION_ASYNC},
{CHAR_GET_ACCOUNT_BY_NAME, "SELECT account FROM characters WHERE name = ?", CONNECTION_SYNCH},
+ {CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES, "DELETE FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC},
+ {CHAR_ADD_ACCOUNT_INSTANCE_LOCK_TIMES, "INSERT INTO account_instance_times (accountId, instanceId, releaseTime) VALUES (?, ?, ?)", CONNECTION_ASYNC},
// Guild handling
// 0: uint32, 1: string, 2: uint32, 3: string, 4: string, 5: uint64, 6-10: uint32, 11: uint64
@@ -450,7 +456,7 @@ static const PreparedStatementTable CharacterDatabasePreparedStatements[] =
// Auras
{CHAR_DEL_AURA, "DELETE FROM character_aura WHERE guid = ?", CONNECTION_ASYNC},
{CHAR_ADD_AURA, "INSERT INTO character_aura (guid,caster_guid,item_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges) "
- "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC}
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC},
};
#endif