This repository was archived by the owner on Mar 24, 2026. It is now read-only.
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
iconvlibrary on Linux. - Console support:
console.logredirection now converts messages to the server's encoding before recording them in the SA-MP log. - Configuration via
config.json: a newencodingsection 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
OnPlayerCommandReceivedandOnPlayerCommandPerformedcallbacks 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.
- Introduction of the
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_THRESHOLDfrom 16 to 32, allowing natives with a higher number of arguments to be processed entirely on the stack.
- Complete refactor of the reference update system: replaced lambdas with a dedicated data structure. Updates (
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.
- The
-
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.
- Implementation of robust validation ("bounds checking") in
-
Dependency Management (TypeScript)
- Removed automatic TypeScript installation and the
ts_auto_installconfiguration flag. Compiler management is now the explicit responsibility of the development environment, preventing unexpected locks during server startup.
- Removed automatic TypeScript installation and the
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.shscript, drastically reducing recompilation time. - Fixed user/group permissions in the Docker container, ensuring the generated artifact (
.so) is accessible on the host without requiringchown.
Contributors
-
- Contributions:
- V8/AMX Interoperability Optimization
- Build Pipeline Modernization
- Pull Request: #1
- Contributions:
-
- Contributions:
- Fixed an issue that, while not the final solution, triggered the "External Command Registration" update.
- Pull Request: #3
- Contributions: