mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-13 03:13:26 -04:00
Changed admin system
This commit is contained in:
@@ -140,9 +140,7 @@ public class LoginService implements INetworkDispatch{
|
||||
client.setPassword(pass);
|
||||
client.setSessionKey(generateSessionKey());
|
||||
client.setAccountId(id);
|
||||
//client.setAccountEmail(email);
|
||||
client.setSession(session);
|
||||
client.setGM(checkForGmPermission(id));
|
||||
|
||||
core.addClient(session, client);
|
||||
|
||||
@@ -156,9 +154,6 @@ public class LoginService implements INetworkDispatch{
|
||||
System.out.println(client.getAccountName() + " was not added to active connections map.");
|
||||
return;
|
||||
}
|
||||
/*if(!checkIfAccountExistInGameDB(id)) {
|
||||
createAccountForGameDB(id, user, email, encryptPass);
|
||||
}*/
|
||||
|
||||
persistSession(client);
|
||||
|
||||
@@ -269,29 +264,6 @@ public class LoginService implements INetworkDispatch{
|
||||
|
||||
}
|
||||
|
||||
public boolean checkForGmPermission(int id) {
|
||||
try {
|
||||
if (core.getConfig().getInt("ADMIN") > 0) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
PreparedStatement preparedStatement;
|
||||
|
||||
try {
|
||||
preparedStatement = databaseConnection1.preparedStatement("SELECT * FROM accounts WHERE id=" + id + "");
|
||||
ResultSet resultSet = preparedStatement.executeQuery();
|
||||
if(resultSet.next())
|
||||
return resultSet.getBoolean("gmflag");
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves session data to DB so Zone Server can link sessions to accounts.
|
||||
* @param client Client that needs a session save.
|
||||
|
||||
Reference in New Issue
Block a user