From 860af5af8228d4bf4a0b22a52a036e052e48e8f6 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Mon, 23 Aug 2021 05:58:20 +0200 Subject: [PATCH] Setup basic strcuture Welcome to the ride. You may witness me slowly loosing my sanity on this. --- core/core.pro | 13 +++++- core/include/logger/u_logger.h | 31 ++++++++++++++ core/include/logger/u_logger_datatypes.h | 52 ++++++++++++++++++++++++ core/include/logger/writer_full.h | 31 ++++++++++++++ core/include/logger/writer_modcall.h | 32 +++++++++++++++ core/include/logger/writer_sql.h | 31 ++++++++++++++ core/src/logger/u_logger.cpp | 24 +++++++++++ core/src/logger/writer_full.cpp | 24 +++++++++++ core/src/logger/writer_modcall.cpp | 24 +++++++++++ core/src/logger/writer_sql.cpp | 24 +++++++++++ 10 files changed, 284 insertions(+), 2 deletions(-) create mode 100644 core/include/logger/u_logger.h create mode 100644 core/include/logger/u_logger_datatypes.h create mode 100644 core/include/logger/writer_full.h create mode 100644 core/include/logger/writer_modcall.h create mode 100644 core/include/logger/writer_sql.h create mode 100644 core/src/logger/u_logger.cpp create mode 100644 core/src/logger/writer_full.cpp create mode 100644 core/src/logger/writer_modcall.cpp create mode 100644 core/src/logger/writer_sql.cpp diff --git a/core/core.pro b/core/core.pro index 26f72c2..29d0c86 100644 --- a/core/core.pro +++ b/core/core.pro @@ -46,7 +46,11 @@ SOURCES += \ src/testimony_recorder.cpp \ src/ws_client.cpp \ src/ws_proxy.cpp \ - src/http_advertiser.cpp + src/http_advertiser.cpp \ + src/logger/u_logger.cpp \ + src/logger/writer_modcall.cpp \ + src/logger/writer_full.cpp \ + src/logger/writer_sql.cpp HEADERS += include/advertiser.h \ include/aoclient.h \ @@ -60,4 +64,9 @@ HEADERS += include/advertiser.h \ include/server.h \ include/ws_client.h \ include/ws_proxy.h \ - include/http_advertiser.h + include/http_advertiser.h \ + include/logger/u_logger.h \ + include/logger/u_logger_datatypes.h \ + include/logger/writer_modcall.h \ + include/logger/writer_full.h \ + include/logger/writer_sql.h diff --git a/core/include/logger/u_logger.h b/core/include/logger/u_logger.h new file mode 100644 index 0000000..6864f95 --- /dev/null +++ b/core/include/logger/u_logger.h @@ -0,0 +1,31 @@ +////////////////////////////////////////////////////////////////////////////////////// +// akashi - a server for Attorney Online 2 // +// Copyright (C) 2020 scatterflower // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +////////////////////////////////////////////////////////////////////////////////////// +#ifndef U_LOGGER_H +#define U_LOGGER_H +#include + +class ULogger : public QObject +{ + Q_OBJECT +public: + ULogger(QObject* parent = nullptr); + virtual ~ULogger(); + +}; + +#endif //U_LOGGER_H diff --git a/core/include/logger/u_logger_datatypes.h b/core/include/logger/u_logger_datatypes.h new file mode 100644 index 0000000..819b080 --- /dev/null +++ b/core/include/logger/u_logger_datatypes.h @@ -0,0 +1,52 @@ +////////////////////////////////////////////////////////////////////////////////////// +// akashi - a server for Attorney Online 2 // +// Copyright (C) 2020 scatterflower // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +////////////////////////////////////////////////////////////////////////////////////// +#ifndef U_LOGGER_DATATYPES_H +#define U_LOGGER_DATATYPES_H + +#include +#include "include/area_data.h" + +class MessageLog { +public: + + explicit MessageLog(); + struct m_content { + QString charname; + QString oocname; + int charID; + QString IPID; + QString HDID; + QString message; + AreaData* area; + }; +}; + +class ModerativeLog { +public: + explicit ModerativeLog(); + struct m_content { + QString moderatorName; + QString ipid; + QString hdid; + QString targetName; + QString targetOOCName; + AreaData* area; + }; +}; + +#endif // U_LOGGER_DATATYPES_H diff --git a/core/include/logger/writer_full.h b/core/include/logger/writer_full.h new file mode 100644 index 0000000..d8ae78d --- /dev/null +++ b/core/include/logger/writer_full.h @@ -0,0 +1,31 @@ +////////////////////////////////////////////////////////////////////////////////////// +// akashi - a server for Attorney Online 2 // +// Copyright (C) 2020 scatterflower // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +////////////////////////////////////////////////////////////////////////////////////// +#ifndef WRITER_FULL_H +#define WRITER_FULL_H +#include + +class WriterFull : public QObject +{ + Q_OBJECT +public: + WriterFull(QObject* parent = nullptr);; + virtual ~WriterFull() {} + +}; + +#endif //WRITER_FULL_H diff --git a/core/include/logger/writer_modcall.h b/core/include/logger/writer_modcall.h new file mode 100644 index 0000000..6329dd2 --- /dev/null +++ b/core/include/logger/writer_modcall.h @@ -0,0 +1,32 @@ +////////////////////////////////////////////////////////////////////////////////////// +// akashi - a server for Attorney Online 2 // +// Copyright (C) 2020 scatterflower // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +////////////////////////////////////////////////////////////////////////////////////// +#ifndef WRITER_MODCALL_H +#define WRITER_MODCALL_H +#include + +class WriterModcall : public QObject +{ + Q_OBJECT +public: + WriterModcall(QObject* parent = nullptr);; + virtual ~WriterModcall() {} + +}; + + +#endif //WRITER_MODCALL_H diff --git a/core/include/logger/writer_sql.h b/core/include/logger/writer_sql.h new file mode 100644 index 0000000..96978c5 --- /dev/null +++ b/core/include/logger/writer_sql.h @@ -0,0 +1,31 @@ +////////////////////////////////////////////////////////////////////////////////////// +// akashi - a server for Attorney Online 2 // +// Copyright (C) 2020 scatterflower // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +////////////////////////////////////////////////////////////////////////////////////// +#ifndef WRITER_SQL_H +#define WRITER_SQL_H +#include + +class WriterSQL : public QObject +{ + Q_OBJECT +public: + WriterSQL(QObject* parent = nullptr);; + virtual ~WriterSQL() {} + +}; + +#endif //WRITER_SQL_H diff --git a/core/src/logger/u_logger.cpp b/core/src/logger/u_logger.cpp new file mode 100644 index 0000000..483ff9c --- /dev/null +++ b/core/src/logger/u_logger.cpp @@ -0,0 +1,24 @@ +////////////////////////////////////////////////////////////////////////////////////// +// akashi - a server for Attorney Online 2 // +// Copyright (C) 2020 scatterflower // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +////////////////////////////////////////////////////////////////////////////////////// +#include "include/logger/u_logger.h" + +ULogger::ULogger(QObject* parent) : + QObject(parent) +{ + +} diff --git a/core/src/logger/writer_full.cpp b/core/src/logger/writer_full.cpp new file mode 100644 index 0000000..4e406a6 --- /dev/null +++ b/core/src/logger/writer_full.cpp @@ -0,0 +1,24 @@ +////////////////////////////////////////////////////////////////////////////////////// +// akashi - a server for Attorney Online 2 // +// Copyright (C) 2020 scatterflower // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +////////////////////////////////////////////////////////////////////////////////////// +#include "include/logger/writer_full.h" + +WriterFull::WriterFull(QObject* parent) : + QObject(parent) +{ + +}; diff --git a/core/src/logger/writer_modcall.cpp b/core/src/logger/writer_modcall.cpp new file mode 100644 index 0000000..6266269 --- /dev/null +++ b/core/src/logger/writer_modcall.cpp @@ -0,0 +1,24 @@ +////////////////////////////////////////////////////////////////////////////////////// +// akashi - a server for Attorney Online 2 // +// Copyright (C) 2020 scatterflower // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +////////////////////////////////////////////////////////////////////////////////////// +#include "include/logger/writer_modcall.h" + +WriterModcall::WriterModcall(QObject* parent) : + QObject(parent) +{ + +}; diff --git a/core/src/logger/writer_sql.cpp b/core/src/logger/writer_sql.cpp new file mode 100644 index 0000000..9aa667e --- /dev/null +++ b/core/src/logger/writer_sql.cpp @@ -0,0 +1,24 @@ +////////////////////////////////////////////////////////////////////////////////////// +// akashi - a server for Attorney Online 2 // +// Copyright (C) 2020 scatterflower // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +////////////////////////////////////////////////////////////////////////////////////// +#include "include/logger/writer_sql.h" + +WriterSQL::WriterSQL(QObject* parent) : + QObject(parent) +{ + +};