Commit Graph

459 Commits

Author SHA1 Message Date
Dmitry Marakasov 2ecf57c640 Fix build issue due to conflicting s64 type definitions (#9064)
See comment in irrlichttypes.h and https://sourceforge.net/p/irrlicht/bugs/433/
2019-10-23 20:28:55 +02:00
ANAND 3799ffd9d5 Move Quicktune code to util/ (#8871) 2019-09-29 13:41:13 +02:00
HybridDog 36bfc67574 Move debug.txt after it grows too big (#8904)
Before opening the file for writing, its file size is tested. If it exceeds 50 MB, it is moved to debut.txt.1, otherwise the log is appended to the old messages. An old debut.txt.1 is removed if it already exists.
2019-09-07 19:38:54 +02:00
Markus Mattes e3738c2f61 Fix handling of --color and --worldlist command line arguments
They verify the provided value and error if a wrong value got provided
command line description for color was differnt on win32 but  code did not handle any differenc
extended the command line description for world and worldname that it is clear that they only start a local game if used with --go

Fixes #7875
2019-06-21 01:29:35 +01:00
HybridDog ee698770b9 Fix --color command line parameter ignorance (#7173)
* Fix color command line parameter ignorance

* coloured log: Support detecting the tty on windows

* Print an error message when setting something invalid as color mode instead of silently using mode never

* Revert "coloured log: Support detecting the tty on windows"

This reverts commit 4c9fc6366487ac0e6799e181796ca594797bb6f8.
It didn't work for travis and belongs to a separate PR

* Allow adjusting the log color with an environment variable

If --color is not passed to minetest,  is used to decide on the log colorization.
Minetest settings can not be used instead of an environment variable because logs may appear before loading them.

* fix empty if body
2019-03-05 08:14:33 +01:00
Kevin Abrams b7eb81fed9 Add command line option to load password from file (#7832) 2018-12-18 20:15:14 +01:00
Quentin Bazin 5f1cd555cd Move client-specific files to 'src/client' (#7902)
Update Android.mk
Remove 'src/client' from include_directories
2018-11-28 20:01:49 +01:00
pauloue 5aa865e56b Save debug.txt to build dir for RUN_IN_PLACE build (#7615) 2018-08-15 11:36:40 +02:00
Ben Deutsch 153fb211ac Replace auth.txt with SQLite auth database (#7279)
* Replace auth.txt with SQLite auth database
2018-08-05 13:13:38 +02:00
Loïc Blot 9a1d3584c2
Server: move shutdown parts to a specific shutdown state object (#7437)
* Server: move shutdown parts to a specific shutdown state object
2018-06-13 21:58:34 +02:00
you 540e07e3ef Fix missing warningstream (or similar problem) (#7034)
Use the --color command line parameter instead of a setting for coloured logs

This fixes the missing warningstream bug, g_settings->get mustn't be used there.
Also, the decision about en- or disabling log colours fits better to the command line parameters than minetest settings.
2018-03-04 17:34:36 +01:00
Brian 929792e15e Allow for getting world name and path separately on the command line (#6555)
Change to --worldlist instead of --world list.

Gets rid of --worldpath parameter added as part of this pull request,
instead moving the listing function to a command --worldlist that
accepts either name, path, or both and prints out the corresponding
information.
2018-03-04 17:34:09 +01:00
Vitaliy 20a85d76d9 Move files to subdirectories (#6599)
* Move files around
2017-11-08 23:56:20 +01:00
Loïc Blot 2afe62952c Server: affect bind_addr on constructor instead of start() (#6474)
bind_addr is already ready when using constructor as we read is.IPv6 from it, instead pass the whole address
2017-09-28 13:47:30 +02:00
Loic Blot 151c95bb9b
main.cpp: server-only builds should not include client headers 2017-09-07 23:51:06 +02:00
you ad9786c44b Add build date to minetest --version and increase readability (#6331) 2017-09-03 22:32:30 +02:00
Loïc Blot bd6b90359c Remove DSTACK support (#6346)
Debugstacks is not useful, we don't really use it, the DebugStack is not pertinent, gdb and lldb are better if we really want to debug.
2017-08-30 08:09:41 +02:00
Loïc Blot c7160cb629 Network cleanup (#6302)
* Cleanup network headers

* Move peerhandler to a specific header to reduce compilation times
* Move socket.cpp/h to network folder

* More work

* Network code cleanups

* Move socket.{cpp,h} to network folder
* Move Address object to network/address.{cpp,h}
* Move network exceptions to network/networkexceptions.h
* Client: use unique_ptr for Connection
* Server/ClientIface: use shared_ptr for Connection

* Format fixes

* Remove socket.cpp socket.h from clang-format whitelist

* Also fix NetworkPacket code style & make it under clang-format
2017-08-24 08:28:54 +02:00
Loïc Blot 1c1c97cbd1 Modernize source code: last part (#6285)
* Modernize source code: last par

* Use empty when needed
* Use emplace_back instead of push_back when needed
* For range-based loops
* Initializers fixes
* constructors, destructors default
* c++ C stl includes
2017-08-20 13:30:50 +02:00
Loïc Blot fd3afbced5 Optimize headers (part 2) (#6272)
* Optimize headers (part 2)

* less debug.h in headers
* less remoteplayer.h for everybody

* Cleanup (part 2)

* camera.h: mesh.h
* mapgen.h: mapnode.h
* serverenvironment.h: mapblock.h
* nodedef.h: shader.h
2017-08-18 19:25:07 +02:00
Loïc Blot c427533389 Modernize various files (src/m*) (#6267)
* Modernize various files (src/m*)

* range-based for loops
* code style
* C++ headers instead of C headers
* Default operators
* empty function

Thanks to clang-tidy
2017-08-18 18:18:25 +02:00
Loïc Blot 85511a642f Cleanup various headers to reduce compilation times (#6255)
* Cleanup various headers to reduce compilation times
2017-08-16 22:11:45 +02:00
Loïc Blot 8f7785771b Cpp11 initializers 2 (#5999)
* C++11 patchset 10: continue cleanup on constructors

* Drop obsolete bool MainMenuData::enable_public (setting is called with cURL in server loop)

* More classes cleanup

* More classes cleanup + change NULL tests to boolean tests
2017-06-17 19:11:28 +02:00
ShadowNinja b662a4577d Clean up getTime helpers
This increases size of the getTime return values to 64 bits.
It also removes the TimeGetter classes since the getTime functions
are now very precise.
2017-04-28 14:43:18 -04:00
Loïc Blot 29ab20c272 Player data to Database (#5475)
* Player data to Database

Add player data into databases (SQLite3 & PG only)

PostgreSQL & SQLite: better POO Design for databases

Add --migrate-players argument to server + deprecation warning

* Remove players directory if empty
2017-04-23 14:35:08 +02:00
adrido 676951d90d Windows: Skip cmd for release builds (#5416) 2017-04-07 07:14:39 +02:00
ShadowNinja b8484ef24e Server list cleanup
This removes the hacky server_dedicated pseudo-setting.
2017-03-18 12:37:57 +01:00
adrido a1e1323d6e Windows: dont link to libraries that are already linked by cmake
This solves the problem whith building where build fails if the libaries have different names.
2016-10-25 13:54:24 +02:00
Loic Blot 143401451c DB::loadBlock copy removal & DB backend cleanup
* Remove the copy from db::loadBlock by using a pointer to the destination
* cleanup db backend, the child backend doesn't have to set their functions as virtual
2016-05-17 06:52:16 +02:00
Craig Robbins 8bb9e467d6 Fix typo in the info printed by --version 2016-05-11 23:20:20 +10:00
Craig Robbins 58b54cf9a9 Add platform name to --version information 2016-05-11 17:15:41 +10:00
ShadowNinja ea2964f5a1 Add seperate cache path
This is set to the XDG cache path where possible.
It's set to the app's cache path on Android.
2015-12-07 13:51:41 -05:00
kwolekr 889f893ff3 Abort compile when attempting to build client with Irrlicht 1.8.2 2015-11-08 23:13:47 -05:00
est31 5e507c9829 Add server side ncurses terminal
This adds a chat console the server owner can use for administration
or to talk with players.
It runs in its own thread, which makes the user interface immune to
the server's lag, behaving just like a client, except timeout.
As it uses the same console code as the f10 console, things like nick
completion or a scroll buffer basically come for free.
The terminal itself is written in a general way so that adding a
client version later on is just about implementing an interface.

Fatal errors are printed after the console exists and the ncurses
terminal buffer gets cleaned up with endwin(), so that the error still
remains visible.

The server owner can chose their username their entered text will
have in chat and where players can send PMs to.
Once the username is secured with a password to prevent anybody to
take over the server, the owner can execute admin tasks over the
console.

This change includes a contribution by @kahrl who has improved ncurses
library detection.
2015-11-06 08:51:14 +01:00
Perttu Ahola 3285bf73b9 Print direct command line responses to standard output instead of using the log system
Using logging for these just makes them bloated and hard to read and overally just not neat at all.
2015-11-02 00:11:20 +02:00
ShadowNinja 9269a0ecc7 Fix server crashing on Lua errors
Previously, the server called FATAL_ERROR when a Lua error occured.
This caused a (mostly useless) core dump.
The server now simply throws an exception, which is caught and printed before
exiting with a non-zero return value.
This also fixes a number of instances where errors were logged multiple times.
2015-10-31 13:28:58 -04:00
est31 5f342aa015 Remove some abort() calls
abort() doesn't benefit from the high level abstractions from FATAL_ERROR.
2015-10-26 04:45:00 +01:00
kwolekr 2d207afe8e Fix compilation under MSVC and remove unnecessary conditional function prototype
Thanks to SmallJoker for pointing this out.
2015-10-24 13:34:49 -04:00
Jun Zhang df80b1ae5a init_log_streams: check if log_filename is empty.
Fixes #3262.
2015-10-19 12:14:05 +02:00
ShadowNinja 6f4d6cb574 Always use errorstream for DEBUG_EXCEPTION_HANDLER 2015-10-14 02:33:30 -04:00
ShadowNinja 2139d7d45f Refactor logging
- Add warning log level
- Change debug_log_level setting to enumeration string
- Map Irrlicht log events to MT log events
- Encapsulate log_* functions and global variables into a class, Logger
- Unify dstream with standard logging mechanism
- Unify core.debug() with standard core.log() script API
2015-10-14 01:03:54 -04:00
ShadowNinja 645e208673 Use CUSTOM_LOCALEDIR if specified 2015-09-06 11:21:26 +02:00
David Jones 34b7a147dc Change i++ to ++i 2015-08-25 18:33:52 -04:00
ShadowNinja e4bff8be94 Clean up threading
* Rename everything.
    * Strip J prefix.
    * Change UpperCamelCase functions to lowerCamelCase.
  * Remove global (!) semaphore count mutex on OSX.
  * Remove semaphore count getter (unused, unsafe, depended on internal
    API functions on Windows, and used a hack on OSX).
  * Add `Atomic<type>`.
  * Make `Thread` handle thread names.
  * Add support for C++11 multi-threading.
  * Combine pthread and win32 sources.
  * Remove `ThreadStarted` (unused, unneeded).
  * Move some includes from the headers to the sources.
  * Move all of `Event` into its header (allows inlining with no new includes).
  * Make `Event` use `Semaphore` (except on Windows).
  * Move some porting functions into `Thread`.
  * Integrate logging with `Thread`.
  * Add threading test.
2015-08-23 22:04:06 -04:00
Loic Blot fa7fe510d9 Remove profiler.h include where it's not needed. Remove some unreachable and very old code 2015-07-21 08:10:43 +02:00
sfan5 4ea5a96fff Revert the upper-case PROJECT_NAME nonsense that was part of #2402 2015-04-27 16:24:49 +02:00
kwolekr 7220ca906d Tests: Modularize unit testing
Split unit tests into separate files under src/unittest/
Give better unittest diagnostics
Clean up some code
2015-04-26 15:08:54 -04:00
Craig Robbins 9527984dbc Move globals from main.cpp to more sane locations
Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
2015-04-01 23:04:25 +10:00
ShadowNinja 93fcab952b Clean up and tweak build system
* Combine client and server man pages.
  * Update unit test options and available databases in man page.
  * Add `--worldname` to man page.
  * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`.
  * Disable server build by default on all operating systems.
  * Make `ENABLE_FREETYPE` not fail if FreeType isn't found.
  * Enable LevelDB, Redis, and FreeType detection by default.
  * Remove the `VERSION_PATCH_ORIG` hack.
  * Add option to search for and use system JSONCPP.
  * Remove broken LuaJIT version detection.
  * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`.
  * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`.
  * Clean up style of CMake files.
2015-03-27 15:00:48 -04:00
Craig Robbins ced6d20295 For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives 2015-03-07 22:41:47 +10:00