From ebc1a6d85e89db03bcf79ae671bedb6dad9b64ca Mon Sep 17 00:00:00 2001 From: Japa Date: Tue, 8 Nov 2016 13:40:08 +0530 Subject: [PATCH 1/6] Add functions to get and set the pause state in DF --- plugins/remotefortressreader.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/remotefortressreader.cpp b/plugins/remotefortressreader.cpp index 4caa8e55f..d1803dc0b 100644 --- a/plugins/remotefortressreader.cpp +++ b/plugins/remotefortressreader.cpp @@ -145,6 +145,8 @@ static command_result GetPlantRaws(color_ostream &stream, const EmptyMessage *in static command_result CopyScreen(color_ostream &stream, const EmptyMessage *in, ScreenCapture *out); static command_result PassKeyboardEvent(color_ostream &stream, const KeyboardEvent *in); static command_result SendDigCommand(color_ostream &stream, const DigCommand *in); +static command_result SetPauseState(color_ostream & stream, const SingleBool * in); +static command_result GetPauseState(color_ostream & stream, const EmptyMessage * in, SingleBool * out); void CopyItem(RemoteFortressReader::Item * NetItem, df::item * DfItem); @@ -250,6 +252,8 @@ DFhackCExport RPCService *plugin_rpcconnect(color_ostream &) svc->addFunction("CopyScreen", CopyScreen); svc->addFunction("PassKeyboardEvent", PassKeyboardEvent); svc->addFunction("SendDigCommand", SendDigCommand); + svc->addFunction("SetPauseState", SetPauseState); + svc->addFunction("GetPauseState", GetPauseState); return svc; } @@ -3008,3 +3012,15 @@ static command_result SendDigCommand(color_ostream &stream, const DigCommand *in mc.WriteAll(); return CR_OK; } + +static command_result SetPauseState(color_ostream &stream, const SingleBool *in) +{ + DFHack::World::SetPauseState(in->value()); + return CR_OK; +} + +static command_result GetPauseState(color_ostream &stream, const EmptyMessage *in, SingleBool *out) +{ + out->set_value(World::ReadPauseState()); + return CR_OK; +} \ No newline at end of file From 2935032a1e13b59b069ad8ee94b4db391e85e7ce Mon Sep 17 00:00:00 2001 From: Japa Illo Date: Tue, 8 Nov 2016 15:10:01 +0530 Subject: [PATCH 2/6] Add .proto files to plugin sources when used, to make it conventient to open it from the IDE. --- plugins/Plugins.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/Plugins.cmake b/plugins/Plugins.cmake index 4871c1f0c..fe167ccb3 100644 --- a/plugins/Plugins.cmake +++ b/plugins/Plugins.cmake @@ -76,6 +76,7 @@ MACRO(DFHACK_PLUGIN) SET(PLUGIN_PROTOCPP) FOREACH(pbuf ${PLUGIN_PROTOBUFS}) SET(PLUGIN_SOURCES ${PLUGIN_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/proto/${pbuf}.pb.cc) + SET(PLUGIN_SOURCES ${PLUGIN_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/proto/${pbuf}.proto) SET(PLUGIN_PROTOCPP ${PLUGIN_PROTOCPP} ${CMAKE_CURRENT_SOURCE_DIR}/proto/${pbuf}.pb.cc) ENDFOREACH() From fbaf2697cb10c7ae20b575ac87c533baba00b490 Mon Sep 17 00:00:00 2001 From: Japa Illo Date: Tue, 8 Nov 2016 15:10:43 +0530 Subject: [PATCH 3/6] fixed MD5 hash of win64 ruby lib. --- plugins/ruby/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ruby/CMakeLists.txt b/plugins/ruby/CMakeLists.txt index 6b5e62c66..f7d35433a 100644 --- a/plugins/ruby/CMakeLists.txt +++ b/plugins/ruby/CMakeLists.txt @@ -38,7 +38,7 @@ ELSE() ${RUBYLIB}.gz "81db54a8b8b3090c94c6ae2147d30b8f" ${RUBYLIB} - "8a8564418aebddef3dfee1e96690e713") + "8568db86a202b803ad7616c53b25bf75") ELSE() DOWNLOAD_FILE_UNZIP("https://github.com/DFHack/dfhack-bin/releases/download/0.43.05/win32-libruby187.dll.gz" "gz" From 20b9aab8dbf4577e7d7d489aaacaf2b338512c13 Mon Sep 17 00:00:00 2001 From: Japa Illo Date: Tue, 8 Nov 2016 15:11:27 +0530 Subject: [PATCH 4/6] moved remotefortressreader.cpp to its own directory. --- plugins/CMakeLists.txt | 2 +- plugins/remotefortressreader/CMakeLists.txt | 36 +++++++++++++++++++ .../remotefortressreader.cpp | 0 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 plugins/remotefortressreader/CMakeLists.txt rename plugins/{ => remotefortressreader}/remotefortressreader.cpp (100%) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 8546c6e89..0e4c8f999 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -141,7 +141,7 @@ if (BUILD_SUPPORTED) DFHACK_PLUGIN(prospector prospector.cpp) DFHACK_PLUGIN(power-meter power-meter.cpp LINK_LIBRARIES lua) DFHACK_PLUGIN(regrass regrass.cpp) - DFHACK_PLUGIN(RemoteFortressReader remotefortressreader.cpp proto/RemoteFortressReader.proto PROTOBUFS RemoteFortressReader) + add_subdirectory(remotefortressreader) DFHACK_PLUGIN(rename rename.cpp LINK_LIBRARIES lua PROTOBUFS rename) add_subdirectory(rendermax) DFHACK_PLUGIN(resume resume.cpp) diff --git a/plugins/remotefortressreader/CMakeLists.txt b/plugins/remotefortressreader/CMakeLists.txt new file mode 100644 index 000000000..be03e604f --- /dev/null +++ b/plugins/remotefortressreader/CMakeLists.txt @@ -0,0 +1,36 @@ +PROJECT (remotefortressreader) +# A list of source files +SET(PROJECT_SRCS + remotefortressreader.cpp +) +# A list of headers +SET(PROJECT_HDRS + +) +#proto files to include. +SET(PROJECT_PROTO + ../../proto/RemoteFortressReader +) + +SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE) + +# mash them together (headers are marked as headers and nothing will try to compile them) +LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS}) + +#linux +IF(UNIX) + add_definitions(-DLINUX_BUILD) + SET(PROJECT_LIBS + # add any extra linux libs here + ${PROJECT_LIBS} + ) +# windows +ELSE(UNIX) + SET(PROJECT_LIBS + # add any extra windows libs here + ${PROJECT_LIBS} + $(NOINHERIT) + ) +ENDIF(UNIX) +# this makes sure all the stuff is put in proper places and linked to dfhack +DFHACK_PLUGIN(RemoteFortressReader ${PROJECT_SRCS} LINK_LIBRARIES ${PROJECT_LIBS} PROTOBUFS ${PROJECT_PROTO} ) diff --git a/plugins/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp similarity index 100% rename from plugins/remotefortressreader.cpp rename to plugins/remotefortressreader/remotefortressreader.cpp From 5e204069ce0ffbd6717cf2d91c980d45fb56e773 Mon Sep 17 00:00:00 2001 From: Japa Illo Date: Tue, 8 Nov 2016 15:13:06 +0530 Subject: [PATCH 5/6] update stonesense --- plugins/stonesense | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/stonesense b/plugins/stonesense index 642e493ef..416bc28f2 160000 --- a/plugins/stonesense +++ b/plugins/stonesense @@ -1 +1 @@ -Subproject commit 642e493efcf8e8d803186950cd11eef3982d496e +Subproject commit 416bc28f2e25d06e7da28a5643b8a849aefddbf5 From 6895f3fbedeaec90a9492e0de786e7f88344cf13 Mon Sep 17 00:00:00 2001 From: Japa Illo Date: Tue, 8 Nov 2016 15:13:43 +0530 Subject: [PATCH 6/6] remove tabs --- plugins/remotefortressreader/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/remotefortressreader/CMakeLists.txt b/plugins/remotefortressreader/CMakeLists.txt index be03e604f..0b84d8905 100644 --- a/plugins/remotefortressreader/CMakeLists.txt +++ b/plugins/remotefortressreader/CMakeLists.txt @@ -9,7 +9,7 @@ SET(PROJECT_HDRS ) #proto files to include. SET(PROJECT_PROTO - ../../proto/RemoteFortressReader + ../../proto/RemoteFortressReader ) SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE)