Skip to content

Commit

Permalink
feat: release v3.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
qixils committed Jun 18, 2024
1 parent 169397b commit 2a51db0
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pojos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>java-crowd-control</artifactId>
<groupId>dev.qixils.crowdcontrol</groupId>
<version>3.9.2-SNAPSHOT</version>
<version>3.9.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ static <T> T fromInputStream(@NotNull InputStream input, @NotNull Function<@NotN
if (!eligible)
return null;

//LoggerFactory.getLogger("CrowdControl/JsonObject").info(inJSON);

// convert to POJO
return jsonMapper.apply(inJSON);
}
Expand Down
10 changes: 9 additions & 1 deletion pojos/src/main/java/dev/qixils/crowdcontrol/socket/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,13 @@ public Integer getCost() {

/**
* Gets the {@link Type Type} of the request.
* May be null for unknown types.
*
* @return request type
* @since 1.0.0
*/
@ApiStatus.AvailableSince("1.0.0")
@NotNull
@Nullable
@CheckReturnValue
public Type getType() {
return type;
Expand Down Expand Up @@ -556,6 +557,13 @@ public enum Type implements ByteObject {
@ApiStatus.AvailableSince("3.0.0")
@ApiStatus.Internal
LOGIN(TriState.UNKNOWN, (byte) 0xF0), // 240
/**
* Requests the current state of the game.
*
* @since 3.9.2
*/
@ApiStatus.AvailableSince("3.9.2")
REQUEST_STATE(TriState.UNKNOWN, (byte) 0xFD), // 253
/**
* This packet's sole purpose is to establish that the connection with the
* Crowd Control server has not been dropped.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ public void methodTests() {
Assertions.assertThrows(IllegalStateException.class, timedEffect::complete); // will throw because effect has not started
Assertions.assertThrows(IllegalStateException.class, () -> timedEffect.complete(true)); // will throw because effect has not started
Assertions.assertThrows(IllegalStateException.class, () -> timedEffect.complete(false)); // will throw because effect has not started
Assertions.assertThrows(IllegalStateException.class, timedEffect::queue); // will throw because request is invalid
Assertions.assertThrows(IllegalStateException.class, timedEffect::queue); // will throw because effect is already queued

TimedEffect newEffect = timedEffect.toBuilder().effectGroup("blah").build();
Assertions.assertEquals("blah", newEffect.getEffectGroup());
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>dev.qixils.crowdcontrol</groupId>
<artifactId>java-crowd-control</artifactId>
<version>3.9.2-SNAPSHOT</version> <!-- don't forget to update scm tags & submodule versions -->
<version>3.9.2</version> <!-- don't forget to update scm tags & submodule versions -->
<packaging>pom</packaging>

<modules>
Expand Down
2 changes: 1 addition & 1 deletion receiver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>java-crowd-control</artifactId>
<groupId>dev.qixils.crowdcontrol</groupId>
<version>3.9.2-SNAPSHOT</version>
<version>3.9.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ public void handle(@NotNull Request request) {
effectHandlers.get(effect).apply(request).send();
else if (asyncHandlers.containsKey(effect))
asyncHandlers.get(effect).accept(request);
else if (effect != null && !effect.isEmpty() && request.getType().isEffectType()) {
else if (effect != null && !effect.isEmpty() && request.getType() != null && request.getType().isEffectType()) {
request.buildResponse().type(Response.ResultType.UNAVAILABLE).message("The effect couldn't be found").send();
request.buildResponse().id(0).packetType(Response.PacketType.EFFECT_STATUS).type(Response.ResultType.NOT_VISIBLE).send();
}
Expand Down
2 changes: 1 addition & 1 deletion sender/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>java-crowd-control</artifactId>
<groupId>dev.qixils.crowdcontrol</groupId>
<version>3.9.2-SNAPSHOT</version>
<version>3.9.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private void loop() {
}

private void writeRequest(@NotNull Request request, @NotNull FluxSink<Response> sink) {
assert isAcceptingRequests() || (isRunning() && !request.getType().isEffectType());
assert isAcceptingRequests() || (isRunning());//TODO: what? && !request.getType().isEffectType());
try {
outputStream.write(request.toJSON().getBytes(StandardCharsets.UTF_8));
outputStream.write(0x00);
Expand Down
2 changes: 1 addition & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>java-crowd-control</artifactId>
<groupId>dev.qixils.crowdcontrol</groupId>
<version>3.9.2-SNAPSHOT</version>
<version>3.9.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down

0 comments on commit 2a51db0

Please sign in to comment.