Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Even even more code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
BelgianDev committed Dec 14, 2023
1 parent 171e942 commit ce1290c
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build
on: [pull_request, push]
on: [ pull_request, push ]

jobs:
build:
Expand All @@ -8,7 +8,7 @@ jobs:
java: [
17,
]
os: [windows-latest]
os: [ windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
Expand Down
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
# AtlasNetwork - AtlasWorld's API ⚙️

Powerful 💪, Secured 🔐, Fast 🚀 and Integrated 🤝 system to manage AtlasWorld's services.

### Features

- 🧩 **Module System:** AtlasNetwork works with modules,
this allows changing services or adding features to the system without requiring a rewrite of AtlasNetwork's code.
AtlasNetwork works with two different modules types, Drivers and Plugins.
- **Drivers:** AtlasNetwork's uses abstraction for some parts of the system,
drivers implements these abstractions and makes them work with the defined service.
AtlasNetwork may **require** some drivers to work properly.
- **Plugins:** Plugin adds features to the system, these are **optional** modules.
- 🧩 **Module System:** AtlasNetwork works with modules,
this allows changing services or adding features to the system without requiring a rewrite of AtlasNetwork's code.
AtlasNetwork works with two different modules types, Drivers and Plugins.
- **Drivers:** AtlasNetwork's uses abstraction for some parts of the system,
drivers implements these abstractions and makes them work with the defined service.
AtlasNetwork may **require** some drivers to work properly.
- **Plugins:** Plugin adds features to the system, these are **optional** modules.

- ⚙️ **Network API:** IO Socket API, for a fast and optimized data transfer.
Used to sync and notify data to AtlasWorld's services
- ⚙️ **Network API:** IO Socket API, for a fast and optimized data transfer.
Used to sync and notify data to AtlasWorld's services
- 🛡️ **No-Client-Trust:** Clients are never trusted, even if it's one of AtlasWorld's services. Security Measure
- 🧠 **Smart Server System:** AtlasNetwork creates, deletes and stops servers to optimize resources usage on the whole network.
- 🔗 **Private & Public HTTP API:** AtlasNetwork provides an HTTP api to access data on the network,
Can be privately used when the environment does not offer a way to connect to AtlasNetwork's IO socket.
- 🧠 **Smart Server System:** AtlasNetwork creates, deletes and stops servers to optimize resources usage on the whole
network.
- 🔗 **Private & Public HTTP API:** AtlasNetwork provides an HTTP api to access data on the network,
Can be privately used when the environment does not offer a way to connect to AtlasNetwork's IO socket.

### Module Api Usage

**Add this to your build.gradle file:**

````groovy
repositories {
maven {
Expand All @@ -35,7 +39,9 @@ dependencies {
compileOnly "fr.atlasworld:network-module-api:${module_api_version}"
}
````

**Now define your module's information here in `src/main/resource/module.json`:**

````json5
{
"name": "My Module", // Required
Expand All @@ -47,7 +53,9 @@ dependencies {
"mainClass": "com.example.module.MyModule" // Required
}
````

**Main Class:**

````java
package com.example.module;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public PacketExecutionException(String clientFeedback, String packetIdentifier)
public PacketExecutionException(String message, String clientFeedback, String packetIdentifier) {
super(message, clientFeedback, packetIdentifier);
}

public PacketExecutionException(String message, Throwable cause, String clientFeedback, String packetIdentifier) {
super(message, cause, clientFeedback, packetIdentifier);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface NetworkPacket {
* Decodes and process received requests.
*
* @param source source from which we received a packet.
* @param buffer received buffer.
* @param buffer received buffer.
*/
void decode(@NotNull ConnectionSource source, @NotNull PacketByteBuf buffer) throws PacketExecutionException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public final class RegistryObject<T> implements Supplier<T> {

private final @NotNull ResourceKey valueKey;
private @Nullable T value;

private RegistryObject(@NotNull ResourceKey valueKey, @Nullable T value) {
this.valueKey = valueKey;
this.value = value;
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ shadowJar {

tasks.withType(ProcessResources).configureEach {
var properties = [
version : project_version,
commit : grgit.head().id,
branch : grgit.branch.current().name,
build_time : new Date().time,
protocol_version : protocol_version
version : project_version,
commit : grgit.head().id,
branch : grgit.branch.current().name,
build_time : new Date().time,
protocol_version: protocol_version
]

inputs.properties properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class SystemGroupClassLoader extends ClassLoader implements GroupClassLoa
private final ClassLoader rootClassLoader; // Root Class Loader
private final Map<Module, ModuleClassLoader> moduleLoaders; // Modules Class Loaders
private final Map<Module, List<ClassLoader>> externalLoaders; // External loaders

private SystemGroupClassLoader(ClassLoader rootClassLoader) {
this.rootClassLoader = rootClassLoader;
this.moduleLoaders = new ConcurrentHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import fr.atlasworld.network.api.networking.ConnectionSource;
import fr.atlasworld.network.api.networking.exception.NetworkingException;
import fr.atlasworld.network.api.networking.exception.packet.PacketExecutionException;
import fr.atlasworld.network.api.networking.packet.NetworkPacket;
import fr.atlasworld.network.api.networking.packet.PacketByteBuf;
import fr.atlasworld.network.core.logging.LogUtils;
Expand Down

0 comments on commit ce1290c

Please sign in to comment.