Merge remote-tracking branch 'drunderscore/feature/bounce-some-new-packets' into general-devel
This commit is contained in:
commit
62eb0afb18
2 changed files with 24 additions and 1 deletions
|
|
@ -28,6 +28,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
|
||||||
* Plugins and ./bin dependencies are now loaded relative to the launcher, this improves the use of startup files (@SignatureBeef)
|
* Plugins and ./bin dependencies are now loaded relative to the launcher, this improves the use of startup files (@SignatureBeef)
|
||||||
* Added preliminary support for Terraria 1.4.4.5. (@drunderscore)
|
* Added preliminary support for Terraria 1.4.4.5. (@drunderscore)
|
||||||
* For clarity sake, we're listing the individual changes to Terraria's version, despite the fact that this version only supports the latest one.
|
* For clarity sake, we're listing the individual changes to Terraria's version, despite the fact that this version only supports the latest one.
|
||||||
|
* Don't allow players to sync loadout index whilst disabled (@drunderscore)
|
||||||
|
|
||||||
## TShock 4.5.18
|
## TShock 4.5.18
|
||||||
* Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@gohjoseph)
|
* Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@gohjoseph)
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,8 @@ namespace TShockAPI
|
||||||
{ PacketTypes.LandGolfBallInCup, HandleLandGolfBallInCup },
|
{ PacketTypes.LandGolfBallInCup, HandleLandGolfBallInCup },
|
||||||
{ PacketTypes.FishOutNPC, HandleFishOutNPC },
|
{ PacketTypes.FishOutNPC, HandleFishOutNPC },
|
||||||
{ PacketTypes.FoodPlatterTryPlacing, HandleFoodPlatterTryPlacing },
|
{ PacketTypes.FoodPlatterTryPlacing, HandleFoodPlatterTryPlacing },
|
||||||
{ PacketTypes.SyncCavernMonsterType, HandleSyncCavernMonsterType }
|
{ PacketTypes.SyncCavernMonsterType, HandleSyncCavernMonsterType },
|
||||||
|
{ PacketTypes.SyncLoadout, HandleSyncLoadout }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4325,6 +4326,27 @@ namespace TShockAPI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool HandleSyncLoadout(GetDataHandlerArgs args)
|
||||||
|
{
|
||||||
|
var playerIndex = args.Data.ReadInt8();
|
||||||
|
var loadoutIndex = args.Data.ReadInt8();
|
||||||
|
|
||||||
|
// When syncing a player's own loadout index, they then sync it back to us...
|
||||||
|
// So let's only care if the index has actually changed, otherwise we might end up in a loop...
|
||||||
|
if (loadoutIndex == args.TPlayer.CurrentLoadoutIndex)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (args.Player.IsBeingDisabled())
|
||||||
|
{
|
||||||
|
TShock.Log.ConsoleDebug("GetDataHandlers / HandleSyncLoadout rejected loadout index sync {0}", args.Player.Name);
|
||||||
|
NetMessage.SendData((int)PacketTypes.SyncLoadout, number: args.Player.Index, number2: args.TPlayer.CurrentLoadoutIndex);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public enum DoorAction
|
public enum DoorAction
|
||||||
{
|
{
|
||||||
OpenDoor = 0,
|
OpenDoor = 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue