Commit graph

963 commits

Author SHA1 Message Date
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
stacey
2a6bc51dd6
Change EoL summon to be more consistent w/ config
now this should be more in line with how other boss summons are currently handled, also made the sundial user messages better thx to quake's suggestions
2021-07-11 23:11:28 -04:00
stacey
65bbd80ca6
Add perm check for EoL + Sundial ForceTime check
If the player does not have permission to summon bosses, they should not be able to kill Prismatic Lacewing, which summons the Empress of Light. 
Using the Enchanted Sundial while ForceTime is set to day or night (via config) will conflict with TShock's continued attempts to set it back to day or night, this makes the world appear very glitchy.
2021-07-04 21:33:48 -04:00
Lucas Nicodemus
1a2281865d Remove now defunct comment 2021-05-28 23:55:27 -07:00
Lucas Nicodemus
580b6d7c61 Add OnDoorUse hook/event in GetDataHandlers 2021-05-28 23:53:29 -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
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
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
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
76ea1760fd
Merge branch 'general-devel' into pscheck 2021-04-22 13:16:40 +09:30
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
3664b81c3f
Merge branch 'general-devel' into pscheck 2021-04-13 16:32:14 +09:30
Stealownz
bc32eab4c8 Update GetDataHandler.HandleProjectileNew to include HasBannerIdToRespondTo 2021-04-05 10:45:41 +08:00
Chris
85fbf593c9 Implement place style checks, courtesy of @AgaSpace 2021-03-22 10:29:09 +10:30
Chris
9423febd0a Refactor for new configuration 2020-12-03 17:43:10 +10:30
Chris
3776a71a20 Handle SyncExtraValue all the time
This may prevent platinum coin duping
2020-12-03 14:26:13 +10:30
Chris
ca38d64632 The great refactoring! Squares to Rectangles 2020-11-13 17:46:00 +10:30
Stealownz
8969ce4a94 Add Torch God's Favor to SSC
Closes #2031
2020-11-01 22:55:50 +08:00
Patrikkk
d4e4692d8b Merge branch 'general-devel' into addtileentityinteraction 2020-06-25 13:41:14 +02:00
Patrikkk
89ab7be0f8 TileEntityInteraction - Pass TileEntity object instead of ID in args. 2020-06-25 01:51:30 +02:00
Patrikkk
38a1351d38 Register DisplayDollItemSyncHandler.
Moved the type check for 0 before itemSetDefaults to have less code run if the empty slots are clicked.
2020-06-25 01:42:22 +02:00
Patrikkk
90dd61e668 Moving the DisplayDollItemSync hook inside null check.
In crafted (hacked) packet sending, people could send the DisplayDollItemSync packet with an entity ID that is not actually a display doll. This would not happen in a normal scenario.
If they send the crafted packet, our hook would have been invoked and it would have contain a null TEDisplayDoll object since we tried to get the TileEntity object as a TEDisplayDoll object.
2020-06-21 15:03:08 +02:00
Patrikkk
408eaf4383 Add TEDisplayDoll object to the event args. 2020-06-19 14:16:27 +02:00
Patrikkk
69f232b12a Adding DisplayDollItemSync event.
An event that is called when a player modifies the slot of a DisplayDoll (Mannequin).

I was trying to think from a developer friendly perspective here.
Instead of passing seperate variables for type/stack/prefix, thought I pass an Item object.
As well as, instead of having devs who work with this hook figure out and implement how to get the Item of the DisplayDoll, I just provide it in the hook.
I can imagine this being used for creative purposes in plugins.
2020-06-19 14:07:39 +02:00
Patrikkk
3012c92370 GetDataHandlers - Add RequestTileEntityInteraction hook. 2020-06-18 16:48:22 +02:00
Patrikkk
11a2a3e21b GetDataHandler - Code formatting. Modify order of Handler to respect PacketType value. 2020-06-18 16:34:33 +02:00
stacey
067006a092
Add clarity to !HasPermission error messages
And a few other minor formatting/grammar changes.
2020-06-13 13:13:46 -04:00
Patrikkk
bcdd0dc8be GetDataHandler - Add missing PlayerInfo data. 2020-06-05 03:46:04 +02:00
Patrikkk
cffdadbc80 Fix previous conflict resolve merging. 2020-06-02 19:10:34 +02:00
Patrikkk
60840807cf Merge branch 'general-devel' into handlesynctilepicking 2020-06-02 19:08:26 +02:00
Patrikkk
0a1f608a3a Fix conflict resolve merge. Make project buildable.
Had a duplicate HandleSyncRevengeMarker method.
2020-06-02 11:59:24 +02:00
Patrikkk
d919c11add
Merge branch 'general-devel' into handlegolfpacket 2020-06-02 11:52:32 +02:00
Patrikkk
0619092ba5 Fix identing after conflict resolve merge. 2020-06-02 11:41:41 +02:00
Patrikkk
f01274164f
Merge branch 'general-devel' into handlesynccavernmonster 2020-06-02 11:39:11 +02:00
Patrikkk
cd58d79322 Kick player on attempting cavern npc type modification. 2020-06-02 11:34:10 +02:00
Patrikkk
3cc8a75b9b
Merge branch 'general-devel' into emojipacketevent 2020-06-02 11:21:19 +02:00
Patrikkk
f7a8695c8f
Merge branch 'general-devel' into handlegolfpacket 2020-06-02 11:15:17 +02:00
Chris
21b51c577c This one should use 'Read' instead of 'Load' as well 2020-06-02 17:26:32 +09:30
Chris
c7a6d044f4 Minor refactors 2020-06-02 17:19:00 +09:30
Chris
c9b015027d Rename NetModulesTypes to NetModuleType 2020-06-02 14:28:09 +09:30
Chris
48d610d33f Move netmodule handling into handlers namespace
Add handler for teleport pylons, and permission for teleport pylons
2020-06-02 12:59:14 +09:30
Chris
b5c3b430fa Standardize permission rejection message again 2020-06-02 10:20:13 +09:30
Chris
d46f534533 Standardize permission rejection messages 2020-06-02 10:18:40 +09:30
Patrikkk
2177d75066 Add SyncTilePicking event. 2020-06-01 18:31:30 +02:00
Patrikkk
ce5ee0d623 Add HandleSyncCavernMonsterType
This packet is never sent from the client to the server in a normal scenario. Although with modded clients, a packet can be sent to modify the cavernMonsterType of the server world and have the world spawn defined NPC types. Can be used to have the server randomly spawn bosses on players in caverns.
Is it okay to have this simple handling in GetDataHandlers? A seperate class felt like an overkill.

Moved the HandleSyncRevengeMarker packet handler to it's "correct" position, so I won't have merge issues between my last PR. As I've mentioned there, we have the Packets in their numerical order.
2020-06-01 17:02:27 +02:00
Patrikkk
2254df21fd Add Emoji event
This is received from the client when they are trying to display an emoji, this comes in to the server, gets processed, and the server sends back the Emote Bubble packet to the clients.
2020-06-01 14:38:29 +02:00
Patrikkk
26773f61a2 Add LandGolfBallInCup event handler. 2020-06-01 12:07:57 +02:00
Patrikkk
20620f2b47 PacketType handler delegate organization.
We have the elements in GetDataHandlerDelegates dict in order by its packet type.
2020-06-01 11:54:59 +02:00
Chris
badba523e7
Merge branch 'general-devel' into projectilestruct-addition 2020-06-01 19:12:38 +09:30