changed definition of Lua function slightly to incorporate a boolean defining if the script should be shared or not.

added a constructor with the sharing variable as default to zero so every script doesn't have to be changed.
added functionality in runScript function to check if a script should be shared and if so send it.
This commit is contained in:
Joakim Kilby
2015-06-24 19:41:59 +02:00
parent 77ecdcec74
commit 7fa460e9dc
2 changed files with 78 additions and 16 deletions
+11 -5
View File
@@ -46,6 +46,17 @@ public:
lua_CFunction function;
std::string argumentText;
std::string helpText;
bool parallelShared;
Function(std::string n, lua_CFunction f, std::string a, std::string h , bool ps = false):
name(n),
function(f),
argumentText(a),
helpText(h),
parallelShared(ps)
{
}
};
std::string name;
std::vector<Function> functions;
@@ -78,8 +89,6 @@ public:
void preSynchronization();
void queueScript(const std::string &script);
std::vector<std::string> executedScripts();
std::vector<std::string> allLuaFunctions() const;
@@ -101,9 +110,6 @@ private:
std::vector<std::string> _receivedScripts;
std::string _currentSyncedScript;
//parallel variables @TODO make a more permanent solution to this - JK
std::vector<std::string> _executedScripts;
std::mutex _executedScriptsMutex;
};
} // namespace scripting