diff --git a/src/protocol/swg/SUIEventNotification.java b/src/protocol/swg/SUIEventNotification.java index 8cbbf2a4..02383036 100644 --- a/src/protocol/swg/SUIEventNotification.java +++ b/src/protocol/swg/SUIEventNotification.java @@ -21,8 +21,8 @@ ******************************************************************************/ package protocol.swg; -import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import java.util.Vector; import org.apache.mina.core.buffer.IoBuffer; @@ -46,21 +46,13 @@ public class SUIEventNotification extends SWGMessage { updateCounter = buffer.getInt(); for(int i = 0; i < count; ++i) { - + int size = buffer.getInt(); if(size > 0) { - - try { - returnList.add(new String(ByteBuffer.allocate(size * 2).put(buffer.array(), buffer.position(), size * 2).array(), "UTF-16LE")); - buffer.position(buffer.position() + size * 2); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - + returnList.add(new String(ByteBuffer.allocate(size * 2).put(buffer.array(), buffer.position(), size * 2).array(), StandardCharsets.UTF_16LE)); + buffer.position(buffer.position() + size * 2); } - } - } @Override diff --git a/src/protocol/swg/auctionManagerClientListener/CreateImmediateAuctionMessage.java b/src/protocol/swg/auctionManagerClientListener/CreateImmediateAuctionMessage.java index bf638873..9fdf9e0b 100644 --- a/src/protocol/swg/auctionManagerClientListener/CreateImmediateAuctionMessage.java +++ b/src/protocol/swg/auctionManagerClientListener/CreateImmediateAuctionMessage.java @@ -49,7 +49,7 @@ public class CreateImmediateAuctionMessage extends SWGMessage { this.description = new String(ByteBuffer.allocate(size * 2).put(data.array(), data.position(), size * 2).array(), StandardCharsets.UTF_16LE); data.position(data.position() + size * 2); - this.isPremium = (data.get() == 0 ? false : true); + this.isPremium = data.get() == 0 ? false : true; } @Override diff --git a/src/resources/objects/ObjectMessageBuilder.java b/src/resources/objects/ObjectMessageBuilder.java index f8da2d6c..384e2c1e 100644 --- a/src/resources/objects/ObjectMessageBuilder.java +++ b/src/resources/objects/ObjectMessageBuilder.java @@ -21,7 +21,6 @@ ******************************************************************************/ package resources.objects; -import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.charset.StandardCharsets;