mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Databuckets] Add Zone Scoped Databuckets (#4690)
* [Databuckets] Add Zone Scoped Databuckets
* Add database indexes
* Update database_update_manifest.cpp
* Shutdown fix
* Testing
* Perf boost
* Revert "Perf boost"
This reverts commit 55d3e507d3.
* Update data_bucket.cpp
This commit is contained in:
@@ -172,6 +172,8 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool is_static) {
|
||||
zone->RequestUCSServerStatus();
|
||||
zone->StartShutdownTimer();
|
||||
|
||||
DataBucket::LoadZoneCache(iZoneID, iInstanceID);
|
||||
|
||||
/*
|
||||
* Set Logging
|
||||
*/
|
||||
@@ -877,6 +879,8 @@ void Zone::Shutdown(bool quiet)
|
||||
return;
|
||||
}
|
||||
|
||||
DataBucket::DeleteCachedBuckets(DataBucketLoadType::Zone, zone->GetZoneID(), zone->GetInstanceID());
|
||||
|
||||
entity_list.StopMobAI();
|
||||
|
||||
std::map<uint32, NPCType *>::iterator itr;
|
||||
@@ -3187,4 +3191,56 @@ bool Zone::DoesAlternateCurrencyExist(uint32 currency_id)
|
||||
);
|
||||
}
|
||||
|
||||
std::string Zone::GetBucket(const std::string& bucket_name)
|
||||
{
|
||||
DataBucketKey k = {};
|
||||
k.zone_id = zoneid;
|
||||
k.instance_id = instanceid;
|
||||
k.key = bucket_name;
|
||||
|
||||
return DataBucket::GetData(k).value;
|
||||
}
|
||||
|
||||
void Zone::SetBucket(const std::string& bucket_name, const std::string& bucket_value, const std::string& expiration)
|
||||
{
|
||||
DataBucketKey k = {};
|
||||
k.zone_id = zoneid;
|
||||
k.instance_id = instanceid;
|
||||
k.key = bucket_name;
|
||||
k.expires = expiration;
|
||||
k.value = bucket_value;
|
||||
|
||||
DataBucket::SetData(k);
|
||||
}
|
||||
|
||||
void Zone::DeleteBucket(const std::string& bucket_name)
|
||||
{
|
||||
DataBucketKey k = {};
|
||||
k.zone_id = zoneid;
|
||||
k.instance_id = instanceid;
|
||||
k.key = bucket_name;
|
||||
|
||||
DataBucket::DeleteData(k);
|
||||
}
|
||||
|
||||
std::string Zone::GetBucketExpires(const std::string& bucket_name)
|
||||
{
|
||||
DataBucketKey k = {};
|
||||
k.zone_id = zoneid;
|
||||
k.instance_id = instanceid;
|
||||
k.key = bucket_name;
|
||||
|
||||
return DataBucket::GetDataExpires(k);
|
||||
}
|
||||
|
||||
std::string Zone::GetBucketRemaining(const std::string& bucket_name)
|
||||
{
|
||||
DataBucketKey k = {};
|
||||
k.zone_id = zoneid;
|
||||
k.instance_id = instanceid;
|
||||
k.key = bucket_name;
|
||||
|
||||
return DataBucket::GetDataRemaining(k);
|
||||
}
|
||||
|
||||
#include "zone_loot.cpp"
|
||||
|
||||
Reference in New Issue
Block a user