Another batch of preemptive bugfixing

This commit is contained in:
ceikry 2021-07-26 07:33:07 -05:00
parent 62ab9e80a9
commit 13dce7226e
19 changed files with 84 additions and 84 deletions

View file

@ -1,6 +1,7 @@
package ms.net.packet;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import ms.system.util.ByteBufferUtils;
@ -301,7 +302,7 @@ public class IoBuffer {
* @return
*/
public IoBuffer putString(String val) {
buf.put(val.getBytes());
buf.put(val.getBytes(StandardCharsets.UTF_8));
buf.put((byte) 0);
return this;
}
@ -313,7 +314,7 @@ public class IoBuffer {
*/
public IoBuffer putJagString(String val) {
buf.put((byte) 0);
buf.put(val.getBytes());
buf.put(val.getBytes(StandardCharsets.UTF_8));
buf.put((byte) 0);
return this;
}
@ -557,18 +558,6 @@ public class IoBuffer {
return buf.getLong();
}
/**
*
* @return
*/
public int getSmart() {
int peek = buf.get(buf.position());
if (peek <= Byte.MAX_VALUE) {
return buf.get() & 0xFF;
}
return (buf.getShort() & 0xFFFF) - 32768;
}
/**
*
* @return