mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-02-21 12:32:37 +01:00
Merge branch 'dev' of https://git.krews.org/morningstar/Arcturus-Community into dev
This commit is contained in:
commit
356fc3776c
@ -107,3 +107,6 @@ INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('subscriptions.hc.payday.m
|
|||||||
ALTER TABLE `bots`
|
ALTER TABLE `bots`
|
||||||
ADD COLUMN `bubble_id` int(3) NULL DEFAULT 31 AFTER `effect`;
|
ADD COLUMN `bubble_id` int(3) NULL DEFAULT 31 AFTER `effect`;
|
||||||
|
|
||||||
|
-- Permissions to see tent chat
|
||||||
|
ALTER TABLE `permissions` ADD `acc_see_tentchat` ENUM('0', '1') NOT NULL DEFAULT '0' AFTER `acc_see_whispers`;
|
||||||
|
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('hotel.room.tent.prefix', 'Tent');
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
-- Permissions to see tent chat
|
|
||||||
ALTER TABLE `permissions` ADD `acc_see_tentchat` ENUM('0', '1') NOT NULL DEFAULT '0' AFTER `acc_see_whispers`;
|
|
||||||
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('hotel.room.tent.prefix', 'Tent');
|
|
@ -17,13 +17,13 @@ public class GameByteDecryption extends ByteToMessageDecoder {
|
|||||||
@Override
|
@Override
|
||||||
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) {
|
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) {
|
||||||
// Read all available bytes.
|
// Read all available bytes.
|
||||||
byte[] data = in.readBytes(in.readableBytes()).array();
|
ByteBuf data = in.readBytes(in.readableBytes());
|
||||||
|
|
||||||
// Decrypt.
|
// Decrypt.
|
||||||
ctx.channel().attr(GameServerAttributes.CRYPTO_CLIENT).get().parse(data);
|
ctx.channel().attr(GameServerAttributes.CRYPTO_CLIENT).get().parse(data.array());
|
||||||
|
|
||||||
// Continue in the pipeline.
|
// Continue in the pipeline.
|
||||||
out.add(Unpooled.wrappedBuffer(data));
|
out.add(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,28 +6,25 @@ import io.netty.buffer.Unpooled;
|
|||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelOutboundHandlerAdapter;
|
import io.netty.channel.ChannelOutboundHandlerAdapter;
|
||||||
import io.netty.channel.ChannelPromise;
|
import io.netty.channel.ChannelPromise;
|
||||||
|
import io.netty.util.ReferenceCountUtil;
|
||||||
|
|
||||||
public class GameByteEncryption extends ChannelOutboundHandlerAdapter {
|
public class GameByteEncryption extends ChannelOutboundHandlerAdapter {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
||||||
// Convert msg to ByteBuf.
|
// convert to Bytebuf
|
||||||
ByteBuf out = (ByteBuf) msg;
|
ByteBuf in = (ByteBuf) msg;
|
||||||
|
|
||||||
// Read all available bytes.
|
// read available bytes
|
||||||
byte[] data;
|
ByteBuf data = (in).readBytes(in.readableBytes());
|
||||||
|
|
||||||
if (out.hasArray()) {
|
//release old object
|
||||||
data = out.array();
|
ReferenceCountUtil.release(in);
|
||||||
} else {
|
|
||||||
data = out.readBytes(out.readableBytes()).array();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encrypt.
|
// Encrypt.
|
||||||
ctx.channel().attr(GameServerAttributes.CRYPTO_SERVER).get().parse(data);
|
ctx.channel().attr(GameServerAttributes.CRYPTO_SERVER).get().parse(data.array());
|
||||||
|
|
||||||
// Continue in the pipeline.
|
// Continue in the pipeline.
|
||||||
ctx.write(Unpooled.wrappedBuffer(data));
|
ctx.write(data, promise);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user