mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Zone] Implement zone player count sharding (#4536)
* [Zone] Implement zone player count sharding * Update client.cpp * Update database_instances.cpp * You must request a shard change from the zone you are currently in. * // zone sharding * You cannot request a shard change while in combat. * Query adjustment * Use safe coords * Changes * Fixes to instance query * Push * Push * Final push * Update client.cpp * Update eq_packet_structs.h * Remove pick menu * Comment * Update character_data_repository.h * Update zoning.cpp --------- Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
@@ -114,7 +114,9 @@ bool Database::CheckInstanceExpired(uint16 instance_id)
|
||||
timeval tv{};
|
||||
gettimeofday(&tv, nullptr);
|
||||
|
||||
return (i.start_time + i.duration) <= tv.tv_sec;
|
||||
// Use uint64_t for the addition to prevent overflow
|
||||
uint64_t expiration_time = static_cast<uint64_t>(i.start_time) + static_cast<uint64_t>(i.duration);
|
||||
return expiration_time <= tv.tv_sec;
|
||||
}
|
||||
|
||||
bool Database::CreateInstance(uint16 instance_id, uint32 zone_id, uint32 version, uint32 duration)
|
||||
@@ -469,15 +471,13 @@ void Database::AssignRaidToInstance(uint32 raid_id, uint32 instance_id)
|
||||
|
||||
void Database::DeleteInstance(uint16 instance_id)
|
||||
{
|
||||
// I'm not sure why this isn't in here but we should add it in a later change and make sure it's tested
|
||||
// InstanceListRepository::DeleteWhere(*this, fmt::format("id = {}", instance_id));
|
||||
InstanceListPlayerRepository::DeleteWhere(*this, fmt::format("id = {}", instance_id));
|
||||
|
||||
RespawnTimesRepository::DeleteWhere(*this, fmt::format("instance_id = {}", instance_id));
|
||||
|
||||
SpawnConditionValuesRepository::DeleteWhere(*this, fmt::format("instance_id = {}", instance_id));
|
||||
|
||||
DynamicZoneMembersRepository::DeleteByInstance(*this, instance_id);
|
||||
DynamicZonesRepository::DeleteWhere(*this, fmt::format("instance_id = {}", instance_id));
|
||||
|
||||
CharacterCorpsesRepository::BuryInstance(*this, instance_id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user