mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-17 20:10:19 -07:00
Another batch of preemptive bugfixing
This commit is contained in:
parent
62ab9e80a9
commit
13dce7226e
19 changed files with 84 additions and 84 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue