Commit graph

58 commits

Author SHA1 Message Date
Eduardo Dantas
8d98d5a6ba
fix: make client asset installation archive-first (#1739)
Restore archive first modern client asset installation

This commit reworks the modern client asset auto installation flow so the normal path is based on downloading and extracting the GitHub release or source ZIP instead of relying on the manifest flow as the primary installer.

The installer now keeps the final runtime files in the same locations already expected by OTClient. Asset files are installed under data things version, sound files are installed under data sounds version, and configured runtime extras are installed into their expected runtime locations such as bin.

The manifest based path is still kept as a compatibility fallback, but it is no longer the preferred installation path for modern client assets. This restores the archive first behavior and makes the install result match the standard runtime loader layout more directly.

For client versions 1281 and newer, OTClient now checks the existing files under data things version before attempting installation. When auto install is enabled and the required files are missing, the client prompts the user, downloads the configured release or source ZIP, extracts the assets folder into data things version, extracts the sounds folder into data sounds version, and installs configured runtime extras into their target runtime paths.

If Services clientAssets enabled is false, OTClient now skips the asset ensure download flow during login. This avoids recursive login attempts caused by the installer prompt and keeps manual or custom asset folders usable. In that mode, OTClient proceeds with the provided local files and lets the normal runtime loader report missing or invalid assets when appropriate.

The archive extraction support was also expanded. ZIP extraction now works through the vendored minizip fallback when libarchive is not available. Visual Studio project configuration was updated to enable libarchive so Windows builds can handle ZIP and RAR archive extraction. Android builds remain safe because unsupported libarchive linkage is not required there.

Main changes included in this commit

• Restores archive first installation for modern client assets

• Keeps the manifest path only as a compatibility fallback

• Downloads the GitHub release or source ZIP as the normal install path

• Extracts assets into data things version

• Extracts sounds into data sounds version

• Installs runtime extras into their expected runtime locations such as bin

• Keeps final installed files in the same OTClient runtime paths already used by the loader

• Adds ZIP extraction support through the vendored minizip fallback

• Enables libarchive in the Visual Studio project for Windows archive extraction

• Allows Windows builds to handle ZIP and RAR extraction through libarchive

• Preserves Android build safety by not requiring unsupported libarchive linkage

• Skips asset ensure and download prompts when Services clientAssets enabled is false

• Avoids recursive login attempts when asset auto install is disabled

• Keeps manual and custom asset folders usable

• Lets the normal runtime loader report actual missing or invalid files when auto install is disabled

• Documents the archive first flow fallback behavior install paths and troubleshooting notes

Runtime behavior

For modern client versions 1281 and newer, OTClient first checks the existing files under data things version. If the files are already present, login continues without triggering the installer.

If files are missing and auto install is enabled, OTClient prompts the user and installs assets from the configured GitHub release or source archive. The archive folders are mapped into the runtime locations expected by the client.

The assets folder is installed into data things version. The sounds folder is installed into data sounds version. Runtime extras such as bin files are installed into their configured runtime destinations.

If auto install is disabled, the installer is not called during login. The client continues with the manually provided files and the regular loader remains responsible for reporting any actual asset problems.

Verification performed

• luac p modules client assets client assets lua init lua

• luac p modules client entergame entergame lua

• git diff check

• Local Windows build using vc18 otclient sln OpenGL x64 Build

• GitHub Actions fast checks passed on the PR branch

• GitHub Actions Lua syntax checks passed on the PR branch

Overall this commit restores the expected archive based installation flow for modern client assets while preserving compatibility fallback behavior. It keeps installed files aligned with the existing OTClient runtime layout improves archive extraction support across build targets and avoids unwanted installer prompts when automatic asset installation is disabled.
2026-06-12 09:11:21 -03:00
Eduardo Dantas
50c5dc49bd
feat: add spdlog backend and centralize logging (#1643)
Add spdlog as the new logging backend and refactor the codebase to use the centralized g_logger interface instead of direct stdout and stderr output.

Main changes:
- Add spdlog-based logger implementation.
- Replace direct std::cout, std::clog, std::cerr, and std::endl usage with g_logger calls.
- Add log level support for debug, warning, error, and related output paths.
- Add consistent console and file logging through spdlog sinks.
- Add custom log formatting and startup timestamp logging.
- Add dynamic sink management for logger output.
- Refactor HTTP and proxy logging to use g_logger with appropriate log levels.
- Add sanitization and redaction for HTTP request and response logs.
- Improve log consistency so output can be filtered and managed from one logging path.

Build changes:
- Add find_package(spdlog CONFIG REQUIRED).
- Link spdlog::spdlog_header_only in the CMake build.
- Ensure the logging dependency is available across supported platforms.

Cleanup:
- Remove unnecessary iostream includes from files that no longer use direct stream logging.
- Remove unused logging-related includes from the precompiled header.
- Adjust output formatting, newline handling, and flush behavior around the centralized logger.

This modernizes the logging infrastructure, reduces ad-hoc console output, and prepares the client for cleaner log filtering, file logging, and safer HTTP diagnostics.
2026-05-29 16:13:55 -03:00
Eduardo Dantas
ef446a9d0c
feat(client): add automatic modern asset installation (#1727)
Add automatic client-asset installation for modern Tibia versions in OTC, with the UI and runtime support needed for a safe download-and-install flow.

Main changes:
- Add modules/client_assets to orchestrate descriptor and release resolution, downloads, retries, cancellation, archive extraction, optional LZMA handling, and SHA-256 integrity checks.
- Add richer install logs in the console, including download phases, install phases, and final install paths.
- Add support for packaged runtime files, including large DLLs distributed through archives.
- Make client_entergame depend on client_assets.
- Check required assets during login for modern clients version 1281 and newer.
- Prompt the user to download missing modern assets instead of requiring manual setup.
- Allow the client list and version selection to work with installed modern asset sets.

Install layout:
- Install things assets under data/things/<version>.
- Install sound assets under data/sounds/<version>.
- Keep extra runtime files in the existing client root/bin flow.
- Preserve the existing OTC asset layout as the source of truth instead of introducing a separate permanent path.

UI improvements:
- Improve missing-assets and progress dialog sizing and text wrapping.
- Improve progress behavior for downloads without Content-Length.
- Add indeterminate progress behavior for unknown-length phases.
- Add an hourglass busy indicator for indeterminate phases.
- Reduce the perception that the installer is stuck during long extraction steps.

Runtime and build support:
- Add libarchive usage and linking for archive extraction.
- Add SHA-256 helpers and Lua bindings used by client_assets.
- Add safer extraction and path normalization in ResourceManager.
- Adjust the Emscripten HTTP login path to follow the same HTTP/HTTPS fallback behavior used by native login.

Security and integrity:
- Enable strictManifestSha256 by default.
- Disable raw fallback on hash mismatch by default.
- Key releasesCache per source URL and repository to avoid stale cross-source cache reuse.
- Add an LZMA decompression output cap to reduce memory-exhaustion risk.

Compatibility:
- Keep existing classic asset behavior unchanged.
- Use the new auto-install flow only for modern versions when required assets are missing.
- Keep the scope limited to client-side asset automation and required runtime support.
- No server-side Canary behavior is changed by this PR.

This makes modern client setup safer and more automatic by downloading, validating, extracting, and installing missing assets directly from OTC while preserving the existing classic asset flow.
2026-05-28 16:18:44 -03:00
Majesty
e111717fef
fix: change protocol from 1412 to 1511 (#1726) 2026-05-26 14:36:14 -03:00
LIBERGOD
9c06ef96fe
improve: 2fa security and multiple world config (#1613) 2026-01-26 17:39:45 -03:00
LIBERGOD
ddd76391a5
feat: game_market (#1539)
Co-authored-by: InnerCircleTFS <ringofoner52@gmail.com>
Co-authored-by: Luan Luciano <luanluciano93@gmail.com>
2026-01-06 09:13:52 -03:00
kokekanon
1645b2b0b3
improve: game_actionbar multiple Bars (#1354) 2025-10-25 04:28:51 -03:00
Renato Machado
2dd672b960 fix(html): preserve nested *for context
ex:  self.teste = {
    {arr = {1, 2, 3, 4, 5}}
  }

<div *for="local teste in self.teste">
    <div *for="local arr in teste.arr">{{arr}}</div>
</div>
2025-10-14 20:05:41 -03:00
Renato Machado
6a2bff9a80
improve: html/css syntax 2025-09-28 14:46:24 -03:00
LIBERGOD
8311a011a0
improve: UI, Styles, MiniWindow General, see Roadmap
- Introduced a new miniwindow header image for UI.
- Created a new style file for the miniwindow battle interface, defining layout, buttons, and scrollable content.
- Configured button states for close, minimize, and toggle filter functionalities.
- Established visual elements such as borders, backgrounds, and dimensions for a cohesive design.
- Multi-Instance battle list feature.
- Filters and Orderings for each instance.
- Lock buttons specific to each instance.
- Keep open/re-launch when relog/exit game.
- On close, it destroys the instance, cleaning up its settings.
- A bunch of safety checks and locks to ensure they are working properly, and update all windows accordingly.
2025-08-27 18:42:18 -03:00
kokekanon
983b5fac85
feat: create accounts with API MyACC (#1131) 2025-04-04 13:41:07 -03:00
Zbizu
2a1b946d6f
feature: boosted creature / reading staticdata from assets / bestiary races rework (#1064) 2025-01-23 18:25:56 -03:00
Marcin Jałocha
262d238f1f
improve: remove bot protection macro 2025-01-14 12:47:32 -03:00
kokekanon
01ebe1bb12
fix: client_bottommenu webscraping login.php myacc (#956) 2024-11-07 23:37:37 -03:00
Renato Machado
886a590459
feat: html system (#824) 2024-07-16 21:36:58 -03:00
Renato Machado
f9d6436fec fix #818 2024-07-12 14:31:39 -03:00
Rodrigo Paixão
1c3abadd2f
feat: new layout (#749)
New layout based on client 13+.

---------

Co-authored-by: kokekanon <114332266+kokekanon@users.noreply.github.com>
Co-authored-by: Luan Luciano <luanluciano@outlook.com>
Co-authored-by: Levi999x <perkic-marko7@t-online.de>
Co-authored-by: SkullzOTS <86809689+SkullzOTS@users.noreply.github.com>
Co-authored-by: Renato Machado <mehahx@gmail.com>
2024-06-21 18:10:07 -03:00
Ben Dol
e9ab65432b
feat: Local Lua Debugger support for VSCode! (#671)
* Added Local Lua Debugger support for VSCode!

* Add README credit

* Don't know the syntax lol

* Okay ignore this
2023-12-08 18:15:41 -03:00
Renato Machado
f6b25d2313 Revert "improve: remove unnecessary spaces from mod/ folder"
This reverts commit 8e5032d48a.
2023-11-28 13:23:06 -03:00
Luan Luciano
8e5032d48a
improve: remove unnecessary spaces from mod/ folder 2023-11-28 13:04:29 -03:00
Renato Machado
94fbbbc8a6
feat: Drawpool 3.0 2023-11-27 14:40:05 -03:00
Renato Machado
11cecb8c35
feat: v8 Bot 2023-11-21 22:27:20 -03:00
Renato Machado
f4393ed173 Revert "fix #578"
This reverts commit 5bf46f3867.
2023-07-28 14:51:00 -03:00
Renato Machado
5bf46f3867 fix #578 2023-07-28 13:13:16 -03:00
Renato Machado
dd8b22f4f1
refactor: auto reload module rewritten from lua to c++ 2023-07-12 17:45:03 -03:00
Renato Machado
f5f6d48ba2
cleanup 2023-06-30 20:13:09 -03:00
Renato Machado
4d43431b62
feat: config default font to creature/static-text/animated-text/widget text 2023-05-13 19:51:28 -03:00
Joao Pasqualini Costa
221a2a2afc
feat: client auto updater 2023-05-11 11:38:24 -03:00
Ben Dol
09aa446ef1
feat: adaptive ui loading #451
The goal of this feature is to provide an efficient way to load the UI on the device running the client.
2023-03-02 23:03:46 -03:00
Renato
6199025399 Force New Walking Formula, default value true 2023-02-23 13:20:55 -03:00
Renato
c361bae3c5 Update init.lua 2022-12-07 18:37:01 -03:00
Renato
1026132e3d support auto-reload-module 2022-11-17 15:35:27 -03:00
Marcos
1d5e48dd6c
Protocol 12.91 support
Co-authored-by: Beats <61994374+beats-dh@users.noreply.github.com>
2022-09-08 15:05:37 -03:00
Nekiro
96c83a0728 Add last supported version variable + 1287 support
Easier than recompiling for this simple conditional
2022-06-09 21:42:04 +02:00
diath
cb508c6b9f Fix write dir missing a trailing slash (#947) 2018-02-28 21:44:17 +01:00
BenDol
2d84fae2c8 Can now create new configs on the fly using: local config = g_configs.create(file) 2014-04-02 01:54:13 +13:00
BenDol
61059e66ec Started implementing ability to load custom config files (currently unstable).
Feel free to help out with this if you like :)
2014-04-01 05:43:31 +13:00
Sam
da959aca28 Support for protocol 7.7/7.72 / Tiny fix 2013-12-26 21:31:55 +01:00
Ricardo Ianelli
b08d0ff157 One more small fix 2013-02-10 03:01:33 -02:00
Ricardo Ianelli
72d63673ca Identation Fixes 2013-02-10 02:54:20 -02:00
Ricardo Ianelli
cbeab6f9b0 Moving start messages to lua
Moved start log messages to lua, to make easier to enable/disable those
messages.
2013-02-10 02:28:47 -02:00
Eduardo Bart
9aca1644e6 Implement rule violations, closes #218 2013-01-27 07:54:50 -02:00
Eduardo Bart
28b5fc1d5a Refactor modules, closes #223
* All modules are sandboxed now
* All images,sounds,fonts,translations and styles were moved to "data" folder
* Reorganize image files folders
* Remove unmaintained modules: client_particles, client_shaders
* Implement new automatic way to load styles and fonts
* Add hide/show offline option in VipList
* Add invite/exclude to/from private channel in players menus
* Many other minor changes
2013-01-18 20:46:36 -02:00
Eduardo Bart
8bb115d6d4 Fix issue #134 2012-10-24 18:03:15 -02:00
Henrique Santiago
23097980a3 Fix scrollbar slider move, outfit exact size, charlist focus 2012-08-31 20:33:51 -03:00
Eduardo Bart
eb24d6776e Multi-protocol
Lots of chagnes to add multi protocol flexibility, not really
completed yet, still have to rework text messages opcodes and other stuff,
so this still a working in progress feature

* Rework dat reader, the dat reader can now
* dinamically detect dat version
* Split game into gamelib and game_interface
* Lots of other minor changes
2012-07-17 20:53:19 -03:00
Eduardo Bart
59fc3d5f77 Rename 'addons' folder to 'mods' to avoid
Use onRun event to play startup music
2012-07-16 20:07:42 -03:00
Eduardo Bart
bc81c9c8bf Packages system with .otpkg files
When otclient initializes it tries to find all .otpkg files inside the
current search paths (./ ./modules ./addons) and then add them
to the front of current search paths. This way .otpkg can contains
many modules/addons and modifications in a single file that otclient
can recognize.

otpkg files can be compressed files supported by PhysFS, which
are ZIP (.zip) and LZMA (.7z).
2012-07-16 16:35:14 -03:00
niczkx
992cbf9d1d mapeditor changes 2012-07-14 16:20:38 -07:00
Kamil
8f492f7e06 Fixed bug with adding Vip from console or map, who is already on viplist. 2012-07-12 13:21:51 +02:00