MWClient execution logic

From MMNet Wiki
Revision as of 02:39, 7 May 2016 by Tubealloy (talk | contribs)
Jump to navigation Jump to search

1) Main method sets up logs using static methods of CampaignData which points to MWLogger ( Should we switch to a logger like log4j? )

2) Stdout and StdErr are set to /logs/megameklog.txt since megamek uses stdout and stderr ( duplicated code in MWDedHost, again should we use log4j? )

3) Args are parsed, ded is set to true if -dedicated is set, enable or disable splash is read.

4) New CConfig is created by reading

 data/mwconfig.txt or data/mwconfig.txt.bak
 serverdata.dat if present
 images including camo if not a dedicated server

5 )Splash screen is enabled or disabled and data/mechfiles/units.cache is deleted if it exists

6) The created CConfig is passed as the argument for a new MWClient

7) The MWClient either calls the MekWarsDed.jar if it's a dedicated instance or sets the look and feel if not.

8) MWClient stores a reference to the java runtime bean at rt

9) MWClient creates a new CConnector, passing itself as the argument (since it implements IClient ) and sets the splash window.

10) If not a ded the client creates the gui etc. as follows -