aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark/common/ws
diff options
context:
space:
mode:
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common/ws')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/ws/ViewerSocketConnection.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/ws/ViewerSocketConnection.java b/spark-common/src/main/java/me/lucko/spark/common/ws/ViewerSocketConnection.java
index 9079860..2173f53 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/ws/ViewerSocketConnection.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/ws/ViewerSocketConnection.java
@@ -21,7 +21,6 @@
package me.lucko.spark.common.ws;
import com.google.protobuf.ByteString;
-
import me.lucko.bytesocks.client.BytesocksClient;
import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.proto.SparkWebSocketProtos.PacketWrapper;
@@ -87,7 +86,7 @@ public class ViewerSocketConnection implements BytesocksClient.Listener, AutoClo
* @return the channel id
*/
public String getChannelId() {
- return this.socket.getChannelId();
+ return this.socket.channelId();
}
/**
@@ -100,7 +99,7 @@ public class ViewerSocketConnection implements BytesocksClient.Listener, AutoClo
}
@Override
- public void onText(CharSequence data) {
+ public void onText(String data) {
try {
RawPacket packet = decodeRawPacket(data);
handleRawPacket(packet);
@@ -178,8 +177,8 @@ public class ViewerSocketConnection implements BytesocksClient.Listener, AutoClo
* @param data the encoded data
* @return the decoded packet
*/
- private RawPacket decodeRawPacket(CharSequence data) throws IOException {
- byte[] buf = Base64.getDecoder().decode(data.toString());
+ private RawPacket decodeRawPacket(String data) throws IOException {
+ byte[] buf = Base64.getDecoder().decode(data);
return RawPacket.parseFrom(buf);
}