Add celestial callbacks to UniverseClient scripts
This commit is contained in:
parent
5f86e0f027
commit
d0307e7aa7
@ -207,7 +207,7 @@ bool CelestialMasterDatabase::coordinateValid(CelestialCoordinate const& coordin
|
|||||||
Maybe<CelestialCoordinate> CelestialMasterDatabase::findRandomWorld(unsigned tries, unsigned trySpatialRange,
|
Maybe<CelestialCoordinate> CelestialMasterDatabase::findRandomWorld(unsigned tries, unsigned trySpatialRange,
|
||||||
function<bool(CelestialCoordinate)> filter, Maybe<uint64_t> seed) {
|
function<bool(CelestialCoordinate)> filter, Maybe<uint64_t> seed) {
|
||||||
//RecursiveMutexLocker locker(m_mutex);
|
//RecursiveMutexLocker locker(m_mutex);
|
||||||
// We don't need this mutex, the other calls are locking anyway.
|
// We don't need this lock, the other calls are locking anyway.
|
||||||
// Having this here is just stopping other threads from having a go in here until we've found a world.
|
// Having this here is just stopping other threads from having a go in here until we've found a world.
|
||||||
RandomSource randSource;
|
RandomSource randSource;
|
||||||
if (seed)
|
if (seed)
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "StarQuestManager.hpp"
|
#include "StarQuestManager.hpp"
|
||||||
#include "StarPlayerUniverseMap.hpp"
|
#include "StarPlayerUniverseMap.hpp"
|
||||||
#include "StarWorldTemplate.hpp"
|
#include "StarWorldTemplate.hpp"
|
||||||
|
#include "StarCelestialLuaBindings.hpp"
|
||||||
|
|
||||||
namespace Star {
|
namespace Star {
|
||||||
|
|
||||||
@ -449,6 +450,8 @@ void UniverseClient::setLuaCallbacks(String const& groupName, LuaCallbacks const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UniverseClient::startLua() {
|
void UniverseClient::startLua() {
|
||||||
|
setLuaCallbacks("celestial", LuaBindings::makeCelestialCallbacks(this));
|
||||||
|
|
||||||
auto assets = Root::singleton().assets();
|
auto assets = Root::singleton().assets();
|
||||||
for (auto& p : assets->json("/client.config:universeScriptContexts").toObject()) {
|
for (auto& p : assets->json("/client.config:universeScriptContexts").toObject()) {
|
||||||
auto scriptComponent = make_shared<ScriptComponent>();
|
auto scriptComponent = make_shared<ScriptComponent>();
|
||||||
|
Loading…
Reference in New Issue
Block a user