Improved MS security

This commit is contained in:
ceikry
2021-08-10 22:16:48 -05:00
parent b4b26cb583
commit cdc3d65fe8
10 changed files with 42 additions and 54 deletions
@@ -3,6 +3,8 @@ package core.net.event;
import core.cache.misc.buffer.ByteBufferUtils;
import core.net.IoSession;
import core.net.IoWriteEvent;
import rs09.Server;
import rs09.ServerConstants;
import java.nio.ByteBuffer;
@@ -12,11 +14,6 @@ import java.nio.ByteBuffer;
*/
public final class MSHSWriteEvent extends IoWriteEvent {
/**
* The password used to verify
*/
private static final String PASSWORD = "0x14ari0SSbh98989910";
/**
* Constructs a new {@code MSHSWriteEvent} {@code Object}
* @param session The session.
@@ -28,9 +25,9 @@ public final class MSHSWriteEvent extends IoWriteEvent {
@Override
public void write(IoSession session, Object context) {
ByteBuffer buffer = ByteBuffer.allocate(2 + PASSWORD.length());
ByteBuffer buffer = ByteBuffer.allocate(2 + ServerConstants.MS_SECRET_KEY.length());
buffer.put((byte) 88);
ByteBufferUtils.putString(PASSWORD, buffer);
ByteBufferUtils.putString(ServerConstants.MS_SECRET_KEY, buffer);
session.queue((ByteBuffer) buffer.flip());
}