Don't draw power beams for derelict blocks
Some checks failed
Validate Gradle Wrapper / Validation (push) Successful in 25s
Tests / runPush (push) Failing after 1m5s

This commit is contained in:
Anuken 2024-11-28 16:55:55 -05:00
parent 52eab0b0c4
commit 8672dcf9f9
3 changed files with 5 additions and 3 deletions

View File

@ -144,7 +144,7 @@ public class ArcNetProvider implements NetProvider{
@Override
public void received(Connection connection, Object object){
if(!(connection.getArbitraryData() instanceof ArcConnection k) || !(object instanceof Packet pack)) return;
if(!(connection.getArbitraryData() instanceof ArcConnection k)) return;
if(packetSpamLimit > 0 && !k.packetRate.allow(3000, packetSpamLimit)){
Log.warn("Blacklisting IP '@' as potential DOS attack - packet spam.", k.address);
@ -153,6 +153,8 @@ public class ArcNetProvider implements NetProvider{
return;
}
if(!(object instanceof Packet pack)) return;
Core.app.post(() -> {
try{
net.handleServerReceived(k, pack);

View File

@ -207,7 +207,7 @@ public class BeamNode extends PowerBlock{
public void draw(){
super.draw();
if(Mathf.zero(Renderer.laserOpacity)) return;
if(Mathf.zero(Renderer.laserOpacity) || team == Team.derelict) return;
Draw.z(Layer.power);
Draw.color(laserColor1, laserColor2, (1f - power.graph.getSatisfaction()) * 0.86f + Mathf.absin(3f, 0.1f));

View File

@ -472,7 +472,7 @@ public class PowerNode extends PowerBlock{
public void draw(){
super.draw();
if(Mathf.zero(Renderer.laserOpacity) || isPayload()) return;
if(Mathf.zero(Renderer.laserOpacity) || isPayload() || team == Team.derelict) return;
Draw.z(Layer.power);
setupColor(power.graph.getSatisfaction());