Commit Graph

329 Commits

Author SHA1 Message Date
sfan5 a08251a61e Log protocol ver on mismatched client connect too 2020-05-16 12:03:36 +02:00
sfan5 d76785b4c7
network: Replace a fatal_error with just error logging 2020-05-14 21:18:26 +02:00
Wuzzy 6e1372bd89
Add support for statbar “off state” icons (#9462)
This adds support for optional “off state” icons for statbars. “off state icons” can be used to denote the lack of something, like missing hearts or bubbles.

Add "off state" textures to the builtin statbars.

Co-authored-by: SmallJoker <mk939@ymail.com>
2020-05-11 21:40:45 +02:00
Loïc Blot 454dbf83a9
Server class code cleanups (#9769)
* Server::overrideDayNightRatio doesn't require to return bool
There is no sense to sending null player, the caller should send a valid object

* Server::init: make private & cleanup
This function is always called before start() and loads some variables which can be loaded in constructor directly.
Make it private and call it directly in start

* Split Server inventory responsibility to a dedicated object

This splits permit to found various historical issues:
* duplicate lookups on player connection
* sending inventory to non related player when a player connects
* non friendly lookups on detached inventories ownership

This reduce the detached inventory complexity and also increased the
lookup performance in a quite interesting way for servers with thousands
of inventories.
2020-05-07 22:38:41 +02:00
sfan5 d1c6cc72cc
Server: Improve some log messages (#9820) 2020-05-05 17:05:11 +02:00
SmallJoker cad5b987ad Sky API: Rename *_tint to fog_*_tint for consistency 2020-05-05 08:37:04 +02:00
ANAND e0ea87f1f3
set_fov: Add support for time-based transitions (#9705) 2020-05-02 12:52:11 +02:00
sfan5 ac368af4fe
Allow connection info to be missing from minetest.get_player_information() (#9739)
fixes #9352
This reverts commit 23c907befe.
2020-05-01 21:44:28 +02:00
EvidenceB Kidscode cee3c5e73d
Add server side translations capability (#9733)
* Add server side translations capability
2020-04-25 07:20:00 +02:00
sfan5 8ef239b448
Improve protocol-level receiving code (#9617) 2020-04-20 23:22:00 +02:00
HybridDog 7b57d3f613
serverpackethandler: Reduce pkt->getPeerId() invocations and more (#9689) 2020-04-18 17:19:53 +02:00
DS 0ac999ded7
Add scroll_container formspec element (redo) (#9101)
New formspec elements:

 - `scroll_container[<X>,<Y>;<W>,<H>;<scrollbar name>;<orientation>;<scroll factor>]`
 - `scroll_container_end[]`

Other elements can be embedded in this element. Scrollbar must be placed manually.
2020-04-13 10:50:07 +02:00
Loic Blot 894a34aef4 Move PlayerSAO to dedicated files 2020-04-11 16:07:17 +02:00
Loïc Blot f648fb76ae
Drop genericobject.{cpp,h} (#9629)
* Drop genericobject.{cpp,h}

This file is not for generic object but for ActiveObject message passing.
Put ownership of the various commands to the right objects and cleanup the related code.

* Protect ServerActiveObject::m_messages_out

* typo fix
2020-04-10 19:49:20 +02:00
sfan5 de73f989eb
Overall improvements to log messages (#9598)
Hide some unnecessarily verbose ones behind --trace or disable them entirely.
Remove duplicate ones. Improve their contents in some places.
2020-04-08 20:13:23 +02:00
sfan5 3494475df1
Miscellaneous networking improvements (#9611)
fixes #2862
2020-04-08 20:12:58 +02:00
SmallJoker a0998754a7
Connection: Fix deadlock in debug mode (#9550) 2020-03-26 19:13:50 +01:00
Wuzzy 625b100593
Add comments for translators (#9510)
* Add translator comments for "special" strings

* Add translator comments for some "tricky" strings
2020-03-20 09:41:07 +01:00
SmallJoker 23c907befe Workaround for get_player_information
'-1' as value is handled as an error. If there are no RTT updates upon fast connect, set_player_information returned nil.
2020-03-08 13:21:15 +01:00
sfan5 9ca0b3739c
Fix memory leak in protocol 38 set_sky 2020-03-05 22:36:21 +01:00
sfan5 e774d8ca2f Fixes around ServerActiveObject on_punch handling 2020-03-05 22:04:23 +01:00
Jordach 946c03c69b set_sky improvements, set_sun, set_moon and set_stars 2020-03-05 20:12:19 +01:00
Warr1024 244121b964
Allow texture modifiers in hotbar textures. (#9271) 2020-02-26 10:26:24 +01:00
sfan5 ace3c76112 Improve core.sound_play with ephemeral sounds and player exclusion 2020-02-01 20:31:41 +01:00
Hugues Ross 680aaa1bd5 Make clipping of formspec elements more consistent (#9262) 2020-01-16 18:41:07 +00:00
DS 8f73ec6c6c Formspec: make bgcolor element less confusing and allow setting fullscreen color (#8996) 2019-12-08 18:59:30 +01:00
Pierre-Yves Rollo cf7fda0083 Add z-index management to HUD 2019-12-06 20:31:26 +00:00
sfan5 c10952b574 Rework packet receiving in ServerThread
Notably it tries to receive all queued packets
between server steps, not just one.
2019-11-19 20:27:20 +01:00
sfan5 4d668f32a6 Call on_secondary_use when object is right-clicked 2019-11-10 13:12:31 +01:00
DS 5506e97ed8 Formspec: draw order and clipping for all elements (#8740) 2019-11-07 20:11:01 +01:00
sfan5 d77ea76476
Fix broken build
The variable name changed but this didn't cause merge conflicts, so it wasn't caught before.
2019-09-23 00:28:26 +02:00
sfan5 70f9e1aafa
Punchwear (improved) (#8959) 2019-09-22 22:12:21 +02:00
SmallJoker 5fa614d97e
Wieldhand: Specify which ItemStack to use (#8961)
Makes 'get_wield_item' to return the "main" ItemStack
2019-09-21 11:44:24 +02:00
Anand S 47da640d77 Add support for per-player FOV overrides and multipliers 2019-09-19 20:14:16 +02:00
sfan5 5c9983400f Remove incorrect MutexAutoLock
The line declared a variable "m_con" instead of locking m_con.
getClient() doesn't need this anyway, so remove it.
2019-09-19 16:46:41 +02:00
SmallJoker 1de4ca1f9d Built-in formspecs: Force version 1 2019-09-14 20:42:54 +02:00
ANAND 81c7f0ae04 Send ActiveObjects once right after Init2 2019-09-14 20:16:55 +02:00
SmallJoker 9acd36bf99 Formspecs: Introduce formspec_version to mods 2019-09-14 19:43:08 +02:00
SmallJoker 23677be951 Load CSM environment after the restrictions are known
Safety-guards for CSM callbacks to abort on a bad implementation
Only run callbacks when the mods are loaded (and with it: builtin)

Duplication checks inside constructors
2019-09-14 19:42:25 +02:00
SmallJoker fae6242d4e Send cumulated inventory changes only each step (#8856)
Applies to player and detached inventories
2019-09-09 19:19:54 +02:00
SmallJoker 0b4f424f41
Inventory: Send dirty lists where appropriate (#8742)
This change reduces the amount of sent data towards clients. Inventory lists that are already known to the player are skipped, saving quite some data over time.

Raises protocol version to 38 to ensure correct backwards-compatible code.
2019-08-24 19:07:38 +02:00
sfan5 13b22e2afb Remove unused function in ReliablePacketBuffer 2019-08-16 20:03:53 +02:00
sfan5 428a4c86e3 Minor refactor of IncomingSplitBuffer 2019-08-16 20:03:53 +02:00
sfan5 fc2f55d931 Drop m_list_size from ReliablePacketBuffer
It's not required and, worse, can lead to bugs.
2019-08-16 20:03:53 +02:00
sfan5 2db0e93f73 network: Stricter handling of split packets 2019-08-15 20:15:22 +02:00
sfan5 c4491165da network: Fix crash in ReliablePacketBuffer on mismatching packets
In the error condition the exception would be thrown before m_list_size
is decremented, causing a nullptr dereference in e.g. popFirst().
2019-08-15 19:18:54 +02:00
SmallJoker 539f016c1b
Better F6 profiler (#8750)
Update the profiler names to make more sense of what they actually represent
Move the profiler code from header to its source file
Use monospace font to align lines
Format the statistics line to align better with surrounding values
Refresh the profiler each 3 seconds (roughly)
2019-08-13 19:56:55 +02:00
Jozef Behran 86d7f84b89 Merge pull request #8776 from osjc/FixGetNode
Finish getNode cleanup
2019-08-10 19:45:44 +02:00
sfan5 cf64054390 Implement adding velocity to player from Lua
The intended usecase is knockback, but there's potential for more.
2019-08-10 19:44:27 +02:00
ANAND e788ee283f Client::Interact: Use InteractAction enum instead of numeric constants
This replaces the magic numbers used as interaction modes both client-side and server-side, primarily for the sake of ease-of-readability.
2019-08-07 19:21:14 +02:00