16 #include "../bscript/berror.h" 17 #include "../bscript/escriptv.h" 18 #include "../clib/logfacility.h" 19 #include "../plib/systemstate.h" 36 disable : 4127 ) // conditional expression is constant (needed because of TICK_PROFILEVAR) 50 unsigned empty_zones = 0;
51 unsigned nonempty_zones = 0;
53 unsigned wgridx, wgridy;
58 if ( chr->has_lightoverride() )
60 auto light_until = chr->lightoverride_until();
61 if ( light_until < now_gameclock && light_until != ~0u )
63 chr->lightoverride( -1 );
64 chr->lightoverride_until( 0 );
66 chr->check_region_changes();
70 if ( chr->has_dblclick_wait() )
72 if ( chr->dblclick_wait() < now_gameclock )
73 chr->dblclick_wait( 0 );
75 if ( chr->has_disable_skills_until() )
77 if ( chr->disable_skills_until() < now )
78 chr->disable_skills_until( 0 );
85 ( now <= chr->disable_regeneration_until ) )
94 if ( !chr->dead() || pVital->regen_while_dead )
95 chr->regen_vital( pVital );
102 chr->check_undamaged();
110 wgridx = realm->grid_width();
111 wgridy = realm->grid_height();
113 for (
unsigned wx = 0; wx < wgridx; ++wx )
115 for (
unsigned wy = 0; wy < wgridy; ++wy )
118 for (
auto& chr : realm->zone[wx][wy].characters )
123 for (
auto& chr : realm->zone[wx][wy].npcs )
139 static HANDLE m_CurrentProcessHandle;
145 m_CurrentProcessHandle = GetCurrentProcess();
146 FILETIME d1, d2, k, u;
147 GetProcessTimes( m_CurrentProcessHandle, &d1, &d2, &k, &u );
148 __int64 kt = *(__int64*)&k;
149 __int64 ut = *(__int64*)&u;
150 __int64 tot = ( kt + ut ) / 10;
201 FILETIME d1, d2, k, u;
202 GetProcessTimes( m_CurrentProcessHandle, &d1, &d2, &k, &u );
203 __int64 kt = *(__int64*)&k;
204 __int64 ut = *(__int64*)&u;
205 __int64 tot = ( kt + ut ) / 10;
228 INFO_PRINT.Format(
"sysload={} ({}) cputime={}\n" )
232 POLLOG.Format(
"sysload={} ({}) cputime={}\n" )
281 INFO_PRINT <<
" - " << realm->name() <<
" (mob: " << realm->mobile_count()
282 <<
", off: " << realm->offline_mobile_count()
283 <<
", tli: " << realm->toplevel_item_count() <<
", mlt: " << realm->multi_count()
int get_toplevel_item_count()
size_t last_script_passes_activity
Vital * FindVital(const std::string &str)
std::unique_ptr< PeriodicTask > update_rpm_task
#define ROLL_PROFILECLOCK(timer)
size_t last_mapcache_misses
#define THREAD_CHECKPOINT(thread, check)
size_t cycles_per_decay_worldzone
#define SET_PROFILEVAR(counter, newvalue)
size_t last_nonbusy_sysload_cycles
std::atomic< size_t > script_passes_activity
void setup_update_rpm(void)
static unsigned int creations()
const ExecList & getRunlist()
size_t last_script_passes_noactivity
std::vector< Realms::Realm * > Realms
unsigned short grid_width() const
#define GET_PROFILEVAR_PER_MIN(counter)
unsigned short grid_height() const
#define TICK_PROFILEVAR(counter)
bool warmode_inhibits_regen
size_t cycles_until_decay_worldzone
gameclock_t read_gameclock()
Reads the current value of the game clock.
size_t nonbusy_sysload_cycles
SettingsManager settingsManager
size_t last_sysload_nprocs
size_t last_mapcache_hits
std::unique_ptr< PeriodicTask > regen_resources_task
StateManager stateManager
ScriptScheduler scriptScheduler
std::unique_ptr< PeriodicTask > update_sysload_task
CombatConfig combat_config
std::unique_ptr< PeriodicTask > regen_stats_task
size_t last_busy_sysload_cycles
std::atomic< size_t > script_passes_noactivity
Realms::Realm * main_realm
std::unique_ptr< PeriodicTask > reload_pol_cfg_task
size_t busy_sysload_cycles
std::unique_ptr< PeriodicTask > reload_accounts_task