Sync with L2jServer HighFive Jul 25th 2015.
This commit is contained in:
@ -31,7 +31,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.commons.database.pool.impl.ConnectionFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.instancemanager.tasks.MessageDeletionTask;
|
||||
@ -58,7 +58,7 @@ public final class MailManager
|
||||
private void load()
|
||||
{
|
||||
int count = 0;
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
Statement ps = con.createStatement();
|
||||
ResultSet rs = ps.executeQuery("SELECT * FROM messages ORDER BY expiration"))
|
||||
{
|
||||
@ -174,7 +174,7 @@ public final class MailManager
|
||||
public void sendMessage(Message msg)
|
||||
{
|
||||
_messages.put(msg.getId(), msg);
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = Message.getStatement(msg, con))
|
||||
{
|
||||
ps.execute();
|
||||
@ -196,7 +196,7 @@ public final class MailManager
|
||||
|
||||
public final void markAsReadInDb(int msgId)
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE messages SET isUnread = 'false' WHERE messageId = ?"))
|
||||
{
|
||||
ps.setInt(1, msgId);
|
||||
@ -210,7 +210,7 @@ public final class MailManager
|
||||
|
||||
public final void markAsDeletedBySenderInDb(int msgId)
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE messages SET isDeletedBySender = 'true' WHERE messageId = ?"))
|
||||
{
|
||||
ps.setInt(1, msgId);
|
||||
@ -224,7 +224,7 @@ public final class MailManager
|
||||
|
||||
public final void markAsDeletedByReceiverInDb(int msgId)
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE messages SET isDeletedByReceiver = 'true' WHERE messageId = ?"))
|
||||
{
|
||||
ps.setInt(1, msgId);
|
||||
@ -238,7 +238,7 @@ public final class MailManager
|
||||
|
||||
public final void removeAttachmentsInDb(int msgId)
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE messages SET hasAttachments = 'false' WHERE messageId = ?"))
|
||||
{
|
||||
ps.setInt(1, msgId);
|
||||
@ -252,7 +252,7 @@ public final class MailManager
|
||||
|
||||
public final void deleteMessageInDb(int msgId)
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM messages WHERE messageId = ?"))
|
||||
{
|
||||
ps.setInt(1, msgId);
|
||||
|
Reference in New Issue
Block a user