Skip to content

Commit

Permalink
Fix group messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainRexPL committed Jan 15, 2024
1 parent a8420ec commit 90cd7c8
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 43 deletions.
22 changes: 11 additions & 11 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.92.Final</version>
<version>4.1.104.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -73,13 +73,13 @@
</filter>
</filters>
<artifactSet>
<excludes>
<exclude>com.google.guava:guava</exclude>
<exclude>org.apache.logging.log4j:*</exclude>
<exclude>com.google.code.findbugs:*</exclude>
<exclude>net.jcip:jcip-annotations:*</exclude>
<exclude>net.java.dev.jna:*</exclude>
</excludes>
<excludes>
<exclude>com.google.guava:guava</exclude>
<exclude>org.apache.logging.log4j:*</exclude>
<exclude>com.google.code.findbugs:*</exclude>
<exclude>net.jcip:jcip-annotations:*</exclude>
<exclude>net.java.dev.jna:*</exclude>
</excludes>
</artifactSet>
<relocations>
<relocation>
Expand Down Expand Up @@ -160,7 +160,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-bytecode-version</id>
Expand All @@ -182,10 +182,10 @@
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>1.6.2</version>
<version>1.7.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.collarmc.client.api.messaging;

import com.collarmc.api.groups.Group;
import com.collarmc.api.identity.ClientIdentity;
import com.collarmc.api.messaging.Message;
import com.collarmc.api.session.Player;
import com.collarmc.client.Collar;
Expand Down Expand Up @@ -95,14 +96,14 @@ public boolean handleResponse(ProtocolResponse resp) {
try {
byte[] contents = groupSession.decrypt(response.message, response.sender);
message = Utils.messagePackMapper().readValue(contents, Message.class);
} catch (IOException | CipherException e) {
// We don't throw an exception here in case someone is doing something naughty to disrupt the group and cause the client to exit
LOGGER.error(collar.identity() + "could not read group message from group " + group.id, e);
message = null;
}
if (message != null) {
collar.configuration.eventBus.dispatch(new GroupMessageReceivedEvent(collar, group, response.player, message));
}});
} catch (IOException | CipherException e) {
// We don't throw an exception here in case someone is doing something naughty to disrupt the group and cause the client to exit
LOGGER.error(collar.identity() + "could not read group message from group " + group.id, e);
message = null;
}
if (message != null) {
collar.configuration.eventBus.dispatch(new GroupMessageReceivedEvent(collar, group, new Player((ClientIdentity)response.sender, null), message));
}});
});
} else if (response.sender != null) {
Message message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.collarmc.api.minecraft.MinecraftPlayer;

/**
* Fired when a private message was attempted with another player but there was not sufficent trust to deliver
* Fired when a private message was attempted with another player but there was not sufficient trust to deliver
*/
public final class UntrustedPrivateMessageReceivedEvent extends AbstractCollarEvent {
public final MinecraftPlayer player;
Expand Down
28 changes: 14 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<jackson-databind.version>2.15.0</jackson-databind.version>
<jackson-databind.version>2.16.1</jackson-databind.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<minecraft.java.runtime>16</minecraft.java.runtime>
<log4j.version>2.20.0</log4j.version>
<log4j.version>2.22.1</log4j.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
Expand Down Expand Up @@ -67,7 +67,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<version>0.8.11</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -103,7 +103,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.12.1</version>
<configuration>
<source>16</source>
<target>16</target>
Expand All @@ -112,7 +112,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
<version>3.2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -126,7 +126,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.1</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down Expand Up @@ -179,7 +179,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.0-jre</version>
<version>33.0.0-jre</version>
</dependency>
<!-- if someone wants to rewrite and use org.json like a chump be my guest -->
<dependency>
Expand All @@ -200,19 +200,19 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.92.Final</version>
<version>4.1.104.Final</version>
<scope>compile</scope>
</dependency>
<!-- a database -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>4.9.1</version>
<version>4.11.1</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.13.0</version>
<version>5.14.0</version>
</dependency>
<!-- password hashing -->
<dependency>
Expand All @@ -239,12 +239,12 @@
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>3.1.1</version>
<version>3.1.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
<version>3.14.0</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand All @@ -254,7 +254,7 @@
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.7</version>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand Down
4 changes: 2 additions & 2 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -162,4 +162,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
12 changes: 6 additions & 6 deletions shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.13.0</version>
<version>5.14.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand All @@ -40,10 +40,10 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.92.Final</version>
<version>4.1.104.Final</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -69,7 +69,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-bytecode-version</id>
Expand All @@ -91,10 +91,10 @@
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>1.6.2</version>
<version>1.7.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
</project>
2 changes: 1 addition & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<version>0.8.11</version>
<executions>
<execution>
<id>report</id>
Expand Down

0 comments on commit 90cd7c8

Please sign in to comment.