Tells the truth.
This commit is contained in:
parent
0637de4866
commit
675c315f2b
2
pom.xml
2
pom.xml
@ -149,7 +149,7 @@
|
||||
<addClasspath>true</addClasspath>
|
||||
<!-- Specifies that all dependencies of our application are found -->
|
||||
<!-- Configures the main class of the application -->
|
||||
<mainClass>com.jamesquinley.init</mainClass>
|
||||
<mainClass>com.jamesquinley.Main</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
|
@ -15,15 +15,10 @@ import org.bson.Document;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import static com.jamesquinley.Asecure.electronicMailHandler.*;
|
||||
import static com.jamesquinley.Asecure.secureCalls.accountMigrationComplete;
|
||||
@ -38,11 +33,10 @@ public class delegationServices {
|
||||
static MongoCollection<Document> dCollection;
|
||||
static MongoDatabase RGFilterDB;
|
||||
static MongoCollection<Document> RGFilter;
|
||||
public static void connectionInit (Boolean beta)
|
||||
{
|
||||
|
||||
public static void connectionInit(Boolean beta) {
|
||||
//TODO Send Server Version As Standard.
|
||||
if (beta == true)
|
||||
{
|
||||
if (beta == true) {
|
||||
scReadconnectionString = new ConnectionString("mongodb+srv://serverClientBeta:Unz6c3I0wjrUVBIf@delegationrequest.qnvfa.mongodb.net/mDelegationRequest?retryWrites=true&w=majority");
|
||||
//connects to database that beta clients can use.
|
||||
System.out.println("This is a beta server build (and will only work on that type)");
|
||||
@ -57,8 +51,7 @@ public class delegationServices {
|
||||
dCollection = dClientDatabase.getCollection("accountRequestBeta");
|
||||
RGFilterDB = dClient.getDatabase("rgcon");
|
||||
RGFilter = RGFilterDB.getCollection("blocked");
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
scReadconnectionString = new ConnectionString("mongodb+srv://serverClient:x2sJ8Qu0VVMifNLX@accountdelegation.n06hb.mongodb.net/DelegationRequest?retryWrites=true&w=majority");
|
||||
//connects to database that production clients can use
|
||||
System.out.println("This is a production server build (and will only work on that type)");
|
||||
@ -75,6 +68,7 @@ public class delegationServices {
|
||||
RGFilter = RGFilterDB.getCollection("blocked");
|
||||
}
|
||||
}
|
||||
|
||||
//TODO get switcher working, NPE currently triggers on post init, move below code block into if statement, or outside of it so it will do the same thing regardless of t/f switch output
|
||||
static ConnectionString AccountCon = new ConnectionString("mongodb+srv://DelegationServerClient:UNxldb8abSJkWscG@account.ufgrh.mongodb.net/account?retryWrites=true&w=majority");
|
||||
static MongoClientSettings AccountSettings = MongoClientSettings.builder()
|
||||
@ -92,8 +86,7 @@ public class delegationServices {
|
||||
public static String lastNet = null;
|
||||
public static String Macid = null;
|
||||
|
||||
public static void banUserID(String UUID)
|
||||
{
|
||||
public static void banUserID(String UUID) {
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("UUID", UUID);
|
||||
BasicDBObject updateQuery2 = new BasicDBObject();
|
||||
@ -106,8 +99,7 @@ public class delegationServices {
|
||||
Document Filter;
|
||||
int ClientID = 0;
|
||||
Document Lrequest = dCollection.find(eq("status", false)).first();
|
||||
if ((boolean) Lrequest.get("status") == true)
|
||||
{
|
||||
if ((boolean) Lrequest.get("status") == true) {
|
||||
|
||||
|
||||
System.out.println("This request was completed, ignoring");
|
||||
@ -130,10 +122,8 @@ public class delegationServices {
|
||||
String RG = (String) Lrequest.get("rg");
|
||||
Filter = RGFilter.find(eq("rgkey", "UAROCKS")).first();
|
||||
String blockedRG = (String) Filter.get("rgflag");
|
||||
if ((Boolean)Filter.get("serviceState") == false)
|
||||
{
|
||||
if ((Boolean)Filter.get("serviceTermination") == true)
|
||||
{
|
||||
if ((Boolean) Filter.get("serviceState") == false) {
|
||||
if ((Boolean) Filter.get("serviceTermination") == true) {
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("rid", Lrequest.get("rid"));
|
||||
|
||||
@ -150,8 +140,7 @@ public class delegationServices {
|
||||
dCollection.updateOne(searchQuery, updateQuery2);
|
||||
dCollection.updateOne(searchQuery, updateQuery1);
|
||||
delegationTimer.DeleteTargetRequest(ClientID);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("rid", Lrequest.get("rid"));
|
||||
|
||||
@ -481,8 +470,7 @@ public class delegationServices {
|
||||
if (accountServer.get("Version").equals("1")) {
|
||||
try {
|
||||
accountKeyStatus = accountServer.getBoolean("keyStatus");
|
||||
} catch (Exception NPE)
|
||||
{
|
||||
} catch (Exception NPE) {
|
||||
System.out.println("Assuming False Due To Variable Not Existing For User.");
|
||||
accountKeyStatus = false;
|
||||
}
|
||||
@ -536,9 +524,7 @@ public class delegationServices {
|
||||
delegationTimer.DeleteTargetRequest(ClientID);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
System.out.println("RSC");
|
||||
if (Password.equals(password)) {
|
||||
System.out.println("R3c");
|
||||
@ -650,10 +636,8 @@ public class delegationServices {
|
||||
try {
|
||||
accountServer = accountS.find(eq("tempKey", userKey)).first();
|
||||
serverUserName = (String) accountServer.get("User");
|
||||
if (accountServer.get("Status").equals(true))
|
||||
{
|
||||
if (userName.equalsIgnoreCase(serverUserName))
|
||||
{
|
||||
if (accountServer.get("Status").equals(true)) {
|
||||
if (userName.equalsIgnoreCase(serverUserName)) {
|
||||
System.out.println("This key is correct.");
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("clientid", ClientID);
|
||||
@ -669,9 +653,7 @@ public class delegationServices {
|
||||
//delegationTimer.trigger();
|
||||
delegationTimer.DeleteTargetRequest(ClientID);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
System.out.println("This key is incorrect");
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("clientid", ClientID);
|
||||
@ -705,8 +687,7 @@ public class delegationServices {
|
||||
}
|
||||
|
||||
}
|
||||
if (requesttype == 57)
|
||||
{
|
||||
if (requesttype == 57) {
|
||||
System.out.println("Verifying email with account tied to OTK");
|
||||
try {
|
||||
String userKey = (String) Lrequest.get("otk");
|
||||
@ -763,9 +744,7 @@ public class delegationServices {
|
||||
delegationTimer.DeleteTargetRequest(ClientID);
|
||||
System.out.println("request finished correctly");
|
||||
accountMigrationComplete(serverEmail, userName);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
System.out.println("request denied");
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("clientid", ClientID);
|
||||
@ -917,8 +896,7 @@ public class delegationServices {
|
||||
}
|
||||
}
|
||||
if (requesttype == 18) {
|
||||
if ((Boolean)Filter.get("gameActive") == true)
|
||||
{
|
||||
if ((Boolean) Filter.get("gameActive") == true) {
|
||||
//Deprecated, a killswitch has been added under rgcon in the field "gameActive"
|
||||
//TOKEN LOGIN FOR GAME, DOES NOT SEND EMAIL, LAUNCHER WILL NOT USE THIS.
|
||||
System.out.println("Game Login");
|
||||
@ -1050,9 +1028,7 @@ public class delegationServices {
|
||||
delegationTimer.DeleteTargetRequest(ClientID);
|
||||
//delegationTimer.trigger();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
System.out.println("Login rejected, game client EOS has been reached.");
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("clientid", ClientID);
|
||||
@ -1382,25 +1358,20 @@ public class delegationServices {
|
||||
//delegationTimer.trigger();
|
||||
}
|
||||
}
|
||||
if (requesttype == 14)
|
||||
{
|
||||
if (requesttype == 14) {
|
||||
//TODO Finish making a secure deletion process.
|
||||
String requestClientUUID = (String) Lrequest.get("UUID");
|
||||
String requestClientToken = (String) Lrequest.get("token");
|
||||
String requestClientMAC = (String) Lrequest.get("mac");
|
||||
}
|
||||
if (requesttype == 61)
|
||||
{
|
||||
if (requesttype == 61) {
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("clientid", ClientID);
|
||||
System.out.println("Init ClientTraceback");
|
||||
String policyDocument;
|
||||
try
|
||||
{
|
||||
try {
|
||||
policyDocument = Files.readString(Path.of(System.getProperty("user.home") + "/ocs/policy/launcher/legal/eula.txt"));
|
||||
}
|
||||
catch (Exception EXR)
|
||||
{
|
||||
} catch (Exception EXR) {
|
||||
System.out.println("Unable to pull file, fallback.");
|
||||
policyDocument = "Policy file does not exist on server. This is an issue on our end. Error ID: " + EXR;
|
||||
}
|
||||
@ -1419,19 +1390,15 @@ public class delegationServices {
|
||||
dCollection.updateOne(searchQuery, updateQuery3);
|
||||
delegationTimer.DeleteTargetRequest(ClientID);
|
||||
}
|
||||
if (requesttype == 63)
|
||||
{
|
||||
if (requesttype == 63) {
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("clientid", ClientID);
|
||||
System.out.println("Init ClientTraceback");
|
||||
String policyDocument;
|
||||
try
|
||||
{
|
||||
try {
|
||||
// File homedir = new File(System.getProperty("user.home"));
|
||||
policyDocument = Files.readString(Path.of(System.getProperty("user.home") + "/ocs/policy/launcher/legal/eula.txt"));
|
||||
}
|
||||
catch (Exception EXR)
|
||||
{
|
||||
} catch (Exception EXR) {
|
||||
System.out.println("Unable to pull file, fallback.");
|
||||
policyDocument = "Policy file does not exist on server. This is an issue on our end. Error ID: " + EXR;
|
||||
}
|
||||
@ -1450,8 +1417,7 @@ public class delegationServices {
|
||||
dCollection.updateOne(searchQuery, updateQuery3);
|
||||
delegationTimer.DeleteTargetRequest(ClientID);
|
||||
}
|
||||
if (requesttype == 65)
|
||||
{
|
||||
if (requesttype == 65) {
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("clientid", ClientID);
|
||||
System.out.println("Collecting Error Data");
|
||||
@ -1491,8 +1457,7 @@ public class delegationServices {
|
||||
dCollection.updateOne(searchQuery, updateQuery);
|
||||
delegationServices.TargetDelete(ClientID);
|
||||
}
|
||||
if (requesttype == 66)
|
||||
{
|
||||
if (requesttype == 66) {
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("clientid", ClientID);
|
||||
System.out.println("Collecting Error Data");
|
||||
@ -1546,10 +1511,8 @@ public class delegationServices {
|
||||
try {
|
||||
accountServer = accountS.find(eq("delOTK", userKey)).first();
|
||||
serverUUID = (String) accountServer.get("UUID");
|
||||
if (accountServer.get("Status").equals(true))
|
||||
{
|
||||
if (clientUUID.equalsIgnoreCase(serverUUID))
|
||||
{
|
||||
if (accountServer.get("Status").equals(true)) {
|
||||
if (clientUUID.equalsIgnoreCase(serverUUID)) {
|
||||
System.out.println("This key is correct.");
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("clientid", ClientID);
|
||||
@ -1566,9 +1529,7 @@ public class delegationServices {
|
||||
offBoarding((String) accountServer.get("Email"), (String) accountServer.get("User"), (String) accountServer.get("FName"));
|
||||
delegationTimer.DeleteTargetRequest(ClientID);
|
||||
accountS.deleteOne(accountServer);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
System.out.println("This key is incorrect");
|
||||
BasicDBObject searchQuery = new BasicDBObject();
|
||||
searchQuery.append("clientid", ClientID);
|
||||
@ -1602,8 +1563,7 @@ public class delegationServices {
|
||||
}
|
||||
|
||||
}
|
||||
if (requesttype == 67)
|
||||
{
|
||||
if (requesttype == 67) {
|
||||
String OTK = "keyNotSetDueToError(ERR24)";
|
||||
Boolean keyStatus = false;
|
||||
//default false, since will be set to true if the mesurement exists on linked account
|
||||
@ -1611,12 +1571,10 @@ public class delegationServices {
|
||||
Document linkedAccount = accountS.find(eq("UUID", accountUUID)).first();
|
||||
try {
|
||||
keyStatus = (boolean) linkedAccount.get("delStatus");
|
||||
} catch (Exception NPE)
|
||||
{
|
||||
} catch (Exception NPE) {
|
||||
keyStatus = false;
|
||||
}
|
||||
if (keyStatus == false)
|
||||
{
|
||||
if (keyStatus == false) {
|
||||
String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Random random = new Random();
|
||||
@ -1638,9 +1596,7 @@ public class delegationServices {
|
||||
accountS.updateOne(deleteTie, deleteKey);
|
||||
accountS.updateOne(deleteTie, deleteKeyStatus);
|
||||
otkDeletionEmail((String) linkedAccount.get("Email"), OTK, (String) linkedAccount.get("User"));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
otkDeletionEmailResend((String) linkedAccount.get("Email"), (String) linkedAccount.get("delOTK"), (String) linkedAccount.get("User"));
|
||||
}
|
||||
BasicDBObject clearCL = new BasicDBObject();
|
||||
@ -1698,11 +1654,11 @@ public class delegationServices {
|
||||
}
|
||||
|
||||
|
||||
|
||||
//above is finding one request and starting wheels
|
||||
//delegationTimer.trigger();
|
||||
delegate();
|
||||
}
|
||||
|
||||
public static void Purge() {
|
||||
BasicDBObject searchQueryT = new BasicDBObject();
|
||||
BasicDBObject searchQueryF = new BasicDBObject();
|
||||
@ -1729,15 +1685,18 @@ public class delegationServices {
|
||||
System.out.println("Flushed a targeted request (RID) from the server");
|
||||
|
||||
|
||||
} public static void delegate ()
|
||||
{
|
||||
}
|
||||
|
||||
public static void delegate() {
|
||||
userAuthetication();
|
||||
}
|
||||
|
||||
public static void userAuthetication() {
|
||||
try {
|
||||
delegationProcesser();
|
||||
} catch (Exception exr) {
|
||||
delegationTimer.trigger();
|
||||
//Shit is so janky, I tell it not to crash when it wants to crash
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import com.jamesquinley.DelegationServices.status;
|
||||
Hey there! This is the source code for AOTSK-Delegation Server, self explanitory.
|
||||
Also this is multi line so I can justify using this type of comment.
|
||||
*/
|
||||
public class init
|
||||
public class Main
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
@ -1,3 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: com.jamesquinley.init
|
||||
Main-Class: com.jamesquinley.Main
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user