Commit Graph

81 Commits (e98d421aff046a2d9a9b87516779603dc170b209)

Author SHA1 Message Date
MoNTE48 e98d421aff Merge remote-tracking branch 'upstream/stable-0.4' into sync 2019-04-01 20:18:54 +02:00
SmallJoker b6138113e9 Inventory: Restrict access from too far away 2018-06-03 17:32:00 +02:00
sfan5 8e3a110314 ServerEnv: Clean up object lifecycle handling (#6414)
* ServerEnv: Clean up object lifecycle handling
2018-06-03 17:31:59 +02:00
Loic Blot 250e7d6754 Typo fix in compat code from commit 1d8d01074fdb52946f81110bebf1d001185b394b 2018-06-03 17:31:59 +02:00
Loïc Blot c5f090e7b4 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)
2018-06-03 17:31:59 +02:00
Maksim Gamarnik 35770f4abb Merge Minetest 0.4.16 2017-06-06 23:03:34 +03:00
ShadowNinja b41838b8ef Rename Scripting API files for consistency 2017-04-25 13:41:36 -04:00
red-001 3fd3573def Network:Remove old opcodes and fix documentation. (#5573) 2017-04-22 13:59:02 +02:00
SmallJoker 82b11ee1ab Fix MSVC build broken by 34d32ce
`round` -> `myround`
Remove superflous `floor` calls
2017-04-17 14:02:26 +02:00
Loïc Blot c99bfa77db Implement delayed server shutdown with cancelation (#4664) 2017-04-15 23:19:18 +02:00
Auke Kok a8cd8fe522 Fix "error: ‘playerSAO’ was not declared"
Cause: 351cc2e79a7d78f7ec97ff9b33e4f0bad4042b19

A rebase issue missed a rename from playerSAO to playersao.

Tested.
2017-04-06 22:05:31 -07:00
Ekdohibs d287b5ec47 Fix spacing 2017-04-06 21:27:29 -07:00
Ekdohibs 01dc95278b Fix problems when overriding the hand:
- If the hand can dig a node the item wielded can't, allow to dig it anyway.
- Fix the API callbacks from setting the hand instead of the wielded item.
2017-04-06 21:27:29 -07:00
presstabstart 7c200612fd Fix multiple death messages (#5305)
Fix multiple death messages (#3565) and damage server logs after death.
2017-04-06 20:32:50 -07:00
Loïc Blot 32d85e68c6 Update server min protocol version to v24 (#5411)
* Update server min protocol version to v24

It's based on @sfan5 stats. See https://kitsunemimi.pw/tmp/serverlist_stats_2017-03-17.txt

v24 was bumped 25/08/14 and 0.4.11 was released 25/12/14

* Drop protocol v23 and lesser code
2017-03-19 08:44:29 +01:00
Loic Blot 045cc40d91 [CSM] Client side modding
* rename GameScripting to ServerScripting
* Make getBuiltinLuaPath static serverside
* Add on_shutdown callback
* Add on_receiving_chat_message & on_sending_chat_message callbacks
* ScriptApiBase: use IGameDef instead of Server
  This permits to share common attribute between client & server
* Enable mod security in client side modding without conditions
2017-03-13 23:56:05 +01:00
Maksim Gamarnik e05f7db82f Updated to Minetest ver. 0.4.15 2017-01-30 00:44:07 +02:00
raymoo 0ff6079c2f Wrap to positive degree values (#5106) 2017-01-24 17:25:11 +01:00
Loic Blot 4fca654fcf Cleanup some header inclusions to improve compilation times 2017-01-11 15:53:56 +01:00
Loic Blot 295d6102c0 Breath cheat fix: server side
Breath is now handled server side. Changing this behaviour required some modifications to core:

* Ignore TOSERVER_BREATH package, marking it as obsolete
* Clients doesn't send the breath to server anymore
* Use PlayerSAO pointer instead of peer_id in Server::SendPlayerBreath to prevent a useless lookup (little perf gain)
* drop a useless static_cast in emergePlayer
2017-01-01 23:11:26 +01:00
sfan5 78e9ce1587 Fix interact range check (thanks to @lhofhansl) 2016-12-29 19:35:22 +01:00
sfan5 e171949b92 Various anticheat improvements
* Calculate maximum interact distance from wielded tool
* New "interacted_while_dead" cheat_type for the Lua API
* Disallow dropping items while dead
* Move player to spawn before resurrecting them
2016-12-26 22:34:29 +01:00
Lars Hofhansl 7d5bf4c229 Optimize block sent: Fix rendering issue 2016-12-03 02:34:45 +00:00
lhofhansl 52bf98ff4c Optimize/adjust blocks/ActiveObjects sent at the server based on client settings. (#4811)
Optimize/adjust blocks and active blocks sent at the server based on client settings.
2016-11-30 18:13:14 +10:00
TeTpaAka 116d887dd0 Wieldhand: Allow overriding the hand 2016-11-26 03:49:30 +00:00
raymoo 7c4f76cca7 Add control information to player interacts (#4685) 2016-11-12 17:22:39 +10:00
Loic Blot 4abc944397 Fix overloading problems mentioned by clang 2016-10-30 16:30:55 +01:00
Ner'zhul 4d9f4685ff PlayerSAO/LocalPlayer refactor: (#4612)
* Create UnitSAO, a common part between PlayerSAO & LuaEntitySAO
* Move breath to PlayerSAO & LocalPlayer
* Migrate m_yaw from (Remote)Player & LuaEntitySAO to UnitSAO
* Migrate m_yaw from Player to LocalPlayer for client
* Move some functions outside of player class to PlayerSAO/RemotePlayer or LocalPlayer depending on which class needs it
* Move pitch to LocalPlayer & PlayerSAO
* Move m_position from Player to LocalPlayer
* Move camera_barely_in_ceiling to LocalPlayer as it's used only there
* use PlayerSAO::m_base_position for Server side positions
* remove a unused variable
* ServerActiveObject::setPos now uses const ref
* use ServerEnv::loadPlayer unconditionnaly as it creates RemotePlayer only if it's not already loaded
* Move hp from Player to LocalPlayer
* Move m_hp from LuaEntitySAO to UnitSAO
* Use m_hp from PlayerSAO/UnitSAO instead of RemotePlayer
2016-10-30 14:53:26 +01:00
Loic Blot 3558ac7829 More code cleanup (UNORDERED + RemotePlayer/LocalPlayer)
* ClientEnvironment now uses UNORDERED MAP for active objects
* Use RemotePlayer and LocalPlayer everywhere it's possible
* Minor code style fixes
* Drop Client::getBreath() unused function
2016-10-08 22:27:44 +02:00
Loic Blot d28e980e7c Player/LocalPlayer/RemotePlayer inheritance cleanup (part 2 on X)
* Server/Client Environments now have an helper to cast Player object in the right type to use it
* Server: use RemotePlayer everywhere and remove previous added casts
* Client: use LocalPlayer where needed
* Environment: remove unused functions (getPlayers(), getRandomConnectedPlayer(), getNearestConnectedPlayer())
2016-10-08 15:57:50 +02:00
Loic Blot aca9ff5961 Player/LocalPlayer/RemotePlayer inheritance cleanup (part 1 on X)
* LocalPlayer take ownership of maxHudId as it's the only caller
* RemotePlayer take ownership of day night ratio as it's the only user
* Pass getPlayerControl as const reference to prevent object copy on each call (perf improvement in ObjectRef::l_get_player_control call)
* getPlayerSAO is now only RemotePlayer call
* get/setHotbarItemCount is now RemotePlayer owned
* Server: Use RemotePlayer instead of Player object on concerned call to properly fix the object type
* PlayerSAO now uses RemotePlayer instead of Player because it's only server side
* ObjectRef::getplayer also returns RemotePlayer as it's linked with PlayerSAO
2016-10-08 11:36:28 +02:00
Loic Blot d33797e079 use unordered containers where possible (patch 4 on X)
Also remove some unused parameters/functions
2016-10-06 22:37:26 +02:00
Loic Blot d462aa0753 Chat: new settings to prevent spam
Added the following chat coreside features
* Chat messages length limit
* Message rate limiting
* Message rate kicking

Note:
* handleChat now takes RemotePlayer pointer instead of u16 to remove useless
  lookups
2016-10-05 00:13:37 +02:00
Maksim Gamarnik 0b19e56113 Merge remote-tracking branch 'upstream1/master' 2016-04-01 00:33:55 +03:00
sfan5 008c21f626 Fix small formatting issue in SRP debug output
Writing an u8 to verbosestream writes a char, not it's numeric value.
2016-03-29 19:59:14 +02:00
Maksim Gamarnik f56e578960 Merge remote-tracking branch 'upstream1/master' 2016-03-21 01:45:56 +02:00
est31 a60976e0cf Much better API for auth.{cpp, h}
* No function overloading
* Adhere coding style and with method names following
  lowercase_underscore_style
* Use std::string in external API, handling these is
  much more fun
2016-03-15 05:55:49 +01:00
Maksim Gamarnik 531f4188bc Merge remote-tracking branch 'upstream/master' 2016-02-25 13:57:55 +02:00
nerzhul 62fb95a95a GOTBLOCKS & DELETEBLOCKS: test packet size only once 2016-02-23 14:24:21 +01:00
Maksim Gamarnik 76ef29709c v. 1.1.2-pre | build1 2016-02-23 06:40:14 +02:00
Maksim Gamarnik 2520ca3ed1 Merge branch 'master' of https://github.com/minetest/minetest 2016-01-31 20:57:03 +02:00
ASL97 5cd497ac5e Cache disable_anticheat and check it for "interacted_too_far" 2016-01-09 16:24:22 -05:00
Maksim Gamarnik 1797862bf9 Merge 2015-12-06 15:00:12 +02:00
Alex Ford 3d8a7bc124 Add on_secondary_use when right clicking an item in the air 2015-12-02 02:18:44 +00:00
Maksim Gamarnik b3726345ff Merge last minetest commits 2015-11-27 12:57:52 +02:00
est31 c0e6e75afc Only allow players with shout to chat
Fix regression of commit

5e507c9829942c434a6f1ae7a4f3a488c7e50bef "Add server side ncurses terminal"

which allowed all players, even those without a shout priv, to chat.

Fixes #3362.
2015-11-13 02:35:02 +01:00
Maksim Gamarnik bcf249297c Merge last Minetest commits 2015-11-10 20:29:00 +02:00
Maksim Gamarnik 919be490f9 Update
Sync all Minetest commits
2015-11-10 13:49:24 +02:00
est31 405e7acee9 Add server side ncurses terminal
This adds a chat console the server owner can use for administration
or to talk with players.
It runs in its own thread, which makes the user interface immune to
the server's lag, behaving just like a client, except timeout.
As it uses the same console code as the f10 console, things like nick
completion or a scroll buffer basically come for free.
The terminal itself is written in a general way so that adding a
client version later on is just about implementing an interface.

Fatal errors are printed after the console exists and the ncurses
terminal buffer gets cleaned up with endwin(), so that the error still
remains visible.

The server owner can chose their username their entered text will
have in chat and where players can send PMs to.
Once the username is secured with a password to prevent anybody to
take over the server, the owner can execute admin tasks over the
console.

This change includes a contribution by @kahrl who has improved ncurses
library detection.
2015-11-06 08:51:14 +01:00
ShadowNinja 29e8adeadc Use warningstream for log messages with WARNING
Remove DTIME macro and its uses, too
2015-10-14 01:36:48 -04:00