Commit graph

5105 commits

Author SHA1 Message Date
Lucas Nicodemus
fb84ebc283 Remove "potential lag spike" warning when saving
It just seems silly to say "potential lag spike" when the world saves
because we have SSDs now, and quite frankly it's not hard to write a
file out.
2021-06-05 20:30:08 -07:00
Lucas Nicodemus
b72ed1542f Version tick: 4.5.4 2021-06-05 20:04:14 -07:00
Lucas Nicodemus
8ad10907be Merge branch 'h/ar' into general-devel 2021-06-05 16:43:30 -07:00
Lucas Nicodemus
df3168be34 Update submodule (again) for final blocking change
The commits before the "Revert changes to submodule" commit are very
cursed and I'm not going to try to rebase to fix things.
2021-06-05 16:34:21 -07:00
Lucas Nicodemus
39e7de1d7c Merge branch 'h/door' into general-devel 2021-06-05 15:34:29 -07:00
Lucas Nicodemus
b69d65bb3d
Merge pull request #2361 from Pryaxis/h/iso-like-backups
Implement ISO8601 style dates for backup filenames
2021-06-05 15:34:01 -07:00
Lucas Nicodemus
5b6e31677e Implement ISO8601 style dates for backup filenames
This partially implements ISO8601 + RFC3389 dates for backup filenames.
As noted in the changelog, this was a sponsor request, and also, it's
impossible to put the `:` literal in most files in most filesystems. So
as a result, this is technically not compliant with ISO8601 or RFC3389
but it is closer.

Also, wait, I don't even know because I don't have enough money to buy
ISO8601 so we'll just assume this is compliant. Job = done.
2021-06-01 23:23:49 -07:00
Lucas Nicodemus
89555beb73 Revert "Revert "Merge branch 'patch-28' into general-devel""
This reverts commit 258b21dddb.
2021-05-29 17:58:57 -07:00
Lucas Nicodemus
bf684ab89b Fix formatting issues in markdown land 2021-05-29 13:36:31 -07:00
Lucas Nicodemus
4aca52ee10 Add security policy to satisfy github 2021-05-29 13:35:23 -07:00
Lucas Nicodemus
e390391d49 Merge branch 'general-devel' into h/ar 2021-05-29 02:33:39 -07:00
Lucas Nicodemus
1a2281865d Remove now defunct comment 2021-05-28 23:55:27 -07:00
Lucas Nicodemus
ac5539947a Merge branch 'general-devel' into h/door 2021-05-28 23:53:43 -07:00
Lucas Nicodemus
580b6d7c61 Add OnDoorUse hook/event in GetDataHandlers 2021-05-28 23:53:29 -07:00
Lucas Nicodemus
0e70d7a93a Undo changes to submodule file
This reverts changes to the TSAPI submodule because if you're unlucky,
you can get git into a nasty state where it doesn't know up from down
anymore. This leads to bad things. Very bad things.

If you get git into a nasty state use:

1. rm -rf git/modules/TShockScaffoldAPI
2. git submodule deinit --all -f
3. git submodule init
4. git submodule update
2021-05-28 23:49:49 -07:00
Lucas Nicodemus
e3b5d31b90 Update submodule to block AutoRegister <= 1.2.0
For more information, see
4fe71f8cdf
or the underlying changelog message.
2021-05-28 23:00:12 -07:00
Lucas Nicodemus
e404176a3b Fix minor inaccuracies in readme
1. Fixes weird whitespace artifacts.
2. Updates suggested things to eat.
3. Notes that the collaborators section is out of date.
2021-05-28 20:35:41 -07:00
Lucas Nicodemus
be2b817abd Merge remote-tracking branch 'moist/patch-28' into general-devel 2021-05-28 20:24:51 -07:00
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
stacey
a369a25084
Update TShockAPI/Bouncer.cs
Co-authored-by: Lucas Nicodemus <shank@shanked.me>
2021-05-28 23:12:39 -04:00
Lucas Nicodemus
707683a0f2 Fix whitespace changes that are confusing 2021-05-28 19:52:42 -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
d8512b842c Merge branch 'general-devel' into h/ips 2021-05-28 19:43:16 -07:00
Lucas Nicodemus
a2d1e2c819 Change changelog to use merge=union
This adjusts the .gitattributes file to allow git to understand how to
better merge the changelog using merge=union.

> If there are conflicts, the user should edit the result and delete one of the alternatives. When --ours, --theirs, or --union option is in effect, however, these conflicts are resolved favouring lines from <current-file>, lines from <other-file>, or lines from both respectively. The length of the conflict markers can be given with the --marker-size option.

See also:

1. https://about.gitlab.com/blog/2015/02/10/gitlab-reduced-merge-conflicts-by-90-percent-with-changelog-placeholders/
2. https://git-scm.com/docs/git-merge-file
3. https://about.gitlab.com/blog/2018/07/03/solving-gitlabs-changelog-conflict-crisis/

No idea if this will work on github dot com, but it may work on git
locally.
2021-05-28 19:39:08 -07:00
Lucas Nicodemus
5e09f5133d Merge branch 'general-devel' into h/ips 2021-05-28 19:36:25 -07:00
Chris
5ff568ebde
Merge pull request #2349 from moisterrific/patch-27
Fix getting kicked for throwing rotten eggs @ town NPCs while wearing Frost armor
2021-05-28 17:48:59 +09:30
Lucas Nicodemus
177648c8c3 Change Bouncer internal handlers to private set 2021-05-28 00:02:59 -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
d78de5719e
Fix formatting 2021-05-27 18:51:27 -04:00
stacey
a5eeb0788a
Even better solution 2021-05-27 18:39:50 -04:00
stacey
8b3e1b68c9
Update CHANGELOG.md 2021-05-27 18:11:45 -04:00
stacey
6592a880bc
Improve on prev code
Thanks to everyone who helped on discord
2021-05-27 18:08:53 -04:00
stacey
98a93693da
Fix Torch God biome torch swap issue
Can confirm this fixes the issue but not sure if it opens any new exploits
2021-05-27 13:00:33 -04:00
stacey
e30b851b0f
Update CHANGELOG.md 2021-05-26 19:37:12 -04:00
stacey
09f75e0db9
Update OnNPCAddBuff to account for Frost armor set
This fixes false positive cheat detection when throwing rotten eggs at town NPCs while wearing Frost armor set. Also made the debug and kick messages more clear for future reference.
2021-05-26 19:31:46 -04:00
Lucas Nicodemus
e5e66264d5 Remove Dangerfile
We aren't using Danger anymore (short lived!) so this is just
superfluous.
2021-05-25 22:55:39 -07: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
Lucas Nicodemus
666a07f5cf
Merge pull request #2340 from bartico6/fix-worldmode
Add WorldInfo broadcast in /worldmode
2021-05-24 02:27:34 -07:00
quake1337
5b9e1dc871 Add WorldInfo broadcast in /worldmode 2021-05-24 10:41:18 +02:00
Chris
d06a6ed0c0
Merge pull request #2337 from Quinci135/general-devel
Fix torchflags
2021-05-24 16:22:26 +09:30
Quinci135
5ac48019ab
Change happyFunTorchTime from true to false
This is set to true when the player obtains the torch god's favor item
2021-05-23 17:11:06 -07:00
Lucas Nicodemus
aee0661192
Merge branch 'general-devel' into general-devel 2021-05-23 13:16:01 -07:00
Lucas Nicodemus
d60a25b211 Use GitHub token built into GHA
Okay, now we're at problem 74 with github actions. Basically, github
actions doesn't send secrets to forks because duh, that makes sense. So
even if you make a super restricted token you still can't send it to
forks because github still doesn't understand how to make a security
platform when they just copy paste azure pipelines into github and then
say "well looks good to me" and ship fucking arbitrary code execution to
the entire fucking world and then try to retroactively fix all of their
mistakes and fail miserably in the process
2021-05-23 13:14:21 -07:00
Lucas Nicodemus
305fa2c594
Merge branch 'general-devel' into general-devel 2021-05-23 13:12:29 -07:00