12 #include "../clib/binaryfile.h" 13 #include "../clib/logfacility.h" 14 #include "../clib/passert.h" 15 #include "../clib/stlutil.h" 16 #include "../clib/timer.h" 24 : _descriptor( descriptor ), _index(), _statics()
30 std::string message =
"Empty file: " +
_descriptor.
path(
"statidx.dat" );
31 throw std::runtime_error( message );
38 std::string message =
"Empty file: " +
_descriptor.
path(
"statics.dat" );
39 throw std::runtime_error( message );
68 if ( block_index + 1 >=
_index.size() )
72 throw std::runtime_error( message );
74 unsigned int first_entry_index =
_index[block_index].index;
75 unsigned int num =
_index[block_index + 1].index - first_entry_index;
76 if ( first_entry_index + num >
_statics.size() )
80 throw std::runtime_error( message );
93 unsigned int first_entry_index =
_index[block_index].index;
94 unsigned int num =
_index[block_index + 1].index - first_entry_index;
101 if ( entry->
xy == xy && entry->
objtype == objtype )
120 unsigned int first_entry_index =
_index[block_index].index;
121 unsigned int num =
_index[block_index + 1].index - first_entry_index;
128 if ( entry->
xy == xy )
130 statics.push_back( *entry );
const unsigned STATICBLOCK_SHIFT
size_t sizeEstimate() const
const unsigned STATICBLOCK_CHUNK
const RealmDescriptor _descriptor
bool findstatic(unsigned short x, unsigned short y, unsigned short objtype) const
void getstatics(StaticEntryList &statics, unsigned short x, unsigned short y) const
size_t sizeEstimate() const
std::vector< STATIC_INDEX > _index
StaticServer(const RealmDescriptor &descriptor)
std::string tostring(const Bscript::BTokenType &v)
void ValidateBlock(unsigned short x, unsigned short y) const
std::string path(const std::string &filename) const
std::vector< STATIC_ENTRY > _statics
void ReadVector(std::vector< T > &vec)
const unsigned STATICCELL_MASK