Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to select Minetest API version #7

Open
S-S-X opened this issue Dec 11, 2020 · 2 comments
Open

Ability to select Minetest API version #7

S-S-X opened this issue Dec 11, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request in-latest-docker Included with latest docker images, might not yet be available elsewhere

Comments

@S-S-X
Copy link
Owner

S-S-X commented Dec 11, 2020

Add Minetest version parameter to configuration and when set use version specific Minetest core libraries.

Requires some easy way to track and update Minetest core libraries, possibly some script to fetch files from commit tagged by version.
Should probably still keep copies in mineunit repository and do updates to new version manually: execute script, resolve possible problems like moved/renamed libraries, commit new version libraries to mineunit repository.

Simplest would probably be putting libraries to subdirectories named after Minetest version.
Default Minetest version should probably be just static value in default configuration.

Related:

@S-S-X S-S-X added the enhancement New feature or request label Dec 11, 2020
@S-S-X
Copy link
Owner Author

S-S-X commented Sep 20, 2021

Finding deprecated and added core API methods (C++ exports only, not Lua side of core API): https://discord.com/channels/369122544273588224/749727888659447960/889649776377864252

https://github.com/minetest/minetest/blob/2628316842e9c3fc1c54c6d57505c7851fa83490/src/script/lua_api/l_object.cpp#L2336-L2338

Checkout tagged versions and grep luamethod* stuff from there, ones registered with luamethod_aliased are probably in deprecation process.
Others can be fairly easily wired into Mineunit classes, for most part naming already follows Minetest C++ class naming. Some things should be renamed or aliased here, for example Mineunit Player.

Some things are simple and can be wired to Mineunit classes directly while other things require bit more complex parsing, for example https://github.com/minetest/minetest/blob/2628316842e9c3fc1c54c6d57505c7851fa83490/src/script/lua_api/l_playermeta.cpp#L108-L122

@S-S-X
Copy link
Owner Author

S-S-X commented Feb 15, 2022

Partially implemented in #74 but only for engine Lua libraries, rest of it has to be implemented somehow.
Possibly through base implementation with loadable version specific extensions to allows introducing and deprecating methods.

For example Player definition would be split like this:

  • player.lua Base for Player, Mineunit internal stuff, very basic implementation, common helper functions
    • engine
      • 5.2.0
        • player.lua Stuff added for 5.2.0 and overriding deprecated things
      • 5.5.0
        • player.lua Stuff added for 5.5.0 and overriding deprecated things

Main definition introduces Player as globally available class, version specific stuff could be better if returning extension that can be merged into base.
This allows for example easily reusing code from engine/5.2.0/player.lua in engine/5.5.0/player.lua extension without duplicating implementation.

Similar should work fine for all current classes and function libraries.

@S-S-X S-S-X pinned this issue Aug 7, 2022
@S-S-X S-S-X added this to Mineunit Jan 11, 2024
@S-S-X S-S-X moved this to In progress in Mineunit Jan 11, 2024
@S-S-X S-S-X self-assigned this Jan 11, 2024
@S-S-X S-S-X moved this from In progress to In review in Mineunit Jan 11, 2024
@S-S-X S-S-X added the in-latest-docker Included with latest docker images, might not yet be available elsewhere label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in-latest-docker Included with latest docker images, might not yet be available elsewhere
Projects
Status: In review
Development

No branches or pull requests

1 participant