mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Strings] Refactor Strings Usage (#2305)
* Initial commit checkpoint * More functions converted * Commify * More functions * Fin * Sort declarations * Split functions between files * Bots * Update strings.h * Split * Revert find replaces * Repository template * Money * Misc function * Update CMakeLists.txt * Saylink * Update strings.cpp * Swap Strings::Saylink for Saylink::Create since saylink is coupled to zone database * API casings
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include "zonedb.h"
|
||||
#include "../common/database.h"
|
||||
#include "../common/expedition_lockout_timer.h"
|
||||
#include "../common/string_util.h"
|
||||
#include "../common/strings.h"
|
||||
#include <fmt/core.h>
|
||||
|
||||
uint32_t ExpeditionDatabase::InsertExpedition(uint32_t dz_id)
|
||||
@@ -100,7 +100,7 @@ std::vector<ExpeditionLockoutTimer> ExpeditionDatabase::LoadCharacterLockouts(
|
||||
character_id = {}
|
||||
AND expire_time > NOW()
|
||||
AND expedition_name = '{}';
|
||||
), character_id, EscapeString(expedition_name));
|
||||
), character_id, Strings::Escape(expedition_name));
|
||||
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (results.Success())
|
||||
@@ -145,7 +145,7 @@ void ExpeditionDatabase::DeleteAllCharacterLockouts(
|
||||
std::string query = fmt::format(SQL(
|
||||
DELETE FROM character_expedition_lockouts
|
||||
WHERE character_id = {} AND expedition_name = '{}';
|
||||
), character_id, EscapeString(expedition_name));
|
||||
), character_id, Strings::Escape(expedition_name));
|
||||
|
||||
database.QueryDatabase(query);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ void ExpeditionDatabase::DeleteCharacterLockout(
|
||||
character_id = {}
|
||||
AND expedition_name = '{}'
|
||||
AND event_name = '{}';
|
||||
), character_id, EscapeString(expedition_name), EscapeString(event_name));
|
||||
), character_id, Strings::Escape(expedition_name), Strings::Escape(event_name));
|
||||
|
||||
database.QueryDatabase(query);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ void ExpeditionDatabase::DeleteMembersLockout(
|
||||
IN ({})
|
||||
AND expedition_name = '{}'
|
||||
AND event_name = '{}';
|
||||
), query_character_ids, EscapeString(expedition_name), EscapeString(event_name));
|
||||
), query_character_ids, Strings::Escape(expedition_name), Strings::Escape(event_name));
|
||||
|
||||
database.QueryDatabase(query);
|
||||
}
|
||||
@@ -204,7 +204,7 @@ void ExpeditionDatabase::DeleteLockout(uint32_t expedition_id, const std::string
|
||||
auto query = fmt::format(SQL(
|
||||
DELETE FROM expedition_lockouts
|
||||
WHERE expedition_id = {} AND event_name = '{}';
|
||||
), expedition_id, EscapeString(event_name));
|
||||
), expedition_id, Strings::Escape(event_name));
|
||||
|
||||
database.QueryDatabase(query);
|
||||
}
|
||||
@@ -223,8 +223,8 @@ void ExpeditionDatabase::InsertCharacterLockouts(uint32_t character_id,
|
||||
lockout.GetExpireTime(),
|
||||
lockout.GetDuration(),
|
||||
lockout.GetExpeditionUUID(),
|
||||
EscapeString(lockout.GetExpeditionName()),
|
||||
EscapeString(lockout.GetEventName())
|
||||
Strings::Escape(lockout.GetExpeditionName()),
|
||||
Strings::Escape(lockout.GetEventName())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -263,8 +263,8 @@ void ExpeditionDatabase::InsertMembersLockout(
|
||||
lockout.GetExpireTime(),
|
||||
lockout.GetDuration(),
|
||||
lockout.GetExpeditionUUID(),
|
||||
EscapeString(lockout.GetExpeditionName()),
|
||||
EscapeString(lockout.GetEventName())
|
||||
Strings::Escape(lockout.GetExpeditionName()),
|
||||
Strings::Escape(lockout.GetEventName())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ void ExpeditionDatabase::InsertLockout(
|
||||
),
|
||||
expedition_id,
|
||||
lockout.GetExpeditionUUID(),
|
||||
EscapeString(lockout.GetEventName()),
|
||||
Strings::Escape(lockout.GetEventName()),
|
||||
lockout.GetExpireTime(),
|
||||
lockout.GetDuration()
|
||||
);
|
||||
@@ -326,7 +326,7 @@ void ExpeditionDatabase::InsertLockouts(
|
||||
"({}, '{}', '{}', FROM_UNIXTIME({}), {}),",
|
||||
expedition_id,
|
||||
lockout.second.GetExpeditionUUID(),
|
||||
EscapeString(lockout.second.GetEventName()),
|
||||
Strings::Escape(lockout.second.GetEventName()),
|
||||
lockout.second.GetExpireTime(),
|
||||
lockout.second.GetDuration()
|
||||
);
|
||||
@@ -388,8 +388,8 @@ void ExpeditionDatabase::AddLockoutDuration(const std::vector<DynamicZoneMember>
|
||||
lockout.GetExpireTime(),
|
||||
lockout.GetDuration(),
|
||||
lockout.GetExpeditionUUID(),
|
||||
EscapeString(lockout.GetExpeditionName()),
|
||||
EscapeString(lockout.GetEventName())
|
||||
Strings::Escape(lockout.GetExpeditionName()),
|
||||
Strings::Escape(lockout.GetEventName())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user