Sync with L2jServer HighFive Jul 25th 2015.

This commit is contained in:
MobiusDev
2015-07-26 10:59:25 +00:00
parent 83854bc5e5
commit 1fc14085f5
161 changed files with 2288 additions and 2181 deletions

View File

@@ -36,7 +36,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jserver.Config;
import com.l2jserver.L2DatabaseFactory;
import com.l2jserver.commons.database.pool.impl.ConnectionFactory;
import com.l2jserver.gameserver.communitybbs.BB.Forum;
import com.l2jserver.gameserver.communitybbs.Manager.ForumsBBSManager;
import com.l2jserver.gameserver.data.sql.impl.CharNameTable;
@@ -248,7 +248,7 @@ public class L2Clan implements IIdentifiable, INamable
}
else
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE characters SET clan_privs = ? WHERE charId = ?"))
{
ps.setInt(1, 0);
@@ -288,7 +288,7 @@ public class L2Clan implements IIdentifiable, INamable
}
else
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE characters SET clan_privs = ? WHERE charId = ?"))
{
ps.setInt(1, EnumIntBitmask.getAllBitmask(ClanPrivilege.class));
@@ -842,7 +842,7 @@ public class L2Clan implements IIdentifiable, INamable
*/
public void updateBloodAllianceCountInDB()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET blood_alliance_count=? WHERE clan_id=?"))
{
ps.setInt(1, getBloodAllianceCount());
@@ -886,7 +886,7 @@ public class L2Clan implements IIdentifiable, INamable
*/
public void updateBloodOathCountInDB()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET blood_oath_count=? WHERE clan_id=?"))
{
ps.setInt(1, getBloodOathCount());
@@ -904,7 +904,7 @@ public class L2Clan implements IIdentifiable, INamable
*/
public void updateClanScoreInDB()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET reputation_score=? WHERE clan_id=?"))
{
ps.setInt(1, getReputationScore());
@@ -933,7 +933,7 @@ public class L2Clan implements IIdentifiable, INamable
*/
public void updateClanInDB()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET leader_id=?,ally_id=?,ally_name=?,reputation_score=?,ally_penalty_expiry_time=?,ally_penalty_type=?,char_penalty_expiry_time=?,dissolving_expiry_time=?,new_leader_id=? WHERE clan_id=?"))
{
ps.setInt(1, getLeaderId());
@@ -975,7 +975,7 @@ public class L2Clan implements IIdentifiable, INamable
*/
public void store()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement(INSERT_CLAN_DATA))
{
ps.setInt(1, getId());
@@ -1011,7 +1011,7 @@ public class L2Clan implements IIdentifiable, INamable
*/
private void removeMemberInDatabase(int playerId, long clanJoinExpiryTime, long clanCreateExpiryTime)
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps1 = con.prepareStatement("UPDATE characters SET clanid=0, title=?, clan_join_expiry_time=?, clan_create_expiry_time=?, clan_privs=0, wantspeace=0, subpledge=0, lvl_joined_academy=0, apprentice=0, sponsor=0 WHERE charId=?");
PreparedStatement ps2 = con.prepareStatement("UPDATE characters SET apprentice=0 WHERE apprentice=?");
PreparedStatement ps3 = con.prepareStatement("UPDATE characters SET sponsor=0 WHERE sponsor=?"))
@@ -1037,7 +1037,7 @@ public class L2Clan implements IIdentifiable, INamable
private void restore()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement(SELECT_CLAN_DATA))
{
ps.setInt(1, getId());
@@ -1117,7 +1117,7 @@ public class L2Clan implements IIdentifiable, INamable
private void restoreNotice()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("SELECT enabled,notice FROM clan_notices WHERE clan_id=?"))
{
ps.setInt(1, getId());
@@ -1148,7 +1148,7 @@ public class L2Clan implements IIdentifiable, INamable
notice = notice.substring(0, MAX_NOTICE_LENGTH - 1);
}
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_notices (clan_id,notice,enabled) values (?,?,?) ON DUPLICATE KEY UPDATE notice=?,enabled=?"))
{
ps.setInt(1, getId());
@@ -1207,7 +1207,7 @@ public class L2Clan implements IIdentifiable, INamable
private void restoreSkills()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("SELECT skill_id,skill_level,sub_pledge_id FROM clan_skills WHERE clan_id=?"))
{
// Retrieve all skills of this L2PcInstance from the database
@@ -1331,7 +1331,7 @@ public class L2Clan implements IIdentifiable, INamable
}
}
try (Connection con = L2DatabaseFactory.getInstance().getConnection())
try (Connection con = ConnectionFactory.getInstance().getConnection())
{
if (oldSkill != null)
{
@@ -1775,7 +1775,7 @@ public class L2Clan implements IIdentifiable, INamable
private void restoreSubPledges()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("SELECT sub_pledge_id,name,leader_id FROM clan_subpledges WHERE clan_id=?"))
{
// Retrieve all subpledges of this clan from the database
@@ -1875,7 +1875,7 @@ public class L2Clan implements IIdentifiable, INamable
return null;
}
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_subpledges (clan_id,sub_pledge_id,name,leader_id) values (?,?,?,?)"))
{
ps.setInt(1, getId());
@@ -1949,7 +1949,7 @@ public class L2Clan implements IIdentifiable, INamable
public void updateSubPledgeInDB(int pledgeType)
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE clan_subpledges SET leader_id=?, name=? WHERE clan_id=? AND sub_pledge_id=?"))
{
ps.setInt(1, getSubPledge(pledgeType).getLeaderId());
@@ -1970,20 +1970,20 @@ public class L2Clan implements IIdentifiable, INamable
private void restoreRankPrivs()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("SELECT privs,rank,party FROM clan_privs WHERE clan_id=?"))
{
// Retrieve all skills of this L2PcInstance from the database
ps.setInt(1, getId());
// _log.warning("clanPrivs restore for ClanId : "+getClanId());
try (ResultSet rset = ps.executeQuery())
try (ResultSet rs = ps.executeQuery())
{
// Go though the recordset of this SQL query
while (rset.next())
while (rs.next())
{
int rank = rset.getInt("rank");
int rank = rs.getInt("rank");
// int party = rset.getInt("party");
int privileges = rset.getInt("privs");
int privileges = rs.getInt("privs");
// Create a SubPledge object for each record
if (rank == -1)
{
@@ -2023,7 +2023,7 @@ public class L2Clan implements IIdentifiable, INamable
{
_privs.get(rank).setPrivs(privs);
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?"))
{
// Retrieve all skills of this L2PcInstance from the database
@@ -2059,7 +2059,7 @@ public class L2Clan implements IIdentifiable, INamable
{
_privs.put(rank, new RankPrivs(rank, 0, privs));
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
{
// Retrieve all skills of this L2PcInstance from the database
@@ -2183,7 +2183,7 @@ public class L2Clan implements IIdentifiable, INamable
if (storeInDb)
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET auction_bid_at=? WHERE clan_id=?"))
{
ps.setInt(1, id);
@@ -2731,7 +2731,7 @@ public class L2Clan implements IIdentifiable, INamable
public void changeLevel(int level)
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET clan_level = ? WHERE clan_id = ?"))
{
ps.setInt(1, level);
@@ -2777,7 +2777,7 @@ public class L2Clan implements IIdentifiable, INamable
setCrestId(crestId);
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET crest_id = ? WHERE clan_id = ?"))
{
ps.setInt(1, crestId);
@@ -2814,7 +2814,7 @@ public class L2Clan implements IIdentifiable, INamable
allyId = getAllyId();
}
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement(sqlStatement))
{
ps.setInt(1, crestId);
@@ -2860,7 +2860,7 @@ public class L2Clan implements IIdentifiable, INamable
setCrestLargeId(crestId);
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
try (Connection con = ConnectionFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET crest_large_id = ? WHERE clan_id = ?"))
{
ps.setInt(1, crestId);