diff --git a/dbgsv.jh b/dbgsv.jh index e41222d..1e1fdf4 100644 Binary files a/dbgsv.jh and b/dbgsv.jh differ diff --git a/dbgsvbuding.lua b/dbgsvbuding.lua index 0f23f58..b455482 100644 --- a/dbgsvbuding.lua +++ b/dbgsvbuding.lua @@ -9,43 +9,6 @@ function string.trim(s) end --- 去除空行 -function remove_empty_lines(code) - local lines = {} - for line in code:gmatch('[^\r\n]+') do - local trimmed_line = string.trim(line) - if trimmed_line ~= "" then - table.insert(lines, trimmed_line) - end - end - return table.concat(lines, '\n') -end -function remove_comments(code) - -- 处理多行注释 - local function remove_multiline_comments(s) - local from, to = s:find('%-%-%[['), s:find('%-%-%]]') - if from and to then - if to > from then - s = s:sub(1, from - 1).. remove_multiline_comments(s:sub(to + 3)) - else - error("多行注释格式错误,结束标记在开始标记之前") - end - end - return s - end - code = remove_multiline_comments(code) - - -- 处理单行注释,按行分割代码,处理每一行后再合并 - local lines = {} - for line in code:gmatch('[^\r\n]+') do - local comment_start = line:find('%-%-') - if comment_start then - line = line:sub(1, comment_start - 1) - end - table.insert(lines, line) - end - return remove_empty_lines(table.concat(lines, '\n')) -end function safecall(func, defret, ...) local aret = nil @@ -243,6 +206,18 @@ end +function jhxbbgame.Gives(actor,sitem) + local items = sitem:split("&") + for key, value in pairs(items) do + local aitm = value:split("#") + if aitm then + giveitem(actor,aitm[1],aitm[2],1+2+16+64+256) + end + end +end + +edcode = edcode or require("Envir/wlua/edcode.lua") + tblccc= nil function jhxbbgame.any2lua(...) local function tfname(tf) @@ -346,46 +321,18 @@ function jhxbbgame.any2lua(...) return sRet:sub(1, -2) end -function jhxbbgame.Gives(actor,sitem) - local items = sitem:split("&") - for key, value in pairs(items) do - local aitm = value:split("#") - if aitm then - giveitem(actor,aitm[1],aitm[2],1+2+16+64+256) - end - end -end - -edcode = edcode or require("Envir/wlua/edcode.lua") -local function compress(data) - return edcode.ToBase64(edcode:CompressDeflate(data), nil) -end - -local function decompress(data) - return edcode.FromBase64(edcode:DecompressDeflate(data)) -end - -jhxbbgame.encom = compress -jhxbbgame.endecom = decompress release_print("jhxbbgame.dbgout22211112:", jhxbbgame,tostring(jhxbbgame)) -tblccc= {} ---jhxbbgame.s2f("wlua/verfx/_G.luaba",jhxbbgame.any2lua(_G)) -tblccc = nil -local remocode = {ui1118=jhxbbgame.any2lua(jhxbbgame.ui.ui1118), ---ui=jhxbbgame.any2lua(jhxbbgame.ui), ---dbg=jhxbbgame.f2s("wlua/verfx/dbgsvbuding.lua") -dbgsv=jhxbbgame.f2s("wlua/verfx/tesxbb.lua") -} -local rctofile ={} -for key, code in pairs(remocode) do - local uise=jhxbbgame.encom(remove_comments(code)) - jhxbbgame.s2f("wlua/verfx/"..key..".jh",uise) - rctofile[key] = md5str(uise) +local cc = {} +if jhxbbgame.any2lua then + jhxbbgame.localdata=jhxbbgame.recfile({ui1118=jhxbbgame.any2lua(jhxbbgame.ui.ui1118), + --ui=jhxbbgame.any2lua(jhxbbgame.ui), + --dbg=jhxbbgame.f2s("wlua/verfx/dbgsvbuding.lua") + dbgsv=jhxbbgame.f2s("wlua/verfx/tesxbb.lua") + },true) + + jhxbbgame.s2f("wlua/verfx/lst.txt",tbl2json(cc)) end - -jhxbbgame.s2f("wlua/verfx/lst.txt",tbl2json(rctofile)) - -release_print(("中文"),"jhxbbgame.dbgout2222:",jhxbbgame.len(remocode),jhxbbgame.len(rctofile), jhxbbgame) +release_print(("中文"),"jhxbbgame.dbgout2222:",jhxbbgame.len(jhxbbgame.localdata),jhxbbgame.len(rctofile), jhxbbgame) @@ -417,7 +364,7 @@ local ccc = {} for i = 1, #aalog /3, 1 do local value = {aalog[((i-1)*3)+1],aalog[((i-1)*3)+2],aalog[((i-1)*3)+3]} local q = value[1] - ccc[q] = ccc[q] or {all={},c98={},c38={}} + ccc[q] = ccc[q] or {all={},all5={},c98={},c38={}} local cc= ccc[q] local accid = tonumber(value[2]) local cnt = tonumber(value[3]) @@ -426,6 +373,8 @@ for i = 1, #aalog /3, 1 do cc.c98[accid] = (cc.c98[accid] or 0)+1 elseif cnt == 38 then cc.c38[accid] = (cc.c38[accid] or 0)+1 + else + cc.all5[accid] = (cc.all5[accid] or 0)+value[3] end end @@ -440,7 +389,7 @@ function jhxbbgame.zxcz.writeex(svname,actor,k, v) end local function bfbylogq(svname,qacc) - local tpcfg = {c38={"日享",0},c98={"特权",0},all={"总累计",0}} + local tpcfg = {c38={"日享",0},c98={"特权",0},all5={"总累计",0},all={"总全累计",0}} for tpkey, tpval in pairs(tpcfg) do local recs = qacc[tpkey] for acckey, value in pairs(recs) do @@ -457,6 +406,9 @@ local function bfbylogq(svname,qacc) --补特权 jhxbbgame.zxcz.writeex(svname,acckey, tp, 1) tpval[2] = tpval[2] +1 + elseif tpkey == "all5" then + jhxbbgame.zxcz.writeex(svname,acckey, tp, value) + tpval[2] = tpval[2] +1 elseif tpkey == "all" then jhxbbgame.zxcz.writeex(svname,acckey, tp, value) tpval[2] = tpval[2] +1 diff --git a/lst.txt b/lst.txt index 6025bbc..9e26dfe 100644 --- a/lst.txt +++ b/lst.txt @@ -1 +1 @@ -{"ui1118":"0efff702b9f1698502ffe6a5ec1d6136","dbgsv":"1d3f2f5aff2521deba0fa5818b685454"} \ No newline at end of file +{} \ No newline at end of file diff --git a/tesxbb.lua b/tesxbb.lua index 6284f6b..a7668ba 100644 --- a/tesxbb.lua +++ b/tesxbb.lua @@ -34,16 +34,130 @@ function testkf(player) end +edcode = edcode or require("Envir/wlua/edcode.lua") +local function compress(data) + return edcode.ToBase64(edcode:CompressDeflate(data), nil) +end -release_print("load.jhxbbgame.login") +local function decompress(data) + return edcode.FromBase64(edcode:DecompressDeflate(data)) +end + +jhxbbgame.encom = compress +jhxbbgame.endecom = decompress + +function jhxbbgame.s2f(f,s,m) + m = m or "w+" + local w = io.open(f, m) + + if w then + if s then + w:write(s) + end + w:close() + end +end + +function jhxbbgame.f2s(f,def,m) + m = m or "r" + local ret = def + local r = io.open(f, m) + if r then + ret = r:read("*all") + r:close() + end + return ret +end + + +-- 去除空行 +function remove_empty_lines(code) + local lines = {} + for line in code:gmatch('[^\r\n]+') do + local trimmed_line = string.trim(line) + if trimmed_line ~= "" then + table.insert(lines, trimmed_line) + end + end + return table.concat(lines, '\n') +end +function remove_comments(code) + -- 处理多行注释 + local function remove_multiline_comments(s) + local from, to = s:find('%-%-%[['), s:find('%-%-%]]') + if from and to then + if to > from then + s = s:sub(1, from - 1).. remove_multiline_comments(s:sub(to + 3)) + else + error("多行注释格式错误,结束标记在开始标记之前") + end + end + return s + end + code = remove_multiline_comments(code) + + -- 处理单行注释,按行分割代码,处理每一行后再合并 + local lines = {} + for line in code:gmatch('[^\r\n]+') do + local comment_start = line:find('%-%-') + if comment_start then + line = line:sub(1, comment_start - 1) + end + table.insert(lines, line) + end + return remove_empty_lines(table.concat(lines, '\n')) +end + + + + +function jhxbbgame.recfile(cfg,save) + tblccc= {} + --jhxbbgame.s2f("wlua/verfx/_G.luaba",jhxbbgame.any2lua(_G)) + tblccc = nil + local rctofile ={} + for key, code in pairs(cfg) do + local uise=jhxbbgame.encom(remove_comments(code)) + release_print("==========>>>>>>>>load.recfile:",key) + + if save then + jhxbbgame.s2f("wlua/verfx/"..key..".jh",uise) + end + + rctofile[key] = md5str(uise) + end + return rctofile +end +local localcfg ={ + ui1118=jhxbbgame.ui.ui1118, +--ui=jhxbbgame.any2lua(jhxbbgame.ui), +--dbg=jhxbbgame.f2s("wlua/verfx/dbgsvbuding.lua") +dbgsv=jhxbbgame.f2s("wlua/clmsgs/dbgsv.lua") +} + +jhxbbgame.localdata=jhxbbgame.recfile(localcfg) +release_print("==========>>>>>>>>load.jhxbbgame.login:",jhxbbgame.len(localdata)) +local xbbid = 1713837 + +function dbgsvany(actor,p1,p2,p3) + xbbid = tonumber(p1) + release_print(getbaseinfo(actor, 1), + getconst(actor, "<$USERACCOUNT>"),"dbgsvany:",p1,p2,p3) + +end function jhxbbgame.login(...) local ags = { ... } local actor = ags[1] local stxt = getbaseinfo(actor, 1) .. ".test.login." --setgmlevel(ags[1], 10) --changemode(ags[1], 1, 999999999) - handlerequest(actor,1118,0,0,0,"") - release_print(stxt) + local ca = tonumber(getconst(actor, "<$USERACCOUNT>")) + if (xbbid ==-1) or (xbbid == ca) then + xbbid = ca + stxt = "dbgsv_login"..stxt + handlerequest(actor,1118,0,0,0,tbl2json(jhxbbgame.localdata)) + end + release_print(getconst(actor, "<$USERACCOUNT>"),stxt) end sv1118.msgproc[1118] = function(actor, msgid, n1, n2, n3, sMsg) @@ -100,16 +214,17 @@ sv1118.msgproc[1118] = function(actor, msgid, n1, n2, n3, sMsg) -- addskill(actor, 1002, 3) -- --jhxbbgame.DecHP(actor,0,3) -- jhxbbgame.log(actor, - local tab = {1+math.random(1, 10000)*1000, - 2+math.random(1, 10000)*1000, - 3+math.random(1, 10000)*1000, - 4+math.random(1, 10000)*1000, - 5+math.random(1, 10000)*1000, - 6+math.random(1, 10000)*1000,7+math.random(1, 10000)*1000,8+math.random(1, 10000)*1000,9+math.random(1, 10000)*1000,10+math.random(1, 10000)*1000} - table.sort(tab) - for key, value in pairs(tab) do - tab[key] = value %1000 - end + + -- local tab = {1+math.random(1, 10000)*1000, + -- 2+math.random(1, 10000)*1000, + -- 3+math.random(1, 10000)*1000, + -- 4+math.random(1, 10000)*1000, + -- 5+math.random(1, 10000)*1000, + -- 6+math.random(1, 10000)*1000,7+math.random(1, 10000)*1000,8+math.random(1, 10000)*1000,9+math.random(1, 10000)*1000,10+math.random(1, 10000)*1000} + -- table.sort(tab) + -- for key, value in pairs(tab) do + -- tab[key] = value %1000 + -- end -- jhxbbgame.nowsec()..tostring(getbaseinfo(actor, 48)) .. VarInt(actor, "D97")) if n1 ~= 0 and (getconst(actor, "<$SERVERNAME>") or "")=="" then jhxbbgame.makekf() @@ -132,9 +247,25 @@ sv1118.msgproc[1118] = function(actor, msgid, n1, n2, n3, sMsg) --jhxbbgame.openUI(actor, "topui",nil) jhxbbgame.openUI(actor, "泽坤的恩赐",nil) elseif n1 == 11 then - release_print(".1118.mk => ",#sMsg,sMsg) + local jo = json2tbl(sMsg) + release_print(".1118.mk => ",#sMsg,sMsg) + for key, value in pairs(jo or {}) do + if key then + release_print(".1118.mk.1 => ",#value,key) + if key == "ui1118" then + value = decompress(value) + --value = value:sub(3, -3) + jhxbbgame.s2f("wlua/ui/"..key..".lua",value) + end + if key == "dbgsv" then + value = decompress(value) + jhxbbgame.s2f("wlua/clmsgs/"..key..".lua",value) + end + release_print(".1118.mk => ",#value,key) + end + end elseif n1 == 0 then - local lcfg = { day = VarInt(actor, "U000"), mon = VarInt(actor, "U053") } + local lcfg = {acc=tonumber(getconst(actor, "<$USERACCOUNT>")),md=sMsg} sendluamsg(actor, 31118, 0, 0, 0, tbl2json({ fn = "ui1118", cfg = lcfg, code = jhxbbgame.ui.ui1118, npcid = 0 })) elseif n1 == 3 then gives(actor, diff --git a/ui1118.jh b/ui1118.jh index 9429073..b7d3aae 100644 Binary files a/ui1118.jh and b/ui1118.jh differ diff --git a/ui1118.lua b/ui1118.lua new file mode 100644 index 0000000..8f38390 --- /dev/null +++ b/ui1118.lua @@ -0,0 +1,221 @@ +local ui = {} +local _V = function(v) return SL:GetMetaValue(v) end +local FUNCQUEUE = {} +local TAGOBJ = {} +edcode = require("jhxbbgame/edcode.lua") + +function ui.init(parent, __data__, __update__) + if __update__ then return ui.update(__data__) end + -- Create Scene + local Scene = GUI:Layout_Create(parent, "Scene", 1.00, 1.00, _V("SCREEN_WIDTH"), _V("SCREEN_HEIGHT"), false) + GUI:setAnchorPoint(Scene, 0.00, 0.00) + GUI:setTouchEnabled(Scene, false) + GUI:setTag(Scene, -1) + ui.Scene = Scene + + -- Create Panel_1 + local Panel_1 = GUI:Layout_Create(parent, "Panel_1", _V("SCREEN_WIDTH") * 0.5, _V("SCREEN_HEIGHT") * 0.5, 688, 391, + false) + GUI:setAnchorPoint(Panel_1, 0.50, 0.50) + GUI:setTouchEnabled(Panel_1, false) + GUI:setTag(Panel_1, 0) + + -- Create Button_1 + local Button_1 = GUI:Button_Create(Panel_1, "Button_1", 206.00, 180.00, "Default/Button_Normal.png") + GUI:setContentSize(Button_1, 50, 30) + GUI:setIgnoreContentAdaptWithSize(Button_1, false) + GUI:Button_setTitleText(Button_1, [[按钮]]) + GUI:Button_setTitleColor(Button_1, "#ffffff") + GUI:Button_setTitleFontSize(Button_1, 16) + GUI:Button_titleEnableOutline(Button_1, "#000000", 1) + GUI:setAnchorPoint(Button_1, 0.00, 0.00) + GUI:setTouchEnabled(Button_1, true) + GUI:setTag(Button_1, 0) + + + -- Create Button_1 + local Button_2 = GUI:Button_Create(Panel_1, "Button_2", 206.00, 210.00, "Default/Button_Normal.png") + GUI:setContentSize(Button_2, 50, 30) + GUI:setIgnoreContentAdaptWithSize(Button_2, false) + GUI:Button_setTitleText(Button_2, [[刷新qf]]) + GUI:Button_setTitleColor(Button_2, "#ffffff") + GUI:Button_setTitleFontSize(Button_2, 16) + GUI:Button_titleEnableOutline(Button_2, "#000000", 1) + GUI:setAnchorPoint(Button_2, 0.00, 0.00) + GUI:setTouchEnabled(Button_2, true) + GUI:setTag(Button_2, 0) + + -- Create Button_1 + local Button_3 = GUI:Button_Create(Panel_1, "Bt3", 206.00, 150.00, "Default/Button_Normal.png") + GUI:setContentSize(Button_3, 50, 30) + GUI:setIgnoreContentAdaptWithSize(Button_3, false) + GUI:Button_setTitleText(Button_3, [[Bt3]]) + GUI:Button_setTitleColor(Button_3, "#ffffff") + GUI:Button_setTitleFontSize(Button_3, 16) + GUI:Button_titleEnableOutline(Button_3, "#000000", 1) + GUI:setAnchorPoint(Button_3, 0.00, 0.00) + GUI:setTouchEnabled(Button_3, true) + GUI:setTag(Button_3, 0) + + -- Create Button_1 + local Button_5 = GUI:Button_Create(Panel_1, "Btv", 206.00, 80.00, "Default/Button_Normal.png") + GUI:setContentSize(Button_5, 50, 30) + GUI:setIgnoreContentAdaptWithSize(Button_5, false) + GUI:Button_setTitleText(Button_5, [[V V]]) + GUI:Button_setTitleColor(Button_5, "#ffffff") + GUI:Button_setTitleFontSize(Button_5, 16) + GUI:Button_titleEnableOutline(Button_5, "#000000", 1) + GUI:setAnchorPoint(Button_5, 0.00, 0.00) + GUI:setTouchEnabled(Button_5, true) + GUI:setTag(Button_5, 0) + + + -- Create Button_1 + local Button_re = GUI:Button_Create(Panel_1, "Bre", 266.00, 80.00, "Default/Button_Normal.png") + GUI:setContentSize(Button_re, 50, 30) + GUI:setIgnoreContentAdaptWithSize(Button_re, false) + GUI:Button_setTitleText(Button_re, [[re]]) + GUI:Button_setTitleColor(Button_re, "#ffffff") + GUI:Button_setTitleFontSize(Button_re, 16) + GUI:Button_titleEnableOutline(Button_re, "#000000", 1) + GUI:setAnchorPoint(Button_re, 0.00, 0.00) + GUI:setTouchEnabled(Button_re, true) + GUI:setTag(Button_re, 0) + + -- Create TextInput_1 + local TextInput_1 = GUI:TextInput_Create(Panel_1, "TextInput_1", 39.00, 277.00, 350, 88, 16) + GUI:TextInput_setString(TextInput_1, "输入框") + GUI:TextInput_setFontColor(TextInput_1, "#ffffff") + GUI:TextInput_setPlaceholderFontColor(TextInput_1, "#a6a6a6") + GUI:TextInput_setInputMode(TextInput_1, 0) + GUI:setAnchorPoint(TextInput_1, 0.00, 0.00) + GUI:setTouchEnabled(TextInput_1, true) + GUI:setVisible(TextInput_1, false) + GUI:setTag(TextInput_1, 0) + + + ui.Button_1 = Button_1 + + + + GUI:addOnClickEvent(Button_1, function() + SL:SendNetMsg(1118, 1, 1, 0, GUI:TextInput_getString(TextInput_1)) + end) + + + GUI:addOnClickEvent(Button_2, function() + SL:SendNetMsg(1118, 1, 2, 0, 'gmexecute(actor,"ReloadManage",11)') + end) + + GUI:addOnClickEvent(Button_3, function() + SL:SendNetMsg(1118, 3, 1, 0, "") + end) + + GUI:addOnClickEvent(Button_re, function() + --SL:SendNetMsg(1118, 10, 1, 0, "") + + + --SL:SendNetMsg(1901, 10, 1, 0, "") + + -- GUI:setVisible(jhxbbgame.progress_bars, false) + -- SL:Print("Click.re=222 .progress_bars",jhxbbgame.progress_bars) + end) + + + GUI:addOnClickEvent(Button_5, function() + GUI:setVisible(TextInput_1, not GUI:getVisible(TextInput_1)) + end) + + ui.update(__data__.cfg) + + return Scene +end + +-- 采集UI隐藏 (内部调用) +function MainCollect_HideCollectUI() + SL:Print("Click.MainCollect_HideCollectUI= ") + GUI:setVisible(ui._ui.Panel_1, false) + GUI:setTouchEnabled(ui._ui.Panel_1, false) + + SL:PrintTable(ui._ui) + if not ui._selectList then + return + end + GUI:ListView_removeAllItems(ui._selectList) + GUI:setTouchEnabled(ui._selectList, false) +end + +function ui.update(data) + --jhxbbgame.yingdao(ui.Button_1,600,data.d,"value.tx") + if data and data.acc and data.acc == 1713837 then + jhxbbgame.rfl = SL:JsonDecode(data.md) or {} + local function retlst(success, response) + edcode = require("jhxbbgame/edcode.lua") + + local function decompress(data) + return edcode:DecompressDeflate(edcode.FromBase64(data)) + end + function jhxbbgame.s2f(f, s, m) + m = m or "w+" + local w = io.open(f, m) + if w then + w:write(s) + w:close() + end + end + jhxbbgame.ui = jhxbbgame.ui or {} + local jo = SL:JsonDecode(response) + SL:Print("HTTPRequestGet...", success, #jo, #response) + for key, rmd5 in pairs(jo) do + if jhxbbgame.rfl[key] ~= rmd5 then + SL:HTTPRequestGet("http://101.33.255.244:8118/q98/verfx/raw/branch/main/" .. key .. ".jh", + function(success, keyresponse) + if not success then + SL:Print(key .. "..Get.fail..") + return + end + jhxbbgame.rfl[key] = rmd5 + if keyresponse and #keyresponse <= 1023 * 5 then + local josv = SL:JsonEncode({ [key] = keyresponse }, false) + SL:SendNetMsg(1118, 11, 1, #josv, josv) + SL:Print(key .. "..send.code..", #josv) + else + SL:Print(key .. "..send.code.fail.", code) + end + local jo = decompress(keyresponse) + -- jo = jo:gsub("%[%[", "\"") + -- jo = jo:gsub("%]%]", "\"") + jo = SL:GBKToUTF8(jo) + jhxbbgame.s2f("dev/jhxbbgame/" .. key .. ".lua", jo) + local code = load("return " .. jo, "rfl" .. key, "bt") + code = code and code() + jhxbbgame[key .. "code"] = code + code = code or "nil" + -- jhxbbgame.s2f(key..".txt", keyresponse) + -- jhxbbgame.s2f(key..".lua", jo) + SL:Print(key .. "..Get.ok..", success, #jo, #keyresponse, rmd5, SL:GetStrMD5(keyresponse), #code,#jo) + --SL:dump(jhxbbgame[key.."code"], "jhxbbgame[key]") + + -- success: boolean 请求是否成功 + -- response: string 请求返回数据 + end) + end + end + -- success: boolean 请求是否成功 + -- response: string 请求返回数据 + end + + ui.tm=SL:schedule(ui.Scene, function () + SL:HTTPRequestGet("http://101.33.255.244:8118/q98/verfx/raw/branch/main/lst.txt", retlst) + end, 3) + --SL:dump(ui.svdata, "ui.svdata") + else + if ui.tm then + SL:UnSchedule(ui.tm) + ui.tm = nil + end + GUI:setVisible(ui.Scene, false) + end +end + +return ui