1package com.runehive.game.world.entity.mob.player.relations;
3import com.runehive.game.event.impl.log.PrivateMessageChatLogEvent;
4import com.runehive.game.world.World;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.net.packet.out.*;
7import com.runehive.util.Utility;
9import java.util.ArrayList;
11import java.util.Optional;
20 private final List<Long>
friendList =
new ArrayList<>(200);
22 private final List<Long>
ignoreList =
new ArrayList<>(100);
57 if (players ==
null) {
60 boolean temporaryOnlineStatus = online;
61 if (players.relations.friendList.contains(
player.usernameLong)) {
64 temporaryOnlineStatus =
false;
68 boolean tempOn =
true;
69 if (
player.relations.friendList.contains(players.usernameLong)) {
71 players.relations.privateChatMode.equals(
PrivacyChatMode.
OFF) || players.relations.getIgnoreList().contains(
player.usernameLong)) {
111 if (
player.usernameLong == username) {
120 player.send(
new SendMessage(
"Please remove " + name +
" from your ignore list first."));
131 result.ifPresent(it -> it.relations.updateLists(
true));
141 if (name.equals(
player.getUsername())) {
158 if (
player.usernameLong == username) {
167 player.send(
new SendMessage(
"Please remove " + name +
" from your friend list first."));
177 result.ifPresent(it -> it.relations.updateLists(
false));
183 if (name.equals(
player.getUsername())) {
191 result.ifPresent(it -> it.relations.updateLists(
true));
199 if (
player.punishment.isMuted()) {
200 player.message(
"You can not send private messages while muted!");
203 if (friend ==
null) {
void publish(Event event)
Sends an Event to all subscribed listeners.
Represents the game world.
static Optional< Player > search(String name)
Gets a player by name.
static DataBus getDataBus()
static MobList< Player > getPlayers()
This class represents a character controlled by a player.
void send(OutgoingPacket encoder)
final PlayerRelation relations
PrivacyChatMode getPrivateChatMode()
void setPublicChatMode(PrivacyChatMode publicChatMode, boolean update)
void setTradeChatMode(PrivacyChatMode tradeChatMode, boolean update)
PlayerRelation updateLists(boolean online)
void addFriend(Long username)
final List< Long > ignoreList
PrivacyChatMode getClanChatMode()
PlayerRelation setPrivateChatMode(PrivacyChatMode privateChatMode, boolean update)
List< Long > getIgnoreList()
void deleteFriend(Long username)
PlayerRelation setPrivateMessageId(int privateMessageId)
void message(Player friend, PrivateChatMessage message)
PrivacyChatMode publicChatMode
void addIgnore(Long username)
final List< Long > friendList
void sendAddFriend(long name)
PrivacyChatMode getPublicChatMode()
void updatePrivacyChatOptions()
void setClanChatMode(PrivacyChatMode clanChatMode, boolean update)
PrivacyChatMode privateChatMode
PrivacyChatMode clanChatMode
boolean isFriendWith(String player)
PlayerRelation(Player player)
void setPrivacyChatModes(int publicChat, int privateChat, int clanChat, int tradeChat)
int getPrivateMessageId()
PrivacyChatMode tradeChatMode
List< Long > getFriendList()
PrivacyChatMode getTradeChatMode()
void deleteIgnore(Long username)
Handles sending the deposit friend packet.
The OutgoingPacket that sends a message to a Players chatbox in the client.
Handles miscellaneous methods.
static String formatName(final String input)
static String longToString(long l)
static long stringToLong(String string)
static Optional< PrivacyChatMode > get(int code)
The enumerated types for private message list statuses.
LOADED
The list is loaded.