Commit graph

5121 commits

Author SHA1 Message Date
James Puleo
98c1587e44
Print proper expected player ID when handling
spoofed LandGolfBallInCup.

(edited manually on GitHub, should be okay though)
2021-06-14 03:00:35 -04:00
Lucas Nicodemus
f1481dd0ec Add more helpful notes to changelog re. config
This adds more notes to the changelog for the config file change.
2021-06-13 13:44:39 -07:00
Lucas Nicodemus
a88c44e0db Remove old ConfigFile class
This was deprecated and replaced.
2021-06-13 13:20:43 -07:00
Lucas Nicodemus
95346e36d4 Update credits on the for group deletion
Fixes #2165 (as of 4d46e58865)
2021-06-13 01:15:42 -07:00
Lucas Nicodemus
4d46e58865 Prevent users from removing default guest group
The default guest group is critical and shouldn't be removed without
either TShock doing something like automatically recreating it if it
doesn't exist, or not having a huge problem if it doesn't exist.

I chose to take the easiest path, preventing users from removing it. In
theory the message gives enough context to imply "okay, go change the
group now."

This should be a relatively small edge case but I wanted to resolve it
while I was here.
2021-06-13 01:09:03 -07:00
Lucas Nicodemus
25a7e9e83a Fix warp send nullcheck
@punchready reported that there was an issue with the /warp send command
checking for position != (0,0). I tried to figure out what was going on
here, and I came up dry. I think this is vestigial from some other
database or file format storage. When @MarioE converted everything to
the new warp system, he preserved the check. The problem is that the
check seems to be based on the idea that a non-existent warp would
return the default constructor (which would contain Point.Zero).
Instead, a warp not found returns a null now.

Therefore, the proper thing to do, as implied by @punchready, is to
simply nullcheck this value instead.
2021-06-13 00:14:32 -07:00
Lucas Nicodemus
eba106a6da Add obvious deprecation warnings to comments
(In the old ConfigFile to prevent repeat incidents of
8cd6bf7d7b)
2021-06-13 00:04:45 -07:00
Lucas Nicodemus
8cd6bf7d7b Fix failure to apply default config changes
TShock.ConfigFile was deprecated and therefore changes applied in
previous commits were not applied until now.

See:

* f567486c47
* 39147355c1
* 597e403d50
2021-06-12 23:56:23 -07:00
Lucas Nicodemus
da163b80ac Allow operators to disable build permission notices
This commit allows server operators to disable build permission failure
notices. This is because some servers wish to have a "silent" operation
mode where the server doesn't send out these messages to users. This
makes sense, e.g., when the server is a "museum" and isn't intended to
be changed.
2021-06-12 23:53:17 -07:00
Lucas Nicodemus
f567486c47 Change default config for respawn timer to 10s
The default value for the respawn timer was 5 seconds, but this always
looked wrong because the default game respawn time is at least 10
seconds for classic characters. This can always be changed in the config
file, but looks significantly better when it matches the default imho.
2021-06-12 22:27:39 -07:00
Lucas Nicodemus
4100ecb64e Fix dead players being able to run /home
This commit fixes an issue where players could bypass the respawn timer
by using /home. Specifically, TShock rejects the command if the player
is dead.
2021-06-12 22:26:01 -07:00
Lucas Nicodemus
fd97c2268a Send success messages as Color.LightGreen
Basically Color.Green looks ugly and Color.LightGreen looks less ugly. I
could see changing the default to something like pure green, but I think
this might cause people to be like "yo why is this so bright."

Now arguably this should be configurable but I'm not going to
revolutionize the world by abandoning far more important work to allow
more artful messages. I just think that Color.Green is ugly enough that
I can't tolerate it.
2021-06-12 13:22:56 -07:00
Lucas Nicodemus
34da464bab Intercept console interrupt and handle nicely
Long ago in the early days of TShock someone asked why CTRL + C wasn't
handled and there was an explanation given along the lines of "something
something not supported on mono something something" or similar.
Attempts were made to try to handle console interrupts unsuccessfully
and the code was ripped out.

However, it's 2021, and we can now handle this signal and do the right
thing (which, ostensibly, is to save the world and shut down). Many
people like me reflexively hit CTRL + C because they want to shut down
the process. It's very infuriating that the current behavior results in
the server just dying and nothing being cleaned up properly.

Therefore, this commit changes the behavior to handle the interrupt,
save the world, and shut down nicely.

(If you still want to shutdown without saving the world, use off-nosave,
or idk, send SIGKILL).
2021-06-12 12:18:55 -07:00
Lucas Nicodemus
933c5f9e49 Fix typo in "Amethyst Gemtree"
🍬
2021-06-11 10:22:39 -07:00
Lucas Nicodemus
bf403a17ec Add /god alias for /godmode
Some of these commands really need more intuitive aliases. Therefore,
I've added another intuitive alias that matches other server mods.
2021-06-06 01:19:12 -07:00
Lucas Nicodemus
f811be6cf8 Add /slay alias for /kill
Like all of the other server mods I've used use /slay and not /kill and
it's really frustrating to type the wrong thing so I'm just going to add
an alias and hope nobody else minds.
2021-06-05 20:32:29 -07:00
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