Calytic submitted a new resource:
EntityOwner - Tracks ownership of placed constructions and deployables
Read more about this resource...
EntityOwner
Moved
Total Downloads: 7,291 - First Release: Jul 23, 2015 - Last Update: Dec 8, 2017
- 5/5, 25 likes
-
Calytic Community Admin Community Mod
-
thank you calytic just what i was after awsome work dude
[DOUBLEPOST=1437620079][/DOUBLEPOST]how do u make it so it puts everyone steam ids into a seperate data folder instead of it creating a file for everyone in the main data folder -
Calytic Community Admin Community Mod
Calytic updated EntityOwner with a new update entry:
Added Resource ID / SendHelpText
-
Version 0.1.9
Code:[Oxide] 11:29 AM [Error] Failed to call hook 'OnServerInitialized' on plugin 'Entity Owner' (InvalidOperationException: Collection was modified; enumeration operation may not execute.)
-
Does this working with this plugin?
http://oxidemod.org/plugins/teleportation-system.660/
Teleport would check building owners to allow players to sethome only on their own foundation or if you used the friendAPI plugin for your friends to sethome. -
Calytic Community Admin Community Mod
Calytic updated EntityOwner with a new update entry:
OnServerInitialized attempted fix
[DOUBLEPOST=1437624235][/DOUBLEPOST]
If you are comfortable making the changes and switching now, the only code you need to change is here:
Code:-- ---------------------------------------------------------------------------- -- PLUGIN:GetOwner( buildingBlock ) -- ---------------------------------------------------------------------------- -- Checks the owner of a specific building block in the Building Owners plugin -- data. -- ---------------------------------------------------------------------------- function PLUGIN:GetOwner( buildingBlock ) -- Setup the array to use to invoke the FindBlockData method from the -- BuildingOwners plugin. local arr = util.TableToArray( { buildingBlock } ) util.ConvertAndSetOnArray( arr, 0, buildingBlock, UnityEngine.Object._type ) -- Get the owner id. local ownerID = plugins.CallHook( "FindEntityData", arr ) -- < -------- THIS -- Return the owner id. return ownerID end
Code:function PLUGIN:OnServerInitialized() -- Check if the CheckFoundationForOwner configuration value is set to true. -- If it is true we need the plugin `Building Owners`. if self.Config.Homes.CheckFoundationForOwner then -- The setting CheckFoundationForOwner is true, check if -- `Building Owners` is installed. if not plugins.Exists( "EntityOwner" ) then -- < -------- THIS -- The plugin isn't installed, print a message in the console and -- disable the owner check. print( "m-Teleportation: To limit Homes to only be set on foundations owned by the player the plugin `Entity Owner` is required!" ) print( " The owner check has temporarily been disabled to prevent problems." ) self.Config.Homes.CheckFoundationForOwner = false end end
Last edited: Jul 23, 2015 -
i cant seem to find that line of code in the teleportation system plugin
-
Calytic Community Admin Community Mod
Code:-- ---------------------------------------------------------------------------- -- PLUGIN:GetOwner( buildingBlock ) -- ---------------------------------------------------------------------------- -- Checks the owner of a specific building block in the Building Owners plugin -- data. -- ---------------------------------------------------------------------------- function PLUGIN:GetOwner( buildingBlock ) -- Setup the array to use to invoke the FindBlockData method from the -- BuildingOwners plugin. local arr = util.TableToArray( { buildingBlock } ) util.ConvertAndSetOnArray( arr, 0, buildingBlock, UnityEngine.Object._type ) -- Get the owner id. local ownerID = plugins.CallHook( "FindEntityData", arr ) -- Return the owner id. return ownerID end
-
would i need to change this section as well to the name of your plugin for teleport
function PLUGIN:OnServerInitialized()
-- Check if the CheckFoundationForOwner configuration value is set to true.
-- If it is true we need the plugin `Building Owners`.
if self.Config.Homes.CheckFoundationForOwner then
-- The setting CheckFoundationForOwner is true, check if
-- `Building Owners` is installed.
if not plugins.Exists( "BuildingOwners" ) then
-- The plugin isn't installed, print a message in the console and
-- disable the owner check.
print( "m-Teleportation: To limit Homes to only be set on foundations owned by the player the plugin `Building Owners` is required!" )
print( " This plugin can be downloaded at http://forum.rustoxide.com/plugins/building-owners.682/" )
print( " The owner check has temporarily been disabled to prevent problems." )
self.Config.Homes.CheckFoundationForOwner = false
end -
Calytic Community Admin Community Mod
Sorry - oversight on my part. Yes, without BuildingOwners installed then the ownership check would be skipped in teleportation..
Code:function PLUGIN:OnServerInitialized() -- Check if the CheckFoundationForOwner configuration value is set to true. -- If it is true we need the plugin `Building Owners`. if self.Config.Homes.CheckFoundationForOwner then -- The setting CheckFoundationForOwner is true, check if -- `Building Owners` is installed. if not plugins.Exists( "EntityOwner" ) then -- The plugin isn't installed, print a message in the console and -- disable the owner check. print( "m-Teleportation: To limit Homes to only be set on foundations owned by the player the plugin `Entity Owner` is required!" ) print( " The owner check has temporarily been disabled to prevent problems." ) self.Config.Homes.CheckFoundationForOwner = false end end
-
alll good just double checking so if i change those 2 things teleport should use entityowner instead of building owners
-
Does this mean we need to keep BuildingOwners plugin installed?
-
Calytic Community Admin Community Mod
EntityOwner does not conflict with BuildingOwners and it may remain installed. -
i changed the things in the tp plugin i removed building owners etc when i try to set a home it says i need to on my own or friends foundation if i do prod2 it says it belongs to me would u mind checking this for me. see if i did it right
Attached Files:
-
-
Calytic Community Admin Community Mod
Read up.
Code:-- ---------------------------------------------------------------------------- -- PLUGIN:GetOwner( buildingBlock ) -- ---------------------------------------------------------------------------- -- Checks the owner of a specific building block in the Building Owners plugin -- data. -- ---------------------------------------------------------------------------- function PLUGIN:GetOwner( buildingBlock ) -- Setup the array to use to invoke the FindBlockData method from the -- BuildingOwners plugin. local arr = util.TableToArray( { buildingBlock } ) util.ConvertAndSetOnArray( arr, 0, buildingBlock, UnityEngine.Object._type ) -- Get the owner id. local ownerID = plugins.CallHook( "FindEntityData", arr ) -- < -------- THIS -- Return the owner id. return ownerID end
-
any way to incorporate who has accessed boxes? i know there is already boxlooters, but an all-in-0ne would be nice. if it's not in your vision, i'll stick with /box
-
i got it working perfect now with teleportation plugin this new entity owners is great cheers
-
Instead of making another plugin with 1 thing better and other things worse or missing, you could have taken over thé buildingowners.
I can already tell you that your plugin will create HUMONGOUS amount of lags, cause the way you save it saves every single entities.
So if you have 250 000 entities, it would mean ... well maybe like a 30seconds save time ...
Even my building owners takes 3-4secs to save the data for 250k entities and it only saves buildings ...
You have to rethink the way you save entities, again the best thing would have been to just take over the plugin i made and add the things you wanted to it, maybe rethink some of the code as i'm not a C# programmer so don't know all the subtilities,
but the way you save it is not viable and will just break/lag servers out. -
Calytic Community Admin Community Mod
Because I'm using separate files per player, there is a lot of flexibility when choosing which profiles to load/unload.
Also it is likely I will add whitelisting/blacklisting to the Entity saving to prevent the /own function from giving you ownership of entities you shouldn't really own. Currently the plugin only excludes owning other players.
I'm sure it can be tweaked to be more performant but generally it's pretty zippy and fault tolerant.
Last edited: Jul 23, 2015 -
ha ... ok, i got it XD
Very cleaver way to do so (lots of files, but only few of them are used at the same time)
so how to you prod an entity or a building then? i tried to look at the code but seems that a lot of things are called XD too hard to read without concentrating on it