281 Commits

Author SHA1 Message Date
est31
0094943204 Refactor around translatePassword
Change types for passed password from wstring to string, which removes converting
back and forth in most cases. Move the narrow_to_wide conversion, where its neccessary,
closer to irrlicht. Remove trailing spaces in guiPasswordChange.cpp. Make parameters for
translatePassword passed as const reference.
2015-04-17 06:10:30 +02:00
kwolekr
737d4078c9 Schematics: Refactor NodeResolver and add NodeResolveMethod
NodeResolver name lists now belong to the NodeResolver object instead of
the associated NodeDefManager.  In addition to minimizing unnecessary
abstraction and overhead, this move permits NodeResolvers to look up nodes
that they had previously set pending for resolution.  So far, this
functionality has been used in the case of schematics for
serialization/deserialization.
2015-04-16 16:27:05 -04:00
est31
9a3a47db88 Make comments consistent with TOSERVER_INIT -> TOSERVER_INIT_LEGACY rename 2015-04-07 00:15:15 +02:00
Craig Robbins
06ff65f2c4 Change screenshot filename to one likely to work on all modern filesystems
Fixes #2603
2015-04-06 11:07:51 +10:00
Craig Robbins
0731f9ed2a 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
Aaron Suen
e8d51554ae Clean scaling pre-filter for formspec/HUD. 2015-04-01 00:01:05 -04:00
Loic Blot
ffee8a059a Connection::Receive(): receive Network Packet instead of SharedBuffer<u8>.
Because we get a Buffer<u8> from ConnectionEvent, don't convert it to SharedBuffer<u8> and return it to Server/Client::Receive which will convert it to NetworkPacket
Instead, put the Buffer<u8> directly to NetworkPacket and return it to packet processing
This remove a long existing memory copy
Also check the packet size directly into Connection::Receive instead of packet processing
2015-03-31 11:01:08 +02:00
Craig Robbins
fd71a03b85 Change format of screenshot names
Filename screenshot_ + ISO 8601 format + [-serial]

i.e. screenshot_YYYY-MM-DDTHH::MM::SS[-serial].png

Serial is added if the filename + timestamp already exists and is in the range 1 to 999
2015-03-31 16:24:25 +10:00
ShadowNinja
2de60ae349 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
0d4b186bbd Change filename of screenshots to something more human readable 2015-03-25 02:55:28 +10:00
Loic Blot
5b3e52fc1e Move client packet generators to dedicated functions for:
* TOSERVER_INIT_LEGACY
* TOSERVER_DELETEDBLOCKS
* TOSERVER_GOTBLOCKS
* TOSERVER_REMOVED_SOUNDS
Also use a std::vector instead of std::set for TOSERVER_REMOVED_SOUNDS
2015-03-16 12:39:27 +01:00
est31
f9986b360a Finer progress bar updates when initializing nodes
The bar is only drawn when the user will notice a change, which prevents time overheads that this commit would cause, resulting from useless draws.
2015-03-15 22:01:52 +10:00
Loic Blot
ae19a9f796 client.cpp: typo fix and break; fix to make some compilers happy 2015-03-13 22:08:48 +01:00
Loic Blot
b4f34761bd Replace NetworkPacket pointers to references 2015-03-13 22:01:49 +01:00
Loic Blot
7d8afdbc1e Rename some packet and handlers to <packet>_Legacy name for compat layer between new network changes and old network clients 2015-03-13 13:40:48 +01:00
Loic Blot
84437aaa6c Fix memleak pointed by issue #2439.
Also change bzero to memset. bzero doesn't work on windows
2015-03-08 18:13:27 +01:00
Loic Blot
62f54e9f52 Fix unitialized data when creating TOSERVER_INIT packet 2015-03-08 18:03:43 +01:00
Craig Robbins
27791ee1aa 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
ShadowNinja
2cb27a5fb6 Clean up database API and save the local map on an interval 2015-03-06 00:20:45 -05:00
Loic Blot
b6a8f1e7c4 Performance improvement: Use std::list instead of std::vector for request_media, Server::getModNames, Environment::m_simple_objects.
* Also remove unused Server::m_modspaths
2015-03-05 10:44:48 +01:00
Loic Blot
1186245881 Remove Queue class which uses std::list and use native std::queue 2015-03-05 16:49:51 +10:00
Loic Blot
12d7ac0fec Fix some memory leaks on packet sending. 2015-02-21 17:27:31 +01:00
Loic Blot
f764ef3076 Replace std::list by std::vector into timerUpdate calls 2015-02-17 15:08:37 +01:00
Loic Blot
ba3e67271c Remove old comment from Network Rework Patch 2/4 2015-02-17 14:49:21 +01:00
Loic Blot
416ba2b408 [Patch 2/4] Network rework: packet writing, sending and cleanups
NetworkPacket.cpp:
* Remove some deprecated functions, we must use streaming interface
* m_data converted from u8* to std::vector<u8>
* Add an exporter to forge packet to Connection object
* implement operator << std::wstring. n
* implement operator << std::string
* dynamic resize when write packet content.
* fix string writing and performances.
* create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
  * Reliability
  * Transmit channel
* Implement putRawString for some ugly char (_INIT packet), and use it.
* Many packet read and write migrated
* Implement oldForgePacket to interface writing with current connection
* fix U8/char/bool writing
* fix string writing and performances.
* add some missing functions
* Use v3s16 read instead of reading x,y,z separately
* Add irr::video::SColor support into packets
* Add some missing handlers
* Add a template function to increase offset
* Throw a serialization error on packet reading (must be improved)

PacketFactories:
* Create ServerCommandFactory, used by client to get useful informations about packet processing (sending).
* Create ClientCommandFactory, used by server to get useful informations about packet processing (sending).

Client.cpp:
* implement NetworkPacket ::Send interface.
* Move packet handlers to a dedicated file
* Remove Client::Send(SharedBuffer)

Server.cpp:
* implement NetworkPacket ::Send interface.
* Rewrite all packets using NetworkPacket
* Move packet handlers to a dedicated file
* Remove Server::Send(SharedBuffer)

ClientIface.cpp:
* Remove sendToAll(SharedBuffer<u8>)

Connection.hpp rework:
* Remove duplicate include
* Remove duplicate negation
* Remove a useless variable
* Improve code performance by using a m_peers_list instead of scanning m_peers map
* Remove Connection::Send(SharedBuffer)
* Fix useafterfree into NetworkPacket Sending
* Remove unused Connection::sendToAll

Test.cpp:
* Remove dead code
* Update tests to use NetworkPackets

Misc:
* add new wrappers to Send packets in client, using NetworkPacket
* Add NetworkPacket methods for Connection
* coding style fix
* dead code since changes cleanup
* Use v3s16 read instead of reading x,y,z separately in some packets
* Use different files to handle packets received by client and server
* Cleanup: Remove useless includes

ok @Zeno-
Tested by @Zeno- @VanessaE and @nerzhul on running servers
2015-02-16 11:00:55 +01:00
Craig Robbins
43bfdaab5f Remove workaround in itemdef.cpp to enable/disable/enable "enable_shaders" setting
* Increase performance (client)
* Avoid changing a global value to solve a local problem
2015-02-11 17:45:49 +10:00
Craig Robbins
92c52c10c0 Revert "Remove workaround in itemdef.cpp to enable/disable/enable "enable_shaders" setting"
This reverts commit d25ff8fd2592f457b91e8a61240694af3902d23f.
2015-02-11 17:01:19 +10:00
Craig Robbins
da65100b53 Remove workaround in itemdef.cpp to enable/disable/enable "enable_shaders" setting
* Increase performance (client)
* Avoid changing a global value to solve a local problem
2015-02-11 16:02:16 +10:00
Loic Blot
d80a529d34 Network Layer 7 rework (Packet handling)
* Move networkcode to a dedicated directory
* Rename clientserver.h to network/networkprotocol.h (Better name) and sanitize some includes
* Create object NetworkPacket
  * It stores command (opcode) and data separated
  * It also stores peer_id
  * Data reading can be done by using a streaming interface
* Change packet routing analysis
  * Remove old conditional analysis
  * Now uses function pointed analysis and add connection state ({Client,Server}::handlers)
  * Connection state permit to categorize condition to handle before analyze packets
  * Create a handler for depreciated messages, instead of duplicating code
2015-02-10 20:04:08 +10:00
ShadowNinja
0a2e53077b Reduce gettext wide/narrow and string/char* conversions 2015-02-05 03:24:22 -05:00
Craig Robbins
13cd83962f Fix local map saving when joining a local server from the server tab
Disables local map saving for all local server types

See: https://github.com/minetest/minetest/issues/2024
2015-01-31 00:42:08 +10:00
sapier
3bba80cbc2 Fix memory leaks due to messed up memory handling for particles as well as their spawners 2015-01-09 15:23:49 +01:00
kwolekr
bcf72f8481 NodeResolver: Perform callback immediately if node registration phase finished
Also add NodeResolver callbacks on the client
2015-01-04 16:32:31 -05:00
sapier
6736de24c6 More consistent progress bar from 0-100 on startup 2015-01-02 17:53:42 +01:00
ShadowNinja
617537325c Fix missing call to std::ostringstream::str 2014-12-12 16:32:11 -05:00
Anton
420b5ec08c Use std::string::empty() instead of size() where applicable 2014-12-12 15:16:24 -05:00
RealBadAngel
b16a3788d5 Fix lighting artifacts (Issue #1887). 2014-12-08 08:53:31 +01:00
Craig Robbins
0be778ad52 Performance of main client loop up to 2x faster In places, up to 3 times faster
NOTE 1: This does not mean a 2x increase in framerate. Increase in fps may be up to 1-2fps
NOTE 2: This local 'caching' of settings is not optimal and an alternative solution will be worked on after 0.4.11 is released
2014-12-07 00:51:01 +10:00
Craig Robbins
203dfd7e80 Fix node 0,0,0 being highlighted when enable_node_highlighting == false
Without this patch node 0,0,0 is highlighted when enable_node_highligting is false
There is a minor lighting issue remaining, however it seems to be related to a different bug (https://github.com/minetest/minetest/issues/1887)
2014-12-01 22:13:21 +10:00
sapier
794909cbe8 Implement proper font handling 2014-11-30 17:50:09 +01:00
Craig Robbins
cc53cc316c Fix client "double saving" simple singleplayer local maps 2014-11-26 00:49:54 +10:00
sfan5
120a177e08 Add (optional) client-side saving of server map to disk 2014-11-19 15:11:23 +01:00
RealBadAngel
fecad5fb24 Speed up removing a node (less block mesh updates). 2014-11-08 21:04:30 +01:00
RealBadAngel
8ddf8a4022 Recalculate normals for cached meshes.
Check if mesh is here before adding to meshcollector.

Fix deleting the meshes.
2014-10-21 18:43:29 +02:00
Craig Robbins
df5491d040 Various uninitialised variable fixes
sky.cpp: m_bgcolor.getAlpha() was being used before initialised

mesh related: m_highlight_mesh_color was being used uninitialised
2014-10-19 15:33:08 +02:00
RealBadAngel
1c09928344 Add meshnode drawtype. 2014-10-18 16:42:23 +02:00
ShadowNinja
4d2318b576 Simplify player modification checks 2014-10-01 18:44:36 -04:00
ShadowNinja
dbf9e444b1 Split settings into seperate source and header files
This also cleans up settings a bit
2014-09-21 14:39:35 -04:00
BlockMen
f77a8a9408 Allow taking screenshots of formspecs and move message to chat 2014-09-21 19:15:48 +02:00
RealBadAngel
61b86590fc Node highlighting. 2014-09-17 22:06:13 +02:00