Commit Graph

37 Commits

Author SHA1 Message Date
Rubidium 66354ab9eb Codechange: introduce allow list infrastructure for companies 2024-05-07 00:03:15 +02:00
Rubidium d5e28a904d Fix fb9d4af: use different nonces for key exchange and stream encryption 2024-03-31 15:14:16 +02:00
Rubidium 7580eac2d5 Codechange: create helper class for useful NetworkAuthorizedKeys functions 2024-03-18 22:56:58 +01:00
Rubidium 1cf8799810 Feature: encrypt the connection between game server and client 2024-03-17 19:48:34 +01:00
Rubidium dd532cbc77 Codechange: add setting for authorized/secret/public keys 2024-03-17 19:09:22 +01:00
Rubidium fb9d4afa5c Codechange: add set of classes providing authentication and encryption 2024-03-17 18:33:53 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Ivan Fefer 23d733be95
Add: Basic autocompletion on tab for console commands (#12163) 2024-03-13 21:43:08 +01:00
Rubidium 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2024-03-10 10:14:20 +01:00
Jonathan G Rennison c0b8e58404 Codechange: Simplify SetBitIterator
Use FindFirstBit and KillFirstBit, allowing simpler iterator equality
Add simple test
2024-02-01 23:05:57 +01:00
Patric Stout 75f21065c9
Codechange: refactor DecodeHexText to a generic purpose ConvertHexToBytes (#11866)
DecodeHexText() does more than just decoding hex. ConvertHexToBytes()
now only does pure hex decoding. This required a bit of refactoring
for the code using DecodeHexText().
2024-01-22 19:42:47 +01:00
Rubidium 4c51534b6a Remove: LeastCommonMultiple / GreatestCommonDivisor
Use std::lcm / std::gcd instead.
2024-01-20 16:45:21 +01:00
Rubidium 2d77cf9c80 Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with 2024-01-17 19:48:22 +01:00
Michael Lutz 6e766a2e81 Change: Allow TrueType fonts to provide our private-use glyphs. 2024-01-14 22:50:56 +01:00
Peter Nelson 7124b4eef1 Codechange: Use std::unique_ptr for all NWidgets. 2023-12-31 15:33:56 +00:00
Peter Nelson b86182ab84 Codechange: Use std::map to provide indexed widget access.
This removes the need to determine the biggest widget index and replaces C-style memory handling.
2023-12-29 18:45:43 +00:00
Jonathan G Rennison 2b914c7a2f Fix: Memory leak in WindowDescTestsFixture 2023-12-26 23:48:59 +01:00
Peter Nelson b1eb5533eb Add: WindowDesc unit test to validate NWidgetPart lists. 2023-11-05 19:24:59 +00:00
Peter Nelson 1c94fb0389 Add: Mock sprite cache intialization.
This fills up the sprite cache with SPR_OPENTTD_BASE + OPENTTD_SPRITE_COUNT zero-size sprites, to
allow GetSpriteSize() calls to continue from unit-tests.
2023-11-05 19:24:59 +00:00
Peter Nelson 46f63074da Add: MockFontCache for testing GUI code that only needs to know font sizes. 2023-11-05 19:24:59 +00:00
Peter Nelson ce6e739491 Codechange: Add unit-test to check if nested widget parts of properly closed.
Properly closed means exactly one EndContainer for every Container widget.
2023-11-03 09:38:41 +00:00
Peter Nelson e563057478 Add: WindowDesc unit test to validate ini-key value.
ini-key must be present if WWT_DEFSIZEBOX or WWT_STICKYBOX is present.
This was previously enforced by a workflow, however that parsed the source
code with regex which turned out to be error-prone.
2023-11-02 22:25:01 +00:00
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 2023-11-01 22:56:11 +01:00
Patric Stout ba67f39db6
Codechange: vendor the nlohmann-json library (#11290) 2023-09-13 16:11:34 +02:00
Patric Stout 00f13282a9
Codechange: keep how we convert string <-> JSON private (#11269) 2023-09-08 19:03:10 +02:00
Patric Stout 5f9b8aaa95
Codechange: [Script] use nlohmann for Squirrel <-> JSON conversion (#11251) 2023-09-06 13:14:12 +02:00
Patric Stout 7afd686541
Codechange: add tests for GS <-> AdminPort JSON conversion (#11252)
While at it, fix a bug where booleans were made integers.
2023-08-31 19:38:15 +00:00
Rubidium 6635f809dd Fix #11181: attempting to read string as int triggers assertion 2023-08-20 23:57:42 +02:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Patric Stout 0f3dd9c796
Fix: crash when window can't be placed on low resolution screens. (#10932)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
2023-06-04 15:39:57 +00:00
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 2023-05-17 10:14:41 +01:00
Rubidium 969a3dc0f3 Codechange: introduce generic ClampTo function to clamp to the range of a type 2023-05-06 21:26:13 +02:00
Rubidium b5f96808a1 Fix: FormatArrayAsHex returns gibberish instead of a hex array 2023-04-29 11:07:57 +02:00
Rubidium 4dd5f994be Codechange: replace strncasecmp with case ignoring variant of StrStarts/EndsWith 2023-04-29 10:25:25 +02:00
Rubidium 86786a7af6 Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp 2023-04-29 10:25:25 +02:00
Rubidium 43a7e54067 Add: unit test functionality using catch2 2023-04-16 18:58:21 +02:00
Rubidium c6ff7dad68 Add: compile time "unit tests" for GetPartialZ consistent 2023-04-09 19:00:26 +02:00