Changed a List to reset each time its registered to prevent stats copying to the next game, automatic string escaping, party colour name changed to original colour

This commit is contained in:
Teddy 2016-01-11 12:35:44 +00:00
parent b9d44d9a24
commit 40d913beaf

View File

@ -35,20 +35,22 @@ import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.managers.chat.ChatStatData; import nautilus.game.arcade.managers.chat.ChatStatData;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.json.simple.JSONObject; import org.jooq.tools.json.JSONObject;
public class GameChatManager implements Listener public class GameChatManager implements Listener
{ {
private ArcadeManager _manager; private ArcadeManager _manager;
private LinkedList<ChatStatData> _chatStats = new LinkedList<ChatStatData>(); private LinkedList<ChatStatData> _chatStats;
public GameChatManager(ArcadeManager manager) public GameChatManager(ArcadeManager manager)
{ {
_manager = manager; _manager = manager;
_manager.getPluginManager().registerEvents(this, _manager.getPlugin()); _manager.getPluginManager().registerEvents(this, _manager.getPlugin());
_chatStats = new LinkedList<ChatStatData>();
} }
@EventHandler @EventHandler
@ -144,8 +146,8 @@ public class GameChatManager implements Listener
event.setFormat(levelStr + C.cDPurple + C.Bold + "Party " + C.cWhite + C.Bold + senderName + " " + C.cPurple + "%2$s"); event.setFormat(levelStr + C.cDPurple + C.Bold + "Party " + C.cWhite + C.Bold + senderName + " " + C.cPurple + "%2$s");
format = event.getFormat().split(sender.getName())[0]; format = event.getFormat().split(sender.getName())[0];
name = _manager.GetColor(sender) + sender.getName(); name = C.cWhite + C.Bold + sender.getName() + C.Reset;
message = event.getFormat().split(sender.getName())[1].replace("%2$s", "") + JSONObject.escape(event.getMessage()); message = event.getFormat().split(sender.getName())[1].replace("%2$s", "") + JSONObject.escape(_manager.GetChat().getFilteredMessage(sender, event.getMessage()));
if(!_manager.GetGame().IsLive()) if(!_manager.GetGame().IsLive())
{ {
@ -195,7 +197,7 @@ public class GameChatManager implements Listener
name = _manager.GetColor(sender) + sender.getName(); name = _manager.GetColor(sender) + sender.getName();
} }
message = event.getFormat().split(sender.getName())[1].replace("%2$s", "") + JSONObject.escape(event.getMessage()); message = event.getFormat().split(sender.getName())[1].replace("%2$s", "") + JSONObject.escape(_manager.GetChat().getFilteredMessage(sender, event.getMessage()));
} }
if (globalMessage) if (globalMessage)