Skip to content

Commit

Permalink
Fix a critical bug regarding sign updates with 1.8 clients
Browse files Browse the repository at this point in the history
  • Loading branch information
Exceptionflug committed Feb 15, 2020
1 parent 30615e7 commit e4b5b4d
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 43 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@ This is the full portfolio of protocolize dependencies:
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-world</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion protocolize-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import de.exceptionflug.protocolize.api.event.EventManager;
import de.exceptionflug.protocolize.api.traffic.TrafficManager;
import net.md_5.bungee.api.plugin.Plugin;

/**
* This class contains all relevant methods to use Protocolize.
Expand Down Expand Up @@ -40,4 +41,5 @@ public static EventManager getEventManager() {
public static TrafficManager getTrafficManager() {
return TRAFFIC_MANAGER;
}

}
8 changes: 4 additions & 4 deletions protocolize-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
Expand All @@ -18,19 +18,19 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions protocolize-inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
import de.exceptionflug.protocolize.items.*;
import de.exceptionflug.protocolize.items.packet.WindowItems;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.protocol.Protocol;
import net.md_5.bungee.protocol.ProtocolConstants;

Expand All @@ -22,14 +24,15 @@
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

import static de.exceptionflug.protocolize.api.util.ProtocolVersions.MINECRAFT_1_8;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;

public final class InventoryModule {

private static final Map<UUID, Map<Integer, Inventory>> WINDOW_MAP = new ConcurrentHashMap<>();
private static final Map<UUID, Map<Integer, Map<Integer, InventoryAction>>> ACTION_MAP = new ConcurrentHashMap<>();
private static final Map<UUID, Integer> WINDOW_ID_COUNTER_MAP = new ConcurrentHashMap<>();
private static final Plugin dummyPlugin = new Plugin();

private static boolean spigotInventoryTracking = false;

Expand Down
6 changes: 3 additions & 3 deletions protocolize-items/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<plugin>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen-plugin</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<executions>
<execution>
<phase>generate-sources</phase>
Expand All @@ -33,12 +33,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
12 changes: 6 additions & 6 deletions protocolize-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-plugin</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>

<properties>
<plugin.main>de.exceptionflug.protocolize.ProtocolizePlugin</plugin.main>
Expand All @@ -23,22 +23,22 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-world</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down
4 changes: 2 additions & 2 deletions protocolize-protogen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
Expand Down
6 changes: 3 additions & 3 deletions protocolize-protogen/protocolize-protogen-compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen-compiler</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>

<build>
<plugins>
Expand Down Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions protocolize-protogen/protocolize-protogen-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen-plugin</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<build>
Expand Down Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen-compiler</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
10 changes: 5 additions & 5 deletions protocolize-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-util</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>

<dependencies>
<dependency>
Expand All @@ -49,17 +49,17 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-world</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions protocolize-world/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-world</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.5.4-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import de.exceptionflug.protocolize.api.BlockPosition;
import de.exceptionflug.protocolize.api.protocol.AbstractPacket;
import io.netty.buffer.ByteBuf;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.chat.ComponentSerializer;
import net.md_5.bungee.protocol.ProtocolConstants;
Expand Down Expand Up @@ -73,10 +74,30 @@ public void read(final ByteBuf buf, final ProtocolConstants.Direction direction,

private void readLineStrings(ByteBuf buf) {
lines = new String[4];
lines[0] = ComponentSerializer.parse(readString(buf))[0].toLegacyText();
lines[1] = ComponentSerializer.parse(readString(buf))[0].toLegacyText();
lines[2] = ComponentSerializer.parse(readString(buf))[0].toLegacyText();
lines[3] = ComponentSerializer.parse(readString(buf))[0].toLegacyText();
String line1 = readString(buf);
if(line1.equals("null")) {
lines[0] = "";
} else {
lines[0] = ComponentSerializer.parse(line1)[0].toLegacyText();
}
String line2 = readString(buf);
if(line2.equals("null")) {
lines[1] = "";
} else {
lines[1] = ComponentSerializer.parse(line2)[0].toLegacyText();
}
String line3 = readString(buf);
if(line3.equals("null")) {
lines[2] = "";
} else {
lines[2] = ComponentSerializer.parse(line3)[0].toLegacyText();
}
String line4 = readString(buf);
if(line4.equals("null")) {
lines[3] = "";
} else {
lines[3] = ComponentSerializer.parse(line4)[0].toLegacyText();
}
}

@Override
Expand Down

0 comments on commit e4b5b4d

Please sign in to comment.