2011-04-07 02:21:10 +00:00
|
|
|
package com.earth2me.essentials;
|
|
|
|
|
2012-03-12 15:35:20 +00:00
|
|
|
import static com.earth2me.essentials.I18n._;
|
2011-04-07 02:21:10 +00:00
|
|
|
import java.io.File;
|
2011-11-21 01:55:26 +00:00
|
|
|
import java.util.*;
|
2011-04-07 02:21:10 +00:00
|
|
|
import org.bukkit.Location;
|
2012-09-02 17:11:29 +00:00
|
|
|
import org.bukkit.configuration.ConfigurationSection;
|
|
|
|
import org.bukkit.configuration.MemoryConfiguration;
|
2011-04-07 02:21:10 +00:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public abstract class UserData extends PlayerExtension implements IConf
|
|
|
|
{
|
2011-11-22 02:02:08 +00:00
|
|
|
protected final transient IEssentials ess;
|
2012-09-14 01:30:24 +00:00
|
|
|
private EssentialsConf config;
|
|
|
|
private final File folder;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
2011-06-01 10:40:12 +00:00
|
|
|
protected UserData(Player base, IEssentials ess)
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2011-11-22 02:02:08 +00:00
|
|
|
super(base);
|
|
|
|
this.ess = ess;
|
2012-09-14 01:30:24 +00:00
|
|
|
folder = new File(ess.getDataFolder(), "userdata");
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
if (!folder.exists())
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
folder.mkdirs();
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
config = new EssentialsConf(new File(folder, Util.sanitizeFileName(base.getName()) + ".yml"));
|
2012-09-14 01:30:24 +00:00
|
|
|
reloadConfig();
|
|
|
|
}
|
2012-09-22 19:43:27 +00:00
|
|
|
|
|
|
|
public final void reset()
|
|
|
|
{
|
2012-09-14 01:30:24 +00:00
|
|
|
config.getFile().delete();
|
|
|
|
config = new EssentialsConf(new File(folder, Util.sanitizeFileName(base.getName()) + ".yml"));
|
2011-04-07 02:21:10 +00:00
|
|
|
reloadConfig();
|
|
|
|
}
|
|
|
|
|
2011-11-18 18:07:28 +00:00
|
|
|
@Override
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
public final void reloadConfig()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
config.load();
|
2011-05-13 16:57:45 +00:00
|
|
|
money = _getMoney();
|
2011-04-07 02:21:10 +00:00
|
|
|
unlimited = _getUnlimited();
|
2011-08-23 02:42:32 +00:00
|
|
|
powertools = _getPowertools();
|
|
|
|
homes = _getHomes();
|
2011-04-07 02:21:10 +00:00
|
|
|
lastLocation = _getLastLocation();
|
|
|
|
lastTeleportTimestamp = _getLastTeleportTimestamp();
|
|
|
|
lastHealTimestamp = _getLastHealTimestamp();
|
|
|
|
jail = _getJail();
|
|
|
|
mails = _getMails();
|
|
|
|
teleportEnabled = getTeleportEnabled();
|
|
|
|
ignoredPlayers = getIgnoredPlayers();
|
2012-03-02 19:05:30 +00:00
|
|
|
godmode = _getGodModeEnabled();
|
2011-04-07 02:21:10 +00:00
|
|
|
muted = getMuted();
|
2011-04-07 02:59:56 +00:00
|
|
|
muteTimeout = _getMuteTimeout();
|
2011-04-07 02:21:10 +00:00
|
|
|
jailed = getJailed();
|
2011-04-07 02:59:56 +00:00
|
|
|
jailTimeout = _getJailTimeout();
|
|
|
|
lastLogin = _getLastLogin();
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
lastLogout = _getLastLogout();
|
2011-11-04 15:28:51 +00:00
|
|
|
lastLoginAddress = _getLastLoginAddress();
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
afk = getAfk();
|
|
|
|
geolocation = _getGeoLocation();
|
2011-05-04 10:39:56 +00:00
|
|
|
isSocialSpyEnabled = _isSocialSpyEnabled();
|
2011-05-14 10:54:18 +00:00
|
|
|
isNPC = _isNPC();
|
2011-09-19 21:41:39 +00:00
|
|
|
arePowerToolsEnabled = _arePowerToolsEnabled();
|
2011-09-29 22:53:25 +00:00
|
|
|
kitTimestamps = _getKitTimestamps();
|
2012-03-02 19:05:30 +00:00
|
|
|
nickname = _getNickname();
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
2011-06-01 10:40:12 +00:00
|
|
|
private double money;
|
2011-07-05 21:50:31 +00:00
|
|
|
|
|
|
|
private double _getMoney()
|
|
|
|
{
|
|
|
|
double money = ess.getSettings().getStartingBalance();
|
2011-04-07 02:21:10 +00:00
|
|
|
if (config.hasProperty("money"))
|
|
|
|
{
|
2011-07-05 21:50:31 +00:00
|
|
|
money = config.getDouble("money", money);
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
2011-07-05 21:50:31 +00:00
|
|
|
if (Math.abs(money) > ess.getSettings().getMaxMoney())
|
2011-04-07 02:21:10 +00:00
|
|
|
{
|
2011-07-05 21:50:31 +00:00
|
|
|
money = money < 0 ? -ess.getSettings().getMaxMoney() : ess.getSettings().getMaxMoney();
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
2011-07-05 21:50:31 +00:00
|
|
|
return money;
|
2011-05-13 16:57:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public double getMoney()
|
|
|
|
{
|
|
|
|
return money;
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setMoney(double value)
|
|
|
|
{
|
2011-05-13 16:57:45 +00:00
|
|
|
money = value;
|
2011-07-05 21:50:31 +00:00
|
|
|
if (Math.abs(money) > ess.getSettings().getMaxMoney())
|
|
|
|
{
|
|
|
|
money = money < 0 ? -ess.getSettings().getMaxMoney() : ess.getSettings().getMaxMoney();
|
|
|
|
}
|
2011-05-02 18:22:17 +00:00
|
|
|
config.setProperty("money", value);
|
|
|
|
config.save();
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
2011-08-23 02:42:32 +00:00
|
|
|
private Map<String, Object> homes;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
2011-08-23 02:42:32 +00:00
|
|
|
private Map<String, Object> _getHomes()
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2012-02-22 00:10:13 +00:00
|
|
|
if (config.isConfigurationSection("homes"))
|
|
|
|
{
|
|
|
|
return config.getConfigurationSection("homes").getValues(false);
|
2012-02-21 22:14:11 +00:00
|
|
|
}
|
|
|
|
return new HashMap<String, Object>();
|
2011-05-01 21:58:38 +00:00
|
|
|
}
|
2011-07-05 21:50:31 +00:00
|
|
|
|
2012-09-22 19:43:27 +00:00
|
|
|
private String getHomeName(String search)
|
2011-05-01 21:58:38 +00:00
|
|
|
{
|
2012-09-22 19:43:27 +00:00
|
|
|
if (Util.isInt(search))
|
2011-05-01 21:58:38 +00:00
|
|
|
{
|
2011-08-23 05:09:34 +00:00
|
|
|
try
|
|
|
|
{
|
2012-09-22 19:43:27 +00:00
|
|
|
search = getHomes().get(Integer.parseInt(search) - 1);
|
2011-08-23 05:09:34 +00:00
|
|
|
}
|
2012-09-22 19:43:27 +00:00
|
|
|
catch (Exception e)
|
2011-08-23 05:09:34 +00:00
|
|
|
{
|
|
|
|
}
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
2012-09-22 19:43:27 +00:00
|
|
|
return search;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Location getHome(String name) throws Exception
|
|
|
|
{
|
|
|
|
String search = getHomeName(name);
|
|
|
|
return config.getLocation("homes." + search, getServer());
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
|
|
|
|
2011-11-26 21:30:40 +00:00
|
|
|
public Location getHome(final Location world)
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2011-11-26 21:30:40 +00:00
|
|
|
try
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2011-11-26 21:30:40 +00:00
|
|
|
Location loc;
|
|
|
|
for (String home : getHomes())
|
2011-08-23 02:42:32 +00:00
|
|
|
{
|
2011-11-26 21:30:40 +00:00
|
|
|
loc = config.getLocation("homes." + home, getServer());
|
|
|
|
if (world.getWorld() == loc.getWorld())
|
|
|
|
{
|
|
|
|
return loc;
|
|
|
|
}
|
2011-08-23 02:42:32 +00:00
|
|
|
|
2011-11-26 21:30:40 +00:00
|
|
|
}
|
|
|
|
loc = config.getLocation("homes." + getHomes().get(0), getServer());
|
|
|
|
return loc;
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
|
|
|
return null;
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
2011-08-23 02:42:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public List<String> getHomes()
|
|
|
|
{
|
2012-04-24 10:30:31 +00:00
|
|
|
return new ArrayList<String>(homes.keySet());
|
2011-08-23 02:42:32 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
2011-08-23 02:42:32 +00:00
|
|
|
public void setHome(String name, Location loc)
|
|
|
|
{
|
2011-09-22 16:50:42 +00:00
|
|
|
//Invalid names will corrupt the yaml
|
|
|
|
name = Util.sanitizeFileName(name);
|
2011-08-23 02:42:32 +00:00
|
|
|
homes.put(name, loc);
|
|
|
|
config.setProperty("homes." + name, loc);
|
2011-04-07 02:21:10 +00:00
|
|
|
config.save();
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
2011-08-23 06:04:33 +00:00
|
|
|
public void delHome(String name) throws Exception
|
|
|
|
{
|
2012-09-22 19:43:27 +00:00
|
|
|
String search = getHomeName(name);
|
2011-09-29 22:27:53 +00:00
|
|
|
if (!homes.containsKey(search))
|
|
|
|
{
|
2012-09-22 19:43:27 +00:00
|
|
|
search = Util.sanitizeFileName(search);
|
2011-09-29 22:27:53 +00:00
|
|
|
}
|
|
|
|
if (homes.containsKey(search))
|
2011-08-23 06:04:33 +00:00
|
|
|
{
|
2012-09-22 19:43:27 +00:00
|
|
|
homes.remove(search);
|
|
|
|
config.removeProperty("homes." + search);
|
2011-08-23 06:04:33 +00:00
|
|
|
config.save();
|
|
|
|
}
|
2011-08-24 04:18:35 +00:00
|
|
|
else
|
|
|
|
{
|
2012-09-22 19:43:27 +00:00
|
|
|
throw new Exception(_("invalidHome", search));
|
2011-08-23 06:04:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-23 02:42:32 +00:00
|
|
|
public boolean hasHome()
|
|
|
|
{
|
|
|
|
if (config.hasProperty("home"))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2012-03-02 19:05:30 +00:00
|
|
|
private String nickname;
|
2012-03-25 09:44:33 +00:00
|
|
|
|
2012-03-02 19:05:30 +00:00
|
|
|
public String _getNickname()
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return config.getString("nickname");
|
|
|
|
}
|
2012-03-25 09:44:33 +00:00
|
|
|
|
2012-03-02 19:05:30 +00:00
|
|
|
public String getNickname()
|
|
|
|
{
|
|
|
|
return nickname;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setNickname(String nick)
|
|
|
|
{
|
2012-03-02 19:05:30 +00:00
|
|
|
nickname = nick;
|
2011-04-07 02:21:10 +00:00
|
|
|
config.setProperty("nickname", nick);
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
private List<Integer> unlimited;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private List<Integer> _getUnlimited()
|
|
|
|
{
|
2012-02-21 16:33:46 +00:00
|
|
|
return config.getIntegerList("unlimited");
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public List<Integer> getUnlimited()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return unlimited;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public boolean hasUnlimited(ItemStack stack)
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return unlimited.contains(stack.getTypeId());
|
|
|
|
}
|
|
|
|
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
public void setUnlimited(ItemStack stack, boolean state)
|
|
|
|
{
|
|
|
|
if (unlimited.contains(stack.getTypeId()))
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
unlimited.remove(Integer.valueOf(stack.getTypeId()));
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
if (state)
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
unlimited.add(stack.getTypeId());
|
|
|
|
}
|
|
|
|
config.setProperty("unlimited", unlimited);
|
|
|
|
config.save();
|
|
|
|
}
|
2012-02-22 00:10:13 +00:00
|
|
|
private Map<String, Object> powertools;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
2012-02-22 00:10:13 +00:00
|
|
|
private Map<String, Object> _getPowertools()
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2012-02-22 00:10:13 +00:00
|
|
|
if (config.isConfigurationSection("powertools"))
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2012-02-22 00:10:13 +00:00
|
|
|
return config.getConfigurationSection("powertools").getValues(false);
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
2012-02-22 00:10:13 +00:00
|
|
|
return new HashMap<String, Object>();
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
2011-09-30 00:11:13 +00:00
|
|
|
public void clearAllPowertools()
|
|
|
|
{
|
2011-09-10 09:39:35 +00:00
|
|
|
powertools.clear();
|
|
|
|
config.setProperty("powertools", powertools);
|
|
|
|
config.save();
|
|
|
|
}
|
2011-09-30 00:11:13 +00:00
|
|
|
|
2012-04-24 10:30:31 +00:00
|
|
|
@SuppressWarnings("unchecked")
|
2011-08-21 16:52:58 +00:00
|
|
|
public List<String> getPowertool(ItemStack stack)
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2012-02-22 00:10:13 +00:00
|
|
|
return (List<String>)powertools.get("" + stack.getTypeId());
|
2011-08-21 16:52:58 +00:00
|
|
|
}
|
2012-02-22 00:10:13 +00:00
|
|
|
|
2012-04-24 10:30:31 +00:00
|
|
|
@SuppressWarnings("unchecked")
|
2012-01-15 23:50:52 +00:00
|
|
|
public List<String> getPowertool(int id)
|
|
|
|
{
|
2012-02-22 00:10:13 +00:00
|
|
|
return (List<String>)powertools.get("" + id);
|
2012-01-15 23:50:52 +00:00
|
|
|
}
|
2011-08-21 16:52:58 +00:00
|
|
|
|
2011-08-21 18:33:37 +00:00
|
|
|
public void setPowertool(ItemStack stack, List<String> commandList)
|
2011-08-21 16:52:58 +00:00
|
|
|
{
|
2011-08-21 18:33:37 +00:00
|
|
|
if (commandList == null || commandList.isEmpty())
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2012-02-22 00:10:13 +00:00
|
|
|
powertools.remove("" + stack.getTypeId());
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-02-22 00:10:13 +00:00
|
|
|
powertools.put("" + stack.getTypeId(), commandList);
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
|
|
|
config.setProperty("powertools", powertools);
|
|
|
|
config.save();
|
|
|
|
}
|
2011-09-30 00:11:13 +00:00
|
|
|
|
2011-09-19 21:41:39 +00:00
|
|
|
public boolean hasPowerTools()
|
|
|
|
{
|
2011-11-18 19:30:05 +00:00
|
|
|
return !powertools.isEmpty();
|
2011-09-19 21:41:39 +00:00
|
|
|
}
|
2011-04-07 02:21:10 +00:00
|
|
|
private Location lastLocation;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private Location _getLastLocation()
|
|
|
|
{
|
2011-08-24 04:18:35 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
return config.getLocation("lastlocation", getServer());
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public Location getLastLocation()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return lastLocation;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setLastLocation(Location loc)
|
|
|
|
{
|
2011-09-30 00:11:13 +00:00
|
|
|
if (loc == null || loc.getWorld() == null)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2011-04-07 02:21:10 +00:00
|
|
|
lastLocation = loc;
|
|
|
|
config.setProperty("lastlocation", loc);
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
private long lastTeleportTimestamp;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private long _getLastTeleportTimestamp()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return config.getLong("timestamps.lastteleport", 0);
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public long getLastTeleportTimestamp()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return lastTeleportTimestamp;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setLastTeleportTimestamp(long time)
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
lastTeleportTimestamp = time;
|
|
|
|
config.setProperty("timestamps.lastteleport", time);
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
private long lastHealTimestamp;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private long _getLastHealTimestamp()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return config.getLong("timestamps.lastheal", 0);
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public long getLastHealTimestamp()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return lastHealTimestamp;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setLastHealTimestamp(long time)
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
lastHealTimestamp = time;
|
|
|
|
config.setProperty("timestamps.lastheal", time);
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
private String jail;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private String _getJail()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return config.getString("jail");
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public String getJail()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return jail;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setJail(String jail)
|
|
|
|
{
|
|
|
|
if (jail == null || jail.isEmpty())
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
this.jail = null;
|
|
|
|
config.removeProperty("jail");
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
this.jail = jail;
|
|
|
|
config.setProperty("jail", jail);
|
|
|
|
}
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
private List<String> mails;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private List<String> _getMails()
|
|
|
|
{
|
2012-02-21 16:33:46 +00:00
|
|
|
return config.getStringList("mail");
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public List<String> getMails()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return mails;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setMails(List<String> mails)
|
|
|
|
{
|
|
|
|
if (mails == null)
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
config.removeProperty("mail");
|
2011-05-02 23:10:24 +00:00
|
|
|
mails = _getMails();
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
config.setProperty("mail", mails);
|
|
|
|
}
|
|
|
|
this.mails = mails;
|
|
|
|
config.save();
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void addMail(String mail)
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
mails.add(mail);
|
|
|
|
setMails(mails);
|
|
|
|
}
|
|
|
|
private boolean teleportEnabled;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private boolean getTeleportEnabled()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return config.getBoolean("teleportenabled", true);
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public boolean isTeleportEnabled()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return teleportEnabled;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setTeleportEnabled(boolean set)
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
teleportEnabled = set;
|
|
|
|
config.setProperty("teleportenabled", set);
|
|
|
|
config.save();
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public boolean toggleTeleportEnabled()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
boolean ret = !isTeleportEnabled();
|
|
|
|
setTeleportEnabled(ret);
|
|
|
|
return ret;
|
|
|
|
}
|
2011-07-05 21:50:31 +00:00
|
|
|
|
2011-05-04 10:39:56 +00:00
|
|
|
public boolean toggleSocialSpy()
|
|
|
|
{
|
|
|
|
boolean ret = !isSocialSpyEnabled();
|
|
|
|
setSocialSpyEnabled(ret);
|
|
|
|
return ret;
|
|
|
|
}
|
2011-04-07 02:21:10 +00:00
|
|
|
private List<String> ignoredPlayers;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public List<String> getIgnoredPlayers()
|
|
|
|
{
|
2012-08-03 20:57:29 +00:00
|
|
|
return Collections.synchronizedList(config.getStringList("ignore"));
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setIgnoredPlayers(List<String> players)
|
|
|
|
{
|
|
|
|
if (players == null || players.isEmpty())
|
|
|
|
{
|
2012-08-03 20:57:29 +00:00
|
|
|
ignoredPlayers = Collections.synchronizedList(new ArrayList<String>());
|
2011-04-07 02:21:10 +00:00
|
|
|
config.removeProperty("ignore");
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
ignoredPlayers = players;
|
|
|
|
config.setProperty("ignore", players);
|
|
|
|
}
|
|
|
|
config.save();
|
|
|
|
}
|
2012-06-19 08:03:37 +00:00
|
|
|
|
2012-06-19 07:59:26 +00:00
|
|
|
@Deprecated
|
|
|
|
public boolean isIgnoredPlayer(final String userName)
|
|
|
|
{
|
|
|
|
final IUser user = ess.getUser(userName);
|
2012-06-19 08:03:37 +00:00
|
|
|
if (user == null || !user.isOnline())
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2012-08-03 20:57:29 +00:00
|
|
|
return isIgnoredPlayer(user);
|
2012-06-19 07:59:26 +00:00
|
|
|
}
|
2011-04-07 02:21:10 +00:00
|
|
|
|
2012-06-16 15:22:51 +00:00
|
|
|
public boolean isIgnoredPlayer(IUser user)
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2012-06-16 15:22:51 +00:00
|
|
|
return (ignoredPlayers.contains(user.getName().toLowerCase(Locale.ENGLISH)) && !user.isAuthorized("essentials.chat.ignoreexempt"));
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
2012-06-16 15:22:51 +00:00
|
|
|
public void setIgnoredPlayer(IUser user, boolean set)
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
|
|
|
if (set)
|
|
|
|
{
|
2012-06-16 15:22:51 +00:00
|
|
|
ignoredPlayers.add(user.getName().toLowerCase(Locale.ENGLISH));
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-06-16 15:22:51 +00:00
|
|
|
ignoredPlayers.remove(user.getName().toLowerCase(Locale.ENGLISH));
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
|
|
|
setIgnoredPlayers(ignoredPlayers);
|
|
|
|
}
|
|
|
|
private boolean godmode;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
2012-03-02 19:05:30 +00:00
|
|
|
private boolean _getGodModeEnabled()
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
|
|
|
return config.getBoolean("godmode", false);
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public boolean isGodModeEnabled()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return godmode;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setGodModeEnabled(boolean set)
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
godmode = set;
|
|
|
|
config.setProperty("godmode", set);
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
private boolean muted;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
2012-06-10 18:56:24 +00:00
|
|
|
public boolean getMuted()
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
|
|
|
return config.getBoolean("muted", false);
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public boolean isMuted()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return muted;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setMuted(boolean set)
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
muted = set;
|
|
|
|
config.setProperty("muted", set);
|
|
|
|
config.save();
|
|
|
|
}
|
2011-04-07 02:59:56 +00:00
|
|
|
private long muteTimeout;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private long _getMuteTimeout()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return config.getLong("timestamps.mute", 0);
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public long getMuteTimeout()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return muteTimeout;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setMuteTimeout(long time)
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
muteTimeout = time;
|
|
|
|
config.setProperty("timestamps.mute", time);
|
|
|
|
config.save();
|
|
|
|
}
|
2011-04-07 02:21:10 +00:00
|
|
|
private boolean jailed;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private boolean getJailed()
|
|
|
|
{
|
|
|
|
return config.getBoolean("jailed", false);
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public boolean isJailed()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
return jailed;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setJailed(boolean set)
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
jailed = set;
|
|
|
|
config.setProperty("jailed", set);
|
|
|
|
config.save();
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public boolean toggleJailed()
|
|
|
|
{
|
2011-04-07 02:21:10 +00:00
|
|
|
boolean ret = !isJailed();
|
|
|
|
setJailed(ret);
|
|
|
|
return ret;
|
|
|
|
}
|
2011-04-07 02:59:56 +00:00
|
|
|
private long jailTimeout;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private long _getJailTimeout()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return config.getLong("timestamps.jail", 0);
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public long getJailTimeout()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return jailTimeout;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setJailTimeout(long time)
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
jailTimeout = time;
|
|
|
|
config.setProperty("timestamps.jail", time);
|
|
|
|
config.save();
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public String getBanReason()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return config.getString("ban.reason");
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setBanReason(String reason)
|
|
|
|
{
|
2012-05-19 16:41:52 +00:00
|
|
|
config.setProperty("ban.reason", Util.sanitizeString(reason));
|
2011-04-07 02:59:56 +00:00
|
|
|
config.save();
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public long getBanTimeout()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return config.getLong("ban.timeout", 0);
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setBanTimeout(long time)
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
config.setProperty("ban.timeout", time);
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
private long lastLogin;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private long _getLastLogin()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return config.getLong("timestamps.login", 0);
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public long getLastLogin()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return lastLogin;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
2012-03-27 20:08:06 +00:00
|
|
|
private void _setLastLogin(long time)
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
lastLogin = time;
|
|
|
|
config.setProperty("timestamps.login", time);
|
2012-03-27 20:08:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setLastLogin(long time)
|
|
|
|
{
|
|
|
|
_setLastLogin(time);
|
|
|
|
_setLastLoginAddress(base.getAddress().getAddress().getHostAddress());
|
2011-04-07 02:59:56 +00:00
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
private long lastLogout;
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
private long _getLastLogout()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return config.getLong("timestamps.logout", 0);
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public long getLastLogout()
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
return lastLogout;
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
|
|
|
|
public void setLastLogout(long time)
|
|
|
|
{
|
2011-04-07 02:59:56 +00:00
|
|
|
lastLogout = time;
|
|
|
|
config.setProperty("timestamps.logout", time);
|
|
|
|
config.save();
|
|
|
|
}
|
2011-11-04 15:28:51 +00:00
|
|
|
private String lastLoginAddress;
|
|
|
|
|
|
|
|
private String _getLastLoginAddress()
|
|
|
|
{
|
|
|
|
return config.getString("ipAddress", "");
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getLastLoginAddress()
|
|
|
|
{
|
|
|
|
return lastLoginAddress;
|
|
|
|
}
|
|
|
|
|
2012-03-27 20:08:06 +00:00
|
|
|
private void _setLastLoginAddress(String address)
|
2011-11-04 15:28:51 +00:00
|
|
|
{
|
|
|
|
lastLoginAddress = address;
|
|
|
|
config.setProperty("ipAddress", address);
|
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
private boolean afk;
|
|
|
|
|
|
|
|
private boolean getAfk()
|
|
|
|
{
|
|
|
|
return config.getBoolean("afk", false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isAfk()
|
|
|
|
{
|
|
|
|
return afk;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setAfk(boolean set)
|
|
|
|
{
|
|
|
|
afk = set;
|
|
|
|
config.setProperty("afk", set);
|
|
|
|
config.save();
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean toggleAfk()
|
|
|
|
{
|
|
|
|
boolean ret = !isAfk();
|
|
|
|
setAfk(ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
private boolean newplayer;
|
|
|
|
private String geolocation;
|
|
|
|
|
|
|
|
private String _getGeoLocation()
|
|
|
|
{
|
|
|
|
return config.getString("geolocation");
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getGeoLocation()
|
|
|
|
{
|
|
|
|
return geolocation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setGeoLocation(String geolocation)
|
|
|
|
{
|
|
|
|
if (geolocation == null || geolocation.isEmpty())
|
|
|
|
{
|
|
|
|
this.geolocation = null;
|
|
|
|
config.removeProperty("geolocation");
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
This is a big refactoring of the user class and more.
Many commands have been cleaned.
File changes:
- all user data has been moved from users.yml to userdata folder
- all files in userdata folder are lower case
Both changes should be done automatically.
Class changes:
- Moved all user data functions to UserData class
- Moved all user teleport functions to Teleport class
- Moved the user list to Essentials class
- Less static functions for better testing
- EssentialsCommand now has ess Property (Essentials class)
- New NotEnoughArgumentsException, that will show command description and syntax
New commands:
- /seen, shows the last login or logout
- /tempban, temporarily ban someone
- /tjail and mute, temporarily option added
Other changes:
- ban reason is saved
- don't show "You have xxx mail" on login, if user doesn't have essentials.mail permission
- time will be parsed: years, months (mo), weeks, days, hours, minutes (m), seconds, these can be shortened and combined, example: 2 days 5h 30m
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1300 e251c2fe-e539-e718-e476-b85c1f46cddb
2011-05-01 21:07:30 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
this.geolocation = geolocation;
|
|
|
|
config.setProperty("geolocation", geolocation);
|
|
|
|
}
|
|
|
|
config.save();
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|
2011-05-04 10:39:56 +00:00
|
|
|
private boolean isSocialSpyEnabled;
|
2011-07-05 21:50:31 +00:00
|
|
|
|
2011-05-04 10:39:56 +00:00
|
|
|
private boolean _isSocialSpyEnabled()
|
|
|
|
{
|
|
|
|
return config.getBoolean("socialspy", false);
|
|
|
|
}
|
2011-07-05 21:50:31 +00:00
|
|
|
|
2011-05-04 10:39:56 +00:00
|
|
|
public boolean isSocialSpyEnabled()
|
|
|
|
{
|
|
|
|
return isSocialSpyEnabled;
|
|
|
|
}
|
2011-07-05 21:50:31 +00:00
|
|
|
|
2011-05-13 16:57:45 +00:00
|
|
|
public void setSocialSpyEnabled(boolean status)
|
2011-05-04 10:39:56 +00:00
|
|
|
{
|
2011-05-07 23:58:14 +00:00
|
|
|
isSocialSpyEnabled = status;
|
2011-05-04 10:39:56 +00:00
|
|
|
config.setProperty("socialspy", status);
|
|
|
|
config.save();
|
|
|
|
}
|
2011-05-13 16:57:45 +00:00
|
|
|
private boolean isNPC;
|
2011-07-05 21:50:31 +00:00
|
|
|
|
2011-05-13 16:57:45 +00:00
|
|
|
private boolean _isNPC()
|
|
|
|
{
|
|
|
|
return config.getBoolean("npc", false);
|
|
|
|
}
|
2011-07-05 21:50:31 +00:00
|
|
|
|
2011-05-13 16:57:45 +00:00
|
|
|
public boolean isNPC()
|
|
|
|
{
|
|
|
|
return isNPC;
|
|
|
|
}
|
2011-07-05 21:50:31 +00:00
|
|
|
|
2011-06-01 10:40:12 +00:00
|
|
|
public void setNPC(boolean set)
|
2011-05-13 16:57:45 +00:00
|
|
|
{
|
|
|
|
isNPC = set;
|
|
|
|
config.setProperty("npc", set);
|
|
|
|
config.save();
|
|
|
|
}
|
2011-09-19 21:41:39 +00:00
|
|
|
private boolean arePowerToolsEnabled;
|
2011-09-30 00:11:13 +00:00
|
|
|
|
2011-09-19 21:41:39 +00:00
|
|
|
public boolean arePowerToolsEnabled()
|
|
|
|
{
|
|
|
|
return arePowerToolsEnabled;
|
|
|
|
}
|
2011-09-30 00:11:13 +00:00
|
|
|
|
2011-09-19 21:41:39 +00:00
|
|
|
public void setPowerToolsEnabled(boolean set)
|
|
|
|
{
|
|
|
|
arePowerToolsEnabled = set;
|
|
|
|
config.setProperty("powertoolsenabled", set);
|
|
|
|
config.save();
|
|
|
|
}
|
2011-09-30 00:11:13 +00:00
|
|
|
|
2011-09-19 21:41:39 +00:00
|
|
|
public boolean togglePowerToolsEnabled()
|
|
|
|
{
|
|
|
|
boolean ret = !arePowerToolsEnabled();
|
|
|
|
setPowerToolsEnabled(ret);
|
|
|
|
return ret;
|
|
|
|
}
|
2011-09-30 00:11:13 +00:00
|
|
|
|
2011-09-19 21:41:39 +00:00
|
|
|
private boolean _arePowerToolsEnabled()
|
|
|
|
{
|
|
|
|
return config.getBoolean("powertoolsenabled", true);
|
|
|
|
}
|
2012-09-02 17:11:29 +00:00
|
|
|
private ConfigurationSection kitTimestamps;
|
2011-09-29 22:53:25 +00:00
|
|
|
|
2012-09-02 17:11:29 +00:00
|
|
|
private ConfigurationSection _getKitTimestamps()
|
2011-09-29 22:53:25 +00:00
|
|
|
{
|
2012-03-02 19:05:30 +00:00
|
|
|
|
2012-03-01 22:04:50 +00:00
|
|
|
if (config.isConfigurationSection("timestamps.kits"))
|
2011-09-29 22:53:25 +00:00
|
|
|
{
|
2012-09-02 17:11:29 +00:00
|
|
|
final ConfigurationSection section = config.getConfigurationSection("timestamps.kits");
|
|
|
|
final ConfigurationSection newSection = new MemoryConfiguration();
|
|
|
|
for (String command : section.getKeys(false))
|
|
|
|
{
|
|
|
|
if (section.isLong(command))
|
|
|
|
{
|
|
|
|
newSection.set(command.toLowerCase(Locale.ENGLISH), section.getLong(command));
|
|
|
|
}
|
|
|
|
else if (section.isInt(command))
|
|
|
|
{
|
|
|
|
newSection.set(command.toLowerCase(Locale.ENGLISH), (long)section.getInt(command));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return newSection;
|
2011-09-29 22:53:25 +00:00
|
|
|
}
|
2012-09-02 17:11:29 +00:00
|
|
|
return new MemoryConfiguration();
|
2011-09-29 22:53:25 +00:00
|
|
|
}
|
|
|
|
|
2012-09-02 17:11:29 +00:00
|
|
|
public long getKitTimestamp(String name)
|
2011-09-29 22:53:25 +00:00
|
|
|
{
|
2012-09-02 17:11:29 +00:00
|
|
|
name = name.replace('.', '_').replace('/', '_');
|
|
|
|
if (kitTimestamps != null)
|
|
|
|
{
|
|
|
|
return kitTimestamps.getLong(name, 0l);
|
|
|
|
}
|
|
|
|
return 0l;
|
2011-09-29 22:53:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setKitTimestamp(final String name, final long time)
|
|
|
|
{
|
2012-09-02 17:11:29 +00:00
|
|
|
kitTimestamps.set(name.toLowerCase(Locale.ENGLISH), time);
|
2011-09-29 22:53:25 +00:00
|
|
|
config.setProperty("timestamps.kits", kitTimestamps);
|
|
|
|
config.save();
|
|
|
|
}
|
2011-11-23 01:43:38 +00:00
|
|
|
|
|
|
|
public void save()
|
|
|
|
{
|
|
|
|
config.save();
|
|
|
|
}
|
2011-04-07 02:21:10 +00:00
|
|
|
}
|