sfan5
0effd2e7a8
Clean up some auth packet handling related code
2022-05-08 17:57:02 +12:00
sfan5
33e2be6bd2
Fix password changing getting stuck if wrong password is entered once
2022-05-08 17:56:57 +12:00
sfan5
686a119e0f
Apply disallow_empty_password to password changes too
2022-05-08 17:56:52 +12:00
sfan5
d4b2acdecf
Fix race condition in registration leading to duplicate create_auth calls
2022-05-08 17:56:47 +12:00
luk3yx
f8f32cc628
Make protocol version <37 compatibility a setting
2022-04-08 18:58:07 +12:00
MoNTE48
d6b01ab8ef
Revert "Prevent interacting with items out of the hotbar ( #10359 )"
2021-11-16 01:09:50 +02:00
luk3yx
1aabc2ca14
Merge tag '5.4.1' into main
...
5.4.1
2021-06-08 10:37:38 +12:00
Lars Müller
847860fc5c
Block & report player self-interaction ( #11137 )
2021-04-05 16:01:27 +02:00
SmallJoker
77e936445f
Protect dropping from far node inventories
...
Also changes if/if to switch/case
2021-04-05 16:01:21 +02:00
SmallJoker
41beb74ef7
Protect per-player detached inventory actions
2021-04-05 16:01:15 +02:00
SmallJoker
7832b6843e
Server-side authority for attached players ( #10952 )
...
The server must have authority about attachments. This commit ignores any player movement packets as long they're attached.
2021-02-15 20:41:19 +01:00
MoNTE48
2aa0400bd2
Backport MultiCraft Engine changes
2021-02-14 09:58:28 +01:00
sfan5
674d67f312
Encode high codepoints as surrogates to safely transport wchar_t over network
...
fixes #7643
2021-02-02 20:46:08 +01:00
sfan5
c834d2ab25
Drop wide/narrow conversion functions
...
The only valid usecase for these is interfacing with OS APIs
that want a locale/OS-specific multibyte encoding.
But they weren't used for that anywhere, instead UTF-8 is pretty
much assumed when it comes to that.
Since these are only a potential source of bugs and do not fulfil
their purpose at all, drop them entirely.
2021-02-02 20:46:08 +01:00
SmallJoker
7ebd5da9cd
Server GotBlocks(): Lock clients to avoid multithreading issues
2021-02-02 19:10:35 +01:00
sfan5
112a6adb10
Cache client IP in RemoteClient so it can always be retrieved ( #10887 )
...
specifically: after the peer has already disappeared
2021-01-31 20:36:47 +01:00
luk3yx
7b37f2c1d8
Re-add protocol v25-33 support for servers.
2021-01-19 13:24:17 +01:00
sfan5
74762470b2
Fix some minor code issues all over the place
2020-12-24 13:44:54 +01:00
sfan5
ad58ece180
serverpackethandler: Minor log message fixes
...
closes #10434
2020-11-12 21:08:26 +01:00
rubenwardy
7589cbe086
Fix object interaction distance not being checked ( #10547 )
2020-11-09 11:55:15 +01:00
SmallJoker
0d128ab344
Inventory: Protect Craft and Drop actions ( #10353 )
...
Change dangerous pointer to unique_ptr for automated deletion.
2020-09-07 21:19:38 +02:00
Lejo
6dcc9e6331
Prevent interacting with items out of the hotbar ( #10359 )
2020-09-04 20:50:33 +02:00
HybridDog
f5df70764d
[2] Code cleanup in serverpackethandler ( #9349 )
...
* Code cleanup in serverpackethandler
* do not define p_under unless a node is pointed
* use switch-case and reduce indentation
2020-09-01 08:08:18 +02:00
Lars Müller
3693b6871e
Prevent players accessing inventories of other players ( #10341 )
2020-08-29 16:41:03 +01:00
MoNTE48
2f9205c23d
License upgrade to GNU Lesser General Public License 3.0+
2020-08-28 18:31:02 +02:00
ANAND
291a6b70d6
Allow binding dig, place actions to keys; remove LMB/RMB hardcoding
...
Co-authored-by: Sam Caulfield <sam@samcaulfield.com>
2020-08-15 12:19:20 +03:00
Lars Müller
e7e065f553
Exposing the zoom key to Lua API ( #9903 )
...
Co-authored-by: Raul Ferriz <raul.ferriz@gmail.com>
2020-06-13 22:46:20 +02:00
sorcerykid
15ba75e4cf
Add on_authplayer callback and 'last_login' to on_joinplayer ( #9574 )
...
Replace on_auth_fail callback with more versatile on_authplayer
Better clarify account login process in Lua API documentation
Change initial timestamp for newly registered accounts to -1
2020-05-23 13:25:29 +02:00
sfan5
a08251a61e
Log protocol ver on mismatched client connect too
2020-05-16 12:03:36 +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
EvidenceB Kidscode
cee3c5e73d
Add server side translations capability ( #9733 )
...
* Add server side translations capability
2020-04-25 07:20:00 +02:00
HybridDog
7b57d3f613
serverpackethandler: Reduce pkt->getPeerId() invocations and more ( #9689 )
2020-04-18 17:19:53 +02:00
Loic Blot
894a34aef4
Move PlayerSAO to dedicated files
2020-04-11 16:07:17 +02:00
sfan5
e774d8ca2f
Fixes around ServerActiveObject on_punch handling
2020-03-05 22:04:23 +01:00
sfan5
4d668f32a6
Call on_secondary_use when object is right-clicked
2019-11-10 13:12:31 +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
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
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
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
Jozef Behran
86d7f84b89
Merge pull request #8776 from osjc/FixGetNode
...
Finish getNode cleanup
2019-08-10 19:45:44 +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
SmallJoker
e462a9a5ef
Unify wield item handling ( #8677 )
...
This moves the wield item functions to Player and the tool utils for range calculation
Also 'local_inventory' was removed due to redundancy in Client
2019-08-07 19:16:31 +02:00
SmallJoker
a687efa6df
Damage: Play no damage sound when immortal ( #8350 )
...
Add isImmortal server-side for proper enable_damage handling
Rework log messages
2019-06-09 11:25:41 +02:00
Jozef Behran
007c8440d7
Optimize interaction distance checker ( #8193 )
...
The "what" parameter is being passed by value, most likely by
accident as the type is "const std::string". Convert it to a
reference by adding the missing "&".
2019-03-07 08:19:13 +01:00
SmallJoker
ffb17f1c9a
Consistent HP and damage types ( #8167 )
...
Remove deprecated HUDs and chat message handling.
Remove unused m_damage variable (compat break).
HP: s32 for setter/calculations, u16 for getter.
2019-02-10 23:03:26 +00:00