[Mod] Node ownership [node_ownership]
Posted: Thu Jan 19, 2012 19:53
Node ownership
Description:
Here is a mod that can set some level of area ownership.
/set_owner PlayerName -100,-100,-100 100,100,100
And it will assign the cube area inside those 2 points to the player. This mod will prevent another player from placing or removing a node inside that area unless this player is added by the area's owner with the next function. The areas created with this function can not overlap. (Required to have "privs" privilege to use this function)
/add_owner PlayerName -100,-100,-100 100,100,100
Once a player is assigned an area he can call this function with the same pattern as /set_owner and allow other players to work in a part of his area. The areas created with this function can overlap.
/list_areas
Will show you all the entries in the owner table that you can delete. They will be the areas you own or areas you added for someone else in your area. (if you have "privs" then you will see all entries)
/remove_areas areaID
Will remove entry from owner table with this ID number. Use /list_owner_entries to see entries you can remove and what their IDs are.
/change_area_owner areaID new_owner
Allows you to transfer an area to a different player.
Requires some code changes to work right. The diff for the changes is at the top of the code here. Also, make sure the mod name is correct in the first line which sets 'owners_db_filename'
There is also a commented out change in 'minetest.register_on_placenode' that will be affected by the InvRef patch that is coming soon.
License(for my code/changes):
GPL
Download
Here is a download for the patched files if you can't get them to patch right. Mar 22, 2012, 10:15am PST(Date it was made)
Description:
Here is a mod that can set some level of area ownership.
/set_owner PlayerName -100,-100,-100 100,100,100
And it will assign the cube area inside those 2 points to the player. This mod will prevent another player from placing or removing a node inside that area unless this player is added by the area's owner with the next function. The areas created with this function can not overlap. (Required to have "privs" privilege to use this function)
/add_owner PlayerName -100,-100,-100 100,100,100
Once a player is assigned an area he can call this function with the same pattern as /set_owner and allow other players to work in a part of his area. The areas created with this function can overlap.
/list_areas
Will show you all the entries in the owner table that you can delete. They will be the areas you own or areas you added for someone else in your area. (if you have "privs" then you will see all entries)
/remove_areas areaID
Will remove entry from owner table with this ID number. Use /list_owner_entries to see entries you can remove and what their IDs are.
/change_area_owner areaID new_owner
Allows you to transfer an area to a different player.
Requires some code changes to work right. The diff for the changes is at the top of the code here. Also, make sure the mod name is correct in the first line which sets 'owners_db_filename'
There is also a commented out change in 'minetest.register_on_placenode' that will be affected by the InvRef patch that is coming soon.
License(for my code/changes):
GPL
Download
Here is a download for the patched files if you can't get them to patch right. Mar 22, 2012, 10:15am PST(Date it was made)