Commit Graph

11 Commits (5f1c933b0f92f0f096df651f5877efb2c5d8d91e)

Author SHA1 Message Date
Alexander Gavrilov cb49c92b99 Allow plugins to export functions to lua with safe reload support.
- To ensure reload safety functions have to be wrapped. Every call
  checks the loaded state and locks a mutex in Plugin. If the plugin
  is unloaded, calling its functions throws a lua error. Therefore,
  plugins may not create closures or export yieldable functions.

- The set of function argument and return types supported by
  LuaWrapper is severely limited when compared to being compiled
  inside the main library.
  Currently supported types: numbers, bool, std::string, df::foo,
  df::foo*, std::vector<bool>, std::vector<df::foo*>.

- To facilitate postponing initialization until after all plugins
  have been loaded, the core sends a SC_CORE_INITIALIZED event.

- As an example, the burrows plugin now exports its functions.
2012-04-14 19:44:07 +04:00
Petr Mrázek 7ff728b6fc Track world and map changes separately for plugin_onstatechange 2012-04-01 02:56:54 +02:00
Alexander Gavrilov 87f925e72e Add support for exporting functions from plugins, with example in rename.
TODO: test by actually calling them remotely.
2012-03-15 13:01:23 +04:00
Alexander Gavrilov 560e977f05 Implement trivial RPC interface for dfhack via TCP & protobufs.
Use it to make an executable capable of calling commands remotely.
2012-03-14 19:57:29 +04:00
Alexander Gavrilov 8cc82d5876 Make plugins accept explicit output stream references.
This is an incompatible change to the plugin ABI.

The Console is not thread-safe unless used indirectly
via color_ostream_proxy, so everything should use their
per-thread stream.
2012-03-10 15:55:42 +04:00
Petr Mrázek 7fe8762852 Get rid of Simple namespace, Gui module is now a namespace. 2012-03-03 14:38:24 +01:00
Petr Mrázek 8ee27e182a Hidden weather command raw value override 2012-02-22 15:21:29 +01:00
Petr Mrázek 2cd2ee9b0c New plugin interface 2012-02-21 18:19:17 +01:00
Quietust 24576ffe19 Silence annoying warning in MSVC 2012-01-11 08:54:54 -06:00
Petr Mrázek f35cdb84cd Merge https://github.com/angavrilov/dfhack
Conflicts:
	library/Core.cpp
	library/PluginManager.cpp
	library/include/Core.h
	library/include/PluginManager.h
	library/modules/Gui.cpp
	plugins/stockpiles.cpp
2011-12-31 13:09:12 +01:00
Petr Mrázek 9db20bd84d Header changes/cleanup. 2011-12-31 12:48:42 +01:00