console: add basic code.

This commit is contained in:
2025-06-20 17:21:58 +08:00
parent 6aea5f6614
commit 61aee68800
6 changed files with 98 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
#include <Util.h>
#include "Console.h"
#include "Helper.h"
#ifndef COMPILER_USE_MINGW
#include <crashelper.h>
@@ -9,6 +10,10 @@
int main(int argc, char* argv[])
{
if (argc < 3) {
std::cerr << "Usage arg is ip port." << std::endl;
return 0;
}
#ifndef COMPILER_USE_MINGW
auto configDir = Util::GetCurConfigPath("frelay");
@@ -25,5 +30,12 @@ int main(int argc, char* argv[])
Util::InitLogger("frelayConsole.log", "frelayConsole");
qInstallMessageHandler(Util::ConsoleMsgHander);
auto* core = new ClientCore();
auto* helper = new ConsoleHelper();
helper->SetIpPort(argv[1], QString("%1").arg(argv[2]).toInt());
helper->RunWorker(core);
helper->Connect();
return app.exec();
}