|
Pol
Revision:cb584c9
|
#include <osmod.h>
Inheritance diagram for Pol::Module::OSExecutorModule:Public Member Functions | |
| OSExecutorModule (Bscript::Executor &exec) | |
| ~OSExecutorModule () | |
| bool | blocked () const |
| Bscript::BObjectImp * | clear_event_queue () |
| bool | in_debugger_holdlist () const |
| unsigned int | pid () const |
| void | revive () |
| void | revive_debugged () |
| bool | signal_event (Bscript::BObjectImp *eventimp) |
| void | SleepFor (int secs) |
| void | SleepForMs (int msecs) |
| void | suspend () |
Public Member Functions inherited from Pol::Bscript::ExecutorModule | |
| virtual | ~ExecutorModule ()=default |
| BApplicObjBase * | getApplicObjParam (unsigned param, const BApplicObjType *object_type) |
| void * | getApplicPtrParam (unsigned param, const BApplicObjType *pointer_type) |
| bool | getObjArrayParam (unsigned param, ObjArray *&pobjarr) |
| bool | getParam (unsigned param, int &value) |
| bool | getParam (unsigned param, int &value, int maxval) |
| bool | getParam (unsigned param, int &value, int minval, int maxval) |
| bool | getParam (unsigned param, unsigned &value) |
| bool | getParam (unsigned param, short &value) |
| bool | getParam (unsigned param, short &value, short maxval) |
| bool | getParam (unsigned param, short &value, short minval, short maxval) |
| bool | getParam (unsigned param, unsigned short &value) |
| bool | getParam (unsigned param, unsigned short &value, unsigned short maxval) |
| bool | getParam (unsigned param, unsigned short &value, unsigned short minval, unsigned short maxval) |
| BObjectImp * | getParamImp (unsigned param) |
| BObjectImp * | getParamImp (unsigned param, BObjectImp::BObjectType type) |
| bool | getParamImp (unsigned param, BObjectImp *&imp) |
| bool | getRealParam (unsigned param, double &value) |
| const String * | getStringParam (unsigned param) |
| bool | getStringParam (unsigned param, const String *&pstr) |
| const std::string & | scriptname () const |
Public Attributes | |
| bool | critical |
| unsigned char | priority |
| bool | warn_on_runaway |
Public Attributes inherited from Pol::Bscript::ExecutorModule | |
| Executor & | exec |
Protected Types | |
| enum | { MAX_EVENTQUEUE_SIZE = 20 } |
| enum | { NO_LIST, TIMEOUT_LIST, NOTIMEOUT_LIST, DEBUGGER_LIST } |
| enum | WAIT_TYPE { WAIT_SLEEP, WAIT_EVENT, WAIT_UNKNOWN } |
Protected Attributes | |
| bool | blocked_ |
| std::queue< Bscript::BObjectImp * > | events_ |
| Core::TimeoutHandle | hold_itr_ |
| enum Pol::Module::OSExecutorModule:: { ... } | in_hold_list_ |
| unsigned short | max_eventqueue_size |
| unsigned int | pid_ |
| Core::polclock_t | sleep_until_clock_ |
| enum Pol::Module::OSExecutorModule::WAIT_TYPE | wait_type |
Protected Attributes inherited from Pol::Bscript::ExecutorModule | |
| boost_utils::function_name_flystring | moduleName |
Friends | |
| class | Bscript::TmplExecutorModule< OSExecutorModule > |
| Core::polclock_t | Core::calc_script_clocksleft (Core::polclock_t now) |
| void | Core::check_blocked (Core::polclock_t *pclocksleft) |
| void | Core::deschedule_executor (Core::UOExecutor *ex) |
| class | Core::ScriptScheduler |
| void | new_check_blocked (void) |
| class | NPCExecutorModule |
| void | step_scripts (void) |
|
protected |
|
protected |
|
explicit |
| Pol::Module::OSExecutorModule::~OSExecutorModule | ( | ) |
Definition at line 118 of file osmod.cpp.
References events_, Pol::Module::freepid(), and pid_.
|
inline |
Definition at line 158 of file osmod.h.
Referenced by Pol::Core::ScriptScheduler::run_ready(), and Pol::Core::UOExecutor::state().
| BObjectImp * Pol::Module::OSExecutorModule::clear_event_queue | ( | ) |
Definition at line 527 of file osmod.cpp.
References events_.
Referenced by Pol::Core::ScriptExObjImp::call_method_id(), and mf_clear_event_queue().
|
protected |
Definition at line 134 of file osmod.cpp.
References Pol::Core::create_debug_context().
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
|
protected |
Definition at line 227 of file osmod.cpp.
References events_.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
inlineprotected |
Definition at line 153 of file osmod.h.
References Pol::Core::getCharacterParam().
Referenced by mf_OpenURL(), and start_skill_script().
|
protected |
Definition at line 165 of file osmod.cpp.
References pid_.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 151 of file osmod.cpp.
References Pol::Core::find_uoexec(), Pol::Bscript::ExecutorModule::getParam(), pid(), and pid_.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
| bool Pol::Module::OSExecutorModule::in_debugger_holdlist | ( | ) | const |
Definition at line 869 of file osmod.cpp.
References DEBUGGER_LIST, and in_hold_list_.
Referenced by Pol::Core::ScriptExObjImp::call_method_id(), Pol::Core::DebugContext::cmd_detach(), Pol::Core::DebugContext::cmd_instrace(), Pol::Core::DebugContext::cmd_run(), Pol::Core::DebugContext::cmd_stepinto(), Pol::Core::DebugContext::cmd_stepover(), Pol::Mobile::NPC::on_death(), Pol::Mobile::NPC::restart_script(), Pol::Mobile::NPC::stop_scripts(), and Pol::Mobile::Character::stop_skill_script().
|
protected |
Definition at line 361 of file osmod.cpp.
References critical.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 934 of file osmod.cpp.
References clear_event_queue().
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 139 of file osmod.cpp.
References Pol::Bscript::Executor::attach_debugger(), Pol::Core::find_uoexec(), and pid_.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 664 of file osmod.cpp.
References Pol::Core::NetworkManager::auxthreadpool, Pol::Bscript::BStruct::contents(), Pol::Module::curlWriteCallback(), Pol::Bscript::String::data(), data, DEBUGLOG, Pol::Bscript::ExecutorModule::exec, weak_ptr< T >::exists(), Pol::Bscript::BStruct::FindMember(), Pol::Bscript::Executor::findModule(), weak_ptr< T >::get_weakptr(), Pol::Bscript::ExecutorModule::getParamImp(), Pol::Bscript::ExecutorModule::getStringParam(), Pol::Bscript::BObjectImp::getStringRep(), Pol::Bscript::BObjectImp::isa(), Pol::Core::networkManager, Pol::Bscript::BObjectImp::OTStruct, Pol::Bscript::Executor::PC, Pol::Core::UOExecutor::pChild, Pol::Bscript::Executor::scriptname(), Pol::Core::UOExecutor::suspend(), uoexec_w, and Pol::Core::UOExecutor::weakptr.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 469 of file osmod.cpp.
References Pol::Bscript::String::data(), Pol::Bscript::ExecutorModule::exec, Pol::Bscript::Executor::getParamImp(), Pol::Bscript::BObjectImp::getStringRep(), INFO_PRINT, Pol::Bscript::BObjectImp::isa(), Pol::Bscript::BObjectImp::OTString, POLLOG, and Pol::Bscript::Executor::scriptname().
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 583 of file osmod.cpp.
References Pol::Core::NetworkManager::auxthreadpool, Pol::Clib::Socket::close(), Pol::Core::ScriptDef::config_nodie(), Pol::Bscript::BObjectImp::copy(), DEBUGLOG, Pol::Bscript::ExecutorModule::exec, Pol::Core::ScriptDef::exists(), weak_ptr< T >::exists(), Pol::Bscript::Executor::findModule(), weak_ptr< T >::get_weakptr(), Pol::Bscript::ExecutorModule::getParam(), Pol::Bscript::ExecutorModule::getParamImp(), Pol::Bscript::ExecutorModule::getStringParam(), Pol::Core::ScriptDef::name(), Pol::Core::networkManager, Pol::Clib::Socket::open(), Pol::Bscript::Executor::PC, Pol::Core::UOExecutor::pChild, Pol::Bscript::EScriptProgram::pkg, Pol::Bscript::Executor::prog(), Pol::Bscript::Executor::scriptname(), Pol::Core::UOExecutor::suspend(), uoexec_w, Pol::Bscript::String::value(), and Pol::Core::UOExecutor::weakptr.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 550 of file osmod.cpp.
References Pol::Mobile::Character::client, Pol::Bscript::String::data(), getCharacterParam(), Pol::Bscript::ExecutorModule::getStringParam(), Pol::Mobile::Character::has_active_client(), Pol::Network::PktHelper::PacketOut< T >::Send(), and URL_MAX_LEN.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
|
protected |
Definition at line 1026 of file osmod.cpp.
References DEBUGLOG, Pol::Bscript::ExecutorModule::exec, Pol::Bscript::Executor::findModule(), Pol::Core::ScriptScheduler::getHoldlist(), Pol::Core::ScriptScheduler::getNoTimeoutHoldlist(), Pol::Bscript::ExecutorModule::getParam(), Pol::Core::ScriptScheduler::getRanlist(), Pol::Core::ScriptScheduler::getRunlist(), max_scripts, Pol::Core::polclock(), Pol::Core::POLCLOCKS_PER_SEC, and Pol::Core::scriptScheduler.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 454 of file osmod.cpp.
References Pol::Bscript::ExecutorModule::exec, Pol::Bscript::ExecutorModule::getParam(), Pol::Bscript::Executor::setDebugLevel(), and Pol::Bscript::Executor::SOURCELINES.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 537 of file osmod.cpp.
References Pol::Bscript::ExecutorModule::getParam(), and max_eventqueue_size.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 493 of file osmod.cpp.
References Pol::Bscript::ExecutorModule::getParam(), and priority.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 885 of file osmod.cpp.
References Pol::Core::UOExecutor::auxsvc_assume_string, Pol::Core::UOExecutor::can_access_offline_mobiles, critical, Pol::Bscript::ExecutorModule::exec, Pol::Bscript::Executor::getDebugLevel(), Pol::Bscript::ExecutorModule::getParam(), Pol::Bscript::Executor::NONE, Pol::Bscript::Executor::setDebugLevel(), Pol::Bscript::Executor::SOURCELINES, and warn_on_runaway.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 488 of file osmod.cpp.
References Pol::Core::stateManager.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 509 of file osmod.cpp.
References Pol::Bscript::String::data(), Pol::Bscript::ExecutorModule::getStringParam(), Pol::Bscript::String::length(), Pol::Core::unload_all_scripts(), and Pol::Core::unload_script().
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
| unsigned int Pol::Module::OSExecutorModule::pid | ( | ) | const |
Definition at line 129 of file osmod.cpp.
References pid_.
Referenced by Pol::Core::DebugContext::cmd_start(), Pol::Core::ScriptExObjImp::get_member_id(), getprocess(), and Pol::Core::ScriptScheduler::run_ready().
| void Pol::Module::OSExecutorModule::revive | ( | ) |
Definition at line 851 of file osmod.cpp.
References blocked_, DEBUGGER_LIST, Pol::Bscript::ExecutorModule::exec, hold_itr_, in_hold_list_, NO_LIST, NOTIMEOUT_LIST, Pol::Core::ScriptScheduler::revive_notimeout(), Pol::Core::ScriptScheduler::revive_timeout(), Pol::Core::scriptScheduler, and TIMEOUT_LIST.
Referenced by Pol::Core::ScriptExObjImp::call_method_id(), Pol::Core::check_blocked(), Pol::Network::ClientGameData::clear(), Pol::Module::clear_gumphandler(), Pol::Module::handle_coord_cursor(), Pol::Core::handle_prompt(), Pol::Module::handle_resurrect_menu(), Pol::Module::handle_script_cursor(), Pol::Module::handle_selcolor(), Pol::Module::handle_textentry(), Pol::Core::handle_unicode_prompt(), Pol::Module::menu_selection_made(), Pol::Module::UOExecutorModule::mf_SendPopUpMenu(), Pol::Mobile::NPC::on_death(), Pol::Module::popup_menu_selection_made(), Pol::Mobile::NPC::restart_script(), Pol::Core::UOExecutor::revive(), Pol::Core::ScriptScheduler::run_ready(), signal_event(), Pol::Mobile::NPC::stop_scripts(), and Pol::Mobile::Character::stop_skill_script().
| void Pol::Module::OSExecutorModule::revive_debugged | ( | ) |
Definition at line 873 of file osmod.cpp.
References Pol::Bscript::ExecutorModule::exec, in_hold_list_, NO_LIST, Pol::Core::ScriptScheduler::revive_debugged(), and Pol::Core::scriptScheduler.
Referenced by Pol::Core::ScriptExObjImp::call_method_id(), Pol::Core::DebugContext::cmd_detach(), Pol::Core::DebugContext::cmd_instrace(), Pol::Core::DebugContext::cmd_run(), Pol::Core::DebugContext::cmd_stepinto(), Pol::Core::DebugContext::cmd_stepover(), Pol::Mobile::NPC::on_death(), Pol::Mobile::NPC::restart_script(), Pol::Mobile::NPC::stop_scripts(), and Pol::Mobile::Character::stop_skill_script().
|
protected |
Definition at line 387 of file osmod.cpp.
References Pol::Core::ScriptDef::config_nodie(), Pol::Module::UOExecutorModule::controller_, Pol::Bscript::BObjectImp::copy(), Pol::Bscript::UninitObject::create(), Pol::Bscript::ExecutorModule::exec, Pol::Core::ScriptDef::exists(), Pol::Bscript::Executor::findModule(), Pol::Bscript::Executor::getParamImp(), Pol::Bscript::Executor::getStringParam(), Pol::Core::ScriptDef::name(), Pol::Bscript::Executor::PC, Pol::Core::UOExecutor::pChild, Pol::Bscript::EScriptProgram::pkg, Pol::Core::UOExecutor::pParent, Pol::Bscript::Executor::prog(), Pol::Core::start_script(), suspend(), Pol::Bscript::String::value(), and Pol::Bscript::Executor::ValueStack.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 369 of file osmod.cpp.
References Pol::Core::ScriptDef::config_nodie(), Pol::Bscript::ExecutorModule::exec, Pol::Core::ScriptDef::exists(), Pol::Bscript::ExecutorModule::getParamImp(), Pol::Bscript::Executor::paramAsString(), Pol::Bscript::EScriptProgram::pkg, Pol::Bscript::Executor::prog(), Pol::Core::run_script_to_completion(), and Pol::Bscript::ExecutorModule::scriptname().
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 347 of file osmod.cpp.
References critical, Pol::Bscript::ExecutorModule::exec, and Pol::Bscript::Executor::getParam().
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
| bool Pol::Module::OSExecutorModule::signal_event | ( | Bscript::BObjectImp * | eventimp | ) |
Definition at line 769 of file osmod.cpp.
References blocked_, events_, Pol::Bscript::ExecutorModule::exec, Pol::Bscript::Executor::findModule(), Pol::Bscript::BObjectImp::getStringRep(), INC_PROFILEVAR, INFO_PRINT, max_eventqueue_size, Pol::Module::NPCExecutorModule::npc, revive(), Pol::Bscript::Executor::scriptname(), Pol::Core::ULWObject::serial, Pol::Plib::systemstate, Pol::Bscript::Executor::ValueStack, WAIT_EVENT, wait_type, Pol::Core::ULWObject::x, Pol::Core::ULWObject::y, and Pol::Core::ULWObject::z.
Referenced by Pol::Mobile::NPC::apply_raw_damage_hundredths(), Pol::Core::ScriptExObjImp::call_method_id(), Pol::Mobile::NPC::inform_criminal(), Pol::Mobile::NPC::inform_disengaged(), Pol::Mobile::NPC::inform_engaged(), Pol::Mobile::NPC::inform_enteredarea(), Pol::Mobile::NPC::inform_imoved(), Pol::Mobile::NPC::inform_leftarea(), Pol::Mobile::NPC::inform_moved(), Pol::Mobile::NPC::on_ghost_pc_spoke(), Pol::Mobile::NPC::on_pc_spoke(), Pol::Core::sayto_listening_points(), Pol::Mobile::NPC::send_event(), and Pol::Mobile::NPC::send_event_script().
|
protected |
Definition at line 183 of file osmod.cpp.
References Pol::Bscript::ExecutorModule::exec, Pol::Bscript::Executor::paramAsLong(), and SleepFor().
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
| void Pol::Module::OSExecutorModule::SleepFor | ( | int | secs | ) |
Definition at line 824 of file osmod.cpp.
References blocked_, Pol::Core::polclock(), Pol::Core::POLCLOCKS_PER_SEC, sleep_until_clock_, WAIT_SLEEP, and wait_type.
Referenced by Pol::Module::NPCExecutorModule::move(), and sleep().
| void Pol::Module::OSExecutorModule::SleepForMs | ( | int | msecs | ) |
Definition at line 834 of file osmod.cpp.
References blocked_, Pol::Core::polclock(), Pol::Core::POLCLOCKS_PER_SEC, sleep_until_clock_, WAIT_SLEEP, and wait_type.
Referenced by Pol::Module::HttpExecutorModule::mf_WriteHtml(), Pol::Module::HttpExecutorModule::mf_WriteHtmlRaw(), Pol::Module::NPCExecutorModule::move_self(), and sleepms().
|
protected |
Definition at line 194 of file osmod.cpp.
References Pol::Bscript::ExecutorModule::exec, Pol::Bscript::Executor::paramAsLong(), and SleepForMs().
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 232 of file osmod.cpp.
References Pol::Core::ScriptDef::config_nodie(), Pol::Module::UOExecutorModule::controller_, Pol::Bscript::BObjectImp::copy(), Pol::Bscript::ExecutorModule::exec, Pol::Core::ScriptDef::exists(), Pol::Bscript::Executor::findModule(), Pol::Bscript::Executor::getParamImp(), Pol::Bscript::Executor::getStringParam(), Pol::Core::ScriptDef::name(), Pol::Bscript::EScriptProgram::pkg, Pol::Bscript::Executor::prog(), Pol::Core::start_script(), and Pol::Bscript::String::value().
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
protected |
Definition at line 269 of file osmod.cpp.
References Pol::Core::ScriptDef::c_str(), Pol::Core::CanUseSkill(), Pol::Mobile::Character::client, Pol::Core::ScriptDef::config_nodie(), Pol::Bscript::BObjectImp::copy(), Pol::Mobile::Attribute::delay_seconds, Pol::Mobile::Attribute::disable_core_checks, Pol::Core::ScriptDef::empty(), Pol::Bscript::ExecutorModule::exec, Pol::Core::ScriptDef::exists(), Pol::Core::find_script2(), ref_ptr< T >::get(), Pol::Core::getAttributeParam(), getCharacterParam(), Pol::Bscript::Executor::getParamImp(), Pol::Bscript::Executor::getStringParam(), Pol::Mobile::Character::hidden(), Pol::Mobile::Attribute::name, Pol::Core::ScriptDef::name(), Pol::Bscript::EScriptProgram::pkg, Pol::Core::poltime(), Pol::Bscript::Executor::prog(), Pol::Mobile::Attribute::script_, Pol::Core::send_sysmessage(), Pol::Mobile::Character::start_script(), Pol::Plib::systemstate, Pol::Mobile::Character::unhide(), Pol::Mobile::Attribute::unhides, and Pol::Bscript::String::value().
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
| void Pol::Module::OSExecutorModule::suspend | ( | ) |
Definition at line 844 of file osmod.cpp.
References blocked_, sleep_until_clock_, WAIT_SLEEP, and wait_type.
Referenced by run_script(), and Pol::Core::UOExecutor::suspend().
|
protected |
Definition at line 205 of file osmod.cpp.
References blocked_, events_, Pol::Bscript::ExecutorModule::exec, Pol::Bscript::Executor::paramAsLong(), Pol::Core::polclock(), Pol::Core::POLCLOCKS_PER_SEC, sleep_until_clock_, WAIT_EVENT, and wait_type.
Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
Definition at line 111 of file osmod.h.
Referenced by Pol::Core::check_blocked(), revive(), signal_event(), SleepFor(), SleepForMs(), suspend(), and wait_for_event().
| bool Pol::Module::OSExecutorModule::critical |
Definition at line 62 of file osmod.h.
Referenced by Pol::Core::ClientCreateChar(), Pol::Core::ClientCreateChar70160(), Pol::Core::ClientCreateCharKR(), is_critical(), Pol::Core::list_crit_script(), mf_set_script_option(), Pol::Core::ScriptScheduler::run_ready(), and set_critical().
|
protected |
Definition at line 137 of file osmod.h.
Referenced by clear_event_queue(), events_waiting(), signal_event(), wait_for_event(), and ~OSExecutorModule().
|
protected |
Definition at line 121 of file osmod.h.
Referenced by revive(), and Pol::Core::ScriptScheduler::run_ready().
| enum { ... } Pol::Module::OSExecutorModule::in_hold_list_ |
Referenced by in_debugger_holdlist(), revive(), revive_debugged(), and Pol::Core::ScriptScheduler::run_ready().
|
protected |
Definition at line 136 of file osmod.h.
Referenced by mf_set_event_queue_size(), and signal_event().
|
protected |
Definition at line 123 of file osmod.h.
Referenced by getpid(), getprocess(), mf_debugger(), pid(), and ~OSExecutorModule().
| unsigned char Pol::Module::OSExecutorModule::priority |
Definition at line 63 of file osmod.h.
Referenced by mf_set_priority(), and Pol::Core::ScriptScheduler::run_ready().
|
protected |
Definition at line 112 of file osmod.h.
Referenced by Pol::Core::calc_script_clocksleft(), Pol::Core::check_blocked(), Pol::Core::ScriptScheduler::run_ready(), SleepFor(), SleepForMs(), suspend(), and wait_for_event().
|
protected |
Referenced by signal_event(), SleepFor(), SleepForMs(), suspend(), and wait_for_event().
| bool Pol::Module::OSExecutorModule::warn_on_runaway |
Definition at line 64 of file osmod.h.
Referenced by mf_set_script_option(), and Pol::Core::ScriptScheduler::run_ready().