add notes to chatuser object

This commit is contained in:
len 2021-06-07 10:51:00 +02:00
parent 8d723cc0c6
commit 3266cc05a3

View File

@ -7,20 +7,21 @@ import java.util.LinkedList;
import java.util.UUID; import java.util.UUID;
public class ChatUser { public class ChatUser {
private final UUID uuid; private final UUID uuid; // player uuid
private final int partyId; private final int partyId; // the party they are in
private boolean toggledPartyChat; private boolean toggledPartyChat; // should chat messages instantly go to party chat when added, idk if this should be saved
private boolean forceTp; private boolean forceTp; // idk ask teri
private String displayName; private String displayName; // the nickname, doesn't need to be saved with the chatuser object, could be saved but we can get it from the nicknamesview
private String prefix; private String prefix; // doesn't need saving, we get this from luckperms
private String staffPrefix; private String staffPrefix; // doesn't need saving, we get this from luckperms
private String prefixAll; private String prefixAll; // doesn't need saving, we get this from luckperms
private boolean toggleGc; private boolean toggleGc; // should be saved, this toggles if the player can see and use global chat
private UUID replyTarget; private UUID replyTarget; // reply target for use in /msg i don't mind setting this to null on login, feedback?
private long gcCooldown; private long gcCooldown; // the time when they last used gc, is used for the cooldown, i wouldn't save this, but setting this to the login time means they can't use gc for 30 seconds after logging in
private LinkedList<Mail> mails; private LinkedList<Mail> mails; // mails aren't finalized yet, so for now a table sender, reciever, sendtime, readtime(if emtpy mail isn't read yet?, could also do a byte to control this), the actual message
private LinkedList<UUID> ignoredPlayers; private LinkedList<UUID> ignoredPlayers; // a list of UUID, a new table non unique, where one is is the player select * from ignores where ignoredby = thisplayer? where the result is the uuid of the player ignored by this player?
private LinkedList<UUID> ignoredBy; // a list of UUID, same table as above but select * from ignores where ignored = thisplayer? result should be the other user that ignored this player?
public ChatUser(UUID uuid, int partyId, boolean toggled_chat, boolean force_tp, boolean toggle_Gc) { public ChatUser(UUID uuid, int partyId, boolean toggled_chat, boolean force_tp, boolean toggle_Gc) {
this.uuid = uuid; this.uuid = uuid;
@ -43,6 +44,7 @@ public class ChatUser {
gcCooldown = System.currentTimeMillis(); // players can't use gc for 30 seconds after logging in if we use this? gcCooldown = System.currentTimeMillis(); // players can't use gc for 30 seconds after logging in if we use this?
mails = new LinkedList<>(); // todo load mails mails = new LinkedList<>(); // todo load mails
ignoredPlayers = new LinkedList<>(); // todo load ignoredPlayers ignoredPlayers = new LinkedList<>(); // todo load ignoredPlayers
ignoredBy = new LinkedList<>(); // todo load ignoredPlayers
} }
public UUID getUuid() { public UUID getUuid() {
@ -135,6 +137,14 @@ public class ChatUser {
ignoredPlayers.add(uuid); ignoredPlayers.add(uuid);
} }
public LinkedList<UUID> getIgnoredBy() {
return ignoredBy;
}
public void addIgnoredBy(UUID uuid) {
ignoredBy.add(uuid);
}
public long getGcCooldown() { public long getGcCooldown() {
return gcCooldown; return gcCooldown;
} }