1111
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <functional>
|
||||
#include <list>
|
||||
#include <ffi.h>
|
||||
#include "nlohmann/json.hpp"
|
||||
|
||||
#define CONTAINS_STRING(str, substr) (str == substr)
|
||||
|
||||
@@ -700,6 +701,17 @@ static SQInteger Sq_getExportByName(HSQUIRRELVM v)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static SQInteger OutPutTable(HSQUIRRELVM v)
|
||||
{
|
||||
const SQChar *Str;
|
||||
sq_getstring(v, 2, &Str);
|
||||
|
||||
nlohmann::json ex1 = nlohmann::json::parse(Str);
|
||||
|
||||
std::cout << std::setw(4) << ex1 << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void RegisterGame(HSQUIRRELVM v)
|
||||
{
|
||||
getConfigPath(szGamePath, sizeof(szGamePath));
|
||||
@@ -712,6 +724,7 @@ static void RegisterGame(HSQUIRRELVM v)
|
||||
register_World_func(v, L_S_Ptr, _SC("S_Ptr"));
|
||||
register_World_func(v, L_Str_Ptr, _SC("Str_Ptr"));
|
||||
|
||||
// 指针运算
|
||||
register_World_func(v, L_Ptr_Operation_A2S, _SC("Ptr_Operation_A2S"));
|
||||
|
||||
// new一个指针
|
||||
@@ -747,8 +760,12 @@ static void RegisterGame(HSQUIRRELVM v)
|
||||
register_World_func(v, L_MysqlExecNoRet, _SC("Sq_MysqlExecNoRet"));
|
||||
// 创建Socket连接
|
||||
register_World_func(v, L_CreatSocketConnect, _SC("Sq_CreatSocketConnect"));
|
||||
|
||||
// 动态调用Call
|
||||
register_World_func(v, L_CallFunc, _SC("Sq_CallFunc"));
|
||||
|
||||
// 获取模块函数地址
|
||||
register_World_func(v, Sq_getExportByName, _SC("Sq_getExportByName"));
|
||||
// 打印表
|
||||
register_World_func(v, OutPutTable, _SC("Sq_OutPutTable"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user