Pol
Revision:cb584c9
|
#include <uoexec.h>
Public Member Functions | |
UOExecutor () | |
virtual | ~UOExecutor () |
bool | revive () |
virtual size_t | sizeEstimate () const POL_OVERRIDE |
std::string | state () |
bool | suspend () |
![]() | |
Executor () | |
virtual | ~Executor () |
void | addmember2 (BObject &left, const BObject &right) |
void | addModule (ExecutorModule *module) |
void | attach_debugger () |
bool | AttachFunctionalityModules () |
void | calcrunnable () |
void | dbg_break () |
void | dbg_clrallbp () |
void | dbg_clrbp (unsigned atPC) |
std::string | dbg_get_instruction (size_t atPC) const |
void | dbg_ins_trace () |
void | dbg_run () |
void | dbg_setbp (unsigned atPC) |
void | dbg_step_into () |
void | dbg_step_over () |
bool | debugging () const |
void | detach_debugger () |
bool | empty_scriptname () |
bool | error () const |
bool | exec () |
void | execFunc (const Token &token) |
void | execInstr () |
ExecutorModule * | findModule (const std::string &name) |
BApplicObjBase * | getApplicObjParam (unsigned param, const BApplicObjType *object_type) |
void * | getApplicPtrParam (unsigned param, const BApplicObjType *pointer_type) |
void | getArg (const Token &token) |
int | getDebugLevel () |
const BLong * | getLongParam (unsigned param) |
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, 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) |
bool | getParam (unsigned param, short &value) |
bool | getParam (unsigned param, short &value, short maxval) |
bool | getParam (unsigned param, short &value, short minval, short maxval) |
BObjectImp * | getParamImp (unsigned param) |
BObjectImp * | getParamImp (unsigned param, BObjectImp::BObjectType type) |
BObjectImp * | getParamImp2 (unsigned param, BObjectImp::BObjectType type) |
BObject * | getParamObj (unsigned param) |
bool | getRealParam (unsigned param, double &value) |
const String * | getStringParam (unsigned param) |
bool | getStringParam (unsigned param, const String *&pstr) |
int | getToken (Token &token, unsigned position) |
BObjectRef & | GlobalVar (unsigned int varnum) |
bool | halt () const |
bool | hasParams (unsigned howmany) const |
void | initForFnCall (unsigned in_PC) |
void | ins_add (const Instruction &ins) |
void | ins_addmember (const Instruction &ins) |
void | ins_addmember2 (const Instruction &ins) |
void | ins_addmember_assign (const Instruction &ins) |
void | ins_array (const Instruction &ins) |
void | ins_array_assign (const Instruction &ins) |
void | ins_array_assign_consume (const Instruction &ins) |
void | ins_arraysubscript (const Instruction &ins) |
void | ins_assign (const Instruction &ins) |
void | ins_assign_consume (const Instruction &ins) |
void | ins_assign_globalvar (const Instruction &ins) |
void | ins_assign_localvar (const Instruction &ins) |
void | ins_bitshift_left (const Instruction &ins) |
void | ins_bitshift_right (const Instruction &ins) |
void | ins_bitwise_and (const Instruction &ins) |
void | ins_bitwise_not (const Instruction &ins) |
void | ins_bitwise_or (const Instruction &ins) |
void | ins_bitwise_xor (const Instruction &ins) |
void | ins_call_method (const Instruction &ins) |
void | ins_call_method_id (const Instruction &ins) |
void | ins_casejmp (const Instruction &ins) |
void | ins_checkmember (const Instruction &ins) |
void | ins_consume (const Instruction &ins) |
void | ins_declareArray (const Instruction &ins) |
void | ins_dictionary (const Instruction &ins) |
void | ins_dictionary_addmember (const Instruction &ins) |
void | ins_div (const Instruction &ins) |
void | ins_divideequal (const Instruction &ins) |
void | ins_double (const Instruction &ins) |
void | ins_equal (const Instruction &ins) |
void | ins_error (const Instruction &ins) |
void | ins_exit (const Instruction &ins) |
void | ins_func (const Instruction &ins) |
void | ins_funcref (const Instruction &ins) |
void | ins_get_arg (const Instruction &ins) |
void | ins_get_member (const Instruction &ins) |
void | ins_get_member_id (const Instruction &ins) |
void | ins_globalvar (const Instruction &ins) |
void | ins_gosub (const Instruction &ins) |
void | ins_goto (const Instruction &ins) |
void | ins_greaterequal (const Instruction &ins) |
void | ins_greaterthan (const Instruction &ins) |
void | ins_ident (const Instruction &ins) |
void | ins_in (const Instruction &ins) |
void | ins_initfor (const Instruction &ins) |
void | ins_initforeach (const Instruction &ins) |
void | ins_initforeach2 (const Instruction &ins) |
void | ins_insert_into (const Instruction &ins) |
void | ins_jmpiffalse (const Instruction &ins) |
void | ins_jmpiftrue (const Instruction &ins) |
void | ins_jsr_userfunc (const Instruction &ins) |
void | ins_leave_block (const Instruction &ins) |
void | ins_lessequal (const Instruction &ins) |
void | ins_lessthan (const Instruction &ins) |
void | ins_localvar (const Instruction &ins) |
void | ins_logical_and (const Instruction &ins) |
void | ins_logical_not (const Instruction &ins) |
void | ins_logical_or (const Instruction &ins) |
void | ins_long (const Instruction &ins) |
void | ins_makeLocal (const Instruction &ins) |
void | ins_makelocal (const Instruction &ins) |
void | ins_member (const Instruction &ins) |
void | ins_minusequal (const Instruction &ins) |
void | ins_modulus (const Instruction &ins) |
void | ins_modulusequal (const Instruction &ins) |
void | ins_mult (const Instruction &ins) |
void | ins_multisubscript (const Instruction &ins) |
void | ins_multisubscript_assign (const Instruction &ins) |
void | ins_multisubscript_assign_consume (const Instruction &ins) |
void | ins_nextfor (const Instruction &ins) |
void | ins_nop (const Instruction &ins) |
void | ins_notequal (const Instruction &ins) |
void | ins_plusequal (const Instruction &ins) |
void | ins_pop_param (const Instruction &ins) |
void | ins_pop_param_byref (const Instruction &ins) |
void | ins_progend (const Instruction &ins) |
void | ins_removemember (const Instruction &ins) |
void | ins_return (const Instruction &ins) |
void | ins_set_member (const Instruction &ins) |
void | ins_set_member_consume (const Instruction &ins) |
void | ins_set_member_id (const Instruction &ins) |
void | ins_set_member_id_consume (const Instruction &ins) |
void | ins_set_member_id_consume_divideequal (const Instruction &ins) |
void | ins_set_member_id_consume_minusequal (const Instruction &ins) |
void | ins_set_member_id_consume_modulusequal (const Instruction &ins) |
void | ins_set_member_id_consume_plusequal (const Instruction &ins) |
void | ins_set_member_id_consume_timesequal (const Instruction &ins) |
void | ins_statementbegin (const Instruction &ins) |
void | ins_stepforeach (const Instruction &ins) |
void | ins_stepforeach2 (const Instruction &ins) |
void | ins_string (const Instruction &ins) |
void | ins_struct (const Instruction &ins) |
void | ins_subtract (const Instruction &ins) |
void | ins_timesequal (const Instruction &ins) |
void | ins_uninit (const Instruction &ins) |
void | ins_unminus (const Instruction &ins) |
BObjectRef & | LocalVar (unsigned int varnum) |
int | makeGlobal (const Token &token) |
BObject * | makeObj (const Token &token) |
int | makeString (unsigned param) |
size_t | numParams () const |
double | paramAsDouble (unsigned param) |
int | paramAsLong (unsigned param) |
const char * | paramAsString (unsigned param) |
void | popParam (const Token &token) |
void | popParamByRef (const Token &token) |
const EScriptProgram * | prog () const |
void | pushArg (BObjectImp *arg) |
void | pushArg (const BObjectRef &ref) |
void | reinitExec () |
bool | runnable () const |
bool | running_to_completion () const |
const std::string & | scriptname () const |
void | set_running_to_completion (bool to_completion) |
void | setdebugging (bool debugging) |
void | setDebugLevel (DEBUG_LEVEL level) |
void | seterror (bool err) |
void | setFunctionResult (BObjectImp *imp) |
void | sethalt (bool halt) |
bool | setProgram (EScriptProgram *prog) |
void | setViewMode (bool vm) |
void | show_context (unsigned atPC) |
void | show_context (fmt::Writer &os, unsigned atPC) |
Public Attributes | |
unsigned short | area_size |
bool | auxsvc_assume_string |
bool | can_access_offline_mobiles |
unsigned int | eventmask |
u64 | instr_cycles |
Module::OSExecutorModule * | os_module |
UOExecutor * | pChild |
UOExecutor * | pParent |
u64 | runaway_cycles |
u64 | sleep_cycles |
unsigned short | speech_size |
time_t | start_time |
u64 | warn_runaway_on_cycle |
weak_ptr_owner< UOExecutor > | weakptr |
![]() | |
std::vector< ExecutorModule * > | availmodules |
std::vector< ReturnContext > | ControlStack |
ModuleFunction * | current_module_function |
DEBUG_LEVEL | debug_level |
int | done |
bool | error_ |
std::vector< ExecutorModule * > | execmodules |
std::vector< BObjectRef > | fparams |
BObjectRefVec | Globals2 |
bool | halt_ |
BObjectRefVec * | Locals2 |
unsigned | nLines |
unsigned | PC |
bool | run_ok_ |
std::vector< BObjectRefVec * > | upperLocals2 |
ValueStackCont | ValueStack |
Private Types | |
typedef Bscript::Executor | base |
Additional Inherited Members | |
![]() | |
enum | DEBUG_LEVEL { NONE, SOURCELINES, INSTRUCTIONS } |
![]() | |
static BObjectRef | addmember (BObject &left, const BObject &right) |
static BObjectRef | checkmember (BObject &left, const BObject &right) |
static ExecInstrFunc | GetInstrFunc (const Token &token) |
static int | ins_casejmp_finddefault (const Token &token) |
static int | ins_casejmp_findlong (const Token &token, BLong *blong) |
static int | ins_casejmp_findstring (const Token &token, String *bstringimp) |
static BObjectRef | removemember (BObject &left, const BObject &right) |
![]() | |
static Clib::SpinLock | _executor_lock |
static UninitObject * | m_SharedUninitObject |
![]() | |
void | cleanParams () |
BObjectRef | getObjRef (void) |
BObject * | getParam (unsigned param) |
int | getParams (unsigned howMany) |
BObject | getValue (void) |
int | makeDouble (unsigned param) |
|
private |
Pol::Core::UOExecutor::UOExecutor | ( | ) |
Definition at line 17 of file uoexec.cpp.
References Pol::Bscript::Executor::addModule(), os_module, and weakptr.
Referenced by sizeEstimate().
|
virtual |
Definition at line 38 of file uoexec.cpp.
References Pol::Core::elapsed(), instr_cycles, pChild, POLLOG_ERROR, Pol::Core::poltime(), pParent, Pol::Core::Watch::profile_scripts, Pol::Bscript::Executor::scriptname(), Pol::Core::settingsManager, sleep_cycles, start_time, and Pol::Core::SettingsManager::watch.
bool Pol::Core::UOExecutor::revive | ( | ) |
Definition at line 64 of file uoexec.cpp.
References os_module, and Pol::Module::OSExecutorModule::revive().
|
virtual |
Reimplemented from Pol::Bscript::Executor.
Definition at line 80 of file uoexec.cpp.
References Pol::Bscript::Executor::sizeEstimate(), and UOExecutor().
Referenced by Pol::Core::ExportScript::estimateSize(), and Pol::Core::ScriptExObjImp::get_member_id().
std::string Pol::Core::UOExecutor::state | ( | ) |
Definition at line 70 of file uoexec.cpp.
References Pol::Module::OSExecutorModule::blocked(), Pol::Bscript::Executor::halt(), and os_module.
Referenced by Pol::Core::ScriptExObjImp::get_member_id().
bool Pol::Core::UOExecutor::suspend | ( | ) |
Definition at line 54 of file uoexec.cpp.
References os_module, Pol::Bscript::Executor::running_to_completion(), and Pol::Module::OSExecutorModule::suspend().
Referenced by Pol::Module::OSExecutorModule::mf_HTTPRequest(), Pol::Module::OSExecutorModule::mf_OpenConnection(), Pol::Module::UnicodeExecutorModule::mf_RequestInputUC(), Pol::Module::UOExecutorModule::mf_SelectMenuItem(), Pol::Module::UOExecutorModule::mf_Target(), Pol::Module::UOExecutorModule::mf_TargetCoordinates(), and Pol::Module::UOExecutorModule::mf_TargetMultiPlacement().
unsigned short Pol::Core::UOExecutor::area_size |
Definition at line 57 of file uoexec.h.
Referenced by Pol::Mobile::NPC::inform_criminal(), Pol::Mobile::NPC::inform_enteredarea(), Pol::Mobile::NPC::inform_imoved(), Pol::Mobile::NPC::inform_leftarea(), Pol::Mobile::NPC::inform_moved(), and Pol::Module::UOExecutorModule::mf_EnableEvents().
bool Pol::Core::UOExecutor::auxsvc_assume_string |
Definition at line 61 of file uoexec.h.
Referenced by Pol::Module::OSExecutorModule::mf_set_script_option().
bool Pol::Core::UOExecutor::can_access_offline_mobiles |
Definition at line 60 of file uoexec.h.
Referenced by Pol::Module::OSExecutorModule::mf_set_script_option().
unsigned int Pol::Core::UOExecutor::eventmask |
Definition at line 56 of file uoexec.h.
Referenced by Pol::Mobile::NPC::apply_raw_damage_hundredths(), Pol::Mobile::NPC::can_accept_event(), 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::Module::UOExecutorModule::mf_DisableEvents(), Pol::Module::UOExecutorModule::mf_EnableEvents(), Pol::Mobile::NPC::on_ghost_pc_spoke(), and Pol::Mobile::NPC::on_pc_spoke().
u64 Pol::Core::UOExecutor::instr_cycles |
Definition at line 49 of file uoexec.h.
Referenced by Pol::Core::ScriptExObjImp::get_member_id(), Pol::Core::ScriptScheduler::run_ready(), and ~UOExecutor().
Module::OSExecutorModule* Pol::Core::UOExecutor::os_module |
Definition at line 37 of file uoexec.h.
Referenced by Pol::Mobile::NPC::apply_raw_damage_hundredths(), Pol::Core::calc_script_clocksleft(), Pol::Core::ScriptExObjImp::call_method_id(), Pol::Core::check_blocked(), Pol::Network::ClientGameData::clear(), Pol::Module::clear_gumphandler(), Pol::Core::ClientCreateChar(), Pol::Core::ClientCreateChar70160(), Pol::Core::ClientCreateCharKR(), Pol::Core::DebugContext::cmd_detach(), Pol::Core::DebugContext::cmd_instrace(), Pol::Core::DebugContext::cmd_run(), Pol::Core::DebugContext::cmd_start(), Pol::Core::DebugContext::cmd_stepinto(), Pol::Core::DebugContext::cmd_stepover(), Pol::Core::ScriptExObjImp::get_member_id(), 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::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::Core::list_crit_script(), Pol::Module::menu_selection_made(), Pol::Module::UOExecutorModule::mf_SendPopUpMenu(), Pol::Module::HttpExecutorModule::mf_WriteHtml(), Pol::Module::HttpExecutorModule::mf_WriteHtmlRaw(), Pol::Mobile::NPC::on_death(), Pol::Mobile::NPC::on_ghost_pc_spoke(), Pol::Mobile::NPC::on_pc_spoke(), Pol::Module::popup_menu_selection_made(), Pol::Mobile::NPC::restart_script(), revive(), Pol::Core::ScriptScheduler::run_ready(), Pol::Core::sayto_listening_points(), Pol::Mobile::NPC::send_event(), Pol::Mobile::NPC::send_event_script(), state(), Pol::Mobile::NPC::stop_scripts(), Pol::Mobile::Character::stop_skill_script(), suspend(), and UOExecutor().
UOExecutor * Pol::Core::UOExecutor::pChild |
Definition at line 64 of file uoexec.h.
Referenced by Pol::Module::OSExecutorModule::mf_HTTPRequest(), Pol::Module::OSExecutorModule::mf_OpenConnection(), Pol::Core::ScriptScheduler::run_ready(), Pol::Module::OSExecutorModule::run_script(), and ~UOExecutor().
UOExecutor* Pol::Core::UOExecutor::pParent |
Definition at line 64 of file uoexec.h.
Referenced by Pol::Core::ScriptScheduler::run_ready(), Pol::Module::OSExecutorModule::run_script(), and ~UOExecutor().
u64 Pol::Core::UOExecutor::runaway_cycles |
Definition at line 54 of file uoexec.h.
Referenced by Pol::Core::ScriptExObjImp::get_member_id(), and Pol::Core::ScriptScheduler::run_ready().
u64 Pol::Core::UOExecutor::sleep_cycles |
Definition at line 50 of file uoexec.h.
Referenced by Pol::Core::ScriptExObjImp::get_member_id(), Pol::Core::ScriptScheduler::run_ready(), and ~UOExecutor().
unsigned short Pol::Core::UOExecutor::speech_size |
Definition at line 58 of file uoexec.h.
Referenced by Pol::Module::UOExecutorModule::mf_EnableEvents(), Pol::Mobile::NPC::on_ghost_pc_spoke(), and Pol::Mobile::NPC::on_pc_spoke().
time_t Pol::Core::UOExecutor::start_time |
Definition at line 51 of file uoexec.h.
Referenced by ~UOExecutor().
u64 Pol::Core::UOExecutor::warn_runaway_on_cycle |
Definition at line 53 of file uoexec.h.
Referenced by Pol::Core::ScriptExObjImp::get_member_id(), and Pol::Core::ScriptScheduler::run_ready().
weak_ptr_owner<UOExecutor> Pol::Core::UOExecutor::weakptr |
Definition at line 62 of file uoexec.h.
Referenced by Pol::Core::DebugContext::cmd_attach(), Pol::Module::SQLExecutorModule::mf_ConnectToDB(), Pol::Module::OSExecutorModule::mf_HTTPRequest(), Pol::Module::OSExecutorModule::mf_OpenConnection(), Pol::Module::SQLExecutorModule::mf_Query(), Pol::Module::SQLExecutorModule::mf_SelectDb(), and UOExecutor().