Added headless connection stuff, fixing connecting with daybreakconnections

This commit is contained in:
KimLS
2016-11-13 23:28:25 -08:00
parent f07b5d9032
commit 84367e1f77
20 changed files with 546 additions and 41 deletions
+32
View File
@@ -0,0 +1,32 @@
#include "../common/event/event_loop.h"
#include "../common/eqemu_logsys.h"
#include "../common/crash.h"
#include "../common/platform.h"
#include <thread>
#include "login.h"
#include "world.h"
EQEmuLogSys Log;
int main() {
RegisterExecutablePlatform(ExePlatformHC);
Log.LoadLogSettingsDefaults();
set_exception_handler();
Log.OutF(Logs::General, Logs::Headless_Client, "Starting EQEmu Headless Client.");
std::unique_ptr<LoginConnection> login_connection(new LoginConnection("testuser", "testpass", "127.0.0.1", 5999, "KLS Test"));
std::unique_ptr<WorldConnection> world_connection;
login_connection->OnCanLoginToWorld([&](const WorldServer &ws, const std::string &key, uint32_t dbid) {
Log.OutF(Logs::General, Logs::Headless_Client, "Connect to world server {1} - {0}:9000", ws.address, ws.long_name);
world_connection.reset(new WorldConnection(key, dbid, ws.address));
});
for (;;) {
EQ::EventLoop::Get().Process();
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
return 0;
}