DataValidateFix

czp3009

A Torch plugin that fix several data validate issue

Github Link

DataValidateFix

A Torch plugin which fix several data validate issue for SpaceEngineers server.

The SpaceEngineers server NOT validate some important two-way sync variable received from client.

For example, open the file located in SpaceEngineers\Content\Data\CubeBlocks\CubeBlocks_Automation.sbc(XML) and search for text MyObjectBuilder_SensorBlockDefinition.

Modify MaxRange of this BlockDefinition then save it.

Use this modified client to connect to dedicated server, you will find that you can set LeftExtend, RightExtend and other options in SensorBlock UI to very large value.

Those data NOT ONLY display on client, server actually accept them.

Use ProgramBlock to get data from SensorBlock with Sandbox.ModAPI.Ingame.IMySensorBlock.DetectedEntities.

Player can get as many grids' position as he want by increase the MaxRange in XML.

This plugin add extra validate logic in server to void the problem above.

Current fixed block

  • MySensorBlock(LeftExtend, RightExtend, BottomExtend, TopExtend, BackExtend, FrontExtend)

  • MyWarhead(Countdown)

  • MyLargeTurretBase(ShootingRange)

  • MyOreDetector(Range)

  • MyMechanicalConnectionBlockBase(SafetyDetach)

  • MyPistonBase(MaxVelocity, MaxLimit, MinLimit, MaxImpulseAxis, MaxImpulseNonAxis)

  • MyMotorStator(Torque, BrakingTorque, TargetVelocity)

  • SafeZone(Box size)(modified client will display the fake border until rejoin to server)

  • MyMotorSuspension(MaxSteerAngle, Power, Strength, Height, Friction, SpeedLimit, PropulsionOverride, SteeringOverride)

  • MyThrust(ThrustOverride)

  • MyJumpDrive(JumpDistanceRatio)

  • MyGyro(OverrideVelocity)

  • MyBeacon(Radius)

  • MyRadioAntenna(Radius)

  • MyLightingBlock(Radius, Falloff, BlinkInterval, BlinkLength, BlinkOffset, Intensity, LightOffset)

TODO blocks

  • MyLaserAntenna(this patch cause crash, i don't know why)
  • Sound(i don't find the block class)

Script fix

If script in ProgramBlock try to pass float.NaN to property of those fixed block, value of that property will be reset to minimum legal value.

For example, player run such code in game:

c# (GridTerminalSystem.GetBlockWithName("GyroName") as IMyGyro).Pitch = float.NaN;

Pitch will be reset to -30(depend on BlockDefinition in server side).

Projector fix

If player use a modified blueprint in Projector, items in some block inventory will NOT be clear. Player can create items for free.

This plugin current fix(If you find more block in blueprint can use this bug, please tell me):

  • OxygenGenerator(All ice in inventory will be clear)

  • JumpDrive(Stored power will be reset to zero)

  • GatlingGun, MissileLauncher(All ammo in inventory will be clear)

Note

The game will automatically correct the wrong data when loading world. If the player created illegal data before, Those data will be cleared after the server restarts(to nearest legal value). So no more step need to be done, just install this plugin and restart server.

License

Apache 2.0

Beta? Version Note Date Download DL Count
v1.0.1.3 fix GatlingGun, MissileLauncher in blueprint 7/2/20 4:41:03 PM Download 142
v1.0.1.2 projector fix 6/15/20 4:28:46 PM Download 105
v1.0.1.1 Beacon, Antenna, LightBlock 6/14/20 10:04:10 AM Download 64
v1.0.1.0 fix NaN 6/10/20 4:51:56 PM Download 68
v1.0.0.2 MyGyro 6/10/20 2:34:43 PM Download 38
v1.0.0.1 JumpDrive 4/28/20 2:54:31 PM Download 114
v1.0.0.0 init 4/27/20 3:23:59 PM Download 34