Warning: MultiHome uses important features currently only available in development builds of Minetest. In order to get MultiHome working properly, you'll need to build your own version of Minetest newer than this commit (January 26th, 2017).

MultiHome is a Minetest mod allowing players to set multiple homes rather than just one home through Minetest Game's sethome mod. MultiHome supports limiting the max number of homes per-player (default: 5) and has two compatibility layers to allow working with sethome. The chatcommands made available by MultiHome depend on the compatibility mode chosen, as shown below.

Note: If MultiHome is set to no compatibility mode, the multihome privilege is required to use MultiHome features, otherwise the home privilege from sethome is used.

Compatibility

MultiHome provides exactly two compatibility modes allowing the mod to work with homes previously created with the sethome mod. If no compatibility mode is set, the setting defaults to none and the default set of chatcommands is used. The compatibility mode can be set with multihome.compatiblity in minetest.conf, valid values being none, deprecate, and override.

The first two compatibility modes use the same chatcommand (/multihome) as documented below, however, deprecate overrides chatcommands from sethome causing them to display a message stating that they are deprecated and /multihome should be used instead. Note: If a compatibility mode is set and the sethome mod is not found, compatibility is automatically set to none.

When attempting to vist a home using any compatibility mode, if the player does not specify a home to teleport to and they only have one home, the player will be automatically teleported to that home.

Compatibility: None/Deprecate

Both the none and deprecate compatibility modes use the same chatcommand, however deprecate adds deprecation messages as mentioned above. The best way to learn how to use this /multihome chatcommand is to use the in-game help, /help multihome, however, an overview of the usage can be found below.

The override compatibility mode does not use one single chatcommand, but rather overrides the chatcommands used by sethome for use by MultiHome and registers two extras (see below).

/home <home name>: Teleport to the home specified/sethome <home name>: Set the position of the home specified/delhome <home name>: Delete the home specified/listhomes: List player's homes

Importing Homes

MultiHome supports imported homes from sethome in both the deprecate and override compatibility options. Importing can be enabled by setting multihome.import = true in minetest.conf. This will cause MultiHome to automatically import homes created by sethome in the player attributes whenever a player with a home joins. MultiHome will also import homes from the `homes` file in the world directory, however, as they are imported they cannot be removed from the file but instead set an attribute on the player indicating that any old homes have already been imported and should not be overwritten. These homes will be named default in MultiHome and will be removed from the player attributes after they have been imported.

Last edited by octacian on Tue May 16, 2017 23:14, edited 3 times in total.

I'm very pleased with this one my friend :)Especially since it's using player attributes so if and when it's time to cull out old players... the data goes with them when player files are removed.However.. I seem to remember mention on Github that deletion of player attributes caused issues at this time. Did that get worked out and I haven't noticed?

Edit: Also MTG's newest /home also imports the homes from the homes flatfile and moves them into player attributes. Eventually the homes file will become empty. So homes that have already moved, will be missed.

Edited Edit: Okay looking closer you DO grab the homes from attributes for import, but not from the flatfile that might not of been imported yet with new MTG. Maybe include those if they exist?

ExeterDad wrote:However.. I seem to remember mention on Github that deletion of player attributes caused issues at this time. Did that get worked out and I haven't noticed?

I was never aware that this was a problem, however, I can say that it definitely isn't at this point as everything works fine for me.

ExeterDad wrote:Edited Edit: Okay looking closer you DO grab the homes from attributes for import, but not from the flatfile that might not of been imported yet with new MTG. Maybe include those if they exist?

Just pushed an update that includes positions from the flat file. The one downfall is that I cannot easily remove the old homes from the flat file, so instead I just set another attribute on the player indicating that homes have already been imported and should not be imported again. Interestingly enough though, MTG's sethome doesn't actually import items from the file to attributes and then remove them from the file, it just reads old ones from the file and only stores new ones in attributes.

octacian wrote:I was never aware that this was a problem, however, I can say that it definitely isn't at this point as everything works fine for me.

I can't quote were I "thought'" I read about that. I likely misunderstood. Thanks for confirming :)

octacian wrote:Interestingly enough though, MTG's sethome doesn't actually import items from the file to attributes and then remove them from the file, it just reads old ones from the file and only stores new ones in attributes.

ExeterDad wrote:Unless I'm reading it wrong, the code in this commit says it does remove the homes entry?

Ah, you're right it does. However, after giving this some thought it is still impossible for me to delete entries from the homes file once I import them into MultiHome, only the original sethome mod can do that as writing to the file with MultiHome as well could cause major issues. At this point I wouldn't worry about it though, the issue will never present itself as a real gameplay-affecting issue, plus, there isn't really anything I can do.

Also, thanks to all for the positive feedback, it's really an encouragement!

I imagine I may be doing something wrong, but I am getting errors when this mod is enabled.

I first added multihome.compatibility = override to minetest.conf. When that generated errors I tried multihome.compatibility = deprecate, which caused a similar error. I placed the setting below the basic_privs line. The errors generated were :

dawgdoc wrote:I first added multihome.compatibility = override to minetest.conf. When that generated errors I tried multihome.compatibility = deprecate, which caused a similar error. I placed the setting below the basic_privs line.

This is caused by the fact that you do not have a development build of Minetest, as 0.4.15 stable is missing two important features used by this my (player attributes and chatcommand override APIs). In order to get MultiHome working correctly, you'll need to build a new development version of Minetest with this commit or newer (simply doing git pull as in the linked guide will work fine).

BTW, placement in minetest.conf doesn't matter at all for anything, just so that you know :D (well, so long as you don't redefine the same thing later, but that's pretty obvious)

Last edited by octacian on Wed May 17, 2017 02:52, edited 1 time in total.

dawgdoc wrote:I first added multihome.compatibility = override to minetest.conf. When that generated errors I tried multihome.compatibility = deprecate, which caused a similar error. I placed the setting below the basic_privs line.

This is caused by the fact that you do not have a development build of Minetest, as 0.4.14 stable is missing two important features used by this my (player attributes and chatcommand override APIs). In order to get MultiHome working correctly, you'll need to build a new development version of Minetest with this commit or newer (simply doing git pull as in the linked guide will work fine).

BTW, placement in minetest.conf doesn't matter at all for anything, just so that you know :D (well, so long as you don't redefine the same thing later, but that's pretty obvious)

I realized today, while away from the house, that I hadn't mentioned my MT version nor the OS of my computer. Thank you for replying in spite of that. (LinuxMint 18.1 based on Ubuntu Xenail, and MT 0.4.15 from the stable PPA). I really must have been sleepy while reading the first post to not catch that a -dev build was needed and to think that it and the readme said to add the line to minetest.conf. Thank you, again, for the reply.