Skip to content

Commit

Permalink
Updated source code to serialize correctly the hashes instead of hash…
Browse files Browse the repository at this point in the history
…ing the hash object itself, causing some problems on the process
  • Loading branch information
KarmaDeb committed Sep 24, 2023
1 parent 90af199 commit bf47aea
Show file tree
Hide file tree
Showing 186 changed files with 10,778 additions and 4,973 deletions.
11 changes: 11 additions & 0 deletions .idea/aws.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

528 changes: 528 additions & 0 deletions .idea/dbnavigator.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions KarmaAPI/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"logger": {
"console": {
"prefix": [
{
"type": "NONE",
"display": "&b[&7&o{0}&r&b]&8: &f{1}"
},
{
"type": "DEBUG",
"display": "&b{&8DEBUG&b}&3 {0}&7:&f {1}"
},
{
"type": "DEBUG_SEVERE",
"display": "&b{&6DEBUG SEVERE&b}&3 {0}&7:&f {1}"
},
{
"type": "SUCCESS",
"display": "&b{&aSUCCESS&b}&3 {0}&7:&f {1}"
},
{
"type": "INFO",
"display": "&b{&7INFO&b}&3 {0}&7:&f {1}"
},
{
"type": "WARNING",
"display": "&b{&eWARNING&b}&3 {0}&7:&f {1}"
},
{
"type": "SEVERE",
"display": "&b{&cSEVERE&b}&3 {0}&7:&f {1}"
},
{
"type": "ERROR",
"display": "&b{&4ERROR&b}&3 {0}&7:&f {1}"
}
],
"print": [
"SUCCESS",
"INFO",
"WARNING",
"SEVERE",
"ERROR"
],
"async": true
},
"file": {
"async": true
}
},
"url": {
"strict": false,
"timeout": 5000
},
"experimental": false
}
27 changes: 23 additions & 4 deletions LockLoginAPI/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<artifactId>LockLoginAPI</artifactId>

<dependencies>
<!--
API interfaces shouldn't need to use those
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
Expand All @@ -21,14 +24,11 @@
<artifactId>bungeecord-api</artifactId>
</dependency>
<dependency>
<groupId>es.karmadev</groupId>
<artifactId>KarmaAPI-Core</artifactId>
</dependency>
<dependency>
<groupId>es.karmadev</groupId>
<artifactId>KarmaAPI-Spigot</artifactId>
</dependency>
-->

<dependency>
<groupId>org.projectlombok</groupId>
Expand All @@ -38,5 +38,24 @@
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</dependency>

<dependency>
<groupId>me.lucko</groupId>
<artifactId>jar-relocator</artifactId>
</dependency>

<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>es.karmadev</groupId>
<artifactId>KarmaAPI-Core</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package es.karmadev.locklogin.api;

import es.karmadev.locklogin.api.plugin.runtime.LockLoginRuntime;
import lombok.Getter;

import java.util.Collections;
import java.util.Set;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;

/**
* Current LockLogin plugin
*/
@SuppressWarnings("unused")
@SuppressWarnings({"unused"})
public final class CurrentPlugin {

@Getter
private static LockLogin plugin;
private final static Set<Consumer<LockLogin>> available_queue = Collections.newSetFromMap(new ConcurrentHashMap<>());
private final static Set<Consumer<LockLogin>> sql_available_queue = Collections.newSetFromMap(new ConcurrentHashMap<>());
Expand Down Expand Up @@ -78,15 +79,6 @@ public static void whenAvailableNoSQL(final Consumer<LockLogin> action) {
}
}

/**
* Get the LockLogin plugin
*
* @return the plugin
*/
public static LockLogin getPlugin() {
return plugin;
}

/**
* Get the plugin minimum license version
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import es.karmadev.api.file.yaml.handler.ResourceLoader;
import es.karmadev.locklogin.api.extension.ModuleConverter;
import es.karmadev.locklogin.api.extension.module.manager.ModuleManager;
import es.karmadev.locklogin.api.extension.module.ModuleManager;
import es.karmadev.locklogin.api.network.PluginNetwork;
import es.karmadev.locklogin.api.network.client.data.MultiAccountManager;
import es.karmadev.locklogin.api.network.client.offline.LocalNetworkClient;
import es.karmadev.locklogin.api.network.server.NetworkServer;
import es.karmadev.locklogin.api.network.server.ServerFactory;
import es.karmadev.locklogin.api.plugin.ServerHash;
import es.karmadev.locklogin.api.plugin.database.DataDriver;
import es.karmadev.locklogin.api.plugin.database.driver.engine.SQLDriver;
import es.karmadev.locklogin.api.plugin.file.Configuration;
import es.karmadev.locklogin.api.plugin.file.Messages;
import es.karmadev.locklogin.api.plugin.runtime.LockLoginRuntime;
Expand Down Expand Up @@ -61,7 +61,7 @@ public interface LockLogin extends ResourceLoader {
*
* @return the plugin data driver
*/
DataDriver driver();
SQLDriver driver();

/**
* Get the plugin build type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@
import es.karmadev.locklogin.api.network.client.offline.LocalNetworkClient;
import es.karmadev.locklogin.api.user.account.UserAccount;
import lombok.Getter;

import javax.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

/**
* This event is fired when an entity account is created.
* This doesn't mean the client is registered, but his account
* is ready to handle it
*/
@Getter
@SuppressWarnings("unused")
public class EntityAccountCreatedEvent extends EntityEvent {

private final static EventHandlerList HANDLER_LIST = new EventHandlerList();

@Nullable
@Getter
private final UserAccount account;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package es.karmadev.locklogin.api.event.entity.client;

import es.karmadev.locklogin.api.event.LockLoginEvent;
import es.karmadev.locklogin.api.event.entity.EntityEvent;
import es.karmadev.locklogin.api.event.handler.EventHandlerList;
import es.karmadev.locklogin.api.extension.module.Module;
import es.karmadev.locklogin.api.network.NetworkEntity;
import es.karmadev.locklogin.api.plugin.service.mail.MailMessage;

/**
* This event is exclusively fired when
* a {@link MailMessage message} is received to
* a client. Implementations must fire this event
*/
public class EntityMailReceiveEvent extends EntityEvent {

private final static EventHandlerList HANDLER_LIST = new EventHandlerList();

private final MailMessage message;

/**
* Initialize the entity event
*
* @param entity the entity
* @param message the mail message
*/
public EntityMailReceiveEvent(final NetworkEntity entity, final MailMessage message) {
this(null, entity, message);
}

/**
* Initialize the entity event
*
* @param entity the entity
* @param message the mail message
* @throws SecurityException as part of {@link LockLoginEvent#LockLoginEvent(Module)}
*/
public EntityMailReceiveEvent(final Module module, final NetworkEntity entity, final MailMessage message) throws SecurityException {
super(module, entity);
this.message = message;
}

/**
* Get the mail message
*
* @return the mail message
*/
public MailMessage getMessage() {
return message;
}

/**
* Get all the handlers for this
* event
*
* @return the event handlers
*/
public static EventHandlerList getHandlers() {
return HANDLER_LIST;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package es.karmadev.locklogin.api.event.entity.client;

import es.karmadev.locklogin.api.event.LockLoginEvent;
import es.karmadev.locklogin.api.event.entity.EntityEvent;
import es.karmadev.locklogin.api.event.handler.EventHandlerList;
import es.karmadev.locklogin.api.extension.module.Module;
import es.karmadev.locklogin.api.network.NetworkEntity;
import es.karmadev.locklogin.api.plugin.service.mail.MailMessage;

/**
* This event is exclusively fired when
* a {@link es.karmadev.locklogin.api.plugin.service.mail.MailMessage message} is sent to
* a client. Implementations must fire this event
*/
public class EntityMailSendEvent extends EntityEvent {

private final static EventHandlerList HANDLER_LIST = new EventHandlerList();

private final MailMessage message;

/**
* Initialize the entity event
*
* @param entity the entity
* @param message the mail message
*/
public EntityMailSendEvent(final NetworkEntity entity, final MailMessage message) {
this(null, entity, message);
}

/**
* Initialize the entity event
*
* @param entity the entity
* @param message the mail message
* @throws SecurityException as part of {@link LockLoginEvent#LockLoginEvent(Module)}
*/
public EntityMailSendEvent(final Module module, final NetworkEntity entity, final MailMessage message) throws SecurityException {
super(module, entity);
this.message = message;
}

/**
* Get the mail message
*
* @return the mail message
*/
public MailMessage getMessage() {
return message;
}

/**
* Get all the handlers for this
* event
*
* @return the event handlers
*/
public static EventHandlerList getHandlers() {
return HANDLER_LIST;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@
import es.karmadev.locklogin.api.network.client.offline.LocalNetworkClient;
import es.karmadev.locklogin.api.user.session.UserSession;
import lombok.Getter;

import javax.annotation.Nullable;
import org.jetbrains.annotations.Nullable;

/**
* This event is fired when an entity session is created.
* This doesn't mean the client has been logged in any method,
* but his session is ready to handle it.
*/
@Getter
@SuppressWarnings("unused")
public class EntitySessionCreatedEvent extends EntityEvent {

private final static EventHandlerList HANDLER_LIST = new EventHandlerList();

@Nullable
@Getter
private final UserSession session;

/**
Expand All @@ -43,7 +42,7 @@ public EntitySessionCreatedEvent(final LocalNetworkClient entity, final UserSess
* @param session the entity session
* @throws SecurityException as part of {@link es.karmadev.locklogin.api.event.LockLoginEvent#LockLoginEvent(Module)}
*/
public EntitySessionCreatedEvent(final Module caller, final LocalNetworkClient entity, UserSession session) throws SecurityException {
public EntitySessionCreatedEvent(final Module caller, final LocalNetworkClient entity, @Nullable UserSession session) throws SecurityException {
super(caller, entity);
this.session = session;
}
Expand Down
Loading

0 comments on commit bf47aea

Please sign in to comment.