Commit Graph

273 Commits

Author SHA1 Message Date
rubenwardy d8ece2e3e9 Fix serialization of std::time_t by casting to u64 first (#8353)
Fixes #8332
2019-03-11 22:07:19 +00:00
rubenwardy da4739a26c Fix detach inventory serialisation (#8331) 2019-03-11 22:07:19 +00:00
rubenwardy fc24bf0915 Fix incorrect string length check after cast 2019-03-11 22:07:19 +00:00
Loïc Blot 170dd409cb
Fix particle spawners not visible since CSM spawner implementation (#8289)
* Drop the ID mapper, use a big u64 instead. This will permit to resync server ids properly with the manager code
* Modernize some code parts (std::unordered_map, auto)
* generate id on client part on U32_MAX + 1 ids, lower are for server ids
2019-03-01 20:16:11 +01:00
Loïc Blot 111f1dc9c5 Revert "Revert CSM particles commit to fix particle spawner bug for 5.0.0 (#8288)"
This reverts commit 01cd63bd3b.
2019-02-26 08:53:53 +01:00
Paramat 01cd63bd3b
Revert CSM particles commit to fix particle spawner bug for 5.0.0 (#8288)
Reverts 5dab742645
"[CSM] Add functions to create particles and particlespawners."
2019-02-26 04:26:25 +00:00
Paramat 20fb04d9fb
Attend to LINT sillyness (#8276) 2019-02-23 02:41:36 +00:00
ANAND 7a0e52acd6 Revert RTT fixes (#8187)
The reverted commit 968ce9af59
is suspected (through the use of bisection) of causing network slowdowns.
Revert for now as we are close to release.
2019-02-15 23:39:22 +00:00
Loïc Blot 3dafc007a9 LINT fix 2019-02-15 12:27:29 +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
Loic Blot ff5d4ffe1c
Fix Address::isLocalhost algorithm 2019-02-09 19:52:56 +01:00
rubenwardy 7796a3118d
Disable confirmation dialog on localhost 2019-02-09 19:52:56 +01:00
Paul Ouellette d5456da69d Use true pitch/yaw/roll rotations without loss of precision by pgimeno (#8019)
Store the rotation in the node as a 4x4 transformation matrix internally (through IDummyTransformationSceneNode), which allows more manipulations without losing precision or having gimbal lock issues.

Network rotation is still transmitted as Eulers, though, not as matrix. But it will stay this way in 5.0.
2019-02-07 21:26:06 +00:00
Muhammad Rifqi Priyo Susanto 9126e1791d Add setting to disable confirmation on new player registration (#8102) 2019-01-26 19:26:37 +00:00
SmallJoker a122ba0ef4 Fix various bugs (Anticheat, Lua helpers) (#8013)
* Fix various bugs (Anticheat, Lua helpers)

Anticheat: Use camera position instead of player position for shoot line calculations
Lua helpers: Increase 'i' to not overwrite earlier added table values

* Remove lag compensation

* * 1.5 for larger selection boxes
2019-01-06 10:24:44 +01:00
SmallJoker bba4563d89 Proselytize the network. Use IEEE F32 (#8030)
* Proselytize the network. Use IEEE F32
* Remove unused V2F1000 functions
2019-01-03 17:04:26 +01:00
Paramat ceacff13a6 CSM restrictions: Make 'LOAD_CLIENT_MODS' disable loading of 'builtin' (#8000)
Previously, when the CSM restriction 'LOAD_CLIENT_MODS' was used a
client was still able to add CSM code to 'builtin' to bypass that
restriction, because 'builtin' is not yet verified.

Until server-sent CSM and verifying of 'builtin' are complete, make
'LOAD_CLIENT_MODS' disable the loading of builtin.

Clarify code comments and messages to distinguish between client-side
modding and client-side scripting. 'Scripting' includes 'builtin',
'modding' does not.
2019-01-03 12:10:07 +01:00
Loïc Blot a5197eaebc
CSM: add requested CSM_RF_READ_PLAYERINFO (#8007)
* CSM: add requested CSM_RF_READ_PLAYERINFO

This new CSM limit permit to limit PLAYERINFO read from server.

It affects get_player_names call
2018-12-24 10:51:10 +01:00
SmallJoker 839e935ba0 Network: Send IEEE floats (#7768) 2018-12-13 11:20:57 +01:00
SmallJoker 3d66622772
Send only changed node metadata to clients instead of whole mapblock (#5268)
Includes newer style changes and fixes by est31

Improve the block position de-serialization
Add type NodeMetadataMap
2018-12-04 20:37:48 +01:00
Quentin Bazin 5f1cd555cd Move client-specific files to 'src/client' (#7902)
Update Android.mk
Remove 'src/client' from include_directories
2018-11-28 20:01:49 +01:00
CoderForTheBetter faa358e797 Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395)
* Adds Lua methods 'set_rotation()' and 'get_rotation'. Also changed some method names to be more clear. Instead of an f32 being sent over network for yaw, now a v3f is sent for rotation on xyz axes. Perserved Lua method set_yaw/setyaw so that old mods still work, other wise to set yaw they would need to switch to set_rotation(0, yaw, 0).
2018-11-28 09:38:50 +01:00
Paramat 2e37ee9565
CSM: Don't create the client script environment if CSM is disabled (#7874)
Use the CSM death formspec when CSM is enabled and use the engine death formspec when CSM is disabled.
Move the CSM death formspec code to a dedicated file.
2018-11-24 10:41:11 +00:00
SmallJoker 0a5e77132a
Add core.remove_detached_inventory (#7684)
Breaks backwards compatibility for good
Bump protocol version
2018-10-10 20:48:58 +02:00
Paramat 766fb7b46e
Particles: Make collision with objects optional (#7682)
Also set it to false for node dig particles, as they are often created
and high in number.

Improve particle documentation.
2018-09-08 00:38:35 +01:00
rubenwardy 14011bdc7a
Add protocol_version and supported package types to ContentDB urls 2018-07-29 00:26:03 +01:00
zeuner d7d451c647 Fix build on gcc 5.0 (#7586) 2018-07-26 21:49:38 +02:00
Lars Hofhansl ca8ec46843 Remove legacy client handling code. 2018-07-14 11:41:05 -07:00
Lars Hofhansl 8d629cf65b Fix bug setting channel window size. 2018-07-13 05:02:08 -07:00
Lars Hofhansl 93c0b3b8fb Ensure that legacy mode is correctly disabled. 2018-07-13 02:50:01 -07:00
SmallJoker f7a8e75765 Formspecs: Remove accidental empty 'quit' field 2018-07-10 18:27:03 +02:00
SmallJoker db42542e27 Rename CSM flavours to restrictions
& Satisfy LINT
2018-06-26 15:38:42 +02:00
SmallJoker 1d1cf000c0 Fix rtt >= 0.0f assertion and free_move crash 2018-06-24 14:48:19 +02:00
you 968ce9af59 RTT fixes (#7428)
* Few code updates

* Do not show average RTT before timing out

* Fix unwanted integer division in RTTStatistics

* Fix float format, prettier jitter calculation

* Use +=, 0.1f -> 100.0f for stronger average updates
2018-06-23 09:16:01 +02:00
sfan5 c66d977269 Fix ipv6_server=true not accepting IPv4 connections on Windows (#7471) 2018-06-22 20:54:23 +02:00
Loïc Blot 9a1d3584c2
Server: move shutdown parts to a specific shutdown state object (#7437)
* Server: move shutdown parts to a specific shutdown state object
2018-06-13 21:58:34 +02:00
SmallJoker bb4f0fd228 Formspec verification: Fix show_formspec inside callbacks (#7374) 2018-05-26 12:50:44 +02:00
SmallJoker 9877a1a207 Fix wrong channel number representation in logs (#7205) 2018-04-18 21:26:28 +02:00
Andrew Ward dfc8198349
Add reasons to on_dieplayer and on_hpchange 2018-03-28 16:05:18 +01:00
Andrew Ward 2323842dd3
Add formspec theming using prepended strings 2018-03-28 16:04:41 +01:00
Loïc Blot 4fd9715876
Cleanup sound manager class (#7158)
* Cleanup sound manager client

* Use some const refs
* Use auto on iterators
* Drop unused parameters
* Move sound_openal.* to client folder
* Move sound.cpp + OnDemandSoundFetcher to client/ folder + reorganize includes properly
2018-03-24 15:45:25 +01:00
Loic Blot 5e61f64ce2
Fix an alone if to be with a missing else 2018-03-16 08:40:21 +01:00
red-001 4bb41a19dc Mitigate formspec exploits by verifying that the formspec was shown to the user by the server. (#6878)
This doesn't check the fields in anyway whatsoever so it should only be seen as a way to mitigate exploits, a last line of defense to make it harder to exploit bugs in mods, not as a reason to not do all the usually checks.
2018-02-18 22:33:42 +01:00
red-001 ae6aed15cf Remove legacy chat network code. (#6954) 2018-02-17 19:23:21 +01:00
red-001 338d645fcf Add `on_auth_fail` callback (#7039)
Called when a client fails to supply the correct password for the account it's attempting to login as.
2018-02-15 21:18:54 +01:00
red-001 4f688d5616 Fix issues with earlier CSM HUD commit (#6940)
The CSM HUD PR caused some strange behavior including aborts due to parts of it using some slightly hacky code, the event refactor changing how events are processed and a minor oversight.
2018-01-26 16:05:47 +01:00
red-001 5dab742645 [CSM] Add functions to create particles and particlespawners. (#6072) 2018-01-20 23:31:53 +01:00
red-001 9649e47214 [CSM] Add basic HUD manipulation. (#6067)
* [CSM] Add basic HUD manipulation.

Workaround for on_connect not working right now.
2018-01-20 14:09:58 +01:00
Muhammad Rifqi Priyo Susanto 792752997c Add confirmation on new player registration (#6849)
* Attempt to add registration confirmation

Using SRP auth mechanism, if server sent AUTH_MECHANISM_FIRST_SRP that means the player isn't exist.
Also tell player about the server and chosen username.
Local game has localhost as IP address of the server.
Add RenderingEngine::draw_menu_scene() to draw GUI and clouds background.
aborted -> connection_aborted

* Rewrite information message text

Client::promptConfirmRegister() -> Client::promptConfirmRegistration()
2018-01-13 12:07:16 +01:00
Thomas--S f3b9d87076 Connected Nodeboxes: Add `disconnected` boxes
The `disconnected_*` boxes are the opposites of the `connect_*` ones,
i.e. when a node has no suitable neighbours on the respective side, the
according disconnected box is drawn.

* disconnected_top
* disconnected_bottom
* disconnected_front
* disconnected_left
* disconnected_back
* disconnected_right
* disconnected (when there is *no* neighbour)
* disconnected_sides (when there are *no* neighbours to the sides)
2018-01-03 04:05:21 +00:00