mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-17 23:12:27 +00:00
* Beginning of cleanup * More cleanup * More cleanup * Enc cleanup * client manager cleanup * client cleanup * More cleanup * More cleanup * Cleanup * More cleanup, account context, account management * Remove positional fmt bindings * Use LoginAccountContext * Update loginserver_webserver.cpp * Remove comments * Port CreateLoginServerAccount to repositories * More cleanup * More cleanup * More cleanup * More cleanup * Remove a ton of functions * More cleanup * More cleanup * More cleanup * Cleanup SendClientAuthToWorld * Consolidate world server logic * Update login_accounts_repository.h * Update login_accounts_repository.h * Move api tokens to repositories * Cleanup options * Move everything else to repositories * Update account_management.cpp * uint64 account * Update login_schema.sql * Fix * Update world_server.cpp * auto
34 lines
830 B
C++
34 lines
830 B
C++
#ifndef EQEMU_LOGIN_WORLD_SERVERS_REPOSITORY_H
|
|
#define EQEMU_LOGIN_WORLD_SERVERS_REPOSITORY_H
|
|
|
|
#include "../database.h"
|
|
#include "../strings.h"
|
|
#include "base/base_login_world_servers_repository.h"
|
|
|
|
class LoginWorldServersRepository: public BaseLoginWorldServersRepository {
|
|
public:
|
|
static LoginWorldServers GetFromWorldContext(Database &db, LoginWorldContext c) {
|
|
std::string where = fmt::format(
|
|
"short_name = '{}' AND long_name = '{}'",
|
|
Strings::Escape(c.short_name),
|
|
Strings::Escape(c.long_name)
|
|
);
|
|
|
|
if (c.admin_id > 0) {
|
|
where += fmt::format(" AND login_server_admin_id = {}", c.admin_id);
|
|
}
|
|
|
|
where += " LIMIT 1";
|
|
|
|
auto results = GetWhere(db, where);
|
|
auto e = NewEntity();
|
|
if (results.size() == 1) {
|
|
e = results.front();
|
|
}
|
|
|
|
return e;
|
|
}
|
|
};
|
|
|
|
#endif //EQEMU_LOGIN_WORLD_SERVERS_REPOSITORY_H
|