Rename ICollisionManager to IPhysicsManager (#113)
* Renamed ICollisionManager to IPhysicsManager. * Added sanitization and logging for clients sending invalid coordinates to the interaction system. * Update Engine.
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan
|
||||
var angle = new Angle(clicklocation.Position - userPosition);
|
||||
|
||||
var ray = new Ray(userPosition, angle.ToVec());
|
||||
var rayCastResults = IoCManager.Resolve<ICollisionManager>().IntersectRay(ray, MaxLength,
|
||||
var rayCastResults = IoCManager.Resolve<IPhysicsManager>().IntersectRay(ray, MaxLength,
|
||||
Owner.Transform.GetMapTransform().Owner);
|
||||
|
||||
Hit(rayCastResults);
|
||||
|
||||
@@ -137,6 +137,13 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
private void HandleUseItemInHand(ICommonSession session, GridLocalCoordinates coords, EntityUid uid)
|
||||
{
|
||||
// client sanitization
|
||||
if(!coords.IsValidLocation())
|
||||
{
|
||||
Logger.InfoS("interaction", $"Invalid Coordinates: client={session}, coords={coords}");
|
||||
return;
|
||||
}
|
||||
|
||||
UserInteraction(((IPlayerSession)session).AttachedEntity, coords, uid);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user