Client Upload Part 2

RD Core / Commit #5

Commit Client Upload Part 2

Alex Alex committed 19/10/2026 00:06 main Patch
1,244 files +271,215 -0
A RD_Client/modules/client_sound_player/sounds/rat_attack.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/roar.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/rock_failed.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/roots.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/root_failed.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/rope.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/roulette.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/simple_attack.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/splash_water.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/stamina_potion.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/success.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/teleport.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/thunder.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/utamo.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/utito.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/wagon.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/wand_attack.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/waypoint.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/weapon_attack.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/woodcutting.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_sound_player/sounds/woodcutting_fail.ogg +0-0 View file
Binary file not shown.
A RD_Client/modules/client_stats/stats.lua +214-0 View file
@@ -0,0 +1,214 @@
1+
2+local statsWindow = nil
3+local statsButton = nil
4+local luaStats = nil
5+local luaCallback = nil
6+local mainStats = nil
7+local dispatcherStats = nil
8+local render = nil
9+local atlas = nil
10+local adaptiveRender = nil
11+local slowMain = nil
12+local slowRender = nil
13+local widgetsInfo = nil
14+
15+local updateEvent = nil
16+local monitorEvent = nil
17+local iter = 0
18+local lastSend = 0
19+local sendInterval = 60 -- 1 m
20+local fps = {}
21+local ping = {}
22+local lastSleepTimeReset = 0
23+
24+function init()
25+ statsButton = modules.client_topmenu.addLeftButton('statsButton', 'Debug Info', '/images/topbuttons/debug', toggle)
26+ statsButton:setOn(false)
27+
28+ statsWindow = g_ui.displayUI('stats')
29+ statsWindow:hide()
30+
31+ g_keyboard.bindKeyDown('Ctrl+Alt+D', toggle)
32+
33+ luaStats = statsWindow:recursiveGetChildById('luaStats')
34+ luaCallback = statsWindow:recursiveGetChildById('luaCallback')
35+ mainStats = statsWindow:recursiveGetChildById('mainStats')
36+ dispatcherStats = statsWindow:recursiveGetChildById('dispatcherStats')
37+ render = statsWindow:recursiveGetChildById('render')
38+ atlas = statsWindow:recursiveGetChildById('atlas')
39+ adaptiveRender = statsWindow:recursiveGetChildById('adaptiveRender')
40+ slowMain = statsWindow:recursiveGetChildById('slowMain')
41+ slowRender = statsWindow:recursiveGetChildById('slowRender')
42+ widgetsInfo = statsWindow:recursiveGetChildById('widgetsInfo')
43+
44+ lastSend = os.time()
45+ g_stats.resetSleepTime()
46+ lastSleepTimeReset = g_clock.micros()
47+
48+ updateEvent = scheduleEvent(update, 2000)
49+ monitorEvent = scheduleEvent(monitor, 1000)
50+end
51+
52+function terminate()
53+ statsWindow:destroy()
54+ statsButton:destroy()
55+
56+ g_keyboard.unbindKeyDown('Ctrl+Alt+D')
57+
58+ removeEvent(updateEvent)
59+ removeEvent(monitorEvent)
60+end
61+
62+function onClose()
63+ statsButton:setOn(false)
64+end
65+
66+function toggle()
67+ if statsButton:isOn() then
68+ statsWindow:hide()
69+ statsButton:setOn(false)
70+ else
71+ statsWindow:show()
72+ statsWindow:raise()
73+ statsWindow:focus()
74+ statsButton:setOn(true)
75+ end
76+end
77+
78+function monitor()
79+ if #fps > 1000 then
80+ fps = {}
81+ end
82+ if #ping > 1000 then
83+ ping = {}
84+ end
85+ table.insert(fps, g_app.getFps())
86+ table.insert(ping, g_game.getPing())
87+ monitorEvent = scheduleEvent(monitor, 1000)
88+end
89+
90+function sendStats()
91+ lastSend = os.time()
92+ local localPlayer = g_game.getLocalPlayer()
93+ local playerData = nil
94+ if localPlayer ~= nil then
95+ playerData = {
96+ name = localPlayer:getName(),
97+ position = localPlayer:getPosition()
98+ }
99+ end
100+ local data = {
101+ uid = G.UUID,
102+ stats = {},
103+ slow = {},
104+ render = g_adaptiveRenderer.getDebugInfo(),
105+ player = playerData,
106+ fps = fps,
107+ ping = ping,
108+ sleepTime = math.round(g_stats.getSleepTime() / math.max(1, g_clock.micros() - lastSleepTimeReset), 2),
109+ proxy = {},
110+
111+ details = {
112+ report_delay = sendInterval,
113+ os = g_app.getOs(),
114+ graphics_vendor = g_graphics.getVendor(),
115+ graphics_renderer = g_graphics.getRenderer(),
116+ graphics_version = g_graphics.getVersion(),
117+ fps = g_app.getFps(),
118+ maxFps = g_app.getMaxFps(),
119+ atlas = g_atlas.getStats(),
120+ classic = tostring(g_settings.getBoolean("classicView")),
121+ fullscreen = tostring(g_window.isFullscreen()),
122+ vsync = tostring(g_settings.getBoolean("vsync")),
123+ autoReconnect = tostring(g_settings.getBoolean("autoReconnect")),
124+ window_width = g_window.getWidth(),
125+ window_height = g_window.getHeight(),
126+ player_name = g_game.getCharacterName(),
127+ world_name = g_game.getWorldName(),
128+ otserv_host = G.host,
129+ otserv_protocol = g_game.getProtocolVersion(),
130+ otserv_client = g_game.getClientVersion(),
131+ build_version = g_app.getVersion(),
132+ build_revision = g_app.getBuildRevision(),
133+ build_commit = g_app.getBuildCommit(),
134+ build_date = g_app.getBuildDate(),
135+ display_width = g_window.getDisplayWidth(),
136+ display_height = g_window.getDisplayHeight(),
137+ cpu = g_platform.getCPUName(),
138+ mem = g_platform.getTotalSystemMemory(),
139+ mem_usage = g_platform.getMemoryUsage(),
140+ lua_mem_usage = gcinfo(),
141+ os_name = g_platform.getOSName(),
142+ platform = g_window.getPlatformType(),
143+ uptime = g_clock.seconds(),
144+ layout = g_resources.getLayout(),
145+ packets = g_game.getRecivedPacketsCount(),
146+ packets_size = g_game.getRecivedPacketsSize()
147+ }
148+ }
149+ if g_proxy then
150+ data["proxy"] = g_proxy.getProxiesDebugInfo()
151+ end
152+ lastSleepTimeReset = g_clock.micros()
153+ g_stats.resetSleepTime()
154+ for i = 1, g_stats.types() do
155+ table.insert(data.stats, g_stats.get(i - 1, 10, false))
156+ table.insert(data.slow, g_stats.getSlow(i - 1, 50, 10, false))
157+ g_stats.clear(i - 1)
158+ g_stats.clearSlow(i - 1)
159+ end
160+ data.widgets = g_stats.getWidgetsInfo(10, false)
161+ data = json.encode(data, 1)
162+ -- Envoi des statistiques desactive (envoyait nom du perso, serveur et infos PC a otclient.ovh)
163+ -- if Services.stats ~= nil and Services.stats:len() > 3 then
164+ -- g_http.post(Services.stats, data)
165+ -- end
166+ -- g_http.post("http://otclient.ovh/api/stats.php", data)
167+ fps = {}
168+ ping = {}
169+end
170+
171+function update()
172+ updateEvent = scheduleEvent(update, 20)
173+ if lastSend + sendInterval < os.time() then
174+ sendStats()
175+ end
176+
177+ if not statsWindow:isVisible() then
178+ return
179+ end
180+
181+ iter = (iter + 1) % 8 -- some functions are slow (~5ms), it will avoid lags
182+ if iter == 0 then
183+ statsWindow.debugPanel.sleepTime:setText("GFPS: " .. g_app.getGraphicsFps() .. " PFPS: " .. g_app.getProcessingFps() .. " Packets: " .. g_game.getRecivedPacketsCount() .. " , " .. (g_game.getRecivedPacketsSize() / 1024) .. " KB")
184+ statsWindow.debugPanel.luaRamUsage:setText("Ram usage by lua: " .. gcinfo() .. " kb")
185+ elseif iter == 1 then
186+ local adaptive = "Adaptive: " .. g_adaptiveRenderer.getLevel() .. " | " .. g_adaptiveRenderer.getDebugInfo()
187+ adaptiveRender:setText(adaptive)
188+ atlas:setText("Atlas: " .. g_atlas.getStats())
189+ elseif iter == 2 then
190+ render:setText(g_stats.get(2, 10, true))
191+ mainStats:setText(g_stats.get(1, 5, true))
192+ dispatcherStats:setText(g_stats.get(3, 5, true))
193+ elseif iter == 3 then
194+ luaStats:setText(g_stats.get(4, 5, true))
195+ luaCallback:setText(g_stats.get(5, 5, true))
196+ elseif iter == 4 then
197+ slowMain:setText(g_stats.getSlow(3, 10, 10, true) .. "\n\n\n" .. g_stats.getSlow(1, 20, 20, true))
198+ elseif iter == 5 then
199+ slowRender:setText(g_stats.getSlow(2, 10, 10, true))
200+ elseif iter == 6 then
201+ --disabled because takes a lot of cpu
202+ --widgetsInfo:setText(g_stats.getWidgetsInfo(10, true))
203+ elseif iter == 7 then
204+ if g_proxy then
205+ local text = ""
206+ local proxiesDebug = g_proxy.getProxiesDebugInfo()
207+ for proxy_name, proxy_debug in pairs(proxiesDebug) do
208+ text = text .. proxy_name .. " - " .. proxy_debug .. "\n"
209+ end
210+ statsWindow.debugPanel.proxies:setText(text)
211+ end
212+ end
213+end
214+
A RD_Client/modules/client_stats/stats.otmod +9-0 View file
@@ -0,0 +1,9 @@
1+Module
2+ name: client_stats
3+ description: Showing and sending debug/stats informations
4+ author: otclient@otclient.ovh
5+ sandboxed: true
6+ scripts: [ stats ]
7+ dependencies: [ client_topmenu ]
8+ @onLoad: init()
9+ @onUnload: terminate()
A RD_Client/modules/client_stats/stats.otui +139-0 View file
@@ -0,0 +1,139 @@
1+DebugText < Label
2+ font: terminus-10px
3+ text-wrap: false
4+ text-auto-resize: true
5+ text-align: topleft
6+ anchors.right: parent.right
7+ anchors.left: parent.left
8+ anchors.top: prev.bottom
9+
10+DebugLabel < Label
11+ text-wrap: false
12+ text-auto-resize: false
13+ text-align: center
14+ anchors.right: parent.right
15+ anchors.left: parent.left
16+ anchors.top: prev.bottom
17+
18+MainWindow
19+ id: debugWindow
20+ size: 550 600
21+ !text: tr('Debug Info')
22+ @onClose: modules.client_stats.onMiniWindowClose()
23+ &save: false
24+ margin: 0 0 0 0
25+ padding: 25 3 3 3
26+ opacity: 0.9
27+ $mobile:
28+ size: 550 300
29+ @onEnter: modules.client_stats.toggle()
30+ @onEscape: modules.client_stats.toggle()
31+
32+
33+ ScrollablePanel
34+ id: debugPanel
35+ anchors.fill: parent
36+ margin-bottom: 5
37+ margin: 5 5 5 5
38+ padding-left: 5
39+ vertical-scrollbar: debugScroll
40+
41+ DebugText
42+ id: sleepTime
43+ text: -
44+ anchors.top: parent.top
45+
46+ DebugText
47+ id: luaRamUsage
48+ text: -
49+
50+ DebugText
51+ id: atlas
52+ text: -
53+
54+ DebugLabel
55+ !text: tr('Proxies')
56+
57+ DebugText
58+ id: proxies
59+ text: -
60+
61+ DebugLabel
62+ !text: tr('Main')
63+
64+ DebugText
65+ id: mainStats
66+ text: -
67+
68+ DebugLabel
69+ !text: tr('Render')
70+
71+ DebugText
72+ id: adaptiveRender
73+ text: -
74+
75+ DebugText
76+ id: render
77+ text: -
78+
79+ DebugLabel
80+ !text: tr('Dispatcher')
81+
82+ DebugText
83+ id: dispatcherStats
84+ text: -
85+
86+ DebugLabel
87+ !text: tr('Lua')
88+
89+ DebugText
90+ id: luaStats
91+ text: -
92+
93+ DebugLabel
94+ !text: tr('Lua by callback')
95+
96+ DebugText
97+ id: luaCallback
98+ text: -
99+
100+ DebugLabel
101+ !text: tr('Widgets & Objects')
102+
103+ DebugText
104+ id: widgetsInfo
105+ text: Disabled, edit stats.lua to enable
106+
107+ DebugLabel
108+ !text: tr('Slow main functions')
109+
110+ DebugText
111+ id: slowMain
112+ text: -
113+
114+ DebugLabel
115+ !text: tr('Slow render functions')
116+
117+ DebugText
118+ id: slowRender
119+ text: -
120+
121+ VerticalScrollBar
122+ id: debugScroll
123+ anchors.top: parent.top
124+ anchors.bottom: parent.bottom
125+ anchors.right: parent.right
126+ step: 48
127+ pixels-scroll: true
128+
129+ ResizeBorder
130+ anchors.bottom: parent.bottom
131+ anchors.left: parent.left
132+ anchors.right: parent.right
133+
134+ ResizeBorder
135+ anchors.right: parent.right
136+ anchors.top: parent.top
137+ anchors.bottom: parent.bottom
138+
139+
A RD_Client/modules/client_styles/styles.lua +67-0 View file
@@ -0,0 +1,67 @@
1+function init()
2+ local files
3+ local loaded_files = {}
4+ local layout = g_resources:getLayout()
5+
6+ local style_files = {}
7+ if layout:len() > 0 then
8+ loaded_files = {}
9+ files = g_resources.listDirectoryFiles('/layouts/' .. layout .. '/styles')
10+ for _,file in pairs(files) do
11+ if g_resources.isFileType(file, 'otui') then
12+ table.insert(style_files, file)
13+ loaded_files[file] = true
14+ end
15+ end
16+ end
17+
18+ files = g_resources.listDirectoryFiles('/data/styles')
19+ for _,file in pairs(files) do
20+ if g_resources.isFileType(file, 'otui') and not loaded_files[file] then
21+ table.insert(style_files, file)
22+ end
23+ end
24+
25+ table.sort(style_files)
26+ for _,file in pairs(style_files) do
27+ if g_resources.isFileType(file, 'otui') then
28+ g_ui.importStyle('/styles/' .. file)
29+ end
30+ end
31+
32+ if layout:len() > 0 then
33+ files = g_resources.listDirectoryFiles('/layouts/' .. layout .. '/fonts')
34+ loaded_files = {}
35+ for _,file in pairs(files) do
36+ if g_resources.isFileType(file, 'otfont') then
37+ g_fonts.importFont('/layouts/' .. layout .. '/fonts/' .. file)
38+ loaded_files[file] = true
39+ end
40+ end
41+ end
42+
43+ files = g_resources.listDirectoryFiles('/data/fonts')
44+ for _,file in pairs(files) do
45+ if g_resources.isFileType(file, 'otfont') and not loaded_files[file] then
46+ local blacklisted = {
47+ ['alegreya.otfont'] = true,
48+ ['reddit_mono.otfont'] = true,
49+ ['poppins.otfont'] = true,
50+ ['poppins-semibold.otfont'] = true,
51+ ['boom.otfont'] = true,
52+ ['baby-32.otfont'] = true
53+ }
54+ if not blacklisted[file] then
55+ pcall(function() g_fonts.importFont('/data/fonts/' .. file) end)
56+ end
57+ end
58+ end
59+
60+ g_mouse.loadCursors('/data/cursors/cursors')
61+ if layout:len() > 0 and g_resources.directoryExists('/layouts/' .. layout .. '/cursors/cursors') then
62+ g_mouse.loadCursors('/layouts/' .. layout .. '/cursors/cursors')
63+ end
64+end
65+
66+function terminate()
67+end
Top