增加取网站目录函数

This commit is contained in:
xx
2024-06-10 19:21:13 +08:00
parent 7748600038
commit 5b2f413711
2 changed files with 10 additions and 1 deletions

View File

@@ -5,6 +5,11 @@
#include "core/global.h"
#include "core/app.h"
static ylib::counter<uint64> s_counter_guid;
std::string module::globalfuncs::website_dir(sol::this_state ts)
{
GET_APP;
return app->config->website.dir;
}
void module::globalfuncs::regist(sol::state* lua)
{
lua->set_function("set_ptr", module::globalfuncs::set_ptr);
@@ -13,6 +18,7 @@ void module::globalfuncs::regist(sol::state* lua)
lua->set_function("make_software_guid", module::globalfuncs::make_software_guid);
lua->set_function("throw_string", module::globalfuncs::throw_string);
lua->set_function("print", module::globalfuncs::print);
lua->set_function("website_dir", module::globalfuncs::website_dir);
}
std::string module::globalfuncs::make_software_guid()

View File

@@ -44,7 +44,10 @@ namespace module
/// </summary>
/// <param name="msg"></param>
static void throw_string(const std::string& msg);
/// <summary>
/// 网站目录
/// </summary>
static std::string website_dir(sol::this_state ts);
static void regist(sol::state* lua);
};