Commit graph

453 commits

Author SHA1 Message Date
Lucas Nicodemus
258b21dddb Revert "Merge branch 'patch-28' into general-devel"
This reverts commit d2179e95ff, reversing
changes made to 58d7e26960.
2021-05-28 20:21:14 -07:00
Lucas Nicodemus
d2179e95ff Merge branch 'patch-28' into general-devel 2021-05-28 20:18:56 -07:00
Lucas Nicodemus
58d7e26960 Merge branch 'h/warn-logins' into general-devel 2021-05-28 19:49:37 -07:00
Lucas Nicodemus
c65c1ff448 Merge branch 'h/amf' into general-devel 2021-05-28 19:49:29 -07:00
Lucas Nicodemus
5e09f5133d Merge branch 'general-devel' into h/ips 2021-05-28 19:36:25 -07:00
Lucas Nicodemus
046d52ad2e Move emoji player index check into IllegalPerSe
This is the first commit in a pattern that I'd like to follow. The
concept is that we specifically create handlers for things that are
"illegal per se." That is, there are no possible situations (in the
current protocol) where a packet of this type is received from a client.
In this case, I moved the emoji handler out of the Handler just for
emoji, since it seemed like an obvious case.

The rule of thumb is simple: if something is illegal per se, there
should be no possible way in the vanilla client to achieve this result.
If a player sends this combination of packets they *must* be hacking.
Not that there is a 99.9% chance they're hacking, but that there is a
100% unambiguous chance that they're hacking.

Something is illegal per se if it can only be created by a hacked
client. If there's a crashing bug that a normal player can do with a
complex series of vanilla events, that is not illegal per se.

The goal of this namespace and class of handlers is to handle exactly
one type of protocol violation, and remove the packet accordingly. If it
is ever reported that the packet can be sent from a vanilla client, the
check must be removed as it is no longer a per se violation of the
protocol.
2021-05-27 23:59:43 -07:00
stacey
8b3e1b68c9
Update CHANGELOG.md 2021-05-27 18:11:45 -04:00
stacey
e30b851b0f
Update CHANGELOG.md 2021-05-26 19:37:12 -04:00
Lucas Nicodemus
dd972a7f31 Warn users about odd password conditions
TShock was originally designed to handle many things that Terraria did
not. Therefore, TShock always "took over" for the server password
prompt. We then added the ability to login via the password prompt if
you had an account, so that you could play on a server and login without
having to run /login in the chat window. Then, UUIDs were introduced,
and we added the ability to login via UUID.

This has created a cascading scenario where users are potentially
affected by many different things. We have always treated a user's
runtime intent as the most important: if a user sets something on the
console, it should be taken as the "most true" setting. In other words,
we believe that the most recent choice the user made is the valid one.
But for some of the config settings we have, we've made it opaque as to
how this decision making works. We also aren't clear what certain things
do by default.

Currently, if UUID login is enabled, a user will login "magically" and
bypass any password prompt. Even if this is disabled, though, users are,
by default, allowed to enter their passwords at the password prompt
instead of the server password. Both of these take priority over the
runtime setting.

The problem is that we haven't really made it clear if we should
override the runtime setting here. This is because the Terraria
interactive prompt asks for a server password, and one of the two
"bypass" settings is not a password setting at all. What do we respect?

I decided that the best approach is to just communicate really loudly
about these settings. If a runtime password is set, we'll warn users if
either of the bypass settings are "in play." If it's not set, we'll warn
users if the server password was set in config.json, just so they know
which password is being used.

If UUID logins are enabled we'll also warn users about that and the
security risks attached, no matter what. I don't know that we should
really have this feature, but we shouldn't get rid of it, imho.

The only thing I don't think we need to warn about is if login before
join is enabled. Login before join just acts as a way to speed up logins
for registered users. In an ideal world, users who shouldn't be able to
login should be banned. But I split the difference since we're warning
about UUID logins.

The only real downside to this change is that the PostInit hook gets
bigger. But dumping this stuff in another file/area/etc., seems dumb
since some of the logic exists here already. I think we can refactor
this later, but it's not my most pressing priority.

This whole change was inspired by the fact that @Onusai tried to lock
down their server but failed because of these settings enabled. We need
to be more transparent about logins, and this is a good first step.
2021-05-25 22:49:01 -07:00
Lucas Nicodemus
e73ce17130 Add fallback for finding players using tsi & tsn
This commit adds a fallback to address problems with FindByNameOrID
potentially returning ambiguous results. Now, in response to a multiple
match error, a player can specify tsi:[number] or tsn:[exact name] to
match a user ID or name exactly. This behaves analogous to the old
behavior of the search method.
2021-05-25 19:25:30 -07:00
Lucas Nicodemus
09fe254f17 Change TSPlayer.FindByNameOrID to keep searching
Currently, the TSPlayer FindbyNameOrID method aborts if it finds an
"exact match" based on this criteria:

1. If the player ID is on the server, it must be the thing we're looking
   for. Therefore, return that.

2. If the case sensitive "exact match" is on the server that isn't an
   ID, that must be what we're looking for. Therefore, return that.

3. Just yolo and downcase everything and return any number of matching
   players next.

This commit changes the behavior because some players have been joining
servers with ambiguous names, like `1`. In the current system, this
player is difficult to query because they're an "ID" and therefore an
exact match will be returned even if a player name exists that matches
the criteria.

This also alleviates the issue of a case exact match falling down the
same trap. It's ambiguous enough in all of these situations that an
admin should just be using a player ID instead.`
2021-05-25 18:39:56 -07:00
Lucas Nicodemus
00f10fed06 Fix changelog typo
Send/Net flipped
2021-05-24 02:35:37 -07:00
Lucas Nicodemus
ef0e83d5cc TSAPI: Add OnSendNetData hook (thanks @Stealownz!) 2021-05-24 02:32:10 -07:00
quake1337
5b9e1dc871 Add WorldInfo broadcast in /worldmode 2021-05-24 10:41:18 +02:00
Quinci135
5581bf5e45 Fix torchflags
UsingBiomeTorches: Whether or not the player has the torchgod biometorches ability enabled
HappyFunTorchTime: Whether or not the player has fought the torchgod before (for logic that checks for torchgod spawning)
unlockedBiomeTorches: Whether or not the player has the torchgod biome torches ability unlocked
2021-05-23 04:48:01 -07:00
Lucas Nicodemus
6856c867dd Use correct value to read usingBiomeTorches in GDH
This fixes a ridiculous typo in GetDataHandlers where we were setting
the UsingBiomeTorches flag based on having unlocked biome torches,
rather than actually being used. Thanks to @Arthri for the tip!
2021-05-23 03:21:56 -07:00
quake1337
02b4bf7973
Update CHANGELOG.md
Address @hakusaro's suggestion for the changelog.

Co-authored-by: Lucas Nicodemus <shank@shanked.me>
2021-05-21 14:18:28 +02:00
quake1337
817dfe26fc Address feedback from @hakusaro about style & documentation 2021-05-21 13:13:06 +02:00
quake1337
0cad24abf7 Merge branch 'advisory-fix-1' of github.com:Pryaxis/TShock-ghsa-q776-cv3j-4q6m into advisory-fix-1 2021-05-21 12:00:03 +02:00
quake1337
ccf5a422ff Update CHANGELOG.md 2021-05-21 11:58:33 +02:00
Lucas Nicodemus
68ae73ffef Warn players if bypass SSC permission is enabled
If a player has the tshock.ignore.ssc permission, odds are that they may
want to know that their data isn't being saved or not. This change
allows users to be notified if they have SSC data stored in the DB but
they aren't having it loaded due to the aforementioned permission.

This permission causes great confusion, but we can't really change it
because we would break existing setups. This is an easy change that
gives people a reason why they suddenly "have no items."

This new option can be turned off in the config file for SSC if it's not
desired.

This change also modifies some of the log messages so that it's clear
why the SSC save didn't occur for a given player.
2021-05-21 01:16:04 -07:00
Lucas Nicodemus
39147355c1 Automatically back up the world by default
Backups run every 10 minutes for up to 4 hours of backups to prevent
against accidental data loss.
2021-05-20 03:31:37 -07:00
Lucas Nicodemus
91bf525a4a
Add upcoming buff changes to changelog 2021-05-20 01:58:37 -07:00
Lucas Nicodemus
e5ffbfde91
Add command specifier support in motd to changelog 2021-05-20 01:54:33 -07:00
Lucas Nicodemus
38c070ad03
Update changelog with upcoming MOTD changes 2021-05-20 01:53:25 -07:00
Lucas Nicodemus
465537b424
Update changelog with log changes from @QuiCM 2021-05-20 01:50:28 -07:00
Lucas Nicodemus
154456bbb5 Update submodule for TSAPI to fix #2304 2021-05-19 23:51:34 -07:00
Lucas Nicodemus
d82db22e5d Tick submodule for 1.4.2.3 2021-05-16 19:17:51 -07:00
stacey
708b455d6b
Add HealOtherCheck to changelog 2021-05-12 12:13:23 -04:00
James Puleo
b3cf5f4e43
Implement additional teleport permissions.
This adds the follows permissions to the following items:
- tshock.tp.tppotion:   Teleportation Potion
- tshock.tp.magicconch:  Magic Conch
- tshock.tp.demonconch: Demon Conch
2021-05-11 14:17:36 -04:00
Chris
19cc3f9b4c Update changelog for new REST perm 2021-04-22 17:28:16 +09:30
Lucas Nicodemus
8a3a339976
Fix silly changelog typo 2021-04-21 20:22:11 -07:00
Lucas Nicodemus
6bb4230bc3 Remove /ungodme
With 1.4.2.2, we no longer need to offer an escape hatch due to the
underlying bug involving godmode being permanently applied to local
players now having been fixed.
2021-04-21 20:16:57 -07:00
Lucas Nicodemus
4668ab86a0 Version tick: 4.5.2 2021-04-21 19:58:36 -07:00
Lucas Nicodemus
fb62110b76 Add preliminary support for Terraria 1.4.2.2 2021-04-21 19:43:35 -07:00
Lucas Nicodemus
f8c265d74c Version tick: 4.5.1 2021-04-19 10:54:12 -07:00
Chris
01fc41968d Refactor wallow command & update changelog 2021-04-19 22:04:41 +09:30
quake1337
663041e8b0 Fix /r against offline players.
- Offline players will no longer be valid /r targets.
2021-04-17 10:11:49 +02:00
quake1337
3b58b0ad16 Update changelog 2021-04-16 06:30:12 +02:00
Lucas Nicodemus
173d6f71f5
Update changelog 2021-04-12 23:21:51 -07:00
Lucas Nicodemus
00b4eb6774
Update changelog 2021-04-12 23:20:10 -07:00
Chris
196a16c321 Changelog update 2021-04-13 13:59:56 +09:30
Lucas Nicodemus
099256bdba Normalize changelog 2021-04-12 11:09:58 -07:00
Luke
29e55a866d Update CHANGELOG.md 2021-04-11 21:18:52 +10:00
Lucas Nicodemus
78eab01904 Fix ban system conversion issue with MySQL
DeathCradle spotted a typo in the ban converter and identified that the
issue is likely because we used table_name in some, but not all, of the
conversion SQL.

Co-authored-by: DeathCradle <rt.luke.s@gmail.com>
2021-04-11 00:12:28 -07:00
Lucas Nicodemus
c8bed97a21
Update changelog with latest changes 2021-04-10 20:34:39 -07:00
Chris
b4789607f6 Implement suggestion for fixing forceupdate flag 2021-03-23 11:44:24 +10:30
Chris
36b5d4e9f7 Updated changelog for stoned & webbed 2021-03-23 11:37:05 +10:30
Rozen / Nova
2b3b0273e3
Update CHANGELOG.md 2021-03-21 02:09:23 +01:00
Rozen / Nova
0edab1de83
Update CHANGELOG.md 2021-03-21 02:08:53 +01:00