Commit graph

324 commits

Author SHA1 Message Date
SGKoishi
ac7ee7e706
Extract common condition 2022-11-28 00:50:45 -08:00
SGKoishi
62e6aaa826
Use single reject to reduce code 2022-11-28 00:49:46 -08:00
SGKoishi
35d47fdf6a
Remove bucket magic number 2022-11-28 00:44:45 -08:00
SGKoishi
baeb5a2f20
Fixed Super Sponge unable to absorb shimmer 2022-11-28 00:41:45 -08:00
Lucas Nicodemus
10268bb196
Merge remote-tracking branch 'sgk/bombfix' into general-devel 2022-11-27 23:49:16 -08:00
James Puleo
51de32387a
Improve rejection message and code duplication in OnPlayerBuff
There is now a local function `Reject` that will handle logging,
rejecting, and (optionally) re-syncing upon a rejected packet.

Alongside this, the debug message has been improved to include the
sender index, buff type, receiver index, and the time in ticks (and the
existing reason for rejection.)
2022-11-26 21:14:30 -05:00
James Puleo
71a480af6b
Whitelist Shadow Candle and BoC for PlayerAddBuff 2022-11-26 21:14:28 -05:00
SGKoishi
3c6521caff
Fix Digging Molecart and Bomb Fish blocked 2022-11-20 12:27:14 -08:00
Lucas Nicodemus
01917d48ed
Merge remote-tracking branch 'sgk/pr2811' into general-devel 2022-11-09 23:20:19 -08:00
Lucas Nicodemus
a9aa988547
Merge remote-tracking branch 'sgk/patch-morei18n' into general-devel 2022-11-09 23:08:34 -08:00
Lucas Nicodemus
b322c4c1e0
Replace references to Main.max*whatever*count
All of the Main.maxwhatever fields have been replaced with
Terraria.ID.WhateverID.Count fields.
2022-11-09 22:53:29 -08:00
SGKoishi
bd70495774
Allow Torch God's Facor to place biome torch and campfire 2022-11-06 11:45:02 -08:00
SGKoishi
770b177426
Rewording update 2022-11-04 20:40:07 -07:00
SGKoishi
fde43a7730
More i18n
Strings for player kick/ban, anti-cheating and server logs
2022-11-02 13:42:52 -07:00
SGKoishi
65e93b7c17
Show buff time in the log 2022-10-31 14:33:05 -07:00
Lucas Nicodemus
eae8ae1fb5
Merge branch 'general-devel' into patch-3 2022-10-27 15:49:53 -06:00
SGKoishi
4f6ba61611
Fix several bracket mismatch 2022-10-27 01:53:41 -07:00
yuyu
4621a2f7f5 Update Bouncer / OnNPCAddBuff 2022-10-26 22:17:25 +08:00
SGKoishi
b766e045b5
Use i18n for most string.Format if shown in log, console or client side 2022-10-24 13:38:33 -07:00
BashGuy10
8818885a9e Fix being kicked for using the new sponge types 2022-10-22 20:52:33 -07:00
BashGuy10
309f4e5500
Fix flamethrowers kicking players 2022-10-22 17:28:16 -07:00
Janet Blackquill
f63b26ac76 Some i18nifiying 2022-10-21 16:12:04 -04:00
Lucas Nicodemus
20fb5023c1
Merge remote-tracking branch 'drunderscore/fix/add-player-buff' into general-devel 2022-10-14 23:49:15 -07:00
Lucas Nicodemus
368b0b274c
Merge remote-tracking branch 'drunderscore/fix/new-tile-placements' into general-devel 2022-10-14 23:37:18 -07:00
Lucas Nicodemus
9258ee77d4
Merge remote-tracking branch 'drunderscore/fix/bunny-cannon-quick-action' into general-devel 2022-10-14 23:31:44 -07:00
Lucas Nicodemus
882ecef013
Merge remote-tracking branch 'drunderscore/fix/bottomless-honey-bucket-is-real' into general-devel 2022-10-14 23:27:07 -07:00
Lucas Nicodemus
2804f71eb0
Merge remote-tracking branch 'drunderscore/fix/you-cant-have-a-pie-without-cool-whip' into general-devel 2022-10-14 23:16:17 -07:00
James Puleo
0f3f5d8652
Allow the Cool Whip to apply CoolWhipNPCDebuff buff for 240 ticks 2022-10-14 12:09:38 -04:00
Stealownz
29d08dd606 Fix Inferno Fork's OnFire debuff causing Bouncer reject abnormal buff
Inferno Fork's OnFire debuff was buffed up to `60 * Main.rand.Next(8, 16)`
2022-10-11 22:15:30 +08:00
James Puleo
1df123d2be
Make Bouncer reject Shimmer placement without bucket or whilst banned 2022-10-10 19:00:43 -04:00
James Puleo
bf53c3313c
Make Bouncer allow Bottomless Honey Buckets 2022-10-10 18:59:54 -04:00
James Puleo
f2e52d97de
Allow the Axe of Regrowth and the Rubblemaker to pass Bouncer checks
The Axe of Regrowth will place a `Saplings` tile object where a tree
used to be, whilst it's `createItem` does not match that of a sapling.
Added an exception to allow this interaction to succeed.

The Rubblemaker is allowed to place echo piles, which will not match
the `createTile` or `placeStyle` of the created piles (except in one
very specific case, I suppose). Added an exception to allow this
interaction to succeed.

The check for the `style` of the placement to match that of
`SelectedItem` was moved to be later on, after checking the tile type,
and only if the two exceptions above weren't triggered. It will also now
sync the tiles upon failure.
2022-10-10 09:16:16 -04:00
James Puleo
b3a6495eba
Always allow breaking of tiles that are in BreakableWhenPlacing set
These tiles (usually piles) might get destroyed even without a pickaxe,
as result of another placement about to happen.
2022-10-10 09:13:39 -04:00
James Puleo
23fd7acd79
Improve OnPlayerBuff logic to properly handle buffs from other players
Previously, we checked if the target player was null, before checking if
their ID was out of bounds, so the check was moved to be first.
We now check if the buff being applied is within bounds.

We introduce `AddPlayerBuffWhitelist` to replace `WhitelistBuffMaxTime`,
which allows us to specify a maximum amount of ticks a buff can be
applied to another player for, and if it can be applied without the
target being in PvP. If a buff is not within this array, it is *not*
allowed to be applied by other players.

When rejecting from `OnPlayerBuff`, we send a `PlayerBuff` instead of
`PlayerAddBuff`, to sync the current buffs of the target, without
syncing the rejected one.
2022-10-08 13:09:54 -04:00
James Puleo
c1edbea1a2
Allow Blood Butcherer and Shimmer buffs to be applied to NPCs by players 2022-10-08 11:07:49 -04:00
Luke
aa0bd7deb2 Merge branch 'general-devel' into otapi3 2022-09-06 22:23:34 +10:00
punchready
9358f11e51 Improve comments 2022-08-14 01:22:22 +02:00
punchready
82a095f3cf fix a region bypass exploit using the ice rod 2022-07-26 08:58:56 +02:00
James Puleo
1d9bc7d1af
Fixed Bouncer possibly rejecting Explosive Bunny critter releases
When using a Bunny Cannon, an Explosive Bunny item (which is also a
critter release item) is used to create an Explosive Bunny projectile,
which will later (in the future) release an Explosive Bunny NPC, by the
release critter packet. The existing checks required that the player be
actively selecting the item to create the critter, however this didn't
make sense for Explosive Bunnies, as they would be released in the
future, possibly when the player was no longer selecting that item.

This commit relaxes the restrictions on Explosive Bunny critter
releases, now requiring either holding the release item, or having
recently created an Explosive Bunny projectile, and that the release
coordinates are within the area of one of their Explosive Bunny
projectiles.
2022-04-29 18:42:54 -04:00
Lucas Nicodemus
78169c87cb Merge remote-tracking branch 'origin/general-devel' into otapi3 2022-02-16 18:44:33 -08:00
0x3fcf1bbd
874b3b2746 Reverted STS change, added STSC, fixed STS/STSC usage. 2022-02-01 16:00:05 +01:00
Lucas Nicodemus
724858b42d Merge branch 'general-devel' into otapi3 2021-12-12 12:36:31 -08:00
Lucas Nicodemus
e42da74f85 Merge remote-tracking branch 'tru321/general-devel' into general-devel 2021-12-12 12:35:13 -08:00
tru321
f20ce4aaa9
Update Bouncer.cs 2021-12-10 10:57:56 +08:00
tru321
16f7c876e1
Apply suggestions from code review
Co-authored-by: Lucas Nicodemus <shank@shanked.me>
2021-12-08 14:44:03 +08:00
Lucas Nicodemus
c62fca5353 Merge remote-tracking branch 'deathcradle/otapi3' into otapi3 2021-12-07 21:06:48 -08:00
tru321
26a46ef40c
Update Bouncer.cs 2021-12-08 11:48:55 +08:00
tru321
d4befdeff0
Update Bouncer.cs 2021-12-08 11:10:12 +08:00
Zoom L1
5230598ba3
Comments updated 2021-12-04 10:37:16 +07:00
Zoom L1
77ded28826
Corrected customDeathReason in OnPlayerDamage
Previously it was called for absolutely any damage from the player.
2021-12-02 22:13:25 +07:00