1
0
Fork 0
Commit Graph

309 Commits

Author SHA1 Message Date
Tiger Wang 91c1d1c58a Windows backtrace: fprintf to fputs 2021-06-28 21:54:21 +01:00
Tiger Wang ce8d8388d6
Windows: remove extra newlines in backtrace (#5218)
- Remove DLL lines, not generally needed.
2021-05-06 14:25:12 +00:00
Tiger Wang 34bf5c0d9d Rename files to match code 2021-05-04 16:11:56 +01:00
Tiger Wang 1100b04b59
Make Windows go brrrr, not tick. tick. tick. (#5201)
* Fixes #5140
2021-04-21 16:07:48 +01:00
Tiger Wang 222d9957a1 cIsThread cleanup
+ Semi-gracefully handle unexpected exceptions
* No-one cared about the return values, remove them
2021-03-29 23:36:15 +01:00
Tiger Wang 5123850db0
Fix Windows XP to 7 compatibility (#5167)
* Partially reverts 01a4e696b
* Unify thread names
- Remove use of GetThreadId API
2021-03-28 13:34:57 +01:00
Tiger Wang 50a94f972d
Fix debug macro situation (#5114)
Use the standard NDEBUG.
2021-01-26 09:41:55 +00:00
Tiger Wang eeb63b8901
zlib -> libdeflate (#5085)
+ Use libdeflate
+ Use std::byte
* Fix passing temporary to string_view
+ Emulate make_unique_for_overwrite
2021-01-11 16:39:43 +00:00
peterbell10 a9031b6bae
Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963)
* Fix cmake not adding Werror on clang, and _lots_ of warnings

* WIP: Build fixes

* Cannot make intermediate blockhandler instance

* Tiger's changes

* Fix BitIndex check

* Handle invalid NextState values in cMultiVersionProtocol

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-10-05 10:27:14 +00:00
KingCol13 a78fd671b2
Deleted BiomeDef.h and ChunkDef.h from Globals.h (#4885)
* Removed BiomeDef.h

* Removed ChunkDef.h from Globals.h

* Added to CONTRIBUTORS.

* Re-added empty last line to Globals.h

* Included stddef and StringUtils in BiomeDef.h

* Fixed build tools compiling. It compiles, but at what cost?

* Added include to src/Generating/Trees.h

* Include added in ChunkGeneratorThread.h

* Moved rearranged includes in LineBlockTracer.cpp

* Re-arrange headers in ChunkInterface.cpp

* Included ChunkDef.h in Path.h

* Included ChunkDef.h in NBTChunkSerializer.h

* Rearranged included and added required includes to headers.

* Removed unnecessary included in StringUtils.h.
2020-09-25 09:13:59 +00:00
SatoKaito 834d61dacc
fixed missing include for FreeBSD. (#4852) 2020-09-10 00:17:06 +01:00
Tiger Wang 1bc12ba2b3 Streamline startup sequence
* Clean up cRoot & main
* Move some OS-specifics into OSSupport
2020-09-05 13:16:52 +01:00
Tiger Wang f23402dacd Add FileStream wrapper 2020-08-19 20:45:27 +01:00
Tiger Wang 330626ab22 Update submodules 2020-07-23 00:32:47 +01:00
Tiger Wang 3f712ca9cf Precompile unordered_map/set
+ Add inclusions to Globals.h
* Sort Globals.h
- Remove sys/stat.h from Globals.h
2020-07-19 19:58:53 +01:00
Tiger Wang 951a0212d8 Move IsValidSocket out of global namespace 2020-07-18 14:20:31 +01:00
Tiger Wang 1c714312eb Remove unnecessary includes 2020-07-12 23:41:54 +01:00
Peter Bell 829f8d46f0 Update fmtlib to 7.0.0 2020-07-06 20:53:04 +01:00
peterbell10 6036971c77
libevent: Enable IOCP backend on windows (#4745) 2020-06-08 21:03:29 +01:00
Tiger Wang 9e8598fb1c
Upgrade to C++17 [CMake] (#4717)
* Make our CMake slightly less insane
2020-05-16 20:59:10 +01:00
Peter Bell 3189a3cbee Update logging code to reduce unnecessary string copying:
* Write into a single fmt::memory_buffer
* Use string_view instead of AString for listener callbacks
* Also collapsed vFLOG and vLOG functions into one per formatting type
2020-05-16 09:39:05 +01:00
peterbell10 13144a08e4
Enable some more clang-tidy linter checks (#4738)
* Avoid inefficient AString -> c_str() -> AString round trip

* Avoid redundant string init expressions

* Avoid unnecessary return, continue, etc.

* Add .clang-format to help with clang-tidy fix-its

* Avoid unnecessary passing by value

* Avoid unnecessary local copying

* Avoid copying in range-for loops

* Avoid over-complicated boolean expressions

* Some violations missed by my local clang-tidy

* Allow unnecessary continue statements

* Add brackets

* Another expression missed locally

* Move BindingsProcessor call into clang-tidy.sh and add space

* Fix pushd not found error

* Different grouping of CheckBlockInteractionRate
2020-05-14 22:15:35 +00:00
Mat e053f72db8
Android build cleanup (#4734)
* Android build cleanup

* Remove unnecessary workaround

* Remove more unnecessities

* Bump cmake version
2020-05-10 16:18:28 +00:00
peterbell10 84289a2ba9
Cleanup some workarounds and warnings (#4735)
* Cleanup thread_local usage in FastRandom

* Use constexpr to avoid clang warning

* Fix more Wglobal-constructor warnings

* Make MSVC happy?
2020-05-10 16:16:49 +00:00
peterbell10 154df6b09d
Cleanup unneeded globals (#4736) 2020-05-10 16:16:38 +00:00
Mat c710f6a4ea
Remove old Android leftovers (#4722) 2020-05-07 22:14:00 +03:00
peterbell10 57952505e5
Update fmt to 6.2.0 (#4718)
* Update fmt to 6.2.0
2020-05-05 22:52:14 +01:00
Mattes D 9ee47e5999 Using Super. 2020-04-16 20:07:48 +00:00
Mattes D 42cc736bfd
ServerHandle: Fix closing failed servers. (#4653)
If the cServerHandle failed to listen, closing it would then crash Cuberite.
2020-04-15 14:13:40 +02:00
Mat 318d31dc39
Use a reasonable listen backlog value (#4597) 2020-04-02 16:05:07 +02:00
Mat 7d4934534e
Stabilise MoveToWorld (#4004)
* Stabilise MoveToWorld

* Fix comments and deprecate ScheduleMoveToWorld

* Enhanced thread safety for m_WorldChangeInfo

* Return unique_ptr from cAtomicUniquePtr::exchange

* cWorld now calls entity cEntity::OnAddToWorld and cEntity::OnRemoveFromWorld.

Allows broadcasting entities added to the world from the world's tick thread.
This also factors out some common code from cEntity::DoMoveToWorld and cEntity::Initialize.

As a consequence, cEntity::Destroy(false) (i.e. Destroying the entity without broadcasting) is impossible.
This isn't used anywhere in Cuberite so it's now deprecated.

* Update entity position after removing it from the world.
Fixes broadcasts being sent to the wrong chunk.

* Fix style

* cEntity: Update LastSentPosition when sending spawn packet

* Add Wno-deprecated-declarations to the lua bindings

* Kill uses of ScheduleMoveToWorld
2020-03-05 12:52:34 +02:00
Alexander Harkness bf10b56638 Fix android builds (#4432)
* Terminate android build script early if any step fails

* Remove deprecated android types

* Use android NDK cmake support rather than cmake android NDK support as that support is better supported

* Android uses GNU strerror_r?

* Fix compilation

* Rebase

* Fix final issues

* Drop submodule changes

* Revert change

* Parentheses

* Lower api levels

* Don't use GNU strerror_r for Android

Co-authored-by: Mat <mail@mathias.is>
2020-01-02 03:54:40 +02:00
Mattes D f021e2fe22 Updated LibEvent to release 2.1.11-stable. (#4383)
This finally restores my ability to compile on Windows and Linux from the same source folder (on a network drive).

LibEvent broke this long ago by writing a config file into the source folder, rather than build folder. Now it's finally fixed.
2019-09-04 22:34:54 +01:00
peterbell10 ee84197014
Force all headers other than "Globals.h" to be included with relative paths (#4269)
Closes #4236

CMake now creates a header file in the build directory under the path "include/Globals.h" which just includes "src/Globals.h" with an absolute path. Then instead of adding "src/" to the include directories, it adds "include/".

#include "Globals.h" still works by including the build generated file and any other src-relative path will not work.
2018-08-29 01:51:25 +01:00
Nate 801d5d7170 Fix: Create players folder recursively (#4283)
Problem: On a new server the players folder was not created on windows.

Root Cause:
`GetUUIDFolderName` was returning a folder structure for players with `/` while CreateFolderRecursively was checking for `\\` for win32. 

The fix is to recognise both forward and backward slashes as file separators on windows.

Fixes #4284
2018-08-12 23:47:38 +01:00
peterbell10 950aeffff8
CheckBasicStyle: Check number of empty lines between functions (#4267)
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-26 22:24:36 +01:00
peterbell10 7b431bed51
cIsThread: Reset m_ShouldTerminate after the thread has stopped (#4258)
This allows threads to be restarted after stopping.

Fixes #4257
2018-07-22 22:35:58 +01:00
peterbell10 a4dbb5c582
Prefer static_cast to reinterpret_cast (#4223)
* Change reinterpret_cast -> static_cast wherever possible
* Remove more unnecessary `const_cast`s.

reinterpret_casts should be avoided for the same reason as c-style casts - they don't do any type-checking. reinterpret_cast was mainly being used for down-casting in inheritance hierarchies but static_cast works just as well while also making sure that there is actually an inheritance relationship there.
2018-05-02 08:50:36 +01:00
peterbell10 1ea36298d2
Fix cUrlClient leak (#4125)
Fixes #4040
* The TCP connection is now shutdown after OnBodyFinished
* Any open connections are closed when cNetworkSingleton::Terminate() is called.
* Removed ownership cycles in cUrlClientRequest
* Added a check to the test to ensure there are no leaks.
2018-02-20 17:08:46 +00:00
peterbell10 757231cc6e
Add the fmt library (#4065)
* Replaces AppendVPrintf with fmt::sprintf
* fmt::ArgList now used as a type safe alternative to varargs.
* Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu.
* Adds FLOG functions to log with fmt's native formatting style.
2018-01-03 17:41:16 +00:00
Mattes D 01322cb1b0 NetworkLookup: Added "virtual" keyword to overridden dtor. (#4100) 2017-12-21 13:31:20 +00:00
bibo38 532731e6f4 Fixed Clang 5.0 compile errors (#4085)
* Fixed Clang 5.0 compile errors

* Fixed wrong comment

* Only disable warnings in Clang 5 or higher

* Added a CMake condition for the Clang 5 no-zero-as-null-pointer-constant warning

* Now using the use_nullptr branch of the Cuberite specific SQLiteCpp fork
2017-12-21 11:36:58 +00:00
Lukas Pioch c5f590d460 Removed UTF-8 BOM (#4033) 2017-09-19 10:34:08 +02:00
peterbell10 84941bcc9f Update mbedtls to 2.5.1 (#3964)
* Renaming changes:
  * macro prefix "POLARSSL" -> "MBEDTLS"
  * functions now prefixed with "mbedtls_"
  * rename PolarSSL++ -> mbedTLS++
  * rename polarssl submodule

* Use mbedtls' AES-CFB8 implementation.

* Add cSslConfig to wrap mbedtls_ssl_config

* Update cTCPLink and cBlockingSslClientSocket to use cSslConfig

* Use cSslConfig in cHTTPServer

* Use cSslConfig for cMojangAPI::SecureRequest

* CI Fixes

* Set -fomit-frame-pointer on the right target
2017-08-30 15:00:06 +01:00
mathiascode 02775e52c4 Minor changes (#3909) 2017-08-24 11:19:40 +02:00
Lukas Pioch 07f25253a2 Removed unneeded includes (#3902) 2017-08-06 20:57:44 +01:00
peterbell10 759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
peterbell10 5a5297974b Remove alignment macros 2017-07-21 14:41:51 +01:00
peterbell10 a56cfd1f42 Remove smart pointer macros 2017-07-21 14:41:51 +01:00
Mattes D ea6660721b NetworkSingleton: Fixed a throw warning in VS2017. (#3792)
Also fixed the misleading name.
2017-06-22 21:10:41 +02:00