mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Commands] Add additional #peqzone functionality. (#2085)
* [Commands] Add additional #peqzone functionality. - Add #peqzone flagging capabilities so operators don't have to blanket allow #peqzone access to zones. - Allows you to set a zone's `peqzone` column to `2` and disallow use of `#peqzone` until they have been given the appropriate flag. - Add #peqzone_flags command to list your #peqzone flags similar to #flags command. - Add `character_peqzone_flags` table to database and database_schema.h. - Required SQL update to add the new table. - Add client:ClearPEQZoneFlag(zone_id) to Lua. - Add client:HasPEQZoneFlag(zone_id) to Lua. - Add client:LoadPEQZoneFlags() to Lua. - Add client:LoadZoneFlags() to Lua. - Add client:SendPEQZoneFlagInfo(client) to Lua. - Add client:SetPEQZoneFlag(zone_id) to Lua. - Add $client->ClearPEQZoneFlag(zone_id) to Perl. - Add $client->HasPEQZoneFlag(zone_id) to Perl. - Add $client->LoadPEQZoneFlags() to Perl. - Add $client->SendPEQZoneFlagInfo(client) to Perl. - Add $client->SetPEQZoneFlag(zone_id) to Perl. * Fixes.
This commit is contained in:
+8
-8
@@ -1143,21 +1143,21 @@ bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zon
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8 Database::GetPEQZone(uint32 zoneID, uint32 version){
|
||||
|
||||
std::string query = StringFormat("SELECT peqzone from zone where zoneidnumber='%i' AND (version=%i OR version=0) ORDER BY version DESC", zoneID, version);
|
||||
uint8 Database::GetPEQZone(uint32 zone_id, uint32 version){
|
||||
std::string query = fmt::format(
|
||||
"SELECT peqzone FROM zone WHERE zoneidnumber = {} AND (version = {} OR version = 0) ORDER BY version DESC LIMIT 1",
|
||||
zone_id,
|
||||
version
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
if (!results.Success()) {
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
return 0;
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return atoi(row[0]);
|
||||
return static_cast<uint8>(std::stoi(row[0]));
|
||||
}
|
||||
|
||||
bool Database::CheckNameFilter(const char* name, bool surname)
|
||||
|
||||
+1
-1
@@ -254,7 +254,7 @@ public:
|
||||
|
||||
uint32 GetZoneGraveyardID(uint32 zone_id, uint32 version);
|
||||
|
||||
uint8 GetPEQZone(uint32 zoneID, uint32 version);
|
||||
uint8 GetPEQZone(uint32 zone_id, uint32 version);
|
||||
uint8 GetRaceSkill(uint8 skillid, uint8 in_race);
|
||||
uint8 GetServerType();
|
||||
uint8 GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 in_level);
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace DatabaseSchema {
|
||||
{"character_pet_buffs", "char_id"},
|
||||
{"character_pet_info", "char_id"},
|
||||
{"character_pet_inventory", "char_id"},
|
||||
{"character_peqzone_flags", "id"},
|
||||
{"character_potionbelt", "id"},
|
||||
{"character_skills", "id"},
|
||||
{"character_spells", "id"},
|
||||
@@ -129,6 +130,7 @@ namespace DatabaseSchema {
|
||||
"character_pet_buffs",
|
||||
"character_pet_info",
|
||||
"character_pet_inventory",
|
||||
"character_peqzone_flags",
|
||||
"character_potionbelt",
|
||||
"character_skills",
|
||||
"character_spells",
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9179
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9180
|
||||
|
||||
#ifdef BOTS
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9028
|
||||
|
||||
Reference in New Issue
Block a user