#V1.0.5
This commit is contained in:
@@ -69,8 +69,8 @@ bool fastweb::interceptor_manager::callback(network::http::reqpack* reqpack, con
|
||||
}
|
||||
module::request m_request(reqpack->request());
|
||||
module::response m_response(reqpack->response());
|
||||
(*lua->state)["response"] = m_response;
|
||||
(*lua->state)["request"] = m_request;
|
||||
(*lua->state)["fw_response"] = m_response;
|
||||
(*lua->state)["fw_request"] = m_request;
|
||||
|
||||
sol::protected_function_result result = script();
|
||||
if (!result.valid()) {
|
||||
|
||||
@@ -71,8 +71,8 @@ bool fastweb::subscribe_manager::callback(network::http::request* request, netwo
|
||||
}
|
||||
module::request m_request(request);
|
||||
module::response m_response(response);
|
||||
(*lua->state)["response"] = m_response;
|
||||
(*lua->state)["request"] = m_request;
|
||||
(*lua->state)["fw_response"] = m_response;
|
||||
(*lua->state)["fw_request"] = m_request;
|
||||
|
||||
sol::protected_function_result result = script();
|
||||
if (!result.valid()) {
|
||||
|
||||
@@ -44,7 +44,7 @@ std::string module::codec::md5(const std::string& value)
|
||||
|
||||
void module::codec::regist(sol::state* lua)
|
||||
{
|
||||
lua->new_usertype<module::codec>("codec",
|
||||
lua->new_usertype<module::codec>("fw_codec",
|
||||
"url_de", &module::codec::url_de,
|
||||
"url_en", &module::codec::url_en,
|
||||
"to_utf8", &module::codec::to_utf8,
|
||||
|
||||
@@ -29,13 +29,13 @@ std::string module::globalfuncs::website_dir(sol::this_state ts)
|
||||
}
|
||||
void module::globalfuncs::regist(sol::state* lua)
|
||||
{
|
||||
lua->set_function("set_ptr", module::globalfuncs::set_ptr);
|
||||
lua->set_function("get_str", module::globalfuncs::get_str);
|
||||
lua->set_function("set_str", module::globalfuncs::set_str);
|
||||
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);
|
||||
lua->set_function("fw_set_ptr", module::globalfuncs::set_ptr);
|
||||
lua->set_function("fw_get_str", module::globalfuncs::get_str);
|
||||
lua->set_function("fw_set_str", module::globalfuncs::set_str);
|
||||
lua->set_function("fw_make_software_guid", module::globalfuncs::make_software_guid);
|
||||
lua->set_function("fw_throw_string", module::globalfuncs::throw_string);
|
||||
lua->set_function("fw_print", module::globalfuncs::print);
|
||||
lua->set_function("fw_website_dir", module::globalfuncs::website_dir);
|
||||
|
||||
}
|
||||
std::string module::globalfuncs::make_software_guid()
|
||||
|
||||
@@ -62,7 +62,7 @@ ushort module::httpclient::status()
|
||||
|
||||
void module::httpclient::regist(sol::state* lua)
|
||||
{
|
||||
lua->new_usertype<module::httpclient>("httpclient",
|
||||
lua->new_usertype<module::httpclient>("fw_httpclient",
|
||||
"new", sol::constructors<module::httpclient()>(),
|
||||
"get", &module::httpclient::get,
|
||||
"post", &module::httpclient::post,
|
||||
|
||||
@@ -52,7 +52,7 @@ void module::interceptor::clear(sol::this_state ts)
|
||||
|
||||
void module::interceptor::regist(sol::state* lua)
|
||||
{
|
||||
lua->new_usertype<module::interceptor>("interceptor",
|
||||
lua->new_usertype<module::interceptor>("fw_interceptor",
|
||||
"add", &module::interceptor::add,
|
||||
"remove", &module::interceptor::remove,
|
||||
"exist", &module::interceptor::exist,
|
||||
|
||||
@@ -87,7 +87,7 @@ bool module::request::write_file(const std::string& name, const std::string& fil
|
||||
void module::request::regist(sol::state* lua)
|
||||
{
|
||||
// 绑定 Request 类到 Lua
|
||||
lua->new_usertype<module::request>("module_request",
|
||||
lua->new_usertype<module::request>("fw_request",
|
||||
"header", &module::request::header,
|
||||
"method", &module::request::method,
|
||||
"filepath", &module::request::filepath,
|
||||
|
||||
@@ -30,7 +30,7 @@ module::response::~response()
|
||||
void module::response::regist(sol::state* lua)
|
||||
{
|
||||
// 绑定 Request 类到 Lua
|
||||
lua->new_usertype<module::response>("module_response",
|
||||
lua->new_usertype<module::response>("fw_response",
|
||||
"send_data", &module::response::send_data,
|
||||
"send", &module::response::send,
|
||||
"send_file", &module::response::send_file,
|
||||
|
||||
@@ -61,7 +61,7 @@ bool module::session::check()
|
||||
|
||||
void module::session::regist(sol::state* lua)
|
||||
{
|
||||
lua->new_usertype<module::session>("module_session",
|
||||
lua->new_usertype<module::session>("fw_session",
|
||||
"check", &module::session::check,
|
||||
"get", &module::session::get,
|
||||
"id", &module::session::id,
|
||||
|
||||
@@ -52,7 +52,7 @@ void module::subscribe::clear(sol::this_state ts)
|
||||
|
||||
void module::subscribe::regist(sol::state* lua)
|
||||
{
|
||||
lua->new_usertype<module::subscribe>("subscribe",
|
||||
lua->new_usertype<module::subscribe>("fw_subscribe",
|
||||
"add", &module::subscribe::add,
|
||||
"remove", &module::subscribe::remove,
|
||||
"exist", &module::subscribe::exist,
|
||||
|
||||
@@ -103,7 +103,7 @@ sol::table module::ini::table(sol::this_state s)
|
||||
|
||||
void module::ini::regist(sol::state* lua)
|
||||
{
|
||||
lua->new_usertype<module::ini>("ini",
|
||||
lua->new_usertype<module::ini>("fw_ini",
|
||||
"new", sol::constructors<module::ini()>(),
|
||||
"close", &module::ini::close,
|
||||
"del", &module::ini::del,
|
||||
|
||||
@@ -42,7 +42,7 @@ bool module::mutex::try_lock()
|
||||
|
||||
void module::mutex::regist(sol::state* lua)
|
||||
{
|
||||
lua->new_usertype<module::mutex>("mutex",
|
||||
lua->new_usertype<module::mutex>("fw_mutex",
|
||||
"new", sol::constructors<module::mutex()>(),
|
||||
"lock", &module::mutex::lock,
|
||||
"unlock", &module::mutex::unlock,
|
||||
|
||||
@@ -94,7 +94,7 @@ std::string module::process::getpath(size_t pid)
|
||||
|
||||
void module::process::regist(sol::state* lua)
|
||||
{
|
||||
lua->new_usertype<module::process>("process",
|
||||
lua->new_usertype<module::process>("fw_process",
|
||||
"create", &module::process::create,
|
||||
"destory", &module::process::destory,
|
||||
"exist", &module::process::exist,
|
||||
|
||||
@@ -24,7 +24,7 @@ void module::sys::sleep_msec(uint32 msec)
|
||||
|
||||
void module::sys::regist(sol::state* lua)
|
||||
{
|
||||
lua->new_usertype<module::sys>("sys",
|
||||
lua->new_usertype<module::sys>("fw_sys",
|
||||
"sleep_msec", &module::sys::sleep_msec
|
||||
|
||||
);
|
||||
|
||||
@@ -64,7 +64,7 @@ void module::timer::remove(const std::string& name, sol::this_state ts)
|
||||
}
|
||||
void module::timer::regist(sol::state* lua)
|
||||
{
|
||||
lua->new_usertype<module::timer>("timer",
|
||||
lua->new_usertype<module::timer>("fw_timer",
|
||||
"new", sol::constructors<module::timer()>(),
|
||||
"add", &module::timer::add,
|
||||
"remove", &module::timer::remove,
|
||||
|
||||
Reference in New Issue
Block a user