Commit Graph

87 Commits (130b42d041270ed4917c81ca3832f342bef54e6d)

Author SHA1 Message Date
Myk Taylor 7cf703ef23
turn down Ruby support 2023-01-09 23:59:55 -08:00
myk002 0858b95c40
print help from helpdb on CR_WRONG_USAGE 2022-07-22 17:45:48 -07:00
lethosor 498fd9a1a6
Flush plugin warning messages 2020-08-06 22:45:46 -04:00
lethosor bb66ef32a7
Tone down a couple warnings
There have been a few cases of people thinking these are more important than they actually are
2020-08-02 12:55:36 -04:00
lethosor 5b11d14c6c Rename save/load to "save data"/"load data" 2019-05-29 19:52:03 -04:00
Ben Lubar 4e690df96a
Add Persistence module.
Alter World to use Persistence instead of storing data in historical figures.

Fake historical figures will be converted to the new format when a world is loaded.

Added plugin_save and plugin_load functions to the plugin API.

Made the weird int7/int28 code that was in the old persistence API slightly safer.
2018-08-26 18:27:58 -05:00
Pauli 19a169ba65 Convert Core.cpp to use c++11 thread
I noticed that tthread is missing some c++11 features that make thread
handling code a bit easier. To be able to use those features I decided
to convert Core.cpp to use equivalent standard classes.

This patch has no functional changes.
2018-06-22 17:57:37 +03:00
lethosor eb22d5c38e Add ABI version symbol to plugins 2018-03-10 16:55:00 -05:00
lethosor 2f8fbd7ecd Show warning if all plugins fail to load (e.g. on Windows XP) 2018-02-12 13:58:55 -05:00
lethosor 9f541481ea Fix some warnings with GCC -Wall 2016-10-15 00:37:18 -04:00
lethosor 93fe222c35 Revert #719
No plugins built prior to the symbol naming change in 4fc6cb6f can
be loaded in DFHack for v0.42.
2016-01-01 11:20:54 -05:00
lethosor d0c28d3f50 Prevent plugins with active viewscreens from being unloaded
This requires plugins to pass plugin_self to Screen::show(), but
avoids the need to implement special checks in plugin_onstatechange
for the SC_BEGIN_UNLOAD event.
2016-01-01 11:15:29 -05:00
lethosor 1ff9277e12 Remove plugin export functionality (unused) 2015-11-15 11:54:34 -05:00
DoctorVanGogh c6220c9703 Remove tabs/trailing whitespaces 2015-10-31 23:43:57 +01:00
DoctorVanGogh 4e0f426bba Fix code formatting 2015-10-26 02:37:44 +01:00
DoctorVanGogh fb4d16f477 Enable loading of r3 plugins 2015-10-25 00:04:49 +02:00
lethosor 9eb86c7e38 Support additional script search paths
These can currently be added/removed from C++ or through the Lua API.
2015-09-06 16:23:02 -04:00
lethosor 19f966aefc Improve some plugin-related error handling 2015-08-16 17:28:31 -04:00
lethosor 5717c2cdd4 Don't set plugin state to PS_BROKEN due to load failures 2015-08-16 17:02:53 -04:00
lethosor a5f15b279c plug: Include deleted plugins in full list 2015-08-14 19:32:41 -04:00
lethosor 4fc6cb6f17 Several PluginManager improvements
* load/unload/reload are no longer restricted to plugins that exist
  on startup
* Names passed to DFHACK_PLUGIN must match the plugin's filename
  (remotefortressreader vs RemoteFortressReader, counters vs probe)
* "plug" output lists all plugins and state/command information
* Deleted plugins can be reloaded again if they are replaced
* load/unload/reload don't fail silently with broken plugins
* Built-in commands are recognized internally (e.g. "help help"
  does not display "help is not a recognized command"), although help
  for them is not yet implemented
* New command: "type" (bash-like) - shows where/how a command is
  implemented
* "plug" can accept multiple plugin names
* "ls" displays more information about unloaded/unrecognized plugins
* "load all" changed to "load -all" (or "load --all", "load -a", ...)
2015-08-14 16:11:23 -04:00
lethosor 786086e5c5 Make non-CR_OK return values for SC_BEGIN_UNLOAD events abort unload
Returning CR_FAILURE, for example, is more consistent with
plugin_shutdown().
2015-07-28 18:36:20 -04:00
lethosor 74404c62e7 Fix deadlock when aborting plugin load 2015-07-17 16:00:41 -04:00
lethosor 935f4dd628 Log plugin load information to stderr 2015-06-26 16:11:41 -04:00
lethosor 5d1ae9f5ed Allow plugins without git description to be loaded 2015-06-25 11:46:04 -04:00
lethosor ee7a2c7db7 Add git commit information to libdfhack-version
git is run every time 'make' is run, but the generated include file
is only updated when necessary. Plugins will be loaded successfully
if their DFHack version matches core's (assuming OpenLibrary()
succeeds), but will produce a warning if their git commit doesn't
match core's.
2015-06-24 19:32:45 -04:00
lethosor e27493fa02 Treat plugins without a "plugin_dev" symbol as ordinary plugins 2015-05-24 11:42:22 -04:00
lethosor a8f5e683f7 Merge remote-tracking branches 'RossM/autolabor-changes', 'RossM/workflow-changes' and 'lethosor/plugin-exports' into develop 2015-05-09 09:39:55 -04:00
lethosor 786581689f Move get_dfhack_version() to a separate namespace and add a few other version-related functions 2015-04-02 16:37:58 -04:00
lethosor 9b6d8d2799 Allow dev plugins to be skipped on startup 2015-04-01 17:50:22 -04:00
lethosor 8b5b8ed864 Log command name collisions 2015-04-01 17:32:11 -04:00
lethosor ea1c9fa0df Allow plugin exports to be defined in plugins (and looked up when needed) 2015-03-07 17:25:35 -05:00
lethosor 1570af3f4d Allow plugins to export additional functions through a class 2015-03-07 15:56:43 -05:00
lethosor db9bcc27e4 Make plugin load errors more descriptive 2015-02-21 21:28:35 -05:00
lethosor 0f77a1a578 Move DFHack version to a separate (static) library
This allows the DFHack version to be changed without recompiling
everything
2015-02-19 12:08:23 -05:00
lethosor e3b67b2985 Use short plugin name in error messages when possible 2015-02-09 22:06:33 -05:00
lethosor bebceffa5f Add Filesystem::listdir() 2015-01-28 19:15:58 -05:00
lethosor f1a863eb79 Use short plugin name 2014-12-03 23:27:52 -05:00
lethosor e206c242c6 Add a plugin_globals vector to aid in safety checks for plugins that require globals
This allows "using df::global::foo" to be replaced by "REQUIRE_GLOBAL(foo)",
and DFHack will refuse to load the plugin if df::global::foo is NULL
2014-12-02 21:32:04 -05:00
lethosor 9aee476c6e Make plugins use ".plug.dylib" extension on OS X 2014-08-30 09:21:19 -04:00
jj 84033bd586 ruby: dont list ruby scripts when ruby plugin is disabled 2013-10-07 14:32:47 +02:00
Alexander Gavrilov d7e35c2d23 Add built-in enable and disable commands. 2013-09-30 13:19:51 +04:00
Alexander Gavrilov a17760af4f Communicate the Plugin pointer to the plugin in a decent sort of way. 2013-02-13 14:45:24 +04:00
expwnent cf619a519e EventManager: made event handlers unregister when plugins are unloaded. Also changed PluginManager so that plugins can call core.getPluginManager() during plugin_init. 2012-12-14 22:14:38 -05:00
Petr Mrázek 8812238bf6 Update license, add contributors file, bump release number 2012-09-30 04:03:37 +02:00
Alexander Gavrilov 3402a3cd5d Fix a deadlock problem between suspend in (un)load, and onupdate. 2012-08-26 14:43:14 +04:00
Alexander Gavrilov b12b9fa91e Suspend DF around loading and unloading plugins.
This is necessary to improve safety of vtable interposing.
2012-08-23 19:51:55 +04:00
Alexander Gavrilov c6c5ad56c9 Track lua event listener count, and let the C++ host know.
This allows completely avoiding the call overhead if there
are none. The downside is that the event object now has to
be a userdata with lots of metamethods.
2012-08-23 19:27:28 +04:00
Alexander Gavrilov 30f71ff510 Implement support for lua-backed viewscreens. 2012-08-19 14:27:44 +04:00
jj a7a25b80a0 ruby: use the color_ostream argument from dfhack to output to dfhack-run 2012-07-03 16:13:15 +02:00