106 Commits

Author SHA1 Message Date
gregorycu
dd4390dd36 Optimize Profiler::avg() 2015-03-07 20:04:01 -05: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
Craig Robbins
45eb41c599 Fix wrapDegrees family of functions
wrapDegrees() (renamed to modulo360f)
wrapDegrees_0_360
wrapDegrees_180

Minor errors were present in previous versions; see issue #2328
2015-02-23 22:50:32 +10:00
Loic Blot
12d7ac0fec Fix some memory leaks on packet sending. 2015-02-21 17:27:31 +01:00
Loic Blot
e329b0c079 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
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
Loic Blot
0f943ab03d Fix unit test if there isn't a localhost address (for example FreeBSD jails), second part 2015-02-15 14:30:34 +00:00
Loic Blot
b660410de1 Fix unit test if there isn't a localhost address (for example FreeBSD jails) 2015-02-15 13:11:03 +01:00
Loic Blot
967adfd9b7 Only do the IPv6 unit test if IPv6 is enabled 2015-02-15 12:20:37 +01: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
Craig Robbins
1c460c3bc3 Create empty default constructor for MapNode 2015-01-18 13:39:50 +10:00
ShadowNinja
3394520db4 Deduplicate code and use stdlib in string functions 2015-01-03 14:50:16 -05:00
kwolekr
8dad84da88 Print unit test failures to dstream 2014-12-29 02:30:03 -05:00
Kahrl
339bdb4d43 Fix weird (and wrong) comment in test.cpp 2014-12-21 13:20:42 +01:00
kwolekr
738c429dc1 Log: Silence errorstream during unittests 2014-12-12 15:51:55 -05:00
kwolekr
4433cb3626 Settings: Fail on invalid sequence and throw exception for LuaSettings 2014-12-12 00:44:17 -05:00
kwolekr
aae5e41aa5 Add support for lacunarity in legacy NoiseParams string format 2014-12-10 01:31:43 -05:00
kwolekr
4119cf9f6d Settings: Sanitize setting name everywhere, not just LuaSettings 2014-12-09 23:52:13 -05:00
kwolekr
bb90f4a321 Settings: Make setting entry group and values mutually exclusive
This greatly reduces the complexity of Settings code.
Additionally, several memory leaks were fixed.
2014-12-09 23:29:34 -05:00
kwolekr
22b22968a1 Add flags and lacunarity as new noise parameters
Add 'absolute value' option to noise map functions
Extend persistence modulation to 3D noise
Extend 'eased' option to noise2d_perlin* functions
Some noise.cpp formatting fixups
2014-12-07 21:59:32 -05:00
SmallJoker
30a051a904 Fix MSVC build
Note: The unit test was technically incorrect for all platforms but passes due to implicit casting
2014-12-05 16:09:53 +10:00
kwolekr
b932f38797 Settings: Various setting group fixes and enhancements
- Remove blank setting values when setting has a group
 - Pair setting values with groups in file when possible
 - Preserve user-set whitespace in setting objects
 - Delete setting value when setting NoiseParams group
 - Delete overwritten groups outside of lock
2014-12-04 03:20:07 -05:00
kwolekr
3eee8323c9 Use setting groups for NoiseParams
Add format example to minetest.conf.example
Add Settings::setU16()
Throw exception on attempted access of NULL settings groups
2014-12-02 04:03:37 -05:00
kwolekr
fa458443f0 settings: Add setting groups and multiline entries 2014-11-30 16:11:21 -05:00
Kahrl
c33891174d 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
Craig Robbins
ab8deee11a Cleanup and (mostly) document util/string.h and (very) minor refactoring
Updated: Incorporated feedback from 'kahrl'
Updated: Moved MinetestApp::boolToCStr() from game.cpp into string.h renaming it bool_to_cstr()
2014-11-02 18:07:20 +01:00
Craig Robbins
68c5101db3 Fix unit tests failing if IPv6 not available
See:
https://github.com/minetest/minetest/issues/1526
https://github.com/minetest/minetest/issues/793
2014-11-02 02:27:26 -05: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
sapier
19ef2554b6 Don't handle lack of IPv6 as fatal in unit tests 2014-06-20 22:35:50 +02:00
ShadowNinja
24cc512b16 Add the option to bind to a specific address 2014-02-05 21:24:46 +01:00
Kahrl
7b8553cacf Implement urlencode and urldecode 2013-12-13 18:05:35 +01:00
Kahrl
ee90d438b8 Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00
proller
f821824943 Weather backward compatibility 2013-08-02 00:51:36 +04:00
Kahrl
03631ae5f7 Change ContentFeatures array to a vector 2013-07-14 23:06:31 +02:00
PilzAdam
aa0b76636f Settings: everything != 0 equals true; remove .asm shaders 2013-07-08 01:58:49 +02:00
sapier
62794622d6 Replace C++ mainmenu by formspec powered one 2013-07-02 19:58:20 -04:00
proller
06ddcb4b1e Add support for IPv6
Two new configuration options are added:
     - "enable_ipv6" to enable/disable the overall use of IPv6
     - "ipv6_server" to enable/disable the use of IPv6 sockets when running
       a server (when "enable_ipv6" is enabled)
2013-06-23 11:31:22 +04:00
Kahrl
ffac1bef30 Extend a delay in TestConnection from 50 to 100 milliseconds.
The 50 ms delay causes frequent test failures on certain systems with
slow network stacks, these failures go away with the 100 ms variant.
2013-06-17 02:09:50 +02:00
kwolekr
76c6a6c017 Fix nearly all warnings 2013-05-19 21:26:56 -04:00
PilzAdam
fd1b6c39a4 Fix memory leak in run_tests() 2013-05-14 12:29:30 +02:00
sapier
5a10a4657a fix various memory leaks 2013-04-09 02:23:07 -04:00
Ilya Zhuravlev
a12df55f29 Migrate to STL containers/algorithms. 2013-03-11 19:08:39 -04:00
kwolekr
2de944c208 Fix most warnings, re-fix MSVC compile error 2013-02-26 01:57:59 -05:00
Sfan5
3fab3825aa Update Copyright Years 2013-02-24 20:15:24 +01:00
PilzAdam
269f01224b Change Minetest-c55 to Minetest 2013-02-24 18:49:03 +01:00
Perttu Ahola
d0dff79761 Ranged support of protocol version on server side 2012-11-29 22:08:25 +02:00
Perttu Ahola
cfba662b99 unit test: TestNodedefSerialization 2012-11-29 22:08:25 +02:00
Ilya Zhuravlev
d7cc000a0c Add InventoryList width property & allow custom crafting grids. 2012-09-01 10:01:41 +03:00
Perttu Ahola
56e361e135 Fix terrible grammar in comment! 2012-07-22 20:36:06 +03:00
Perttu Ahola
d6998afda6 Test zlib wrapper's handling of large data 2012-07-22 20:27:55 +03:00