Commit graph

1109 commits

Author SHA1 Message Date
James Puleo
3163c88d4a
Allow PacketTypes.SyncLoadout during early connection
This mirrors the behavior in `MessageBuffer` when only accepting
specific packets under state `10`.
2022-10-22 17:14:56 -04:00
Luke
aa0bd7deb2 Merge branch 'general-devel' into otapi3 2022-09-06 22:23:34 +10:00
Lucas Nicodemus
1d4d19f961 Version tick: 4.5.18
And also, add changelog entry for dependabot change
2022-08-16 20:57:26 -07:00
NotGeri
953622c8e1 Add -worldevil startup parameter 2022-06-29 17:10:18 +02:00
Lucas Nicodemus
07becc3c8f Change language from fatal startup exceptions
The previous language was true but slightly unhelpful to non-native
English speakers and users who aren't familiar with server software.
When a fatal startup exception occurs now, TShock tells you what this
means and that it won't be able to start until this is resolved.
2022-04-02 11:53:53 -07:00
Lucas Nicodemus
32f2f6a33d Merge branch 'general-devel' into otapi3 2022-04-01 01:10:00 -07:00
Luke
b01c75b274 Remove older SQLite SetDllImportResolver call 2022-03-27 21:54:28 +10:00
Luke
c063aabbc0 Switch to Microsoft.Data.Sqlite for arm64
There is a slight change the the way QueryResult works in order to satisfy the variances in the new library.
Disposing of the command with the reader appears to solve this, and hopefully, with minimal impact to plugins.
2022-03-27 21:38:58 +10:00
Lucas Nicodemus
1e5e3cd864 Version tick: 4.5.17 2022-03-18 20:35:50 -07:00
gohjoseph
203b9bf281 Remove unneeded kick display adminUsername 2022-03-18 01:56:59 +08:00
gohjoseph
8b064a7e22 Fix NetHooks_NameCollision to kick duplicate players.
- Fixes Pryaxis/TShock#2530
2022-03-18 00:35:02 +08:00
Luke
d2a060b76e Create module subsystem under TShockAPI.Modules
This should allow for TShock.cs to be split up to mini-modules, or "micro-plugins"
2022-03-05 22:49:52 +10:00
Lucas Nicodemus
d3adc6db42 Merge branch 'general-devel' into otapi3 2022-02-28 22:32:22 -08:00
Lucas Nicodemus
0f13de4ee3 Version tick: 4.5.15 2022-02-28 14:04:34 -08:00
Lucas Nicodemus
aafed511a6 Swap 0 with PlayerAnnounceResult.None
In 44034c7649 I added a magic 0 instead of
a call to an enum because I was looking at an outdated diff that didn't
have `None` as an option. Turns out this was added a day later in a
commit I didn't see originally. Changed to `None` to make code better
documentation wise.
2022-02-28 00:34:28 -08:00
Lucas Nicodemus
44034c7649 Set args.Result to 0 in PlayerAnnounce hook
In
8204e2b3f9,
`PlayerAnnounceResult` was introduced, replacing `HookResult`, which changed
the result for `PlayerAnnounce` to a byte called `PlayerAnnounceResult`.
There are two options, `SendToPlayer` and `WriteToConsole`, set to 1 and 2
respectively. Because TShock handles this, we're setting it to 0, i.e.,
don't notify anybody.
2022-02-28 00:20:00 -08:00
Lucas Nicodemus
acde508c53 Merge branch 'general-devel' into otapi3 2022-02-28 00:15:06 -08:00
Lucas Nicodemus
92ea78f4c8 Remove Rpi doomsday scenario 2022-02-25 01:45:55 -08:00
Lucas Nicodemus
6591b455fc Version tick: 4.5.13 2022-02-16 19:45:57 -08:00
Luke
cec53c780f Merge branch 'general-devel' into otapi3 2021-11-27 17:53:28 +10:00
Lucas Nicodemus
996229b9af Force shutdown server if SIGINT is received twice
Previously, I updated the SIGINT handler so that it would safely shut
down. This is because I'm an idiot and like most people like me, I use
CTRL + C as my exclusive way to close all programs in the command line
environment. This poses a risk because it doesn't save the world and
shuts down improperly.

However, I forgot that Terraria has interactive menus that you can't
exit from. So, in these menus, the only way out was CTRL + C. @Onusai
reported this, so this changes the behavior a second time.

Now, when passing SIGINT, you can pass it twice. This will cause the
program to actually exit on the second time, such as when you're stuck
at a menu. Hooray.
2021-11-25 11:26:09 -08:00
Luke
f48dda3ae3 Improve native resolutions 2021-11-24 21:32:11 +10:00
Luke
a5a75e3f50 Implement System.Data.SQLite
TODO: determine if we can do something better than a resolver
2021-11-24 07:49:03 +10:00
Luke
8edd0393e5 Initial OTAPI3 port
TODO: sqlite
2021-11-23 20:49:41 +10:00
Arthri
350d76c315 Fix bad XML(unescaped ampersand) 2021-11-23 17:13:02 +08:00
Lucas Nicodemus
42ca83e6b5 Update version codename and changelog for 1.4.3 2021-11-19 22:39:45 -08:00
Chris
09a2947cf4
Merge branch 'general-devel' into fix-invalid-groups 2021-08-25 19:16:57 +09:30
quake1337
91376ae087
Merge branch 'general-devel' into fix-invalid-groups 2021-07-31 16:38:12 +02:00
quake1337
51348d1806 Fixes for PR 2397.
- GroupManager now validates core groups in the constructor.
- EnsureCoreGroupsPresent -> AssertCoreGroupsPresent.
- Fix indentiation in some places.
- Clarify the intent of this PR in CHANGELOG.md.
2021-07-31 16:34:43 +02:00
stacey
59fddbcfd8
Merge branch 'general-devel' into patch-32 2021-07-24 20:39:27 -04:00
stacey
b5c1640058
Refactor: use more human-readable ProjectileID 2021-07-24 20:08:51 -04:00
stacey
11463930f3
Add DisablePrimeBombs to OnProjectileSetDefaults 2021-07-24 19:53:13 -04:00
Killia0
9b249d72a8
Merge branch 'general-devel' into upstream-general-devel 2021-07-24 19:48:54 -04:00
Lucas Nicodemus
87d5b769c7 Version tick: 4.5.5 2021-07-21 18:46:01 -07:00
Killia0
154bee58f1 Typo fixes on comments/strings
My first PR contribution to TShock is spellcheck huh, frankly I don't know why but hey I could spare the time for this and caught some stuff.
2021-07-16 14:53:37 -04:00
quake1337
f7c550a8ad Fix the server not reporting startup errors correctly. 2021-07-13 21:39:20 +02:00
quake1337
48370d74b7 Missing group safeguards.
- Server will no longer start up when the guest or default groups cannot
  be located.
- Players joining with unknown groups assigned to them will be
  disconnected with an error
2021-07-13 21:33:35 +02: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
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
9ff3036469 Version tick: 4.5.3 2021-05-22 10:54:47 -07:00
Chris
b754f142a1 Change logpath to ./tshock/logs by default 2021-05-14 22:08:32 +09:30
Lucas Nicodemus
4668ab86a0 Version tick: 4.5.2 2021-04-21 19:58:36 -07:00
quake1337
207b43e772 Update /godmode to use JourneyMode Godmode power.
- Previous Bouncer checks for GodMode (namely, Hurt) were removed.
- The command now uses the GodmodePower from core Terraria
- The toggle powers (which this command will now make use of) are now
  reset on disconnect to prevent accidentally "gifting" godmode to an
  unsuspecting player.
2021-04-16 06:11:26 +02:00
Chris
784a75b7c5 Implement handled pattern on the PlayerChat hook 2021-04-13 13:14:56 +09:30
Lucas Nicodemus
67a1a669a4
Update version codename 2021-04-10 20:31:33 -07:00
Chris
b4789607f6 Implement suggestion for fixing forceupdate flag 2021-03-23 11:44:24 +10:30
Lucas Nicodemus
355a7f02f5 Fix ∞ velocity exploit (@bartico6, @tlworks) 2021-01-28 00:39:09 -08:00
Chris
9423febd0a Refactor for new configuration 2020-12-03 17:43:10 +10:30
Chris
24a4ab885c Offload ban checking to BanManager
Remove ban immunity
2020-11-29 18:10:47 +10:30
Chris
29170e62a6 Rename unique ID -> ticket number
Also get ban conversion to execute cleanly and clean up after itself
2020-11-29 15:17:49 +10:30