Skip to content

Commit

Permalink
Large bugfix
Browse files Browse the repository at this point in the history
Fixed a very dangerous bug with the server password always resetting to the same thing
Removed team selection from host tab because it's easier for everyone just to do it when you get into the game
Fixed setting the server name
  • Loading branch information
HitCoder9768 committed Aug 27, 2019
1 parent c107df4 commit 6662b27
Show file tree
Hide file tree
Showing 27 changed files with 32 additions and 39 deletions.
Binary file modified bin/AboutWindow.class
Binary file not shown.
Binary file modified bin/FileInOut.class
Binary file not shown.
Binary file modified bin/LauncherWindow$23.class
Binary file not shown.
Binary file modified bin/LauncherWindow$24.class
Binary file not shown.
Binary file modified bin/LauncherWindow$25.class
Binary file not shown.
Binary file modified bin/LauncherWindow$26.class
Binary file not shown.
Binary file modified bin/LauncherWindow$27.class
Binary file not shown.
Binary file modified bin/LauncherWindow$28.class
Binary file not shown.
Binary file modified bin/LauncherWindow$29.class
Binary file not shown.
Binary file modified bin/LauncherWindow$30.class
Binary file not shown.
Binary file modified bin/LauncherWindow$31.class
Binary file not shown.
Binary file modified bin/LauncherWindow$32.class
Binary file not shown.
Binary file modified bin/LauncherWindow$33.class
Binary file not shown.
Binary file modified bin/LauncherWindow$34.class
Binary file not shown.
Binary file modified bin/LauncherWindow$35.class
Binary file not shown.
Binary file modified bin/LauncherWindow$36.class
Binary file not shown.
Binary file modified bin/LauncherWindow$37.class
Binary file not shown.
Binary file modified bin/LauncherWindow$38.class
Binary file not shown.
Binary file modified bin/LauncherWindow$39.class
Binary file not shown.
Binary file modified bin/LauncherWindow$40.class
Binary file not shown.
Binary file modified bin/LauncherWindow$41.class
Binary file not shown.
Binary file modified bin/LauncherWindow$42$1.class
Binary file not shown.
Binary file modified bin/LauncherWindow$42.class
Binary file not shown.
Binary file modified bin/LauncherWindow.class
Binary file not shown.
2 changes: 1 addition & 1 deletion src/AboutWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private void initialize() {
lblSrbCrossplatformLauncher.setBounds(10, 11, 179, 14);
frame.getContentPane().add(lblSrbCrossplatformLauncher);

JLabel lblVersion = new JLabel("Version 1.9 (revision 4)");
JLabel lblVersion = new JLabel("Version 2.0.2");
lblVersion.setBounds(10, 36, 179, 14);
frame.getContentPane().add(lblVersion);

Expand Down
8 changes: 5 additions & 3 deletions src/FileInOut.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public String getLaunchCommand(boolean setSkin, String skinName, boolean setColo
boolean isMultiplayerGame, boolean setName, String userName, boolean isHosting,
String connectTo, boolean noDownload, boolean localHost,
String serverName, boolean isDedicated, boolean useMasterServ, String roomID, boolean useAdminPassword, String adminPassword, boolean upload,
int gameTypeIndex, int teamIndex, boolean enablePointlimit, boolean enableTimeLimit, int pointLimit, int timeLimit,
int gameTypeIndex, boolean enablePointlimit, boolean enableTimeLimit, int pointLimit, int timeLimit,
boolean playerCap, int maxPlayers, boolean noWeaponRings, boolean suddenDeath, int advanceMapIndex, boolean forceSkin,
int forceSkinIndex,
boolean useLauncherPath, String workingDirectory, boolean useWine,
Expand Down Expand Up @@ -131,10 +131,12 @@ public String getLaunchCommand(boolean setSkin, String skinName, boolean setColo
if(useAdminPassword)
command+="-password "+adminPassword+" ";
command+="-gametype "+gameTypeIndex+" ";
command+="+changeteam "+teamIndex+" ";

command+="+advancemap "+advanceMapIndex+" ";

if(!serverName.isEmpty() && serverName!="" && !serverName.contains("\""))
command+="+servername \""+serverName+"\"";

if(enablePointlimit)
command+="+pointlimit "+pointLimit+" ";

Expand Down Expand Up @@ -195,7 +197,7 @@ public void saveParameters(File fileToWrite, boolean setSkin, String skinName, b
boolean isMultiplayerGame, boolean setName, String userName, boolean isHosting,
String connectTo, boolean noDownload, boolean localHost,
String serverName, boolean isDedicated, boolean useMasterServ, String roomID, boolean useAdminPassword, String adminPassword, boolean upload,
int gameTypeIndex, int teamIndex, boolean enablePointlimit, boolean enableTimeLimit, int pointLimit, int timeLimit,
int gameTypeIndex, boolean enablePointlimit, boolean enableTimeLimit, int pointLimit, int timeLimit,
boolean playerCap, int maxPlayers, boolean noWeaponRings, boolean suddenDeath, int advanceMapIndex, boolean forceSkin,
int forceSkinIndex,
boolean useLauncherPath, String workingDirectory, boolean useWine)
Expand Down
61 changes: 26 additions & 35 deletions src/LauncherWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -803,74 +803,65 @@ public void actionPerformed(ActionEvent e) {
tabGame.add(cmbGameType);
cmbGameType.setModel(new DefaultComboBoxModel<>(new String[] {"Co-op", "Competition", "Race", "Match", "Team Match", "Tag", "Hide and Seek", "Capture the Flag"}));

JLabel lblTeam = new JLabel("Team:");
lblTeam.setBounds(12, 47, 46, 14);
tabGame.add(lblTeam);

JComboBox<String> cmbTeam = new JComboBox<>();
cmbTeam.setBounds(131, 43, 278, 23);
tabGame.add(cmbTeam);
cmbTeam.setModel(new DefaultComboBoxModel<>(new String[] {"Spectator", "Red", "Blue"}));

txtTimeLimit = new JTextField();
txtTimeLimit.setBounds(131, 148, 278, 23);
txtTimeLimit.setBounds(131, 113, 278, 23);
tabGame.add(txtTimeLimit);
txtTimeLimit.setEnabled(false);
txtTimeLimit.setText("5");
txtTimeLimit.setColumns(10);

JCheckBox chckbxTimeLimit = new JCheckBox("Time limit:");
chckbxTimeLimit.setBounds(8, 148, 105, 23);
chckbxTimeLimit.setBounds(8, 113, 105, 23);
tabGame.add(chckbxTimeLimit);

JCheckBox chckbxPointLimit = new JCheckBox("Point limit:");
chckbxPointLimit.setBounds(8, 113, 105, 23);
chckbxPointLimit.setBounds(8, 78, 105, 23);
tabGame.add(chckbxPointLimit);

txtPointLimit = new JTextField();
txtPointLimit.setBounds(131, 113, 278, 23);
txtPointLimit.setBounds(131, 78, 278, 23);
tabGame.add(txtPointLimit);
txtPointLimit.setEnabled(false);
txtPointLimit.setText("1000");
txtPointLimit.setColumns(10);

JCheckBox chckbxMaxPlayers = new JCheckBox("Max players:");
chckbxMaxPlayers.setBounds(8, 183, 115, 23);
chckbxMaxPlayers.setBounds(8, 148, 115, 23);
tabGame.add(chckbxMaxPlayers);

txtMaxPlayers = new JTextField();
txtMaxPlayers.setBounds(131, 183, 278, 23);
txtMaxPlayers.setBounds(131, 148, 278, 23);
tabGame.add(txtMaxPlayers);
txtMaxPlayers.setEnabled(false);
txtMaxPlayers.setText("4");
txtMaxPlayers.setColumns(10);

JCheckBox chckbxDisableWeaponRings = new JCheckBox("Disable weapon rings");
chckbxDisableWeaponRings.setBounds(8, 218, 192, 23);
chckbxDisableWeaponRings.setBounds(8, 183, 192, 23);
tabGame.add(chckbxDisableWeaponRings);

JLabel lblAdvanceMap = new JLabel("Advance map:");
lblAdvanceMap.setBounds(12, 82, 115, 14);
lblAdvanceMap.setBounds(12, 47, 115, 14);
tabGame.add(lblAdvanceMap);

JComboBox<String> cmbAdvanceMap = new JComboBox<>();
cmbAdvanceMap.setBounds(131, 78, 278, 23);
cmbAdvanceMap.setBounds(131, 42, 278, 23);
tabGame.add(cmbAdvanceMap);
cmbAdvanceMap.setModel(new DefaultComboBoxModel<>(new String[] {"Off", "Next", "Random"}));
cmbAdvanceMap.setSelectedIndex(1);

JCheckBox chckbxSuddenDeath = new JCheckBox("Sudden death");
chckbxSuddenDeath.setBounds(204, 218, 205, 23);
chckbxSuddenDeath.setBounds(204, 183, 205, 23);
tabGame.add(chckbxSuddenDeath);

JComboBox<String> cmbForceSkin = new JComboBox<>();
cmbForceSkin.setBounds(131, 252, 278, 23);
cmbForceSkin.setBounds(131, 217, 278, 23);
tabGame.add(cmbForceSkin);
cmbForceSkin.setEnabled(false);
cmbForceSkin.setModel(new DefaultComboBoxModel<>(new String[] {"Sonic", "Tails", "Knuckles"}));

JCheckBox chckbxForceSkin = new JCheckBox("Force skin:");
chckbxForceSkin.setBounds(8, 252, 115, 23);
chckbxForceSkin.setBounds(8, 217, 115, 23);
tabGame.add(chckbxForceSkin);
chckbxForceSkin.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
Expand Down Expand Up @@ -1096,8 +1087,8 @@ public void actionPerformed(ActionEvent e) {
chckbxExecuteScript.isSelected(), txtExec.getText(), chckbxMultiplayerGame.isSelected(), lblName.isSelected(),
txtName.getText(), (tbpNetwork.getSelectedIndex()==1), txtIP.getText(), chckbxDontDownloadFiles.isSelected(), chckbxJoinMyOwn.isSelected(),
txtServerName.getText(), chckbxDedicated.isSelected(), chckbxAdvertiseOnInternet.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), txtServerPassword.getPassword().toString(), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), cmbTeam.getSelectedIndex(), chckbxPointLimit.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), new String(txtServerPassword.getPassword()), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), chckbxPointLimit.isSelected(),
chckbxTimeLimit.isSelected(), Integer.parseInt(txtPointLimit.getText()), Integer.parseInt(txtTimeLimit.getText()),
chckbxMaxPlayers.isSelected(), Integer.parseInt(txtMaxPlayers.getText()),
chckbxDisableWeaponRings.isSelected(), chckbxSuddenDeath.isSelected(), cmbAdvanceMap.getSelectedIndex(),
Expand All @@ -1121,8 +1112,8 @@ public void actionPerformed(ActionEvent e) {
chckbxExecuteScript.isSelected(), txtExec.getText(), chckbxMultiplayerGame.isSelected(), lblName.isSelected(),
txtName.getText(), (tbpNetwork.getSelectedIndex()==1), txtIP.getText(), chckbxDontDownloadFiles.isSelected(), chckbxJoinMyOwn.isSelected(),
txtServerName.getText(), chckbxDedicated.isSelected(), chckbxAdvertiseOnInternet.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), txtServerPassword.getPassword().toString(), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), cmbTeam.getSelectedIndex(), chckbxPointLimit.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), new String(txtServerPassword.getPassword()), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), chckbxPointLimit.isSelected(),
chckbxTimeLimit.isSelected(), Integer.parseInt(txtPointLimit.getText()), Integer.parseInt(txtTimeLimit.getText()),
chckbxMaxPlayers.isSelected(), Integer.parseInt(txtMaxPlayers.getText()),
chckbxDisableWeaponRings.isSelected(), chckbxSuddenDeath.isSelected(), cmbAdvanceMap.getSelectedIndex(),
Expand Down Expand Up @@ -1158,8 +1149,8 @@ public void actionPerformed(ActionEvent e) {
chckbxExecuteScript.isSelected(), txtExec.getText(), chckbxMultiplayerGame.isSelected(), lblName.isSelected(),
txtName.getText(), (tbpNetwork.getSelectedIndex()==1), txtIP.getText(), chckbxDontDownloadFiles.isSelected(), chckbxJoinMyOwn.isSelected(),
txtServerName.getText(), chckbxDedicated.isSelected(), chckbxAdvertiseOnInternet.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), txtServerPassword.getPassword().toString(), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), cmbTeam.getSelectedIndex(), chckbxPointLimit.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), new String(txtServerPassword.getPassword()), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), chckbxPointLimit.isSelected(),
chckbxTimeLimit.isSelected(), Integer.parseInt(txtPointLimit.getText()), Integer.parseInt(txtTimeLimit.getText()),
chckbxMaxPlayers.isSelected(), Integer.parseInt(txtMaxPlayers.getText()),
chckbxDisableWeaponRings.isSelected(), chckbxSuddenDeath.isSelected(), cmbAdvanceMap.getSelectedIndex(),
Expand Down Expand Up @@ -1194,8 +1185,8 @@ public void windowClosing(WindowEvent e) {
chckbxExecuteScript.isSelected(), txtExec.getText(), chckbxMultiplayerGame.isSelected(), lblName.isSelected(),
txtName.getText(), (tbpNetwork.getSelectedIndex()==1), txtIP.getText(), chckbxDontDownloadFiles.isSelected(), chckbxJoinMyOwn.isSelected(),
txtServerName.getText(), chckbxDedicated.isSelected(), chckbxAdvertiseOnInternet.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), txtServerPassword.getPassword().toString(), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), cmbTeam.getSelectedIndex(), chckbxPointLimit.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), new String(txtServerPassword.getPassword()), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), chckbxPointLimit.isSelected(),
chckbxTimeLimit.isSelected(), Integer.parseInt(txtPointLimit.getText()), Integer.parseInt(txtTimeLimit.getText()),
chckbxMaxPlayers.isSelected(), Integer.parseInt(txtMaxPlayers.getText()),
chckbxDisableWeaponRings.isSelected(), chckbxSuddenDeath.isSelected(), cmbAdvanceMap.getSelectedIndex(),
Expand Down Expand Up @@ -1243,8 +1234,8 @@ public void actionPerformed(ActionEvent arg0) {
chckbxExecuteScript.isSelected(), txtExec.getText(), chckbxMultiplayerGame.isSelected(), lblName.isSelected(),
txtName.getText(), (tbpNetwork.getSelectedIndex()==1), txtIP.getText(), chckbxDontDownloadFiles.isSelected(), chckbxJoinMyOwn.isSelected(),
txtServerName.getText(), chckbxDedicated.isSelected(), chckbxAdvertiseOnInternet.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), txtServerPassword.getPassword().toString(), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), cmbTeam.getSelectedIndex(), chckbxPointLimit.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), new String(txtServerPassword.getPassword()), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), chckbxPointLimit.isSelected(),
chckbxTimeLimit.isSelected(), Integer.parseInt(txtPointLimit.getText()), Integer.parseInt(txtTimeLimit.getText()),
chckbxMaxPlayers.isSelected(), Integer.parseInt(txtMaxPlayers.getText()),
chckbxDisableWeaponRings.isSelected(), chckbxSuddenDeath.isSelected(), cmbAdvanceMap.getSelectedIndex(),
Expand Down Expand Up @@ -1301,8 +1292,8 @@ public void actionPerformed(ActionEvent e) {
chckbxExecuteScript.isSelected(), txtExec.getText(), chckbxMultiplayerGame.isSelected(), lblName.isSelected(),
txtName.getText(), (tbpNetwork.getSelectedIndex()==1), txtIP.getText(), chckbxDontDownloadFiles.isSelected(), chckbxJoinMyOwn.isSelected(),
txtServerName.getText(), chckbxDedicated.isSelected(), chckbxAdvertiseOnInternet.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), txtServerPassword.getPassword().toString(), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), cmbTeam.getSelectedIndex(), chckbxPointLimit.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), new String(txtServerPassword.getPassword()), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), chckbxPointLimit.isSelected(),
chckbxTimeLimit.isSelected(), Integer.parseInt(txtPointLimit.getText()), Integer.parseInt(txtTimeLimit.getText()),
chckbxMaxPlayers.isSelected(), Integer.parseInt(txtMaxPlayers.getText()),
chckbxDisableWeaponRings.isSelected(), chckbxSuddenDeath.isSelected(), cmbAdvanceMap.getSelectedIndex(),
Expand Down Expand Up @@ -1364,8 +1355,8 @@ public void actionPerformed(ActionEvent arg0) {
chckbxExecuteScript.isSelected(), txtExec.getText(), chckbxMultiplayerGame.isSelected(), lblName.isSelected(),
txtName.getText(), (tbpNetwork.getSelectedIndex()==1), txtIP.getText(), chckbxDontDownloadFiles.isSelected(), chckbxJoinMyOwn.isSelected(),
txtServerName.getText(), chckbxDedicated.isSelected(), chckbxAdvertiseOnInternet.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), txtServerPassword.getPassword().toString(), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), cmbTeam.getSelectedIndex(), chckbxPointLimit.isSelected(),
txtRoomID.getText(), chckbxServerPassword.isSelected(), new String(txtServerPassword.getPassword()), chckbxAllowWadDownloading.isSelected(),
cmbGameType.getSelectedIndex(), chckbxPointLimit.isSelected(),
chckbxTimeLimit.isSelected(), Integer.parseInt(txtPointLimit.getText()), Integer.parseInt(txtTimeLimit.getText()),
chckbxMaxPlayers.isSelected(), Integer.parseInt(txtMaxPlayers.getText()),
chckbxDisableWeaponRings.isSelected(), chckbxSuddenDeath.isSelected(), cmbAdvanceMap.getSelectedIndex(),
Expand Down

0 comments on commit 6662b27

Please sign in to comment.