Configuration adjustments to match other branches.

This commit is contained in:
MobiusDevelopment
2019-07-31 10:03:25 +00:00
parent 1bfea0f2ae
commit c704d4687a
22 changed files with 1707 additions and 1882 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -23,8 +23,6 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Logger;
import org.l2jmobius.Config;
public class OlympiadLogger
{
private static final Logger LOGGER = Logger.getLogger(OlympiadLogger.class.getName());
@@ -69,15 +67,4 @@ public class OlympiadLogger
add(text, null);
}
}
public static final void Assert(boolean exp, String cmt)
{
if (exp || !Config.ASSERT)
{
return;
}
LOGGER.info("Assertion error [" + cmt + "]");
Thread.dumpStack();
}
}

View File

@@ -20,7 +20,6 @@ import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
/**
@@ -213,10 +212,6 @@ public final class L2ObjectHashMap<T extends WorldObject>extends L2ObjectMap<T>
expand();
}
final int hashcode = obj.getObjectId();
if (Config.ASSERT)
{
assert hashcode > 0;
}
int seed = hashcode;
final int incr = 1 + (((seed >> 5) + 1) % (_table.length - 1));
int ntry = 0;
@@ -255,11 +250,6 @@ public final class L2ObjectHashMap<T extends WorldObject>extends L2ObjectMap<T>
{
return;
}
// this should never happen
if (Config.ASSERT)
{
assert obj.getObjectId() != _table[pos].getObjectId();
}
// if there was no collisions at this slot, and we found a free
// slot previously - use found slot
if ((slot >= 0) && (_keys[pos] > 0))
@@ -300,10 +290,6 @@ public final class L2ObjectHashMap<T extends WorldObject>extends L2ObjectMap<T>
public synchronized void remove(T obj)
{
final int hashcode = obj.getObjectId();
if (Config.ASSERT)
{
assert hashcode > 0;
}
int seed = hashcode;
final int incr = 1 + (((seed >> 5) + 1) % (_table.length - 1));
int ntry = 0;
@@ -418,10 +404,6 @@ public final class L2ObjectHashMap<T extends WorldObject>extends L2ObjectMap<T>
continue;
}
final int hashcode = _keys[i] & 0x7FFFFFFF;
if (Config.ASSERT)
{
assert hashcode == obj.getObjectId();
}
int seed = hashcode;
final int incr = 1 + (((seed >> 5) + 1) % (newSize - 1));
int ntry = 0;
@@ -430,10 +412,6 @@ public final class L2ObjectHashMap<T extends WorldObject>extends L2ObjectMap<T>
final int pos = (seed % newSize) & 0x7FFFFFFF;
if (newTable[pos] == null)
{
if (Config.ASSERT)
{
assert (newKeys[pos] == 0) && (hashcode != 0);
}
// found an empty slot without previous collisions,
// but use previously found slot
newKeys[pos] = hashcode;

View File

@@ -20,7 +20,6 @@ import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.WorldObject;
/**
@@ -174,10 +173,6 @@ public final class L2ObjectHashSet<T extends WorldObject>extends L2ObjectSet<T>
expand();
}
final int hashcode = obj.getObjectId();
if (Config.ASSERT)
{
assert hashcode > 0;
}
int seed = hashcode;
final int incr = 1 + (((seed >> 5) + 1) % (_table.length - 1));
int ntry = 0;
@@ -211,11 +206,6 @@ public final class L2ObjectHashSet<T extends WorldObject>extends L2ObjectSet<T>
{
return;
}
// this should never happen
if (Config.ASSERT)
{
assert obj.getObjectId() != _table[pos].getObjectId();
}
// if there was no collisions at this slot, and we found a free
// slot previously - use found slot
if ((slot >= 0) && ((_collisions[pos >> 5] & (1 << (pos & 31))) == 0))
@@ -252,10 +242,6 @@ public final class L2ObjectHashSet<T extends WorldObject>extends L2ObjectSet<T>
return;
}
final int hashcode = obj.getObjectId();
if (Config.ASSERT)
{
assert hashcode > 0;
}
int seed = hashcode;
final int incr = 1 + (((seed >> 5) + 1) % (_table.length - 1));
int ntry = 0;
@@ -307,10 +293,6 @@ public final class L2ObjectHashSet<T extends WorldObject>extends L2ObjectSet<T>
return false;
}
final int hashcode = obj.getObjectId();
if (Config.ASSERT)
{
assert hashcode > 0;
}
int seed = hashcode;
final int incr = 1 + (((seed >> 5) + 1) % (size - 1));
int ntry = 0;

View File

@@ -22,7 +22,6 @@ import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.gameserver.datatables.SkillTable;
import org.l2jmobius.gameserver.datatables.sql.ArmorSetsTable;
@@ -196,11 +195,6 @@ public abstract class Inventory extends ItemContainer
return;
}
if (Config.ASSERT)
{
assert null == getPaperdollItem(PAPERDOLL_LRHAND);
}
if (item.getItemType() == WeaponType.BOW)
{
ItemInstance arrow = getPaperdollItem(PAPERDOLL_LHAND);
@@ -234,11 +228,6 @@ public abstract class Inventory extends ItemContainer
return;
}
if (Config.ASSERT)
{
assert item == getPaperdollItem(PAPERDOLL_LRHAND);
}
if (item.getItemType() == WeaponType.BOW)
{
ItemInstance arrow = findArrowForBow(item.getItem());
@@ -889,11 +878,6 @@ public abstract class Inventory extends ItemContainer
*/
public synchronized void addPaperdollListener(PaperdollListener listener)
{
if (Config.ASSERT)
{
assert !_paperdollListeners.contains(listener);
}
_paperdollListeners.add(listener);
}

View File

@@ -18,7 +18,6 @@ package org.l2jmobius.gameserver.model;
import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -58,11 +57,6 @@ public class ObjectPosition
*/
public final void setXYZ(int x, int y, int z)
{
if (Config.ASSERT)
{
assert getWorldRegion() != null;
}
setWorldPosition(x, y, z);
try
@@ -110,10 +104,6 @@ public class ObjectPosition
*/
public final void setXYZInvisible(int x, int y, int z)
{
if (Config.ASSERT)
{
assert getWorldRegion() == null;
}
if (x > World.MAP_MAX_X)
{
x = World.MAP_MAX_X - 5000;

View File

@@ -109,31 +109,16 @@ public abstract class WorldObject
public final int getX()
{
if (Config.ASSERT)
{
assert (getPosition().getWorldRegion() != null) || _isVisible;
}
return getPosition().getX();
}
public final int getY()
{
if (Config.ASSERT)
{
assert (getPosition().getWorldRegion() != null) || _isVisible;
}
return getPosition().getY();
}
public final int getZ()
{
if (Config.ASSERT)
{
assert (getPosition().getWorldRegion() != null) || _isVisible;
}
return getPosition().getZ();
}
@@ -158,11 +143,6 @@ public abstract class WorldObject
*/
public final void decayMe()
{
if (Config.ASSERT)
{
assert getPosition().getWorldRegion() != null;
}
// Remove the WorldObject from the world
_isVisible = false;
World.getInstance().removeVisibleObject(this, getPosition().getWorldRegion());
@@ -198,16 +178,6 @@ public abstract class WorldObject
*/
public final void pickupMe(Creature creature) // NOTE: Should move this function into ItemInstance because it does not apply to Creature
{
if (Config.ASSERT)
{
assert this instanceof ItemInstance;
}
if (Config.ASSERT)
{
assert getPosition().getWorldRegion() != null;
}
WorldRegion oldregion = getPosition().getWorldRegion();
// Create a server->client GetItem packet to pick up the ItemInstance
@@ -264,11 +234,6 @@ public abstract class WorldObject
*/
public final void spawnMe()
{
if (Config.ASSERT)
{
assert (getPosition().getWorldRegion() == null) && (getPosition().getWorldPosition().getX() != 0) && (getPosition().getWorldPosition().getY() != 0) && (getPosition().getWorldPosition().getZ() != 0);
}
synchronized (this)
{
// Set the x,y,z position of the WorldObject spawn and update its _worldregion
@@ -291,11 +256,6 @@ public abstract class WorldObject
public final void spawnMe(int x, int y, int z)
{
if (Config.ASSERT)
{
assert getPosition().getWorldRegion() == null;
}
synchronized (this)
{
// Set the x,y,z position of the WorldObject spawn and update its _worldregion

View File

@@ -339,11 +339,6 @@ public final class WorldRegion
*/
public void addVisibleObject(WorldObject object)
{
if (Config.ASSERT)
{
assert object.getWorldRegion() == this;
}
if (object == null)
{
return;
@@ -372,11 +367,6 @@ public final class WorldRegion
*/
public void removeVisibleObject(WorldObject object)
{
if (Config.ASSERT)
{
assert (object.getWorldRegion() == this) || (object.getWorldRegion() == null);
}
if (object == null)
{
return;

View File

@@ -353,11 +353,6 @@ public final class ItemInstance extends WorldObject
*/
public int getEquipSlot()
{
if (Config.ASSERT)
{
assert (_loc == ItemLocation.PAPERDOLL) || (_loc == ItemLocation.PET_EQUIP) || (_loc == ItemLocation.FREIGHT);
}
return _locData;
}
@@ -1162,11 +1157,6 @@ public final class ItemInstance extends WorldObject
*/
public final void dropMe(Creature dropper, int x, int y, int z)
{
if (Config.ASSERT)
{
assert getPosition().getWorldRegion() == null;
}
if (Config.PATHFINDING && (dropper != null))
{
Location dropDest = GeoEngine.getInstance().canMoveToTargetLoc(dropper.getX(), dropper.getY(), dropper.getZ(), x, y, z, dropper.getInstanceId());
@@ -1207,11 +1197,6 @@ public final class ItemInstance extends WorldObject
*/
private void updateInDb()
{
if (Config.ASSERT)
{
assert _existsInDb;
}
if (_wear)
{
return;
@@ -1257,11 +1242,6 @@ public final class ItemInstance extends WorldObject
return;
}
if (Config.ASSERT)
{
assert !_existsInDb && (getObjectId() != 0);
}
try (Connection con = DatabaseFactory.getConnection())
{
PreparedStatement statement = con.prepareStatement("INSERT INTO items (owner_id,item_id,count,loc,loc_data,enchant_level,price_sell,price_buy,object_id,custom_type1,custom_type2,mana_left) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)");
@@ -1299,11 +1279,6 @@ public final class ItemInstance extends WorldObject
return;
}
if (Config.ASSERT)
{
assert _existsInDb;
}
// delete augmentation data
if (isAugmented())
{
@@ -1470,11 +1445,6 @@ public final class ItemInstance extends WorldObject
*/
public int getLocationSlot()
{
if (Config.ASSERT)
{
assert (_loc == ItemLocation.PAPERDOLL) || (_loc == ItemLocation.PET_EQUIP) || (_loc == ItemLocation.FREIGHT) || (_loc == ItemLocation.INVENTORY);
}
return _locData;
}

View File

@@ -550,13 +550,6 @@ public class EnterWorld extends GameClientPacket
player.removeSkill(3628, true);
}
// If it's a Beta server all players got GM SPEED skill for better testing
if (Config.BETASERVER)
{
player.addSkill(SkillTable.getInstance().getInfo(7029, 4), true);
player.sendMessage("Server is on Beta mode. Skill Gm Haste 4 added for better testing.");
}
// Send all skills to char
player.sendSkillList();

View File

@@ -36,7 +36,11 @@ public final class ProtocolVersion extends GameClientPacket
@Override
protected void runImpl()
{
if ((_version < Config.MIN_PROTOCOL_REVISION) || (_version > Config.MAX_PROTOCOL_REVISION))
if ((_version == 65534) || (_version == -2)) // Ping
{
getClient().close((GameServerPacket) null);
}
else if ((_version < Config.MIN_PROTOCOL_REVISION) || (_version > Config.MAX_PROTOCOL_REVISION))
{
LOGGER.info("Client: " + getClient() + " -> Protocol Revision: " + _version + " is invalid. Minimum is " + Config.MIN_PROTOCOL_REVISION + " and Maximum is " + Config.MAX_PROTOCOL_REVISION + " are supported. Closing connection.");
LOGGER.warning("Wrong Protocol Version " + _version);