MCPcopy Create free account
hub / github.com/Segs/Segs / cmdHandler_ReloadScripts

Function cmdHandler_ReloadScripts

Projects/CoX/Servers/MapServer/SlashCommand.cpp:2187–2199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2185}
2186
2187void cmdHandler_ReloadScripts(const QStringList &/*params*/, MapClientSession &sess)
2188{
2189 qCDebug(logSlashCommand) << "Reloading all Lua scripts in" << sess.m_current_map->name();
2190
2191 // Reset script engine
2192 sess.m_current_map->m_scripting_interface.reset(new ScriptingEngine);
2193 sess.m_current_map->m_scripting_interface->setIncludeDir(sess.m_current_map->name());
2194 sess.m_current_map->m_scripting_interface->registerTypes();
2195
2196 // load all scripts again
2197 // TODO: this will regenerate any NPCs (luabot) that exist
2198 sess.m_current_map->load_map_lua();
2199}
2200
2201
2202void cmdHandler_OpenStore(const QStringList &/*params*/, MapClientSession &sess)

Callers

nothing calls this directly

Calls 5

load_map_luaMethod · 0.80
nameMethod · 0.45
resetMethod · 0.45
setIncludeDirMethod · 0.45
registerTypesMethod · 0.45

Tested by

no test coverage detected