Commit Graph

284 Commits

Author SHA1 Message Date
kwolekr 8e08e92eb4 Cherry-pick most commits since 15c0376
Commits not directly related to network changes were cherry-picked
on a best-effort basis, as some cause difficult merge conflicts.

Commits skipped over:
0d1eedcccc
aa474e4501
82482ecd9d
b214cde5b4
2066655aae
7e088fdfe3
40bf1d7b5f
1b2f64473e
7e56637ed0
64ff966bae
51057a56f5
009149a073
cf4045ff0f
e357577cb2
49f84b76bc
b019221c30
7880ff74b6
146f77fdb7
a704c04f00

Commits with conflicts:
038d3a31df
e9eda2b0d0
708337dfc2 ~~ modified client.cpp manually; shadow changes to packethandlers/client.cpp
36e8ba9ce2 ~~ modified main.cpp manually; add ALLOW_ZWRITE_ON_TRANSPARENT set
3b6480c5b0 ~~ modified server.cpp manually; change wrapDegrees -> modulo360f
5a5854ea9d
c09d026f05
3c91ad8fc2
2015-03-07 16:25:50 -05:00
kwolekr 32352e90da Revert all commits up to (including) a704c04f 2015-03-07 16:16:25 -05:00
Loic Blot 0d1eedcccc Replace std::list to std::vector into tile.cpp (m_texture_trash) and move tile.hpp to src/client/ 2015-03-05 11:59:40 +01:00
Loic Blot 3998a1f8f9 Move sha1.hpp and base64.hpp to util/ 2015-02-21 14:03:27 +01:00
Loic Blot cf4045ff0f Use proper CMakeLists.txt for network and client directories 2015-02-21 11:51:12 +01:00
Loic Blot b3aeba684b Unit tests must be done at integration process.
* Remove --enable-unittests and --disable-unittests and add --do-unittests function
* --do-unittests function will exit 0 on success.
* minetest and minetestserver binaries are launched with --do-unittests in travis build.
2015-02-21 11:04:19 +01:00
Loic Blot ed04e8e9e4 [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
Loic Blot 146f77fdb7 main.cpp rework * Move ClientLauncher class to a dedicated file * ClientLauncher now owns print_video_modes and speed_tests functions (they are only called by him) * Move GameParams to shared/gameparams.h because it's shared between server and client and launcher need to know it * Move InputHandlers class to client/inputhandler.h * Cleanup includes 2015-02-12 15:00:03 +01:00
Loic Blot a704c04f00 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
kwolekr 43f102271d Create minidump on fatal Win32 exceptions
Remove software exception translator function, simplifying exception handler
macros.  FatalSystemExceptions are left unhandled.
2015-02-02 01:39:17 -05:00
kwolekr 38bd9e93a2 Fix all warnings and remove -Wno-unused-but-set cflag 2015-01-18 23:29:19 -05:00
kwolekr e36681101e Add SemiDebug (-O1 with debug symbols) build mode and do not optimize Debug at all
Add -Wall to Debug modes for all compilers and -Wabi for non-MSVC
Use /Ox for MSVC Release mode (potentially higher optimization than /O2)
2015-01-18 22:30:11 -05:00
kwolekr 6e9f287844 Revert "Fix bug in debug build"
This reverts commit 839c4a99cd.
2015-01-18 13:19:28 -05:00
Craig Robbins 839c4a99cd Fix bug in debug build
-O1 results in executables that are completely useless for actuall debugging
2015-01-19 00:26:59 +10:00
sfan5 8089d89a51 Set default value for ENABLE_REDIS to 0 2015-01-10 15:28:25 +01:00
ShadowNinja a3db918f78 Remove included SQLite3 2015-01-08 16:34:42 -05:00
sfan5 d8cf64a202 Add SQLite3 libraries to buildbot 2015-01-08 16:34:42 -05:00
Craig Robbins 3993102e88 Fix -Wtype-limits warnings and remove disabling of -Wtype-limits 2014-12-29 23:56:40 +10:00
kwolekr 565959db86 Silence misc. warnings 2014-12-23 01:09:50 -05:00
sfan5 4fcf9fb66a Add workaround for failing clang build 2014-12-06 19:56:31 +01:00
sapier dceb9f7d60 Implement proper font handling 2014-11-30 17:50:09 +01:00
Pavel Puchkin f7f24d1470 Fix compiling if no endian.h found
f7d6509 introduces error when no endian.h found in the system.

Since "CHECK_INCLUDE_FILE" returns empty string instead of "0", when
"cmake_config.h" is generated it has "#define CMAKE_HAVE_ENDIAN_H " line.
Later we have "#define HAVE_ENDIAN_H CMAKE_HAVE_ENDIAN_H" in the
"config.h", an thus "HAVE_ENDIAN_H" is also empty sting. Because of
this, "#if HAVE_ENDIAN_H" is incorrect preprocessor directive.

Signed-off-by: Craig Robbins <kde.psych@gmail.com>
2014-11-22 21:56:38 +10:00
Rafael Reilova f7d65091f8 serialize.h: use machine native byte swapping if available, fall-back to previous generic method if not (supported for GCC using endian.h, detection done in cmake) write/readARGB8() - just write 32-bit color in one op, instead of 4 1-byte ops cleanup: removed unneeded buffer init for some serialize-out functions use a #define for the fixed point factor in read/writeF1000()
nodemetadata.cpp, nodetimer.cpp
	optimzation: simpler deserialize node position method

staticobject.cpp:
	cleanup: use util/serialize.h inlines instead of its own de/serialization

serialize.cpp:
	minor optimization/cleanup: avoid generation of unneeded string temporary

CMakeLists.txt, cmake_config.h.in: detection of endian.h

config.h: added HAVE_ENDIAN_H

Commits due to feedback squashed

Signed-off-by: Craig Robbins <kde.psych@gmail.com>
2014-11-21 22:33:48 +10:00
Kahrl 9b551d5cbc Implement WieldMeshSceneNode which improves wield mesh rendering
- Don't create and cache an extruded mesh for every (non-node) item.
  Instead use a single one per image resolution.

- For cubic nodes reuse a single wield mesh too

- Improve lighting of the wielded item

- Increase far value of wield mesh scene camera, fixes #1770

- Also includes some minor refactorings of Camera and GenericCAO.
2014-11-08 23:11:57 +01:00
paramat 92981b2fee Add mgv5. New noise code, uses biome API. Eased 3d noise for terrain, caves, blobs 2014-11-08 21:37:26 +01:00
kwolekr 9e811a92e7 Split up mapgen.cpp 2014-11-01 13:16:23 -04:00
ShadowNinja 6bc4cad0ed Split settings into seperate source and header files
This also cleans up settings a bit
2014-09-21 14:39:35 -04:00
sfan5 17345404ba Add ZLIBWAPI_DLL and LEVELDB_DLL CMake options Remove legacy MINGWM10_DLL CMake option Update 32-bit buildbot (OpenAL updated, zlib updated) Change build directory for buildbots to '_build' to prevent removal of Android build files Use -win64 suffix for 64-bit Windows builds Fixes #1476 2014-07-29 20:03:18 +02:00
proller 2d90aca4ab Remove indev mapgen 2014-07-12 18:21:54 +04:00
proller 7df83c2c67 Remove math mapgen 2014-07-12 18:15:55 +04:00
sapier c39992e429 Copy zlib and freetype dll to windows package too 2014-06-29 19:36:51 +02:00
Martin Doege c410e9182d OS X compatibility fixes 2014-06-29 17:27:33 +02:00
sapier c0e4551249 Remove not really used guiTextInputMenu 2014-06-17 21:27:40 +02:00
sapier 7fba341dbb Works for debian and a few other distributions but fails for even more so back to old order
Revert "Fix library link order"
This reverts commit b743dcb942.
2014-05-25 01:14:47 +02:00
sapier b743dcb942 Fix library link order 2014-05-24 13:39:27 +02:00
sapier 09970b7b6d Add support for interlaced polarized 3d screens
Add (experimental) support for topbottom as well as sidebyside 3d mode
2014-05-18 01:08:13 +02:00
sapier 0d93119040 Replace deathscreen by formspec variant 2014-04-19 12:21:27 +02:00
Sfan5 674be38fc2 Add redis database backend 2014-04-16 22:05:06 +02:00
Sfan5 859287b027 Fix generating winresource.o with build dir != source dir 2014-03-11 17:48:34 +01:00
sapier a4e2198e41 Replace pause and message menu by formspec ones 2014-03-05 18:44:14 +01:00
sapier 3e52dd5c68 Improved win32 file version information 2014-03-02 23:49:19 +01:00
Sfan5 f6232d71b6 Fix test for broken LuaJIT versions, solves #1152 2014-02-23 18:30:45 +01:00
Sfan5 4585fba98b Fix broken cross-compiling 2014-02-16 08:07:57 +01:00
sapier 31ec14afe2 Add check to avoid usage of broken LuaJIT < 2.0.0beta8 2014-02-13 23:28:01 +01:00
sapier e258675eab Add propper client initialization
-add client states to avoid server sending data to uninitialized clients
  -don't show uninitialized clients to other players
  -propper client disconnect handling
Minor comment fixes in server
Minor bugfixes in connection
  -improved peer id calculation
  -honor NDEBUG flag
  -improved disconnect handling
  -increased initial send window
Remove some dead code
2014-01-31 18:44:43 +01:00
Sfan5 3875a77bf8 Fix curl dll not getting installed when sound is disabled 2014-01-21 13:35:26 +01:00
Kahrl 8966c16ad2 Add formspec table 2014-01-13 18:11:08 -05:00
hasufell 10eea107ed BUILD: fix cmake list parsing
because cmake is unable to parse it's own lists properly
2014-01-05 20:58:40 +04:00
hasufell cb7bb736c7 BUILD: prefer pkg-config for freetype2 detection
This can solve numerous problems such as:
http://www.cmake.org/Bug/view.php?id=13959
http://www.cmake.org/Bug/view.php?id=14601

If pkg-config or freetype2.pc is not found, then fall back to the
FindFreetype.cmake module logic.

Restrict to UNIX since I only tested it here.
2014-01-05 20:58:40 +04:00
Sfan5 160e2b7b7d Add option to link to OpenGL ES, fixes #1051 2014-01-05 20:50:55 +04:00