Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

v1.0.1

Latest

Choose a tag to compare

@ocalasans ocalasans released this 03 Feb 07:51
· 1 commit to main since this release
e0daff6

Added

  • Codepage Conversion System (Encoding Support)

    • Support for multiple character encodings to ensure compatibility with servers in different languages (e.g., Windows-1252, Windows-1251, CP850).
    • Seamless integration in the interoperability layer: automatic string conversion from UTF-8 (JavaScript) to the target encoding (AMX) and vice versa.
    • Robust cross-platform implementation: utilizes native Windows APIs and the iconv library on Linux.
    • Console support: console.log redirection now converts messages to the server's encoding before recording them in the SA-MP log.
    • Configuration via config.json: a new encoding section allows defining the target via number (Codepage) or name (Encoding Name).
  • External Command Registration

    • Introduction of the External_Commands() function to register existing commands in other scripts (i.e., outside the Kainure environment).
    • Ensures the correct triggering of OnPlayerCommandReceived and OnPlayerCommandPerformed callbacks for non-native JS commands.
    • Implementation of automatic validation that issues critical warnings when attempting to register commands that already exist within the JavaScript context.

Changed | Fixed

Core & Performance

  • V8/AMX Interoperability Optimization
    • Complete refactor of the reference update system: replaced lambdas with a dedicated data structure. Updates (Ref()) are now batch-processed, improving cache locality and eliminating the cost of constructing closures on every native call.
    • Implementation of Stack Allocation for small string conversion: reduces V8 Heap pressure by using the stack for short-lived strings during communication with the AMX.
    • Increased STACK_ARGS_THRESHOLD from 16 to 32, allowing natives with a higher number of arguments to be processed entirely on the stack.

API & Systems

  • Public Signature Refactoring (Publics)

    • The Public() method now requires an explicit type signature as the second parameter when arguments are present (e.g., Public('OnPlayerConnect', 'i', callback)).
    • Removal of toString()-based inference via Regex, eliminating vulnerabilities in parameter recognition.
    • Strict initialization validation: the gamemode is prevented from starting if there is a mismatch between the provided signature and the callback's parameter count.
    • Improved support for boolean types in the C++ layer.
  • Command Parser Hardening

    • Implementation of robust validation ("bounds checking") in Parse_Array_Format().
    • Added protections against invalid array formats, truncated strings, and out-of-scope array sizes (1-1000).
    • Execution flow fix: non-existent commands are now correctly reported without interfering with the execution of valid or external commands.
  • Dependency Management (TypeScript)

    • Removed automatic TypeScript installation and the ts_auto_install configuration flag. Compiler management is now the explicit responsibility of the development environment, preventing unexpected locks during server startup.

Build & Infrastructure

  • Build Pipeline Modernization
    • Updated the build environment to GCC 11.
    • Enabled aggressive optimization flags in CMake: -O3, -flto (Link Time Optimization), and -msse2.
    • Implemented Docker image caching via the compile.sh script, drastically reducing recompilation time.
    • Fixed user/group permissions in the Docker container, ensuring the generated artifact (.so) is accessible on the host without requiring chown.

Contributors

  • @LESS14

    • Contributions:
      • V8/AMX Interoperability Optimization
      • Build Pipeline Modernization
    • Pull Request: #1
  • @alexschimitz

    • Contributions:
      • Fixed an issue that, while not the final solution, triggered the "External Command Registration" update.
    • Pull Request: #3

Full Changelog: v1.0.0...v1.0.1