Sync with L2jServer HighFive Mar 25th 2015.
This commit is contained in:
@@ -63,10 +63,7 @@ public class ForumsBBSManager extends BaseBBSManager
|
||||
*/
|
||||
public void initRoot()
|
||||
{
|
||||
for (Forum f : _table)
|
||||
{
|
||||
f.vload();
|
||||
}
|
||||
_table.forEach(f -> f.vload());
|
||||
_log.info("Loaded " + _table.size() + " forums. Last forum id used: " + _lastid);
|
||||
}
|
||||
|
||||
@@ -101,14 +98,7 @@ public class ForumsBBSManager extends BaseBBSManager
|
||||
*/
|
||||
public Forum getForumByName(String name)
|
||||
{
|
||||
for (Forum f : _table)
|
||||
{
|
||||
if (f.getName().equals(name))
|
||||
{
|
||||
return f;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return _table.stream().filter(f -> f.getName().equals(name)).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,14 +133,7 @@ public class ForumsBBSManager extends BaseBBSManager
|
||||
*/
|
||||
public Forum getForumByID(int idf)
|
||||
{
|
||||
for (Forum f : _table)
|
||||
{
|
||||
if (f.getID() == idf)
|
||||
{
|
||||
return f;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return _table.stream().filter(f -> f.getID() == idf).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,10 +20,10 @@ package com.l2jserver.gameserver.communitybbs.Manager;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import com.l2jserver.gameserver.communitybbs.BB.Forum;
|
||||
import com.l2jserver.gameserver.communitybbs.BB.Post;
|
||||
@@ -35,7 +35,7 @@ import com.l2jserver.util.StringUtil;
|
||||
|
||||
public class PostBBSManager extends BaseBBSManager
|
||||
{
|
||||
private final Map<Topic, Post> _postByTopic = new HashMap<>();
|
||||
private final Map<Topic, Post> _postByTopic = new ConcurrentHashMap<>();
|
||||
|
||||
public Post getGPosttByTopic(Topic t)
|
||||
{
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
package com.l2jserver.gameserver.communitybbs.Manager;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import com.l2jserver.gameserver.communitybbs.BB.Forum;
|
||||
import com.l2jserver.gameserver.communitybbs.BB.Post;
|
||||
@@ -37,13 +37,12 @@ import com.l2jserver.util.StringUtil;
|
||||
|
||||
public class TopicBBSManager extends BaseBBSManager
|
||||
{
|
||||
private final List<Topic> _table;
|
||||
private final Map<Forum, Integer> _maxId;
|
||||
private final List<Topic> _table = new CopyOnWriteArrayList<>();
|
||||
private final Map<Forum, Integer> _maxId = new HashMap<>();
|
||||
|
||||
protected TopicBBSManager()
|
||||
{
|
||||
_table = new ArrayList<>();
|
||||
_maxId = new ConcurrentHashMap<>();
|
||||
// Prevent external initialization.
|
||||
}
|
||||
|
||||
public void addTopic(Topic tt)
|
||||
|
||||
Reference in New Issue
Block a user