Sync with L2jServer HighFive Jul 25th 2015.
This commit is contained in:
@@ -28,7 +28,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.communitybbs.Manager.ForumsBBSManager;
|
||||
import com.l2jserver.gameserver.communitybbs.Manager.TopicBBSManager;
|
||||
|
||||
@@ -93,7 +93,7 @@ public class Forum
|
||||
|
||||
private void load()
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM forums WHERE forum_id=?"))
|
||||
{
|
||||
ps.setInt(1, _forumId);
|
||||
@@ -114,7 +114,7 @@ public class Forum
|
||||
_log.log(Level.WARNING, "Data error on Forum " + _forumId + " : " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM topic WHERE topic_forum_id=? ORDER BY topic_id DESC"))
|
||||
{
|
||||
ps.setInt(1, _forumId);
|
||||
@@ -139,7 +139,7 @@ public class Forum
|
||||
|
||||
private void getChildren()
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT forum_id FROM forums WHERE forum_parent=?"))
|
||||
{
|
||||
ps.setInt(1, _forumId);
|
||||
@@ -218,7 +218,7 @@ public class Forum
|
||||
|
||||
public void insertIntoDb()
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO forums (forum_id,forum_name,forum_parent,forum_post,forum_type,forum_perm,forum_owner_id) VALUES (?,?,?,?,?,?,?)"))
|
||||
{
|
||||
ps.setInt(1, _forumId);
|
||||
|
@@ -26,7 +26,7 @@ import java.util.List;
|
||||
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.communitybbs.Manager.PostBBSManager;
|
||||
|
||||
/**
|
||||
@@ -79,7 +79,7 @@ public class Post
|
||||
|
||||
public void insertindb(CPost cp)
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO posts (post_id,post_owner_name,post_ownerid,post_date,post_topic_id,post_forum_id,post_txt) values (?,?,?,?,?,?,?)"))
|
||||
{
|
||||
ps.setInt(1, cp.postId);
|
||||
@@ -105,7 +105,7 @@ public class Post
|
||||
public void deleteme(Topic t)
|
||||
{
|
||||
PostBBSManager.getInstance().delPostByTopic(t);
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM posts WHERE post_forum_id=? AND post_topic_id=?"))
|
||||
{
|
||||
ps.setInt(1, t.getForumID());
|
||||
@@ -123,7 +123,7 @@ public class Post
|
||||
*/
|
||||
private void load(Topic t)
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM posts WHERE post_forum_id=? AND post_topic_id=? ORDER BY post_id ASC"))
|
||||
{
|
||||
ps.setInt(1, t.getForumID());
|
||||
@@ -155,7 +155,7 @@ public class Post
|
||||
*/
|
||||
public void updatetxt(int i)
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE posts SET post_txt=? WHERE post_id=? AND post_topic_id=? AND post_forum_id=?"))
|
||||
{
|
||||
CPost cp = getCPost(i);
|
||||
|
@@ -23,7 +23,7 @@ import java.sql.PreparedStatement;
|
||||
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.communitybbs.Manager.TopicBBSManager;
|
||||
|
||||
public class Topic
|
||||
@@ -74,7 +74,7 @@ public class Topic
|
||||
|
||||
public void insertindb()
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO topic (topic_id,topic_forum_id,topic_name,topic_date,topic_ownername,topic_ownerid,topic_type,topic_reply) values (?,?,?,?,?,?,?,?)"))
|
||||
{
|
||||
ps.setInt(1, _id);
|
||||
@@ -132,7 +132,7 @@ public class Topic
|
||||
{
|
||||
TopicBBSManager.getInstance().delTopic(this);
|
||||
f.rmTopicByID(getID());
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM topic WHERE topic_id=? AND topic_forum_id=?"))
|
||||
{
|
||||
ps.setInt(1, getID());
|
||||
|
@@ -26,7 +26,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
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.communitybbs.BB.Forum;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ForumsBBSManager extends BaseBBSManager
|
||||
*/
|
||||
protected ForumsBBSManager()
|
||||
{
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
Statement s = con.createStatement();
|
||||
ResultSet rs = s.executeQuery("SELECT forum_id FROM forums WHERE forum_type = 0"))
|
||||
{
|
||||
|
Reference in New Issue
Block a user