Removed pointless user and master access levels.

This commit is contained in:
MobiusDevelopment
2020-01-31 20:35:57 +00:00
parent b8cc736d7b
commit d4cb185c34
9 changed files with 43 additions and 234 deletions

View File

@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../data/xsd/AccessLevels.xsd"> <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../data/xsd/AccessLevels.xsd">
<!-- Access levels --> <!-- Access levels -->
<access level="100" name="Master Access" nameColor="0099FF" useNameColor="true" titleColor="0099FF" useTitleColor="false" isGm="true" allowPeaceAttack="true" allowFixedRes="true" allowTransaction="true" allowAltg="true" giveDamage="true" takeAggro="true" gainExp="true" canDisableGmStatus="true" /> <access level="100" name="Master Access" nameColor="00CCFF" useNameColor="true" titleColor="00CCFF" useTitleColor="false" isGm="true" allowPeaceAttack="true" allowFixedRes="true" allowTransaction="true" allowAltg="true" giveDamage="true" takeAggro="true" gainExp="true" canDisableGmStatus="true" />
<access level="90" name="Head GM" nameColor="00FFFF" useNameColor="true" titleColor="00FFFF" useTitleColor="false" isGm="true" allowPeaceAttack="true" allowFixedRes="true" allowTransaction="true" allowAltg="true" giveDamage="true" takeAggro="true" gainExp="true" canDisableGmStatus="true" /> <access level="90" name="Head GM" nameColor="00FFFF" useNameColor="true" titleColor="00FFFF" useTitleColor="false" isGm="true" allowPeaceAttack="true" allowFixedRes="true" allowTransaction="true" allowAltg="true" giveDamage="true" takeAggro="true" gainExp="true" canDisableGmStatus="true" />
<access level="80" name="Event GM" nameColor="00FFFF" useNameColor="true" titleColor="00FFFF" useTitleColor="false" isGm="true" allowPeaceAttack="true" allowFixedRes="true" allowTransaction="false" allowAltg="true" giveDamage="false" takeAggro="false" gainExp="false" canDisableGmStatus="false" /> <access level="80" name="Event GM" nameColor="00FFFF" useNameColor="true" titleColor="00FFFF" useTitleColor="false" isGm="true" allowPeaceAttack="true" allowFixedRes="true" allowTransaction="false" allowAltg="true" giveDamage="false" takeAggro="false" gainExp="false" canDisableGmStatus="false" />
<access level="70" name="Support GM" nameColor="00FFFF" useNameColor="true" titleColor="00FFFF" useTitleColor="false" isGm="true" allowPeaceAttack="false" allowFixedRes="true" allowTransaction="false" allowAltg="true" giveDamage="false" takeAggro="false" gainExp="false" canDisableGmStatus="false" /> <access level="70" name="Support GM" nameColor="00FFFF" useNameColor="true" titleColor="00FFFF" useTitleColor="false" isGm="true" allowPeaceAttack="false" allowFixedRes="true" allowTransaction="false" allowAltg="true" giveDamage="false" takeAggro="false" gainExp="false" canDisableGmStatus="false" />
<access level="60" name="General GM" nameColor="00FFFF" useNameColor="true" titleColor="00FFFF" useTitleColor="false" isGm="true" allowPeaceAttack="false" allowFixedRes="true" allowTransaction="false" allowAltg="true" giveDamage="false" takeAggro="false" gainExp="false" canDisableGmStatus="false" /> <access level="60" name="General GM" nameColor="00FFFF" useNameColor="true" titleColor="00FFFF" useTitleColor="false" isGm="true" allowPeaceAttack="false" allowFixedRes="true" allowTransaction="false" allowAltg="true" giveDamage="false" takeAggro="false" gainExp="false" canDisableGmStatus="false" />
<access level="50" name="Test GM" nameColor="FFFFFF" useNameColor="true" titleColor="FFFFFF" useTitleColor="false" isGm="false" allowPeaceAttack="false" allowFixedRes="true" allowTransaction="false" allowAltg="true" giveDamage="false" takeAggro="false" gainExp="false" canDisableGmStatus="false" /> <access level="50" name="Test GM" nameColor="FFFFFF" useNameColor="true" titleColor="FFFFFF" useTitleColor="false" isGm="false" allowPeaceAttack="false" allowFixedRes="true" allowTransaction="false" allowAltg="true" giveDamage="false" takeAggro="false" gainExp="false" canDisableGmStatus="false" />
<access level="0" name="User" nameColor="FFFFFF" useNameColor="false" titleColor="ECF9A2" useTitleColor="false" isGm="false" allowPeaceAttack="false" allowFixedRes="false" allowTransaction="true" allowAltg="false" giveDamage="true" takeAggro="true" gainExp="true" canDisableGmStatus="false" />
</list> </list>

View File

@@ -3,43 +3,13 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# Admin Rights
# ---------------------------------------------------------------------------
# If next switch set to true every created character will have Admin access. # If next switch set to true every created character will have Admin access.
EverybodyHasAdminRights = False EverybodyHasAdminRights = False
# This option will set the default AccessLevel for MasterAccess
# Pls be carefully with that. Chars with this AccessLevel have
# right to execute every AdminCommand ingame.
# Default = 100 - Max. 255
MasterAccessLevel = 100
# This option will set the default AccessLevel for UserAccess
# Chars with this AccessLevel have user rights
# Default = 0 - Max. 255
UserAccessLevel = 0
# ---------------------------------------------------------------------------
# GM Rights
# ---------------------------------------------------------------------------
# The way //admin panel looks can be "modern" or "classic" # The way //admin panel looks can be "modern" or "classic"
# (default is modern while classic provides more compatibility) # (default is modern while classic provides more compatibility)
GMAdminMenuStyle = modern GMAdminMenuStyle = modern
#Turn on MasterNameColor config.
MasterNameColorEnabled = True
# This option will set the Default NameColor for MasterAccess
MasterNameColor = 00CCFF
# Turn on MasterTitleColor config.
MasterTitleColorEnabled = True
# This option will set the Default TitleColor for MasterAccess
MasterTitleColor = 00CCFF
# Enable GMs to have the glowing aura of a Hero character. # Enable GMs to have the glowing aura of a Hero character.
GMHeroAura = False GMHeroAura = False

View File

@@ -112,12 +112,6 @@ public class Config
public static ServerMode SERVER_MODE = ServerMode.NONE; public static ServerMode SERVER_MODE = ServerMode.NONE;
public static boolean EVERYBODY_HAS_ADMIN_RIGHTS; public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
public static int MASTERACCESS_LEVEL;
public static int USERACCESS_LEVEL;
public static boolean MASTERACCESS_NAME_COLOR_ENABLED;
public static boolean MASTERACCESS_TITLE_COLOR_ENABLED;
public static int MASTERACCESS_NAME_COLOR;
public static int MASTERACCESS_TITLE_COLOR;
public static boolean SHOW_GM_LOGIN; public static boolean SHOW_GM_LOGIN;
public static boolean GM_STARTUP_INVISIBLE; public static boolean GM_STARTUP_INVISIBLE;
public static boolean GM_SPECIAL_EFFECT; public static boolean GM_SPECIAL_EFFECT;
@@ -1172,12 +1166,6 @@ public class Config
is.close(); is.close();
EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(accessSettings.getProperty("EverybodyHasAdminRights", "false")); EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(accessSettings.getProperty("EverybodyHasAdminRights", "false"));
MASTERACCESS_LEVEL = Integer.parseInt(accessSettings.getProperty("MasterAccessLevel", "1"));
MASTERACCESS_NAME_COLOR_ENABLED = Boolean.parseBoolean(accessSettings.getProperty("MasterNameColorEnabled", "false"));
MASTERACCESS_TITLE_COLOR_ENABLED = Boolean.parseBoolean(accessSettings.getProperty("MasterTitleColorEnabled", "false"));
MASTERACCESS_NAME_COLOR = Integer.decode("0x" + accessSettings.getProperty("MasterNameColor", "00FF00"));
MASTERACCESS_TITLE_COLOR = Integer.decode("0x" + accessSettings.getProperty("MasterTitleColor", "00FF00"));
USERACCESS_LEVEL = Integer.parseInt(accessSettings.getProperty("UserAccessLevel", "0"));
GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(accessSettings.getProperty("GMStartupAutoList", "true")); GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(accessSettings.getProperty("GMStartupAutoList", "true"));
GM_ADMIN_MENU_STYLE = accessSettings.getProperty("GMAdminMenuStyle", "modern"); GM_ADMIN_MENU_STYLE = accessSettings.getProperty("GMAdminMenuStyle", "modern");
GM_HERO_AURA = Boolean.parseBoolean(accessSettings.getProperty("GMHeroAura", "false")); GM_HERO_AURA = Boolean.parseBoolean(accessSettings.getProperty("GMHeroAura", "false"));

View File

@@ -28,7 +28,6 @@ import java.util.logging.Logger;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.l2jmobius.Config;
import org.l2jmobius.commons.util.IXmlReader; import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.gameserver.model.AccessLevel; import org.l2jmobius.gameserver.model.AccessLevel;
import org.l2jmobius.gameserver.model.StatSet; import org.l2jmobius.gameserver.model.StatSet;
@@ -45,8 +44,6 @@ public class AdminData implements IXmlReader
{ {
private static final Logger LOGGER = Logger.getLogger(AdminData.class.getName()); 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<Integer, AccessLevel> _accessLevels = new HashMap<>();
private final Map<String, Integer> _adminCommandAccessRights = new HashMap<>(); private final Map<String, Integer> _adminCommandAccessRights = new HashMap<>();
private final Map<PlayerInstance, Boolean> _gmList = new ConcurrentHashMap<>(); private final Map<PlayerInstance, Boolean> _gmList = new ConcurrentHashMap<>();
@@ -60,12 +57,8 @@ public class AdminData implements IXmlReader
public void load() public void load()
{ {
_accessLevels.clear(); _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"); parseDatapackFile("config/AccessLevels.xml");
LOGGER.info(getClass().getSimpleName() + ": Loaded " + _accessLevels.size() + " access levels."); 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(); _adminCommandAccessRights.clear();
parseDatapackFile("config/AdminCommands.xml"); parseDatapackFile("config/AdminCommands.xml");
@@ -106,17 +99,7 @@ public class AdminData implements IXmlReader
accessLevel = set.getInt("level"); accessLevel = set.getInt("level");
name = set.getString("name"); name = set.getString("name");
if (accessLevel == Config.USERACCESS_LEVEL) if (accessLevel < 0)
{
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..."); LOGGER.info(getClass().getSimpleName() + ": Access level with name " + name + " is using banned access level state(below 0). Ignoring it...");
continue; continue;
@@ -196,7 +179,6 @@ public class AdminData implements IXmlReader
public AccessLevel getAccessLevel(int accessLevelNum) public AccessLevel getAccessLevel(int accessLevelNum)
{ {
AccessLevel accessLevel = null; AccessLevel accessLevel = null;
synchronized (_accessLevels) synchronized (_accessLevels)
{ {
accessLevel = _accessLevels.get(accessLevelNum); accessLevel = _accessLevels.get(accessLevelNum);
@@ -212,7 +194,6 @@ public class AdminData implements IXmlReader
{ {
return; 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)); _accessLevels.put(accessLevel, new AccessLevel(accessLevel, "Banned", Integer.decode("0x000000"), Integer.decode("0x000000"), false, false, false, false, false, false, false, false, false, false, false));
} }
} }
@@ -239,11 +220,6 @@ public class AdminData implements IXmlReader
return false; return false;
} }
if (accessLevel.getLevel() == Config.MASTERACCESS_LEVEL)
{
return true;
}
String command = adminCommand; String command = adminCommand;
if (adminCommand.indexOf(' ') != -1) if (adminCommand.indexOf(' ') != -1)
{ {
@@ -261,20 +237,13 @@ public class AdminData implements IXmlReader
LOGGER.warning("Admin Access Rights: No rights defined for admin command " + command + "."); LOGGER.warning("Admin Access Rights: No rights defined for admin command " + command + ".");
return false; return false;
} }
else if (acar >= accessLevel.getLevel())
{ return accessLevel.getLevel() >= acar;
return true;
}
else
{
return false;
}
} }
public List<PlayerInstance> getAllGms(boolean includeHidden) public List<PlayerInstance> getAllGms(boolean includeHidden)
{ {
final List<PlayerInstance> tmpGmList = new ArrayList<>(); final List<PlayerInstance> tmpGmList = new ArrayList<>();
for (Entry<PlayerInstance, Boolean> n : _gmList.entrySet()) for (Entry<PlayerInstance, Boolean> n : _gmList.entrySet())
{ {
if (includeHidden || !n.getValue()) if (includeHidden || !n.getValue())
@@ -288,7 +257,6 @@ public class AdminData implements IXmlReader
public List<String> getAllGmNames(boolean includeHidden) public List<String> getAllGmNames(boolean includeHidden)
{ {
final List<String> tmpGmList = new ArrayList<>(); final List<String> tmpGmList = new ArrayList<>();
for (Entry<PlayerInstance, Boolean> n : _gmList.entrySet()) for (Entry<PlayerInstance, Boolean> n : _gmList.entrySet())
{ {
if (!n.getValue()) if (!n.getValue())
@@ -387,10 +355,6 @@ public class AdminData implements IXmlReader
} }
} }
/**
* Gets the single instance of AdminTable.
* @return AccessLevels: the one and only instance of this class<br>
*/
public static AdminData getInstance() public static AdminData getInstance()
{ {
return SingletonHolder.INSTANCE; return SingletonHolder.INSTANCE;

View File

@@ -1587,7 +1587,6 @@ public abstract class Inventory extends ItemContainer
final int objectId = inv.getInt(1); final int objectId = inv.getInt(1);
item = ItemInstance.restoreFromDb(objectId); item = ItemInstance.restoreFromDb(objectId);
if (item == null) if (item == null)
{ {
continue; continue;

View File

@@ -689,7 +689,7 @@ public class PlayerInventory extends Inventory
} }
catch (Exception e) catch (Exception e)
{ {
LOGGER.warning("could not restore inventory: " + e); LOGGER.warning("Could not restore inventory: " + e);
} }
return paperdoll; return paperdoll;
} }

View File

@@ -8202,9 +8202,8 @@ public class PlayerInstance extends Playable
} }
/** /**
* Return true if the PlayerInstance is a GM.<BR> * Return true if the PlayerInstance is a GM.
* <BR> * @return true, if is GM
* @return true, if is gM
*/ */
public boolean isGM() public boolean isGM()
{ {
@@ -8212,37 +8211,7 @@ public class PlayerInstance extends Playable
} }
/** /**
* Return true if the PlayerInstance is a Administrator.<BR> * Manage the Leave Party task of the PlayerInstance.
* <BR>
* @return true, if is administrator
*/
public boolean isAdministrator()
{
return getAccessLevel().getLevel() == Config.MASTERACCESS_LEVEL;
}
/**
* Return true if the PlayerInstance is a User.<BR>
* <BR>
* @return true, if is user
*/
public boolean isUser()
{
return getAccessLevel().getLevel() == Config.USERACCESS_LEVEL;
}
/**
* Checks if is normal gm.
* @return true, if is normal gm
*/
public boolean isNormalGm()
{
return !isAdministrator() && !isUser();
}
/**
* Manage the Leave Party task of the PlayerInstance.<BR>
* <BR>
*/ */
public void leaveParty() public void leaveParty()
{ {
@@ -8254,8 +8223,7 @@ public class PlayerInstance extends Playable
} }
/** /**
* Return the _party object of the PlayerInstance.<BR> * Return the _party object of the PlayerInstance.
* <BR>
* @return the party * @return the party
*/ */
@Override @Override
@@ -8322,49 +8290,37 @@ public class PlayerInstance extends Playable
*/ */
public void setAccessLevel(int level) public void setAccessLevel(int level)
{ {
if (level == Config.MASTERACCESS_LEVEL) if (level > 0)
{ {
LOGGER.warning("Access level " + level + " set for character " + getName() + "! Just a warning ;)"); LOGGER.warning("Access level " + level + " set for character " + getName() + "! Just a warning ;)");
_accessLevel = AdminData.getInstance()._masterAccessLevel;
} }
else if (level == Config.USERACCESS_LEVEL)
final AccessLevel accessLevel = AdminData.getInstance().getAccessLevel(level);
if (accessLevel == null)
{ {
_accessLevel = AdminData.getInstance()._userAccessLevel; if (level < 0)
}
else
{
if (level > 0)
{ {
LOGGER.warning("Access level " + level + " set for character " + getName() + "! Just a warning ;)"); AdminData.getInstance().addBanAccessLevel(level);
} _accessLevel = AdminData.getInstance().getAccessLevel(level);
final AccessLevel accessLevel = AdminData.getInstance().getAccessLevel(level);
if (accessLevel == null)
{
if (level < 0)
{
AdminData.getInstance().addBanAccessLevel(level);
_accessLevel = AdminData.getInstance().getAccessLevel(level);
}
else
{
LOGGER.warning("Tried to set unregistered access level " + level + " to character " + getName() + ". Setting access level without privileges!");
_accessLevel = AdminData.getInstance()._userAccessLevel;
}
} }
else else
{ {
_accessLevel = accessLevel; LOGGER.warning("Tried to set unregistered access level " + level + " to character " + getName() + ". Setting access level without privileges!");
_accessLevel = AdminData.getInstance().getAccessLevel(0);
} }
} }
else
if (_accessLevel != AdminData.getInstance()._userAccessLevel)
{ {
if (getAccessLevel().useNameColor()) _accessLevel = accessLevel;
}
if (_accessLevel.isGm())
{
if (_accessLevel.useNameColor())
{ {
getAppearance().setNameColor(_accessLevel.getNameColor()); getAppearance().setNameColor(_accessLevel.getNameColor());
} }
if (getAccessLevel().useTitleColor()) if (_accessLevel.useTitleColor())
{ {
getAppearance().setTitleColor(_accessLevel.getTitleColor()); getAppearance().setTitleColor(_accessLevel.getTitleColor());
} }
@@ -8390,11 +8346,11 @@ public class PlayerInstance extends Playable
{ {
if (Config.EVERYBODY_HAS_ADMIN_RIGHTS) if (Config.EVERYBODY_HAS_ADMIN_RIGHTS)
{ {
return AdminData.getInstance()._masterAccessLevel; return AdminData.getInstance().getAccessLevel(100);
} }
else if (_accessLevel == null) else if (_accessLevel == null)
{ {
setAccessLevel(Config.USERACCESS_LEVEL); setAccessLevel(0);
} }
return _accessLevel; return _accessLevel;
} }
@@ -8575,8 +8531,7 @@ public class PlayerInstance extends Playable
} }
/** /**
* Create a new player in the characters table of the database.<BR> * Create a new player in the characters table of the database.
* <BR>
* @return true, if successful * @return true, if successful
*/ */
private boolean createDb() private boolean createDb()
@@ -8763,7 +8718,6 @@ public class PlayerInstance extends Playable
player.setDeleteTimer(rset.getLong("deletetime")); player.setDeleteTimer(rset.getLong("deletetime"));
player.setTitle(rset.getString("title")); player.setTitle(rset.getString("title"));
player.setAccessLevel(rset.getInt("accesslevel"));
player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId)); player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId));
player.setUptime(System.currentTimeMillis()); player.setUptime(System.currentTimeMillis());
@@ -8832,6 +8786,8 @@ public class PlayerInstance extends Playable
// leave them as default // leave them as default
} }
player.setAccessLevel(rset.getInt("accesslevel"));
CursedWeaponsManager.getInstance().checkPlayer(player); CursedWeaponsManager.getInstance().checkPlayer(player);
player.setAllianceWithVarkaKetra(rset.getInt("varka_ketra_ally")); player.setAllianceWithVarkaKetra(rset.getInt("varka_ketra_ally"));
@@ -11930,6 +11886,7 @@ public class PlayerInstance extends Playable
getAppearance().setNameColor(Config.L2JMOD_WEDDING_NAME_COLOR_NORMAL); getAppearance().setNameColor(Config.L2JMOD_WEDDING_NAME_COLOR_NORMAL);
} }
} }
/** Updates title and name color of a donator **/ /** Updates title and name color of a donator **/
if (Config.DONATOR_NAME_COLOR_ENABLED && isDonator()) if (Config.DONATOR_NAME_COLOR_ENABLED && isDonator())
{ {
@@ -11938,65 +11895,13 @@ public class PlayerInstance extends Playable
} }
} }
/**
* Update gm name title color.
*/
public void updateGmNameTitleColor()
{
// if this is a GM but has disabled his gM status, so we clear name / title
if (isGM() && !hasGmStatusActive())
{
getAppearance().setNameColor(0xFFFFFF);
getAppearance().setTitleColor(0xFFFF77);
}
// this is a GM but has GM status enabled, so we must set proper values
else if (isGM() && hasGmStatusActive())
{
// Nick Updates
if (getAccessLevel().useNameColor())
{
// this is a normal GM
if (isNormalGm())
{
getAppearance().setNameColor(getAccessLevel().getNameColor());
}
else if (isAdministrator())
{
getAppearance().setNameColor(Config.MASTERACCESS_NAME_COLOR);
}
}
else
{
getAppearance().setNameColor(0xFFFFFF);
}
// Title Updates
if (getAccessLevel().useTitleColor())
{
// this is a normal GM
if (isNormalGm())
{
getAppearance().setTitleColor(getAccessLevel().getTitleColor());
}
else if (isAdministrator())
{
getAppearance().setTitleColor(Config.MASTERACCESS_TITLE_COLOR);
}
}
else
{
getAppearance().setTitleColor(0xFFFF77);
}
}
}
/** /**
* Sets the olympiad side. * Sets the olympiad side.
* @param i the new olympiad side * @param value the new olympiad side
*/ */
public void setOlympiadSide(int i) public void setOlympiadSide(int value)
{ {
_olympiadSide = i; _olympiadSide = value;
} }
/** /**

View File

@@ -615,16 +615,6 @@ public class EnterWorld extends GameClientPacket
{ {
Announcements.getInstance().announceToAll("GM " + player.getName() + " has logged on."); Announcements.getInstance().announceToAll("GM " + player.getName() + " has logged on.");
} }
if (Config.MASTERACCESS_NAME_COLOR_ENABLED)
{
player.getAppearance().setNameColor(Config.MASTERACCESS_NAME_COLOR);
}
if (Config.MASTERACCESS_TITLE_COLOR_ENABLED)
{
player.getAppearance().setTitleColor(Config.MASTERACCESS_TITLE_COLOR);
}
} }
} }

View File

@@ -16,44 +16,36 @@
*/ */
package org.l2jmobius.gameserver.network.serverpackets; package org.l2jmobius.gameserver.network.serverpackets;
import org.l2jmobius.gameserver.datatables.xml.AdminData;
import org.l2jmobius.gameserver.instancemanager.CastleManager; import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.FortManager; import org.l2jmobius.gameserver.instancemanager.FortManager;
import org.l2jmobius.gameserver.model.AccessLevel;
import org.l2jmobius.gameserver.model.SiegeClan; import org.l2jmobius.gameserver.model.SiegeClan;
import org.l2jmobius.gameserver.model.actor.Attackable; import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.entity.event.CTF; import org.l2jmobius.gameserver.model.entity.event.CTF;
import org.l2jmobius.gameserver.model.entity.event.DM; import org.l2jmobius.gameserver.model.entity.event.DM;
import org.l2jmobius.gameserver.model.entity.event.TvT; import org.l2jmobius.gameserver.model.entity.event.TvT;
import org.l2jmobius.gameserver.model.entity.siege.Castle; import org.l2jmobius.gameserver.model.entity.siege.Castle;
import org.l2jmobius.gameserver.model.entity.siege.Fort; import org.l2jmobius.gameserver.model.entity.siege.Fort;
/**
* sample 0b 952a1048 objectId 00000000 00000000 00000000 00000000 00000000 00000000 format dddddd rev 377 format ddddddd rev 417
* @version $Revision: 1.3.3 $ $Date: 2009/04/29 00:46:18 $
*/
public class Die extends GameServerPacket public class Die extends GameServerPacket
{ {
private final int _objectId; private final int _objectId;
private final boolean _fake; private final boolean _fake;
private boolean _sweepable; private boolean _sweepable;
private boolean _canTeleport; private boolean _canTeleport;
private AccessLevel _access = AdminData.getInstance()._userAccessLevel; private boolean _allowFixedRes;
private org.l2jmobius.gameserver.model.clan.Clan _clan; private Clan _clan;
Creature _creature; Creature _creature;
/**
* @param creature
*/
public Die(Creature creature) public Die(Creature creature)
{ {
_creature = creature; _creature = creature;
if (creature instanceof PlayerInstance) if (creature instanceof PlayerInstance)
{ {
final PlayerInstance player = (PlayerInstance) creature; final PlayerInstance player = creature.getActingPlayer();
_access = player.getAccessLevel(); _allowFixedRes = player.getAccessLevel().allowFixedRes();
_clan = player.getClan(); _clan = player.getClan();
_canTeleport = ((!TvT.isStarted() || !player._inEventTvT) && (!DM.hasStarted() || !player._inEventDM) && (!CTF.isStarted() || !player._inEventCTF) && !player.isInFunEvent() && !player.isPendingRevive()); _canTeleport = ((!TvT.isStarted() || !player._inEventTvT) && (!DM.hasStarted() || !player._inEventDM) && (!CTF.isStarted() || !player._inEventCTF) && !player.isInFunEvent() && !player.isPendingRevive());
} }
@@ -74,8 +66,8 @@ public class Die extends GameServerPacket
} }
writeC(0x06); writeC(0x06);
writeD(_objectId); writeD(_objectId);
// NOTE: // NOTE:
// 6d 00 00 00 00 - to nearest village // 6d 00 00 00 00 - to nearest village
// 6d 01 00 00 00 - to hide away // 6d 01 00 00 00 - to hide away
@@ -124,6 +116,6 @@ public class Die extends GameServerPacket
} }
writeD(_sweepable ? 0x01 : 0x00); // sweepable (blue glow) writeD(_sweepable ? 0x01 : 0x00); // sweepable (blue glow)
writeD(_access.allowFixedRes() ? 0x01 : 0x00); // 6d 04 00 00 00 - to FIXED writeD(_allowFixedRes ? 0x01 : 0x00); // 6d 04 00 00 00 - to FIXED
} }
} }