Commit Graph

8713 Commits (17d60c5a1ffdfee32babbd299eae4932374a48d5)
 

Author SHA1 Message Date
Pauli 320e94a1eb Avoid locking CoreSuspender second time in main thread 2018-07-04 00:00:06 +03:00
Ben Lubar 4a0682133e
Annotate plugin proto files with the name of the plugin they are associated with. 2018-07-03 15:54:30 -05:00
Ben Lubar df9150f302
Add documentation for RPC functions supported by RemoteFortressReader and ISOWorldRemote. 2018-07-03 15:37:16 -05:00
Ben Lubar 6839fde555
Remove execute permission on files that are not executables. 2018-07-03 15:37:16 -05:00
Pauli 8a3a05de24 Allow unloading plugins that use std::regex 2018-07-03 15:23:46 +03:00
Pauli ee999ccbdf Implement runtime debug print filtering
The runtime debug print filtering support dynamic debug print selection.
Tis patch only implements basic core support for filtering. The commands
to change the runtime filtering settings will be added in a following
patch.

But even with only this one can change filtering settings by editing
memory using a debugger. It can even be automated by using gdb break
point commands.
2018-07-03 15:23:46 +03:00
lethosor ae5a1fad84 Changelog entry for Screen::zoom (#1332) 2018-07-03 00:32:15 -04:00
lethosor 616675f0ce Merge remote-tracking branch 'suokko/kittens_data_race_fix' into develop 2018-07-03 00:30:36 -04:00
lethosor dc444add10 Fix changelog section for #1318, update scripts 2018-07-03 00:28:29 -04:00
lethosor c449041c11 Merge remote-tracking branch 'suokko/lua_List_setChoices_internal_table_1171' into develop 2018-07-03 00:27:22 -04:00
lethosor c5b3fbf673 Add ruby codefactor fix to changelog, hide double viewscreen_civlistst entry 2018-07-03 00:23:59 -04:00
lethosor 2dd8aea5ab Update changelog, scripts 2018-07-03 00:18:23 -04:00
lethosor a4384a9e98 Core.rst: add dfhack-run anchor, use more sensible example 2018-07-03 00:02:53 -04:00
lethosor c543a17250 Improve RPC port handling
- Use port from remote-server.json in dfhack-run
- Make DFHACK_RUN environment variable take priority over remote-server.json
- Log current port to stderr
2018-07-02 23:53:56 -04:00
lethosor 81a7ddcf92 Merge remote-tracking branch 'suokko/screen_show_memory_leak' into develop 2018-07-02 22:58:11 -04:00
lethosor 7e91173289 Merge remote-tracking branch 'origin/develop-cf-autofix' into develop 2018-07-02 13:44:20 -04:00
lethosor f0ff96f614 Merge remote-tracking branch 'suokko/multibyte_console' into develop 2018-07-02 10:55:03 -04:00
codefactor-io a08f08ae5f [CodeFactor] Apply fixes 2018-07-01 15:25:53 +00:00
Ben Lubar b5eb541fd3
Handle pointers back to the list link. 2018-06-30 23:04:27 -05:00
Ben Lubar 1606483e7e
perf improvement for DfLinkedList::end(), erase/insert/insert_after/push_front implementations 2018-06-30 23:04:26 -05:00
Ben Lubar 0b9d46712f
Run DfLinkedList::end's computations only when needed. 2018-06-30 23:04:26 -05:00
Ben Lubar 31d22967f8
Linked list 2018-06-30 23:04:26 -05:00
Pauli 03f8a04a43 Document and changelog entry for printall_recurse 2018-06-30 22:40:03 +03:00
Pauli ba1d3fcb6a Add dfhack.printall_recurse to quickly print df containers
I often want to see multiple items quickly when trying to figure out
what states actually matter to an issue that I debug. I decided to make
it easier to quickly dump df structures with substructures and
containers. It will generate large amount of data which can be sometimes
slow to process manually. But processing can be automated using
dfhack-run lua ^<df data to inspect> and pipe to other tools (eg grep,
sed, perl, sort, uniq etc)
2018-06-30 22:31:49 +03:00
Pauli 645ec0d591 Improve kittens thread safety and shutdown with core
The bools could use acquire&release memory order or even relaxed but I
didn't think code was worth auditing for such low level optimizations.
Sequantial consistent is fast enough but much harder to use incorrectly.

The timeLast is protected by CoreSuspender lock. plugin_update is only
called when CoreSuspender lock is held.

The last_menu is protected by trackmenu_flg loads and stores.
2018-06-30 21:53:12 +03:00
Pauli 0727403ac1 Fix devel plugins linking in linux 2018-06-30 21:12:42 +03:00
Pauli 7a2245c2fa Remove null byte from string length
I noticed an extra null when trying to grep dfhack.run ls output.

std::string manages null byte at end(). Pre C++11 didn't require null
termination for std::string but C++11 add the null termination to make
c_str() and data() truely const. It is undefined behavior to modify the
internal null termination but this modification sets the null to null.
2018-06-30 12:51:38 +03:00
lethosor 1a4440859c Update xml (viewscreen_civlistst) 2018-06-29 22:33:15 -04:00
lethosor 105ddd86d8 Merge remote-tracking branch 'suokko/jsoncpp_upgrade_to_submodule' into develop 2018-06-29 22:33:00 -04:00
Lethosor 6b067bbba8
Use relative submodule path 2018-06-29 22:29:12 -04:00
lethosor f8250bd8a4 Merge remote-tracking branch 'suokko/missing_isDiplomat_1324' into develop 2018-06-29 22:19:12 -04:00
Lethosor 5d1141e1ec
Add isDiplomat to API section too 2018-06-29 09:26:16 -04:00
Pauli c39a882b57 Add missing Unit::isDiplomat
Fixes #1324
2018-06-29 16:19:18 +03:00
lethosor aad4bbe65c Authors.rst: fix order 2018-06-28 14:26:32 -04:00
lethosor 3c2bfb6f47 Bump to 0.44.11-alpha1, update changelog, xml 2018-06-28 13:31:56 -04:00
lethosor f9dfb5907b Update submodules, authors 2018-06-27 13:57:34 -04:00
Pauli afd942a94b ruby: Support automatic array size from index-enum 2018-06-26 23:48:54 +03:00
lethosor 19627b9221 Bump to 0.44.11 2018-06-24 17:42:31 -04:00
Pauli 20bd03ab6d Reset dsgn_check_cooldown in Block::write
To make sure that DF generates jobjs from desgination as soon as
possible the dsgn_check_cooldown should be reset when designations
change.
2018-06-24 17:06:32 +03:00
Pauli 123de7fdf7 Use constexpr to prevent attempts of linking static variable 2018-06-24 17:06:32 +03:00
Pauli f6b0ac7819 Refactor CoreSuspender to fix Console::lineedit exit hangs
The old CoreSuspender requires processing from Core::Update to allow
commands execute. But that causes issues if Core::Shutdown wants
quarentee cleanup order with std:🧵:join. Fixing shutdown ordering
adds too many branches to already fairly complex code.

I decided to try to refactor CoreSuspender to use simpler locking
locking using a std::recusive_muted as primary synchronization
primitive.
To help control when Core::Update unlocks the primary mutex there is
std::contition_variable_any and std::atomic<size_t> queue lenght
counter.
The last state variable is std::atomic<std:🧵:id> that is used to
keep track of owner thread for Core::IsSuspended query.

This should be merged only just after a release to make sure that it
gets maximum testing in develop branch before next release.

Fixes #1066
2018-06-22 17:57:37 +03:00
Pauli 0bc1db4f07 Make sure hotkeythread exits before cleanup 2018-06-22 17:57:37 +03:00
Pauli 1fc37f8ddc Checke Console::lineedit error return values
Console::lineedit can return -1 to indicate input error and -2 to
indicate the program is closing. But most users don't check possible
unusual return values which can lead to exit hang.
2018-06-22 17:57:37 +03:00
Pauli 84b1361387 Make cuchar check test if c32rtomb is present in system
Fix for mac build where cuchar is present but uchar.h is not.
2018-06-22 17:57:37 +03:00
Pauli 84f8a75a2e Add cuchar fallback implementation for gcc 4 and 5 2018-06-22 17:57:37 +03:00
Pauli 820b787cd0 Add multibyte character handling to posix console
I noticed that multibyte characters can mess up the console state
variables. I decided to add a minimal multibyte support to make sure the
input only collects complete valid multibyte characters in case user
enters them to console.

This change assumes that UTF-32 has one to one mapping between printed
characters and char32 indexes. But I remember reading there is a few
rare corner cases with accents where character might require multiple
4byte characters too. But this patch at least changes correct handling
from about 100 characters to 99% of unicode characters.
2018-06-22 17:57:37 +03:00
Pauli 1acb60daa2 Prevent data races during console/init thread shutdown
There is a minor chance that console or init thread would access already
freed memory when core is shutting down and cleaning up state. To avoid
any danger of having random bugs caused by the potential data race I
decided to make sure the shutdown code waits for the thread to exit
first.

Windows change is completely untested. It is purely based on msdn
documentation.
2018-06-22 17:57:37 +03: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
Pauli b7871c7368 Console-posix: Use lowest possible nfds parameter to the select call 2018-06-22 17:57:37 +03:00
lethosor 8a1979b8a7 Update version in CMakeLists.txt to 0.44.10-r2 2018-06-21 22:34:11 -04:00