-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Custom Data location to store #448
Comments
|
@simon816 but also only for a certain plugin, since you might not want to clear all of it in some cases? |
Yeah that's possible assuming the data gets tagged with the plugin id or something |
@simon816 But then you need Sponge to remove the plugin data. What if you want to move the world to a vanilla server for example and you don't want to start a Sponge server first, but also delete the data? |
Then the vanilla server doesn't read it (I assume), so it doesn't get saved. |
As with our multi-world system, we need to store this data separately. Your structure sounds good for number 2 gabizou. EDIT |
@Zidane Great. |
My main reasons to do the second option are that server owners quite frequently disable plugins temporarily, which would erase all their data. Also they sometimes improperly set them up, or use unstable dev builds which cause errors on startup - causing the same side effect. |
@amaranth Had some constructive comments the last I saw him mention it in IRC, Amaranth it would be really useful to see your comments re-iterated here where it can be better preserved. I think gab had some good input as well. |
My view on this was more or less the second choice with the additional requirement that you always load and attach metadata to entities and block entities even if you don't have a deserializer for it. This ensures the data stays in sync with the entity's world/position and existence. Edit: And also for performance reasons you wouldn't want per-plugin files for this, as nice as that would be. You'll likely need to do per-region or per-chunk files with the data from every plugin in one file. One file per plugin per world would be too large (see structures) and one file per plugin per entity would be too small (see chunk storage before regions). |
Second solution sounds good. |
This has been resolved with the custom data config that allows admins to prune custom data by their string id. Specifically as such: sponge {
data-registration {
# A configurable list of registration ids that are to be removed
# when discovered for deserialization. This can be controlled by
# commands in sponge. It is adviseable to refer to the lists made
# available through 'failed-data-list', as using any id's from
# 'registered-data' will result in custom data being deleted at
# every load.
data-to-purge=[
"myhomes:home",
"myhomes:friends"
]
# An auto generated list, by Sponge, to discover and list
# all failed custom data deserializations at runtime due
# to a lack of the registrations being made by a plugin.
# Not to be confused by failed deserialization due to bad data.
# Modifying the list will result in no effect as Sponge auto
# generates this list. This is merely for user configuration.
failed-data-list=[]
# In the cases where there is already previously discovered data
# we don't want to spam the log on each discovery in certain
# contexts. If it is required, we still can emit the log warning
# when necessary.
print-on-discovery=false
# An auto generated list, by Sponge, to provide a list of
# registered custom data manipulators by plugins. Since
# the list is generated AFTER the game starts, modifying
# this list will not affect Sponge's system in any way.
# However, it is advisable to view what registered datas
# exist on a server instance, such that when Sponge completes
# startup, it will be verified that all existing registrations
# are accounted for. A warning will be emitted for any existing
# registrations that were not registered, and moved to the
# 'failed-data-list'.
registered-data=[
"myhomes:home",
"myhomes:friends"
]
}
} |
So, naturally,
Entity
andTileEntity
can store customDataManipulator
s perfectly fine, but it might be prudent that custom data from plugins may be loaded/stored outside of theEntity
/TileEntity
's specificNBTTagCompound
to avoid contamination and cases where "server owner wants to just delete the plugin from existence, and all custom data with it." without having the issue of seeing spam errors of deserializing aDataManipulator
because the plugin'sDataManipulatorBuilder
wasn't found.There were a few options thrown around in the past:
DataManipulatorBuilder
s.<worldname>/data/<pluginid>/entities.dat
etc.So, just collecting some thoughts on how best to make this work, and possibly ensure that there's some sense of performance with whatever situation it is.
The text was updated successfully, but these errors were encountered: