mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-18 08:35:44 +01:00
Start logging players last login address.
This commit is contained in:
parent
fd4c82b0eb
commit
d8f7c82e2d
@ -213,7 +213,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
user.setNPC(false);
|
||||
|
||||
final long currentTime = System.currentTimeMillis();
|
||||
boolean banExpired = user.checkBanTimeout(currentTime);
|
||||
final boolean banExpired = user.checkBanTimeout(currentTime);
|
||||
user.checkMuteTimeout(currentTime);
|
||||
user.checkJailTimeout(currentTime);
|
||||
|
||||
@ -232,6 +232,7 @@ public class EssentialsPlayerListener extends PlayerListener
|
||||
event.allow();
|
||||
|
||||
user.setLastLogin(System.currentTimeMillis());
|
||||
user.setLastLoginAddress(user.getAddress().getAddress().getHostAddress());
|
||||
updateCompass(user);
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,7 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
jailTimeout = _getJailTimeout();
|
||||
lastLogin = _getLastLogin();
|
||||
lastLogout = _getLastLogout();
|
||||
lastLoginAddress = _getLastLoginAddress();
|
||||
afk = getAfk();
|
||||
newplayer = getNew();
|
||||
geolocation = _getGeoLocation();
|
||||
@ -668,6 +669,7 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
config.setProperty("timestamps.login", time);
|
||||
config.save();
|
||||
}
|
||||
|
||||
private long lastLogout;
|
||||
|
||||
private long _getLastLogout()
|
||||
@ -686,6 +688,26 @@ public abstract class UserData extends PlayerExtension implements IConf
|
||||
config.setProperty("timestamps.logout", time);
|
||||
config.save();
|
||||
}
|
||||
|
||||
private String lastLoginAddress;
|
||||
|
||||
private String _getLastLoginAddress()
|
||||
{
|
||||
return config.getString("ipAddress", "");
|
||||
}
|
||||
|
||||
public String getLastLoginAddress()
|
||||
{
|
||||
return lastLoginAddress;
|
||||
}
|
||||
|
||||
public void setLastLoginAddress(String address)
|
||||
{
|
||||
lastLoginAddress = address;
|
||||
config.setProperty("ipAddress", address);
|
||||
config.save();
|
||||
}
|
||||
|
||||
private boolean afk;
|
||||
|
||||
private boolean getAfk()
|
||||
|
Loading…
Reference in New Issue
Block a user