[Repositories] Update repositories (#2040)

This commit is contained in:
Chris Miles
2022-03-11 15:27:36 -08:00
committed by GitHub
parent f22608a43a
commit 3ed6663c4c
170 changed files with 5543 additions and 511 deletions
+112 -6
View File
@@ -14,6 +14,7 @@
#include "../../database.h"
#include "../../string_util.h"
#include <ctime>
class BaseZoneRepository {
public:
@@ -219,11 +220,116 @@ public:
};
}
static std::vector<std::string> SelectColumns()
{
return {
"short_name",
"id",
"file_name",
"long_name",
"map_file_name",
"safe_x",
"safe_y",
"safe_z",
"safe_heading",
"graveyard_id",
"min_level",
"min_status",
"zoneidnumber",
"version",
"timezone",
"maxclients",
"ruleset",
"note",
"underworld",
"minclip",
"maxclip",
"fog_minclip",
"fog_maxclip",
"fog_blue",
"fog_red",
"fog_green",
"sky",
"ztype",
"zone_exp_multiplier",
"walkspeed",
"time_type",
"fog_red1",
"fog_green1",
"fog_blue1",
"fog_minclip1",
"fog_maxclip1",
"fog_red2",
"fog_green2",
"fog_blue2",
"fog_minclip2",
"fog_maxclip2",
"fog_red3",
"fog_green3",
"fog_blue3",
"fog_minclip3",
"fog_maxclip3",
"fog_red4",
"fog_green4",
"fog_blue4",
"fog_minclip4",
"fog_maxclip4",
"fog_density",
"flag_needed",
"canbind",
"cancombat",
"canlevitate",
"castoutdoor",
"hotzone",
"insttype",
"shutdowndelay",
"peqzone",
"expansion",
"suspendbuffs",
"rain_chance1",
"rain_chance2",
"rain_chance3",
"rain_chance4",
"rain_duration1",
"rain_duration2",
"rain_duration3",
"rain_duration4",
"snow_chance1",
"snow_chance2",
"snow_chance3",
"snow_chance4",
"snow_duration1",
"snow_duration2",
"snow_duration3",
"snow_duration4",
"gravity",
"type",
"skylock",
"fast_regen_hp",
"fast_regen_mana",
"fast_regen_endurance",
"npc_max_aggro_dist",
"max_movement_update_range",
"min_expansion",
"max_expansion",
"content_flags",
"content_flags_disabled",
"underworld_teleport_index",
"lava_damage",
"min_lava_damage",
};
}
static std::string ColumnsRaw()
{
return std::string(implode(", ", Columns()));
}
static std::string SelectColumnsRaw()
{
return std::string(implode(", ", SelectColumns()));
}
static std::string TableName()
{
return std::string("zone");
@@ -233,7 +339,7 @@ public:
{
return fmt::format(
"SELECT {} FROM {}",
ColumnsRaw(),
SelectColumnsRaw(),
TableName()
);
}
@@ -338,8 +444,8 @@ public:
entry.fast_regen_endurance = 180;
entry.npc_max_aggro_dist = 600;
entry.max_movement_update_range = 600;
entry.min_expansion = 0;
entry.max_expansion = 0;
entry.min_expansion = -1;
entry.max_expansion = -1;
entry.content_flags = "";
entry.content_flags_disabled = "";
entry.underworld_teleport_index = 0;
@@ -439,7 +545,7 @@ public:
entry.castoutdoor = atoi(row[56]);
entry.hotzone = atoi(row[57]);
entry.insttype = atoi(row[58]);
entry.shutdowndelay = strtoll(row[59], NULL, 10);
entry.shutdowndelay = strtoll(row[59], nullptr, 10);
entry.peqzone = atoi(row[60]);
entry.expansion = atoi(row[61]);
entry.suspendbuffs = atoi(row[62]);
@@ -930,7 +1036,7 @@ public:
entry.castoutdoor = atoi(row[56]);
entry.hotzone = atoi(row[57]);
entry.insttype = atoi(row[58]);
entry.shutdowndelay = strtoll(row[59], NULL, 10);
entry.shutdowndelay = strtoll(row[59], nullptr, 10);
entry.peqzone = atoi(row[60]);
entry.expansion = atoi(row[61]);
entry.suspendbuffs = atoi(row[62]);
@@ -1048,7 +1154,7 @@ public:
entry.castoutdoor = atoi(row[56]);
entry.hotzone = atoi(row[57]);
entry.insttype = atoi(row[58]);
entry.shutdowndelay = strtoll(row[59], NULL, 10);
entry.shutdowndelay = strtoll(row[59], nullptr, 10);
entry.peqzone = atoi(row[60]);
entry.expansion = atoi(row[61]);
entry.suspendbuffs = atoi(row[62]);