Commit Graph

67 Commits

Author SHA1 Message Date
sfan5 397682a5b0 Clean up client and server command sending / tables 2024-01-27 10:33:32 +01:00
sfan5 731b84d725 Reduce some instances of useless data shuffling 2024-01-23 22:34:36 +01:00
sfan5 6df0de565f Check media requests on the server more carefully 2024-01-23 22:34:36 +01:00
savilli 432988a4ad
Fix multiple password changes in one session 2024-01-19 11:50:55 +01:00
sfan5 e8008c1b21 Sanitize lang_code and full_version received from client
fixes #14262
2024-01-17 20:05:57 +01:00
sfan5 f27f701251 Make server disconnect lingering clients 2024-01-17 20:05:57 +01:00
lhofhansl ca1a723890
Allow cheaper culling checks at a distance (#14073)
* Allow cheaper culling checks at a distance
* Pick a random ray, so that far missing block will eventually be shown
2023-12-16 15:04:21 -08:00
lhofhansl 1f0d042377
Reduce server CPU consumed by occlusion culling. (#13260)
Cache blocks already occluded at a specific distance. The RemoteClient typically visits the same distance multiple time - especially at larger distances, so this saves significant CPU from recalculating the occlusion state of blocks.
2023-03-05 21:33:41 -08:00
lhofhansl dcf6a6a67b
Log server map send cycle time. (#13259)
* Measure server map send time per player.
2023-03-03 17:41:30 -08:00
rubenwardy 39f4d26177
Add minetest.get_player_window_information() (#12367) 2023-02-27 22:58:41 +00:00
Abdou-31 d1b80b462e
Fix typos and en_US/en_GB inconsistency in various files (#12902) 2022-11-09 11:57:19 -05:00
sfan5 00f71c3b9d Fix password changing getting stuck if wrong password is entered once 2022-04-28 19:55:36 +02:00
ShadowNinja 7993909fab Spacing fixes 2022-04-08 14:55:21 +01:00
Jude Melton-Houghton 1c73902005 Clean up ClientInterface locking 2022-02-03 11:43:51 +01:00
SmallJoker ecc6f4ba25
Remove a few unused functions reported by callcatcher (#11658) 2021-10-12 20:12:20 +02:00
lhofhansl 7c2826cbc0
Fix build for newer versions of GCC (#11246) 2021-05-06 19:24:30 +02: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
Lars 68cd93b865 Avoid resending near blocks unnecessarily. 2020-10-27 12:08:44 -07:00
Lars f43d1cfa81 Rely on max_simultaneous_block_sends_per_client to limit blocks sent to the client. 2020-10-13 19:39:43 -07:00
EvidenceB Kidscode cee3c5e73d
Add server side translations capability (#9733)
* Add server side translations capability
2020-04-25 07:20:00 +02:00
Lejo 37f771a95b Fix the player information version_string return value (#8616)
* Give more player information

* Correct lua_api.txt

* Correct keys in lua_api.txt

* Improve Code

* Only Bugfix+ser_vers

* Correct doc

* Fix double
2019-12-20 19:16:29 +01:00
SmallJoker d73e458db6
ClientInterface: Use recursive mutex to prevent freeze in on_newplayer() (#8808) 2019-08-17 13:27:28 +02:00
SmallJoker 297beea5bf
Check node updates whether the blocks are known (#7568)
* Remove unused ignore_id
2018-08-16 20:10:34 +02:00
Loic Blot 6036f865cb Drop less performant Server::setBlockNotSent for ClientInterface::markBlockposAsNotSent 2018-03-09 23:27:26 +01:00
lhofhansl 6bab695479 Cache server config settings. (#6530)
* Cache server config settings.
2017-10-15 09:32:17 +02:00
Loic Blot 27eeb3581f
Fix some forgotten u16 -> session_t in ad7daf7b52 2017-09-27 23:48:12 +02:00
Loïc Blot ad7daf7b52 Add session_t typedef + remove unused functions (#6470)
* Add session_t typedef + remove unused functions

u16 peer_id is used everywhere, to be more consistent and permit some evolutions on this type in the future (i'm working on a PoC), uniformize u16 peer_id to SessionId peer_id
2017-09-27 19:47:36 +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
SmallJoker 745a90dc84 Server: Calculate maximal total block sends dynamically (#6393)
The block sends per client is 1/2 when reaching the maximal player count.
2017-09-09 00:36:48 +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
Loïc Blot 921151d97a C++ modernize: Pragma once (#6264)
* Migrate cpp headers to pragma once
2017-08-17 22:19:39 +02:00
Loic Blot 3e80bf933f
l_server, clientenvironment, clientiface: code modernization
* use range-based for loops
* use refs on some exceptions & one setter
2017-08-17 08:11:39 +02:00
Loïc Blot 1d8d01074f ClientInterface: add a function to verify (correctly) if user limit was reached (#6258)
* ClientInterface: add a function to verify (correctly) if user limit was reached

CS_HelloSent is a better indicator of active slots than CS_Created, which are session objects created after init packet reception

Switch existing checks to ClientInterface::isUserLimitReached()

Use range-based for loop for getClientIds() used function too

This will fix #6254 (not the memory overhead if init is flooded)
2017-08-16 23:48:29 +02:00
Loïc Blot 85511a642f Cleanup various headers to reduce compilation times (#6255)
* Cleanup various headers to reduce compilation times
2017-08-16 22:11:45 +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 76be103a91 C++11 patchset 9: move hardcoded init parameters to class definitions (part 1) (#5984)
* C++11 patchset 9: move hardcoded init parameters to class definitions

C++11 introduced the possibility to define the default values directly in class definitions, do it on current code

Also remove some unused attributes

* CollisionInfo::bouncy
* collisionMoveResult::collides_xy
* collisionMoveResult::standing_on_unloaded
* Clouds::speed

* More constructor cleanups + some variables removal

* remove only write guiFormSpecMenu::m_old_tooltip
* move header included inside defintions in genericobject.h
* remove some unused since years exception classes
* remove unused & empty debug_stacks_init
* remove unused & empty content_nodemeta_serialize_legacy
* remove forgotten useless bool (bouncy) in collision.cpp code
2017-06-16 11:25:52 +02:00
Loïc Blot d4c0f91275 Use C++11 mutexes only (remove compat code) (#5922)
* Fix event LINT & remove default constructor/destructors
* remove compat code & modernize autolock header
2017-06-06 16:29:28 +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
SmallJoker d99b6fed55 Time: Change old `u32` timestamps to 64-bit (#5818)
MacOSX build fix + cleanups
2017-05-26 14:03:36 +02:00
Loïc Blot ce9802266e Various code cleanup & little performance improvement on HTTP download (#5772)
* Disable or remove unused enum members/functions
* Tiny code style fixes
* Make some functions const
* Replace ClientMediaDownloader std::unordered_map with std::map
2017-05-20 08:15:56 +02:00
ShadowNinja b662a4577d Clean up getTime helpers
This increases size of the getTime return values to 64 bits.
It also removes the TimeGetter classes since the getTime functions
are now very precise.
2017-04-28 14:43:18 -04:00
Loïc Blot f98bbe193e Fix various copy instead of const ref reported by cppcheck (part 3) (#5616)
* Also remove 2 non declared but defined functions
* Make some functions around const ref changes const
2017-04-20 00:12:52 +02:00
Loïc Blot b0be7ab61e ClientIface::sendToAll: honor packet configuration (#5590) 2017-04-14 15:34:01 +02:00
red-001 d988f9b769 Use the `ARRLEN` macro in more places and remove an unused macro. (#5260) 2017-02-18 15:24:49 +01:00
Loic Blot edba6e50d9 Optimize ClientIface::getPlayerNames(): return const ref instead a copy of all names 2016-10-08 22:27:44 +02:00
Loic Blot 613797a304 Replace various std::map with UNORDERED_MAP + various cleanups
This is part 2 for 5f084cd98d

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
Jeija 089f9bbe81 Resend blocks when modified while sending to client 2016-03-12 23:59:44 +01:00
est31 4c654557ec Clientiface: remove "value is dummy" from docs
Commit

6a1670dbc3 "Migrate to STL containers/algorithms."

has replaced core::map<T, bool> with std::set<T>, but didn't update
the accompanying comment saying "value is dummy". This happened at
two places.
2016-02-16 23:58:30 +01:00
est31 2c637ce1c2 Make ClientInterface::statenames consistent with the state enum again
Fixes minetest.get_player_information segfault due
to out of bounds access problems, when compiled as debug build.
2015-08-31 13:31:29 +02:00
ShadowNinja e4bff8be94 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