Commit graph

470 commits

Author SHA1 Message Date
Lucas Nicodemus
56041f2c1a
Merge remote-tracking branch 'ghsa/handshake-final-update-fix' into general-devel 2025-03-10 01:08:28 +09:00
Lucas Nicodemus
329fce0089
Merge branch 'general-devel' into feature/properly-seed-group-names-in-database 2025-03-10 00:51:37 +09:00
Lucas Nicodemus
13a4a0864b
Merge branch 'general-devel' into playerdata-changes 2025-03-10 00:39:33 +09:00
ohayo
6d5fff83cf Prevent blank UUIDs from being banned
This fixes a bug with a bad actor getting banned with a blank client UUID and then preventing anyone from joining the server due to a lack of UUID on the Connect Request ban check.
2025-02-08 14:37:48 +10:00
ohayo
5a23073db5 Suggestions + fix last missed magic number 2025-02-05 09:33:36 +10:00
ohayo
ce04d9d173 Remove magic number + Use suggestions by particles
Added a new ClientState enum based on code in Terraria.MessageBuffer.GetData & Terraria.Netplay.InnerClientLoop
2025-02-04 21:06:40 +10:00
AkjaHAsLk1IALk0MasH
a6666ff21a Updated the message 2023-06-10 13:59:38 +07:00
AkjaHAsLk1IALk0MasH
1e037748c1 Updated the UserManager.SetUserGroup.
Added an exception `UserGroupUpdateLockedException`, which appears when a hook locks a group change.
Added an overload for `UserManager.SetUserGroup`, with the `TSPlayer` parameter (author)
2023-05-14 12:13:56 +07:00
AkjaHAsLk1IALk0MasH
22d8575e01 Corrected the UserAccountNotExistException documentation. 2023-05-14 12:04:17 +07:00
AkjaHAsLk1IALk0MasH
b184133a7f Updated the call to the obsolete constructor PlayerData 2023-05-14 10:43:01 +07:00
Stargazing Koishi
fc4c509285
Add a check to InsertPlayerData to prevent data overwrite 2023-01-11 02:23:01 -08:00
James Puleo
872b239b47
Seed initial group database with default and guest names from config
The `GroupManager` constructor ensures the structure of the `GroupList`
table, and if the table is newly-created, then some initial data is
seeded.

We previously used the names `default` to represent the group that
accounts are defaultly registered to, and `guest` to represent players
that have not logged in yet. We now instead refer to the group names
specified by the config (`DefaultRegistrationGroupName` and
`DefaultGuestGroupName` respectively)
2022-12-14 21:41:37 -05:00
hufang360
ca93fa685e Fixed SSC not save ateArtisanBread, usedAegisCrystal, usedAegisFruit, usedArcaneCrystal, usedGalaxyPearl, usedGummyWorm, usedAmbrosia, unlockedSuperCart, enabledSuperCart flags, and Server will correct read them. 2022-10-24 13:27:50 +08:00
Lucas Nicodemus
41bc22e292
Fix broken interpolation in CharacterManager 2022-10-23 07:22:13 -07:00
James Puleo
bfaa47ad1a
Introduce support for loadouts, and save current loadout index to SSC
We needed to modify `NetItem` to know that these new inventory now
exist.

`PlayerData` can now re/store these items, and properly sync them. It
also now knows of the player's currently selected index, and how to sync
it.
2022-10-22 17:36:57 -04:00
Janet Blackquill
f63b26ac76 Some i18nifiying 2022-10-21 16:12:04 -04:00
James Puleo
aa17f013c1
Use a string interpolation and escape single quotes when escaping tables 2022-10-05 13:57:30 -04:00
Lucas Nicodemus
a01b48ead5 Remove dead code: DBTools.cs 2021-11-22 19:27:40 -08:00
Lucas Nicodemus
9416e8f1e2 Remove DIY password hashing crypto
The old system for hashing passwords and permitting users to select
their algorithm has been deprecated and phased out since 2015. This
removes the remaining functions for hashing passwords to clear the way
for .NET5/6 and for OTAPI 3.

In 211b70ca37, I allowed blank passwords
to upgrade to bcrypt hashes. However, the minimum password length has
been 4 historically for a long time. So I don't actually assume a lot of
users have blank passwords, so I think there are very few, if any of the
old hashes laying around.

So therefore, I think this is pretty much safe to merge.
2021-11-22 10:26:57 -08:00
Lucas Nicodemus
211b70ca37 Upgrade blank passwords to bcrypt hashes
Previously, blank passwords were not upgraded to bcrypt hashes. This is
annoying and problematic because it makes it difficult to remove the old
password hashing system because those passwords might still be checked
against non-bcrypt hashes.
2021-11-21 14:44:53 -08:00
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
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
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
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
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
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
stacey
62d15cf445
Add tele potion and conch perms to default 2021-05-16 20:57:26 -04:00
Chris
e80f0bfda5 Add ban ticket ID to ban messages 2021-04-19 21:48:34 +09:30
Luke
d0ce5746ea Fix mysql & sqlite ban manager migration during init
Tested with existing bans in both sqlite & mysql environments.
This is in addition to the syntax fix from earlier.
2021-04-11 21:18:37 +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
Chris
9423febd0a Refactor for new configuration 2020-12-03 17:43:10 +10:30
Chris
ae8ab04e8a Change BanManager.Bans to a readonly dictionary
Entries to this dictionary should be added through `InsertBan` rather than directly to the dictionary
2020-12-03 14:25:38 +10:30
Chris
24a4ab885c Offload ban checking to BanManager
Remove ban immunity
2020-11-29 18:10:47 +10:30
Chris
af9957f8ec Refactoring based on suggestions 2020-11-29 16:18:09 +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
Chris
c71cf79125 Refactor 'Id' to 'TicketNumber' and extend the identifier model 2020-11-29 14:23:58 +10:30
Chris
cde4cc5f04 Ban rewrite and various other adjustments 2020-11-26 17:20:19 +10:30
Chris
56de9f6684 Ban rewrite 2020-11-15 11:05:04 +10:30
Stealownz
8969ce4a94 Add Torch God's Favor to SSC
Closes #2031
2020-11-01 22:55:50 +08:00
ZakFahey
90f519a1c6 Overwrite the config if any new fields are missing 2020-08-01 10:13:04 -07:00
stacey
5b44c9dd84
Fix formatting...again 2020-06-13 10:41:02 -04:00
stacey
a345587bd0
Add spawnpets perm to trustedadmin & owner
Also fix a few formatting inconsistencies that was the result from editing on mobile
2020-06-12 19:18:44 -04:00
moisterrific
470da46511
Add new perms and move more perms to trustedadmin
Add new journey mode research perm and move all existing journey perms from owner to trustedadmin. Also added pylon tp to default and added /spawn perm to admin.
2020-06-06 00:28:21 -04:00
Patrikkk
f538ceb793 Adding EmojiHandler to handle an exploit. Adding sendemoji permission and checks.
I know, this is not something important, but I'm going through the new packets one by one and adding events developers can work with, patching exploits, and thought this could be a core permission.
2020-06-01 15:24:02 +02:00
Lucas Nicodemus
a0726ad8bb
Merge branch 'general-devel' into patch-7 2020-05-30 00:18:44 -07:00
Lucas Nicodemus
f82ab41a25
Add /sync command to alleviate door related sadness
Run /sync if your doors disappear. This will resync your local client
with the server state. For more information, please see the associated
changelog entry.
2020-05-29 21:04:48 -07:00
moisterrific
51d2d9af69
Fix error in previous change
there's no setdawn, made the mistake of looking at a prev commit instead of the most current version of permissions
2020-05-26 18:51:15 -04:00
moisterrific
2c384aaaeb
Add journey permissions to trustedadmin and owner
hope im doing this right lol
2020-05-26 17:17:01 -04:00
Lucas Nicodemus
0e711da8cc
Merge branch 'general-devel' into region-mysql 2020-05-25 00:40:08 -07:00