projectile fix4

This commit is contained in:
dingo
2026-01-20 18:25:43 -05:00
parent 2765203ef1
commit ed6ad4985d
+46 -30
View File
@@ -1167,22 +1167,30 @@ public sealed partial class DungeonHandler : IClientMessageHandler
if (playerSession != null) if (playerSession != null)
{ {
Console.WriteLine($"[HandleFireProjectile] Sending EVENT_PROJECTILE_SPAWNED (504) to player {playerSession.Character.Name} (CharId={playerSession.CharacterId})"); Console.WriteLine($"[HandleFireProjectile] Sending EVENT_PROJECTILE_SPAWNED (504) to player {playerSession.Character.Name} (CharId={playerSession.CharacterId})");
_ = SendAsync(playerSession.Connection, DungeonOpCodes.EVENT_PROJECTILE_SPAWNED, new try
{ {
id = projectile.Id, await SendAsync(playerSession.Connection, DungeonOpCodes.EVENT_PROJECTILE_SPAWNED, new
sourceType = "player", {
sourceId = session.CharacterId, id = projectile.Id,
x = projectile.X, sourceType = "player",
y = projectile.Y, sourceId = session.CharacterId,
vx = projectile.VelocityX, x = projectile.X,
vy = projectile.VelocityY, y = projectile.Y,
sprite = projectile.SpriteKey, vx = projectile.VelocityX,
isLinear = projectile.IsLinear, vy = projectile.VelocityY,
frontX = projectile.FrontX, sprite = projectile.SpriteKey,
frontY = projectile.FrontY, isLinear = projectile.IsLinear,
backX = projectile.BackX, frontX = projectile.FrontX,
backY = projectile.BackY frontY = projectile.FrontY,
}, CancellationToken.None); backX = projectile.BackX,
backY = projectile.BackY
}, ct);
Console.WriteLine($"[HandleFireProjectile] Successfully sent EVENT_PROJECTILE_SPAWNED to {playerSession.Character.Name}");
}
catch (Exception ex)
{
Console.WriteLine($"[HandleFireProjectile] ERROR sending EVENT_PROJECTILE_SPAWNED to {playerSession.Character.Name}: {ex.Message}");
}
} }
else else
{ {
@@ -1257,22 +1265,30 @@ public sealed partial class DungeonHandler : IClientMessageHandler
if (playerSession != null) if (playerSession != null)
{ {
Console.WriteLine($"[HandleThrowableProjectile] Sending EVENT_PROJECTILE_SPAWNED (504) to player {playerSession.Character.Name}"); Console.WriteLine($"[HandleThrowableProjectile] Sending EVENT_PROJECTILE_SPAWNED (504) to player {playerSession.Character.Name}");
_ = SendAsync(playerSession.Connection, DungeonOpCodes.EVENT_PROJECTILE_SPAWNED, new try
{ {
id = projectile.Id, await SendAsync(playerSession.Connection, DungeonOpCodes.EVENT_PROJECTILE_SPAWNED, new
sourceType = "player", {
sourceId = session.CharacterId, id = projectile.Id,
x = projectile.X, sourceType = "player",
y = projectile.Y, sourceId = session.CharacterId,
vx = projectile.VelocityX, x = projectile.X,
vy = projectile.VelocityY, y = projectile.Y,
sprite = projectile.SpriteKey, vx = projectile.VelocityX,
isLinear = projectile.IsLinear, vy = projectile.VelocityY,
frontX = projectile.FrontX, sprite = projectile.SpriteKey,
frontY = projectile.FrontY, isLinear = projectile.IsLinear,
backX = projectile.BackX, frontX = projectile.FrontX,
backY = projectile.BackY frontY = projectile.FrontY,
}, CancellationToken.None); backX = projectile.BackX,
backY = projectile.BackY
}, ct);
Console.WriteLine($"[HandleThrowableProjectile] Successfully sent EVENT_PROJECTILE_SPAWNED to {playerSession.Character.Name}");
}
catch (Exception ex)
{
Console.WriteLine($"[HandleThrowableProjectile] ERROR sending EVENT_PROJECTILE_SPAWNED to {playerSession.Character.Name}: {ex.Message}");
}
} }
} }
} }