StandardDataSource

public class StandardDataSource implements DataSource

Class StandardDataSource. Provides standarddatasource functionality for the Hytale server.

java.lang.Object > StandardDataSource

Field Summary

saveSchedule

private ScheduledFuture saveSchedule

Field saveSchedule.

isAssetPackBeDeleteable

private boolean isAssetPackBeDeleteable

Field isAssetPackBeDeleteable.

doc

final BsonDocument doc

Field doc.

assets

final BsonArray assets

Field assets.

modifiedAsset

final ModifiedAsset modifiedAsset

Field modifiedAsset.

assetsArray

final BsonArray assetsArray

Field assetsArray.

path

final Path path

Field path.

hash

final String hash

Field hash.

fileSaveInfos

final Deque fileSaveInfos

Field fileSaveInfos.

bytes

final byte[] bytes

Field bytes.

now

final long now

Field now.

iterator

final Iterator iterator

Field iterator.

fileSaves

final Deque fileSaves

Field fileSaves.

Method Detail

StandardDataSource

public public StandardDataSource (final String packKey, final Path rootPath, final boolean isImmutable, final PluginManifest manifest)

Method StandardDataSource.

Parameters:
final String packKey
final Path rootPath
final boolean isImmutable
final PluginManifest manifest

isInModsDirectory

static boolean isInModsDirectory (final Path path)

Method isInModsDirectory.

Parameters:
final Path path

start

public void start ()

Method start.

shutdown

public void shutdown ()

Method shutdown.

loadRecentModifications

private void loadRecentModifications ()

Method loadRecentModifications.

ExtraInfo

public new ExtraInfo ()

Method ExtraInfo.

saveRecentModifications

public void saveRecentModifications ()

Method saveRecentModifications.

canAssetPackBeDeleted

public boolean canAssetPackBeDeleted ()

Method canAssetPackBeDeleted.

resolveAbsolutePath

public Path resolveAbsolutePath (final Path path)

Method resolveAbsolutePath.

Parameters:
final Path path

getFullPathToAssetData

public Path getFullPathToAssetData (final Path assetPath)

Method getFullPathToAssetData.

Parameters:
final Path assetPath

getAssetTree

public AssetTree getAssetTree ()

Method getAssetTree.

isImmutable

public boolean isImmutable ()

Method isImmutable.

getRootPath

public Path getRootPath ()

Method getRootPath.

getManifest

public PluginManifest getManifest ()

Method getManifest.

doesDirectoryExist

public boolean doesDirectoryExist (final Path folderPath)

Method doesDirectoryExist.

Parameters:
final Path folderPath

createDirectory

public boolean createDirectory (final Path dirPath, final EditorClient editorClient)

Method createDirectory.

Parameters:
final Path dirPath
final EditorClient editorClient

deleteDirectory

public boolean deleteDirectory (final Path dirPath)

Method deleteDirectory.

Parameters:
final Path dirPath

moveDirectory

public boolean moveDirectory (final Path oldDirPath, final Path newDirPath)

Method moveDirectory.

Parameters:
final Path oldDirPath
final Path newDirPath

doesAssetExist

public boolean doesAssetExist (final Path assetPath)

Method doesAssetExist.

Parameters:
final Path assetPath

getAssetBytes

public byte[] getAssetBytes (final Path assetPath)

Method getAssetBytes.

Parameters:
final Path assetPath

updateAsset

public boolean updateAsset (final Path assetPath, final byte[] bytes, final EditorClient editorClient)

Method updateAsset.

Parameters:
final Path assetPath
final byte[] bytes
final EditorClient editorClient

createAsset

public boolean createAsset (final Path assetPath, final byte[] bytes, final EditorClient editorClient)

Method createAsset.

Parameters:
final Path assetPath
final byte[] bytes
final EditorClient editorClient

deleteAsset

public boolean deleteAsset (final Path assetPath, final EditorClient editorClient)

Method deleteAsset.

Parameters:
final Path assetPath
final EditorClient editorClient

shouldReloadAssetFromDisk

public boolean shouldReloadAssetFromDisk (final Path assetPath)

Method shouldReloadAssetFromDisk.

Parameters:
final Path assetPath

getLastModificationTimestamp

public Instant getLastModificationTimestamp (final Path assetPath)

Method getLastModificationTimestamp.

Parameters:
final Path assetPath

moveAsset

public boolean moveAsset (final Path oldAssetPath, final Path newAssetPath, final EditorClient editorClient)

Method moveAsset.

Parameters:
final Path oldAssetPath
final Path newAssetPath
final EditorClient editorClient

loadAssetTree

public AssetTree loadAssetTree (final Collection assetTypes)

Method loadAssetTree.

Parameters:
final Collection assetTypes

putModifiedAsset

public void putModifiedAsset (final ModifiedAsset modifiedAsset)

Method putModifiedAsset.

Parameters:
final ModifiedAsset modifiedAsset

getRecentlyModifiedAssets

public ModifiedAsset> getRecentlyModifiedAssets ()

Method getRecentlyModifiedAssets.

trackEditorFileSave

private void trackEditorFileSave (final Path path, final String hash)

Method trackEditorFileSave.

Parameters:
final Path path
final String hash

ArrayDeque

public new ArrayDeque ()

Method ArrayDeque.

EditorFileSaveInfo

public new EditorFileSaveInfo (hash, System.currentTimeMillis()

Method EditorFileSaveInfo.

Parameters:
hash hash
System.currentTimeMillis( System.currentTimeMillis(