From c041fca1ae932bb31ad64f1acd097bb84323e0eb Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 12 Sep 2024 15:57:53 +0200 Subject: [PATCH] Add Brokk and Sintri Skeletons --- .gitignore | 14 + rAthena.sln | 354 -------------------------- src/bot/Brokk/Brokk.vcxproj | 9 +- src/bot/Brokk/brokk.cpp | 42 ++- src/bot/Brokk/brokk.hpp | 4 +- src/bot/Brokk/sindri.hpp | 34 +++ src/bot/Sindri/Sindri.vcxproj | 12 +- src/bot/Sindri/Sindri.vcxproj.filters | 5 + src/bot/Sindri/sindri.cpp | 42 ++- src/common/core.cpp | 126 +++++++++ src/common/core.hpp | 9 + 11 files changed, 283 insertions(+), 368 deletions(-) delete mode 100644 rAthena.sln create mode 100644 src/bot/Brokk/sindri.hpp diff --git a/.gitignore b/.gitignore index ee26648..96334eb 100644 --- a/.gitignore +++ b/.gitignore @@ -594,3 +594,17 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ +/conf +/db/import +/charserv.bat +/csv2yaml.bat +/logserv.bat +/mapcache.bat +/mapserv.bat +/navigenerator.bat +/rAthena.sln +/runserver.bat +/serv.bat +/webserv.bat +/yaml2sql.bat +/yamlupgrade.bat diff --git a/rAthena.sln b/rAthena.sln deleted file mode 100644 index dd330d3..0000000 --- a/rAthena.sln +++ /dev/null @@ -1,354 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.0.0 -MinimumVisualStudioVersion = 15.0.0.0 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdparty", "3rdparty", "{6ABA1767-6242-4CA0-BA22-A30972DC8918}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "src\common\common.vcxproj", "{F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}" - ProjectSection(ProjectDependencies) = postProject - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD} = {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD} - {492E2981-34F4-3A6A-BFD9-46096C641203} = {492E2981-34F4-3A6A-BFD9-46096C641203} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig", "3rdparty\libconfig\libconfig.vcxproj", "{F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{60D3315D-FBF4-4FBF-8D44-99D5BED11D32}" - ProjectSection(SolutionItems) = preProject - src\config\const.hpp = src\config\const.hpp - src\config\core.hpp = src\config\core.hpp - src\config\classes\general.hpp = src\config\classes\general.hpp - src\config\packets.hpp = src\config\packets.hpp - src\config\renewal.hpp = src\config\renewal.hpp - src\config\secure.hpp = src\config\secure.hpp - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "classes", "classes", "{33B49CB8-CBE3-4ED2-86DD-C9A351AC9026}" - ProjectSection(SolutionItems) = preProject - src\config\classes\general.hpp = src\config\classes\general.hpp - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Custom", "Custom", "{6513C8D3-D15F-45D4-9AD8-6286CBA7EE36}" - ProjectSection(SolutionItems) = preProject - src\custom\atcommand.inc = src\custom\atcommand.inc - src\custom\atcommand_def.inc = src\custom\atcommand_def.inc - src\custom\battle_config_init.inc = src\custom\battle_config_init.inc - src\custom\battle_config_struct.inc = src\custom\battle_config_struct.inc - src\custom\defines_post.hpp = src\custom\defines_post.hpp - src\custom\defines_pre.hpp = src\custom\defines_pre.hpp - src\custom\script.inc = src\custom\script.inc - src\custom\script_def.inc = src\custom\script_def.inc - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "server-components", "server-components", "{6D9F5D00-2988-4812-844D-D155C4F588DC}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{C0A6FC9A-3A5C-48F8-A4B6-8D463C61C021}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "login-server", "src\login\login-server.vcxproj", "{864805EA-FD39-453D-9248-C581951BA058}" - ProjectSection(ProjectDependencies) = postProject - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} = {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "char-server", "src\char\char-server.vcxproj", "{FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}" - ProjectSection(ProjectDependencies) = postProject - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} = {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "map-server", "src\map\map-server.vcxproj", "{B4114A9C-EEA4-433C-A830-56119A984F24}" - ProjectSection(ProjectDependencies) = postProject - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} = {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "map-server-generator", "src\map\map-server-generator.vcxproj", "{EB03BC16-8A47-43B9-B5BB-D0200E4A2775}" - ProjectSection(ProjectDependencies) = postProject - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} = {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common-minicore", "src\common\common-minicore.vcxproj", "{352B45B3-FE88-4431-9D89-48CF811446DB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{9F328FE9-129D-4C0C-820B-BE4AA5996652}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapcache", "src\tool\mapcache.vcxproj", "{FC4C071B-2C26-4B03-948A-335C94A88B5E}" - ProjectSection(ProjectDependencies) = postProject - {352B45B3-FE88-4431-9D89-48CF811446DB} = {352B45B3-FE88-4431-9D89-48CF811446DB} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml-cpp", "3rdparty\yaml-cpp\yaml-cpp.vcxproj", "{61D6A599-6BED-4154-A9FC-40553BD972E0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csv2yaml", "src\tool\csv2yaml.vcxproj", "{5A9059F2-4933-49A2-BEE6-CC67F66FA070}" - ProjectSection(ProjectDependencies) = postProject - {61D6A599-6BED-4154-A9FC-40553BD972E0} = {61D6A599-6BED-4154-A9FC-40553BD972E0} - {492E2981-34F4-3A6A-BFD9-46096C641203} = {492E2981-34F4-3A6A-BFD9-46096C641203} - {352B45B3-FE88-4431-9D89-48CF811446DB} = {352B45B3-FE88-4431-9D89-48CF811446DB} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml2sql", "src\tool\yaml2sql.vcxproj", "{CDBBB260-B245-44EC-80FB-3F9421885E40}" - ProjectSection(ProjectDependencies) = postProject - {61D6A599-6BED-4154-A9FC-40553BD972E0} = {61D6A599-6BED-4154-A9FC-40553BD972E0} - {492E2981-34F4-3A6A-BFD9-46096C641203} = {492E2981-34F4-3A6A-BFD9-46096C641203} - {352B45B3-FE88-4431-9D89-48CF811446DB} = {352B45B3-FE88-4431-9D89-48CF811446DB} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "web-server", "src\web\web-server.vcxproj", "{5809F27D-65B5-46A3-A340-C8685A8C09F4}" - ProjectSection(ProjectDependencies) = postProject - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} = {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6} = {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "httplib", "3rdparty\httplib\httplib.vcxproj", "{7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yamlupgrade", "src\tool\yamlupgrade.vcxproj", "{9115C6D1-520A-4540-B4FE-95F3C923FE2C}" - ProjectSection(ProjectDependencies) = postProject - {61D6A599-6BED-4154-A9FC-40553BD972E0} = {61D6A599-6BED-4154-A9FC-40553BD972E0} - {492E2981-34F4-3A6A-BFD9-46096C641203} = {492E2981-34F4-3A6A-BFD9-46096C641203} - {352B45B3-FE88-4431-9D89-48CF811446DB} = {352B45B3-FE88-4431-9D89-48CF811446DB} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ryml", "3rdparty\rapidyaml\ryml.vcxproj", "{492E2981-34F4-3A6A-BFD9-46096C641203}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Brokk", "src\bot\Brokk\Brokk.vcxproj", "{78A0D59E-F3F7-4A8D-B0CD-597D33655631}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sindri", "src\bot\Sindri\Sindri.vcxproj", "{EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Any CPU = Release|Any CPU - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Debug|Any CPU.ActiveCfg = Debug|x64 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Debug|Any CPU.Build.0 = Debug|x64 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Debug|Win32.ActiveCfg = Debug|Win32 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Debug|Win32.Build.0 = Debug|Win32 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Debug|x64.ActiveCfg = Debug|x64 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Debug|x64.Build.0 = Debug|x64 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Release|Any CPU.ActiveCfg = Release|x64 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Release|Any CPU.Build.0 = Release|x64 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Release|Win32.ActiveCfg = Release|Win32 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Release|Win32.Build.0 = Release|Win32 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Release|x64.ActiveCfg = Release|x64 - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559}.Release|x64.Build.0 = Release|x64 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Debug|Any CPU.ActiveCfg = Debug|x64 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Debug|Any CPU.Build.0 = Debug|x64 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Debug|Win32.ActiveCfg = Debug|Win32 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Debug|Win32.Build.0 = Debug|Win32 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Debug|x64.ActiveCfg = Debug|x64 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Debug|x64.Build.0 = Debug|x64 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Release|Any CPU.ActiveCfg = Release|x64 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Release|Any CPU.Build.0 = Release|x64 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Release|Win32.ActiveCfg = Release|Win32 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Release|Win32.Build.0 = Release|Win32 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Release|x64.ActiveCfg = Release|x64 - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD}.Release|x64.Build.0 = Release|x64 - {864805EA-FD39-453D-9248-C581951BA058}.Debug|Any CPU.ActiveCfg = Debug|x64 - {864805EA-FD39-453D-9248-C581951BA058}.Debug|Any CPU.Build.0 = Debug|x64 - {864805EA-FD39-453D-9248-C581951BA058}.Debug|Win32.ActiveCfg = Debug|Win32 - {864805EA-FD39-453D-9248-C581951BA058}.Debug|Win32.Build.0 = Debug|Win32 - {864805EA-FD39-453D-9248-C581951BA058}.Debug|x64.ActiveCfg = Debug|x64 - {864805EA-FD39-453D-9248-C581951BA058}.Debug|x64.Build.0 = Debug|x64 - {864805EA-FD39-453D-9248-C581951BA058}.Release|Any CPU.ActiveCfg = Release|x64 - {864805EA-FD39-453D-9248-C581951BA058}.Release|Any CPU.Build.0 = Release|x64 - {864805EA-FD39-453D-9248-C581951BA058}.Release|Win32.ActiveCfg = Release|Win32 - {864805EA-FD39-453D-9248-C581951BA058}.Release|Win32.Build.0 = Release|Win32 - {864805EA-FD39-453D-9248-C581951BA058}.Release|x64.ActiveCfg = Release|x64 - {864805EA-FD39-453D-9248-C581951BA058}.Release|x64.Build.0 = Release|x64 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Debug|Any CPU.ActiveCfg = Debug|x64 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Debug|Any CPU.Build.0 = Debug|x64 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Debug|Win32.ActiveCfg = Debug|Win32 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Debug|Win32.Build.0 = Debug|Win32 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Debug|x64.ActiveCfg = Debug|x64 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Debug|x64.Build.0 = Debug|x64 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Release|Any CPU.ActiveCfg = Release|x64 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Release|Any CPU.Build.0 = Release|x64 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Release|Win32.ActiveCfg = Release|Win32 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Release|Win32.Build.0 = Release|Win32 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Release|x64.ActiveCfg = Release|x64 - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23}.Release|x64.Build.0 = Release|x64 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Debug|Any CPU.ActiveCfg = Debug|x64 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Debug|Any CPU.Build.0 = Debug|x64 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Debug|Win32.ActiveCfg = Debug|Win32 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Debug|Win32.Build.0 = Debug|Win32 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Debug|x64.ActiveCfg = Debug|x64 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Debug|x64.Build.0 = Debug|x64 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Release|Any CPU.ActiveCfg = Release|x64 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Release|Any CPU.Build.0 = Release|x64 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Release|Win32.ActiveCfg = Release|Win32 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Release|Win32.Build.0 = Release|Win32 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Release|x64.ActiveCfg = Release|x64 - {B4114A9C-EEA4-433C-A830-56119A984F24}.Release|x64.Build.0 = Release|x64 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Debug|Any CPU.ActiveCfg = Debug|x64 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Debug|Any CPU.Build.0 = Debug|x64 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Debug|Win32.ActiveCfg = Debug|Win32 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Debug|Win32.Build.0 = Debug|Win32 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Debug|x64.ActiveCfg = Debug|x64 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Debug|x64.Build.0 = Debug|x64 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Release|Any CPU.ActiveCfg = Release|x64 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Release|Any CPU.Build.0 = Release|x64 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Release|Win32.ActiveCfg = Release|Win32 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Release|Win32.Build.0 = Release|Win32 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Release|x64.ActiveCfg = Release|x64 - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775}.Release|x64.Build.0 = Release|x64 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Debug|Any CPU.ActiveCfg = Debug|x64 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Debug|Any CPU.Build.0 = Debug|x64 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Debug|Win32.ActiveCfg = Debug|Win32 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Debug|Win32.Build.0 = Debug|Win32 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Debug|x64.ActiveCfg = Debug|x64 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Debug|x64.Build.0 = Debug|x64 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Release|Any CPU.ActiveCfg = Release|x64 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Release|Any CPU.Build.0 = Release|x64 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Release|Win32.ActiveCfg = Release|Win32 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Release|Win32.Build.0 = Release|Win32 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Release|x64.ActiveCfg = Release|x64 - {352B45B3-FE88-4431-9D89-48CF811446DB}.Release|x64.Build.0 = Release|x64 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Debug|Any CPU.ActiveCfg = Debug|x64 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Debug|Any CPU.Build.0 = Debug|x64 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Debug|Win32.ActiveCfg = Debug|Win32 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Debug|Win32.Build.0 = Debug|Win32 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Debug|x64.ActiveCfg = Debug|x64 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Debug|x64.Build.0 = Debug|x64 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Release|Any CPU.ActiveCfg = Release|x64 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Release|Any CPU.Build.0 = Release|x64 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Release|Win32.ActiveCfg = Release|Win32 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Release|Win32.Build.0 = Release|Win32 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Release|x64.ActiveCfg = Release|x64 - {FC4C071B-2C26-4B03-948A-335C94A88B5E}.Release|x64.Build.0 = Release|x64 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Debug|Any CPU.ActiveCfg = Debug|x64 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Debug|Any CPU.Build.0 = Debug|x64 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Debug|Win32.ActiveCfg = Debug|Win32 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Debug|Win32.Build.0 = Debug|Win32 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Debug|x64.ActiveCfg = Debug|x64 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Debug|x64.Build.0 = Debug|x64 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Release|Any CPU.ActiveCfg = Release|x64 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Release|Any CPU.Build.0 = Release|x64 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Release|Win32.ActiveCfg = Release|Win32 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Release|Win32.Build.0 = Release|Win32 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Release|x64.ActiveCfg = Release|x64 - {61D6A599-6BED-4154-A9FC-40553BD972E0}.Release|x64.Build.0 = Release|x64 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Debug|Any CPU.ActiveCfg = Debug|x64 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Debug|Any CPU.Build.0 = Debug|x64 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Debug|Win32.ActiveCfg = Debug|Win32 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Debug|Win32.Build.0 = Debug|Win32 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Debug|x64.ActiveCfg = Debug|x64 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Debug|x64.Build.0 = Debug|x64 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Release|Any CPU.ActiveCfg = Release|x64 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Release|Any CPU.Build.0 = Release|x64 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Release|Win32.ActiveCfg = Release|Win32 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Release|Win32.Build.0 = Release|Win32 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Release|x64.ActiveCfg = Release|x64 - {5A9059F2-4933-49A2-BEE6-CC67F66FA070}.Release|x64.Build.0 = Release|x64 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Debug|Any CPU.ActiveCfg = Debug|x64 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Debug|Any CPU.Build.0 = Debug|x64 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Debug|Win32.ActiveCfg = Debug|Win32 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Debug|Win32.Build.0 = Debug|Win32 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Debug|x64.ActiveCfg = Debug|x64 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Debug|x64.Build.0 = Debug|x64 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Release|Any CPU.ActiveCfg = Release|x64 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Release|Any CPU.Build.0 = Release|x64 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Release|Win32.ActiveCfg = Release|Win32 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Release|Win32.Build.0 = Release|Win32 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Release|x64.ActiveCfg = Release|x64 - {CDBBB260-B245-44EC-80FB-3F9421885E40}.Release|x64.Build.0 = Release|x64 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Debug|Any CPU.ActiveCfg = Debug|x64 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Debug|Any CPU.Build.0 = Debug|x64 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Debug|Win32.ActiveCfg = Debug|Win32 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Debug|Win32.Build.0 = Debug|Win32 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Debug|x64.ActiveCfg = Debug|x64 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Debug|x64.Build.0 = Debug|x64 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Release|Any CPU.ActiveCfg = Release|x64 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Release|Any CPU.Build.0 = Release|x64 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Release|Win32.ActiveCfg = Release|Win32 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Release|Win32.Build.0 = Release|Win32 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Release|x64.ActiveCfg = Release|x64 - {5809F27D-65B5-46A3-A340-C8685A8C09F4}.Release|x64.Build.0 = Release|x64 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Debug|Any CPU.ActiveCfg = Debug|x64 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Debug|Any CPU.Build.0 = Debug|x64 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Debug|Win32.ActiveCfg = Debug|Win32 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Debug|Win32.Build.0 = Debug|Win32 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Debug|x64.ActiveCfg = Debug|x64 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Debug|x64.Build.0 = Debug|x64 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Release|Any CPU.ActiveCfg = Release|x64 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Release|Any CPU.Build.0 = Release|x64 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Release|Win32.ActiveCfg = Release|Win32 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Release|Win32.Build.0 = Release|Win32 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Release|x64.ActiveCfg = Release|x64 - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6}.Release|x64.Build.0 = Release|x64 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Debug|Any CPU.ActiveCfg = Debug|x64 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Debug|Any CPU.Build.0 = Debug|x64 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Debug|Win32.ActiveCfg = Debug|Win32 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Debug|Win32.Build.0 = Debug|Win32 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Debug|x64.ActiveCfg = Debug|x64 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Debug|x64.Build.0 = Debug|x64 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Release|Any CPU.ActiveCfg = Release|x64 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Release|Any CPU.Build.0 = Release|x64 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Release|Win32.ActiveCfg = Release|Win32 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Release|Win32.Build.0 = Release|Win32 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Release|x64.ActiveCfg = Release|x64 - {9115C6D1-520A-4540-B4FE-95F3C923FE2C}.Release|x64.Build.0 = Release|x64 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Debug|Any CPU.ActiveCfg = Debug|x64 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Debug|Any CPU.Build.0 = Debug|x64 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Debug|Win32.ActiveCfg = Debug|Win32 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Debug|Win32.Build.0 = Debug|Win32 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Debug|x64.ActiveCfg = Debug|x64 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Debug|x64.Build.0 = Debug|x64 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Release|Any CPU.ActiveCfg = Release|x64 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Release|Any CPU.Build.0 = Release|x64 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Release|Win32.ActiveCfg = Release|Win32 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Release|Win32.Build.0 = Release|Win32 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Release|x64.ActiveCfg = Release|x64 - {492E2981-34F4-3A6A-BFD9-46096C641203}.Release|x64.Build.0 = Release|x64 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Debug|Any CPU.ActiveCfg = Debug|x64 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Debug|Any CPU.Build.0 = Debug|x64 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Debug|Win32.ActiveCfg = Debug|Win32 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Debug|Win32.Build.0 = Debug|Win32 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Debug|x64.ActiveCfg = Debug|x64 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Debug|x64.Build.0 = Debug|x64 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Release|Any CPU.ActiveCfg = Release|x64 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Release|Any CPU.Build.0 = Release|x64 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Release|Win32.ActiveCfg = Release|Win32 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Release|Win32.Build.0 = Release|Win32 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Release|x64.ActiveCfg = Release|x64 - {78A0D59E-F3F7-4A8D-B0CD-597D33655631}.Release|x64.Build.0 = Release|x64 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Debug|Any CPU.ActiveCfg = Debug|x64 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Debug|Any CPU.Build.0 = Debug|x64 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Debug|Win32.ActiveCfg = Debug|Win32 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Debug|Win32.Build.0 = Debug|Win32 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Debug|x64.ActiveCfg = Debug|x64 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Debug|x64.Build.0 = Debug|x64 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Release|Any CPU.ActiveCfg = Release|x64 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Release|Any CPU.Build.0 = Release|x64 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Release|Win32.ActiveCfg = Release|Win32 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Release|Win32.Build.0 = Release|Win32 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Release|x64.ActiveCfg = Release|x64 - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {F8FD7B1E-8E1C-4CC3-9CD1-2E28F77B6559} = {C0A6FC9A-3A5C-48F8-A4B6-8D463C61C021} - {F6CC5F60-BD13-41B1-81D3-822A45EC0DBD} = {6ABA1767-6242-4CA0-BA22-A30972DC8918} - {33B49CB8-CBE3-4ED2-86DD-C9A351AC9026} = {60D3315D-FBF4-4FBF-8D44-99D5BED11D32} - {864805EA-FD39-453D-9248-C581951BA058} = {6D9F5D00-2988-4812-844D-D155C4F588DC} - {FED3A941-0AF7-49FE-85CF-E1DFDC0EBB23} = {6D9F5D00-2988-4812-844D-D155C4F588DC} - {B4114A9C-EEA4-433C-A830-56119A984F24} = {6D9F5D00-2988-4812-844D-D155C4F588DC} - {EB03BC16-8A47-43B9-B5BB-D0200E4A2775} = {9F328FE9-129D-4C0C-820B-BE4AA5996652} - {352B45B3-FE88-4431-9D89-48CF811446DB} = {C0A6FC9A-3A5C-48F8-A4B6-8D463C61C021} - {FC4C071B-2C26-4B03-948A-335C94A88B5E} = {9F328FE9-129D-4C0C-820B-BE4AA5996652} - {61D6A599-6BED-4154-A9FC-40553BD972E0} = {6ABA1767-6242-4CA0-BA22-A30972DC8918} - {5A9059F2-4933-49A2-BEE6-CC67F66FA070} = {9F328FE9-129D-4C0C-820B-BE4AA5996652} - {CDBBB260-B245-44EC-80FB-3F9421885E40} = {9F328FE9-129D-4C0C-820B-BE4AA5996652} - {5809F27D-65B5-46A3-A340-C8685A8C09F4} = {6D9F5D00-2988-4812-844D-D155C4F588DC} - {7A1A25BC-2CF7-44B2-8CAF-B4273B510FC6} = {6ABA1767-6242-4CA0-BA22-A30972DC8918} - {9115C6D1-520A-4540-B4FE-95F3C923FE2C} = {9F328FE9-129D-4C0C-820B-BE4AA5996652} - {492E2981-34F4-3A6A-BFD9-46096C641203} = {6ABA1767-6242-4CA0-BA22-A30972DC8918} - {78A0D59E-F3F7-4A8D-B0CD-597D33655631} = {6D9F5D00-2988-4812-844D-D155C4F588DC} - {EF1BCCEB-381A-4EB9-B8CF-52CEAB17389D} = {6D9F5D00-2988-4812-844D-D155C4F588DC} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {026DA20F-820C-40AA-983E-0E231EA90AD5} - EndGlobalSection -EndGlobal diff --git a/src/bot/Brokk/Brokk.vcxproj b/src/bot/Brokk/Brokk.vcxproj index a77e9e5..0ee1c6e 100644 --- a/src/bot/Brokk/Brokk.vcxproj +++ b/src/bot/Brokk/Brokk.vcxproj @@ -106,10 +106,15 @@ Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + $(DefineConstants);WIN32;FD_SETSIZE=4096;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;LIBCONFIG_STATIC;YY_USE_CONST;_DEBUG;_CONSOLE;_LIB;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) true stdcpp17 + + MultiThreadedDebug + $(SolutionDir)src;$(SolutionDir)3rdparty\rapidyaml\src;$(SolutionDir)3rdparty\rapidyaml\ext\c4core\src;$(SolutionDir)3rdparty\libconfig\;%(AdditionalIncludeDirectories) + true Console diff --git a/src/bot/Brokk/brokk.cpp b/src/bot/Brokk/brokk.cpp index 48f1ec1..b0e6062 100644 --- a/src/bot/Brokk/brokk.cpp +++ b/src/bot/Brokk/brokk.cpp @@ -3,11 +3,45 @@ // that any distributed versions must include an attribution to the original author (4lexKidd) in all copies // or substantial portions of the software. +#pragma warning(disable:4800) +#include "brokk.hpp" -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //ip2str +#include +#include +#include +#include +#include -int main() -{ - std::cout << "Hello World!\n"; +using namespace rathena; +using namespace rathena::server_brokk; + + +void BrokkServer::finalize() { + + ShowStatus("Finished.\n"); +} + +void BrokkServer::handle_shutdown() { + ShowStatus("Shutting down...\n"); + + flush_fifos(); +} + +bool BrokkServer::initialize(int argc, char* argv[]) { + + return true; +} + +int main(int argc, char* argv[]) { + return main_bot_core(argc, argv); } diff --git a/src/bot/Brokk/brokk.hpp b/src/bot/Brokk/brokk.hpp index cd63404..099fd33 100644 --- a/src/bot/Brokk/brokk.hpp +++ b/src/bot/Brokk/brokk.hpp @@ -16,8 +16,8 @@ using rathena::server_core::Core; using rathena::server_core::e_core_type; namespace rathena { - namespace server_login { - class LoginServer : public Core { + namespace server_brokk { + class BrokkServer : public Core { protected: bool initialize(int argc, char* argv[]) override; void finalize() override; diff --git a/src/bot/Brokk/sindri.hpp b/src/bot/Brokk/sindri.hpp new file mode 100644 index 0000000..a2d505e --- /dev/null +++ b/src/bot/Brokk/sindri.hpp @@ -0,0 +1,34 @@ +// Copyright (c) 4lexKidd +// This software is licensed under the GPL v3 as to be fitting with the rathena project with the additional requirement +// that any distributed versions must include an attribution to the original author (4lexKidd) in all copies +// or substantial portions of the software. + +#ifndef SINDRI_HPP +#define SINDRI_HPP +#include + +#include +#include +#include // NAME_LENGTH,SEX_* +#include +#include + +using rathena::server_core::Core; +using rathena::server_core::e_core_type; + +namespace rathena { + namespace server_sindri { + class SindriServer : public Core { + protected: + bool initialize(int argc, char* argv[]) override; + void finalize() override; + void handle_shutdown() override; + + public: + SindriServer() : Core(e_core_type::SINDRI) { + + } + }; + } +} +#endif /* SINDRI_HPP */ diff --git a/src/bot/Sindri/Sindri.vcxproj b/src/bot/Sindri/Sindri.vcxproj index 3e14623..b335028 100644 --- a/src/bot/Sindri/Sindri.vcxproj +++ b/src/bot/Sindri/Sindri.vcxproj @@ -106,10 +106,15 @@ Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + $(DefineConstants);WIN32;FD_SETSIZE=4096;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;LIBCONFIG_STATIC;YY_USE_CONST;_DEBUG;_CONSOLE;_LIB;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) true stdcpp17 + MultiThreadedDebug + + $(SolutionDir)src;$(SolutionDir)3rdparty\rapidyaml\src;$(SolutionDir)3rdparty\rapidyaml\ext\c4core\src;$(SolutionDir)3rdparty\libconfig\;%(AdditionalIncludeDirectories) + true Console @@ -136,6 +141,9 @@ + + + diff --git a/src/bot/Sindri/Sindri.vcxproj.filters b/src/bot/Sindri/Sindri.vcxproj.filters index 678bf86..fa5db03 100644 --- a/src/bot/Sindri/Sindri.vcxproj.filters +++ b/src/bot/Sindri/Sindri.vcxproj.filters @@ -19,4 +19,9 @@ Quelldateien + + + Headerdateien + + \ No newline at end of file diff --git a/src/bot/Sindri/sindri.cpp b/src/bot/Sindri/sindri.cpp index 2a35b29..4c914a1 100644 --- a/src/bot/Sindri/sindri.cpp +++ b/src/bot/Sindri/sindri.cpp @@ -3,9 +3,43 @@ // that any distributed versions must include an attribution to the original author (4lexKidd) in all copies // or substantial portions of the software. -#include +#pragma warning(disable:4800) +#include "sindri.hpp" -int main() -{ - std::cout << "Hello World!\n"; +#include +#include +#include +#include +#include +#include +#include +#include +#include //ip2str +#include +#include +#include +#include +#include + +using namespace rathena; +using namespace rathena::server_sindri; + + +void SindriServer::finalize() { + + ShowStatus("Finished.\n"); +} + +void SindriServer::handle_shutdown() { + ShowStatus("Shutting down...\n"); + + flush_fifos(); +} + +bool SindriServer::initialize(int argc, char* argv[]) { + + return true; +} +int main(int argc, char* argv[]) { + return main_bot_core(argc, argv); } diff --git a/src/common/core.cpp b/src/common/core.cpp index 1f947f5..a044b48 100644 --- a/src/common/core.cpp +++ b/src/common/core.cpp @@ -313,6 +313,39 @@ static void display_title(void) { else if( git[0] != UNKNOWN_VERSION ) ShowInfo("Git Hash: '" CL_WHITE "%s" CL_RESET "'\n", git); } +/*====================================== + * CORE : Display Bot server title + * ASCII By CalciumKid 1/12/2011 + * BOT ASCII by 4lexKidd 9/12/2024 + *--------------------------------------*/ +static void display_botserver_title(void) { + const char* svn = get_svn_revision(); + const char* git = get_git_hash(); + + ShowMessage("\n"); + ShowMessage("" CL_PASS " " CL_BOLD " " CL_PASS"" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_PASS " " CL_BT_WHITE " rAthena Development Team and 4lexKidd presents " CL_PASS "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_PASS " " CL_BOLD " ___ __ __ " CL_PASS "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_PASS " " CL_BOLD " _____/ | / /_/ /_ ___ ____ ____ _ " CL_PASS "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_PASS " " CL_BOLD " / ___/ /| |/ __/ __ \\/ _ \\/ __ \\/ __ `/ " CL_PASS "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_PASS " " CL_BOLD " / / / ___ / /_/ / / / __/ / / / /_/ / " CL_PASS "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_PASS " " CL_BOLD " /_/ /_/ |_\\__/_/ /_/\\___/_/ /_/\\__,_/ " CL_PASS "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_PASS " " CL_BOLD " " CL_PASS "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_PASS " " CL_GREEN " http://rathena.org/board/ " CL_PASS "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_PASS " " CL_BOLD " " CL_PASS "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_WTBL " " CL_BOLD " " CL_WTBL "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_WTBL " " CL_BOLD " Svartalfheim Edition " CL_WTBL "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_WTBL " " CL_BOLD " " CL_WTBL "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_WTBL " " CL_CYAN " " CL_WTBL "" CL_CLL "" CL_NORMAL "\n"); + ShowMessage("" CL_PASS " " CL_BOLD " " CL_PASS "" CL_CLL "" CL_NORMAL "\n"); + + + if (svn[0] != UNKNOWN_VERSION) + ShowInfo("SVN Revision: '" CL_WHITE "%s" CL_RESET "'\n", svn); + else if (git[0] != UNKNOWN_VERSION) + ShowInfo("Git Hash: '" CL_WHITE "%s" CL_RESET "'\n", git); +} + // Warning if executed as superuser (root) void usercheck(void) @@ -421,6 +454,99 @@ int Core::start( int argc, char **argv ){ return EXIT_SUCCESS; } +int Core::start_botserver(int argc, char** argv) { + // Same as start but slightly modified for the bot servers + if (this->get_status() != e_core_status::NOT_STARTED) { + ShowFatalError("Core was already started and cannot be started again!\n"); + return EXIT_FAILURE; + } + + this->set_status(e_core_status::CORE_INITIALIZING); + + {// initialize program arguments + char* p1; + if ((p1 = strrchr(argv[0], '/')) != nullptr || (p1 = strrchr(argv[0], '\\')) != nullptr) { + char* pwd = nullptr; //path working directory + SERVER_NAME = ++p1; + size_t n = p1 - argv[0]; //calc dir name len + pwd = safestrncpy((char*)malloc(n + 1), argv[0], n); + if (chdir(pwd) != 0) + ShowError("Couldn't change working directory to %s for %s, runtime will probably fail", pwd, SERVER_NAME); + free(pwd); + } + else { + // On Windows the .bat files have the executeable names as parameters without any path seperator [Lemongrass] + SERVER_NAME = argv[0]; + } + } + + malloc_init();// needed for Show* in display_title() [FlavioJS] + display_botserver_title(); + usercheck(); + +#ifndef MINICORE + Sql_Init(); + db_init(); + signals_init(); + do_init_database(); +#ifdef _WIN32 + cevents_init(); +#endif + timer_init(); + socket_init(); +#endif + + this->set_status(e_core_status::CORE_INITIALIZED); + + this->set_status(e_core_status::SERVER_INITIALIZING); + if (!this->initialize(argc, argv)) { + return EXIT_FAILURE; + } + + // If initialization did not trigger shutdown + if (this->m_status != e_core_status::STOPPING) { + this->set_status(e_core_status::SERVER_INITIALIZED); + + this->set_status(e_core_status::RUNNING); +#ifndef MINICORE + if (!this->m_run_once) { + // Main runtime cycle + while (this->get_status() == e_core_status::RUNNING) { + t_tick next = do_timer(gettick_nocache()); + + this->handle_main(next); + } + } +#endif + this->set_status(e_core_status::STOPPING); + } + + this->set_status(e_core_status::SERVER_FINALIZING); + this->finalize(); + this->set_status(e_core_status::SERVER_FINALIZED); + + this->set_status(e_core_status::CORE_FINALIZING); +#ifndef MINICORE + timer_final(); + socket_final(); + db_final(); + ers_final(); +#endif + + malloc_final(); + this->set_status(e_core_status::CORE_FINALIZED); + +#if defined(BUILDBOT) + if (buildbotflag) { + exit(EXIT_FAILURE); + } +#endif + + this->set_status(e_core_status::STOPPED); + + return EXIT_SUCCESS; +} + bool Core::initialize( int argc, char* argv[] ){ // Do nothing return true; diff --git a/src/common/core.hpp b/src/common/core.hpp index a37e0c2..2586e7c 100644 --- a/src/common/core.hpp +++ b/src/common/core.hpp @@ -90,6 +90,7 @@ namespace rathena{ void signal_crash(); void signal_shutdown(); int start( int argc, char* argv[] ); + int start_botserver(int argc, char* argv[]); }; } } @@ -104,4 +105,12 @@ template int main_core( int argc, char *argv[] ){ return server.start( argc, argv ); } +template int main_bot_core(int argc, char* argv[]) { + T server = {}; + + global_core = &server; + + return server.start_botserver(argc, argv); +} + #endif /* CORE_HPP */