projectile fix4
This commit is contained in:
@@ -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}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user