C# Класс fCraft.BlockDB

Database of block changes. Each BlockDB object is associated with a world. Provides controls for storage/retention, and methods to look up data.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AddEntry void
BlockDB System
CacheClear void
CheckAlignment void
CountNewerEntries int
EnforceLimit void
EnforceTimeLimit void
EnsureCapacity void
Flush void
Init void
LimitCapacity void
Lookup fCraft.BlockDBEntry[]
OnPlayerPlacedBlock void
OpenAppend System.IO.FileStream
OpenRead System.IO.FileStream
Preload void
TrimFile void

Открытые методы

Метод Описание
AutoToggleIfNeeded ( ) : bool

If EnabledState is set to Auto, calling this auto-enables / auto-disables BlockDB depending on world's BuildSecurity.MinRank and BlockDBAutoEnableRank config key.

Clear ( ) : void

Clears cache and deletes the .fbdb file.

GetReadLock ( ) : IDisposable

Acquires and returns a shared (read) lock for this BlockDB. Disposing the object returned by this method releases the lock.

GetWriteLock ( ) : IDisposable

Acquires and returns an exclusive (write) lock for this BlockDB. Disposing the object returned by this method releases the lock.

LoadSettings ( System.Xml.Linq.XElement el ) : void
Lookup ( int max ) : fCraft.BlockDBEntry[]
Lookup ( int max, System.TimeSpan span ) : fCraft.BlockDBEntry[]
Lookup ( int max, Vector3I coords ) : fCraft.BlockDBEntry[]

Returns list of all changes done to the map at the given coordinate, newest to oldest.

Lookup ( int max, [ area ) : fCraft.BlockDBEntry[]
Lookup ( int max, [ area, System.TimeSpan span ) : fCraft.BlockDBEntry[]
Lookup ( int max, [ area, [ info, bool exclude ) : fCraft.BlockDBEntry[]
Lookup ( int max, [ area, [ info, bool exclude, System.TimeSpan span ) : fCraft.BlockDBEntry[]
Lookup ( int max, [ info, bool exclude ) : fCraft.BlockDBEntry[]
Lookup ( int max, [ info, bool exclude, System.TimeSpan span ) : fCraft.BlockDBEntry[]
SaveSettings ( ) : System.Xml.Linq.XElement
SaveSettings ( string rootName ) : System.Xml.Linq.XElement
Traverse ( [ processor ) : void

Traverses the database, newest to oldest entries, processing each entry with the given IBlockDBQueryProcessor.

Приватные методы

Метод Описание
AddEntry ( BlockDBEntry item ) : void
BlockDB ( [ world ) : System
CacheClear ( ) : void
CheckAlignment ( ) : void
CountNewerEntries ( System.TimeSpan age ) : int

Counts entries that are newer than the given age.

EnforceLimit ( ) : void
EnforceTimeLimit ( ) : void
EnsureCapacity ( int min ) : void
Flush ( bool enforceLimits ) : void
Init ( ) : void
LimitCapacity ( int max ) : void
Lookup ( int max, BlockDBSearchType searchType, bool>.[ selector ) : fCraft.BlockDBEntry[]
OnPlayerPlacedBlock ( object sender, [ e ) : void
OpenAppend ( ) : FileStream
OpenRead ( ) : FileStream
Preload ( ) : void
TrimFile ( int maxCapacity ) : void

Описание методов

AutoToggleIfNeeded() публичный Метод

If EnabledState is set to Auto, calling this auto-enables / auto-disables BlockDB depending on world's BuildSecurity.MinRank and BlockDBAutoEnableRank config key.
public AutoToggleIfNeeded ( ) : bool
Результат bool

Clear() публичный Метод

Clears cache and deletes the .fbdb file.
public Clear ( ) : void
Результат void

GetReadLock() публичный Метод

Acquires and returns a shared (read) lock for this BlockDB. Disposing the object returned by this method releases the lock.
public GetReadLock ( ) : IDisposable
Результат IDisposable

GetWriteLock() публичный Метод

Acquires and returns an exclusive (write) lock for this BlockDB. Disposing the object returned by this method releases the lock.
public GetWriteLock ( ) : IDisposable
Результат IDisposable

LoadSettings() публичный Метод

public LoadSettings ( System.Xml.Linq.XElement el ) : void
el System.Xml.Linq.XElement
Результат void

Lookup() публичный Метод

public Lookup ( int max ) : fCraft.BlockDBEntry[]
max int
Результат fCraft.BlockDBEntry[]

Lookup() публичный Метод

public Lookup ( int max, System.TimeSpan span ) : fCraft.BlockDBEntry[]
max int
span System.TimeSpan
Результат fCraft.BlockDBEntry[]

Lookup() публичный Метод

Returns list of all changes done to the map at the given coordinate, newest to oldest.
Given coordinates are outside the map.
public Lookup ( int max, Vector3I coords ) : fCraft.BlockDBEntry[]
max int Maximum number of changes to return.
coords Vector3I Coordinate to search at.
Результат fCraft.BlockDBEntry[]

Lookup() публичный Метод

public Lookup ( int max, [ area ) : fCraft.BlockDBEntry[]
max int
area [
Результат fCraft.BlockDBEntry[]

Lookup() публичный Метод

public Lookup ( int max, [ area, System.TimeSpan span ) : fCraft.BlockDBEntry[]
max int
area [
span System.TimeSpan
Результат fCraft.BlockDBEntry[]

Lookup() публичный Метод

public Lookup ( int max, [ area, [ info, bool exclude ) : fCraft.BlockDBEntry[]
max int
area [
info [
exclude bool
Результат fCraft.BlockDBEntry[]

Lookup() публичный Метод

public Lookup ( int max, [ area, [ info, bool exclude, System.TimeSpan span ) : fCraft.BlockDBEntry[]
max int
area [
info [
exclude bool
span System.TimeSpan
Результат fCraft.BlockDBEntry[]

Lookup() публичный Метод

public Lookup ( int max, [ info, bool exclude ) : fCraft.BlockDBEntry[]
max int
info [
exclude bool
Результат fCraft.BlockDBEntry[]

Lookup() публичный Метод

public Lookup ( int max, [ info, bool exclude, System.TimeSpan span ) : fCraft.BlockDBEntry[]
max int
info [
exclude bool
span System.TimeSpan
Результат fCraft.BlockDBEntry[]

SaveSettings() публичный Метод

public SaveSettings ( ) : System.Xml.Linq.XElement
Результат System.Xml.Linq.XElement

SaveSettings() публичный Метод

public SaveSettings ( string rootName ) : System.Xml.Linq.XElement
rootName string
Результат System.Xml.Linq.XElement

Traverse() публичный Метод

Traverses the database, newest to oldest entries, processing each entry with the given IBlockDBQueryProcessor.
processor is null. BlockDB is disabled. The end of FBDB file is reached prematurely (corrupted file, or outside interference). FBDB file is not aligned to 20 bytes (likely corrupted). An I/O error occurrs while trying to read FBDB file from disk.
public Traverse ( [ processor ) : void
processor [ Processor to use for each BlockDBEntry.
Результат void