-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
also command now working (only /sentry ping, alerts)
- Loading branch information
1 parent
a4e019a
commit 501065f
Showing
23 changed files
with
507 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/com/mogukun/sentry/check/checks/combats/aura/AuraB.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.mogukun.sentry.check.checks.combats.aura; | ||
|
||
import com.mogukun.sentry.check.Category; | ||
import com.mogukun.sentry.check.Check; | ||
import com.mogukun.sentry.check.CheckInfo; | ||
import net.minecraft.server.v1_8_R3.Packet; | ||
import net.minecraft.server.v1_8_R3.PacketPlayInFlying; | ||
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity; | ||
|
||
@CheckInfo( | ||
name = "Aura (B)", | ||
description = "Badly Coded KillAura detection", | ||
category = Category.COMBAT | ||
) | ||
public class AuraB extends Check { | ||
|
||
long lastFlyingPacket = 0; | ||
|
||
@Override | ||
public void handle(Packet packet) { | ||
long now = System.currentTimeMillis(); | ||
if ( packet instanceof PacketPlayInFlying ) { | ||
lastFlyingPacket = now; | ||
} | ||
if ( packet instanceof PacketPlayInUseEntity ) { | ||
long diff = now - lastFlyingPacket; | ||
if ( diff < 5 ) flag("diff=" + diff); | ||
} | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/com/mogukun/sentry/check/checks/combats/aura/AuraC.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.mogukun.sentry.check.checks.combats.aura; | ||
|
||
import com.mogukun.sentry.check.Category; | ||
import com.mogukun.sentry.check.Check; | ||
import com.mogukun.sentry.check.CheckInfo; | ||
import net.minecraft.server.v1_8_R3.Packet; | ||
import net.minecraft.server.v1_8_R3.PacketPlayInArmAnimation; | ||
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity; | ||
|
||
@CheckInfo( | ||
name = "Aura (C)", | ||
description = "No Swing KillAura Detection", | ||
category = Category.COMBAT | ||
) | ||
public class AuraC extends Check { | ||
|
||
long lastArm = 0; | ||
|
||
@Override | ||
public void handle(Packet packet) { | ||
long now = System.currentTimeMillis(); | ||
if ( packet instanceof PacketPlayInArmAnimation) { | ||
lastArm = now; | ||
} | ||
if ( packet instanceof PacketPlayInUseEntity ) { | ||
long diff = now - lastArm; | ||
|
||
if ( diff > 10 ) { | ||
flag("diff=" + diff); | ||
} | ||
|
||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/com/mogukun/sentry/check/checks/movements/fly/FlyD.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.mogukun.sentry.check.checks.movements.fly; | ||
|
||
import com.mogukun.sentry.check.Category; | ||
import com.mogukun.sentry.check.Check; | ||
import com.mogukun.sentry.check.CheckInfo; | ||
import com.mogukun.sentry.check.MovementData; | ||
|
||
@CheckInfo( | ||
name = "Fly (D)", | ||
description = "Predication Check", | ||
category = Category.MOVEMENT | ||
) | ||
public class FlyD extends Check { | ||
|
||
double buffer = 0; | ||
|
||
@Override | ||
public void handle(MovementData data) | ||
{ | ||
if ( !data.moving ) return; | ||
if ( data.currentDeltaY > 1 ) return; | ||
if ( data.serverAirTick <= 16 ) { | ||
buffer = 0; | ||
return; | ||
} | ||
if ( data.sinceVehicleTick <= 10 || data.sinceStandingOnBoatTick <= 10 || data.sinceWebTick <= 10 || data.sinceWaterTick <= 10 || data.sinceClimbTick <= 10 ) return; | ||
|
||
// Credit: CheatGuard @DerRedstoner | ||
double predicated = ( data.lastDeltaY - 0.08 ) * 0.9800000190734863; | ||
double difference = Math.abs(predicated - data.currentDeltaY); | ||
|
||
if ( difference > 0.001 ) { | ||
buffer += difference * 10; | ||
if ( buffer > 10 ) { | ||
flag("pred=" + predicated + " real=" + data.currentDeltaY + " diff=" + difference ); | ||
buffer -= 1; | ||
} | ||
} else { | ||
buffer -= buffer > 0 ? 0.5 : 0; | ||
} | ||
} | ||
} | ||
|
||
|
37 changes: 37 additions & 0 deletions
37
src/main/java/com/mogukun/sentry/check/checks/movements/fly/FlyE.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.mogukun.sentry.check.checks.movements.fly; | ||
|
||
import com.mogukun.sentry.check.Category; | ||
import com.mogukun.sentry.check.Check; | ||
import com.mogukun.sentry.check.CheckInfo; | ||
import com.mogukun.sentry.check.MovementData; | ||
import com.mogukun.sentry.models.Counter; | ||
|
||
@CheckInfo( | ||
name = "Fly (E)", | ||
description = "Unusual DeltaY Detection", | ||
category = Category.MOVEMENT | ||
) | ||
public class FlyE extends Check { | ||
|
||
Counter counter = new Counter(); | ||
|
||
@Override | ||
public void handle(MovementData data) | ||
{ | ||
if ( data.serverAirTick <= 6 ) { | ||
counter.reset(); | ||
return; | ||
} | ||
|
||
if ( data.sinceVehicleTick <= 10 || data.sinceStandingOnBoatTick <= 10 || data.sinceWebTick <= 10 || data.sinceWaterTick <= 10 || data.sinceClimbTick <= 10 ) return; | ||
|
||
if ( data.currentY < data.lastY && data.currentDeltaY <= data.lastDeltaY ) { | ||
if ( counter.count() > 5 ) { | ||
flag(); | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.