Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public bool Critical
get;
set;
}
[Obsolete("NPC.StrikeNPC does not supply this value; it is always false and is ignored.")]
public bool NoEffect
{
get;
Expand Down
4 changes: 1 addition & 3 deletions TerrariaServerAPI/TerrariaApi.Server/HookManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ public HandlerCollection<NpcStrikeEventArgs> NpcStrike
}

internal bool InvokeNpcStrike(
NPC npc, ref int damage, ref float knockback, ref int hitDirection, ref bool crit, ref bool noEffect,
NPC npc, ref int damage, ref float knockback, ref int hitDirection, ref bool crit,
ref bool fromNet, Player player)
{
NpcStrikeEventArgs args = new NpcStrikeEventArgs
Expand All @@ -688,7 +688,6 @@ internal bool InvokeNpcStrike(
KnockBack = knockback,
HitDirection = hitDirection,
Critical = crit,
NoEffect = noEffect,
FromNet = fromNet,
Player = player
};
Expand All @@ -699,7 +698,6 @@ internal bool InvokeNpcStrike(
knockback = args.KnockBack;
hitDirection = args.HitDirection;
crit = args.Critical;
noEffect = args.NoEffect;
fromNet = args.FromNet;
player = args.Player;
return args.Handled;
Expand Down
4 changes: 2 additions & 2 deletions TerrariaServerAPI/TerrariaApi.Server/Hooking/NetHooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void OnUpdateConnectedClients(object? sender, HookEvents.Terraria.Netplay
args.OriginalMethod();
if (ServerApi.ForceUpdate)
{
Terraria.Netplay.HasClients = true;
Terraria.Netplay.HasFullyConnectedClients = true;
}
}

Expand Down Expand Up @@ -192,7 +192,7 @@ static void OnConnectionAccepted(object? sender, HookEvents.Terraria.Netplay.OnC
}
if (FindNextOpenClientSlot() == -1)
{
Netplay.StopListening();
Netplay.TcpListener?.StopListening();
}
}

Expand Down
2 changes: 1 addition & 1 deletion TerrariaServerAPI/TerrariaApi.Server/Hooking/NpcHooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void OnStrike(NPC npc, HookEvents.Terraria.NPC.StrikeNPCEventArgs args)
if (!args.ContinueExecution) return;
if (args.entity is Player player)
{
if (_hookManager.InvokeNpcStrike(npc, ref args.Damage, ref args.knockBack, ref args.hitDirection, ref args.crit, ref args.noEffect, ref args.fromNet, player))
if (_hookManager.InvokeNpcStrike(npc, ref args.Damage, ref args.knockBack, ref args.hitDirection, ref args.crit, ref args.fromNet, player))
{
args.ContinueExecution = false;
args.HookReturnValue = 0;
Expand Down
7 changes: 3 additions & 4 deletions TerrariaServerAPI/TerrariaApi.Server/PacketTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ public enum PacketTypes
RequestSection = 159,
SyncItemPosition = 160,
HostToken = 161,

// Mobile version packets
ServerInfo = 162,
PlayerPlatformInfo = 163
DamageNPCAck = 162,
ServerInfo = 163,
PlayerPlatformInfo = 164
}
2 changes: 1 addition & 1 deletion TerrariaServerAPI/TerrariaServerAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="9.0.0" />
<PackageReference Include="OTAPI.Upcoming" Version="3.3.11" />
<PackageReference Include="OTAPI.Upcoming" Version="3.3.14" />
</ItemGroup>
</Project>