From 15248aa46540f455d62a9c2cdc6efea9218dd6c1 Mon Sep 17 00:00:00 2001
From: Warmist
Date: Sun, 15 Apr 2012 01:49:37 +0300
Subject: [PATCH 01/11] Propogate errors from bat files.
---
build/package-debug.bat | 4 +++-
build/package-release.bat | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/build/package-debug.bat b/build/package-debug.bat
index e6149c56d..b6833f552 100644
--- a/build/package-debug.bat
+++ b/build/package-debug.bat
@@ -1,4 +1,6 @@
+@echo off
call "%VS100COMNTOOLS%vsvars32.bat"
cd VC2010
msbuild /m /p:Platform=Win32 /p:Configuration=RelWithDebInfo PACKAGE.vcxproj
-cd ..
\ No newline at end of file
+cd ..
+exit %ERRORLEVEL%
\ No newline at end of file
diff --git a/build/package-release.bat b/build/package-release.bat
index 3cc3d4af7..99e94b0e5 100644
--- a/build/package-release.bat
+++ b/build/package-release.bat
@@ -1,4 +1,6 @@
+@echo off
call "%VS100COMNTOOLS%vsvars32.bat"
cd VC2010
msbuild /m /p:Platform=Win32 /p:Configuration=Release PACKAGE.vcxproj
-cd ..
\ No newline at end of file
+cd ..
+exit %ERRORLEVEL%
\ No newline at end of file
From cb27a1d83916b333d1a0d1b5aa24a7f371e120af Mon Sep 17 00:00:00 2001
From: Alexander Gavrilov
Date: Sun, 15 Apr 2012 11:31:05 +0400
Subject: [PATCH 02/11] Fix typo in the 1MB constant.
---
library/include/RemoteClient.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/library/include/RemoteClient.h b/library/include/RemoteClient.h
index 9eb8fb427..37aaea9b1 100644
--- a/library/include/RemoteClient.h
+++ b/library/include/RemoteClient.h
@@ -66,7 +66,7 @@ namespace DFHack
};
struct RPCMessageHeader {
- static const int MAX_MESSAGE_SIZE = 8*1048756;
+ static const int MAX_MESSAGE_SIZE = 8*1048576;
int16_t id;
int32_t size;
From 14709e5d4598e11ddce6f9d2cce734528d842ca5 Mon Sep 17 00:00:00 2001
From: Alexander Gavrilov
Date: Sun, 15 Apr 2012 19:09:25 +0400
Subject: [PATCH 03/11] Add an official core lua context, and allow plugins to
send events to it.
- This context requires core suspend lock and asserts it in a few places.
- Special 'event' objects are introduced. They can be invoked as
functions, in which case they iterate all their fields and call
them as functions. Errors are printed and consumed.
- When a plugin is opened by the core context, events registered in
a special array are linked to it. The system is organized so as to
avoid even trying to pass the event to lua if the module isn't loaded.
---
LUA_API.rst | 14 ++
Lua API.html | 13 ++
library/Core.cpp | 17 ++
library/LuaApi.cpp | 45 ++----
library/LuaTools.cpp | 270 +++++++++++++++++++++++++++++++-
library/LuaTypes.cpp | 18 ++-
library/PluginManager.cpp | 60 +++++--
library/include/Core.h | 2 +
library/include/DataFuncs.h | 8 +-
library/include/DataIdentity.h | 6 +-
library/include/LuaTools.h | 174 +++++++++++++++++++-
library/include/LuaWrapper.h | 6 +
library/include/PluginManager.h | 23 ++-
library/lua/dfhack.lua | 4 +
plugins/Dfusion/dfusion.cpp | 7 +
plugins/burrows.cpp | 28 +++-
16 files changed, 632 insertions(+), 63 deletions(-)
diff --git a/LUA_API.rst b/LUA_API.rst
index d5af5e7a4..e68a87a66 100644
--- a/LUA_API.rst
+++ b/LUA_API.rst
@@ -799,3 +799,17 @@ Maps module
* ``dfhack.maps.setBlockBurrowTile(burrow,block,x,y,enable)``
Adds or removes the tile from the burrow. Returns *false* if invalid coords.
+
+
+Core interpreter context
+========================
+
+While plugins can create any number of interpreter instances,
+there is one special context managed by dfhack core. It is the
+only context that can receive events from DF and plugins.
+
+Core context specific functions:
+
+* ``dfhack.is_core_context``
+
+ Boolean value; *true* in the core context.
diff --git a/Lua API.html b/Lua API.html
index 66385840b..38a375d86 100644
--- a/Lua API.html
+++ b/Lua API.html
@@ -344,6 +344,7 @@ ul.auto-toc {
Maps module
+Core interpreter context
@@ -1010,6 +1011,18 @@ Returns false in case of error.
+
+
+
While plugins can create any number of interpreter instances,
+there is one special context managed by dfhack core. It is the
+only context that can receive events from DF and plugins.
+
Core context specific functions:
+
+