mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-03 05:16:37 +00:00
[Repositories] Convert database.cpp to Repositories (#4054)
* [Repositories] Convert database.cpp to Repositories - Convert all database.cpp methods to repositories where possible. * Final push. * Cleanup * Cleanup * Update database.h * Fix crash * Update database.cpp
This commit is contained in:
@@ -57,9 +57,7 @@ EQ::Net::WebsocketLoginStatus CheckLogin(
|
||||
return ret;
|
||||
}
|
||||
|
||||
char account_name[64];
|
||||
database.GetAccountName(static_cast<uint32>(ret.account_id), account_name);
|
||||
ret.account_name = account_name;
|
||||
ret.account_name = database.GetAccountName(static_cast<uint32>(ret.account_id));
|
||||
ret.logged_in = true;
|
||||
ret.status = database.CheckStatus(ret.account_id);
|
||||
return ret;
|
||||
|
||||
@@ -1579,9 +1579,7 @@ std::string Perl__GetCharactersInInstance(uint16 instance_id)
|
||||
char_id_string = fmt::format("{} player(s) in instance: ", character_ids.size());
|
||||
auto iter = character_ids.begin();
|
||||
while (iter != character_ids.end()) {
|
||||
char char_name[64];
|
||||
database.GetCharName(*iter, char_name);
|
||||
char_id_string += char_name;
|
||||
char_id_string += database.GetCharName(*iter);
|
||||
char_id_string += "(";
|
||||
char_id_string += itoa(*iter);
|
||||
char_id_string += ")";
|
||||
|
||||
@@ -53,7 +53,7 @@ void command_movechar(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
const bool moved = database.MoveCharacterToZone(character_name.c_str(), zone_id);
|
||||
const bool moved = database.MoveCharacterToZone(character_name, zone_id);
|
||||
std::string moved_string = moved ? "Succeeded" : "Failed";
|
||||
c->Message(
|
||||
Chat::White,
|
||||
|
||||
+10
-2
@@ -67,6 +67,7 @@
|
||||
#include "../common/serverinfo.h"
|
||||
#include "../common/repositories/merc_stance_entries_repository.h"
|
||||
#include "../common/repositories/alternate_currency_repository.h"
|
||||
#include "../common/repositories/graveyard_repository.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
@@ -1023,9 +1024,16 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name)
|
||||
|
||||
if (graveyard_id() > 0) {
|
||||
LogDebug("Graveyard ID is [{}]", graveyard_id());
|
||||
bool GraveYardLoaded = content_db.GetZoneGraveyard(graveyard_id(), &pgraveyard_zoneid, &m_graveyard.x, &m_graveyard.y, &m_graveyard.z, &m_graveyard.w);
|
||||
const auto& e = GraveyardRepository::FindOne(content_db, graveyard_id());
|
||||
|
||||
if (e.id) {
|
||||
pgraveyard_zoneid = e.zone_id;
|
||||
|
||||
m_graveyard.x = e.x;
|
||||
m_graveyard.y = e.y;
|
||||
m_graveyard.z = e.z;
|
||||
m_graveyard.w = e.heading;
|
||||
|
||||
if (GraveYardLoaded) {
|
||||
LogDebug("Loaded a graveyard for zone [{}]: graveyard zoneid is [{}] at [{}]", short_name, graveyard_zoneid(), to_string(m_graveyard).c_str());
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user