Remove junk.

This commit is contained in:
James Quinley 2023-06-20 12:01:03 -07:00
parent d05b3e9507
commit 9d7fd0e04f
10 changed files with 8 additions and 3403 deletions

1
.idea/compiler.xml generated
View File

@ -6,6 +6,7 @@
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="MatchmakingBackend" />
<module name="AOTSK-Login-Delegation-Server" />
<module name="AotskLoginServer" />
</profile>

View File

@ -1,392 +0,0 @@
package com.jamesquinley.Asecure;
import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
public class electronicMailHandler {
/*
This will handle both account creation verify and login verify tasks, it will not verify for token based logins as
that form of login is client controlled and no user input is allowed, hacked clients are also locked out of the network
*/
static final String senderEmailId = "obsidiancorestudios@gmail.com";
static final String senderPassword = "dcixokaivbyxbmnj";
static final String emailSMTPserver = "smtp.gmail.com";
static final String emailSMTPPort = "465";
public static void Onboarding(String receiverEmail, String User, String UUID) {
//get date for email
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
String Date = formatter.format(date);
//get time for sign in time
Date dt = new Date();
SimpleDateFormat dateFormat;
dateFormat = new SimpleDateFormat("kk:mm:ss");
Properties props = new Properties();
props.put("mail.smtp.host", emailSMTPserver);
props.put("mail.smtp.socketFactory.port", emailSMTPPort);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", emailSMTPPort);
try {
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(senderEmailId));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(receiverEmail));
message.setSubject("Welcome To Obsidian Core Studios!");
message.setText("Thanks for joining our platform!\n\n" +
"Usage rules apply, account subject to moderation in accordance to our various agreements." +
"\nYou'll Only Get This Email Once." +
"\nThis Account Was Created For: " + User
+
"\nView the web dashboard here: http://obsidiancorestudios.com/login");
Transport.send(message);
System.out.println("Sent Onboarding Email");
} catch (Exception e) {
e.printStackTrace();
System.err.println("Email ONBOARD Not sent due to an error");
secureCalls.banAction(UUID);
System.out.println("Banned user due to invalid email.");
}
}
public static void Onboardingdisabled(String receiverEmail, String User) {
//get date for email
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
String Date = formatter.format(date);
//get time for sign in time
Date dt = new Date();
SimpleDateFormat dateFormat;
dateFormat = new SimpleDateFormat("kk:mm:ss");
Properties props = new Properties();
props.put("mail.smtp.host", emailSMTPserver);
props.put("mail.smtp.socketFactory.port", emailSMTPPort);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", emailSMTPPort);
try {
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(senderEmailId));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(receiverEmail));
message.setSubject("Obsidian Core Account Message");
message.setText("Hey there, account creation has been disabled.\n" +
"Due to a technical issue account creation has been disabled, see https://status.obsidiancorestudios.com for more info." +
"\nHave a good day, " + User);
Transport.send(message);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void offBoarding(String receiverEmail, String User, String Name) {
//get date for email
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
String Date = formatter.format(date);
//get time for sign in time
Date dt = new Date();
SimpleDateFormat dateFormat;
dateFormat = new SimpleDateFormat("kk:mm:ss");
Properties props = new Properties();
props.put("mail.smtp.host", emailSMTPserver);
props.put("mail.smtp.socketFactory.port", emailSMTPPort);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", emailSMTPPort);
try {
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(senderEmailId));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(receiverEmail));
message.setSubject("Sorry to see you go");
message.setText("Hey " + Name + "," +
"\n" +
"We're sorry to see you go, you probably have a pretty valid reason to do so." +
"\n" +
"As such any data we have that you submitted is being deleted, this will take around a minute." +
"\n" +
"Thank you again for using our services, have a great day." +
"\n" +
"-Obsidian Core Services Team" +
"\n" +
"This email is for, " + User + ". If this is not your account, ignore this and check who has your email.");
Transport.send(message);
System.out.println("Sent goodbye Email");
} catch (Exception e) {
e.printStackTrace();
}
}
public static void newLocation (String receiverEmail, String User, String Adr, String OldAdr) {
//get date for email
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
String Date = formatter.format(date);
//get time for sign in time
Date dt = new Date();
SimpleDateFormat dateFormat;
dateFormat = new SimpleDateFormat("kk:mm:ss");
Properties props = new Properties();
props.put("mail.smtp.host", emailSMTPserver);
props.put("mail.smtp.socketFactory.port", emailSMTPPort);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", emailSMTPPort);
try {
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(senderEmailId));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(receiverEmail));
message.setSubject("Obsidian Core Account Login Notice | " + Date);
message.setText("Something seems fishy, a login was detected at a new location " + Adr +" "+ "(at " + dateFormat.format(dt) + " PST)" + ".\nIf this was you ignore this email, if it wasn't you, please contact us (Respond to this email).\n\n\n\n" +
"\nThis email (" + receiverEmail + ") is linked to the Obsidian Core account: "+ User + " \nThese security emails can't be opted out of.\n\nThis was sent on behalf of Obsidian Core Studios by our super cool login robots.\n\n\n\n" +
"The IP address used has been set as your account's default, as well as past logins ("+Adr + ")");
Transport.send(message);
System.out.println("Alert Sent");
} catch (Exception e) {
e.printStackTrace();
System.err.println("Was Not Sent Because Of An Error.");
}
}
public static void newLink (String receiverEmail, String Platform, String User) {
//get date for email
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
String Date = formatter.format(date);
//get time for sign in time
Date dt = new Date();
SimpleDateFormat dateFormat;
dateFormat = new SimpleDateFormat("kk:mm:ss");
Properties props = new Properties();
props.put("mail.smtp.host", emailSMTPserver);
props.put("mail.smtp.socketFactory.port", emailSMTPPort);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", emailSMTPPort);
try {
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(senderEmailId));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(receiverEmail));
message.setSubject("Obsidian Core Account Linked to " + Platform + " | " + Date);
message.setText("Hello, " + User
+ "\nYou've linked your " + Platform + " account with your Obsidian Core Studios account. \n" +
"You can now use our services which we ofter there with the same account as the launcher! \n" +
"This is an automated email, please don't reply." +
"\n See the account management dashboard at https://www.obsidiancorestudios.com/account/" +
"\nYour use of our services regardless of platform are subject to our usage agreements, which can be found at https://www.obsidiancorestudios.com/legal/eula");
Transport.send(message);
System.out.println("Alert Sent");
} catch (Exception e) {
e.printStackTrace();
System.err.println("Was Not Sent Because Of An Error.");
}
}
public static void otkEmail (String receiverEmail, String Key, String User) {
//get date for email
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
String Date = formatter.format(date);
//get time for sign in time
Date dt = new Date();
SimpleDateFormat dateFormat;
dateFormat = new SimpleDateFormat("kk:mm:ss");
Properties props = new Properties();
props.put("mail.smtp.host", emailSMTPserver);
props.put("mail.smtp.socketFactory.port", emailSMTPPort);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", emailSMTPPort);
try {
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(senderEmailId));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(receiverEmail));
message.setSubject("Obsidian Core Account Notice");
message.setText("Hey there, as you may have seen in the launcher, you need a one time key to continue, this email can help! " +
"\nBefore we give you the required key to continue, a gentle reminder to NEVER SHARE YOUR PASSWORD OR ONE TIME KEY! " +
"\nWell, good luck! Your one time key is: " + Key +
"\nThis key will remain active until used, it was generated at your login attempt, and won't be regenerated after the initial creation of said key." +
"\nThis key will only work with the account tied to the username: " + User + ", and will only work one time, its in the name.");
Transport.send(message);
System.out.println("Alert Sent");
} catch (Exception e) {
e.printStackTrace();
System.err.println("Was Not Sent Because Of An Error.");
}
}
public static void otkDeletionEmail (String receiverEmail, String Key, String User) {
//get date for email
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
String Date = formatter.format(date);
//get time for sign in time
Date dt = new Date();
SimpleDateFormat dateFormat;
dateFormat = new SimpleDateFormat("kk:mm:ss");
Properties props = new Properties();
props.put("mail.smtp.host", emailSMTPserver);
props.put("mail.smtp.socketFactory.port", emailSMTPPort);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", emailSMTPPort);
try {
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(senderEmailId));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(receiverEmail));
message.setSubject("Obsidian Core Account Notice");
message.setText("Hey there, as you may have seen in the launcher, you need a one time key to delete your account, this email can help! " +
"\nBefore we give you the required key to continue, a gentle reminder to NEVER SHARE YOUR PASSWORD OR ONE TIME KEY! " +
"\nWell, good luck! Your one time key is: " + Key +
"\nThis key will remain active until used, it was generated at your login attempt, and won't be regenerated after the initial creation of said key." +
"\nThis key will only work with the account tied to the username: " + User + ", and will only work one time, its in the name." +
"\nWe're sorry to see you go.");
Transport.send(message);
System.out.println("Alert Sent");
} catch (Exception e) {
e.printStackTrace();
System.err.println("Was Not Sent Because Of An Error.");
}
}
public static void otkDeletionEmailResend (String receiverEmail, String Key, String User) {
//get date for email
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
String Date = formatter.format(date);
//get time for sign in time
Date dt = new Date();
SimpleDateFormat dateFormat;
dateFormat = new SimpleDateFormat("kk:mm:ss");
Properties props = new Properties();
props.put("mail.smtp.host", emailSMTPserver);
props.put("mail.smtp.socketFactory.port", emailSMTPPort);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", emailSMTPPort);
try {
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(senderEmailId));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(receiverEmail));
message.setSubject("Obsidian Core Account Notice");
message.setText("It seems you've tried to delete your account in the past, and clicked the button again so here's the same info." +
"\nHey there, as you may have seen in the launcher, you need a one time key to delete your account, this email can help! " +
"\nBefore we give you the required key to continue, a gentle reminder to NEVER SHARE YOUR PASSWORD OR ONE TIME KEY! " +
"\nWell, good luck! Your one time key is: " + Key +
"\nThis key will remain active until used, it was generated at your login attempt, and won't be regenerated after the initial creation of said key." +
"\nThis key will only work with the account tied to the username: " + User + ", and will only work one time, its in the name." +
"\nWe're sorry to see you go.");
Transport.send(message);
System.out.println("Alert RESent");
} catch (Exception e) {
e.printStackTrace();
System.err.println("Was Not Sent Because Of An Error.");
}
}
public static void otkMigrate (String receiverEmail, String User) {
//get date for email
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yy");
String Date = formatter.format(date);
//get time for sign in time
Date dt = new Date();
SimpleDateFormat dateFormat;
dateFormat = new SimpleDateFormat("kk:mm:ss");
Properties props = new Properties();
props.put("mail.smtp.host", emailSMTPserver);
props.put("mail.smtp.socketFactory.port", emailSMTPPort);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", emailSMTPPort);
try {
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getInstance(props, auth);
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(senderEmailId));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(receiverEmail));
message.setSubject("Obsidian Core Account Notice");
message.setText("The migration process has been completed, and the key is no longer valid.\n" +
"You will not receive a migration popup on login unless the account service changes hashes again.\n" +
"Welcome back to your account, and have a great day!\n" +
"\n\n\n\n\n" +
"This email is automated, sent to the owner of the account (" + User + ")." + " Please don't reply to this email.");
Transport.send(message);
System.out.println("Alert Sent");
} catch (Exception e) {
e.printStackTrace();
System.err.println("Was Not Sent Because Of An Error.");
}
}
private static class SMTPAuthenticator extends
javax.mail.Authenticator {
public PasswordAuthentication
getPasswordAuthentication() {
return new PasswordAuthentication(senderEmailId,
senderPassword);
}
}
}

View File

@ -1,71 +0,0 @@
package com.jamesquinley.Asecure;
import com.jamesquinley.DelegationServices.delegationServices;
public class secureCalls {
public static void locationBasedEmail (String email, String user, String adr, String oldAdr)
{
final Runnable runnable = new Runnable() {
public void run() {
electronicMailHandler.newLocation(email , user, adr, oldAdr);
}
};
runnable.run();
}
public static void banAction (String UUID)
{
final Runnable runnable = new Runnable() {
public void run() {
delegationServices.banUserID(UUID);
}
};
runnable.run();
}
public static void oneTimeKeyEmail (String email, String key, String user)
{
final Runnable runnable = new Runnable() {
public void run() {
electronicMailHandler.otkEmail(email,key,user);
}
};
runnable.run();
}
public static void accountLinked (String email, String Platform, String user)
{
final Runnable runnable = new Runnable() {
public void run() {
electronicMailHandler.newLink(email,Platform,user);
}
};
runnable.run();
}
public static void accountMigrationComplete (String email, String user)
{
final Runnable runnable = new Runnable() {
public void run() {
electronicMailHandler.otkMigrate(email, user);
}
};
runnable.run();
}
public static void accountCreationComplete (String email, String user, String UUID)
{
final Runnable runnable = new Runnable() {
public void run() {
electronicMailHandler.Onboarding(email,user,UUID);
}
};
runnable.run();
}
public static void accountCreationDisabled (String email, String user)
{
final Runnable runnable = new Runnable() {
public void run() {
electronicMailHandler.Onboardingdisabled(email,user);
}
};
runnable.run();
}
}

View File

@ -1,5 +0,0 @@
package com.jamesquinley.DelegationServices;
public class chatSessionCreator {
}

View File

@ -1,55 +0,0 @@
package com.jamesquinley.DelegationServices;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class delegationTimer {
public static void DeleteTargetRequest (int CID)
{
final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
final Runnable runnable = new Runnable() {
int countdownStarter = 5;
public void run() {
countdownStarter--;
if (countdownStarter <= 0) {
countdownStarter = 5;
delegationServices.TargetDelete(CID);
scheduler.shutdown();
}
}
};
scheduler.scheduleAtFixedRate(runnable, 0, 1, TimeUnit.SECONDS);
}
public static void DeleteTargetRequestByID (Object ID)
{
final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
final Runnable runnable = new Runnable() {
int countdownStarter = 5;
public void run() {
countdownStarter--;
if (countdownStarter <= 0) {
countdownStarter = 5;
delegationServices.TargetDeleteByID(ID);
scheduler.shutdown();
}
}
};
scheduler.scheduleAtFixedRate(runnable, 0, 1, TimeUnit.SECONDS);
}
public static void DeleteTargetRequestRID (int RID)
{
final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
final Runnable runnable = new Runnable() {
int countdownStarter = 9;
public void run() {
countdownStarter--;
if (countdownStarter <= 0) {
countdownStarter = 9;
delegationServices.TargetDeleteRID(RID);
scheduler.shutdown();
}
}
};
scheduler.scheduleAtFixedRate(runnable, 0, 1, TimeUnit.SECONDS);
}}

View File

@ -1,27 +0,0 @@
package com.jamesquinley.DelegationServices;
import com.jamesquinley.Asecure.electronicMailHandler;
import com.jamesquinley.Asecure.secureCalls;
import com.mongodb.BasicDBObject;
import static com.jamesquinley.DelegationServices.delegationServices.accountS;
public class localNet {
public static void macRead (String NewIp, String OldIp, String email, String UName, String Token)
{
if (OldIp.contains(NewIp))
{
System.out.println("User Logged In From A Known Computer, not sending email");
} else
{
System.out.println("Hey this user Logged In From A new Location, dispatching email!");
secureCalls.locationBasedEmail(email,UName,NewIp, OldIp);
System.out.println("Switching Trusted Net To New Local");
BasicDBObject searchQuery = new BasicDBObject();
searchQuery.append("Token", Token);
BasicDBObject updateQuery = new BasicDBObject();
updateQuery.append("$set", new BasicDBObject().append("lastNet", OldIp +" "+ NewIp));
accountS.updateOne(searchQuery, updateQuery);
}
}
}

View File

@ -1,6 +0,0 @@
package com.jamesquinley.DelegationServices;
public class status {
public static boolean betaServer = false;
public static String serverVersion = "1.3";
}

View File

@ -1,23 +1,21 @@
package com.jamesquinley;
import com.jamesquinley.DelegationServices.status;
/**
Hey there! This is the source code for AOTSK-Delegation Server, self-explanatory.
Also this is multi line so I can justify using this type of comment.
I/O and lobby management backend for new sandbox multiplayer game, go team (Marci and I!)
*/
public class Main {
public static void main(String[] args) throws InterruptedException {
com.jamesquinley.DelegationServices.delegationServices.connectionInit(status.betaServer);
com.jamesquinley.DelegationServices.delegationServices.connectionInit();
com.jamesquinley.DelegationServices.delegationServices.Purge();
System.out.println("We're starting the login delegation server, please wait one moment while we check a few things.");
System.out.println("We've started everything, requests are now being served");
while (true) {
isolatedTimer();
isolatedTrigger();
Thread.sleep(500);
}
}
static void isolatedTimer() {
static void isolatedTrigger() {
try {
com.jamesquinley.DelegationServices.delegationServices.userAuthetication();
} catch (Exception e) {

View File

@ -1,6 +0,0 @@
package com.jamesquinley;
public class variables {
public static String serverVersion = "5.2.3 (Prod)";
public static String serverRegion = "US West (CEN-CAL)";
}