Skip to content

Commit 3c4e834

Browse files
committed
Remove UI_NETPLAY_COMPAT toggle and inline the OFF path
The UI_NETPLAY_COMPAT preference gated two outer-codec serialization branches that had become functionally equivalent for production traffic: TrackableObject reference compression is performed at the application layer by DeltaSyncManager.toNetworkValue (property maps -> Integer IDs) and TrackableSerializer.wrapEvents (bundled events -> EventCardRef), both unconditional on the pref. The Android record serialVersionUID fallback lives in TrackableSerializer.ResolvingInputStream, which is used by unwrapEvents regardless of the outer codec, so cross-platform record deserialization is unaffected. A pref-mismatch between two endpoints corrupted the stream on the first class descriptor; removing the toggle eliminates that hazard. - Delete FPref.UI_NETPLAY_COMPAT - Delete GuiBase.propertyConfig, hasPropertyConfig, enablePropertyConfig - Inline the CObjectInputStream / CObjectOutputStream path in CompatibleObjectEncoder / CompatibleObjectDecoder - Drop the now-dead Tracker field from CompatibleObjectEncoder; the encoder no longer needed it (CObjectOutputStream passes null to TrackableSerializer.replace) and its callers stop calling setTracker on the encoder - Run ProtocolMethod.checkArgs unconditionally; it only logs, mirrors the always-on checkReturnValue, and replaces a generic Method.invoke "argument type mismatch" with a structured log line - Remove startup wiring in FControl and Forge.getApp; mobile launchers drop the propertyConfig argument - Remove the settings UI on desktop and mobile and the lblExperimentalNetworkCompatibility / nlExperimentalNetworkCompatibility localization strings across nine language files
1 parent 55a42ab commit 3c4e834

24 files changed

Lines changed: 11 additions & 105 deletions

File tree

forge-gui-android/src/forge/app/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ private void loadGame(final HWInfo hwInfo, final String title, final String step
385385
forgeLogo = findViewById(resId("id", "logo_id"));
386386
activeView = findViewById(resId("id", "mainview"));
387387
activeView.setBackgroundColor(Color.WHITE);
388-
forgeView = initializeForView(Forge.getApp(hwInfo, getAndroidClipboard(), adapter, ASSETS_DIR, false, !isLandscape, isTabletDevice, Build.VERSION.SDK_INT), config);
388+
forgeView = initializeForView(Forge.getApp(hwInfo, getAndroidClipboard(), adapter, ASSETS_DIR, !isLandscape, isTabletDevice, Build.VERSION.SDK_INT), config);
389389

390390
getAnimator(ObjectAnimator.ofFloat(forgeLogo, "alpha", 1f, 1f).setDuration(800), ObjectAnimator.ofObject(activeView, "backgroundColor", new ArgbEvaluator(), Color.WHITE, Color.BLACK).setDuration(1600), new AnimatorListenerAdapter() {
391391
@Override

forge-gui-desktop/src/main/java/forge/control/FControl.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import forge.gamemodes.match.HostedMatch;
4646
import forge.gamemodes.quest.data.QuestPreferences.QPref;
4747
import forge.gamemodes.quest.io.QuestDataIO;
48-
import forge.gui.GuiBase;
4948
import forge.gui.SOverlayUtils;
5049
import forge.gui.framework.FScreen;
5150
import forge.gui.framework.InvalidLayoutFileException;
@@ -261,10 +260,6 @@ public void initialize() {
261260

262261
display = FView.SINGLETON_INSTANCE.getLpnDocument();
263262

264-
//set ExperimentalNetworkOption from preference
265-
boolean propertyConfig = prefs != null && prefs.getPrefBoolean(ForgePreferences.FPref.UI_NETPLAY_COMPAT);
266-
GuiBase.enablePropertyConfig(propertyConfig);
267-
268263
closeAction = CloseAction.valueOf(prefs.getPref(FPref.UI_CLOSE_ACTION));
269264

270265
FView.SINGLETON_INSTANCE.setSplashProgessBarMessage(getLocalizer().getMessage("lblLoadingQuest"));

forge-gui-desktop/src/main/java/forge/screens/home/settings/CSubmenuPreferences.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,6 @@ public void initialize() {
101101
SoundSystem.instance.changeBackgroundTrack();
102102
});
103103

104-
// This updates Experimental Network Option
105-
view.getCbUseExperimentalNetworkStream().addItemListener(arg0 -> {
106-
if (updating) { return; }
107-
108-
final boolean toggle = view.getCbUseExperimentalNetworkStream().isSelected();
109-
GuiBase.enablePropertyConfig(toggle);
110-
prefs.setPref(FPref.UI_NETPLAY_COMPAT, String.valueOf(toggle));
111-
prefs.save();
112-
});
113-
114104
lstControls.clear(); // just in case
115105
lstControls.add(Pair.of(view.getCbAnte(), FPref.UI_ANTE));
116106
lstControls.add(Pair.of(view.getCbAnteMatchRarity(), FPref.UI_ANTE_MATCH_RARITY));
@@ -136,7 +126,6 @@ public void initialize() {
136126
lstControls.add(Pair.of(view.getCbEnableUnknownCards(), FPref.UI_LOAD_UNKNOWN_CARDS));
137127
lstControls.add(Pair.of(view.getCbEnableNonLegalCards(), FPref.UI_LOAD_NONLEGAL_CARDS));
138128
lstControls.add(Pair.of(view.getCbAllowCustomCardsDeckConformance(), FPref.ALLOW_CUSTOM_CARDS_IN_DECKS_CONFORMANCE));
139-
lstControls.add(Pair.of(view.getCbUseExperimentalNetworkStream(), FPref.UI_NETPLAY_COMPAT));
140129
lstControls.add(Pair.of(view.getCbImageFetcher(), FPref.UI_ENABLE_ONLINE_IMAGE_FETCHER));
141130
lstControls.add(Pair.of(view.getCbDisableCardImages(), FPref.UI_DISABLE_CARD_IMAGES));
142131
lstControls.add(Pair.of(view.getCbDisplayFoil(), FPref.UI_OVERLAY_FOIL_EFFECT));
@@ -254,7 +243,6 @@ public void update() {
254243
setPlayerNameButtonText();
255244
view.getCbDevMode().setSelected(ForgePreferences.DEV_MODE);
256245
view.getCbEnableMusic().setSelected(prefs.getPrefBoolean(FPref.UI_ENABLE_MUSIC));
257-
view.getCbUseExperimentalNetworkStream().setSelected(prefs.getPrefBoolean(FPref.UI_NETPLAY_COMPAT));
258246

259247
for(final Pair<JCheckBox, FPref> kv: lstControls) {
260248
kv.getKey().setSelected(prefs.getPrefBoolean(kv.getValue()));

forge-gui-desktop/src/main/java/forge/screens/home/settings/VSubmenuPreferences.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
121121
private final JCheckBox cbEnableUnknownCards = new OptionsCheckBox(localizer.getMessage("lblEnableUnknownCards"));
122122
private final JCheckBox cbEnableNonLegalCards = new OptionsCheckBox(localizer.getMessage("lblEnableNonLegalCards"));
123123
private final JCheckBox cbAllowCustomCardsDeckConformance = new OptionsCheckBox(localizer.getMessage("lblAllowCustomCardsInDecks"));
124-
private final JCheckBox cbUseExperimentalNetworkStream = new OptionsCheckBox(localizer.getMessage("lblExperimentalNetworkCompatibility"));
125124
private final JCheckBox cbAiPicker = new OptionsCheckBox(localizer.getMessage("lblAiPickerSettings"));
126125
private final JCheckBox cbCardArtCoreExpansionsOnlyOpt = new OptionsCheckBox(localizer.getMessage("lblPrefArtExpansionOnly"));
127126
private final JCheckBox cbSmartCardArtSelectionOpt = new OptionsCheckBox(localizer.getMessage("lblSmartCardArtOpt"));
@@ -382,9 +381,6 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
382381
pnlPrefs.add(cbAllowCustomCardsDeckConformance, titleConstraints);
383382
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlAllowCustomCardsInDecks")), descriptionConstraints);
384383

385-
pnlPrefs.add(cbUseExperimentalNetworkStream, titleConstraints);
386-
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlExperimentalNetworkCompatibility")), descriptionConstraints);
387-
388384
pnlPrefs.add(cbAiPicker, titleConstraints);
389385
pnlPrefs.add(new NoteLabel(localizer.getMessage("nlAiPickerSettings")), descriptionConstraints);
390386

@@ -749,11 +745,6 @@ public JCheckBox getCbAllowCustomCardsDeckConformance() {
749745
return cbAllowCustomCardsDeckConformance;
750746
}
751747

752-
/** @return {@link javax.swing.JCheckBox} */
753-
public JCheckBox getCbUseExperimentalNetworkStream() {
754-
return cbUseExperimentalNetworkStream;
755-
}
756-
757748
/** @return {@link javax.swing.JCheckBox} */
758749
public JCheckBox getCbImageFetcher() {
759750
return cbImageFetcher;

forge-gui-ios/src/forge/ios/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected IOSApplication createApplication() {
3030
final IOSApplicationConfiguration config = new IOSApplicationConfiguration();
3131
config.useAccelerometer = false;
3232
config.useCompass = false;
33-
final ApplicationListener app = Forge.getApp(null, new IOSClipboard(), new IOSAdapter(), assetsDir, false, false, false, 0);
33+
final ApplicationListener app = Forge.getApp(null, new IOSClipboard(), new IOSAdapter(), assetsDir, false, false, 0);
3434
final IOSApplication iosApp = new IOSApplication(app, config);
3535
return iosApp;
3636
}

forge-gui-mobile-dev/src/forge/app/GameLauncher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public GameLauncher(final String versionString, final String[] args) {
8080
else if (hasBothDims) isPortrait = heightArg > widthArg;
8181

8282
ApplicationListener start = Forge.getApp(hw, new Lwjgl3Clipboard(), new Main.DesktopAdapter(switchOrientationFile),
83-
assetsDir, false, isPortrait, false, 0);
83+
assetsDir, isPortrait, false, 0);
8484

8585
// Initialize window size
8686
int windowWidth, windowHeight;

forge-gui-mobile/src/forge/Forge.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public class Forge implements ApplicationListener {
131131
private static Localizer localizer;
132132
private static boolean desktopAutoOrientation = true;
133133

134-
public static ApplicationListener getApp(HWInfo hwInfo, Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean propertyConfig, boolean androidOrientation, boolean isTablet, int AndroidAPI) {
134+
public static ApplicationListener getApp(HWInfo hwInfo, Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean androidOrientation, boolean isTablet, int AndroidAPI) {
135135
if (app == null) {
136136
app = new Forge();
137137
if (GuiBase.getInterface() == null) {
@@ -140,7 +140,6 @@ public static ApplicationListener getApp(HWInfo hwInfo, Clipboard clipboard0, ID
140140
//obb directory on android uses the package name as entrypoint
141141
GuiBase.setUsingAppDirectory(assetDir0.contains("forge.app"));
142142
GuiBase.setInterface(new GuiMobile(assetDir0));
143-
GuiBase.enablePropertyConfig(propertyConfig);
144143
isPortraitMode = androidOrientation;
145144
isTabletDevice = isTablet;
146145
androidVersion = AndroidAPI;

forge-gui-mobile/src/forge/screens/settings/SettingsPage.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,6 @@ public void select() {
448448
);
449449
}
450450
}, 3);
451-
lstSettings.addItem(new BooleanSetting(FPref.UI_NETPLAY_COMPAT,
452-
Forge.getLocalizer().getMessage("lblExperimentalNetworkCompatibility"),
453-
Forge.getLocalizer().getMessage("nlExperimentalNetworkCompatibility")) {
454-
@Override
455-
public void select() {
456-
super.select();
457-
GuiBase.enablePropertyConfig(FModel.getPreferences().getPrefBoolean(FPref.UI_NETPLAY_COMPAT));
458-
}
459-
}, 3);
460451
lstSettings.addItem(new BooleanSetting(FPref.UI_ENABLE_DISPOSE_TEXTURES,
461452
Forge.getLocalizer().getMessage("lblDisposeTextures"),
462453
Forge.getLocalizer().getMessage("nlDisposeTextures")) {

forge-gui/res/languages/de-DE.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,8 +1137,6 @@ lblAllowCustomCardsInDecks=Erlaube benutzerdefinierte Karten
11371137
nlAllowCustomCardsInDecks=Erlaubt die Verwendung von benutzerdefinierten Karten in Decks. (Erfordert Neustart)
11381138
lblDisableCardImages=Kartenbilder abschalten
11391139
nlDisableCardImages=Wenn aktiviert, zeigt Forge keine Kartenbilder mehr.
1140-
lblExperimentalNetworkCompatibility=Experimentelle Netzwerkkompatibilität
1141-
nlExperimentalNetworkCompatibility=Forge wechselt auf kompatiblen Netzwerk-Stream. (Im Zweifel bitte ausschalten)
11421140
lblDisposeTextures=Bildspeicher reorganisieren
11431141
nlDisposeTextures=Wenn aktiviert, wird der Kartenbildspeicher zwischen einzelnen Spiele entleert um RAM zu sparen. (Im Zweifel bitte ausschalten)
11441142
lblAutoCacheSize=Aktiviere automatische Cache-Größe

forge-gui/res/languages/en-US.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,8 +1232,6 @@ lblAllowCustomCardsInDecks=Allow Custom Cards in Decks
12321232
nlAllowCustomCardsInDecks=Allow Custom Cards to be used in Decks (Ignored if Deck Conformance is disabled). (REQUIRES RESTART)
12331233
lblDisableCardImages=Disable Card Images
12341234
nlDisableCardImages=When enabled, Forge will not display card images.
1235-
lblExperimentalNetworkCompatibility=Experimental Network Compatibility
1236-
nlExperimentalNetworkCompatibility=Forge switches to compatible network stream. (If unsure, turn OFF this option)
12371235
lblDisposeTextures=Dispose Textures
12381236
nlDisposeTextures=When enabled, disposes the card art and card image caches to save RAM during game screen switching. (If unsure, turn OFF this option)
12391237
lblAutoCacheSize=Enable Auto Cache Size

0 commit comments

Comments
 (0)