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:
@@ -19,7 +19,7 @@ namespace Content.Server.AI
|
||||
[AiLogicProcessor("AimShootLife")]
|
||||
class AimShootLifeProcessor : AiLogicProcessor
|
||||
{
|
||||
private readonly ICollisionManager _physMan;
|
||||
private readonly IPhysicsManager _physMan;
|
||||
private readonly IServerEntityManager _entMan;
|
||||
private readonly IGameTiming _timeMan;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Content.Server.AI
|
||||
/// </summary>
|
||||
public AimShootLifeProcessor()
|
||||
{
|
||||
_physMan = IoCManager.Resolve<ICollisionManager>();
|
||||
_physMan = IoCManager.Resolve<IPhysicsManager>();
|
||||
_entMan = IoCManager.Resolve<IServerEntityManager>();
|
||||
_timeMan = IoCManager.Resolve<IGameTiming>();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
2
engine
2
engine
Submodule engine updated: 99ab6fce9c...d8ca95db0c
Reference in New Issue
Block a user