Skip to content

Commit ca20c4a

Browse files
committed
modify:lua and lib plugin configure file
delete:plugin of option configure
1 parent 2ed96d7 commit ca20c4a

File tree

6 files changed

+63
-37
lines changed

6 files changed

+63
-37
lines changed

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@
2929
},
3030
"XPlugin":{
3131
"bEnable":true,
32-
"tszPluginFile":"./XEngine_Config/XEngine_PluginConfig.json"
32+
"tszPluginLib":"./XEngine_Config/XEngine_PluginLib.json",
33+
"tszPluginLua":"./XEngine_Config/XEngine_PluginLua.json"
3334
},
3435
"XVer":[
36+
"2.6.0.1001 Build20221209",
3537
"2.5.0.1001 Build20221102",
3638
"2.4.0.1001 Build20220902",
3739
"2.3.0.1001 Build20220723",

XEngine_Release/XEngine_Config/XEngine_OPtionConfig.json

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -59,36 +59,5 @@
5959
"OPTionNote": "行政邮编信息",
6060
"OPTionExample": "参考文档"
6161
}
62-
],
63-
"OPTionPlugin": [{
64-
"OPTionEnable": true,
65-
"OPTionMethod": "zodiac",
66-
"OPTionNote": "生肖星座",
67-
"OPTionExample": "http://%s/api?function=zodiac&params1=19880121"
68-
},
69-
{
70-
"OPTionEnable": true,
71-
"OPTionMethod": "pass",
72-
"OPTionNote": "密码",
73-
"OPTionExample": "http://%s/api?function=pass&params1=1&params2=4"
74-
},
75-
{
76-
"OPTionEnable": true,
77-
"OPTionMethod": "timezone",
78-
"OPTionNote": "时区转换",
79-
"OPTionExample": "http://%s/api?function=timezone&params1=0"
80-
},
81-
{
82-
"OPTionEnable": true,
83-
"OPTionMethod": "bmindex",
84-
"OPTionNote": "体脂标准",
85-
"OPTionExample": "http://%s/api?function=bmindex&params1=高(米))&param2=体重(千克)"
86-
},
87-
{
88-
"OPTionEnable": true,
89-
"OPTionMethod": "meter",
90-
"OPTionNote": "计量转换",
91-
"OPTionExample": "http://%s/api?function=meter&type=0&source=1&value=100"
92-
}
9362
]
9463
}

XEngine_Release/XEngine_Config/XEngine_PluginConfig.json renamed to XEngine_Release/XEngine_Config/XEngine_PluginLib.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
{
44
"PluginEnable":true,
55
"PluginMethod":"zodiac",
6-
"PluginFile":"./XEngine_Plugin/libModulePlugin_Zodiac"
6+
"PluginFile":"./XEngine_LibPlugin/libModulePlugin_Zodiac"
77
},
88
{
99
"PluginEnable":true,
1010
"PluginMethod":"pass",
11-
"PluginFile":"./XEngine_Plugin/libModulePlugin_Password"
11+
"PluginFile":"./XEngine_LibPlugin/libModulePlugin_Password"
1212
},
1313
{
1414
"PluginEnable":true,
1515
"PluginMethod":"timezone",
16-
"PluginFile":"./XEngine_Plugin/libModulePlugin_Timezone"
16+
"PluginFile":"./XEngine_LibPlugin/libModulePlugin_Timezone"
1717
},
1818
{
1919
"PluginEnable":true,
2020
"PluginMethod":"bmindex",
21-
"PluginFile":"./XEngine_Plugin/libModulePlugin_BMIndex"
21+
"PluginFile":"./XEngine_LibPlugin/libModulePlugin_BMIndex"
2222
},
2323
{
2424
"PluginEnable":true,
2525
"PluginMethod":"meter",
26-
"PluginFile":"./XEngine_Plugin/libModulePlugin_Meter"
26+
"PluginFile":"./XEngine_LibPlugin/libModulePlugin_Meter"
2727
}
2828
]
2929
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"PluginArray":[
3+
{
4+
"PluginEnable":true,
5+
"PluginMethod":"cal",
6+
"PluginFile":"./XEngine_LuaPlugin/ModulePlugin_Calculation.lua"
7+
}
8+
]
9+
}
File renamed without changes.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
function PluginCore_Init()
2+
return true
3+
end
4+
5+
function PluginCore_UnInit()
6+
end
7+
8+
9+
function PluginCore_URLSqlit(str,reps)
10+
local resultStrList = {}
11+
string.gsub(str,'[^'..reps..']+',function (w)
12+
table.insert(resultStrList,w)
13+
end)
14+
return resultStrList
15+
end
16+
17+
18+
function PluginCore_Call(lpszStrUrl, nListCount, lpszMsgBuffer, nMsgLen)
19+
if nListCount < 3 then
20+
return false
21+
end
22+
23+
local nValue = 0
24+
local HDRArray = PluginCore_URLSqlit(lpszStrUrl,'&')
25+
local HDRObjectValue1 = PluginCore_URLSqlit(HDRArray[1],'=')
26+
local HDRObjectValue2 = PluginCore_URLSqlit(HDRArray[2],'=')
27+
local HDRObjectType = PluginCore_URLSqlit(HDRArray[3],'=')
28+
29+
if '0' == HDRObjectType[2] then
30+
nValue = HDRObjectValue1[2] + HDRObjectValue2[2]
31+
elseif '1' == HDRObjectType[2] then
32+
nValue = HDRObjectValue1[2] - HDRObjectValue2[2]
33+
elseif '2' == HDRObjectType[2] then
34+
nValue = HDRObjectValue1[2] * HDRObjectValue2[2]
35+
elseif '3' == HDRObjectType[2] then
36+
nValue = HDRObjectValue1[2] / HDRObjectValue2[2]
37+
end
38+
39+
PInt_HTTPCode = 200
40+
PtszMsgBuffer = "{\"code\":0,\"value\":" .. nValue .. "}"
41+
PInt_MsgLen = #PtszMsgBuffer
42+
43+
return true
44+
end
45+
46+
-- PluginCore_Call1("param1=1&param2=2&param3=0",3,"hello",5)

0 commit comments

Comments
 (0)