384 Commits

Author SHA1 Message Date
lhofhansl
52bf98ff4c Optimize/adjust blocks/ActiveObjects sent at the server based on client settings. (#4811)
Optimize/adjust blocks and active blocks sent at the server based on client settings.
2016-11-30 18:13:14 +10:00
raymoo
7c4f76cca7 Add control information to player interacts (#4685) 2016-11-12 17:22:39 +10:00
Loic Blot
94cfb9ae7c Environment cleanup
* Move client list to ServerEnvironment and use RemotePlayer members instead of Player
* ClientEnvironment only use setLocalPlayer to specify the current player
* Remove ClientEnvironment dead code on player list (in fact other players are CAO not Player objects)
* Drop LocalPlayer::getPlayer(xxx) functions which aren't used.
* Improve a little bit performance by using const ref list for ClientEnvironment::getPlayerNames() & Client::getConnectedPlayerNames()
* Drop isLocal() function from (Local)Player which is not needed anymore because of previous changes

This change permits to cleanup shared client list which is very old code.
ClientEnvironment doesn't use player list anymore, it only contains the local player, as addPlayer is only called from Client constructor client side.
Clients are only CAO on client side, this cleanup permit to remove confusion about player list.
2016-10-09 15:17:10 +02:00
Loic Blot
3558ac7829 More code cleanup (UNORDERED + RemotePlayer/LocalPlayer)
* ClientEnvironment now uses UNORDERED MAP for active objects
* Use RemotePlayer and LocalPlayer everywhere it's possible
* Minor code style fixes
* Drop Client::getBreath() unused function
2016-10-08 22:27:44 +02:00
Loic Blot
d28e980e7c Player/LocalPlayer/RemotePlayer inheritance cleanup (part 2 on X)
* Server/Client Environments now have an helper to cast Player object in the right type to use it
* Server: use RemotePlayer everywhere and remove previous added casts
* Client: use LocalPlayer where needed
* Environment: remove unused functions (getPlayers(), getRandomConnectedPlayer(), getNearestConnectedPlayer())
2016-10-08 15:57:50 +02:00
Loic Blot
2b5c276768 Use more unordered_maps to improve performance in c++11 builds 2016-10-06 12:33:35 +02:00
Loic Blot
17bad192fe Replace various std::map with UNORDERED_MAP + various cleanups
This is part 2 for 5f084cd98d7b3326b51320455364337539710efd

Other improvements:

* Use the defined ItemGroupList when used
* make Client::checkPrivilege const
* inline some trivial functions
* Add ActiveObjectMap typedef
* Add SettingsEntries typedef
2016-10-05 10:53:19 +02:00
Rogier-5
abac6acd29 Use the standard to_string() functions for C++11 (#4279)
If compiling according to a C++ version before C++11, then define
std::to_string ourselves.

Add a to_wstring version as well

As std::to_string() for floating point types uses %.6f as floating
point format converter, instead of %G, it needs special care.

To preserve ftos() behavior (which is expected to use the %G format
converter), it no longer uses to_string().
2016-08-11 19:22:40 +02:00
Maksim Gamarnik
6d3bdc5a7d Merge 2016-04-12 21:28:50 +03:00
kwolekr
81e06b1f01 Hud: Cache hud_scaling, fix minor style issues 2016-04-10 23:54:34 -04:00
Maksim Gamarnik
f56e578960 Merge remote-tracking branch 'upstream1/master' 2016-03-21 01:45:56 +02:00
est31
a334f5f527 Add option to not send pre v25 init packet
The legacy init packet (pre v25) sends information about the client's
password that a server could use to log in to other servers if the
username and password are the same. All the other benefits of SRP of
protocol v25 are missed if the legacy init packet is still sent during
connection creation.

This patch adds an option to not send the v25 init packet. Not sending
the v25 packet means breaking compat with pre v25 servers, but as the
option is not enabled by default, no servers are affected unless the
user explicitly flips the switch. More than 90% of the servers on the
serverlist support post v25 protocols.

The patch also fixes a bug with greying out of non compliant servers
being done wrongly, the min and max params were mixed.
2016-03-15 17:20:09 +01:00
est31
a60976e0cf Much better API for auth.{cpp, h}
* No function overloading
* Adhere coding style and with method names following
  lowercase_underscore_style
* Use std::string in external API, handling these is
  much more fun
2016-03-15 05:55:49 +01:00
Maksim Gamarnik
8f6ddcc57c Merge branch 'upstream/master' 2016-03-14 11:44:17 +02:00
Diego Martinez
d5c0e09d40 Add options for screenshot format and quality 2016-03-12 17:12:43 -05:00
Maksim Gamarnik
be288f1c52 Merge 2016-02-23 00:40:02 +02:00
RealBadAngel
226be7bc32 Remove preload_item_visuals code
Closes #3748
2016-02-21 17:46:50 +01:00
Maksim Gamarnik
3efde6c9c3 Merge remote-tracking branch 'upstream/master' 2016-02-19 00:39:50 +02:00
RealBadAngel
e0f29ab7d3 Move object nametags to camera 2016-02-18 16:43:29 +01:00
Maksim Gamarnik
dc1e041b26 Merge 2016-02-16 16:38:32 +02:00
RealBadAngel
26e91b396d Use vertices with tangents only when its needed. 2016-02-15 06:05:39 +00:00
Maksim Gamarnik
d7c0fad71f Merge Minetest commits 2016-02-11 22:35:23 +02:00
nerzhul
c4bf66116d v2d & aabbox3d<f32> & sky cleanups
* Sky: rename Box => m_box and inline getBoundingBox
* Uniformize aabbox3d<f32> to aabb3f
2016-02-11 16:55:15 +01:00
Maksim Gamarnik
2ba90de7d4 Merge Part 2/2
Halo enabled! :)
2016-02-09 00:42:28 +02:00
RealBadAngel
8b602bba0f Cleanup selection mesh code, add shaders for halo and selection boxes 2016-02-08 03:57:42 -05:00
Maksim Gamarnik
1797862bf9 Merge 2015-12-06 15:00:12 +02:00
Alex Ford
3d8a7bc124 Add on_secondary_use when right clicking an item in the air 2015-12-02 02:18:44 +00:00
Maksim Gamarnik
919be490f9 Update
Sync all Minetest commits
2015-11-10 13:49:24 +02:00
ShadowNinja
85dbe50ec1 Rename macros with two leading underscores
These names are reserved for the compiler/library implementations.
2015-10-14 02:39:37 -04:00
est31
67c1695c16 Fix some SRP issues
-> Remove memory allocation bugs
-> Merge changes from upstream, enabling customizeable memory allocation
2015-09-30 09:19:40 +02:00
est31
9e5c0119da Hide minimap if it has been disabled by server 2015-09-01 19:00:33 +02:00
David Jones
9d1284b324 Change i++ to ++i 2015-08-25 18:33:52 -04:00
ShadowNinja
098d28aa5e 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
Maksim Gamarnik
9247f32e0e LGPL 2.1 to 3.0 on all files 2015-08-14 01:26:28 +03:00
est31
143d1f6835 Add count based unload limit for mapblocks 2015-08-13 07:56:07 +02:00
Břetislav Štec
563d8138ea src/client.cpp: Fix mapper memory leak 2015-08-02 02:15:38 -04:00
Břetislav Štec
d1e322facf Fixed minimap memory leak 2015-07-27 11:06:46 -04:00
est31
c3162ae744 Fix srp.cpp:815 leak
Thanks @Zeno-
2015-07-27 08:15:39 +02:00
est31
713002778f Optional reconnect functionality
Enable the server to request the client to reconnect.

This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting.
2015-07-23 07:38:13 +02:00
Kahrl
aba75ee5bb Display an access denied message when client detects a server timeout 2015-07-17 12:06:30 +02:00
kwolekr
9aadb44895 Clean-up Minimap code
- Fixed race conditions
- Fixed null dereference
- Fixed out-of-bounds array access
- MinimapMapblock is now allocated and added to update queue only when enabled
- Removed dependency on LocalPlayer
- Fixed code style
- Simplified expressions and program logic
- Cleaned minimap object interfaces
2015-07-08 01:50:31 -04:00
est31
991448706d Client: better m_proto_ver initialisation
Previously, m_proto_ver was set to the serialisation version
inside the legacy init packet.

Now, if the server doesn't send a protocol version (protocols < 25),
we set m_proto_ver to some value < 25 and > 0.
2015-07-07 17:03:26 +02:00
est31
0ef3a70c40 Add UpdateThread and use it for minimap and mesh threads 2015-06-29 15:00:19 +02:00
RealBadAngel
15bbb593e4 Add minimap feature 2015-06-27 03:42:01 +02:00
est31
daca6875e6 Return to ignore 2015-06-24 22:47:41 +02:00
kwolekr
a8e64001ff Replace instances of std::map<std::string, std::string> with StringMap
Also, clean up surrounding code style
Replace by-value parameter passing with const refs when possible
Fix post-increment of iterators
2015-05-31 23:21:19 +10:00
rubenwardy
6666d8ab42 Add texture overriding 2015-05-31 23:21:17 +10:00
est31
2a58ad066a Finalize init packets and enable protocol v25
This enables srp.
2015-05-31 23:16:28 +10:00
est31
69bda0a70f Make early protocol auth mechanism generic, and add SRP
Adds everything needed for SRP (and everything works too),
but still deactivated, as protocol v25 init packets aren't final yet.
Can be activated by changing the LATEST_PROTOCOL_VERSION header to 25
inside networkprotocol.h.
2015-05-31 23:14:05 +10:00
kwolekr
4df33b90e5 Replace instances of std::map<std::string, std::string> with StringMap
Also, clean up surrounding code style
Replace by-value parameter passing with const refs when possible
Fix post-increment of iterators
2015-05-19 16:10:49 -04:00