MCPcopy Create free account
hub / github.com/Card-Forge/forge / main

Method main

forge-gui-desktop/src/main/java/forge/view/Main.java:35–94  ·  view source on GitHub ↗

Main entry point for Forge

(final String[] args)

Source from the content-addressed store, hash-verified

33 * Main entry point for Forge
34 */
35 public static void main(final String[] args) {
36 Sentry.init(options -> {
37 options.setEnableExternalConfiguration(true);
38 options.setRelease(BuildInfo.getVersionString());
39 options.setEnvironment(System.getProperty("os.name"));
40 options.setTag("Java Version", System.getProperty("java.version"));
41 options.setShutdownTimeoutMillis(5000);
42 // these belong to sentry.properties, but somehow some OS/Zip tool discards it?
43 if (options.getDsn() == null || options.getDsn().isEmpty())
44 options.setDsn("https://87bc8d329e49441895502737c069067b@sentry.asgardsrealm.net//3");
45 }, true);
46
47 // HACK - temporary solution to "Comparison method violates it's general contract!" crash
48 System.setProperty("java.util.Arrays.useLegacyMergeSort", "true");
49
50 //Turn off the Java 2D system's use of Direct3D to improve rendering speed (particularly when Full Screen)
51 System.setProperty("sun.java2d.d3d", "false");
52
53 //Turn on OpenGl acceleration to improve performance
54 //System.setProperty("sun.java2d.opengl", "True");
55
56 //setup GUI interface
57 GuiBase.setInterface(new GuiDesktop());
58
59 //install our error handler
60 ExceptionHandler.registerErrorHandling();
61 GuiBase.logHWInfo();
62
63 // Start splash screen first, then data models, then controller.
64 if (args.length == 0) {
65 Singletons.initializeOnce(true);
66
67 // Controller can now step in and take over.
68 Singletons.getControl().initialize();
69 return;
70 }
71
72 // command line startup here
73 String mode = args[0].toLowerCase();
74
75 switch (mode) {
76 case "sim":
77 SimulateMatch.simulate(args);
78 break;
79
80 case "parse":
81 CardReaderExperiments.parseAllCards(args);
82 break;
83
84 case "server":
85 System.out.println("Dedicated server mode.\nNot implemented.");
86 break;
87
88 default:
89 System.out.println("Unknown mode.\nKnown mode is 'sim', 'parse' ");
90 break;
91 }
92

Callers

nothing calls this directly

Calls 13

getVersionStringMethod · 0.95
setInterfaceMethod · 0.95
registerErrorHandlingMethod · 0.95
logHWInfoMethod · 0.95
initializeOnceMethod · 0.95
getControlMethod · 0.95
simulateMethod · 0.95
parseAllCardsMethod · 0.95
isEmptyMethod · 0.65
initializeMethod · 0.65
exitMethod · 0.65
initMethod · 0.45

Tested by

no test coverage detected