mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Show whisper spies cross server
This commit is contained in:
1 parent
10fc409266
commit
af705e7812
1 file changed
+17
-4
+17
-4
@@ -129,14 +129,27 @@ public class MessageManager {
|
||||
this.messageService().registerUUIDMessageListener("whisper-component", (uuid, byteArray) -> {
|
||||
final UUID recipient = new UUID(byteArray.readLong(), byteArray.readLong());
|
||||
|
||||
final PlayerUser sender = this.carbonChat.userService().wrap(uuid);
|
||||
final PlayerUser target = this.carbonChat.userService().wrap(recipient);
|
||||
final String message = byteArray.readUTF();
|
||||
|
||||
if (target != null) {
|
||||
if (!target.ignoringUser(uuid)) {
|
||||
target.replyTarget(uuid);
|
||||
target.sendMessage(Identity.identity(uuid), this.carbonChat.gsonSerializer().deserialize(message));
|
||||
if (!target.ignoringUser(uuid)) {
|
||||
target.replyTarget(uuid);
|
||||
target.sendMessage(Identity.identity(uuid), this.carbonChat.gsonSerializer().deserialize(message));
|
||||
}
|
||||
|
||||
for (final PlayerUser user : this.carbonChat.userService().onlineUsers()) {
|
||||
if (!user.spyingWhispers()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (user.equals(target) || user.uuid().equals(uuid)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
user.sendMessage(sender, this.carbonChat.messageProcessor()
|
||||
.processMessage(this.carbonChat.translations().spyWhispers(), "message", message,
|
||||
"target", target.displayName(), "sender", sender.displayName()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user