aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
AgeCommit message (Collapse)Author
2018-03-08Cleanup: drop Server::hudGetHotbarImage()Loic Blot
Call directly accessible RemotePlayer::getHotbarImage() from server api & make it const ref
2018-03-08Cleanup: drop Server::hudGetHotbarItemcount()Loic Blot
Call directly accessible RemotePlayer::getHotbarItemcount() from server api
2018-02-18Mitigate formspec exploits by verifying that the formspec was shown to the ↵red-001
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-10Node definition manager refactor (#7016)Dániel Juhász
* Rename IWritableNodeDefManager to NodeDefManager * Make INodeDefManager functions const * Use "const *NodeDefManager" instead of "*INodeDefManager" * Remove unused INodeDefManager class * Merge NodeDefManager and CNodeDefManager * Document NodeDefManager
2018-01-16Load a texturepack from the 'textures' subfolder of a gamered-001
2017-12-03Shut down mapgen threads before other shutdown tasks (#6689)raymoo
Solves some issues with ModStorage functionality in mapgen threads that occurred when mapgen threads continued to run after the main server thread had stopped. Also shuts down mapgen threads before shutdown callbacks are called.
2017-11-17Load files from subfolders in texturepacksnumber Zero
Updated and rebased version of a PR by red-001
2017-11-08Move files to subdirectories (#6599)Vitaliy
* Move files around
2017-09-30Make Player::peer_id server-side only and add getters and setters (#6478)Loïc Blot
* Make Player::peer_id server-side only and add getters and setters Player::peer_id has no sense client side, move it to server, make it private and add setter and getter Also add some PEER_ID_INEXISTENT instead of harcoded 0
2017-09-28Server: affect bind_addr on constructor instead of start() (#6474)Loïc Blot
bind_addr is already ready when using constructor as we read is.IPv6 from it, instead pass the whole address
2017-09-27Fix some forgotten u16 -> session_t in ad7daf7b52348e1b71aa803be10de5b2134cba11Loic Blot
2017-09-27Add session_t typedef + remove unused functions (#6470)Loïc Blot
* 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-26Implement mod communication channels (#6351)Loïc Blot
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-15Customizeable max breath for players (#6411)SmallJoker
* Customizeable maximal breath for players
2017-09-12Network: Remove large parts of deprecated legacy code (#6404)SmallJoker
Also remove the setting 'send_pre_v25_init' Keep old enum entries for obsolete commands
2017-09-09Server: Calculate maximal total block sends dynamically (#6393)SmallJoker
The block sends per client is 1/2 when reaching the maximal player count.
2017-08-30Remove DSTACK support (#6346)Loïc Blot
Debugstacks is not useful, we don't really use it, the DebugStack is not pertinent, gdb and lldb are better if we really want to debug.
2017-08-29Network proto handlers/container fixes (#6334)Loïc Blot
* 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-24Add clientside translations.Ekdohibs
2017-08-24Network cleanup (#6302)Loïc Blot
* 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-23Respect object property hp_max field for players (#6287)SmallJoker
* Respect object property hp_max field for players This allows modders to configure the maximal HP per player * Statbars: Downscale bar to full 20 HP when exceeding this value Add default max HP for players and breath constants to builtin Document the constants * Rename PLAYER_MAX_HP -> PLAYER_MAX_HP_DEFAULT
2017-08-19Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)Loïc Blot
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial) * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Spelling: vertice -> vertex
2017-08-18Optimize headers (part 2) (#6272)Loïc Blot
* Optimize headers (part 2) * less debug.h in headers * less remoteplayer.h for everybody * Cleanup (part 2) * camera.h: mesh.h * mapgen.h: mapnode.h * serverenvironment.h: mapblock.h * nodedef.h: shader.h
2017-08-18server.cpp: unroll setting when sending mapblocks (#6265)Loïc Blot
* server.cpp: unroll setting when sending mapblocks * Improve a little bit performance when sending mapblocks massively * Use a range based for * Code style fixes
2017-08-16Cleanup various headers to reduce compilation times (#6255)Loïc Blot
* Cleanup various headers to reduce compilation times
2017-08-15server.cpp: code modernizationLoic Blot
* Use more for range based loops * Simplify some tests * Code style fixes * connection.h: better PeerChange constructor instead of creating uninitalized object and then affect variables
2017-08-14Various server.cpp cleanupsLoic Blot
* Modernize many for loops * Use constness on many loops * use empty function on many strings tests * various code style fixes
2017-08-14Server::AsyncRunStep + Server::sendAddNode: modernize codeLoic Blot
* Use various modern for loops * Make some loop iterator constants, whereas there weren't * Use empty on some size() > 0 tests * Various little codestyle fixes * Fix an hidden scope variable in Server::SendBlockNoLock
2017-07-27Remove one unused variable in Server::Receive functionLoic Blot
2017-07-18[CSM] Add flavour limits controlled by server (#5930)Loïc Blot
* [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-16Chat protocol rewrite (#5117)Loïc Blot
* 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-06-18Cpp11 patchset 11: continue working on constructor style migration (#6004)Loïc Blot
2017-06-14Remove legacy content_abm.{cpp,h}Loïc Blot
2017-06-11Use thread_local instead from some static settings (#5955)Loïc Blot
thread_local permits to limit variable lifetime to thread duration. Use it on each setting place which uses static to cache variable result only for thread lifetime. This permits to keep the same performance level & reconfigure server from MT gui in those various variables places. Add thread_local to undersampling calculation too.
2017-06-11Sound: Add pitch option (#5960)Rui
* Sound: Add pitch option
2017-06-11(Re)spawn players within 'mapgen_limit'paramat
Previously, findSpawnPos() did not take the 'mapgen_limit' setting into account, a small limit often resulted in a spawn out in the void. Use the recently added 'calcMapgenEdges()' to get max spawn range through a new mapgenParams function 'getSpawnRangeMax()'. Previously, when a player respawned into a world, 'objectpos_over_limit()' was used as a check, which was inaccurate. Use the recently added 'saoPosOverLimit()' to get exact mapgen edges. Also fix default value of 'm_sao_limit_min'.
2017-06-10Add a server-sided way to remove color codes from incoming chat messages (#5948)red-001
These code be generated by CSM, a modded client or just copy and pasted by the player. Changes - Update configuration example and setting translation file. - Remove colour codes before logging chat. - Add setting to remove colour codes before processing the chat.
2017-06-09Fix sending color codes to clients that don't support them. (#5950)red-001
Also remove `disable_escape_sequences` since it's not needed anymore.
2017-06-08Have the server send the player list to the client (#5924)red-001
* 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-06Revert "Remove deprecated code segments (#5891)"Loïc Blot
This reverts commit 599e13e95e81aadb959c9f3715aec9b425ede084.
2017-06-04Remove deprecated code segments (#5891)Thomas--S
2017-06-04C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821)Loïc Blot
2017-05-20Real control fix (#5787)Loïc Blot
* Allow enabling and disabling mods. * Re-fix 605599b6f150b89ba6539c4d088231b326adcb48 This breaks some chars like € in chat. Instead verify is char is a non control char -> iswcntrl
2017-05-19Mainmenu: Fix issues while trying to enable all mods (#5770)SmallJoker
2017-05-17Particles: Do not send single particles to distant clients (#5760)Paramat
Previously, every individual particle on a server is sent to, and rendered by (even if not actually visible), every client regardless of distance. This significantly reduces client FPS and creates unnecessary network traffic. Maximum distance is set by 'max block send distance' as this determines how far a client is able to see.
2017-05-02Set sky API: Add bool for clouds in front of custom skyboxparamat
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-03Sound API: Add fading soundsBrandon
2017-04-30Add clouds APIBen Deutsch
2017-04-25Rename Scripting API files for consistencyShadowNinja
2017-04-23Player data to Database (#5475)Loïc Blot
* Player data to Database Add player data into databases (SQLite3 & PG only) PostgreSQL & SQLite: better POO Design for databases Add --migrate-players argument to server + deprecation warning * Remove players directory if empty