Instructions Jenkins Doxygen

[fixed] Lua::callFunction calls for new engine 75/875/3
authorVictor Popovici <victorpopovici@gmail.com>
Wed, 2 Oct 2013 20:59:40 +0000 (22:59 +0200)
committerVictor Popovici <victorpopovici@gmail.com>
Wed, 2 Oct 2013 21:13:34 +0000 (23:13 +0200)
Change-Id: Ia94f040a972e91afaeb91ebb49205ecf62a63072

MMOCoreORB/src/client/zone/managers/object/ObjectManager.cpp
MMOCoreORB/src/server/zone/managers/director/DirectorManager.cpp
MMOCoreORB/src/server/zone/managers/director/ScreenPlayObserverImplementation.cpp
MMOCoreORB/src/server/zone/managers/jedi/JediManager.cpp
MMOCoreORB/src/server/zone/managers/templates/TemplateManager.cpp
MMOCoreORB/src/server/zone/objects/creature/ai/bt/LuaBehavior.cpp
MMOCoreORB/src/server/zone/objects/player/sui/callbacks/LuaSuiCallback.cpp
MMOCoreORB/src/server/zone/objects/scene/components/LuaContainerComponent.cpp
MMOCoreORB/src/server/zone/objects/scene/components/LuaObjectMenuComponent.cpp

index 865ac11..5d11e35 100644 (file)
@@ -111,7 +111,7 @@ SceneObject* ObjectManager::createObject(uint32 objectCRC, uint64 objectID) {
 
                LuaFunction getTemplate(luaInstance->getLuaState(), "getTemplate", 1);
                getTemplate << objectCRC; // push first argument
-               luaInstance->callFunction(&getTemplate);
+               getTemplate.callFunction();
 
                LuaObject result(luaInstance->getLuaState());
 
index e2697cf..5231fd3 100644 (file)
@@ -1403,7 +1403,7 @@ void DirectorManager::startScreenPlay(CreatureObject* creatureObject, const Stri
        LuaFunction startScreenPlay(lua->getLuaState(), screenPlayName, "start", 0);
        startScreenPlay << creatureObject;
 
-       lua->callFunction(&startScreenPlay);
+       startScreenPlay.callFunction();
 }
 
 ConversationScreen* DirectorManager::getNextConversationScreen(const String& luaClass, ConversationTemplate* conversationTemplate, CreatureObject* conversingPlayer, int selectedOption, CreatureObject* conversingNPC) {
@@ -1415,7 +1415,7 @@ ConversationScreen* DirectorManager::getNextConversationScreen(const String& lua
        runMethod << selectedOption;
        runMethod << conversingNPC;
 
-       lua->callFunction(&runMethod);
+       runMethod.callFunction();
 
        ConversationScreen* result = (ConversationScreen*) lua_touserdata(lua->getLuaState(), -1);
 
@@ -1434,7 +1434,7 @@ ConversationScreen* DirectorManager::runScreenHandlers(const String& luaClass, C
        runMethod << selectedOption;
        runMethod << conversationScreen;
 
-       lua->callFunction(&runMethod);
+       runMethod.callFunction();
 
        ConversationScreen* result = (ConversationScreen*) lua_touserdata(lua->getLuaState(), -1);
 
@@ -1454,7 +1454,7 @@ void DirectorManager::activateEvent(ScreenPlayTask* task) {
                LuaFunction startScreenPlay(lua->getLuaState(), play, key, 0);
                startScreenPlay << obj;
 
-               lua->callFunction(&startScreenPlay);
+               startScreenPlay.callFunction();
        } catch (Exception& e) {
                error("exception while running lua task " + play + ":" + key);
                e.printStackTrace();
index 34cbe56..5bb5688 100644 (file)
@@ -52,7 +52,7 @@ int ScreenPlayObserverImplementation::notifyObserverEvent(uint32 eventType, Obse
        startScreenPlay << arg1;
        startScreenPlay << arg2;
 
-       lua->callFunction(&startScreenPlay);
+       startScreenPlay.callFunction();
 
        if (lua_gettop(lua->getLuaState()) == 0) {
                Logger::console.error("ScreenPlayObserverImplementation::notifyObserverEvent didnt return a value from " + play + ":" + key);
index 630b24d..7690c63 100644 (file)
@@ -90,7 +90,7 @@ void JediManager::loadConfiguration(Lua* luaEngine) {
 void JediManager::start(Lua* luaEngine) {
        LuaFunction luaStart(luaEngine->getLuaState(), jediManagerName, "start", 0);
 
-       luaEngine->callFunction(&luaStart);
+       luaStart.callFunction();
 }
 
 void JediManager::onPlayerCreated(CreatureObject* creature) {
@@ -98,7 +98,7 @@ void JediManager::onPlayerCreated(CreatureObject* creature) {
        LuaFunction luaOnPlayerCreated(lua->getLuaState(), getJediManagerName(), "onPlayerCreated", 0);
        luaOnPlayerCreated << creature;
 
-       lua->callFunction(&luaOnPlayerCreated);
+       luaOnPlayerCreated.callFunction();
 }
 
 void JediManager::onPlayerLoggedIn(CreatureObject* creature) {
@@ -106,7 +106,7 @@ void JediManager::onPlayerLoggedIn(CreatureObject* creature) {
        LuaFunction luaOnPlayerLoggedIn(lua->getLuaState(), getJediManagerName(), "onPlayerLoggedIn", 0);
        luaOnPlayerLoggedIn << creature;
 
-       lua->callFunction(&luaOnPlayerLoggedIn);
+       luaOnPlayerLoggedIn.callFunction();
 }
 
 void JediManager::onPlayerLoggedOut(CreatureObject* creature) {
@@ -114,7 +114,7 @@ void JediManager::onPlayerLoggedOut(CreatureObject* creature) {
        LuaFunction luaOnPlayerLoggedOut(lua->getLuaState(), getJediManagerName(), "onPlayerLoggedOut", 0);
        luaOnPlayerLoggedOut << creature;
 
-       lua->callFunction(&luaOnPlayerLoggedOut);
+       luaOnPlayerLoggedOut.callFunction();
 }
 
 void JediManager::checkForceStatusCommand(CreatureObject* creature) {
@@ -122,7 +122,7 @@ void JediManager::checkForceStatusCommand(CreatureObject* creature) {
        LuaFunction luaCheckForceStatusCommand(lua->getLuaState(), getJediManagerName(), "checkForceStatusCommand", 0);
        luaCheckForceStatusCommand << creature;
 
-       lua->callFunction(&luaCheckForceStatusCommand);
+       luaCheckForceStatusCommand.callFunction();
 }
 
 void JediManager::useHolocron(SceneObject* holocron, CreatureObject* creature) {
@@ -131,5 +131,5 @@ void JediManager::useHolocron(SceneObject* holocron, CreatureObject* creature) {
        luaUseHolocron << holocron;
        luaUseHolocron << creature;
 
-       lua->callFunction(&luaUseHolocron);
+       luaUseHolocron.callFunction();
 }
index f77efa9..921beb6 100644 (file)
@@ -933,7 +933,7 @@ LuaObject* TemplateManager::getLuaObject(const String& iffTemplate) {
 
        LuaFunction getObject(luaTemplatesInstance->getLuaState(), "getTemplate", 1);
        getObject << iffTemplate.hashCode(); // push first argument
-       luaTemplatesInstance->callFunction(&getObject);
+       getObject.callFunction();
 
        LuaObject* result = new LuaObject(luaTemplatesInstance->getLuaState());
 
index 104f4e0..059d226 100644 (file)
@@ -24,7 +24,7 @@ int LuaBehavior::update(AiAgent* actor) {
        LuaFunction update(lua->getLuaState(), this->className, "update", 1);
        update << actor;
        // run the function and fetch result
-       lua_State* L = lua->callFunction(&update);
+       lua_State* L = update.callFunction();
        int rc = lua_tonumber(L, -1);
        return rc;
 }
@@ -34,7 +34,7 @@ void LuaBehavior::onInitialize(AiAgent* actor) {
        LuaFunction initialize(lua->getLuaState(), this->className, "OnInitialize", 0);
        initialize << actor;
        // run the function and fetch result
-       lua->callFunction(&initialize);
+       initialize.callFunction();
 }
 void LuaBehavior::onTerminate(AiAgent* actor, int s) {
        // re-use director maager
@@ -43,5 +43,5 @@ void LuaBehavior::onTerminate(AiAgent* actor, int s) {
        terminate << actor;
        terminate << s;
        // run the function
-       lua->callFunction(&terminate);
+       terminate.callFunction();
 }
index c8295e0..62cf840 100644 (file)
@@ -22,5 +22,5 @@ void LuaSuiCallback::run(CreatureObject* creature, SuiBox* sui, bool cancelPress
                startScreenPlay << args->get(i).toString().toCharArray();
        }
 
-       lua->callFunction(&startScreenPlay);
+       startScreenPlay.callFunction();
 }
index 3ccffa0..77a7273 100644 (file)
@@ -31,7 +31,7 @@ int LuaContainerComponent::canAddObject(SceneObject* sceneObject, SceneObject* o
        runMethod << object;
        runMethod << containmentType;
 
-       lua->callFunction(&runMethod);
+       runMethod.callFunction();
 
        int result = lua_tointeger(lua->getLuaState(), -1);
 
@@ -54,7 +54,7 @@ bool LuaContainerComponent::transferObject(SceneObject* sceneObject, SceneObject
        runMethod << object;
        runMethod << containmentType;
 
-       lua->callFunction(&runMethod);
+       runMethod.callFunction();
 
        int result = lua_tointeger(lua->getLuaState(), -1);
 
@@ -77,7 +77,7 @@ bool LuaContainerComponent::removeObject(SceneObject* sceneObject, SceneObject*
        runMethod << object;
        runMethod << destination;
 
-       lua->callFunction(&runMethod);
+       runMethod.callFunction();
 
        int result = lua_tointeger(lua->getLuaState(), -1);
 
index b874711..9d5d03a 100644 (file)
@@ -28,7 +28,7 @@ void LuaObjectMenuComponent::fillObjectMenuResponse(SceneObject* sceneObject, Ob
        runMethod << menuResponse;
        runMethod << player;
 
-       lua->callFunction(&runMethod);
+       runMethod.callFunction();
 }
 
 
@@ -43,7 +43,7 @@ int LuaObjectMenuComponent::handleObjectMenuSelect(SceneObject* sceneObject, Cre
        runMethod << player;
        runMethod << selectedID;
 
-       lua->callFunction(&runMethod);
+       runMethod.callFunction();
 
        int result = lua_tonumber(lua->getLuaState(), -1);