HoverRace
2.0
|
#include <ClientScriptCore.h>
Public Member Functions | |
ClientScriptCore () | |
virtual | ~ClientScriptCore () |
Script::Core * | Reset () override |
Reset changes to the global environment. More... | |
Public Member Functions inherited from HoverRace::Script::Core | |
Core () | |
Core (const Core &core)=delete | |
virtual | ~Core () |
void | ActivateSandbox () |
Activate the security sandbox. More... | |
OutHandle | AddOutput (std::shared_ptr< std::ostream > out) |
Redirect output to a stream. More... | |
int | Call (int numParams=0, Help::HelpHandler *helpHandler=nullptr) |
Pop a function off the stack and execute it. More... | |
void | CallAndPrint (int numParams=0, Help::HelpHandler *helpHandler=nullptr) |
void | Compile (const Chunk &chunk) |
Compile a chunk of code. More... | |
template<class ReturnPolicy = PrintReturn> | |
void | Execute (const Chunk &chunk, Help::HelpHandler *helpHandler=nullptr, ReturnPolicy rp=ReturnPolicy()) |
Safely compile and execute a chunk of code. More... | |
lua_State * | GetState () const |
std::string | GetVersionString () const |
Retrieve the full scripting version string (name and version). More... | |
template<class ReturnPolicy = PrintReturn> | |
int | Invoke (int numParams=0, Help::HelpHandler *helpHandler=nullptr, ReturnPolicy rp=ReturnPolicy()) |
Pop a function off the stack and execute it, printing any return values. More... | |
Core & | operator= (const Core &)=delete |
void | Print (const std::string &s) |
Print a message to all registered output streams. More... | |
void | PrintStack () |
void | RemoveOutput (const OutHandle &handle) |
void | ReqHelp (const std::string &className) |
Request the documentation for a scripting API class. More... | |
void | ReqHelp (const std::string &className, const std::string &methodName) |
Request the documentation for a scripting API class or method. More... | |
Private Types | |
using | SUPER = Script::Core |
Private Member Functions | |
void | RegisterMiscClasses () |
Register miscellaneous classes that don't have peers and aren't associated with anything else. More... | |
Private Attributes | |
bool | classesRegistered |
Additional Inherited Members | |
Public Types inherited from HoverRace::Script::Core | |
using | OutHandle = outs_t::iterator |
Public Attributes inherited from HoverRace::Script::Core | |
std::unique_ptr< luabind::object > | NIL |
Static Public Attributes inherited from HoverRace::Script::Core | |
static const std::string | DEFAULT_CHUNK_NAME |
|
private |
|
inline |
|
inlinevirtual |
|
private |
Register miscellaneous classes that don't have peers and aren't associated with anything else.
|
overridevirtual |
Reset changes to the global environment.
When creating a new instance, this member function must be called at least once before executing any scripts. This is used for fixing accidental changes to globals. Note that this will effectively deactivate the security sandbox. Call ActivateSandbox() to reactivate if necessary. The state returned by GetState() is otherwise unchanged.
Reimplemented from HoverRace::Script::Core.
|
private |