Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiChat v1.10 #130

Draft
wants to merge 199 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
e1a8240
Created the ProxyDataStore
OllieMartin Jul 15, 2020
9ce67dd
Relocated more fields to the ProxyDataStore
OllieMartin Jul 15, 2020
8ac177f
Commented the proxy data store fields
OllieMartin Jul 15, 2020
b12d0a3
Implemented a new CommChannels class for inter server communication
OllieMartin Jul 16, 2020
a5f4647
Migrated player meta communication to new channel (local to proxy only)
OllieMartin Jul 16, 2020
cb3ef74
Incremented version number to 1.10
OllieMartin Jul 16, 2020
6b5dc2a
Relocated chat comm channel to pchat and schat
OllieMartin Jul 16, 2020
2500329
Relocated the MCE, PMCE, PXE and PPXE to pact and sact channels
OllieMartin Jul 16, 2020
b3beedf
Fixed bug with pxe wrong channel being used
OllieMartin Jul 16, 2020
9d4cdf0
Unhacked the direct message hack using new pchat channel
OllieMartin Jul 19, 2020
d63b9e1
Refactored BungeeComm to ProxyLocalCommunicationManager
OllieMartin Jul 19, 2020
1770955
Refactored the multichat:channel channel to pdata channel
OllieMartin Jul 19, 2020
60711d5
Updated the remaining plugin messaging channels
OllieMartin Jul 19, 2020
a5c5ba2
Fixed issue in last commit (needed to flush Object Streams)
OllieMartin Jul 19, 2020
9028724
Updated descriptions for each of the new channels
OllieMartin Jul 20, 2020
d6a6a52
Removed unnecessary comments
OllieMartin Jul 20, 2020
de4dc7d
Moved configDir to MultiChatProxy API
OllieMartin Jul 20, 2020
27e5fc8
Moved Announcements data file to new ProxyFileStore system
OllieMartin Jul 20, 2020
9edd8cb
Moved the individual file data stores to their own package
OllieMartin Jul 20, 2020
a5f898c
Implemented new Bulletins file
OllieMartin Jul 20, 2020
a9af0e1
Merge branch 'ten' into tenmerge
OllieMartin Jul 20, 2020
3e0ab64
Merge pull request #127 from MultiChat/tenmerge
OllieMartin Jul 20, 2020
96abb76
Merge branch 'ten' into tenmerge2
OllieMartin Jul 20, 2020
ea648c5
Merge pull request #129 from MultiChat/tenmerge2
OllieMartin Jul 20, 2020
ccecf78
Moved StaffChatInfo and AdminChatInfo files to new file stores
OllieMartin Jul 21, 2020
c606e3d
Moved GroupChatInfo.dat file to the new File Stores
OllieMartin Jul 21, 2020
9872e28
Fixed typo in last commit
OllieMartin Jul 21, 2020
c33bd20
Changed spigot api version to 1.13 (no longer listed as legacy)
OllieMartin Jul 21, 2020
0f71bec
Moved GroupSpyInfo.dat files to new FileStore
OllieMartin Jul 21, 2020
29ad906
Moved Casts.dat to new File Store
OllieMartin Jul 21, 2020
9c8207c
Moved the SocialSpyInfo.dat file to new File Stores
OllieMartin Jul 21, 2020
9c2b58b
Moved GlobalChatInfo.dat to new File Stores
OllieMartin Jul 21, 2020
bde15ba
Moved Mute.dat to new File stores
OllieMartin Jul 21, 2020
d859f7d
Added Ignore.dat to new File Stores
OllieMartin Jul 21, 2020
561f32b
Moved UUIDNameManager files to new File Stores
OllieMartin Jul 21, 2020
6d98bce
First attempt to migrate command aliases to new file aliases.yml
OllieMartin Jul 21, 2020
41b9194
Moved MultiChatUtil to common package
OllieMartin Jul 21, 2020
aee8f63
Changed CommChannels to Interface implementation (thanks to Gadse)
OllieMartin Jul 22, 2020
410cca2
Created new ProxyBackupManager
OllieMartin Jul 22, 2020
49a35b7
Changed outdated config version message
OllieMartin Jul 22, 2020
2b78c21
Renamed Channel class to LegacyChannel to make way for new Channel
OllieMartin Jul 22, 2020
ab131bb
First batch of new channel and context implementation
OllieMartin Jul 22, 2020
8ff2cb0
Much of the framework for new chat channels is now in place
OllieMartin Jul 22, 2020
cfa537f
Channels seem to practically work except local channel
OllieMartin Jul 23, 2020
74c683c
Made changes to proxy channels, need to fix local part
OllieMartin Jul 24, 2020
8415e0c
Attempt to implement the local chat with new channels
OllieMartin Jul 26, 2020
ac6361c
Fix registering of local channel
OllieMartin Jul 26, 2020
b77a47e
Fix a bug with selecting channels
OllieMartin Jul 26, 2020
bb6b2b8
Fixed bug with legacy message handling
OllieMartin Jul 26, 2020
22b9c9c
Updated package organisation
OllieMartin Jul 26, 2020
d3faf7c
1.10 beta 1
OllieMartin Jul 26, 2020
00b2a56
Separated out the login, logout, and server switch listeners
OllieMartin Jul 26, 2020
5cdc2c8
Fixed broadcast raw message formatting in channels
OllieMartin Jul 27, 2020
80642db
Fixed wrong ChatColor class
OllieMartin Jul 27, 2020
b27256c
Fixed another wrong ChatColor class
OllieMartin Jul 27, 2020
30e031b
First steps towards using a slightly different system for config manag
OllieMartin Jul 27, 2020
a04526d
Attempted to implement the ability to use more channels than local/glob
OllieMartin Jul 27, 2020
e8d051d
Prevent players switching to channels unless they have speak permission
OllieMartin Jul 27, 2020
baddf40
Remove unused class
OllieMartin Jul 27, 2020
91467c8
Moved old fetch display name code to the new server switch listener
OllieMartin Jul 27, 2020
69ebef9
Introduced ProxyChatManager
OllieMartin Jul 27, 2020
cc6bf2a
Further refined ProxyChatManager
OllieMartin Jul 27, 2020
e1c4b0d
First implementation of LocalSpy
OllieMartin Jul 27, 2020
d5be1b7
Fixed bug in message shown for local spy
OllieMartin Jul 27, 2020
94de99d
Only show [SPY] prefix if NOT on same server when localspy enabled
OllieMartin Jul 27, 2020
78eecff
MultiChat v1.10 beta 2 includes local spy
OllieMartin Jul 27, 2020
7e7178b
Attempt to make local spy customisable
OllieMartin Jul 28, 2020
bdf2c44
Fixed wrong use of ChatColor class
OllieMartin Jul 28, 2020
a6d38e6
Don't send spy messages to the player who originally sent the message!
OllieMartin Jul 28, 2020
53f9ba6
Fix bug where receiver still saw 2 messages if were also sender in spy
OllieMartin Jul 28, 2020
cab2be0
MultiChat v1.10 beta 3 can now customise the local spy format
OllieMartin Jul 28, 2020
7e839a3
Move to using enums to get config handlers
OllieMartin Jul 29, 2020
ded0ced
Add basic support for RGB colours in network join / quit messages
OllieMartin Jul 29, 2020
fbad6c4
Moved join messages to ServerConnectedEvent to prevent null pointer
OllieMartin Jul 29, 2020
b993501
Made it so that welcome messages can be shown even if join msgs disabled
OllieMartin Jul 29, 2020
cf60bbe
Experiment by expanding the /display command to read JSON text
OllieMartin Jul 29, 2020
4f84ded
More experimentation with JSON in the display command (not perfect)
OllieMartin Jul 29, 2020
2fbecce
Display command can now use JSON (and injection) (and legacy supported)
OllieMartin Jul 30, 2020
7669ec8
Beta 4 includes quit message fixes & json in display command
OllieMartin Jul 30, 2020
663b6dc
Slightly improved the new JSON and translations methods
OllieMartin Jul 30, 2020
dd69106
Further improved MultiChats JSON handling routines
OllieMartin Jul 30, 2020
63ebb80
Fix variable naming
OllieMartin Jul 30, 2020
b00484d
Very minor optimisation of json handling loop
OllieMartin Jul 30, 2020
167ce76
Added JSON to PMs (but no validation on user using JSON in the message)
OllieMartin Aug 2, 2020
a245f19
Prevent players from inserting JSON into %MESSAGE% placeholder
OllieMartin Aug 2, 2020
5127bac
Refactored the JSON parsing code again
OllieMartin Aug 2, 2020
3cd3f54
Implemented JSON into message manager
OllieMartin Aug 2, 2020
10462f2
Implement JSON in staff chats
OllieMartin Aug 2, 2020
7e08ac8
Prevent use of JSON in %MESSAGE% in staff chats
OllieMartin Aug 2, 2020
8728b57
Implement JSON to group chats
OllieMartin Aug 3, 2020
6a936bc
Fixed console group chat logging
OllieMartin Aug 3, 2020
c7dd836
Fix multiple network join message bug
OllieMartin Aug 3, 2020
7ac7785
Fixed bug with injection copying in first part of component
OllieMartin Aug 3, 2020
66c08ae
Support JSON in bulletins
OllieMartin Aug 3, 2020
4f952ec
Display full JSON formatting in /bulletin list
OllieMartin Aug 3, 2020
469aa9b
Implemented JSON into announcements
OllieMartin Aug 3, 2020
94bb9c1
Added %SERVER% placeholder to join / quit / welcome messages (& JSON)
OllieMartin Aug 3, 2020
e8fb5c3
Fix fr translation
OllieMartin Aug 3, 2020
7c2bf83
MultiChat v1.10 beta 5 includes the new JSON support
OllieMartin Aug 3, 2020
a6b7f11
Move ProxyUtils to MultiChatUtil
OllieMartin Aug 3, 2020
9289505
Refine some of the local colour code translations code
OllieMartin Aug 3, 2020
2ce2a80
Fixed issue in placeholder managers
OllieMartin Aug 3, 2020
45d0972
Better incorporation of the &r reset code
OllieMartin Aug 3, 2020
a6c3852
Allow /nick command to be used on offline players
OllieMartin Aug 3, 2020
a0f69c2
Prevent error if player not online
OllieMartin Aug 3, 2020
ea283ec
ACCCommand overhaul and implementation of common regex util class.
Gadsee Aug 3, 2020
92871a8
Experiments with player tagging
OllieMartin Aug 3, 2020
6c91a76
ACCommand overhaul
Gadsee Aug 3, 2020
f2e530d
Allow console to use nick command
OllieMartin Aug 3, 2020
0d28061
AnnouncementCommand overhaul
Gadsee Aug 3, 2020
09f3e0b
AnnouncementCommand overhaul (Forgot formatting)
Gadsee Aug 3, 2020
65d78df
Refactored lots of the MultiChatUtil code and added JUNIT tests
OllieMartin Aug 3, 2020
22e13e6
Fix error with JSON RGB code approximations being used for non JSON
OllieMartin Aug 3, 2020
f9cc7b1
BulletinCommand overhaul
Gadsee Aug 4, 2020
7d4b087
Move BulletinCommand argument case for proper order
Gadsee Aug 4, 2020
05198cf
Cleaner command usage handling
Gadsee Aug 4, 2020
e4e4b26
CastCommand refactor
Gadsee Aug 4, 2020
dbcd376
ChannelCommand refactor
Gadsee Aug 4, 2020
e5ef531
Merge remote-tracking branch 'upstream/ten' into ten
Gadsee Aug 4, 2020
4dedcf0
ClearChatCommand refactor
Gadsee Aug 4, 2020
51fbfb1
Completed unit tests for the MultiChatUtil class
OllieMartin Aug 4, 2020
6872897
Merge branch 'ten' of https://github.com/MultiChat/Development into ten
Gadsee Aug 4, 2020
5510995
DisplayCommand Refactor
Gadsee Aug 4, 2020
ab49740
FreezeChatCommand refactor
Gadsee Aug 4, 2020
aef4ea9
Migrated all colour translation / stripping code to MultiChatUtil
OllieMartin Aug 4, 2020
c04aea1
Colour -> Color in MultiChatUtil
OllieMartin Aug 4, 2020
15041d7
Colour -> Color in JUNIT and TranslateMode
OllieMartin Aug 4, 2020
28eae98
GCCommand refactor
Gadsee Aug 4, 2020
cb18030
Merge branch 'ten' into ten
akshualy Aug 4, 2020
364a210
Refactored some local chat handling code to use newer translation method
OllieMartin Aug 4, 2020
8a7c8f2
Remove legacy comments
OllieMartin Aug 4, 2020
c64def1
GlobalCommand refactor
Gadsee Aug 4, 2020
eb75f70
Add TODO to GlobalCommand
Gadsee Aug 4, 2020
5590c52
Improved console logging & debug for MultiChatLocal
OllieMartin Aug 4, 2020
0857e00
Better proxy debug messages for pchat received from MultiChatLocal
OllieMartin Aug 4, 2020
628e2de
Allow the name to not be exact in order to /msg to someone
OllieMartin Aug 4, 2020
ab73572
Fix null pointer in getting recipients from queue when cancelled earlier
OllieMartin Aug 5, 2020
6177dae
GroupCommand refactor
Gadsee Aug 5, 2020
0ffc98c
Removed all code relating to communicating the legacy "ignore map"
OllieMartin Aug 5, 2020
22f073d
Fix MultiChat version (was displaying 1.1 not 1.10)
OllieMartin Aug 5, 2020
558e4e5
MultiChat v1.10 beta 6
OllieMartin Aug 5, 2020
26dbc17
GroupListCommand refactor
Gadsee Aug 5, 2020
299fc1b
HelpMeCommand refactor
Gadsee Aug 5, 2020
0190297
IgnoreCommand refactor
Gadsee Aug 5, 2020
10e8859
LocalCommand refactor
Gadsee Aug 5, 2020
3bc2d22
LocalSpyCommand refactor
Gadsee Aug 5, 2020
4b285af
Merge branch 'ten' into ten
akshualy Aug 5, 2020
d78b902
Fix Upstream Merge
Gadsee Aug 5, 2020
67c58ae
MCCCommand refactor
Gadsee Aug 5, 2020
6f3889f
MCCommand refactor
Gadsee Aug 5, 2020
c4138e6
Adjust ACCommand to match MCCommand
Gadsee Aug 5, 2020
d4a98f4
ACCommand variable name clarification
Gadsee Aug 5, 2020
a4deb40
MsgCommand refactor
Gadsee Aug 5, 2020
793da2c
MultiChatBypassCommand refactor
Gadsee Aug 6, 2020
bf72f3f
MultiChatCommand refactor and command unregister improvement
Gadsee Aug 6, 2020
6e5d1e8
Update PAPI version in maven
OllieMartin Aug 6, 2020
08c393c
Prevent JSON injection progressively snowballing (with &l chars etc.)
OllieMartin Aug 6, 2020
5574b3c
GroupListCommand fix typo
Gadsee Aug 6, 2020
71076bd
HelpMeCommand fix username not being included anymore
Gadsee Aug 6, 2020
2f4c61d
MsgCommand fix username being sent in message
Gadsee Aug 6, 2020
3b54c69
MultiChatExecuteCommand refactor
Gadsee Aug 6, 2020
1c99394
MuteCommand refactor
Gadsee Aug 6, 2020
a7c2265
ReplyCommand refactor
Gadsee Aug 6, 2020
f4d4da5
SocialSpyCommand refactor
Gadsee Aug 6, 2020
8f30517
StaffListCommand refactor
Gadsee Aug 6, 2020
a41ed2a
UseCastCommand refactor
Gadsee Aug 6, 2020
583bfc7
Merge branch 'ten' of https://github.com/MultiChat/Development into ten
Gadsee Aug 6, 2020
6b50f54
Removed some old (very questionable) hack-y double char placeholder code
OllieMartin Aug 6, 2020
73e90ec
Merge pull request #138 from Gadse-KastCraft/ten
OllieMartin Aug 6, 2020
30c4dab
Removed unnecessary import
OllieMartin Aug 6, 2020
3a77335
Fixed bug when PremiumVanish not found and logic error for toggle pm
OllieMartin Aug 6, 2020
d0ab98c
MultiChat v1.10 beta 7
OllieMartin Aug 6, 2020
bd1cbf8
Start of proxy config refactor
Gadsee Aug 7, 2020
38226ca
Refactor all configurations and access to them
Gadsee Aug 7, 2020
9236f48
Added back configuration load messages
Gadsee Aug 7, 2020
58f6e20
Removed the creation/load confirmations
Gadsee Aug 7, 2020
7851140
Remove static config access from MultiChat.class
Gadsee Aug 8, 2020
5e6f367
Remove unused aliases access
Gadsee Aug 8, 2020
dfcfe1c
MultiChat.class optimizations
Gadsee Aug 8, 2020
9678e0b
Target UTF-8 and Java 8 in pom for platform-independency
Gadsee Aug 8, 2020
8f8ebf0
Replace MessageManager with modern config handler
Gadsee Aug 8, 2020
14d97b6
TODO Update
Gadsee Aug 8, 2020
e19b794
Auto Update Config
Gadsee Aug 8, 2020
7a16071
Making some space
Gadsee Aug 8, 2020
4840b69
Updater optimization
Gadsee Aug 8, 2020
2a72a16
Config backups
Gadsee Aug 8, 2020
aae44b6
Make regex rules / actions actually work
Gadsee Aug 8, 2020
c9491f9
Versioned proxy config backups
Gadsee Aug 8, 2020
556841a
String#valueOf(null) returns "null", not null
Gadsee Aug 8, 2020
15f09b9
Javadoc and QOL changes
Gadsee Aug 9, 2020
942d87e
Fixed reloadConfig throwing wrong exception
Gadsee Aug 9, 2020
318e9fb
Remove unnecessary new line write
Gadsee Aug 9, 2020
2b62cac
Merge pull request #141 from Gadsee/ten
akshualy Jan 6, 2021
dbb4178
Remove Tab Hell From GroupManager
Jan 6, 2021
2e171c6
Clarify method and variable names in TGroupChatInfo
Jan 6, 2021
7185fd2
Clarify method and variable names in TGroupChatInfo
Jan 6, 2021
aa71d71
Check /group spy all for permission change.
Jan 6, 2021
5df5d04
Added the message placeholder at a later point in time
Jan 6, 2021
53b65dd
Remove quotes that were too much
Jan 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions multichat/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>xyz.olivermartin.multichat</groupId>
<artifactId>multichat</artifactId>
<version>1.9.5</version>
<version>1.10</version>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -261,8 +261,14 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.9.2</version>
<version>2.10.9</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>annotations</artifactId>
<groupId>org.jetbrains</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.rojo8399</groupId>
Expand Down Expand Up @@ -293,5 +299,9 @@
</exclusions>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

9 changes: 7 additions & 2 deletions multichat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

<groupId>xyz.olivermartin.multichat</groupId>
<artifactId>multichat</artifactId>
<version>1.9.5</version>
<version>1.10</version>

<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<repositories>

Expand Down Expand Up @@ -147,7 +152,7 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.9.2</version>
<version>2.10.9</version>
<scope>provided</scope>
</dependency>

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.olivermartin410.plugins;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

/**
Expand All @@ -16,22 +16,22 @@ public class TGroupChatInfo extends TChatInfo implements Serializable {

private static final long serialVersionUID = 1L;

private List<UUID> Members = new ArrayList<UUID>();
private List<UUID> Viewers = new ArrayList<UUID>();
private List<UUID> Admins = new ArrayList<UUID>();
private List<UUID> BannedPlayers = new ArrayList<UUID>();
private final Set<UUID> members = new HashSet<>();
private final Set<UUID> viewers = new HashSet<>();
private final Set<UUID> admins = new HashSet<>();
private final Set<UUID> bannedPlayers = new HashSet<>();

private String PartyName;
private boolean secret;
private String password;
private boolean formal;

public void setPassword(String newpassword) {
this.password = newpassword;
public void setPassword(String password) {
this.password = password;
}

public void setFormal(boolean trueorfalse) {
this.formal = trueorfalse;
public void setFormal(boolean formal) {
this.formal = formal;
}

public boolean getFormal() {
Expand All @@ -42,8 +42,8 @@ public String getPassword() {
return this.password;
}

public void setSecret(boolean trueorfalse) {
this.secret = trueorfalse;
public void setSecret(boolean secret) {
this.secret = secret;
}

public boolean getSecret() {
Expand All @@ -58,91 +58,67 @@ public void setName(String Name) {
this.PartyName = Name;
}

public List<UUID> getMembers() {
return this.Members;
public Set<UUID> getMembers() {
return this.members;
}

public void addMember(UUID memberuuid) {
this.Members.add(memberuuid);
public void addMember(UUID playerUID) {
this.members.add(playerUID);
}

public void delMember(UUID memberuuid) {
this.Members.remove(memberuuid);
public void delMember(UUID playerUID) {
this.members.remove(playerUID);
}

public List<UUID> getAdmins() {
return this.Admins;
public Set<UUID> getAdmins() {
return this.admins;
}

public void addAdmin(UUID adminuuid) {
this.Admins.add(adminuuid);
public void addAdmin(UUID playerUID) {
this.admins.add(playerUID);
}

public void delAdmin(UUID adminuuid) {
this.Admins.remove(adminuuid);
public void delAdmin(UUID playerUID) {
this.admins.remove(playerUID);
}

public boolean existsAdmin(UUID adminuuid) {

if (this.Admins.contains(adminuuid)) {
return true;
}

return false;

public boolean isAdmin(UUID playerUID) {
return this.admins.contains(playerUID);
}

public List<UUID> getBanned() {
return this.BannedPlayers;
public Set<UUID> getBanned() {
return this.bannedPlayers;
}

public void addBanned(UUID banuuid) {
this.BannedPlayers.add(banuuid);
public void addBanned(UUID playerUID) {
this.bannedPlayers.add(playerUID);
}

public void delBanned(UUID banuuid) {
this.BannedPlayers.remove(banuuid);
public void delBanned(UUID playerUID) {
this.bannedPlayers.remove(playerUID);
}

public boolean existsBanned(UUID banuuid) {

if (this.BannedPlayers.contains(banuuid)) {
return true;
}

return false;

public boolean isBanned(UUID playerUID) {
return this.bannedPlayers.contains(playerUID);
}

public boolean existsMember(UUID memberuuid) {

if (this.Members.contains(memberuuid)) {
return true;
}

return false;

public boolean isMember(UUID playerUID) {
return this.members.contains(playerUID);
}

public List<UUID> getViewers() {
return this.Viewers;
public Set<UUID> getViewers() {
return this.viewers;
}

public void addViewer(UUID memberuuid) {
this.Viewers.add(memberuuid);
public void addViewer(UUID playerUID) {
this.viewers.add(playerUID);
}

public void delViewer(UUID memberuuid) {
this.Viewers.remove(memberuuid);
public void delViewer(UUID playerUID) {
this.viewers.remove(playerUID);
}

public boolean existsViewer(UUID memberuuid) {

if (this.Viewers.contains(memberuuid)) {
return true;
}

return false;

public boolean isViewer(UUID playerUID) {
return this.viewers.contains(playerUID);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package xyz.olivermartin.multichat.bungee;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.scheduler.ScheduledTask;
import xyz.olivermartin.multichat.bungee.events.PostBroadcastEvent;
import xyz.olivermartin.multichat.common.MessageType;
import xyz.olivermartin.multichat.common.MultiChatUtil;
import xyz.olivermartin.multichat.proxy.common.MultiChatProxy;
import xyz.olivermartin.multichat.proxy.common.ProxyJsonUtils;
import xyz.olivermartin.multichat.proxy.common.config.ProxyConfigs;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
* Announcements Management
Expand All @@ -29,19 +32,21 @@ public static boolean startAnnouncement(final String name, Integer minutes) {

Integer ID;

ScheduledTask task = ProxyServer.getInstance().getScheduler().schedule(MultiChat.getInstance(), new Runnable() {
ScheduledTask task = ProxyServer.getInstance().getScheduler().schedule(MultiChatProxy.getInstance().getPlugin(), new Runnable() {

@Override
public void run() {
String message = announcements.get(name.toLowerCase());

message = ChatControl.applyChatRules(message, "announcements", "").get();
message = ChatControl.applyChatRules(null, message, MessageType.ANNOUNCEMENTS).get();

message = MultiChatUtil.translateColorCodes(message);

for (ProxiedPlayer onlineplayer : ProxyServer.getInstance().getPlayers()) {
if (MultiChat.legacyServers.contains(onlineplayer.getServer().getInfo().getName())) {
onlineplayer.sendMessage(TextComponent.fromLegacyText(MultiChatUtil.approximateHexCodes(ChatColor.translateAlternateColorCodes('&',message))));
if (ProxyConfigs.CONFIG.isLegacyServer(onlineplayer.getServer().getInfo().getName())) {
onlineplayer.sendMessage(ProxyJsonUtils.parseMessage(MultiChatUtil.approximateRGBColorCodes(message)));
} else {
onlineplayer.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&',message)));
onlineplayer.sendMessage(ProxyJsonUtils.parseMessage(message));
}
}

Expand Down Expand Up @@ -92,7 +97,7 @@ public static boolean addAnnouncement(String name, String message) {

if (!announcements.containsKey(name.toLowerCase())) {

announcements.put(name.toLowerCase(), MultiChatUtil.reformatRGB(message));
announcements.put(name.toLowerCase(), message);
return true;

} else {
Expand Down Expand Up @@ -133,13 +138,15 @@ public static void playAnnouncement(String name) {

String message = announcements.get(name.toLowerCase());

message = ChatControl.applyChatRules(message, "announcements", "").get();
message = ChatControl.applyChatRules(null, message, MessageType.ANNOUNCEMENTS).get();

message = MultiChatUtil.translateColorCodes(message);

for (ProxiedPlayer onlineplayer : ProxyServer.getInstance().getPlayers()) {
if (MultiChat.legacyServers.contains(onlineplayer.getServer().getInfo().getName())) {
onlineplayer.sendMessage(TextComponent.fromLegacyText(MultiChatUtil.approximateHexCodes(ChatColor.translateAlternateColorCodes('&',message))));
if (ProxyConfigs.CONFIG.isLegacyServer(onlineplayer.getServer().getInfo().getName())) {
onlineplayer.sendMessage(ProxyJsonUtils.parseMessage(MultiChatUtil.approximateRGBColorCodes(message)));
} else {
onlineplayer.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&',message)));
onlineplayer.sendMessage(ProxyJsonUtils.parseMessage(message));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package xyz.olivermartin.multichat.bungee;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.TimeUnit;

import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.scheduler.ScheduledTask;
import xyz.olivermartin.multichat.bungee.events.PostBroadcastEvent;
import xyz.olivermartin.multichat.common.MessageType;
import xyz.olivermartin.multichat.common.MultiChatUtil;
import xyz.olivermartin.multichat.proxy.common.MultiChatProxy;
import xyz.olivermartin.multichat.proxy.common.ProxyJsonUtils;
import xyz.olivermartin.multichat.proxy.common.config.ProxyConfigs;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.TimeUnit;

/**
* Bulletins Management
Expand Down Expand Up @@ -72,7 +75,7 @@ public static void stopBulletins() {

public static void addBulletin(String message) {
synchronized (bulletin) {
bulletin.add(MultiChatUtil.reformatRGB(message));
bulletin.add(message);
}
}

Expand All @@ -95,7 +98,7 @@ public static void removeBulletin(int index) {
}

private static void scheduleNextBulletin(final int minutes) {
ScheduledTask task = ProxyServer.getInstance().getScheduler().schedule(MultiChat.getInstance(), new Runnable() {
ScheduledTask task = ProxyServer.getInstance().getScheduler().schedule(MultiChatProxy.getInstance().getPlugin(), new Runnable() {

@Override
public void run() {
Expand All @@ -108,16 +111,18 @@ public void run() {

message = bulletin.get(nextBulletin);

message = ChatControl.applyChatRules(message, "bulletins", "").get();
message = ChatControl.applyChatRules(null, message, MessageType.BULLETINS).get();

message = MultiChatUtil.translateColorCodes(message);

for (ProxiedPlayer onlineplayer : ProxyServer.getInstance().getPlayers()) {
if (MultiChat.legacyServers.contains(onlineplayer.getServer().getInfo().getName())) {
onlineplayer.sendMessage(TextComponent.fromLegacyText(MultiChatUtil.approximateHexCodes(ChatColor.translateAlternateColorCodes('&',message))));
if (ProxyConfigs.CONFIG.isLegacyServer(onlineplayer.getServer().getInfo().getName())) {
onlineplayer.sendMessage(ProxyJsonUtils.parseMessage(MultiChatUtil.approximateRGBColorCodes(message)));
} else {
onlineplayer.sendMessage(TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&',message)));
onlineplayer.sendMessage(ProxyJsonUtils.parseMessage(message));
}
}

// Trigger PostBroadcastEvent
ProxyServer.getInstance().getPluginManager().callEvent(new PostBroadcastEvent("bulletin", message));

Expand Down
Loading