Commit Graph

77 Commits (6f1c90720402415b62fb4d5e809ec7dbc1cd7f96)

Author SHA1 Message Date
Alex Ford 97908cc656 Add on_secondary_use when right clicking an item in the air 2015-12-02 02:18:44 +00:00
est31 657a16d90c Only allow players with shout to chat
Fix regression of commit

5e507c9829 "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
est31 5e507c9829 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 96cc5b34fe Use warningstream for log messages with WARNING
Remove DTIME macro and its uses, too
2015-10-14 01:36:48 -04:00
Kahrl e0b57c1140 Fix how address is logged when a wrong password is supplied
- 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
2015-10-12 21:47:56 +02:00
kwolekr 7b01b94c6b Remove redundant code in player interact handler 2015-10-04 04:06:26 -04:00
est31 283bf97a1c Serialisation: documentation fixes, clarifying renames and whitespace fixes
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.
2015-09-14 07:02:15 +02:00
est31 a57d83b46a Ask auth handler to create auth when a default password is set
-> 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
2015-07-21 18:12:28 +02:00
kwolekr 1a1774a105 Fix damage flash when damage disabled 2015-07-10 15:58:57 -04:00
est31 b0784ba871 Use UTF-8 instead of narrow
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.
2015-07-08 10:12:44 +02:00
Craig Davison bc55ef337c Use actionstream instead of errorstream when failing to emerge player 2015-06-23 19:25:06 +02:00
est31 e13d2bafc6 Deny empty username early in the protocol
Thanks to @UltimateNate for pointing this out :)
2015-05-22 20:24:39 +02:00
kwolekr da34a2b33e Replace instances of std::map<std::string, std::string> with StringMap
Also, clean up surrounding code style
Replace by-value parameter passing with const refs when possible
Fix post-increment of iterators
2015-05-19 16:10:49 -04:00
est31 497299afd6 Lower log level for unexpected behaviour
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.
2015-05-19 00:55:58 +02:00
est31 c297a75a7d Fix build since last commit
Also rename method to better match what it does.
2015-05-16 22:14:15 +02:00
est31 8dbf683313 Finalize init packets and enable protocol v25
This enables srp.
2015-05-16 21:17:28 +02:00
est31 82e35edff5 Make early protocol auth mechanism generic, and add SRP
Adds everything needed for SRP (and everything works too),
but still deactivated, as protocol v25 init packets aren't final yet.
Can be activated by changing the LATEST_PROTOCOL_VERSION header to 25
inside networkprotocol.h.
2015-05-11 18:40:27 +02:00
est31 ccc09abc2d Protocol 25: wstring -> string for custom access denial reasons
Also fix std::logic_error when server::DenyAccess() is used with only two arguments.
2015-04-22 14:10:39 +02:00
est31 f0a1379e5a Refactor around translatePassword
Change types for passed password from wstring to string, which removes converting
back and forth in most cases. Move the narrow_to_wide conversion, where its neccessary,
closer to irrlicht. Remove trailing spaces in guiPasswordChange.cpp. Make parameters for
translatePassword passed as const reference.
2015-04-17 06:10:30 +02:00
est31 1cb404522f Remove errorstream logging on password change
This seems to be a debug message which has been forgotten to be removed.
2015-04-03 14:01:41 +02:00
Craig Robbins 9527984dbc Move globals from main.cpp to more sane locations
Move debug streams to log.cpp|h

Move GUI-related globals to clientlauncher

Move g_settings and g_settings_path to settings.cpp|h

Move g_menuclouds to clouds.cpp|h

Move g_profiler to profiler.cpp|h
2015-04-01 23:04:25 +10:00
ShadowNinja 93fcab952b Clean up and tweak build system
* Combine client and server man pages.
  * Update unit test options and available databases in man page.
  * Add `--worldname` to man page.
  * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`.
  * Disable server build by default on all operating systems.
  * Make `ENABLE_FREETYPE` not fail if FreeType isn't found.
  * Enable LevelDB, Redis, and FreeType detection by default.
  * Remove the `VERSION_PATCH_ORIG` hack.
  * Add option to search for and use system JSONCPP.
  * Remove broken LuaJIT version detection.
  * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`.
  * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`.
  * Clean up style of CMake files.
2015-03-27 15:00:48 -04:00
Loic Blot 7851c4f7a2 Don't send an InventoryAction at each setInventoryModified, we only need one SendInventory per inventory modification
Client doesn't like to receive multiples SendInventory for one action, this can trigger glitches on clients (sometimes due to incorrect UDP packet ordering due to UDP protocol)

This fix issue #2544
2015-03-24 14:13:17 +01:00
poet-nohit 7679396ebb SendInventory when handleCommand_Interact is a use.
This call was missing when change looping to triggering SendInventory: 1b2f64473e
2015-03-21 21:37:32 +01:00
Loic Blot 8f2e9bfbc2 ServerpacketHandler: spelling fixes 2015-03-18 12:06:02 +01:00
Loic Blot 814e55597d Use the NetworkPacket api to read full version string instead of u8 pointers. Also store the reserved byte to use API properly
Fixes #2509
2015-03-17 14:12:18 +01:00
Loic Blot b560294050 Rename packethandler/{client,server}.cpp to {client,server}packethandler.cpp
* Requested by @Zeno-
* Approved by @nerzhul
2015-03-16 10:19:19 +01:00