Access levels stored in XML.
This commit is contained in:
@@ -1,189 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.l2jmobius.gameserver.datatables;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.GameServerPacket;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
* This class stores references to all online game masters. (access level > 100)
|
||||
* @version $Revision: 1.2.2.1.2.7 $ $Date: 2005/04/05 19:41:24 $
|
||||
*/
|
||||
public class GmListTable
|
||||
{
|
||||
protected static final Logger LOGGER = Logger.getLogger(GmListTable.class.getName());
|
||||
private static GmListTable _instance;
|
||||
|
||||
/** Set(PlayerInstance>) containing all the GM in game */
|
||||
private final Map<PlayerInstance, Boolean> _gmList;
|
||||
|
||||
public static GmListTable getInstance()
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new GmListTable();
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
|
||||
public static void reload()
|
||||
{
|
||||
_instance = null;
|
||||
getInstance();
|
||||
}
|
||||
|
||||
public List<PlayerInstance> getAllGms(boolean includeHidden)
|
||||
{
|
||||
final List<PlayerInstance> tmpGmList = new ArrayList<>();
|
||||
|
||||
for (Entry<PlayerInstance, Boolean> n : _gmList.entrySet())
|
||||
{
|
||||
if (includeHidden || !n.getValue())
|
||||
{
|
||||
tmpGmList.add(n.getKey());
|
||||
}
|
||||
}
|
||||
return tmpGmList;
|
||||
}
|
||||
|
||||
public List<String> getAllGmNames(boolean includeHidden)
|
||||
{
|
||||
final List<String> tmpGmList = new ArrayList<>();
|
||||
|
||||
for (Entry<PlayerInstance, Boolean> n : _gmList.entrySet())
|
||||
{
|
||||
if (!n.getValue())
|
||||
{
|
||||
tmpGmList.add(n.getKey().getName());
|
||||
}
|
||||
else if (includeHidden)
|
||||
{
|
||||
tmpGmList.add(n.getKey().getName() + " (invis)");
|
||||
}
|
||||
}
|
||||
return tmpGmList;
|
||||
}
|
||||
|
||||
private GmListTable()
|
||||
{
|
||||
LOGGER.info("GmListTable: initalized.");
|
||||
_gmList = new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a PlayerInstance player to the Set _gmList
|
||||
* @param player
|
||||
* @param hidden
|
||||
*/
|
||||
public void addGm(PlayerInstance player, boolean hidden)
|
||||
{
|
||||
_gmList.put(player, hidden);
|
||||
}
|
||||
|
||||
public void deleteGm(PlayerInstance player)
|
||||
{
|
||||
_gmList.remove(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* GM will be displayed on clients GM list.
|
||||
* @param player the player
|
||||
*/
|
||||
public void showGm(PlayerInstance player)
|
||||
{
|
||||
if (_gmList.containsKey(player))
|
||||
{
|
||||
_gmList.put(player, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* GM will no longer be displayed on clients GM list.
|
||||
* @param player the player
|
||||
*/
|
||||
public void hideGm(PlayerInstance player)
|
||||
{
|
||||
if (_gmList.containsKey(player))
|
||||
{
|
||||
_gmList.put(player, true);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isGmOnline(boolean includeHidden)
|
||||
{
|
||||
for (boolean b : _gmList.values())
|
||||
{
|
||||
if (includeHidden || !b)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void sendListToPlayer(PlayerInstance player)
|
||||
{
|
||||
if (isGmOnline(player.isGM()))
|
||||
{
|
||||
SystemMessage sm = new SystemMessage(SystemMessageId.GM_LIST);
|
||||
player.sendPacket(sm);
|
||||
|
||||
for (String name : getAllGmNames(player.isGM()))
|
||||
{
|
||||
final SystemMessage sm1 = new SystemMessage(SystemMessageId.GM_S1);
|
||||
sm1.addString(name);
|
||||
player.sendPacket(sm1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SystemMessage sm2 = new SystemMessage(SystemMessageId.NO_GM_PROVIDING_SERVICE_NOW);
|
||||
player.sendPacket(sm2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void broadcastToGMs(GameServerPacket packet)
|
||||
{
|
||||
for (PlayerInstance gm : getInstance().getAllGms(true))
|
||||
{
|
||||
gm.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
public static void broadcastMessageToGMs(String message)
|
||||
{
|
||||
for (PlayerInstance gm : getInstance().getAllGms(true))
|
||||
{
|
||||
// prevents a NPE.
|
||||
if (gm != null)
|
||||
{
|
||||
gm.sendPacket(SystemMessage.sendString(message));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,199 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.l2jmobius.gameserver.datatables.sql;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.gameserver.datatables.AccessLevel;
|
||||
|
||||
/**
|
||||
* @author FBIagent<br>
|
||||
*/
|
||||
public class AccessLevels
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(AccessLevels.class.getName());
|
||||
|
||||
private static AccessLevels _instance = null;
|
||||
public AccessLevel _masterAccessLevel;
|
||||
public AccessLevel _userAccessLevel;
|
||||
private final Map<Integer, AccessLevel> _accessLevels = new HashMap<>();
|
||||
|
||||
private AccessLevels()
|
||||
{
|
||||
_masterAccessLevel = new AccessLevel(Config.MASTERACCESS_LEVEL, "Master Access", Config.MASTERACCESS_NAME_COLOR, Config.MASTERACCESS_TITLE_COLOR, true, true, true, true, true, true, true, true, true, true, true);
|
||||
_userAccessLevel = new AccessLevel(Config.USERACCESS_LEVEL, "User", Integer.decode("0xFFFFFF"), Integer.decode("0xFFFFFF"), false, false, false, true, false, true, true, true, true, true, false);
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
final PreparedStatement stmt = con.prepareStatement("SELECT * FROM `access_levels` ORDER BY `accessLevel` DESC");
|
||||
final ResultSet rset = stmt.executeQuery();
|
||||
int accessLevel = 0;
|
||||
String name = null;
|
||||
int nameColor = 0;
|
||||
int titleColor = 0;
|
||||
boolean isGm = false;
|
||||
boolean allowPeaceAttack = false;
|
||||
boolean allowFixedRes = false;
|
||||
boolean allowTransaction = false;
|
||||
boolean allowAltG = false;
|
||||
boolean giveDamage = false;
|
||||
boolean takeAggro = false;
|
||||
boolean gainExp = false;
|
||||
|
||||
boolean useNameColor = true;
|
||||
boolean useTitleColor = false;
|
||||
boolean canDisableGmStatus = true;
|
||||
|
||||
while (rset.next())
|
||||
{
|
||||
accessLevel = rset.getInt("accessLevel");
|
||||
name = rset.getString("name");
|
||||
|
||||
if (accessLevel == Config.USERACCESS_LEVEL)
|
||||
{
|
||||
LOGGER.info("AccessLevels: Access level with name " + name + " is using reserved user access level " + Config.USERACCESS_LEVEL + ". Ignoring it...");
|
||||
continue;
|
||||
}
|
||||
else if (accessLevel == Config.MASTERACCESS_LEVEL)
|
||||
{
|
||||
LOGGER.info("AccessLevels: Access level with name " + name + " is using reserved master access level " + Config.MASTERACCESS_LEVEL + ". Ignoring it...");
|
||||
continue;
|
||||
}
|
||||
else if (accessLevel < 0)
|
||||
{
|
||||
LOGGER.info("AccessLevels: Access level with name " + name + " is using banned access level state(below 0). Ignoring it...");
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
nameColor = Integer.decode("0x" + rset.getString("nameColor"));
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
LOGGER.warning(nfe.getMessage());
|
||||
|
||||
try
|
||||
{
|
||||
nameColor = Integer.decode("0xFFFFFF");
|
||||
}
|
||||
catch (NumberFormatException nfe2)
|
||||
{
|
||||
LOGGER.warning(nfe.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
titleColor = Integer.decode("0x" + rset.getString("titleColor"));
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
LOGGER.warning(nfe.getMessage());
|
||||
|
||||
try
|
||||
{
|
||||
titleColor = Integer.decode("0x77FFFF");
|
||||
}
|
||||
catch (NumberFormatException nfe2)
|
||||
{
|
||||
LOGGER.warning(nfe.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
isGm = rset.getBoolean("isGm");
|
||||
allowPeaceAttack = rset.getBoolean("allowPeaceAttack");
|
||||
allowFixedRes = rset.getBoolean("allowFixedRes");
|
||||
allowTransaction = rset.getBoolean("allowTransaction");
|
||||
allowAltG = rset.getBoolean("allowAltg");
|
||||
giveDamage = rset.getBoolean("giveDamage");
|
||||
takeAggro = rset.getBoolean("takeAggro");
|
||||
gainExp = rset.getBoolean("gainExp");
|
||||
|
||||
useNameColor = rset.getBoolean("useNameColor");
|
||||
useTitleColor = rset.getBoolean("useTitleColor");
|
||||
canDisableGmStatus = rset.getBoolean("canDisableGmStatus");
|
||||
|
||||
_accessLevels.put(accessLevel, new AccessLevel(accessLevel, name, nameColor, titleColor, isGm, allowPeaceAttack, allowFixedRes, allowTransaction, allowAltG, giveDamage, takeAggro, gainExp, useNameColor, useTitleColor, canDisableGmStatus));
|
||||
}
|
||||
|
||||
rset.close();
|
||||
stmt.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.warning("AccessLevels: Error loading from database " + e);
|
||||
}
|
||||
LOGGER.info("AccessLevels: Master Access Level is " + Config.MASTERACCESS_LEVEL + ".");
|
||||
LOGGER.info("AccessLevels: User Access Level is " + Config.USERACCESS_LEVEL + ".");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the one and only instance of this class<br>
|
||||
* <br>
|
||||
* @return AccessLevels: the one and only instance of this class<br>
|
||||
*/
|
||||
public static AccessLevels getInstance()
|
||||
{
|
||||
return _instance == null ? (_instance = new AccessLevels()) : _instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the access level by characterAccessLevel<br>
|
||||
* <br>
|
||||
* @param accessLevelNum as int<br>
|
||||
* <br>
|
||||
* @return AccessLevel: AccessLevel instance by char access level<br>
|
||||
*/
|
||||
public AccessLevel getAccessLevel(int accessLevelNum)
|
||||
{
|
||||
AccessLevel accessLevel = null;
|
||||
|
||||
synchronized (_accessLevels)
|
||||
{
|
||||
accessLevel = _accessLevels.get(accessLevelNum);
|
||||
}
|
||||
return accessLevel;
|
||||
}
|
||||
|
||||
public void addBanAccessLevel(int accessLevel)
|
||||
{
|
||||
synchronized (_accessLevels)
|
||||
{
|
||||
if (accessLevel > -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_accessLevels.put(accessLevel, new AccessLevel(accessLevel, "Banned", Integer.decode("0x000000"), Integer.decode("0x000000"), false, false, false, false, false, false, false, false, false, false, false));
|
||||
}
|
||||
}
|
||||
|
||||
public static void reload()
|
||||
{
|
||||
_instance = null;
|
||||
getInstance();
|
||||
}
|
||||
}
|
@@ -1,138 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.l2jmobius.gameserver.datatables.sql;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.gameserver.datatables.AccessLevel;
|
||||
|
||||
/**
|
||||
* @author FBIagent<br>
|
||||
*/
|
||||
public class AdminCommandAccessRights
|
||||
{
|
||||
protected static final Logger LOGGER = Logger.getLogger(AdminCommandAccessRights.class.getName());
|
||||
|
||||
private static AdminCommandAccessRights _instance = null;
|
||||
private final Map<String, Integer> adminCommandAccessRights = new HashMap<>();
|
||||
|
||||
private AdminCommandAccessRights()
|
||||
{
|
||||
try (Connection con = DatabaseFactory.getConnection())
|
||||
{
|
||||
final PreparedStatement stmt = con.prepareStatement("SELECT * FROM admin_command_access_rights");
|
||||
final ResultSet rset = stmt.executeQuery();
|
||||
String adminCommand = null;
|
||||
int accessLevels = 1;
|
||||
|
||||
while (rset.next())
|
||||
{
|
||||
adminCommand = rset.getString("adminCommand");
|
||||
accessLevels = rset.getInt("accessLevels");
|
||||
adminCommandAccessRights.put(adminCommand, accessLevels);
|
||||
}
|
||||
rset.close();
|
||||
stmt.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.warning("Admin Access Rights: Error loading from database " + e);
|
||||
}
|
||||
|
||||
LOGGER.info("Admin Access Rights: Loaded " + adminCommandAccessRights.size() + " Access Rigths from database.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the one and only instance of this class<br>
|
||||
* <br>
|
||||
* @return AdminCommandAccessRights: the one and only instance of this class<br>
|
||||
*/
|
||||
public static AdminCommandAccessRights getInstance()
|
||||
{
|
||||
return _instance == null ? (_instance = new AdminCommandAccessRights()) : _instance;
|
||||
}
|
||||
|
||||
public static void reload()
|
||||
{
|
||||
_instance = null;
|
||||
getInstance();
|
||||
}
|
||||
|
||||
public int accessRightForCommand(String command)
|
||||
{
|
||||
int out = -1;
|
||||
|
||||
if (adminCommandAccessRights.containsKey(command))
|
||||
{
|
||||
out = adminCommandAccessRights.get(command);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
public boolean hasAccess(String adminCommand, AccessLevel accessLevel)
|
||||
{
|
||||
if (accessLevel.getLevel() <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!accessLevel.isGm())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (accessLevel.getLevel() == Config.MASTERACCESS_LEVEL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
String command = adminCommand;
|
||||
if (adminCommand.indexOf(" ") != -1)
|
||||
{
|
||||
command = adminCommand.substring(0, adminCommand.indexOf(" "));
|
||||
}
|
||||
|
||||
int acar = 0;
|
||||
if (adminCommandAccessRights.get(command) != null)
|
||||
{
|
||||
acar = adminCommandAccessRights.get(command);
|
||||
}
|
||||
|
||||
if (acar == 0)
|
||||
{
|
||||
LOGGER.warning("Admin Access Rights: No rights defined for admin command " + command + ".");
|
||||
return false;
|
||||
}
|
||||
else if (acar >= accessLevel.getLevel())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,406 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.l2jmobius.gameserver.datatables.xml;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.IXmlReader;
|
||||
import org.l2jmobius.gameserver.datatables.AccessLevel;
|
||||
import org.l2jmobius.gameserver.model.StatsSet;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.GameServerPacket;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
* Loads administrator access levels and commands.
|
||||
* @author Mobius
|
||||
*/
|
||||
public class AdminData implements IXmlReader
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(AdminData.class.getName());
|
||||
|
||||
public AccessLevel _masterAccessLevel;
|
||||
public AccessLevel _userAccessLevel;
|
||||
private final Map<Integer, AccessLevel> _accessLevels = new HashMap<>();
|
||||
private final Map<String, Integer> _adminCommandAccessRights = new HashMap<>();
|
||||
private final Map<PlayerInstance, Boolean> _gmList = new ConcurrentHashMap<>();
|
||||
|
||||
protected AdminData()
|
||||
{
|
||||
load();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load()
|
||||
{
|
||||
_accessLevels.clear();
|
||||
_masterAccessLevel = new AccessLevel(Config.MASTERACCESS_LEVEL, "Master Access", Config.MASTERACCESS_NAME_COLOR, Config.MASTERACCESS_TITLE_COLOR, true, true, true, true, true, true, true, true, true, true, true);
|
||||
_userAccessLevel = new AccessLevel(Config.USERACCESS_LEVEL, "User", Integer.decode("0xFFFFFF"), Integer.decode("0xFFFFFF"), false, false, false, true, false, true, true, true, true, true, false);
|
||||
parseDatapackFile("config/AccessLevels.xml");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _accessLevels.size() + " access levels.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Master access level is " + Config.MASTERACCESS_LEVEL + ".");
|
||||
LOGGER.info(getClass().getSimpleName() + ": User access level is " + Config.USERACCESS_LEVEL + ".");
|
||||
|
||||
_adminCommandAccessRights.clear();
|
||||
parseDatapackFile("config/AdminCommands.xml");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _adminCommandAccessRights.size() + " access commands.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parseDocument(Document doc, File f)
|
||||
{
|
||||
StatsSet set = null;
|
||||
String command = null;
|
||||
int accessLevel = 0;
|
||||
String name = null;
|
||||
int nameColor = 0;
|
||||
int titleColor = 0;
|
||||
boolean isGm = false;
|
||||
boolean allowPeaceAttack = false;
|
||||
boolean allowFixedRes = false;
|
||||
boolean allowTransaction = false;
|
||||
boolean allowAltG = false;
|
||||
boolean giveDamage = false;
|
||||
boolean takeAggro = false;
|
||||
boolean gainExp = false;
|
||||
boolean useNameColor = true;
|
||||
boolean useTitleColor = false;
|
||||
boolean canDisableGmStatus = true;
|
||||
|
||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
||||
{
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
{
|
||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
{
|
||||
if ("access".equals(d.getNodeName()))
|
||||
{
|
||||
set = new StatsSet(parseAttributes(d));
|
||||
|
||||
accessLevel = set.getInt("level");
|
||||
name = set.getString("name");
|
||||
|
||||
if (accessLevel == Config.USERACCESS_LEVEL)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Access level with name " + name + " is using reserved user access level " + Config.USERACCESS_LEVEL + ". Ignoring it...");
|
||||
continue;
|
||||
}
|
||||
else if (accessLevel == Config.MASTERACCESS_LEVEL)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Access level with name " + name + " is using reserved master access level " + Config.MASTERACCESS_LEVEL + ". Ignoring it...");
|
||||
continue;
|
||||
}
|
||||
else if (accessLevel < 0)
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Access level with name " + name + " is using banned access level state(below 0). Ignoring it...");
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
nameColor = Integer.decode("0x" + set.getString("nameColor"));
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
LOGGER.warning(nfe.getMessage());
|
||||
|
||||
try
|
||||
{
|
||||
nameColor = Integer.decode("0xFFFFFF");
|
||||
}
|
||||
catch (NumberFormatException nfe2)
|
||||
{
|
||||
LOGGER.warning(nfe.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
titleColor = Integer.decode("0x" + set.getString("titleColor"));
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
LOGGER.warning(nfe.getMessage());
|
||||
|
||||
try
|
||||
{
|
||||
titleColor = Integer.decode("0x77FFFF");
|
||||
}
|
||||
catch (NumberFormatException nfe2)
|
||||
{
|
||||
LOGGER.warning(nfe.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
isGm = set.getBoolean("isGm");
|
||||
allowPeaceAttack = set.getBoolean("allowPeaceAttack");
|
||||
allowFixedRes = set.getBoolean("allowFixedRes");
|
||||
allowTransaction = set.getBoolean("allowTransaction");
|
||||
allowAltG = set.getBoolean("allowAltg");
|
||||
giveDamage = set.getBoolean("giveDamage");
|
||||
takeAggro = set.getBoolean("takeAggro");
|
||||
gainExp = set.getBoolean("gainExp");
|
||||
|
||||
useNameColor = set.getBoolean("useNameColor");
|
||||
useTitleColor = set.getBoolean("useTitleColor");
|
||||
canDisableGmStatus = set.getBoolean("canDisableGmStatus");
|
||||
|
||||
_accessLevels.put(accessLevel, new AccessLevel(accessLevel, name, nameColor, titleColor, isGm, allowPeaceAttack, allowFixedRes, allowTransaction, allowAltG, giveDamage, takeAggro, gainExp, useNameColor, useTitleColor, canDisableGmStatus));
|
||||
}
|
||||
else if ("admin".equals(d.getNodeName()))
|
||||
{
|
||||
set = new StatsSet(parseAttributes(d));
|
||||
|
||||
command = set.getString("command");
|
||||
accessLevel = set.getInt("accessLevel");
|
||||
_adminCommandAccessRights.put(command, accessLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the access level by characterAccessLevel<br>
|
||||
* <br>
|
||||
* @param accessLevelNum as int<br>
|
||||
* <br>
|
||||
* @return AccessLevel: AccessLevel instance by char access level<br>
|
||||
*/
|
||||
public AccessLevel getAccessLevel(int accessLevelNum)
|
||||
{
|
||||
AccessLevel accessLevel = null;
|
||||
|
||||
synchronized (_accessLevels)
|
||||
{
|
||||
accessLevel = _accessLevels.get(accessLevelNum);
|
||||
}
|
||||
return accessLevel;
|
||||
}
|
||||
|
||||
public void addBanAccessLevel(int accessLevel)
|
||||
{
|
||||
synchronized (_accessLevels)
|
||||
{
|
||||
if (accessLevel > -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_accessLevels.put(accessLevel, new AccessLevel(accessLevel, "Banned", Integer.decode("0x000000"), Integer.decode("0x000000"), false, false, false, false, false, false, false, false, false, false, false));
|
||||
}
|
||||
}
|
||||
|
||||
public int accessRightForCommand(String command)
|
||||
{
|
||||
int out = -1;
|
||||
if (_adminCommandAccessRights.containsKey(command))
|
||||
{
|
||||
out = _adminCommandAccessRights.get(command);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
public boolean hasAccess(String adminCommand, AccessLevel accessLevel)
|
||||
{
|
||||
if (accessLevel.getLevel() <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!accessLevel.isGm())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (accessLevel.getLevel() == Config.MASTERACCESS_LEVEL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
String command = adminCommand;
|
||||
if (adminCommand.indexOf(" ") != -1)
|
||||
{
|
||||
command = adminCommand.substring(0, adminCommand.indexOf(" "));
|
||||
}
|
||||
|
||||
int acar = 0;
|
||||
if (_adminCommandAccessRights.get(command) != null)
|
||||
{
|
||||
acar = _adminCommandAccessRights.get(command);
|
||||
}
|
||||
|
||||
if (acar == 0)
|
||||
{
|
||||
LOGGER.warning("Admin Access Rights: No rights defined for admin command " + command + ".");
|
||||
return false;
|
||||
}
|
||||
else if (acar >= accessLevel.getLevel())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public List<PlayerInstance> getAllGms(boolean includeHidden)
|
||||
{
|
||||
final List<PlayerInstance> tmpGmList = new ArrayList<>();
|
||||
|
||||
for (Entry<PlayerInstance, Boolean> n : _gmList.entrySet())
|
||||
{
|
||||
if (includeHidden || !n.getValue())
|
||||
{
|
||||
tmpGmList.add(n.getKey());
|
||||
}
|
||||
}
|
||||
return tmpGmList;
|
||||
}
|
||||
|
||||
public List<String> getAllGmNames(boolean includeHidden)
|
||||
{
|
||||
final List<String> tmpGmList = new ArrayList<>();
|
||||
|
||||
for (Entry<PlayerInstance, Boolean> n : _gmList.entrySet())
|
||||
{
|
||||
if (!n.getValue())
|
||||
{
|
||||
tmpGmList.add(n.getKey().getName());
|
||||
}
|
||||
else if (includeHidden)
|
||||
{
|
||||
tmpGmList.add(n.getKey().getName() + " (invis)");
|
||||
}
|
||||
}
|
||||
return tmpGmList;
|
||||
}
|
||||
|
||||
public void addGm(PlayerInstance player, boolean hidden)
|
||||
{
|
||||
_gmList.put(player, hidden);
|
||||
}
|
||||
|
||||
public void deleteGm(PlayerInstance player)
|
||||
{
|
||||
_gmList.remove(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* GM will be displayed on clients GM list.
|
||||
* @param player the player
|
||||
*/
|
||||
public void showGm(PlayerInstance player)
|
||||
{
|
||||
if (_gmList.containsKey(player))
|
||||
{
|
||||
_gmList.put(player, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* GM will no longer be displayed on clients GM list.
|
||||
* @param player the player
|
||||
*/
|
||||
public void hideGm(PlayerInstance player)
|
||||
{
|
||||
if (_gmList.containsKey(player))
|
||||
{
|
||||
_gmList.put(player, true);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isGmOnline(boolean includeHidden)
|
||||
{
|
||||
for (boolean b : _gmList.values())
|
||||
{
|
||||
if (includeHidden || !b)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void sendListToPlayer(PlayerInstance player)
|
||||
{
|
||||
if (isGmOnline(player.isGM()))
|
||||
{
|
||||
SystemMessage sm = new SystemMessage(SystemMessageId.GM_LIST);
|
||||
player.sendPacket(sm);
|
||||
|
||||
for (String name : getAllGmNames(player.isGM()))
|
||||
{
|
||||
final SystemMessage sm1 = new SystemMessage(SystemMessageId.GM_S1);
|
||||
sm1.addString(name);
|
||||
player.sendPacket(sm1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SystemMessage sm2 = new SystemMessage(SystemMessageId.NO_GM_PROVIDING_SERVICE_NOW);
|
||||
player.sendPacket(sm2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void broadcastToGMs(GameServerPacket packet)
|
||||
{
|
||||
for (PlayerInstance gm : getInstance().getAllGms(true))
|
||||
{
|
||||
gm.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
public static void broadcastMessageToGMs(String message)
|
||||
{
|
||||
for (PlayerInstance gm : getInstance().getAllGms(true))
|
||||
{
|
||||
if (gm != null)
|
||||
{
|
||||
gm.sendPacket(SystemMessage.sendString(message));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the single instance of AdminTable.
|
||||
* @return AccessLevels: the one and only instance of this class<br>
|
||||
*/
|
||||
public static AdminData getInstance()
|
||||
{
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final AdminData INSTANCE = new AdminData();
|
||||
}
|
||||
}
|
@@ -20,7 +20,7 @@ import java.util.StringTokenizer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.datatables.GmListTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.entity.olympiad.Olympiad;
|
||||
@@ -100,14 +100,14 @@ public class AdminAdmin implements IAdminCommandHandler
|
||||
}
|
||||
case admin_gmliston:
|
||||
{
|
||||
GmListTable.getInstance().showGm(activeChar);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Registerd into gm list");
|
||||
AdminData.getInstance().showGm(activeChar);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Registerd into gm list.");
|
||||
return true;
|
||||
}
|
||||
case admin_gmlistoff:
|
||||
{
|
||||
GmListTable.getInstance().hideGm(activeChar);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Removed from gm list");
|
||||
AdminData.getInstance().hideGm(activeChar);
|
||||
BuilderUtil.sendSysMessage(activeChar, "Removed from gm list.");
|
||||
return true;
|
||||
}
|
||||
case admin_silence:
|
||||
|
@@ -23,7 +23,7 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.gameserver.datatables.GmListTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -193,7 +193,7 @@ public class AdminAio implements IAdminCommandHandler
|
||||
_player.broadcastUserInfo();
|
||||
_player.sendPacket(new EtcStatusUpdate(_player));
|
||||
_player.sendSkillList();
|
||||
GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " set Aio stat for player " + _playername + " for " + _time + " day(s)");
|
||||
AdminData.broadcastMessageToGMs("GM " + activeChar.getName() + " set Aio stat for player " + _playername + " for " + _time + " day(s)");
|
||||
_player.sendMessage("You are now an Aio, Congratulations!");
|
||||
_player.broadcastUserInfo();
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public class AdminAio implements IAdminCommandHandler
|
||||
_player.broadcastUserInfo();
|
||||
_player.sendPacket(new EtcStatusUpdate(_player));
|
||||
_player.sendSkillList();
|
||||
GmListTable.broadcastMessageToGMs("GM " + activeChar.getName() + " remove Aio stat of player " + _playername);
|
||||
AdminData.broadcastMessageToGMs("GM " + activeChar.getName() + " remove Aio stat of player " + _playername);
|
||||
_player.sendMessage("Now You are not an Aio..");
|
||||
_player.broadcastUserInfo();
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ import java.sql.PreparedStatement;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.gameserver.datatables.GmListTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -98,7 +98,7 @@ public class AdminDonator implements IAdminCommandHandler
|
||||
|
||||
if (notifyGmList)
|
||||
{
|
||||
GmListTable.broadcastMessageToGMs("Warn: " + gm.getName() + " has set " + player.getName() + " as Donator !");
|
||||
AdminData.broadcastMessageToGMs("Warn: " + gm.getName() + " has set " + player.getName() + " as Donator !");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -113,7 +113,7 @@ public class AdminDonator implements IAdminCommandHandler
|
||||
|
||||
if (notifyGmList)
|
||||
{
|
||||
GmListTable.broadcastMessageToGMs("Warn: " + gm.getName() + " has removed Donator Status of player" + player.getName());
|
||||
AdminData.broadcastMessageToGMs("Warn: " + gm.getName() + " has removed Donator Status of player" + player.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@ import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.DropCategory;
|
||||
import org.l2jmobius.gameserver.model.DropData;
|
||||
import org.l2jmobius.gameserver.model.Skill;
|
||||
import org.l2jmobius.gameserver.model.StatsSet;
|
||||
import org.l2jmobius.gameserver.model.StoreTradeList;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.BoxInstance;
|
||||
@@ -45,7 +46,6 @@ import org.l2jmobius.gameserver.model.actor.instance.ItemInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import org.l2jmobius.gameserver.templates.StatsSet;
|
||||
import org.l2jmobius.gameserver.templates.creatures.NpcTemplate;
|
||||
import org.l2jmobius.gameserver.templates.item.Item;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
@@ -1186,7 +1186,7 @@ public class AdminEditNpc implements IAdminCommandHandler
|
||||
LOGGER.warning("Error saving new npc value: " + e);
|
||||
}
|
||||
|
||||
final int npcId = newNpcData.getInteger("npcId");
|
||||
final int npcId = newNpcData.getInt("npcId");
|
||||
final NpcTemplate old = NpcTable.getInstance().getTemplate(npcId);
|
||||
|
||||
if (old.isCustom())
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.handler.admincommandhandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.datatables.GmListTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
@@ -53,12 +53,12 @@ public class AdminGm implements IAdminCommandHandler
|
||||
{
|
||||
if (activeChar.isGM())
|
||||
{
|
||||
GmListTable.getInstance().deleteGm(activeChar);
|
||||
AdminData.getInstance().deleteGm(activeChar);
|
||||
BuilderUtil.sendSysMessage(activeChar, "You no longer have GM status.");
|
||||
}
|
||||
else
|
||||
{
|
||||
GmListTable.getInstance().addGm(activeChar, false);
|
||||
AdminData.getInstance().addGm(activeChar, false);
|
||||
BuilderUtil.sendSysMessage(activeChar, "You now have GM status.");
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.handler.admincommandhandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.datatables.GmListTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
@@ -117,7 +117,7 @@ public class AdminGmChat implements IAdminCommandHandler
|
||||
|
||||
text = command.substring(offset);
|
||||
CreatureSay cs = new CreatureSay(0, 9, activeChar.getName(), text);
|
||||
GmListTable.broadcastToGMs(cs);
|
||||
AdminData.broadcastToGMs(cs);
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
|
@@ -21,7 +21,7 @@ import java.sql.PreparedStatement;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.gameserver.datatables.GmListTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -92,7 +92,7 @@ public class AdminNoble implements IAdminCommandHandler
|
||||
|
||||
if (notifyGmList)
|
||||
{
|
||||
GmListTable.broadcastMessageToGMs("Warn: " + gm.getName() + " has set " + player.getName() + " as Noble !");
|
||||
AdminData.broadcastMessageToGMs("Warn: " + gm.getName() + " has set " + player.getName() + " as Noble !");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -102,7 +102,7 @@ public class AdminNoble implements IAdminCommandHandler
|
||||
|
||||
if (notifyGmList)
|
||||
{
|
||||
GmListTable.broadcastMessageToGMs("Warn: " + gm.getName() + " has removed Noble Status of player" + player.getName());
|
||||
AdminData.broadcastMessageToGMs("Warn: " + gm.getName() + " has removed Noble Status of player" + player.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -24,10 +24,10 @@ import java.util.StringTokenizer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.datatables.GmListTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.TeleportLocationTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.DayNightSpawnManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
@@ -178,7 +178,7 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
RaidBossSpawnManager.getInstance().cleanUp();
|
||||
DayNightSpawnManager.getInstance().cleanUp();
|
||||
World.getInstance().deleteVisibleNpcSpawns();
|
||||
GmListTable.broadcastMessageToGMs("NPC Unspawn completed!");
|
||||
AdminData.broadcastMessageToGMs("NPC Unspawn completed!");
|
||||
}
|
||||
else if (command.startsWith("admin_spawnday"))
|
||||
{
|
||||
@@ -199,12 +199,12 @@ public class AdminSpawn implements IAdminCommandHandler
|
||||
SpawnTable.getInstance().reloadAll();
|
||||
RaidBossSpawnManager.getInstance().load();
|
||||
SevenSigns.getInstance().spawnSevenSignsNPC();
|
||||
GmListTable.broadcastMessageToGMs("NPC Respawn completed!");
|
||||
AdminData.broadcastMessageToGMs("NPC Respawn completed!");
|
||||
}
|
||||
else if (command.startsWith("admin_teleport_reload"))
|
||||
{
|
||||
TeleportLocationTable.getInstance().reloadAll();
|
||||
GmListTable.broadcastMessageToGMs("Teleport List Table reloaded.");
|
||||
AdminData.broadcastMessageToGMs("Teleport List Table reloaded.");
|
||||
}
|
||||
else if (command.startsWith("admin_topspawncount") || command.startsWith("admin_top_spawn_count"))
|
||||
{
|
||||
|
@@ -18,8 +18,8 @@ package org.l2jmobius.gameserver.handler.admincommandhandlers;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.l2jmobius.gameserver.datatables.GmListTable;
|
||||
import org.l2jmobius.gameserver.datatables.csv.MapRegionTable;
|
||||
import org.l2jmobius.gameserver.datatables.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -93,7 +93,7 @@ public class AdminZone implements IAdminCommandHandler
|
||||
else if (actualCommand.equalsIgnoreCase("admin_zone_reload"))
|
||||
{
|
||||
// TODO: ZONETODO ZoneManager.getInstance().reload();
|
||||
GmListTable.broadcastMessageToGMs("Zones can not be reloaded in this version.");
|
||||
AdminData.broadcastMessageToGMs("Zones can not be reloaded in this version.");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@@ -23,7 +23,6 @@ import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.gameserver.datatables.GmListTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.PlayerCountManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
|
||||
@@ -182,16 +181,6 @@ public class World
|
||||
return _allObjects.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a table containing all GMs.<BR>
|
||||
* <BR>
|
||||
* @return the all g ms
|
||||
*/
|
||||
public List<PlayerInstance> getAllGMs()
|
||||
{
|
||||
return GmListTable.getInstance().getAllGms(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a collection containing all players in game.<BR>
|
||||
* <BR>
|
||||
|
Reference in New Issue
Block a user