mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Use Netty Default Object Decoder/Encoder
This commit is contained in:
@@ -292,8 +292,8 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
|||||||
pnlPrefs.add(cbEnableUnknownCards, titleConstraints);
|
pnlPrefs.add(cbEnableUnknownCards, titleConstraints);
|
||||||
pnlPrefs.add(new NoteLabel("Enable Unknown Cards to be loaded to Unknown Set. (Requires restart)"), descriptionConstraints);
|
pnlPrefs.add(new NoteLabel("Enable Unknown Cards to be loaded to Unknown Set. (Requires restart)"), descriptionConstraints);
|
||||||
|
|
||||||
pnlPrefs.add(cbUseElsa, titleConstraints);
|
/*pnlPrefs.add(cbUseElsa, titleConstraints);
|
||||||
pnlPrefs.add(new NoteLabel("Use ELSA Serializer for Network (EXPERIMENTAL Option, Requires restart)"), descriptionConstraints);
|
pnlPrefs.add(new NoteLabel("Use ELSA Serializer for Network (EXPERIMENTAL Option, Requires restart)"), descriptionConstraints);*/
|
||||||
|
|
||||||
// Graphic Options
|
// Graphic Options
|
||||||
pnlPrefs.add(new SectionLabel(localizer.getMessage("GraphicOptions")), sectionConstraints + ", gaptop 2%");
|
pnlPrefs.add(new SectionLabel(localizer.getMessage("GraphicOptions")), sectionConstraints + ", gaptop 2%");
|
||||||
|
|||||||
@@ -240,10 +240,10 @@ public class SettingsPage extends TabPage<SettingsScreen> {
|
|||||||
"Enable Unknown Cards",
|
"Enable Unknown Cards",
|
||||||
"Enable Unknown Cards to be loaded to Unknown Set. (Requires restart)"),
|
"Enable Unknown Cards to be loaded to Unknown Set. (Requires restart)"),
|
||||||
3);
|
3);
|
||||||
lstSettings.addItem(new BooleanSetting(FPref.UI_USE_ELSA,
|
/*lstSettings.addItem(new BooleanSetting(FPref.UI_USE_ELSA,
|
||||||
"Use ELSA Serializer",
|
"Use ELSA Serializer",
|
||||||
"Use ELSA Serializer for Network (EXPERIMENTAL Option, Requires restart)"),
|
"Use ELSA Serializer for Network (EXPERIMENTAL Option, Requires restart)"),
|
||||||
3);
|
3);*/
|
||||||
|
|
||||||
//Graphic Options
|
//Graphic Options
|
||||||
lstSettings.addItem(new BooleanSetting(FPref.UI_ENABLE_ONLINE_IMAGE_FETCHER,
|
lstSettings.addItem(new BooleanSetting(FPref.UI_ENABLE_ONLINE_IMAGE_FETCHER,
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package forge.net.client;
|
package forge.net.client;
|
||||||
|
|
||||||
import forge.net.CustomObjectDecoder;
|
|
||||||
import forge.net.CustomObjectEncoder;
|
|
||||||
import io.netty.bootstrap.Bootstrap;
|
import io.netty.bootstrap.Bootstrap;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
@@ -28,6 +26,8 @@ import forge.net.event.IdentifiableNetEvent;
|
|||||||
import forge.net.event.LobbyUpdateEvent;
|
import forge.net.event.LobbyUpdateEvent;
|
||||||
import forge.net.event.MessageEvent;
|
import forge.net.event.MessageEvent;
|
||||||
import forge.net.event.NetEvent;
|
import forge.net.event.NetEvent;
|
||||||
|
import io.netty.handler.codec.serialization.ObjectDecoder;
|
||||||
|
import io.netty.handler.codec.serialization.ObjectEncoder;
|
||||||
|
|
||||||
public class FGameClient implements IToServer {
|
public class FGameClient implements IToServer {
|
||||||
|
|
||||||
@@ -58,8 +58,8 @@ public class FGameClient implements IToServer {
|
|||||||
public void initChannel(final SocketChannel ch) throws Exception {
|
public void initChannel(final SocketChannel ch) throws Exception {
|
||||||
final ChannelPipeline pipeline = ch.pipeline();
|
final ChannelPipeline pipeline = ch.pipeline();
|
||||||
pipeline.addLast(
|
pipeline.addLast(
|
||||||
new CustomObjectEncoder(),
|
new ObjectEncoder(),
|
||||||
new CustomObjectDecoder(CustomObjectDecoder.maxObjectsize, ClassResolvers.cacheDisabled(null)),
|
new ObjectDecoder(9766*1024, ClassResolvers.cacheDisabled(null)),
|
||||||
new MessageHandler(),
|
new MessageHandler(),
|
||||||
new LobbyUpdateHandler(),
|
new LobbyUpdateHandler(),
|
||||||
new GameClientHandler(FGameClient.this));
|
new GameClientHandler(FGameClient.this));
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import forge.interfaces.IGuiGame;
|
|||||||
import forge.interfaces.ILobbyListener;
|
import forge.interfaces.ILobbyListener;
|
||||||
import forge.match.LobbySlot;
|
import forge.match.LobbySlot;
|
||||||
import forge.match.LobbySlotType;
|
import forge.match.LobbySlotType;
|
||||||
import forge.net.CustomObjectDecoder;
|
|
||||||
import forge.net.CustomObjectEncoder;
|
|
||||||
import forge.net.event.LobbyUpdateEvent;
|
import forge.net.event.LobbyUpdateEvent;
|
||||||
import forge.net.event.LoginEvent;
|
import forge.net.event.LoginEvent;
|
||||||
import forge.net.event.LogoutEvent;
|
import forge.net.event.LogoutEvent;
|
||||||
@@ -26,6 +24,8 @@ import io.netty.channel.nio.NioEventLoopGroup;
|
|||||||
import io.netty.channel.socket.SocketChannel;
|
import io.netty.channel.socket.SocketChannel;
|
||||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||||
import io.netty.handler.codec.serialization.ClassResolvers;
|
import io.netty.handler.codec.serialization.ClassResolvers;
|
||||||
|
import io.netty.handler.codec.serialization.ObjectDecoder;
|
||||||
|
import io.netty.handler.codec.serialization.ObjectEncoder;
|
||||||
import io.netty.handler.logging.LogLevel;
|
import io.netty.handler.logging.LogLevel;
|
||||||
import io.netty.handler.logging.LoggingHandler;
|
import io.netty.handler.logging.LoggingHandler;
|
||||||
|
|
||||||
@@ -99,8 +99,8 @@ public final class FServerManager {
|
|||||||
public final void initChannel(final SocketChannel ch) throws Exception {
|
public final void initChannel(final SocketChannel ch) throws Exception {
|
||||||
final ChannelPipeline p = ch.pipeline();
|
final ChannelPipeline p = ch.pipeline();
|
||||||
p.addLast(
|
p.addLast(
|
||||||
new CustomObjectEncoder(),
|
new ObjectEncoder(),
|
||||||
new CustomObjectDecoder(CustomObjectDecoder.maxObjectsize, ClassResolvers.cacheDisabled(null)),
|
new ObjectDecoder(9766*1024, ClassResolvers.cacheDisabled(null)),
|
||||||
new MessageHandler(),
|
new MessageHandler(),
|
||||||
new RegisterClientHandler(),
|
new RegisterClientHandler(),
|
||||||
new LobbyInputHandler(),
|
new LobbyInputHandler(),
|
||||||
|
|||||||
Reference in New Issue
Block a user