Replaced concatenations with infix operations.
This commit is contained in:
parent
eb3742d44f
commit
bb7e3b8e1b
@ -175,7 +175,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
|
||||
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000));
|
||||
String zoneName = zone.getName().toLowerCase().replace(" ", "_");
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName)));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic")), null));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null));
|
||||
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
|
||||
currentInfo.setZoneStage(7);
|
||||
ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min
|
||||
@ -198,7 +198,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
String zoneName = zone.getName().toLowerCase().replace(" ", "_");
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic"))));
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic")));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null));
|
||||
return;
|
||||
}
|
||||
|
@ -155,17 +155,17 @@ public class SQLAccountManager
|
||||
String q = "SELECT login, accessLevel FROM accounts ";
|
||||
if (m.equals("1"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel < 0");
|
||||
q += "WHERE accessLevel < 0";
|
||||
}
|
||||
else if (m.equals("2"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel > 0");
|
||||
q += "WHERE accessLevel > 0";
|
||||
}
|
||||
else if (m.equals("3"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel = 0");
|
||||
q += "WHERE accessLevel = 0";
|
||||
}
|
||||
q = q.concat(" ORDER BY login ASC");
|
||||
q += " ORDER BY login ASC";
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(q);
|
||||
|
@ -175,7 +175,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
|
||||
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000));
|
||||
String zoneName = zone.getName().toLowerCase().replace(" ", "_");
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName)));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic")), null));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null));
|
||||
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
|
||||
currentInfo.setZoneStage(7);
|
||||
ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min
|
||||
@ -198,7 +198,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
String zoneName = zone.getName().toLowerCase().replace(" ", "_");
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic"))));
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic")));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null));
|
||||
return;
|
||||
}
|
||||
|
@ -155,17 +155,17 @@ public class SQLAccountManager
|
||||
String q = "SELECT login, accessLevel FROM accounts ";
|
||||
if (m.equals("1"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel < 0");
|
||||
q += "WHERE accessLevel < 0";
|
||||
}
|
||||
else if (m.equals("2"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel > 0");
|
||||
q += "WHERE accessLevel > 0";
|
||||
}
|
||||
else if (m.equals("3"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel = 0");
|
||||
q += "WHERE accessLevel = 0";
|
||||
}
|
||||
q = q.concat(" ORDER BY login ASC");
|
||||
q += " ORDER BY login ASC";
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(q);
|
||||
|
@ -175,7 +175,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
|
||||
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000));
|
||||
String zoneName = zone.getName().toLowerCase().replace(" ", "_");
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName)));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic")), null));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null));
|
||||
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
|
||||
currentInfo.setZoneStage(7);
|
||||
ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min
|
||||
@ -198,7 +198,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
String zoneName = zone.getName().toLowerCase().replace(" ", "_");
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic"))));
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic")));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null));
|
||||
return;
|
||||
}
|
||||
|
@ -155,17 +155,17 @@ public class SQLAccountManager
|
||||
String q = "SELECT login, accessLevel FROM accounts ";
|
||||
if (m.equals("1"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel < 0");
|
||||
q += "WHERE accessLevel < 0";
|
||||
}
|
||||
else if (m.equals("2"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel > 0");
|
||||
q += "WHERE accessLevel > 0";
|
||||
}
|
||||
else if (m.equals("3"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel = 0");
|
||||
q += "WHERE accessLevel = 0";
|
||||
}
|
||||
q = q.concat(" ORDER BY login ASC");
|
||||
q += " ORDER BY login ASC";
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(q);
|
||||
|
@ -175,7 +175,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
|
||||
zone.broadcastPacket(new ExShowScreenMessage(NpcStringId.DEMONIC_SYSTEM_WILL_ACTIVATE, ExShowScreenMessage.TOP_CENTER, 3000));
|
||||
String zoneName = zone.getName().toLowerCase().replace(" ", "_");
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName)));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic")), null));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic"), null));
|
||||
zone.getPlayersInside().forEach(temp -> temp.sendPacket(new ExSendUIEvent(temp, false, false, 600, 0, NpcStringId.DEMONIC_SYSTEM_ACTIVATED)));
|
||||
currentInfo.setZoneStage(7);
|
||||
ThreadPool.schedule(new changeZoneStage(zone), 600000); // 10min
|
||||
@ -198,7 +198,7 @@ public class HarnakUndergroundRuinsZone extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
String zoneName = zone.getName().toLowerCase().replace(" ", "_");
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName.concat("_demonic"))));
|
||||
_templates.stream().forEach(t -> t.despawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName + "_demonic")));
|
||||
_templates.stream().forEach(t -> t.spawn(g -> String.valueOf(g.getName()).equalsIgnoreCase(zoneName), null));
|
||||
return;
|
||||
}
|
||||
|
@ -155,17 +155,17 @@ public class SQLAccountManager
|
||||
String q = "SELECT login, accessLevel FROM accounts ";
|
||||
if (m.equals("1"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel < 0");
|
||||
q += "WHERE accessLevel < 0";
|
||||
}
|
||||
else if (m.equals("2"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel > 0");
|
||||
q += "WHERE accessLevel > 0";
|
||||
}
|
||||
else if (m.equals("3"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel = 0");
|
||||
q += "WHERE accessLevel = 0";
|
||||
}
|
||||
q = q.concat(" ORDER BY login ASC");
|
||||
q += " ORDER BY login ASC";
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(q);
|
||||
|
@ -167,17 +167,17 @@ public class SQLAccountManager
|
||||
String q = "SELECT login, accessLevel FROM accounts ";
|
||||
if (m.equals("1"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel < 0");
|
||||
q += "WHERE accessLevel < 0";
|
||||
}
|
||||
else if (m.equals("2"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel > 0");
|
||||
q += "WHERE accessLevel > 0";
|
||||
}
|
||||
else if (m.equals("3"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel = 0");
|
||||
q += "WHERE accessLevel = 0";
|
||||
}
|
||||
q = q.concat(" ORDER BY login ASC");
|
||||
q += " ORDER BY login ASC";
|
||||
|
||||
PreparedStatement statement = con.prepareStatement(q);
|
||||
ResultSet rset = statement.executeQuery();
|
||||
|
@ -155,17 +155,17 @@ public class SQLAccountManager
|
||||
String q = "SELECT login, accessLevel FROM accounts ";
|
||||
if (m.equals("1"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel < 0");
|
||||
q += "WHERE accessLevel < 0";
|
||||
}
|
||||
else if (m.equals("2"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel > 0");
|
||||
q += "WHERE accessLevel > 0";
|
||||
}
|
||||
else if (m.equals("3"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel = 0");
|
||||
q += "WHERE accessLevel = 0";
|
||||
}
|
||||
q = q.concat(" ORDER BY login ASC");
|
||||
q += " ORDER BY login ASC";
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(q);
|
||||
|
@ -155,17 +155,17 @@ public class SQLAccountManager
|
||||
String q = "SELECT login, accessLevel FROM accounts ";
|
||||
if (m.equals("1"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel < 0");
|
||||
q += "WHERE accessLevel < 0";
|
||||
}
|
||||
else if (m.equals("2"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel > 0");
|
||||
q += "WHERE accessLevel > 0";
|
||||
}
|
||||
else if (m.equals("3"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel = 0");
|
||||
q += "WHERE accessLevel = 0";
|
||||
}
|
||||
q = q.concat(" ORDER BY login ASC");
|
||||
q += " ORDER BY login ASC";
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(q);
|
||||
|
@ -155,17 +155,17 @@ public class SQLAccountManager
|
||||
String q = "SELECT login, accessLevel FROM accounts ";
|
||||
if (m.equals("1"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel < 0");
|
||||
q += "WHERE accessLevel < 0";
|
||||
}
|
||||
else if (m.equals("2"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel > 0");
|
||||
q += "WHERE accessLevel > 0";
|
||||
}
|
||||
else if (m.equals("3"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel = 0");
|
||||
q += "WHERE accessLevel = 0";
|
||||
}
|
||||
q = q.concat(" ORDER BY login ASC");
|
||||
q += " ORDER BY login ASC";
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(q);
|
||||
|
@ -155,17 +155,17 @@ public class SQLAccountManager
|
||||
String q = "SELECT login, accessLevel FROM accounts ";
|
||||
if (m.equals("1"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel < 0");
|
||||
q += "WHERE accessLevel < 0";
|
||||
}
|
||||
else if (m.equals("2"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel > 0");
|
||||
q += "WHERE accessLevel > 0";
|
||||
}
|
||||
else if (m.equals("3"))
|
||||
{
|
||||
q = q.concat("WHERE accessLevel = 0");
|
||||
q += "WHERE accessLevel = 0";
|
||||
}
|
||||
q = q.concat(" ORDER BY login ASC");
|
||||
q += " ORDER BY login ASC";
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(q);
|
||||
|
Loading…
Reference in New Issue
Block a user