Skip to content

Commit

Permalink
Updated to latest KSON, fixed a problem with joining, and added cache…
Browse files Browse the repository at this point in the history
… to local client instance
  • Loading branch information
KarmaDeb committed Jan 17, 2024
1 parent bac572a commit c1fd941
Show file tree
Hide file tree
Showing 15 changed files with 328 additions and 202 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import java.util.function.Supplier;

/**
* Contains cached elements for an object
* Contains cached elements for an object.
* Please note, thread-safety depends on implementations, the
* interface itself DOES NOT provide any kind of thread
* safety, proceed with caution
*/
@SuppressWarnings("unused")
public interface CacheContainer<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ public String toString() {
* @return the serialized string
*/
public final String serialize() {
JsonObject main = JsonObject.newObject();
JsonObject result = JsonObject.newObject("product");
JsonObject main = JsonObject.newObject("", "");
JsonObject result = JsonObject.newObject("", "product");
VirtualizedInput vInput = product();

result.put("value", Base64.getEncoder().encodeToString(vInput.product()));
result.put("virtualized", vInput.valid());

JsonObject references = JsonObject.newObject("references");
JsonArray array = JsonArray.newArray("values");
JsonObject references = JsonObject.newObject("", "references");
JsonArray array = JsonArray.newArray("", "values");
int[] ref = vInput.references();

references.put("size", ref.length);
for (int i = 0; i < ref.length; i++) {
JsonObject refObject = JsonObject.newObject();
JsonObject refObject = JsonObject.newObject("", "");
refObject.put("source", i);
refObject.put("target", ref[i]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public LockLoginBungee(final BungeePlugin plugin) throws RuntimeException {
pair = generator.generateKeyPair();

PathUtilities.createPath(keyStore);
JsonObject object = JsonObject.newObject();
JsonObject object = JsonObject.newObject("", "");
object.put("public", Base64.getEncoder().encodeToString(pair.getPublic().getEncoded()));
object.put("private", Base64.getEncoder().encodeToString(pair.getPrivate().getEncoded()));

Expand Down Expand Up @@ -331,7 +331,7 @@ void installDriver() {
for (Table table : Table.values()) {
String rawName = table.name();

JsonObject tableObject = JsonObject.newObject();
JsonObject tableObject = JsonObject.newObject("", "");
if (object.hasChild(rawName) && object.getChild(rawName).isObjectType()) {
tableObject = object.getChild(rawName).asObject();
}
Expand Down Expand Up @@ -413,11 +413,11 @@ void installDriver() {
PathUtilities.write(databaseData, raw);
}
} else {
JsonObject object = JsonObject.newObject();
JsonObject object = JsonObject.newObject("", "");
for (Table table : Table.values()) {
String name = database.tableName(table);

JsonObject tableObject = JsonObject.newObject();
JsonObject tableObject = JsonObject.newObject("", "");
tableObject.put("name", name);

for (Row row : table.getUsableRows()) {
Expand Down
Loading

0 comments on commit c1fd941

Please sign in to comment.