Commit Graph

79 Commits

Author SHA1 Message Date
Loïc Blot 23bd5baf42 Fix particle spawners not visible since CSM spawner implementation
* 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-02-26 10:02:03 +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
rubenwardy 7796a3118d
Disable confirmation dialog on localhost 2019-02-09 19:52:56 +01: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 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
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
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
SmallJoker db42542e27 Rename CSM flavours to restrictions
& Satisfy LINT
2018-06-26 15:38:42 +02: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
red-001 ae6aed15cf Remove legacy chat network code. (#6954) 2018-02-17 19:23:21 +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
Loïc Blot 308bb69eef
CSM fixes: load mods after flavours & add flavour to block mod loading (#6738)
* CSM fixes: load mods after flavours & add flavour to block mod loading

* Don't permit to load mods twice

* Prepare builtin integrity global algorithm

* Add missing doc & use a nicer byteflag for LOAD_CLIENT_MODS flavour

* flag typo fix

* Invert CSM_FL_LOOKUP_NODES & CSM_FL_LOAD_CLIENT_MODS ids
2017-12-11 17:33:44 +01:00
SmallJoker 03caa1e319 Damage: Remove damage ignore timer 2017-12-10 14:23:45 +00:00
Loïc Blot 6f1c907204 Implement mod communication channels (#6351)
Implement network communication for channels

* Implement ModChannel manager server side to route incoming messages from clients to other clients
* Add signal handler switch on client & ModChannelMgr on client to handle channels
* Add Lua API bindings + client packet sending + unittests
* Implement server message sending
* Add callback from received message handler to Lua API using registration method
2017-09-26 00:11:20 +02:00
SmallJoker 5e141ac920 Network: Fix logging into older worlds with base64 hashes 2017-09-12 20:26:03 +02:00
SmallJoker ee9a442ecc Network: Remove large parts of deprecated legacy code (#6404)
Also remove the setting 'send_pre_v25_init'
Keep old enum entries for obsolete commands
2017-09-12 19:48:09 +02:00
Loïc Blot 1d4a2a6ea7 Network proto handlers/container fixes (#6334)
* Fix HP transport + some double <-> float problems

TOCLIENT_HP transport u16 hp as a u8, use u16 HP, this prevent HP over 255 to overflow across network

* Fix more double/float problem in serverpackethandler & remove implicit struct type for TileAnimationParams

* Fix connection unittests container
2017-08-29 20:37:54 +02:00
Loïc Blot 5f38fe33f8 Clientevent refactor (#6320)
* Refactor clientevent structure

* Move structure outside of client header

* Create client events on heap not stack, this remove the ClientEvent object copy

* Use clientEventHandler to route events
2017-08-28 20:02:23 +02:00
Ekdohibs b24e6433df Add clientside translations. 2017-08-24 17:54:10 +02:00
Loïc Blot c7160cb629 Network cleanup (#6302)
* Cleanup network headers

* Move peerhandler to a specific header to reduce compilation times
* Move socket.cpp/h to network folder

* More work

* Network code cleanups

* Move socket.{cpp,h} to network folder
* Move Address object to network/address.{cpp,h}
* Move network exceptions to network/networkexceptions.h
* Client: use unique_ptr for Connection
* Server/ClientIface: use shared_ptr for Connection

* Format fixes

* Remove socket.cpp socket.h from clang-format whitelist

* Also fix NetworkPacket code style & make it under clang-format
2017-08-24 08:28:54 +02:00
paramat 7657fe7a50 Minimap: Add new HUD flag for minimap radar mode
Flag default is true to not change default behaviour.
The existing minimap HUD flag remains the master control for minimap.
2017-08-20 23:58:15 +01:00
Loïc Blot 88b436e6a9 Code modernization: subfolders (#6283)
* Code modernization: subfolders

Modernize various code on subfolders client, network, script, threading, unittests, util

* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* C++ STL header style
* Make connection.cpp readable in a pointed place + typo
2017-08-19 22:23:47 +02:00
Loïc Blot 79f19b8369 [CSM] Add flavour limits controlled by server (#5930)
* [CSM] Add flavour limits controlled by server

Server send flavour limits to client permitting to disable or limit some Lua calls

* Add limits for reading nodedefs and itemdefs

* flavour: Add lookup node limits

* Merge get_node_or_nil into get_node.

Sending fake node doesn't make sense in CSM, just return nil if node is not available for any reason

* Add node range customization when noderange flavour is enabled (default 8 nodes)

* Limit nodes range & disable chat message sending by default

* Bump protocol version
2017-07-18 21:39:55 +02:00
Loïc Blot 7ddf67aa14 Chat protocol rewrite (#5117)
* New TOCLIENT_CHAT_MESSAGE packet

* Rename old packet to TOCLIENT_CHAT_MESSAGE_OLD for compat
* Handle TOCLIENT_CHAT_MESSAGE new structure client side
* Client chat queue should use a specific object
* SendChatMessage: use the right packet depending on protocol version (not complete yet)
* Add chatmessage(type) objects and handle them client side (partially)
* Use ChatMessage instead of std::wstring server side

* Update with timestamp support
2017-07-16 10:47:31 +02:00
Loïc Blot 4dcc5985df Verify HudSetParams input when hotbar textures are set (#6013)
* Verify HudSetParams input when hotbar textures are set

This fix #6011
2017-06-19 14:10:30 +02:00
Loïc Blot 8f7785771b Cpp11 initializers 2 (#5999)
* C++11 patchset 10: continue cleanup on constructors

* Drop obsolete bool MainMenuData::enable_public (setting is called with cURL in server loop)

* More classes cleanup

* More classes cleanup + change NULL tests to boolean tests
2017-06-17 19:11:28 +02:00
Rui ff73c7a5da Sound: Add pitch option (#5960)
* Sound: Add pitch option
2017-06-11 13:58:26 +02:00
red-001 4221c1b441 Have the server send the player list to the client (#5924)
* Have the server send the player list to the client

Currently the client generates the player list based on the Client active object list, the issue with this is that we can't be sure all player active objects will be sent to the client, so this could result in players showing up when someone run `/status` but auto complete not working with their nick and CSM not being aware of the player
2017-06-08 15:30:09 +02:00
Loïc Blot a98baef5e4 C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821) 2017-06-04 21:00:04 +02:00
Loïc Blot e25a38e3fb When minimap is disabled in configuration, really disable it (#5771)
* When minimap is disabled in configuration, really disable it
2017-05-19 07:25:27 +02:00
SmallJoker 468eeb618e Fading soungs: Fix client crash on older servers 2017-05-03 13:48:46 +02:00
paramat ad9fcf859e Set sky API: Add bool for clouds in front of custom skybox
Default true.
Add 'm_clouds_enabled' bool to sky.h, set from new bool in 'set sky' API.
Make 'getCloudsVisible()' depend on 'm_clouds_enabled' instead of
'm_visible' (whether normal sky is visible).
2017-05-02 20:42:35 -07:00
SmallJoker f9fdb48dc8 Sneak: Improve and fix various things
Remove useless `got_teleported`.
Fix jitter when walking against the sneak limits.
Fix damage evading on sneak ladders.
2017-05-03 03:16:20 +01:00
Brandon bd921a7916 Sound API: Add fading sounds 2017-05-03 03:12:45 +01:00
Ben Deutsch f1d7a26b7c Add clouds API 2017-04-30 00:06:13 +01:00
ShadowNinja 2818d3f224 Rename Scripting API files for consistency 2017-04-25 13:41:36 -04:00
red-001 0c34fe20a1 Network:Remove old opcodes and fix documentation. (#5573) 2017-04-22 13:59:02 +02:00
Loïc Blot 563199698d Client handlers: Remove useless stringstream usage in two handlers (#5510) 2017-04-04 07:47:04 +02:00
Loïc Blot 40ce538aad [CSM] Add minimap API modifiers (#5399)
* Rename Mapper (too generic) to Minimap
* Add lua functions to get/set position, angle, mode for minimap
* Client: rename m_mapper to m_minimap
* Add minimap to core.ui namespace (core.ui.minimap)
* Add various functions to manage minimap (show, hide, toggle_shape)
* Cleanup trivial declaration in client
2017-03-16 10:34:54 +01:00
nerzhul 44ca9c9cb2 [CSM] Add enable_client_modding param (default: false) 2017-03-13 23:56:05 +01:00
Loïc Blot 9978f5af82 [CSM] Add on_death, on_hp_modification & oh_damage_taken callbacks (#5093)
* Add on_death callback
* Add on_hp_modification & on_damage_taken callbacks
* move preview code to preview.lua
2017-03-13 23:56:05 +01:00
red-001 cb3a61f8db [CSM] Add method that display chat to client-sided lua. (#5089) (#5091)
* squashed: [Client-sided scripting] Don't register functions that don't work. (#5091)
2017-03-13 23:56:05 +01:00