From 470da46511c9809102476d1453ab3151d3719a7c Mon Sep 17 00:00:00 2001 From: moisterrific <57187883+moisterrific@users.noreply.github.com> Date: Sat, 6 Jun 2020 00:28:21 -0400 Subject: [PATCH 1/2] 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. --- TShockAPI/DB/GroupManager.cs | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/TShockAPI/DB/GroupManager.cs b/TShockAPI/DB/GroupManager.cs index 3cff37a1..1462411d 100644 --- a/TShockAPI/DB/GroupManager.cs +++ b/TShockAPI/DB/GroupManager.cs @@ -76,7 +76,8 @@ namespace TShockAPI.DB Permissions.summonboss, Permissions.whisper, Permissions.wormhole, - Permissions.canpaint)); + Permissions.canpaint, + Permissions.pylon)); AddDefaultGroup("vip", "default", string.Join(",", @@ -123,7 +124,8 @@ namespace TShockAPI.DB Permissions.tpnpc, Permissions.tppos, Permissions.tpsilent, - Permissions.userinfo)); + Permissions.userinfo, + Permissions.spawn)); AddDefaultGroup("trustedadmin", "admin", string.Join(",", @@ -155,7 +157,20 @@ namespace TShockAPI.DB Permissions.invade, Permissions.startdd2, Permissions.uploaddata, - Permissions.uploadothersdata)); + Permissions.uploadothersdata, + Permissions.journey_timefreeze, + Permissions.journey_timeset, + Permissions.journey_timespeed, + Permissions.journey_godmode, + Permissions.journey_windstrength, + Permissions.journey_windfreeze, + Permissions.journey_rainstrength, + Permissions.journey_rainfreeze, + Permissions.journey_placementrange, + Permissions.journey_setdifficulty, + Permissions.journey_biomespreadfreeze, + Permissions.journey_setspawnrate, + Permissions.journey_contributeresearch)); AddDefaultGroup("owner", "trustedadmin", string.Join(",", @@ -174,19 +189,7 @@ namespace TShockAPI.DB Permissions.settempgroup, Permissions.spawnrate, Permissions.tpoverride, - Permissions.createdumps, - Permissions.journey_timefreeze, - Permissions.journey_timeset, - Permissions.journey_timespeed, - Permissions.journey_godmode, - Permissions.journey_windstrength, - Permissions.journey_windfreeze, - Permissions.journey_rainstrength, - Permissions.journey_rainfreeze, - Permissions.journey_placementrange, - Permissions.journey_setdifficulty, - Permissions.journey_biomespreadfreeze, - Permissions.journey_setspawnrate)); + Permissions.createdumps)); } // Load Permissions from the DB From 156cf4930bad9db85d3d87076e4a2750fb65daf0 Mon Sep 17 00:00:00 2001 From: Patrikkk Date: Sat, 6 Jun 2020 22:28:37 +0200 Subject: [PATCH 2/2] FishOutNPC - Fix some rods not fishing out NPCs. I was wrong, not all bobbers are named "Bobber". Just found that Projectile now has an extra field which determines if the given type is a bobber. This field is set in Projectile.SetDefaults method in the following logic `((type >= 360 && type <= 366) || type == 381 || type == 382 || type == 760 || type == 775)` I think it is reasonable to use the bobber field, as it would be updateproof too. Tested and working. Fixes #1985 --- CHANGELOG.md | 1 + TShockAPI/Bouncer.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e1bd75a..256deb73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Added LandGolfBallInCup event which is accessible for developers to work with, as well as LandGolfBallInCup handler to handle exploits where players could send direct packets to trigger and imitate golf ball cup landing anywhere in the game world. Added two public lists in Handlers.LandGolfBallInCupHandler: GolfBallProjectileIDs and GolfClubItemIDs. (@Patrikkk) * Added SyncTilePicking event. This is called when a player damages a tile. Implementing SyncTilePickingHandler and patching tile damaging related exploits. (Preventing player sending invalid world position data which disconnects other players.) * Fixed the issue where mobs could not be fished out during bloodmoon because of Bouncer checks. (@Patrikkk) + *Fixed the issue where certain fishing rods could not fish out NPCs due to a Bouncer check. (@Patrikkk) * Update for OTAPI 2.0.0.37 and Terraria 1.4.0.5. (@hakusaro, @Patrikkk) * Adding missing PlayerInfo data in GetDataHandler. (@Patrikkk) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index f21b60eb..f663b073 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -1906,8 +1906,8 @@ namespace TShockAPI /// internal void OnFishOutNPC(object sender, GetDataHandlers.FishOutNPCEventArgs args) { - /// Getting recent projectiles of the player which are named Bobber. All bobbers have the same Name. - var projectile = args.Player.RecentlyCreatedProjectiles.FirstOrDefault(p => Main.projectile[p.Index].Name == "Bobber"); + /// Getting recent projectiles of the player and selecting the first that is a bobber. + var projectile = args.Player.RecentlyCreatedProjectiles.FirstOrDefault(p => Main.projectile[p.Index].bobber); if (!FishingRodItemIDs.Contains(args.Player.SelectedItem.type)) {