| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
| |
* ServerEnv: Clean up object lifecycle handling
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
| |
|
|
|
|
|
| |
`round` -> `myround`
Remove superflous `floor` calls
|
| |
|
|
|
|
|
|
|
|
| |
Cause: 351cc2e79a7d78f7ec97ff9b33e4f0bad4042b19
A rebase issue missed a rename from playerSAO to playersao.
Tested.
|
| |
|
|
|
|
|
| |
- 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.
|
|
|
|
| |
Fix multiple death messages (#3565) and damage server logs after death.
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
| |
settings. (#4811)
Optimize/adjust blocks and active blocks sent at the server based on client settings.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
* 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())
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
Also remove some unused parameters/functions
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Writing an u8 to verbosestream writes a char, not it's numeric value.
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Fix regression of commit
5e507c9829942c434a6f1ae7a4f3a488c7e50bef "Add server side ncurses terminal"
which allowed all players, even those without a shout priv, to chat.
Fixes #3362.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Remove DTIME macro and its uses, too
|
|
|
|
|
|
| |
- SRP: print the address only once, not twice
- Legacy: previously the address was not printed at all
- Make both messages structurally the same, to facilitate log analyzers
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Do two renames:
* SER_FMT_CLIENT_VER_LOWEST -> SER_FMT_VER_LOWEST_WRITE
* SER_FMT_VER_LOWEST -> SER_FMT_VER_LOWEST_READ
Now the two define values are consistently named with the _WRITE defines
SER_FMT_VER_{HIGHEST,LOWEST}_WRITE, and to better point out what the two
serialisation versions actually are for.
2. wrap some lines in doc/worldformat.txt, and point out that the node
timers are serialized at a later point, as this can cause confusion about
what now happens (if one doesn't strictly read the if block's conditions).
3. some whitespace fixes in NodeTimerList::serialize, and one new comment.
|
|
|
|
|
| |
-> Fix server crash with protocol >=25 if a default password is set.
-> Remove some useless and possibly confusion causing code for the TOCLIENT_FIRST_SRP packet handler
|
| |
|
|
|
|
|
| |
Use wide_to_utf8 and utf8_to_wide instead of wide_to_narrow and narrow_to_wide at almost all places.
Only exceptions: test functions for narrow conversion, and chat, which is done in a separate commit.
|
| |
|
|
|
|
| |
Thanks to @UltimateNate for pointing this out :)
|
|
|
|
|
|
| |
Also, clean up surrounding code style
Replace by-value parameter passing with const refs when possible
Fix post-increment of iterators
|
|
|
|
|
| |
Its a possible mistake to log in to a server with twice the same name.
Before, it triggered a server wide error message, now it logs to actionstream.
|
|
|
|
| |
Also rename method to better match what it does.
|
|
|
|
| |
This enables srp.
|