diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-02-26 22:06:10 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-02 18:12:07 +0100 |
commit | 34ac0d64e23f2b2d3981dbb0ea72157f334805dd (patch) | |
tree | 114b1f7a65956c097f7a59078292c9fa29c6451f /src/game-server/commandhandler.cpp | |
parent | e896d0b0125b48e12d43d99ace4498e56d968d50 (diff) | |
download | manaserv-34ac0d64e23f2b2d3981dbb0ea72157f334805dd.tar.gz manaserv-34ac0d64e23f2b2d3981dbb0ea72157f334805dd.tar.bz2 manaserv-34ac0d64e23f2b2d3981dbb0ea72157f334805dd.tar.xz manaserv-34ac0d64e23f2b2d3981dbb0ea72157f334805dd.zip |
Merged all the different Lua states into one
No more Lua state for each status effect, monster, item effect or map. All
scripts are loaded into the same state. This should be more efficient overall
and make it easier to implement dynamic reloading of the scripts in the
future.
Now, this introduces the problem of name collisions between different Lua
scripts. For now this is solved by using more specific function names, like
'tick_plague' and 'tick_jump' rather than just 'tick'. The plan is however
to get rid of these globals, and register these callbacks from the script,
so that they can be local functions without the danger of colliding with
other scripts.
Reviewed-by: Erik Schilling
Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/game-server/commandhandler.cpp')
-rw-r--r-- | src/game-server/commandhandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game-server/commandhandler.cpp b/src/game-server/commandhandler.cpp index 6904e0fc..b59177ca 100644 --- a/src/game-server/commandhandler.cpp +++ b/src/game-server/commandhandler.cpp @@ -33,7 +33,7 @@ #include "game-server/monstermanager.h" #include "game-server/state.h" -#include "scripting/script.h" +#include "scripting/scriptmanager.h" #include "common/configuration.h" #include "common/permissionmanager.h" @@ -1408,7 +1408,7 @@ static void handleCraft(Character *player, std::string &args) // pass to script engine. The engine is responsible for all // further processing of the crafting operation, including // outputting an error message when the recipe is invalid. - Script::performCraft(player, recipe); + ScriptManager::performCraft(player, recipe); } } |