Code style changes.
This commit is contained in:
@ -55,7 +55,7 @@ public class SQLAccountManager
|
||||
System.out.println("3 - Delete existing account");
|
||||
System.out.println("4 - List accounts and access levels");
|
||||
System.out.println("5 - Exit");
|
||||
while (!(_mode.equals("1") || _mode.equals("2") || _mode.equals("3") || _mode.equals("4") || _mode.equals("5")))
|
||||
while (!_mode.equals("1") && !_mode.equals("2") && !_mode.equals("3") && !_mode.equals("4") && !_mode.equals("5"))
|
||||
{
|
||||
System.out.print("Your choice: ");
|
||||
_mode = _scn.next();
|
||||
@ -126,7 +126,7 @@ public class SQLAccountManager
|
||||
System.out.println("2 - GM/privileged accounts (accessLevel > 0");
|
||||
System.out.println("3 - Regular accounts only (accessLevel = 0)");
|
||||
System.out.println("4 - List all");
|
||||
while (!(_mode.equals("1") || _mode.equals("2") || _mode.equals("3") || _mode.equals("4")))
|
||||
while (!_mode.equals("1") && !_mode.equals("2") && !_mode.equals("3") && !_mode.equals("4"))
|
||||
{
|
||||
System.out.print("Your choice: ");
|
||||
_mode = _scn.next();
|
||||
|
@ -23,19 +23,19 @@ import java.sql.Connection;
|
||||
*/
|
||||
public interface DBOutputInterface
|
||||
{
|
||||
public void setProgressIndeterminate(boolean value);
|
||||
void setProgressIndeterminate(boolean value);
|
||||
|
||||
public void setProgressMaximum(int maxValue);
|
||||
void setProgressMaximum(int maxValue);
|
||||
|
||||
public void setProgressValue(int value);
|
||||
void setProgressValue(int value);
|
||||
|
||||
public void setFrameVisible(boolean value);
|
||||
void setFrameVisible(boolean value);
|
||||
|
||||
public void appendToProgressArea(String text);
|
||||
void appendToProgressArea(String text);
|
||||
|
||||
public Connection getConnection();
|
||||
Connection getConnection();
|
||||
|
||||
public int requestConfirm(String title, String message, int type);
|
||||
int requestConfirm(String title, String message, int type);
|
||||
|
||||
public void showMessage(String title, String message, int type);
|
||||
void showMessage(String title, String message, int type);
|
||||
}
|
||||
|
@ -174,13 +174,13 @@ public class DBDumper
|
||||
fws.print(", ");
|
||||
}
|
||||
|
||||
if (dset.getString(i) == null)
|
||||
if (dset.getString(i) != null)
|
||||
{
|
||||
fws.print("NULL");
|
||||
fws.print("'" + dset.getString(i).replace("\'", "\\\'") + "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
fws.print("'" + dset.getString(i).replace("\'", "\\\'") + "'");
|
||||
fws.print("NULL");
|
||||
}
|
||||
isInFirst = false;
|
||||
}
|
||||
|
@ -116,13 +116,10 @@ public class SpringUtilities
|
||||
lastRowCons = lastCons;
|
||||
cons.setX(initialXSpring);
|
||||
}
|
||||
else
|
||||
// x position depends on previous component
|
||||
else if (lastCons != null)
|
||||
{
|
||||
// x position depends on previous component
|
||||
if (lastCons != null)
|
||||
{
|
||||
cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST), xPadSpring));
|
||||
}
|
||||
cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST), xPadSpring));
|
||||
}
|
||||
|
||||
if ((i / cols) == 0)
|
||||
@ -130,13 +127,10 @@ public class SpringUtilities
|
||||
// first row
|
||||
cons.setY(initialYSpring);
|
||||
}
|
||||
else
|
||||
// y position depends on previous row
|
||||
else if (lastRowCons != null)
|
||||
{
|
||||
// y position depends on previous row
|
||||
if (lastRowCons != null)
|
||||
{
|
||||
cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH), yPadSpring));
|
||||
}
|
||||
cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH), yPadSpring));
|
||||
}
|
||||
lastCons = cons;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
System.out.print("| ");
|
||||
|
||||
inUse = GameServerTable.getInstance().hasRegisteredGameServerOnId(e.getKey());
|
||||
final String inUseStr = (inUse ? gsInUse : gsFree);
|
||||
final String inUseStr = inUse ? gsInUse : gsFree;
|
||||
System.out.print(inUseStr);
|
||||
|
||||
for (int i = inUseStr.length(); i < gsStatusMaxLen; i++)
|
||||
@ -258,25 +258,22 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
{
|
||||
System.out.printf("No name for ID: %d" + Config.EOL, id);
|
||||
}
|
||||
else if (GameServerTable.getInstance().hasRegisteredGameServerOnId(id))
|
||||
{
|
||||
System.out.printf("Are you sure you want to remove GameServer %d - %s?" + Config.EOL, id, name);
|
||||
try
|
||||
{
|
||||
BaseGameServerRegister.unregisterGameServer(id);
|
||||
System.out.printf("GameServer ID: %d was successfully removed from LoginServer." + Config.EOL, id);
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
showError("An SQL error occurred while trying to remove the GameServer.", e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameServerTable.getInstance().hasRegisteredGameServerOnId(id))
|
||||
{
|
||||
System.out.printf("Are you sure you want to remove GameServer %d - %s?" + Config.EOL, id, name);
|
||||
try
|
||||
{
|
||||
BaseGameServerRegister.unregisterGameServer(id);
|
||||
System.out.printf("GameServer ID: %d was successfully removed from LoginServer." + Config.EOL, id);
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
showError("An SQL error occurred while trying to remove the GameServer.", e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.printf("No GameServer is registered on ID: %d" + Config.EOL, id);
|
||||
}
|
||||
System.out.printf("No GameServer is registered on ID: %d" + Config.EOL, id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -304,22 +301,19 @@ public class GameServerRegister extends BaseGameServerRegister
|
||||
{
|
||||
System.out.printf("No name for ID: %d" + Config.EOL, id);
|
||||
}
|
||||
else if (GameServerTable.getInstance().hasRegisteredGameServerOnId(id))
|
||||
{
|
||||
System.out.println("This ID is not available.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameServerTable.getInstance().hasRegisteredGameServerOnId(id))
|
||||
try
|
||||
{
|
||||
System.out.println("This ID is not available.");
|
||||
BaseGameServerRegister.registerGameServer(id, ".");
|
||||
}
|
||||
else
|
||||
catch (IOException e)
|
||||
{
|
||||
try
|
||||
{
|
||||
BaseGameServerRegister.registerGameServer(id, ".");
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
showError("An error saving the hexid file occurred while trying to register the GameServer.", e);
|
||||
}
|
||||
showError("An error saving the hexid file occurred while trying to register the GameServer.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user