diff --git a/data/images/loading.png b/data/images/loading.png new file mode 100644 index 0000000..de8dff6 Binary files /dev/null and b/data/images/loading.png differ diff --git a/modules/client_stats/stats.lua b/modules/client_stats/stats.lua index 7b7e9ff..5cd985e 100644 --- a/modules/client_stats/stats.lua +++ b/modules/client_stats/stats.lua @@ -9,6 +9,7 @@ local render = nil local atlas = nil local adaptiveRender = nil local slowMain = nil +local slowRender = nil local widgetsInfo = nil local updateEvent = nil @@ -37,6 +38,7 @@ function init() atlas = statsWindow:recursiveGetChildById('atlas') adaptiveRender = statsWindow:recursiveGetChildById('adaptiveRender') slowMain = statsWindow:recursiveGetChildById('slowMain') + slowRender = statsWindow:recursiveGetChildById('slowRender') widgetsInfo = statsWindow:recursiveGetChildById('widgetsInfo') lastSend = os.time() @@ -166,7 +168,7 @@ function sendStats() end function update() - updateEvent = scheduleEvent(update, 200) + updateEvent = scheduleEvent(update, 20) if lastSend + sendInterval < os.time() then sendStats() end @@ -175,26 +177,37 @@ function update() return end - statsWindow.debugPanel.sleepTime:setText("GFPS: " .. g_app.getGraphicsFps() .. " PFPS: " .. g_app.getProcessingFps() .. " Packets: " .. g_game.getRecivedPacketsCount() .. " , " .. (g_game.getRecivedPacketsSize() / 1024) .. " KB") - statsWindow.debugPanel.luaRamUsage:setText("Ram usage by lua: " .. gcinfo() .. " kb") - local adaptive = "Adaptive: " .. g_adaptiveRenderer.getLevel() .. " | " .. g_adaptiveRenderer.getDebugInfo() - adaptiveRender:setText(adaptive) - atlas:setText("Atlas: " .. g_atlas.getStats()) - render:setText(g_stats.get(2, 10, true)) - mainStats:setText(g_stats.get(1, 5, true)) - dispatcherStats:setText(g_stats.get(3, 5, true)) - luaStats:setText(g_stats.get(4, 5, true)) - luaCallback:setText(g_stats.get(5, 5, true)) - slowMain:setText(g_stats.getSlow(3, 10, 10, true) .. "\n\n\n" .. g_stats.getSlow(1, 20, 20, true)) - widgetsInfo:setText(g_stats.getWidgetsInfo(10, true)) - - if g_proxy then - local text = "" - local proxiesDebug = g_proxy.getProxiesDebugInfo() - for proxy_name, proxy_debug in pairs(proxiesDebug) do - text = text .. proxy_name .. " - " .. proxy_debug .. "\n" + iter = (iter + 1) % 8 -- some functions are slow (~5ms), it will avoid lags + if iter == 0 then + statsWindow.debugPanel.sleepTime:setText("GFPS: " .. g_app.getGraphicsFps() .. " PFPS: " .. g_app.getProcessingFps() .. " Packets: " .. g_game.getRecivedPacketsCount() .. " , " .. (g_game.getRecivedPacketsSize() / 1024) .. " KB") + statsWindow.debugPanel.luaRamUsage:setText("Ram usage by lua: " .. gcinfo() .. " kb") + elseif iter == 1 then + local adaptive = "Adaptive: " .. g_adaptiveRenderer.getLevel() .. " | " .. g_adaptiveRenderer.getDebugInfo() + adaptiveRender:setText(adaptive) + atlas:setText("Atlas: " .. g_atlas.getStats()) + elseif iter == 2 then + render:setText(g_stats.get(2, 10, true)) + mainStats:setText(g_stats.get(1, 5, true)) + dispatcherStats:setText(g_stats.get(3, 5, true)) + elseif iter == 3 then + luaStats:setText(g_stats.get(4, 5, true)) + luaCallback:setText(g_stats.get(5, 5, true)) + elseif iter == 4 then + slowMain:setText(g_stats.getSlow(3, 10, 10, true) .. "\n\n\n" .. g_stats.getSlow(1, 20, 20, true)) + elseif iter == 5 then + slowRender:setText(g_stats.getSlow(2, 10, 10, true)) + elseif iter == 6 then + --disabled because takes a lot of cpu + --widgetsInfo:setText(g_stats.getWidgetsInfo(10, true)) + elseif iter == 7 then + if g_proxy then + local text = "" + local proxiesDebug = g_proxy.getProxiesDebugInfo() + for proxy_name, proxy_debug in pairs(proxiesDebug) do + text = text .. proxy_name .. " - " .. proxy_debug .. "\n" + end + statsWindow.debugPanel.proxies:setText(text) end - statsWindow.debugPanel.proxies:setText(text) end end diff --git a/modules/client_stats/stats.otui b/modules/client_stats/stats.otui index 3a354ed..a347375 100644 --- a/modules/client_stats/stats.otui +++ b/modules/client_stats/stats.otui @@ -24,12 +24,11 @@ MainWindow margin: 0 0 0 0 padding: 25 3 3 3 opacity: 0.9 - + $mobile: + size: 550 300 @onEnter: modules.client_stats.toggle() @onEscape: modules.client_stats.toggle() - $mobile: - size: 550 300 ScrollablePanel id: debugPanel @@ -103,7 +102,7 @@ MainWindow DebugText id: widgetsInfo - text: - + text: Disabled, edit stats.lua to enable DebugLabel !text: tr('Slow main functions') @@ -111,6 +110,13 @@ MainWindow DebugText id: slowMain text: - + + DebugLabel + !text: tr('Slow render functions') + + DebugText + id: slowRender + text: - VerticalScrollBar id: debugScroll diff --git a/modules/game_bot/functions/map.lua b/modules/game_bot/functions/map.lua index 0e9fd17..a8cfc32 100644 --- a/modules/game_bot/functions/map.lua +++ b/modules/game_bot/functions/map.lua @@ -122,7 +122,7 @@ context.findPath = function(startPos, destPos, maxDist, params) marginMin marginMax ]]-- - if startPos.z ~= destPos.z then + if not destPos or startPos.z ~= destPos.z then return end if type(maxDist) ~= 'number' then diff --git a/modules/game_shop/shop.otui b/modules/game_shop/shop.otui index e70bd41..10c05f3 100644 --- a/modules/game_shop/shop.otui +++ b/modules/game_shop/shop.otui @@ -134,6 +134,8 @@ MainWindow !text: tr('Shop') size: 750 500 @onEscape: modules.game_shop.hide() + $mobile: + size: 500 360 Panel id: infoPanel diff --git a/modules/gamelib/const.lua b/modules/gamelib/const.lua index d0c25e8..098a6d1 100644 --- a/modules/gamelib/const.lua +++ b/modules/gamelib/const.lua @@ -182,6 +182,8 @@ GameBotProtection = 99 GameFasterAnimations = 101 GameCenteredOutfits = 102 GameSendIdentifiers = 103 +GameWingsAndAura = 104 +GamePlayerStateU32 = 105 GamePacketSizeU32 = 110 GamePacketCompression = 111 diff --git a/otclient_dx.exe b/otclient_dx.exe index 9cfd98f..dcb9ba7 100644 Binary files a/otclient_dx.exe and b/otclient_dx.exe differ diff --git a/otclient_gl.exe b/otclient_gl.exe index 07a9a76..e838a27 100644 Binary files a/otclient_gl.exe and b/otclient_gl.exe differ diff --git a/otclient_linux b/otclient_linux index 8e901e9..20a0c51 100644 Binary files a/otclient_linux and b/otclient_linux differ diff --git a/otclientv8.apk b/otclientv8.apk index cf52a13..71c96f1 100644 Binary files a/otclientv8.apk and b/otclientv8.apk differ diff --git a/pdb/pdb.7z b/pdb/pdb.7z index b518af8..5f8e349 100644 Binary files a/pdb/pdb.7z and b/pdb/pdb.7z differ