20 #include "../../bscript/bobject.h" 21 #include "../../clib/boostutils.h" 22 #include "../../clib/clib_MD5.h" 23 #include "../../clib/logfacility.h" 24 #include "../../plib/systemstate.h" 25 #include "../accounts/account.h" 26 #include "../accounts/accounts.h" 27 #include "../checkpnt.h" 28 #include "../console.h" 29 #include "../guardrgn.h" 30 #include "../guilds.h" 31 #include "../item/equipmnt.h" 32 #include "../item/itemdesc.h" 33 #include "../item/weapon.h" 34 #include "../listenpt.h" 35 #include "../loadunld.h" 36 #include "../miscrgn.h" 37 #include "../mobile/attribute.h" 38 #include "../multi/boat.h" 39 #include "../musicrgn.h" 40 #include "../npctmpl.h" 41 #include "../objecthash.h" 43 #include "../polcfg.h" 44 #include "../polsem.h" 45 #include "../realms/realm.h" 46 #include "../resource.h" 47 #include "../scrstore.h" 48 #include "../spells.h" 49 #include "../startloc.h" 50 #include "../storage.h" 51 #include "../syshook.h" 52 #include "../syshookscript.h" 53 #include "../uoskills.h" 54 #include "../uworld.h" 64 disable : 4505 ) // '...': unreferenced local function has been removed (because of region.h) 85 wrestling_weapon( nullptr ),
86 justicedef( nullptr ),
89 weatherdef( nullptr ),
96 main_realm( nullptr ),
100 shadowrealm_count( 0 ),
113 pAttrStrength( nullptr ),
114 pAttrIntelligence( nullptr ),
115 pAttrDexterity( nullptr ),
116 pAttrParry( nullptr ),
117 pAttrTactics( nullptr ),
123 spell_scroll_objtype_limits( {{
131 {{0x574B, 0x5750}}}} ),
213 elem.second->unload_scripts();
268 account->clear_character( i );
271 for (
auto& realm :
Realms )
273 unsigned wgridx = realm->grid_width();
274 unsigned wgridy = realm->grid_height();
276 for (
unsigned wx = 0; wx < wgridx; ++wx )
278 for (
unsigned wy = 0; wy < wgridy; ++wy )
280 for (
auto& item : realm->zone[wx][wy].items )
284 realm->zone[wx][wy].items.clear();
288 for (
unsigned wx = 0; wx < wgridx; ++wx )
290 for (
unsigned wy = 0; wy < wgridy; ++wy )
292 for (
auto& chr : realm->zone[wx][wy].characters )
297 realm->zone[wx][wy].characters.clear();
298 for (
auto& chr : realm->zone[wx][wy].npcs )
303 realm->zone[wx][wy].npcs.clear();
307 for (
unsigned wx = 0; wx < wgridx; ++wx )
309 for (
unsigned wy = 0; wy < wgridy; ++wy )
311 for (
auto& multi : realm->zone[wx][wy].multis )
315 realm->zone[wx][wy].multis.clear();
368 lp_pair.second =
nullptr;
370 listen_points.clear();
386 if ( it->second !=
nullptr )
388 it->second->destroy();
389 it->second =
nullptr;
400 if ( templates.second !=
nullptr )
401 delete templates.second;
402 templates.second =
nullptr;
404 npc_templates.clear();
413 memset( &usage, 0,
sizeof( usage ) );
417 usage.
misc += ele.estimateSize();
421 usage.
misc += ele.first.capacity() +
sizeof(
NpcTemplate* ) + (
sizeof(
void* ) * 3 + 1 ) / 2;
422 if ( ele.second !=
nullptr )
423 usage.
misc += ele.second->estimateSize();
429 ele.first.capacity() + ele.second.estimateSize() + (
sizeof(
void* ) * 3 + 1 ) / 2;
439 if ( acc.get() != nullptr )
445 if ( loc !=
nullptr )
446 usage.
misc += loc->estimateSize();
460 for (
const auto& menu :
menus )
461 usage.
misc += menu.estimateSize();
465 for (
const auto& party :
parties )
466 if ( party.get() != nullptr )
467 usage.
misc += party->estimateSize();
469 for (
const auto& guild :
guilds )
470 if ( guild.second.get() != nullptr )
472 sizeof(
unsigned int ) + guild.second->estimateSize() + (
sizeof(
void* ) * 3 + 1 ) / 2;
474 for (
const auto& realm :
Realms )
476 if ( realm !=
nullptr )
480 (
sizeof( int ) +
sizeof(
Realms::Realm* ) + (
sizeof(
void* ) * 3 + 1 ) / 2 ) *
485 if ( attr !=
nullptr )
486 usage.
misc += attr->estimateSize();
492 attr.first.capacity() +
sizeof(
Mobile::Attribute* ) + (
sizeof(
void* ) * 3 + 1 ) / 2;
496 for (
const auto& spell :
spells )
498 if ( spell !=
nullptr )
499 usage.
misc += spell->estimateSize();
507 if ( script !=
nullptr )
508 usage.
misc += script->estimateSize();
518 usage.
misc += zone.name.capacity() +
sizeof( double ) + 3 *
sizeof(
unsigned short* ) +
519 zone.layers.capacity() *
sizeof(
unsigned short );
523 for (
const auto& vital :
vitals )
525 if ( vital !=
nullptr )
526 usage.
misc += vital->estimateSize();
529 usage.
misc += vital.first.capacity() +
sizeof(
Vital* ) + (
sizeof(
void* ) * 3 + 1 ) / 2;
536 if ( elem.second !=
nullptr )
537 usage.
misc += elem.second->estimatedSize();
541 if ( elem !=
nullptr )
542 usage.
misc += elem->estimatedSize();
545 (
sizeof(
unsigned int ) +
sizeof(
unsigned int ) + (
sizeof(
void* ) * 3 + 1 ) / 2 ) *
549 usage.
misc += elem.first.capacity() +
sizeof(
u32 ) + (
sizeof(
void* ) * 3 + 1 ) / 2;
553 usage.
misc += elem.first.capacity() +
sizeof(
ResourceDef* ) + (
sizeof(
void* ) * 3 + 1 ) / 2;
554 if ( elem.second !=
nullptr )
555 usage.
misc += elem.second->estimateSize();
560 (
sizeof(
void* ) * 3 + 1 ) / 2;
565 if ( elem.second !=
nullptr )
566 usage.
misc += elem.second->estimateSize();
572 elem.first.capacity() + elem.second.estimateSize() + (
sizeof(
void* ) * 3 + 1 ) / 2;
577 usage.
misc += elem.estimateSize();
580 (
sizeof(
void* ) * 3 + 1 ) / 2 ) *
584 usage.
misc += elem.first.capacity() + elem.second.capacity() + (
sizeof(
void* ) * 3 + 1 ) / 2;
590 usage.
misc += elem.capacity() + 3 *
sizeof(
void* );
594 usage.
misc += elem.first.capacity() +
sizeof( elem.second ) + (
sizeof(
void* ) * 3 + 1 ) / 2;
598 usage.
misc += elem.first.capacity() +
sizeof( elem.second ) + (
sizeof(
void* ) * 3 + 1 ) / 2;
603 usage.
misc += elem.estimateSize();
virtual size_t estimateSize() const POL_OVERRIDE
NpcTemplates npc_templates
PropSet Global_Ignore_CProps
std::map< std::string, std::string > mime_types
std::vector< Items::ItemDesc * > dynamic_item_descriptors
IntrinsicEquipments intrinsic_equipments
void unload_npc_templates()
void log_all_script_cycle_counts(bool clear_counters)
threadhelp::TaskThreadPool task_thread_pool
void clear_listen_points()
std::vector< UOSkill > uo_skills
void unload_intrinsic_templates()
ResourceDefs resourcedefs
AttributesByName attributes_byname
std::unique_ptr< Core::PropertyList > global_properties
void display_leftover_objects()
Memory estimateSize() const
VitalsByName vitals_byname
UACTION mount_action_xlate[ACTION__HIGHEST+1]
ListenPoints listen_points
std::unique_ptr< Items::ItemDesc > temp_itemdesc
static void ReleaseSharedInstance()
std::unique_ptr< Items::ItemDesc > empty_itemdesc
virtual size_t estimateSize() const
std::vector< Menu > menus
std::map< std::string, MobileTranslate > animation_translates
std::vector< ConsoleCommand > console_commands
void reload_account_data(void)
void checkpoint(const char *msg, unsigned short minlvl)
std::vector< std::string > tipfilenames
Plib::Package * wwwroot_pkg
std::vector< Realms::Realm * > Realms
NpcTemplatesElems npc_template_elems
NetworkManager networkManager
boost_utils::flyweight_initializers fw_inits
ConfigurationBuffer configurationbuffer
ParamTextCmds paramtextcmds
std::array< LandTile, LANDTILE_COUNT > landtiles
std::vector< Mobile::Attribute * > attributes
void unload_intrinsic_weapons()
void write_account_data_task(void)
void ClearCharacterAccountReferences()
const Vital * pVitalStamina
void unload_system_hooks()
std::vector< USpell * > spells
ScriptScheduler scriptScheduler
ref_ptr< Accounts::Account > AccountRef
ObjtypeByNameMap objtype_byname
OldObjtypeConversions old_objtype_conversions
ObjectStorageManager objStorageManager
std::vector< ExportScript * > export_scripts
std::map< u32, Items::ItemDesc * > desctable
double armor_zone_chance_sum
StartingLocations startlocations
Items::UWeapon * wrestling_weapon
unsigned short character_slots
std::map< int, Realms::Realm * > shadowrealms_by_id
size_t estimateSize() const
std::vector< SpellCircle * > spellcircles
Realms::Realm * main_realm
MultiDefBuffer multidef_buffer
std::vector< Vital * > vitals