mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-14 19:41:21 +01:00
Remove getKeepAliveTime from MCAccess.
It does not seem to become accessible any time soon, while packet level access allows to fetch it.
This commit is contained in:
parent
a5ec614444
commit
b6c146ce64
@ -211,12 +211,6 @@ public class MCAccessBukkit implements MCAccess, BlockPropertiesSetup{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
try{
|
||||
|
@ -145,12 +145,6 @@ public class MCAccessCB2512 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
switch(mat){
|
||||
|
@ -145,12 +145,6 @@ public class MCAccessCB2545 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
switch(mat){
|
||||
|
@ -146,13 +146,6 @@ public class MCAccessCB2602 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
switch(mat){
|
||||
|
@ -147,12 +147,6 @@ public class MCAccessCB2645 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
switch(mat){
|
||||
|
@ -149,12 +149,6 @@ public class MCAccessCB2691 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
switch(mat){
|
||||
|
@ -147,12 +147,6 @@ public class MCAccessCB2763 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
// TODO: TEST: return mat.hasGravity();
|
||||
|
@ -147,12 +147,6 @@ public class MCAccessCB2794 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
// TODO: Test/check.
|
||||
|
@ -148,12 +148,6 @@ public class MCAccessCB2808 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
// TODO: Test/check.
|
||||
|
@ -149,12 +149,6 @@ public class MCAccessCB2882 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
// TODO: Test/check.
|
||||
|
@ -149,12 +149,6 @@ public class MCAccessCB2922 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
// TODO: Test/check.
|
||||
|
@ -149,12 +149,6 @@ public class MCAccessCB3026 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
// TODO: Test/check.
|
||||
|
@ -168,12 +168,6 @@ public class MCAccessCB3043 implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
// TODO: Test/check.
|
||||
|
@ -170,12 +170,6 @@ public class MCAccessCBDev implements MCAccess{
|
||||
mcPlayer.dead = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getKeepAliveTime(final Player player) {
|
||||
// TODO: Implement if possible.
|
||||
return Long.MIN_VALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasGravity(final Material mat) {
|
||||
// TODO: Test/check.
|
||||
|
@ -128,8 +128,9 @@ public class GodMode extends Check {
|
||||
// Check for client side lag.
|
||||
final long now = System.currentTimeMillis();
|
||||
final long maxAge = cc.godModeLagMaxAge;
|
||||
long keepAlive = mcAccess.getKeepAliveTime(player);
|
||||
if (keepAlive > now || keepAlive == Long.MIN_VALUE){
|
||||
long keepAlive = Long.MIN_VALUE;
|
||||
// TODO: Get keepAlive from NetData, if available.
|
||||
if (keepAlive > now || keepAlive == Long.MIN_VALUE) {
|
||||
keepAlive = CheckUtils.guessKeepAliveTime(player, now, maxAge);
|
||||
}
|
||||
// TODO: else: still check the other time stamp ?
|
||||
|
@ -122,13 +122,6 @@ public interface MCAccess {
|
||||
*/
|
||||
public void setDead(Player player, int deathTicks);
|
||||
|
||||
/**
|
||||
* Get timestamp of the keep-alive field (not only updated on keep-alive packets).
|
||||
* @param player The player for which to get the time.
|
||||
* @return Long.MIN_VALUE if not possible.
|
||||
*/
|
||||
public long getKeepAliveTime(Player player);
|
||||
|
||||
/**
|
||||
* Usually sand and gravel. Not for fastest access.
|
||||
* @param type
|
||||
|
Loading…
Reference in New Issue
Block a user