diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml
new file mode 100644
index 000000000..67133c86d
--- /dev/null
+++ b/.github/workflows/gradle-build.yml
@@ -0,0 +1,73 @@
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
+# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
+
+name: Build and Publish
+
+on:
+ #schedule:
+ # - cron: '37 7 * * *'
+ push:
+ branches: [ "dev/2.0", "master" ]
+ # Publish semver tags as releases.
+ #tags: [ 'v*.*.*' ]
+ #pull_request:
+ # branches: [ "development", "master" ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up JDK 8
+ uses: actions/setup-java@v3
+ with:
+ java-version: '8'
+ distribution: 'temurin'
+
+ - name: Build with Gradle
+ uses: gradle/gradle-build-action@v2
+ with:
+ arguments: shadowJar
+
+ - name: Copy files
+ run: |
+ mkdir -p temp
+ mkdir temp/modules/
+ mkdir temp/storage/
+ mkdir temp/storage/pluginJars/
+ cp start-files/*.* temp/
+ cp simplecloud-modules/**/build/libs/SimpleCloud-*.jar temp/modules/
+ cp simplecloud-runner/build/libs/runner.jar temp/runner.jar
+ cp simplecloud-base/build/libs/base.jar temp/storage/base.jar
+ cp simplecloud-plugin/build/libs/*.jar temp/storage/pluginJars/
+ cp simplecloud-dependency-loader/build/libs/dependency-loader.jar temp/storage/dependency-loader.jar
+ cp simplecloud-launcher/build/libs/launcher.jar temp/launcher.jar
+ rm temp/modules/SimpleCloud-Chat+Tab.jar
+ rm temp/modules/SimpleCloud-ServiceSelection.jar
+ rm temp/modules/SimpleCloud-CloudFlare.jar
+
+ - name: Upload zip
+ uses: actions/upload-artifact@v3
+ with:
+ name: SimpleCloud-Latest
+ path: temp/
+
+ # The USERNAME and TOKEN need to correspond to the credentials environment variables used in
+ # the publishing section of your build.gradle
+ - name: Publish
+ uses: gradle/gradle-build-action@v2
+ with:
+ arguments: publish
+ env:
+ MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
+ MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
+
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..93526bc00
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,79 @@
+##########################
+## Java
+##########################
+*.class
+.mtj.tmp/
+*.jar
+*.war
+*.ear
+hs_err_pid*
+
+##########################
+## Maven
+##########################
+target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
+
+##########################
+## Gradle
+##########################
+.gradle
+/build/
+gradle-app.setting
+!gradle-wrapper.jar
+.gradletasknamecache
+
+##########################
+## IntelliJ
+##########################
+*.iml
+.idea/
+*.ipr
+*.iws
+out/
+.idea_modules/
+
+##########################
+## Eclipse
+##########################
+.metadata
+.classpath
+.project
+.settings/
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.loadpath
+
+##########################
+## NetBeans
+##########################
+nbproject/private/
+build/
+nbbuild/
+dist/
+nbdist/
+nbactions.xml
+nb-configuration.xml
+
+##########################
+## OS X
+##########################
+.DS_Store
+
+##########################
+## SimpleCloud
+##########################
+logs/
+launcher.json
+storage/
+local-repo/
+modules/
\ No newline at end of file
diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 000000000..6b1b9ffe2
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,58 @@
+pipeline {
+ agent any
+ options {
+ buildDiscarder logRotator(numToKeepStr: '10')
+ }
+ stages {
+ stage('Clean') {
+ steps {
+ sh 'chmod +x ./gradlew';
+ sh './gradlew clean';
+ }
+ }
+ stage('Build') {
+ steps {
+ sh './gradlew build';
+ }
+ }
+ stage('Test') {
+ steps {
+ sh './gradlew test';
+ junit '**/build/test-results/test/*.xml';
+ }
+ }
+ stage('Create zip') {
+ steps {
+ sh 'rm -f SimpleCloud-Latest.zip';
+ sh 'mkdir -p temp'
+ sh 'mkdir temp/modules/'
+ sh 'mkdir temp/storage/'
+ sh 'cp start-files/*.* temp/';
+ sh 'cp simplecloud-modules/**/build/libs/*.jar temp/modules/';
+ sh 'cp simplecloud-runner/build/libs/runner.jar temp/runner.jar';
+ sh 'cp simplecloud-base/build/libs/base.jar temp/storage/base.jar';
+ sh 'rm temp/modules/SimpleCloud-Chat+Tab.jar';
+ sh 'rm temp/modules/SimpleCloud-ServiceSelection.jar';
+ sh 'rm temp/modules/SimpleCloud-CloudFlare.jar';
+ zip archive: true, dir: 'temp', glob: '', zipFile: 'SimpleCloud-Latest.zip';
+ sh 'rm -r temp/';
+ }
+ }
+ stage('Sources') {
+ steps {
+ sh './gradlew sourceJar';
+ }
+ }
+ stage('Publish') {
+ when {
+ anyOf {
+ branch 'master';
+ branch 'dev/2.0';
+ }
+ }
+ steps {
+ sh './gradlew publish';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000..466e3fc26
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2020-2022 The SimpleCloud authors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 000000000..2811f7a9a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,243 @@
+
+
+
+
+
+
+ A simple alternative to other minecraft cloud systems
+
+ SpigotMC
+ ·
+ Repository
+ ·
+ Dashboard
+ ·
+ Jenkins
+ ·
+ Discord
+ ·
+ Teamspeak
+
+
+
+
+
+
+
+
+ Overview
+
+ -
+ Getting Started
+
+
+ - Features
+ - Dashboard
+ -
+ Modules
+
+
+
+
+
+
+
+## Getting Started
+
+### Requirements
+
+* **Java 8** or higher
+* **[MongoDB](https://www.mongodb.com/cloud/atlas/lp/try2-de?utm_source=google&utm_campaign=gs_emea_germany_search_core_brand_atlas_desktop&utm_term=mongodb&utm_medium=cpc_paid_search&utm_ad=e&utm_ad_campaign_id=12212624524&gclid=Cj0KCQjw5auGBhDEARIsAFyNm9EkpiB2K-5CMNxHkHcY7VbdNE_4HrbwDOSrMmjgNAve270Hnd9pjRoaAqFgEALw_wcB)**
+ or **[SQL](https://go.mariadb.com/download-mariadb-server-community.html?utm_source=google&utm_medium=ppc&utm_campaign=MKG-Search-Google-Branded-EMEA-bd-Server-DL&gclid=Cj0KCQjw5auGBhDEARIsAFyNm9HBSH7xv8vFObvU9Xk8-bgYskrjfU53aBSkyehaGOxQQx2veRbC6-caAtJyEALw_wcB)**
+ database
+* min. **2GB** Memory and **2 virtual cores**
+
+### Installation
+
+
+ - Download the cloud on SpigotMC
+ - Unzip the folder and execute the start file
+ - Follow the setup instructions
+ - Connect a wrapper to your manager. It is recommended to use the InternalWrapperModule for this. You can find it below.
+ - Create your first group by typing create into the console
+ - For more information type help
+ - Have fun :D
+
+
+
+
+## Features
+
+* Dashboard
+* Language-System
+* Multi-Root
+* Multi-Proxy
+* Module-System
+* **MongoDB** and **SQL** support
+* Powerful **API**
+* Powerful **REST-API**
+* Support for **Spigot**, **BungeeCord** and **Velocity**
+* Template-System
+
+
+
+## Dashboard
+
+SimpleCloud provides a **Dashboard accessible** for every user.
+The domain for the **Dashboard** is: **http://dashboard-nossl.thesimplecloud.eu**.
+Now you have to enter the **IP-Address** of your server follwed by the port of the **REST-Module.**
+
+
+The default port of the **REST-Module** is **8585**. So an ip would be **55.55.55.55:8585**.
+The username and password can be found in **"modules/rest/users.json"**
+
+
+
+## Modules
+
+SimpleCloud provides some modules by default.
+
+### Internal-Wrapper
+
+The **Internal-Wrapper Module** starts a wrapper every time the manager of the cloud gets started.
+This wrapper does only run when the manager is running. It connects **automatically** with no need to set it up.
+The wrapper will be automatically named **"InternalWrapper"** and it will have **2GB of memory**.
+
+You can **download**
+it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-internalwrapper/2.4.0/simplecloud-module-internalwrapper-2.4.0.jar)
+
+
+To edit the memory of the wrapper you can use the command:
+``edit wrapper InternalWrapper maxMemory ``
+
+
+
+### Signs
+
+The **Sign Module** is used to show available services for players in the lobby via a **sign**.
+The players can click on that sign and will be sent to the server. The layout of the signs is **fully customizable**.
+
+You can **download**
+it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-sign/2.4.0/simplecloud-module-sign-2.4.0.jar)
+
+![SignModule](https://i.imgur.com/w534aZG.gif "SignModule")
+
+
+
+### Permissions
+
+With the **Permission Module**, you can easily manage your permissions.
+You can define groups and add permissions to them. You can also add permissions to single users.
+
+You can **download**
+it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-permission/2.4.0/simplecloud-module-permission-2.4.0.jar)
+
+![PermissionModule](https://i.imgur.com/mjqCmjq.png"PermissionModule")
+
+
+
+### Proxy
+
+The **Proxy Module** is used to manage your proxies.
+It controls the **MOTD**, **Tablist**, **maintenance** and the **online count**.
+The online count of proxies of one group will be summed up and displayed in the player info.
+
+You can **download**
+it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-proxy/2.4.0/simplecloud-module-proxy-2.4.0.jar)
+
+![ProxyModuleTab](https://i.imgur.com/2djSS9l.jpg "ProxyModuleTab")
+
+![ProxyModuleMotd](https://i.imgur.com/dkuxYM7.png "ProxyModuleMotd")
+
+![ProxyModuleMotdMaintenance](https://i.imgur.com/eCSXSJo.png "ProxyModuleMotdMaintenance")
+
+
+
+**Permissions:**
+
+
+````
+Maintenance join: cloud.maintenance.join
+Full join: cloud.full.join
+````
+
+
+
+### Hub
+
+The **Hub Module** provides a hub command for players to switch to a **lobby server**.
+
+You can **download**
+it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-hubcommand/2.4.0/simplecloud-module-hubcommand-2.4.0.jar)
+
+
+
+### Notify
+
+The **Notify Module** sends notifications to players that have the required permission when a server gets **started**
+or **stopped**.
+
+You can **download**
+it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-notify/2.4.0/simplecloud-module-notify-2.4.0.jar)
+
+![NotifyModule](https://i.imgur.com/7lcjXbN.jpg "NotifyModule")
+
+
+
+**Permissions:**
+
+
+````
+cloud.module.notify.messages
+````
+
+
+
+### REST
+
+The **REST Module** provides a **restful API**. It is necessary for the **dashboard**.
+
+You can **download**
+it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-rest/2.4.0/simplecloud-module-rest-2.4.0.jar)
+
+
+
+### Statistics
+
+The **Statistics Module** saves some statistics of the cloud. The data is displayed on the **dashboard**.
+
+You can **download**
+it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-statistics/2.4.0/simplecloud-module-statistics-2.4.0.jar)
+
+
+
+### Chat + Tab
+
+The **Chat + Tab Module** provides **prefixes** and **suffixes** in the tablist and adds a **chat configuration**.
+
+You can **download**
+it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-chat-tab/2.4.0/simplecloud-module-chat-tab-2.4.0.jar)
+
+Special Thanks To:
+-------------
+
+[![YourKit-Logo](https://www.yourkit.com/images/yklogo.png)](https://www.yourkit.com/)
+
+[YourKit](https://www.yourkit.com/) supports open source projects with innovative and intelligent tools
+for monitoring and profiling Java and .NET applications.
+YourKit is the creator of YourKit Java Profiler,
+YourKit .NET Profiler,
+and YourKit YouMonitor.
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 000000000..3d9f6c3ab
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,168 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+plugins {
+ id 'org.jetbrains.kotlin.jvm' version '1.8.22'
+ id "com.github.johnrengelman.shadow" version "8.1.1"
+ id 'org.jetbrains.dokka' version '0.10.1'
+}
+
+allprojects {
+
+ group 'eu.thesimplecloud.simplecloud'
+ version '2.5.0-SNAPSHOT'
+
+ repositories {
+ mavenCentral()
+ jcenter()
+
+ maven { url 'https://repository.derklaro.dev/releases' }
+ maven { url 'https://jitpack.io' }
+ maven {
+ url "https://repo.thesimplecloud.eu/artifactory/gradle-release-local/"
+ }
+
+ maven {
+ url "https://libraries.minecraft.net"
+ }
+
+ maven {
+ name = "papermc"
+ url = uri("https://repo.papermc.io/repository/maven-public/")
+ }
+
+ maven {
+ name 'spongepowered'
+ url 'https://repo.spongepowered.org/maven'
+ }
+
+ maven {
+ name 'bungeecord-repo'
+ url 'https://oss.sonatype.org/content/repositories/snapshots'
+ }
+
+ maven {
+ name 'spigotmc-repo'
+ url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
+ }
+
+ }
+
+ project.ext {
+ depedencyClientServerAPIVersion = '4.1.17'
+ dependencyCommonsIOVersion = '2.11.0'
+ dependencyKotlinCouroutinesVersion = '1.5.2'
+ dependencyNettyVersion = '4.1.71.Final'
+ dependencyGuavaVersion = '31.0.1-jre'
+ dependencyKMongoVersion = '4.4.0'
+ }
+
+ buildscript {
+ repositories {
+ mavenLocal()
+ }
+ }
+}
+
+subprojects {
+
+ apply plugin: 'java'
+ apply plugin: 'java-library'
+ apply plugin: 'maven-publish'
+ apply plugin: 'org.jetbrains.kotlin.jvm'
+ apply plugin: 'org.jetbrains.dokka'
+ apply plugin: "com.github.johnrengelman.shadow"
+
+ sourceCompatibility = 8
+ targetCompatibility = 8
+
+ task sourcesJar(type: Jar, dependsOn: classes) {
+ archiveClassifier.set('sources')
+ from sourceSets.main.allSource
+ }
+
+ dependencies {
+ testApi group: 'junit', name: 'junit', version: '4.13'
+ compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
+ testCompileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
+ compileOnly(group: 'eu.thesimplecloud.clientserverapi', name: 'clientserverapi', version: depedencyClientServerAPIVersion) {
+ transitive = false
+ }
+ compileOnly(group: 'eu.thesimplecloud.jsonlib', name: 'json-lib', version: "1.0.8") {
+ transitive = false
+ }
+
+ testApi(group: 'eu.thesimplecloud.clientserverapi', name: 'clientserverapi', version: depedencyClientServerAPIVersion)
+ testApi(group: 'eu.thesimplecloud.jsonlib', name: 'json-lib', version: "1.0.8")
+
+ compileOnly group: 'commons-io', name: 'commons-io', version: dependencyCommonsIOVersion
+ compileOnly group: 'com.google.guava', name: 'guava', version: dependencyGuavaVersion
+ compileOnly group: 'io.netty', name: 'netty-all', version: dependencyNettyVersion
+ compileOnly group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: dependencyKotlinCouroutinesVersion
+ compileOnly group: 'com.google.code.gson', name: 'gson', version: '2.9.0'
+
+ }
+
+ compileKotlin {
+ kotlinOptions.jvmTarget = "1.8"
+ }
+ compileTestKotlin {
+ kotlinOptions.jvmTarget = "1.8"
+ }
+
+ jar {
+ manifest {
+ attributes(
+ 'Implementation-Version': project.version,
+ )
+ }
+ }
+
+ publishing {
+ publications {
+ mavenJava(MavenPublication) {
+ from components.java
+ artifact sourcesJar
+ }
+ }
+ repositories {
+ maven {
+ if (project.version.endsWith("SNAPSHOT")) {
+ url 'https://repo.thesimplecloud.eu/artifactory/list/gradle-dev-local/'
+ } else {
+ url 'https://repo.thesimplecloud.eu/artifactory/list/gradle-release-local//'
+ }
+
+ credentials {
+ username = project.hasProperty("mavenUser") ? project.property("mavenUser") : System.getenv("MAVEN_USERNAME")
+ password = project.hasProperty("mavenPassword") ? project.property("mavenPassword") : System.getenv("MAVEN_PASSWORD")
+ }
+ }
+ }
+ }
+
+ dokka {
+ outputFormat = 'html'
+ outputDirectory = "$buildDir/dokka"
+ }
+
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000..e708b1c02
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000..1016baed3
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,26 @@
+#
+# MIT License
+#
+# Copyright (C) 2020-2022 The SimpleCloud authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+# documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100644
index 000000000..22b42f2fd
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,191 @@
+#!/usr/bin/env sh
+
+#
+# MIT License
+#
+# Copyright (C) 2020-2022 The SimpleCloud authors
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+# documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=`expr $i + 1`
+ done
+ case $i in
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 000000000..107acd32c
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 000000000..aff53bd36
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,63 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+rootProject.name = 'simplecloud-v2'
+include 'simplecloud-api'
+include 'simplecloud-client'
+include 'simplecloud-launcher'
+include 'simplecloud-plugin'
+include 'simplecloud-base'
+include 'simplecloud-modules'
+include 'simplecloud-modules:simplecloud-module-permission'
+findProject(':simplecloud-modules:simplecloud-module-permission')?.name = 'simplecloud-module-permission'
+include 'simplecloud-modules:simplecloud-module-cloudflare'
+findProject(':simplecloud-modules:simplecloud-module-cloudflare')?.name = 'simplecloud-module-cloudflare'
+include 'simplecloud-modules:simplecloud-module-proxy'
+findProject(':simplecloud-modules:simplecloud-module-proxy')?.name = 'simplecloud-module-proxy'
+include 'simplecloud-modules:simplecloud-module-sign'
+findProject(':simplecloud-modules:simplecloud-module-sign')?.name = 'simplecloud-module-sign'
+include 'simplecloud-modules:simplecloud-module-internalwrapper'
+findProject(':simplecloud-modules:simplecloud-module-internalwrapper')?.name = 'simplecloud-module-internalwrapper'
+include 'simplecloud-updater'
+include 'simplecloud-modules:simplecloud-module-notify'
+findProject(':simplecloud-modules:simplecloud-module-notify')?.name = 'simplecloud-module-notify'
+include 'simplecloud-modules:simplecloud-module-hubcommand'
+findProject(':simplecloud-modules:simplecloud-module-hubcommand')?.name = 'simplecloud-module-hubcommand'
+include 'simplecloud-runner'
+include 'simplecloud-modules:simplecloud-module-serviceselection'
+findProject(':simplecloud-modules:simplecloud-module-serviceselection')?.name = 'simplecloud-module-serviceselection'
+include 'simplecloud-modules:simplecloud-module-rest'
+findProject(':simplecloud-modules:simplecloud-module-rest')?.name = 'simplecloud-module-rest'
+include 'simplecloud-modules:simplecloud-module-chat-tab'
+findProject(':simplecloud-modules:simplecloud-module-chat-tab')?.name = 'simplecloud-module-chat-tab'
+include 'simplecloud-modules:simplecloud-module-statistics'
+findProject(':simplecloud-modules:simplecloud-module-statistics')?.name = 'simplecloud-module-statistics'
+include 'simplecloud-dependency-loader'
+include 'simplecloud-modules:simplecloud-module-npc'
+findProject(':simplecloud-modules:simplecloud-module-npc')?.name = 'simplecloud-module-npc'
+include 'simplecloud-modules:simplecloud-module-support'
+findProject(':simplecloud-modules:simplecloud-module-support')?.name = 'simplecloud-module-support'
+include 'simplecloud-modules:simplecloud-module-placeholders'
+findProject(':simplecloud-modules:simplecloud-module-placeholders')?.name = 'simplecloud-module-placeholders'
+include 'simplecloud-modules:simplecloud-module-placeholders'
+findProject(':simplecloud-modules:simplecloud-module-placeholders')?.name = 'simplecloud-module-placeholders'
+
diff --git a/simplecloud-api/build.gradle b/simplecloud-api/build.gradle
new file mode 100644
index 000000000..eb34b41ef
--- /dev/null
+++ b/simplecloud-api/build.gradle
@@ -0,0 +1,39 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+dependencies {
+ testApi group: 'io.netty', name: 'netty-all', version: dependencyNettyVersion
+ testApi group: 'org.mockito', name: 'mockito-core', version: '2.1.0'
+ compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.12.6.1'
+ compileOnly(project(":simplecloud-runner"))
+
+ testApi group: 'commons-io', name: 'commons-io', version: dependencyCommonsIOVersion
+ testApi group: 'com.google.guava', name: 'guava', version: dependencyGuavaVersion
+ testApi group: 'io.netty', name: 'netty-all', version: dependencyNettyVersion
+ testApi group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: dependencyKotlinCouroutinesVersion
+ api group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
+ api(group: 'eu.thesimplecloud.clientserverapi', name: 'clientserverapi', version: depedencyClientServerAPIVersion)
+ api(group: 'io.netty', name: 'netty-all', version: dependencyNettyVersion)
+ api("net.kyori:adventure-api:4.11.0")
+ api("net.kyori:adventure-text-serializer-gson:4.11.0")
+
+}
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/CloudAPI.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/CloudAPI.kt
new file mode 100644
index 000000000..8cf1baeef
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/CloudAPI.kt
@@ -0,0 +1,68 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api
+
+import eu.thesimplecloud.api.cachelist.manager.CacheListManager
+import eu.thesimplecloud.api.cachelist.manager.ICacheListManager
+import eu.thesimplecloud.api.message.IMessageChannelManager
+import eu.thesimplecloud.api.message.MessageChannelManager
+import eu.thesimplecloud.api.sync.`object`.GlobalPropertyHolder
+import eu.thesimplecloud.api.sync.`object`.IGlobalPropertyHolder
+import eu.thesimplecloud.api.template.ITemplateManager
+import eu.thesimplecloud.api.template.impl.DefaultTemplateManager
+import eu.thesimplecloud.api.wrapper.IWrapperManager
+import eu.thesimplecloud.api.wrapper.impl.DefaultWrapperManager
+
+abstract class CloudAPI : ICloudAPI {
+
+ private val wrapperManager: IWrapperManager = DefaultWrapperManager()
+ private val templateManager: ITemplateManager = DefaultTemplateManager()
+ private val messageChannelManager: IMessageChannelManager = MessageChannelManager()
+ private val cacheListManager: ICacheListManager = CacheListManager()
+ private val globalPropertyHolder: IGlobalPropertyHolder = GlobalPropertyHolder()
+
+ init {
+ instance = this
+ }
+
+
+ override fun getWrapperManager(): IWrapperManager = this.wrapperManager
+
+ override fun getTemplateManager(): ITemplateManager = this.templateManager
+
+ override fun getMessageChannelManager(): IMessageChannelManager = this.messageChannelManager
+
+ override fun getCacheListManager(): ICacheListManager = this.cacheListManager
+
+ override fun getGlobalPropertyHolder(): IGlobalPropertyHolder = this.globalPropertyHolder
+
+ companion object {
+ @JvmStatic
+ lateinit var instance: ICloudAPI
+ private set
+
+ fun isAvailable(): Boolean {
+ return runCatching { CloudAPI.instance.getEventManager() }.isSuccess
+ }
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/ICloudAPI.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/ICloudAPI.kt
new file mode 100644
index 000000000..2097a282f
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/ICloudAPI.kt
@@ -0,0 +1,144 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api
+
+import eu.thesimplecloud.api.cachelist.manager.ICacheListManager
+import eu.thesimplecloud.api.eventapi.IEventManager
+import eu.thesimplecloud.api.external.ICloudModule
+import eu.thesimplecloud.api.language.ILanguageManager
+import eu.thesimplecloud.api.message.IMessageChannelManager
+import eu.thesimplecloud.api.network.component.INetworkComponent
+import eu.thesimplecloud.api.player.ICloudPlayerManager
+import eu.thesimplecloud.api.screen.ICommandExecutable
+import eu.thesimplecloud.api.screen.ICommandExecuteManager
+import eu.thesimplecloud.api.service.ICloudServiceManager
+import eu.thesimplecloud.api.service.version.IServiceVersionHandler
+import eu.thesimplecloud.api.servicegroup.ICloudServiceGroupManager
+import eu.thesimplecloud.api.sync.list.manager.ISynchronizedObjectListManager
+import eu.thesimplecloud.api.sync.`object`.IGlobalPropertyHolder
+import eu.thesimplecloud.api.template.ITemplateManager
+import eu.thesimplecloud.api.wrapper.IWrapperManager
+import eu.thesimplecloud.clientserverapi.lib.bootstrap.ICommunicationBootstrap
+
+/**
+ * The global api for the cloud. It can be accessed from everywhere.
+ */
+interface ICloudAPI {
+
+ /**
+ * Returns the [IWrapperManager] to manage wrapper
+ */
+ fun getWrapperManager(): IWrapperManager
+
+ /**
+ * Returns the [ICloudServiceGroupManager] to manage service groups
+ */
+ fun getCloudServiceGroupManager(): ICloudServiceGroupManager
+
+ /**
+ * Returns the [ICloudServiceManager] to manage services
+ */
+ fun getCloudServiceManager(): ICloudServiceManager
+
+ /**
+ * Returns the [ICloudPlayerManager] to manage players
+ */
+ fun getCloudPlayerManager(): ICloudPlayerManager
+
+ /**
+ * Returns the [IEventManager] to manage and call events
+ */
+ fun getEventManager(): IEventManager
+
+ /**
+ * Returns the [ICommandExecuteManager] used to execute command on [ICommandExecutable]
+ */
+ fun getCommandExecuteManager(): ICommandExecuteManager
+
+ /**
+ * Returns the [ITemplateManager] used to manage the templates
+ */
+ fun getTemplateManager(): ITemplateManager
+
+ /**
+ * Returns the [IGlobalPropertyHolder] used to manage the templates
+ */
+ fun getGlobalPropertyHolder(): IGlobalPropertyHolder
+
+ /**
+ * Returns the [ICommunicationBootstrap] of this side.
+ */
+ fun getThisSidesCommunicationBootstrap(): ICommunicationBootstrap
+
+ /**
+ * Returns the [ISynchronizedObjectListManager]
+ */
+ fun getSynchronizedObjectListManager(): ISynchronizedObjectListManager
+
+ /**
+ * Return the [IMessageChannelManager]
+ */
+ fun getMessageChannelManager(): IMessageChannelManager
+
+ /**
+ * Returns the [ICacheListManager]
+ */
+ fun getCacheListManager(): ICacheListManager
+
+ /**
+ * Returns the [IServiceVersionHandler]
+ */
+ fun getServiceVersionHandler(): IServiceVersionHandler
+
+ /**
+ * Returns the [ILanguageManager]
+ */
+ fun getLanguageManager(): ILanguageManager
+
+ /**
+ * Returns the name of this side
+ * e.g Manager / Wrapper-1 / Lobby-1
+ */
+ fun getThisSidesName(): String
+
+ /**
+ * Returns the [INetworkComponent] of this side.
+ */
+ fun getThisSidesNetworkComponent(): INetworkComponent
+
+ /**
+ * Returns whether this side is a manager.
+ */
+ fun isManager(): Boolean = getThisSidesName() == "Manager"
+
+ /**
+ * Returns whether the application is executed on windows.
+ */
+ fun isWindows(): Boolean = System.getProperty("os.name").lowercase().contains("windows")
+
+ /**
+ * Returns then cloud module fot this side.
+ */
+ fun getThisSidesCloudModule(): ICloudModule
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/AbstractCacheList.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/AbstractCacheList.kt
new file mode 100644
index 000000000..b084b1b58
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/AbstractCacheList.kt
@@ -0,0 +1,54 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.cachelist
+
+import eu.thesimplecloud.api.cachelist.value.ICacheValue
+import eu.thesimplecloud.api.cachelist.value.ICacheValueUpdater
+import eu.thesimplecloud.clientserverapi.lib.promise.CommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.flatten
+import java.util.concurrent.CopyOnWriteArrayList
+
+abstract class AbstractCacheList>(private val spreadUpdates: Boolean = true) :
+ ICacheList {
+
+ protected val values = CopyOnWriteArrayList()
+
+ override fun shallSpreadUpdates(): Boolean {
+ return this.spreadUpdates
+ }
+
+ override fun delete(value: T, fromPacket: Boolean): ICommunicationPromise {
+ return CommunicationPromise.runAsync {
+ super.update(value, fromPacket = true, isCalledFromDelete = true).awaitCoroutine()
+ val result = super.delete(value, fromPacket).awaitCoroutine()
+ values.remove(getUpdateExecutor().getCachedObjectByUpdateValue(value))
+ return@runAsync result
+ }.flatten()
+
+ }
+
+ override fun getAllCachedObjects(): List {
+ return this.values
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/ICacheList.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/ICacheList.kt
new file mode 100644
index 000000000..2aae9a66e
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/ICacheList.kt
@@ -0,0 +1,136 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.cachelist
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.cachelist.value.ICacheValue
+import eu.thesimplecloud.api.cachelist.value.ICacheValueUpdater
+import eu.thesimplecloud.api.network.packets.sync.cachelist.PacketIOUpdateCacheObject
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.promise.CommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.combineAllPromises
+
+interface ICacheList> {
+
+ /**
+ * Updates the cashed value with the content of the specified one.
+ * @param value the value to update
+ * @param fromPacket whether this method was called by a packet
+ * @return a promise that completes when the update was sent
+ */
+ fun update(
+ value: T,
+ fromPacket: Boolean = false,
+ isCalledFromDelete: Boolean = false
+ ): ICommunicationPromise {
+ val valueUpdater = value.getUpdater()
+ val updateExecutor = getUpdateExecutor()
+ val cachedValue = updateExecutor.getCachedObjectByUpdateValue(value)
+ val eventsToCall = updateExecutor.determineEventsToCall(valueUpdater, cachedValue)
+ if (cachedValue == null) {
+ updateExecutor.addNewValue(value)
+ } else {
+ cachedValue.applyValuesFromUpdater(valueUpdater)
+ }
+ eventsToCall.forEach { CloudAPI.instance.getEventManager().call(it) }
+
+ if (shallSpreadUpdates())
+ if (!isCalledFromDelete)
+ if (CloudAPI.instance.isManager() || !fromPacket)
+ return updateExecutor.sendUpdatesToOtherComponents(value, PacketIOUpdateCacheObject.Action.UPDATE)
+
+ return CommunicationPromise.UNIT_PROMISE
+ }
+
+ /**
+ * Returns whether the updates shall be spread to other network components.
+ */
+ fun shallSpreadUpdates(): Boolean
+
+ /**
+ * Returns ht update lifecycle of this object
+ */
+ fun getUpdateExecutor(): ICacheObjectUpdateExecutor
+
+ /**
+ * Deletes the specified value.
+ * @param value the object to delete
+ * @param fromPacket whether this method was called by a packet
+ * @return a promise that completes when the delete was sent
+ */
+ fun delete(value: T, fromPacket: Boolean = false): ICommunicationPromise {
+ val updater = getUpdateExecutor()
+ if (shallSpreadUpdates())
+ if (CloudAPI.instance.isManager() || !fromPacket)
+ return updater.sendUpdatesToOtherComponents(value, PacketIOUpdateCacheObject.Action.DELETE)
+
+ return CommunicationPromise.UNIT_PROMISE
+ }
+
+ /**
+ * Returns all objects in this cache
+ */
+ fun getAllCachedObjects(): List
+
+ /**
+ * Sends the update of the [value] to the specified [connection]
+ * @param value the object to send
+ * @param connection the connection to send the [value] to
+ * @return the a promise that completes when the packet was handled.
+ */
+ fun sendUpdateToConnection(value: T, connection: IConnection): ICommunicationPromise {
+ return connection.sendUnitQuery(
+ PacketIOUpdateCacheObject(
+ getUpdateExecutor().getIdentificationName(),
+ value,
+ PacketIOUpdateCacheObject.Action.UPDATE
+ )
+ )
+ }
+
+ /**
+ * Sends the delete request of the [value] to the specified [connection]
+ * @param value the object to send
+ * @param connection the connection to send the [value] to
+ * @return the a promise that completes when the packet was handled.
+ */
+ fun sendDeleteToConnection(value: T, connection: IConnection): ICommunicationPromise {
+ return connection.sendUnitQuery(
+ PacketIOUpdateCacheObject(
+ getUpdateExecutor().getIdentificationName(),
+ value,
+ PacketIOUpdateCacheObject.Action.DELETE
+ )
+ )
+ }
+
+ /**
+ * Sends all cached objects to the specified [connection]
+ * @return a promise that completes when all packet have been sent.
+ */
+ fun sendAllCachedObjectsToConnection(connection: IConnection): ICommunicationPromise {
+ return getAllCachedObjects().map { this.sendUpdateToConnection(it, connection) }.combineAllPromises()
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/ICacheObjectUpdateExecutor.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/ICacheObjectUpdateExecutor.kt
new file mode 100644
index 000000000..9f6630b87
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/ICacheObjectUpdateExecutor.kt
@@ -0,0 +1,77 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.cachelist
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.cachelist.value.ICacheValue
+import eu.thesimplecloud.api.cachelist.value.ICacheValueUpdater
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.extension.sendPacketToAllAuthenticatedClients
+import eu.thesimplecloud.api.network.packets.sync.cachelist.PacketIOUpdateCacheObject
+import eu.thesimplecloud.clientserverapi.client.INettyClient
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import eu.thesimplecloud.clientserverapi.server.INettyServer
+
+interface ICacheObjectUpdateExecutor> {
+
+ /**
+ * Returns the identification name
+ */
+ fun getIdentificationName(): String
+
+ /**
+ * Returns the cached object by the update value
+ * @param value the update value
+ * @return the value currently cached
+ */
+ fun getCachedObjectByUpdateValue(value: T): T?
+
+ /**
+ * This method will be invoked
+ * the events will be called after the update value was updated to the cache
+ * All events should be called with the [cachedValue] if it is not null
+ */
+ fun determineEventsToCall(updater: U, cachedValue: T?): List
+
+ /**
+ * Sends the [value] to every network component that shall receive the update.
+ * This method is only called if [ICacheList.update] was invoked with fromPacket = false or
+ * this side is the Manager
+ */
+ fun sendUpdatesToOtherComponents(value: T, action: PacketIOUpdateCacheObject.Action): ICommunicationPromise {
+ val packet = PacketIOUpdateCacheObject(getIdentificationName(), value, action)
+ return if (CloudAPI.instance.isManager()) {
+ val server = CloudAPI.instance.getThisSidesCommunicationBootstrap() as INettyServer<*>
+ server.getClientManager().sendPacketToAllAuthenticatedClients(packet)
+ } else {
+ val client = CloudAPI.instance.getThisSidesCommunicationBootstrap() as INettyClient
+ client.getConnection().sendUnitQuery(packet)
+ }
+ }
+
+ /**
+ * Adds the specified [value] to the cache
+ */
+ fun addNewValue(value: T)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/manager/CacheListManager.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/manager/CacheListManager.kt
new file mode 100644
index 000000000..35602f54e
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/manager/CacheListManager.kt
@@ -0,0 +1,41 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.cachelist.manager
+
+import eu.thesimplecloud.api.cachelist.ICacheList
+import eu.thesimplecloud.api.cachelist.value.ICacheValue
+import eu.thesimplecloud.api.cachelist.value.ICacheValueUpdater
+import java.util.concurrent.CopyOnWriteArrayList
+
+class CacheListManager : ICacheListManager {
+
+ private val cacheListList = CopyOnWriteArrayList>>()
+
+ override fun registerCacheList(cacheList: ICacheList>) {
+ this.cacheListList.add(cacheList as ICacheList>)
+ }
+
+ override fun getCacheListenerByName(name: String): ICacheList>? {
+ return this.cacheListList.firstOrNull { it.getUpdateExecutor().getIdentificationName() == name }
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/manager/ICacheListManager.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/manager/ICacheListManager.kt
new file mode 100644
index 000000000..dcb817a08
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/manager/ICacheListManager.kt
@@ -0,0 +1,41 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.cachelist.manager
+
+import eu.thesimplecloud.api.cachelist.ICacheList
+import eu.thesimplecloud.api.cachelist.value.ICacheValue
+import eu.thesimplecloud.api.cachelist.value.ICacheValueUpdater
+
+interface ICacheListManager {
+
+ /**
+ * Registers a cache listener.
+ */
+ fun registerCacheList(cacheList: ICacheList>)
+
+ /**
+ * Returns the [ICacheList] found by the specified [name]
+ */
+ fun getCacheListenerByName(name: String): ICacheList>?
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/value/AbstractCacheValueUpdater.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/value/AbstractCacheValueUpdater.kt
new file mode 100644
index 000000000..9867135d7
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/value/AbstractCacheValueUpdater.kt
@@ -0,0 +1,42 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.cachelist.value
+
+import com.google.common.collect.Maps
+import java.util.concurrent.ConcurrentMap
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 29/01/2021
+ * Time: 14:21
+ * @author Frederick Baier
+ */
+abstract class AbstractCacheValueUpdater : ICacheValueUpdater {
+
+ protected val changes: ConcurrentMap = Maps.newConcurrentMap()
+
+ protected fun getChangedValue(key: String): T? {
+ return changes[key] as T?
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/value/ICacheValue.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/value/ICacheValue.kt
new file mode 100644
index 000000000..64b690edd
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/value/ICacheValue.kt
@@ -0,0 +1,43 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.cachelist.value
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 22.01.2021
+ * Time: 18:02
+ * @author Frederick Baier
+ */
+interface ICacheValue {
+
+ /**
+ * Returns the updater instance of this value
+ */
+ fun getUpdater(): U
+
+ /**
+ * Applies the values from the specified updater
+ */
+ fun applyValuesFromUpdater(updater: U)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/value/ICacheValueUpdater.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/value/ICacheValueUpdater.kt
new file mode 100644
index 000000000..33cb8cf83
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/cachelist/value/ICacheValueUpdater.kt
@@ -0,0 +1,40 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.cachelist.value
+
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 22.01.2021
+ * Time: 18:04
+ * @author Frederick Baier
+ */
+interface ICacheValueUpdater {
+
+ /**
+ * Applies the changes
+ */
+ fun update(): ICommunicationPromise
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/client/NetworkComponentReference.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/client/NetworkComponentReference.kt
new file mode 100644
index 000000000..5c2d45c92
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/client/NetworkComponentReference.kt
@@ -0,0 +1,51 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.client
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.network.component.INetworkComponent
+
+data class NetworkComponentReference(val componentType: NetworkComponentType, val name: String) {
+
+ companion object {
+ @JvmStatic
+ val MANAGER_COMPONENT_REFERENCE = NetworkComponentReference(NetworkComponentType.MANAGER, "Manager")
+
+
+ }
+
+ fun getNetworkComponent(): INetworkComponent? {
+ return when (componentType) {
+ NetworkComponentType.WRAPPER -> {
+ CloudAPI.instance.getWrapperManager().getWrapperByName(name)
+ }
+ NetworkComponentType.SERVICE -> {
+ CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(name)
+ }
+ NetworkComponentType.MANAGER -> {
+ INetworkComponent.MANAGER_COMPONENT
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/client/NetworkComponentType.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/client/NetworkComponentType.kt
new file mode 100644
index 000000000..303bfb2b8
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/client/NetworkComponentType.kt
@@ -0,0 +1,35 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.client
+
+/**
+ * An enum to separate wrapper and service clients
+ */
+enum class NetworkComponentType {
+
+
+ WRAPPER,
+ SERVICE,
+ MANAGER
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/command/ICommandSender.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/command/ICommandSender.kt
new file mode 100644
index 000000000..4e143a0ad
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/command/ICommandSender.kt
@@ -0,0 +1,64 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.command
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.exception.NoSuchPlayerException
+import eu.thesimplecloud.api.exception.UnreachableComponentException
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+interface ICommandSender {
+
+ /**
+ * Sends a message to this [ICommandSender]
+ * @return a promise that completes when the message was sent.
+ */
+ fun sendMessage(message: String): ICommunicationPromise
+
+ /**
+ * Sends message got by the [property] with the replaced values
+ */
+ fun sendProperty(property: String, vararg placeholderValues: String): ICommunicationPromise {
+ val replacedMessage = CloudAPI.instance.getLanguageManager().getMessage(property, *placeholderValues)
+ return sendMessage(replacedMessage)
+ }
+
+ /**
+ * Checks whether this sender has the specified [permission]
+ * @return a promise that is completed when the permission is checked, or
+ * when an exception is encountered. [ICommunicationPromise.isSuccess] indicates success
+ * or failure. If the sender is a ConsoleSender this method returns true.
+ * The promise will fail with:
+ * - [UnreachableComponentException] if the proxy server the sender is connected is not reachable.
+ * - [NoSuchPlayerException] if the sender cannot be found on the proxy.
+ */
+ fun hasPermission(permission: String): ICommunicationPromise
+
+ /**
+ * Checks if the sender has the specified [permission]
+ * This method blocks until the result is ready
+ * @return whether the player has the permission or false if there was an error
+ */
+ fun hasPermissionSync(permission: String): Boolean = hasPermission(permission).getBlockingOrNull() ?: false
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/AbstractJsonLibConfigLoader.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/AbstractJsonLibConfigLoader.kt
new file mode 100644
index 000000000..53d036623
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/AbstractJsonLibConfigLoader.kt
@@ -0,0 +1,55 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.config
+
+import com.google.gson.Gson
+import eu.thesimplecloud.jsonlib.JsonLib
+import java.io.File
+
+abstract class AbstractJsonLibConfigLoader(
+ private val configClass: Class,
+ private val configFie: File,
+ private val lazyDefaultObject: () -> T,
+ private val saveDefaultOnFistLoad: Boolean,
+ private val gsonToUse: Gson = JsonLib.GSON
+) : IConfigLoader {
+
+ override fun loadConfig(): T {
+ val objectFromFile = JsonLib.fromJsonFile(configFie, gsonToUse)?.getObjectOrNull(configClass)
+ if (objectFromFile == null) {
+ val defaultObject = lazyDefaultObject()
+ if (saveDefaultOnFistLoad && !doesConfigFileExist())
+ saveConfig(defaultObject)
+ return defaultObject
+ }
+ return objectFromFile
+ }
+
+ override fun saveConfig(value: T) {
+ JsonLib.fromObject(value, gsonToUse).saveAsFile(configFie)
+ }
+
+ override fun doesConfigFileExist(): Boolean = this.configFie.exists()
+
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/AbstractMultipleConfigLoader.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/AbstractMultipleConfigLoader.kt
new file mode 100644
index 000000000..7dde2084b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/AbstractMultipleConfigLoader.kt
@@ -0,0 +1,65 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.config
+
+import com.google.gson.Gson
+import eu.thesimplecloud.api.utils.Nameable
+import eu.thesimplecloud.jsonlib.JsonLib
+import java.io.File
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 12.12.2020
+ * Time: 11:32
+ * @author Frederick Baier
+ */
+abstract class AbstractMultipleConfigLoader(
+ private val clazz: Class,
+ private val directory: File,
+ private val defaultValues: List,
+ private val saveDefaultOnFirstLoad: Boolean,
+ private val gsonToUse: Gson = JsonLib.GSON
+) : IFileHandler {
+
+ override fun save(value: T) {
+ JsonLib.fromObject(value, gsonToUse).saveAsFile(getFileByObject(value))
+ }
+
+ override fun delete(value: T) {
+ getFileByObject(value).delete()
+ }
+
+ override fun loadAll(): Set {
+ if (!directory.exists() && saveDefaultOnFirstLoad) saveDefaults()
+ return this.directory.listFiles()?.mapNotNull { JsonLib.fromJsonFile(it, gsonToUse)?.getObject(clazz) }?.toSet()
+ ?: emptySet()
+ }
+
+ private fun saveDefaults() {
+ defaultValues.forEach { save(it) }
+ }
+
+ private fun getFileByObject(value: T): File {
+ return File(this.directory, value.getName() + ".json")
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/IConfigLoader.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/IConfigLoader.kt
new file mode 100644
index 000000000..62868da43
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/IConfigLoader.kt
@@ -0,0 +1,43 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.config
+
+interface IConfigLoader {
+
+ /**
+ * Load the config form the file.
+ * If the config does not exist it returns a default value without creating the file.
+ */
+ fun loadConfig(): T
+
+ /**
+ * Saves the object to the config file
+ */
+ fun saveConfig(value: T)
+
+ /**
+ * Returns whether the config file exist
+ */
+ fun doesConfigFileExist(): Boolean
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/IFileHandler.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/IFileHandler.kt
new file mode 100644
index 000000000..790b61e9d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/config/IFileHandler.kt
@@ -0,0 +1,42 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.config
+
+interface IFileHandler {
+
+ /**
+ * Saves the specified value to a file
+ */
+ fun save(value: T)
+
+ /**
+ * Deletes the file found yb the specified value
+ */
+ fun delete(value: T)
+
+ /**
+ * Loads all saved objects
+ */
+ fun loadAll(): Set
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/depedency/DependenciesInformation.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/depedency/DependenciesInformation.kt
new file mode 100644
index 000000000..7fa425d20
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/depedency/DependenciesInformation.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.depedency
+
+import eu.thesimplecloud.runner.dependency.CloudDependency
+
+class DependenciesInformation(val repositories: List, val dependencies: List) {
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/directorypaths/DirectoryPaths.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/directorypaths/DirectoryPaths.kt
new file mode 100644
index 000000000..313d3fcb9
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/directorypaths/DirectoryPaths.kt
@@ -0,0 +1,43 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.directorypaths
+
+class DirectoryPaths(
+ val groupsPath: String = "groups/",
+ val proxyGroupsPath: String = groupsPath + "proxies/",
+ val serverGroupsPath: String = groupsPath + "servers/",
+ val lobbyGroupsPath: String = groupsPath + "lobbies/",
+ val storagePath: String = "storage/",
+ val templatesPath: String = "templates/",
+ val tempPath: String = "tmp/",
+ val staticPath: String = "static/",
+ val minecraftJarsPath: String = storagePath + "minecraftJars/",
+ val languagesPath: String = storagePath + "languages/",
+ val modulesPath: String = "modules/",
+ val wrappersPath: String = storagePath + "wrappers/",
+ val zippedTemplatesPath: String = storagePath + "zippedTemplates/",
+) {
+ companion object {
+ lateinit var paths: DirectoryPaths
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/dto/PlayerLoginRequestResult.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/dto/PlayerLoginRequestResult.kt
new file mode 100644
index 000000000..8cfbec6a0
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/dto/PlayerLoginRequestResult.kt
@@ -0,0 +1,34 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.dto
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 17.12.2020
+ * Time: 23:33
+ * @author Frederick Baier
+ */
+data class PlayerLoginRequestResult(
+ val cancel: Boolean,
+ val kickMessage: String
+)
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/group/CloudServiceGroupCreatedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/group/CloudServiceGroupCreatedEvent.kt
new file mode 100644
index 000000000..b06fdf263
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/group/CloudServiceGroupCreatedEvent.kt
@@ -0,0 +1,35 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.group
+
+import eu.thesimplecloud.api.servicegroup.ICloudServiceGroup
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 15.07.2020
+ * Time: 23:17
+ * @author Frederick Baier
+ *
+ * Called when a service was updated
+ */
+class CloudServiceGroupCreatedEvent(serviceGroup: ICloudServiceGroup) : CloudServiceGroupEvent(serviceGroup)
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/group/CloudServiceGroupEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/group/CloudServiceGroupEvent.kt
new file mode 100644
index 000000000..a8a94d7c7
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/group/CloudServiceGroupEvent.kt
@@ -0,0 +1,34 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.group
+
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.servicegroup.ICloudServiceGroup
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 15.07.2020
+ * Time: 23:16
+ * @author Frederick Baier
+ */
+open class CloudServiceGroupEvent(val serviceGroup: ICloudServiceGroup) : IEvent
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/group/CloudServiceGroupUpdatedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/group/CloudServiceGroupUpdatedEvent.kt
new file mode 100644
index 000000000..b3e382e8b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/group/CloudServiceGroupUpdatedEvent.kt
@@ -0,0 +1,35 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.group
+
+import eu.thesimplecloud.api.servicegroup.ICloudServiceGroup
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 15.07.2020
+ * Time: 23:17
+ * @author Frederick Baier
+ *
+ * Called when a service was updated
+ */
+class CloudServiceGroupUpdatedEvent(serviceGroup: ICloudServiceGroup) : CloudServiceGroupEvent(serviceGroup)
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerCommandExecuteEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerCommandExecuteEvent.kt
new file mode 100644
index 000000000..81ff559be
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerCommandExecuteEvent.kt
@@ -0,0 +1,53 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.eventapi.ISynchronizedEvent
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+/**
+ * This event will be called when a player executes any command
+ */
+class CloudPlayerCommandExecuteEvent(
+ /**
+ * The unique id of the player involved in this event
+ */
+ val playerUniqueId: UUID,
+
+ /**
+ * The name of the player involved in this event
+ */
+ val playerName: String,
+
+ /**
+ * The executed command
+ */
+ val command: String
+) : ISynchronizedEvent {
+
+ fun getCloudPlayer(): ICommunicationPromise =
+ CloudAPI.instance.getCloudPlayerManager().getCloudPlayer(playerUniqueId)
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerDisconnectEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerDisconnectEvent.kt
new file mode 100644
index 000000000..df1416ea7
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerDisconnectEvent.kt
@@ -0,0 +1,49 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.eventapi.ISynchronizedEvent
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+/**
+ * This event is called when a player disconnects from the network
+ */
+class CloudPlayerDisconnectEvent(
+ /**
+ * The unique id of the player involved in this event
+ */
+ val playerUniqueId: UUID,
+
+ /**
+ * The name of the player involved in this event
+ */
+ val playerName: String
+) : ISynchronizedEvent {
+
+ fun getCloudPlayer(): ICommunicationPromise =
+ CloudAPI.instance.getCloudPlayerManager().getCloudPlayer(playerUniqueId)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerEvent.kt
new file mode 100644
index 000000000..58e07410d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerEvent.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player
+
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.player.ICloudPlayer
+
+open class CloudPlayerEvent(val cloudPlayer: ICloudPlayer) : IEvent
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerLoginEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerLoginEvent.kt
new file mode 100644
index 000000000..bf749b108
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerLoginEvent.kt
@@ -0,0 +1,49 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.eventapi.ISynchronizedEvent
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+/**
+ * This event is called when a player logged in to the network
+ */
+class CloudPlayerLoginEvent(
+ /**
+ * The unique id of the player involved in this event
+ */
+ val playerUniqueId: UUID,
+
+ /**
+ * The name of the player involved in this event
+ */
+ val playerName: String
+) : ISynchronizedEvent {
+
+ fun getCloudPlayer(): ICommunicationPromise =
+ CloudAPI.instance.getCloudPlayerManager().getCloudPlayer(playerUniqueId)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerMessageEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerMessageEvent.kt
new file mode 100644
index 000000000..0ac40d155
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerMessageEvent.kt
@@ -0,0 +1,26 @@
+package eu.thesimplecloud.api.event.player
+
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.api.service.ICloudService
+
+/**
+ * Created by MrManHD
+ * Class create at 23.06.2023 23:09
+ */
+
+/**
+ * This event is called when a player sends a chat message
+ */
+class CloudPlayerMessageEvent(
+ cloudPlayer: ICloudPlayer,
+
+ /**
+ * The chat message from this player
+ */
+ val message: String,
+
+ /**
+ * The cloud service where the player sent the chat message
+ */
+ val cloudService: ICloudService
+) : CloudPlayerEvent(cloudPlayer)
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerRegisteredEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerRegisteredEvent.kt
new file mode 100644
index 000000000..4edd75ffd
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerRegisteredEvent.kt
@@ -0,0 +1,31 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player
+
+import eu.thesimplecloud.api.player.ICloudPlayer
+
+/**
+ * This event is called when a player is updated the first time on a service. This event means not that the player is now logged in to the network.
+ * @see CloudPlayerLoginEvent
+ */
+class CloudPlayerRegisteredEvent(cloudPlayer: ICloudPlayer) : CloudPlayerEvent(cloudPlayer)
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerServerConnectEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerServerConnectEvent.kt
new file mode 100644
index 000000000..667b22c8a
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerServerConnectEvent.kt
@@ -0,0 +1,46 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player
+
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.api.service.ICloudService
+
+/**
+ * This event is called when a player changed his server. The event will only be called on services that receive updates of the player.
+ * @see [ICloudPlayer.enableUpdates]
+ */
+class CloudPlayerServerConnectEvent(
+ /**
+ * The player involved in this event.
+ */
+ val cloudPlayer: ICloudPlayer,
+ /**
+ * The server the player switched from. The server can be null if the player was on no server before.
+ */
+ val from: ICloudService?,
+ /**
+ * The server the player switched to.
+ */
+ val to: ICloudService
+) : IEvent
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerServerConnectedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerServerConnectedEvent.kt
new file mode 100644
index 000000000..f5d968f05
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerServerConnectedEvent.kt
@@ -0,0 +1,32 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player
+
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.api.service.ICloudService
+
+/**
+ * This event is called when a player is connected to a server
+ */
+class CloudPlayerServerConnectedEvent(cloudPlayer: ICloudPlayer, val server: ICloudService) :
+ CloudPlayerEvent(cloudPlayer)
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerUnregisteredEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerUnregisteredEvent.kt
new file mode 100644
index 000000000..db06efdbc
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerUnregisteredEvent.kt
@@ -0,0 +1,33 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player
+
+import eu.thesimplecloud.api.player.ICloudPlayer
+
+/**
+ * This event is called when a player was removed from this network component. This event is not called when a player
+ * leaves the network.
+ *
+ * @see CloudPlayerDisconnectEvent
+ */
+class CloudPlayerUnregisteredEvent(cloudPlayer: ICloudPlayer) : CloudPlayerEvent(cloudPlayer)
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerUpdatedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerUpdatedEvent.kt
new file mode 100644
index 000000000..57908f89c
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/CloudPlayerUpdatedEvent.kt
@@ -0,0 +1,33 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player
+
+import eu.thesimplecloud.api.player.ICloudPlayer
+
+/**
+ * This event is called when a network component receives an update of a player. Note, that not every component will
+ * receive updates.
+ * To read more about updates
+ * @see ICloudPlayer.enableUpdates
+ */
+class CloudPlayerUpdatedEvent(cloudPlayer: ICloudPlayer) : CloudPlayerEvent(cloudPlayer)
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/permission/CloudPlayerPermissionCheckEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/permission/CloudPlayerPermissionCheckEvent.kt
new file mode 100644
index 000000000..0d8caaef7
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/permission/CloudPlayerPermissionCheckEvent.kt
@@ -0,0 +1,45 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player.permission
+
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.player.ICloudPlayer
+
+/**
+ * This event is called when [ICloudPlayer.hasPermission] is called. If the result of this event is [PermissionState.UNKNOWN]
+ * a packet to check the permission will be sent to the player's proxy.
+ * Note, that the permission module of SimpleCloud uses this event and sets the [PermissionState] on every component
+ * in the network.
+ */
+class CloudPlayerPermissionCheckEvent(
+ val cloudPlayer: ICloudPlayer,
+ val permission: String,
+ var state: PermissionState = PermissionState.UNKNOWN
+) : IEvent {
+
+
+ fun setHasPermission(boolean: Boolean) {
+ this.state = PermissionState.valueOf(boolean.toString().toUpperCase())
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/permission/PermissionState.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/permission/PermissionState.kt
new file mode 100644
index 000000000..74fbb238b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/player/permission/PermissionState.kt
@@ -0,0 +1,33 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.player.permission
+
+/**
+ * Represents the result of the [CloudPlayerPermissionCheckEvent]
+ */
+enum class PermissionState {
+
+ TRUE, FALSE, UNKNOWN
+
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceConnectedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceConnectedEvent.kt
new file mode 100644
index 000000000..7dd3b5afe
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceConnectedEvent.kt
@@ -0,0 +1,30 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.service
+
+import eu.thesimplecloud.api.service.ICloudService
+
+/**
+ * Called when the [cloudService] connects to the manager
+ */
+class CloudServiceConnectedEvent(cloudService: ICloudService) : CloudServiceEvent(cloudService)
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceEvent.kt
new file mode 100644
index 000000000..7247bf779
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceEvent.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.service
+
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.service.ICloudService
+
+open class CloudServiceEvent(val cloudService: ICloudService) : IEvent
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceInvisibleEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceInvisibleEvent.kt
new file mode 100644
index 000000000..f9ba1143b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceInvisibleEvent.kt
@@ -0,0 +1,30 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.service
+
+import eu.thesimplecloud.api.service.ICloudService
+
+/**
+ * Called when the [cloudService] connects to the manager
+ */
+class CloudServiceInvisibleEvent(cloudService: ICloudService) : CloudServiceEvent(cloudService)
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceRegisteredEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceRegisteredEvent.kt
new file mode 100644
index 000000000..49ea589d0
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceRegisteredEvent.kt
@@ -0,0 +1,30 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.service
+
+import eu.thesimplecloud.api.service.ICloudService
+
+/**
+ * Called when a service updates the first time on a network component.
+ */
+class CloudServiceRegisteredEvent(cloudService: ICloudService) : CloudServiceEvent(cloudService)
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceStartedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceStartedEvent.kt
new file mode 100644
index 000000000..e47f65a8e
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceStartedEvent.kt
@@ -0,0 +1,31 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.service
+
+import eu.thesimplecloud.api.service.ICloudService
+import eu.thesimplecloud.api.service.ServiceState
+
+/**
+ * Called when the state of a [cloudService] changed to [ServiceState.VISIBLE] or [ServiceState.INVISIBLE] and was not [ServiceState.VISIBLE] or [ServiceState.INVISIBLE] before.
+ */
+class CloudServiceStartedEvent(cloudService: ICloudService) : CloudServiceEvent(cloudService)
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceStartingEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceStartingEvent.kt
new file mode 100644
index 000000000..75fc35c1d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceStartingEvent.kt
@@ -0,0 +1,31 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.service
+
+import eu.thesimplecloud.api.service.ICloudService
+import eu.thesimplecloud.api.service.ServiceState
+
+/**
+ * Called when a service changes its state from [ServiceState.PREPARED] to [ServiceState.STARTING]
+ */
+class CloudServiceStartingEvent(cloudService: ICloudService) : CloudServiceEvent(cloudService)
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceUnregisteredEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceUnregisteredEvent.kt
new file mode 100644
index 000000000..e8b432adc
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceUnregisteredEvent.kt
@@ -0,0 +1,30 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.service
+
+import eu.thesimplecloud.api.service.ICloudService
+
+/**
+ * Called when a service was unregistered (stopped)
+ */
+class CloudServiceUnregisteredEvent(cloudService: ICloudService) : CloudServiceEvent(cloudService)
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceUpdatedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceUpdatedEvent.kt
new file mode 100644
index 000000000..b69e3e435
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/service/CloudServiceUpdatedEvent.kt
@@ -0,0 +1,30 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.service
+
+import eu.thesimplecloud.api.service.ICloudService
+
+/**
+ * Called when a service was updated.
+ */
+class CloudServiceUpdatedEvent(cloudService: ICloudService) : CloudServiceEvent(cloudService)
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/sync/list/SynchronizedListObjectRemovedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/sync/list/SynchronizedListObjectRemovedEvent.kt
new file mode 100644
index 000000000..5ac926499
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/sync/list/SynchronizedListObjectRemovedEvent.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.sync.list
+
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.property.IProperty
+
+class SynchronizedListObjectRemovedEvent(val property: IProperty) : IEvent
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/sync/list/SynchronizedListObjectUpdatedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/sync/list/SynchronizedListObjectUpdatedEvent.kt
new file mode 100644
index 000000000..3d5c7c7f7
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/sync/list/SynchronizedListObjectUpdatedEvent.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.sync.list
+
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.property.IProperty
+
+class SynchronizedListObjectUpdatedEvent(val property: IProperty) : IEvent
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/sync/object/GlobalPropertyUpdatedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/sync/object/GlobalPropertyUpdatedEvent.kt
new file mode 100644
index 000000000..9be9ea84b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/sync/object/GlobalPropertyUpdatedEvent.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.sync.`object`
+
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.property.IProperty
+
+class GlobalPropertyUpdatedEvent(val propertyName: String, val property: IProperty) : IEvent
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/wrapper/WrapperEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/wrapper/WrapperEvent.kt
new file mode 100644
index 000000000..0ffcbdc6e
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/wrapper/WrapperEvent.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.wrapper
+
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.wrapper.IWrapperInfo
+
+open class WrapperEvent(val wrapper: IWrapperInfo) : IEvent
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/wrapper/WrapperUpdatedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/wrapper/WrapperUpdatedEvent.kt
new file mode 100644
index 000000000..cd526f207
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/event/wrapper/WrapperUpdatedEvent.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.event.wrapper
+
+import eu.thesimplecloud.api.wrapper.IWrapperInfo
+
+class WrapperUpdatedEvent(wrapper: IWrapperInfo) : WrapperEvent(wrapper) {
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/BasicEventManager.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/BasicEventManager.kt
new file mode 100644
index 000000000..874703a5b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/BasicEventManager.kt
@@ -0,0 +1,139 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.eventapi
+
+import com.google.common.collect.Maps
+import eu.thesimplecloud.api.eventapi.exception.EventException
+import eu.thesimplecloud.api.external.ICloudModule
+import java.lang.reflect.Method
+import java.util.concurrent.CopyOnWriteArrayList
+
+open class BasicEventManager : IEventManager {
+
+ /**
+ * The map with all [IEvent]s and the listener methods.
+ */
+ private val listeners = Maps.newConcurrentMap, MutableList>()
+
+ override fun registerListener(cloudModule: ICloudModule, listener: IListener) {
+ for (method in getValidMethods(listener::class.java)) {
+ val eventClass = method.parameterTypes[0] as Class
+ addRegisteredEvent(RegisteredEvent.fromEventMethod(cloudModule, eventClass, listener, method))
+ }
+ }
+
+ override fun registerEvent(
+ cloudModule: ICloudModule,
+ eventClass: Class,
+ listener: IListener,
+ eventExecutor: IEventExecutor
+ ) {
+ addRegisteredEvent(RegisteredEvent(cloudModule, eventClass, listener, eventExecutor))
+ }
+
+ override fun unregisterListener(listener: IListener) {
+ val list = this.listeners.values.map { it.filter { it.listener == listener } }.flatten()
+ list.forEach { removeRegisteredEvent(it) }
+ }
+
+ override fun call(event: IEvent, fromPacket: Boolean) {
+ this.listeners[event::class.java]?.forEach { registeredEvent ->
+ registeredEvent.eventExecutor.execute(event)
+ }
+ }
+
+ override fun unregisterAllListenersByCloudModule(cloudModule: ICloudModule) {
+ listeners.values.forEach { list -> list.removeIf { it.cloudModule == cloudModule } }
+ }
+
+ override fun unregisterAll() {
+ this.listeners.clear()
+ }
+
+ /**
+ * Gets all methods that have the [CloudEventHandler] annotation and only one parameter
+ *
+ * @param listenerClass
+ * @return
+ */
+ private fun getValidMethods(listenerClass: Class): List {
+ val methods = listenerClass.declaredMethods
+ .filter {
+ it.isAnnotationPresent(CloudEventHandler::class.java) && it.parameterTypes.size == 1 && IEvent::class.java.isAssignableFrom(
+ it.parameterTypes[0]
+ )
+ }
+ methods.forEach { it.isAccessible = true }
+ return methods
+ }
+
+ /**
+ * Adds the [RegisteredEvent] to the listeners map.
+ *
+ * @param registeredEvent the [RegisteredEvent] that should be registered.
+ */
+ private fun addRegisteredEvent(registeredEvent: RegisteredEvent) {
+ this.listeners.getOrPut(registeredEvent.eventClass, { CopyOnWriteArrayList() }).add(registeredEvent)
+ }
+
+ /**
+ * Removes the [RegisteredEvent] from the listeners map.
+ *
+ * @param registeredEvent the [RegisteredEvent] that should be removed.
+ */
+ private fun removeRegisteredEvent(registeredEvent: RegisteredEvent) {
+ this.listeners[registeredEvent.eventClass]?.remove(registeredEvent)
+ }
+
+ data class RegisteredEvent(
+ val cloudModule: ICloudModule,
+ val eventClass: Class,
+ val listener: IListener,
+ val eventExecutor: IEventExecutor
+ ) {
+
+ companion object {
+ fun fromEventMethod(
+ cloudModule: ICloudModule,
+ eventClass: Class,
+ listener: IListener,
+ method: Method
+ ): RegisteredEvent {
+ return RegisteredEvent(cloudModule, eventClass, listener, object : IEventExecutor {
+
+ override fun execute(event: IEvent) {
+ if (!eventClass.isAssignableFrom(event.javaClass))
+ return
+ try {
+ method.invoke(listener, event)
+ } catch (ex: Exception) {
+ throw EventException(event, ex)
+ }
+ }
+ })
+ }
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/CloudEventHandler.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/CloudEventHandler.kt
new file mode 100644
index 000000000..89f93557f
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/CloudEventHandler.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.eventapi
+
+
+@Target(AnnotationTarget.FUNCTION)
+@Retention(AnnotationRetention.RUNTIME)
+annotation class CloudEventHandler
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/ICancellable.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/ICancellable.kt
new file mode 100644
index 000000000..014f0136d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/ICancellable.kt
@@ -0,0 +1,40 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.eventapi
+
+/**
+ * Represents a class that can be cancelled.
+ */
+interface ICancellable {
+
+ /**
+ * Returns whether this action was cancelled.
+ */
+ fun isCancelled(): Boolean
+
+ /**
+ * Sets the cancelled state
+ */
+ fun setCancelled(cancel: Boolean)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IEvent.kt
new file mode 100644
index 000000000..b7acda4a6
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IEvent.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.eventapi
+
+/**
+ * All events should implement this interface.
+ */
+interface IEvent
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IEventExecutor.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IEventExecutor.kt
new file mode 100644
index 000000000..c5046cd6d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IEventExecutor.kt
@@ -0,0 +1,36 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.eventapi
+
+import eu.thesimplecloud.api.eventapi.exception.EventException
+
+@FunctionalInterface
+interface IEventExecutor {
+
+ /**
+ * Executes the specified event.
+ */
+ @Throws(EventException::class)
+ fun execute(event: IEvent)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IEventManager.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IEventManager.kt
new file mode 100644
index 000000000..df2b92ac1
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IEventManager.kt
@@ -0,0 +1,73 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.eventapi
+
+import eu.thesimplecloud.api.eventapi.exception.EventException
+import eu.thesimplecloud.api.external.ICloudModule
+
+interface IEventManager {
+
+ /**
+ * Registers all methods from the specified object that has the [CloudEventHandler] annotation.
+ *
+ * @param listener the listener object from which the methods should be registered.
+ */
+ fun registerListener(cloudModule: ICloudModule, listener: IListener)
+
+ /**
+ * Registers one event.
+ */
+ fun registerEvent(
+ cloudModule: ICloudModule,
+ eventClass: Class,
+ listener: IListener,
+ eventExecutor: IEventExecutor
+ )
+
+ /**
+ * Unregisters all methods from the specified object that has the [CloudEventHandler] annotation.
+ *
+ * @param listener the listener object from which the methods should be unregistered.
+ */
+ fun unregisterListener(listener: IListener)
+
+ /**
+ * Calls all methods which were registered.
+ *
+ * @param event the event which should be called.
+ * @param fromPacket whether the event shall be synchronized with all components. Only used when the specified [event] is a [ISynchronizedEvent].
+ */
+ @Throws(EventException::class)
+ fun call(event: IEvent, fromPacket: Boolean = false)
+
+ /**
+ * Unregisters all listeners registered with the specified [ICloudModule].
+ */
+ fun unregisterAllListenersByCloudModule(cloudModule: ICloudModule)
+
+ /**
+ * Unregisters all listeners.
+ */
+ fun unregisterAll()
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IListener.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IListener.kt
new file mode 100644
index 000000000..aaaee9cc9
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/IListener.kt
@@ -0,0 +1,29 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.eventapi
+
+/**
+ * All listeners should implement this interface
+ */
+interface IListener {
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/ISynchronizedEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/ISynchronizedEvent.kt
new file mode 100644
index 000000000..e0cea1b5d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/ISynchronizedEvent.kt
@@ -0,0 +1,29 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.eventapi
+
+/**
+ * A special type of [IEvent]
+ * Synchronized events will be sent to all connected components(Wrappers and services). Because of this they must not contain any unserializable member variables like interfaces.
+ */
+interface ISynchronizedEvent : IEvent
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/exception/EventException.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/exception/EventException.kt
new file mode 100644
index 000000000..3f9ec7244
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/eventapi/exception/EventException.kt
@@ -0,0 +1,29 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.eventapi.exception
+
+import eu.thesimplecloud.api.eventapi.IEvent
+
+class EventException(causeEvent: IEvent, cause: Throwable) :
+ Exception("An error occurred while attempting to handle event ${causeEvent::class.java.name}", cause) {
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/NoSuchPlayerException.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/NoSuchPlayerException.kt
new file mode 100644
index 000000000..37fb5b561
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/NoSuchPlayerException.kt
@@ -0,0 +1,26 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.exception
+
+class NoSuchPlayerException(reason: String) : Exception(reason) {
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/NoSuchServiceException.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/NoSuchServiceException.kt
new file mode 100644
index 000000000..fe57d7d67
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/NoSuchServiceException.kt
@@ -0,0 +1,25 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.exception
+
+class NoSuchServiceException(message: String) : Exception(message)
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/NoSuchWorldException.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/NoSuchWorldException.kt
new file mode 100644
index 000000000..b12275b22
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/NoSuchWorldException.kt
@@ -0,0 +1,26 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.exception
+
+class NoSuchWorldException(reason: String) : Exception(reason) {
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/PlayerConnectException.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/PlayerConnectException.kt
new file mode 100644
index 000000000..367f91bfb
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/PlayerConnectException.kt
@@ -0,0 +1,29 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.exception
+
+/**
+ * This exception is used to indicate that the proxy was unable to send the player to a service.
+ */
+class PlayerConnectException(message: String) : Exception(message) {
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/SerializationException.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/SerializationException.kt
new file mode 100644
index 000000000..e055c9a68
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/SerializationException.kt
@@ -0,0 +1,26 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.exception
+
+class SerializationException(message: String) : Exception(message) {
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/UnreachableComponentException.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/UnreachableComponentException.kt
new file mode 100644
index 000000000..a4d3b0ce6
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/exception/UnreachableComponentException.kt
@@ -0,0 +1,29 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.exception
+
+/**
+ * This exception is thrown when a service is not available or not connected to the manager.
+ */
+class UnreachableComponentException(reason: String) : Exception(reason) {
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/extension/ClientManagerExtension.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/extension/ClientManagerExtension.kt
new file mode 100644
index 000000000..37e2aee61
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/extension/ClientManagerExtension.kt
@@ -0,0 +1,53 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.extension
+
+import eu.thesimplecloud.api.network.component.IAuthenticatable
+import eu.thesimplecloud.api.wrapper.IWrapperInfo
+import eu.thesimplecloud.clientserverapi.lib.packet.IPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.combineAllPromises
+import eu.thesimplecloud.clientserverapi.server.client.clientmanager.IClientManager
+import eu.thesimplecloud.clientserverapi.server.client.connectedclient.IConnectedClient
+import eu.thesimplecloud.clientserverapi.server.client.connectedclient.IConnectedClientValue
+
+fun IClientManager<*>.getAllAuthenticatedClients(): List> {
+ return this.getClients()
+ .filter { it.isOpen() }
+ .filter { it.getClientValue() != null && (it.getClientValue() as IAuthenticatable).isAuthenticated() }
+}
+
+fun IClientManager<*>.sendPacketToAllAuthenticatedClients(packet: IPacket): ICommunicationPromise {
+ return this.getAllAuthenticatedClients().map { it.sendUnitQuery(packet) }.combineAllPromises()
+}
+
+fun IClientManager<*>.sendPacketToAllAuthenticatedNonWrapperClients(packet: IPacket): ICommunicationPromise {
+ return this.getAllAuthenticatedClients().filter { it.getClientValue() !is IWrapperInfo }
+ .map { it.sendUnitQuery(packet) }
+ .combineAllPromises()
+}
+
+fun IClientManager<*>.sendPacketToAllAuthenticatedWrapperClients(packet: IPacket) {
+ this.getAllAuthenticatedClients().filter { it.getClientValue() is IWrapperInfo }
+ .forEach { it.sendUnitQuery(packet) }
+}
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/external/ICloudModule.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/external/ICloudModule.kt
new file mode 100644
index 000000000..b522d8bb6
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/external/ICloudModule.kt
@@ -0,0 +1,42 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.external
+
+interface ICloudModule {
+
+ /**
+ * Called when the plugin is enabled
+ */
+ fun onEnable()
+
+ /**
+ * Called when the plugin is disabled
+ */
+ fun onDisable()
+
+ /**
+ * Returns whether this module is reloadable
+ */
+ fun isReloadable() = true
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/ILanguageManager.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/ILanguageManager.kt
new file mode 100644
index 000000000..29c12bdff
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/ILanguageManager.kt
@@ -0,0 +1,61 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.language
+
+import eu.thesimplecloud.api.external.ICloudModule
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 14.10.2020
+ * Time: 22:24
+ * @author Frederick Baier
+ */
+interface ILanguageManager {
+
+ /**
+ * Registers a language file for the specified [cloudModule]
+ */
+ fun registerLanguageFile(cloudModule: ICloudModule, languageFile: LoadedLanguageFile)
+
+ /**
+ * Returns the replaced message found by the property with the [placeholderValues]
+ * If the [property] cannot be found it will return the [property]
+ */
+ fun getMessage(property: String, vararg placeholderValues: String): String
+
+ /**
+ * Unregisters the [LoadedLanguageFile] by the specified [cloudModule]
+ */
+ fun unregisterLanguageFileByCloudModule(cloudModule: ICloudModule)
+
+ /**
+ * Clears all language properties
+ */
+ fun clearAll()
+
+ /**
+ * Returns a list of all registered [LanguageProperty]s
+ */
+ fun getAllProperties(): List
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LanguageManager.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LanguageManager.kt
new file mode 100644
index 000000000..fcd42cad6
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LanguageManager.kt
@@ -0,0 +1,55 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.language
+
+import com.google.common.collect.Maps
+import eu.thesimplecloud.api.external.ICloudModule
+
+
+open class LanguageManager : ILanguageManager {
+
+ private val languageFiles = Maps.newConcurrentMap()
+
+ override fun registerLanguageFile(cloudModule: ICloudModule, languageFile: LoadedLanguageFile) {
+ this.languageFiles[cloudModule] = languageFile
+ }
+
+ override fun getMessage(property: String, vararg placeholderValues: String): String {
+ val allProperties = this.languageFiles.values.map { it.getProperties() }.flatten()
+ val languageProperty = allProperties.firstOrNull { it.property == property } ?: return property
+ return languageProperty.getReplacedMessage(*placeholderValues)
+ }
+
+ override fun unregisterLanguageFileByCloudModule(cloudModule: ICloudModule) {
+ this.languageFiles.remove(cloudModule)
+ }
+
+ override fun clearAll() {
+ this.languageFiles.clear()
+ }
+
+ override fun getAllProperties(): List {
+ return this.languageFiles.values.map { it.getProperties() }.flatten()
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LanguagePlaceholder.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LanguagePlaceholder.kt
new file mode 100644
index 000000000..692326277
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LanguagePlaceholder.kt
@@ -0,0 +1,37 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.language
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 15.10.2020
+ * Time: 18:36
+ * @author Frederick Baier
+ */
+class LanguagePlaceholder(val placeholderName: String) {
+
+ fun getStringToReplace(): String {
+ return "%${placeholderName}%"
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LanguageProperty.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LanguageProperty.kt
new file mode 100644
index 000000000..32a535492
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LanguageProperty.kt
@@ -0,0 +1,59 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.language
+
+class LanguageProperty(val property: String, val message: String) {
+
+
+ /**
+ * Returns all placeholders in this message.
+ *
+ * Messages look like this
+ * Service %SERVICE% was stopped.
+ */
+ fun getAllPlaceHolders(): List {
+ val percentParts = this.message.split("%")
+ //is number not divisible by 2
+ if (percentParts.lastIndex % 2 != 0) {
+ throw IllegalArgumentException("Invalid message format for property $property")
+ }
+
+ val returnList = mutableListOf()
+ //all indices of placeholders
+ for (i in 1..percentParts.lastIndex step 2) {
+ returnList.add(LanguagePlaceholder(percentParts[i]))
+ }
+ return returnList
+ }
+
+ fun getReplacedMessage(vararg replacements: String): String {
+ val allPlaceHolders = getAllPlaceHolders()
+ var message = this.message
+ val replacementsIterator = replacements.iterator()
+ for (placeHolder in allPlaceHolders) {
+ message = message.replace(placeHolder.getStringToReplace(), replacementsIterator.next())
+ }
+ return message
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LoadedLanguageFile.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LoadedLanguageFile.kt
new file mode 100644
index 000000000..6f421a851
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/language/LoadedLanguageFile.kt
@@ -0,0 +1,39 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.language
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 15.10.2020
+ * Time: 21:55
+ * @author Frederick Baier
+ */
+class LoadedLanguageFile(
+ private val properties: List = ArrayList()
+) {
+
+ fun getProperties(): List {
+ return this.properties
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/listenerextension/AdvancedListener.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/listenerextension/AdvancedListener.kt
new file mode 100644
index 000000000..2397c681a
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/listenerextension/AdvancedListener.kt
@@ -0,0 +1,103 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.listenerextension
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.api.eventapi.IEventExecutor
+import eu.thesimplecloud.api.eventapi.IListener
+import eu.thesimplecloud.clientserverapi.lib.promise.CommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import io.netty.util.concurrent.GlobalEventExecutor
+import java.util.concurrent.TimeUnit
+
+open class AdvancedListener(
+ eventClass: Class,
+ autoUnregister: Boolean = true,
+ unregisterTimeInSeconds: Long = 5 * 60
+) : IAdvancedListener {
+
+ private val conditions = ArrayList<(T) -> Boolean>()
+ private val actions = ArrayList<(T) -> Unit>()
+ private val listenerObj = object : IListener {}
+
+ init {
+
+ CloudAPI.instance.getEventManager().registerEvent(
+ CloudAPI.instance.getThisSidesCloudModule(),
+ eventClass,
+ listenerObj, object : IEventExecutor {
+ override fun execute(event: IEvent) {
+ if (!eventClass.isAssignableFrom(event.javaClass))
+ return
+ event as T
+ if (conditions.all { it(event) }) actions.forEach { it(event) }
+ }
+ })
+ if (autoUnregister) {
+ GlobalEventExecutor.INSTANCE.schedule({
+ this.unregister()
+ }, unregisterTimeInSeconds, TimeUnit.SECONDS)
+ }
+ }
+
+ override fun addCondition(predicate: (T) -> Boolean): IAdvancedListener {
+ this.conditions.add(predicate)
+ return this
+ }
+
+ override fun addAction(function: (T) -> Unit): IAdvancedListener {
+ this.actions.add(function)
+ return this
+ }
+
+ override fun unregisterWhen(advancedListener: IAdvancedListener<*>): IAdvancedListener {
+ advancedListener.addAction { this.unregister() }
+ return this
+ }
+
+ override fun unregister() {
+ CloudAPI.instance.getEventManager().unregisterListener(listenerObj)
+ }
+
+ override fun unregisterAfterCall(): IAdvancedListener {
+ this.addAction { this.unregister() }
+ return this
+ }
+
+ override fun toPromise(): ICommunicationPromise {
+ val newPromise = CommunicationPromise(enableTimeout = false)
+ this.addAction { newPromise.trySuccess(it) }
+ this.unregisterAfterCall()
+ return newPromise
+ }
+
+ override fun toUnitPromise(): ICommunicationPromise {
+ val newPromise = CommunicationPromise(enableTimeout = false)
+ this.addAction { newPromise.trySuccess(Unit) }
+ this.unregisterAfterCall()
+ return newPromise
+ }
+
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/listenerextension/AdvancedListenerExtension.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/listenerextension/AdvancedListenerExtension.kt
new file mode 100644
index 000000000..b4494f398
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/listenerextension/AdvancedListenerExtension.kt
@@ -0,0 +1,32 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.listenerextension
+
+import eu.thesimplecloud.api.eventapi.IEvent
+
+inline fun cloudListener(
+ autoUnregister: Boolean = true,
+ unregisterTimeInSeconds: Long = 5 * 60
+): AdvancedListener {
+ return AdvancedListener(T::class.java, autoUnregister, unregisterTimeInSeconds)
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/listenerextension/IAdvancedListener.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/listenerextension/IAdvancedListener.kt
new file mode 100644
index 000000000..e5d92470b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/listenerextension/IAdvancedListener.kt
@@ -0,0 +1,68 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.listenerextension
+
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+interface IAdvancedListener {
+
+ /**
+ * Adds a condition to this listener
+ * @return this listener
+ */
+ fun addCondition(predicate: (T) -> Boolean): IAdvancedListener
+
+ /**
+ * Adds an action to this listener
+ * @return this listener
+ */
+ fun addAction(function: (T) -> Unit): IAdvancedListener
+
+ /**
+ * Unregisters this listener when the specified listener is called
+ * @return this listener
+ */
+ fun unregisterWhen(advancedListener: IAdvancedListener<*>): IAdvancedListener
+
+ /**
+ * Unregisters this listener
+ */
+ fun unregister()
+
+ /**
+ * Unregisters this listener after one call.
+ * @return this listener
+ */
+ fun unregisterAfterCall(): IAdvancedListener
+
+ /**
+ * Returns a promise that completes when the listener was called.
+ */
+ fun toPromise(): ICommunicationPromise
+
+ /**
+ * Returns a promise that completes when the listener was called.
+ */
+ fun toUnitPromise(): ICommunicationPromise
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/GroupLocation.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/GroupLocation.kt
new file mode 100644
index 000000000..2ed70557a
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/GroupLocation.kt
@@ -0,0 +1,84 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.location
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.servicegroup.ICloudServiceGroup
+
+open class GroupLocation(
+ private val serviceGroupName: String,
+ worldName: String,
+ x: Double,
+ y: Double,
+ z: Double,
+ yaw: Float,
+ pitch: Float
+) : SimpleLocation(worldName, x, y, z, yaw, pitch) {
+
+ /**
+ * Returns the group this location belongs to.
+ */
+ fun getGroup(): ICloudServiceGroup? =
+ CloudAPI.instance.getCloudServiceGroupManager().getServiceGroupByName(serviceGroupName)
+
+ override fun add(x: Double, y: Double, z: Double): GroupLocation {
+ return GroupLocation(
+ this.serviceGroupName,
+ this.worldName,
+ this.x + x,
+ this.y + y,
+ this.z + z,
+ this.yaw,
+ this.pitch
+ )
+ }
+
+ override fun setWorldName(worldName: String): GroupLocation {
+ return GroupLocation(this.serviceGroupName, worldName, this.x, this.y, this.z, this.yaw, this.pitch)
+ }
+
+ /**
+ * Returns the template location of this location
+ */
+ fun toTemplateLocation(): TemplateLocation {
+ val group = getGroup() ?: throw IllegalStateException("Group $serviceGroupName cannot be found")
+ return TemplateLocation(group.getTemplateName(), worldName, x, y, z, yaw, pitch)
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (other !is GroupLocation) return false
+ if (!super.equals(other)) return false
+
+ if (serviceGroupName != other.serviceGroupName) return false
+
+ return true
+ }
+
+ override fun hashCode(): Int {
+ var result = super.hashCode()
+ result = 31 * result + serviceGroupName.hashCode()
+ return result
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/ServiceLocation.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/ServiceLocation.kt
new file mode 100644
index 000000000..22f5ef421
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/ServiceLocation.kt
@@ -0,0 +1,128 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.location
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.service.ICloudService
+
+
+class ServiceLocation(
+ val serviceName: String,
+ worldName: String,
+ x: Double,
+ y: Double,
+ z: Double,
+ yaw: Float,
+ pitch: Float
+) : SimpleLocation(worldName, x, y, z, yaw, pitch) {
+
+ val groupName = serviceName.split("-").dropLast(1).joinToString("-")
+
+ constructor(
+ service: ICloudService,
+ worldName: String,
+ x: Double,
+ y: Double,
+ z: Double,
+ yaw: Float,
+ pitch: Float
+ ) : this(service.getName(), worldName, x, y, z, yaw, pitch)
+
+ constructor(service: ICloudService, worldName: String, x: Double, y: Double, z: Double) : this(
+ service,
+ worldName,
+ x,
+ y,
+ z,
+ 0F,
+ 0F
+ )
+
+ constructor(serviceName: String, worldName: String, x: Double, y: Double, z: Double) : this(
+ serviceName,
+ worldName,
+ x,
+ y,
+ z,
+ 0F,
+ 0F
+ )
+
+ /**
+ * Returns this location converted to a [GroupLocation]
+ */
+ fun toGroupLocation() = GroupLocation(groupName, worldName, x, y, z, yaw, pitch)
+
+ /**
+ * Returns the template location of this location
+ */
+ fun toTemplateLocation(): TemplateLocation {
+ val service = getService() ?: throw IllegalStateException("Service $serviceName cannot be found")
+ return TemplateLocation(service.getTemplateName(), worldName, x, y, z, yaw, pitch)
+ }
+
+ /**
+ * Returns the service this location is belongs to.
+ */
+ fun getService() = CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(serviceName)
+
+ override fun add(x: Double, y: Double, z: Double): ServiceLocation {
+ return ServiceLocation(
+ this.serviceName,
+ this.worldName,
+ this.x + x,
+ this.y + y,
+ this.z + z,
+ this.yaw,
+ this.pitch
+ )
+ }
+
+ override fun setWorldName(worldName: String): ServiceLocation {
+ return ServiceLocation(this.serviceName, worldName, this.x, this.y, this.z, this.yaw, this.pitch)
+ }
+
+ /**
+ * Returns a new [ServiceLocation] with a changed [serviceName]
+ */
+ fun setServiceName(serviceName: String): ServiceLocation {
+ return ServiceLocation(serviceName, this.worldName, this.x, this.y, this.z, this.yaw, this.pitch)
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (other !is ServiceLocation) return false
+ if (!super.equals(other)) return false
+
+ if (serviceName != other.serviceName) return false
+
+ return true
+ }
+
+ override fun hashCode(): Int {
+ var result = super.hashCode()
+ result = 31 * result + serviceName.hashCode()
+ return result
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/SimpleLocation.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/SimpleLocation.kt
new file mode 100644
index 000000000..fff7b83de
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/SimpleLocation.kt
@@ -0,0 +1,80 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.location
+
+open class SimpleLocation(
+ val worldName: String,
+ val x: Double,
+ val y: Double,
+ val z: Double,
+ val yaw: Float,
+ val pitch: Float
+) {
+ constructor(worldName: String, x: Double, y: Double, z: Double) : this(worldName, x, y, z, 0F, 0F)
+
+ /**
+ * Returns a new location with the specified [x], [y], [z] values added to the current ones.
+ */
+ open fun add(x: Double, y: Double, z: Double): SimpleLocation {
+ return SimpleLocation(this.worldName, this.x + x, this.y + y, this.z + z, this.yaw, this.pitch)
+ }
+
+ /**
+ * Returns a new location with a different [worldName]
+ */
+ open fun setWorldName(worldName: String): SimpleLocation {
+ return SimpleLocation(worldName, this.x, this.y, this.z, this.yaw, this.pitch)
+ }
+
+ /**
+ * Returns a service location with the specified [serviceName]
+ */
+ fun toServiceLocation(serviceName: String): ServiceLocation {
+ return ServiceLocation(serviceName, worldName, x, y, z, yaw, pitch)
+ }
+
+
+ override fun hashCode(): Int {
+ var result = worldName.hashCode()
+ result = 31 * result + x.hashCode()
+ result = 31 * result + y.hashCode()
+ result = 31 * result + z.hashCode()
+ result = 31 * result + yaw.hashCode()
+ result = 31 * result + pitch.hashCode()
+ return result
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (other !is SimpleLocation) return false
+
+ if (worldName != other.worldName) return false
+ if (x != other.x) return false
+ if (y != other.y) return false
+ if (z != other.z) return false
+ if (yaw != other.yaw) return false
+ if (pitch != other.pitch) return false
+
+ return true
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/TemplateLocation.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/TemplateLocation.kt
new file mode 100644
index 000000000..af40c743b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/location/TemplateLocation.kt
@@ -0,0 +1,75 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.location
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.template.ITemplate
+
+class TemplateLocation(
+ val templateName: String,
+ worldName: String,
+ x: Double,
+ y: Double,
+ z: Double,
+ yaw: Float,
+ pitch: Float
+) : SimpleLocation(worldName, x, y, z, yaw, pitch) {
+
+ /**
+ * Returns the template this location belongs to.
+ */
+ fun getTemplate(): ITemplate? = CloudAPI.instance.getTemplateManager().getTemplateByName(templateName)
+
+ override fun add(x: Double, y: Double, z: Double): TemplateLocation {
+ return TemplateLocation(
+ this.templateName,
+ this.worldName,
+ this.x + x,
+ this.y + y,
+ this.z + z,
+ this.yaw,
+ this.pitch
+ )
+ }
+
+ override fun setWorldName(worldName: String): TemplateLocation {
+ return TemplateLocation(this.templateName, this.worldName, this.x, this.y, this.z, this.yaw, this.pitch)
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (other !is TemplateLocation) return false
+ if (!super.equals(other)) return false
+
+ if (templateName != other.templateName) return false
+
+ return true
+ }
+
+ override fun hashCode(): Int {
+ var result = super.hashCode()
+ result = 31 * result + templateName.hashCode()
+ return result
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/IMessageChannel.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/IMessageChannel.kt
new file mode 100644
index 000000000..712f5eb68
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/IMessageChannel.kt
@@ -0,0 +1,65 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.message
+
+import eu.thesimplecloud.api.network.component.INetworkComponent
+import eu.thesimplecloud.api.service.ICloudService
+import eu.thesimplecloud.api.utils.Nameable
+import eu.thesimplecloud.api.wrapper.IWrapperInfo
+
+interface IMessageChannel : Nameable {
+
+ /**
+ * Returns the class of this [IMessageChannel]
+ */
+ fun getMessageClass(): Class
+
+ /**
+ * Registers a listener
+ */
+ fun registerListener(messageListener: IMessageListener)
+
+ /**
+ * Unregisters a listener
+ */
+ fun unregisterListener(messageListener: IMessageListener)
+
+ /**
+ * Sends a message
+ * As receiver a [ICloudService] or [IWrapperInfo] can be used.
+ * If you want to send a message to the manager you must use [INetworkComponent.MANAGER_COMPONENT]
+ * @param msg the object to send
+ * @param receivers the list of receivers
+ */
+ fun sendMessage(msg: T, receivers: List)
+
+ /**
+ * Sends a message
+ * As receiver a [ICloudService] or [IWrapperInfo] can be used.
+ * If you want to send a message to the manager you must use [INetworkComponent.MANAGER_COMPONENT]
+ * @param msg the object to send
+ * @param receiver the receiver
+ */
+ fun sendMessage(msg: T, receiver: INetworkComponent) = sendMessage(msg, listOf(receiver))
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/IMessageChannelManager.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/IMessageChannelManager.kt
new file mode 100644
index 000000000..ba2ff4a7a
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/IMessageChannelManager.kt
@@ -0,0 +1,50 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.message
+
+import eu.thesimplecloud.api.external.ICloudModule
+
+interface IMessageChannelManager {
+
+ /**
+ * Registers a new [MessageChannel]
+ *
+ */
+ fun registerMessageChannel(cloudModule: ICloudModule, name: String, clazz: Class): IMessageChannel
+
+ /**
+ * Return the [IMessageChannel] found by the specified [name]
+ */
+ fun getMessageChannelByName(name: String): IMessageChannel?
+
+ /**
+ * Unregisters the message channel found by the specified [name]
+ */
+ fun unregisterMessageChannel(name: String)
+
+ /**
+ * Unregisters all message channel registered by the specified [cloudModule]
+ */
+ fun unregisterMessageChannel(cloudModule: ICloudModule)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/IMessageListener.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/IMessageListener.kt
new file mode 100644
index 000000000..51b3ef801
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/IMessageListener.kt
@@ -0,0 +1,34 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.message
+
+import eu.thesimplecloud.api.network.component.INetworkComponent
+
+interface IMessageListener {
+
+ /**
+ * This method will be called when the listener receives a message,
+ */
+ fun messageReceived(msg: T, sender: INetworkComponent)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/Message.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/Message.kt
new file mode 100644
index 000000000..b94daf9cf
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/Message.kt
@@ -0,0 +1,33 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.message
+
+import eu.thesimplecloud.api.client.NetworkComponentReference
+
+data class Message(
+ val channel: String,
+ val className: String,
+ val messageString: String,
+ val senderReference: NetworkComponentReference,
+ val receivers: List
+)
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/MessageChannel.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/MessageChannel.kt
new file mode 100644
index 000000000..c84fb2c39
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/MessageChannel.kt
@@ -0,0 +1,84 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.message
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.external.ICloudModule
+import eu.thesimplecloud.api.network.component.INetworkComponent
+import eu.thesimplecloud.jsonlib.GsonCreator
+import eu.thesimplecloud.jsonlib.JsonLib
+import java.util.concurrent.CopyOnWriteArraySet
+
+
+class MessageChannel(val cloudModule: ICloudModule, private val name: String, private val clazz: Class) :
+ IMessageChannel {
+
+ companion object {
+ private val GSON = GsonCreator().create()
+ }
+
+ private val listeners = CopyOnWriteArraySet>()
+
+ override fun registerListener(messageListener: IMessageListener) {
+ this.listeners.add(messageListener)
+ }
+
+ override fun unregisterListener(messageListener: IMessageListener) {
+ this.listeners.remove(messageListener)
+ }
+
+ /**
+ * Notifies all listeners.
+ */
+ fun notifyListeners(message: Message) {
+ if (message.className != clazz.name)
+ throw IllegalArgumentException("Invalid message class on message channel ${message.channel}: Expected ${clazz.name} but was ${message.className} ")
+ val jsonLib = JsonLib.fromJsonString(message.messageString)
+ val msg = jsonLib.getObject(clazz)
+ val networkComponent = message.senderReference.getNetworkComponent()
+ ?: throw IllegalArgumentException("Connected process of ${message.senderReference.name} is null")
+ this.listeners.forEach { it.messageReceived(msg, networkComponent) }
+ }
+
+ override fun getName(): String {
+ return this.name
+ }
+
+ override fun getMessageClass(): Class {
+ return this.clazz
+ }
+
+ override fun sendMessage(msg: T, receivers: List) {
+ val thisComponent = CloudAPI.instance.getThisSidesNetworkComponent()
+ val messageString = GSON.toJson(msg)
+ val message = Message(
+ getName(),
+ clazz.name,
+ messageString,
+ thisComponent.toNetworkComponentReference(),
+ receivers.map { it.toNetworkComponentReference() })
+ return (CloudAPI.instance.getMessageChannelManager() as MessageChannelManager)
+ .sendMessage(message)
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/MessageChannelManager.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/MessageChannelManager.kt
new file mode 100644
index 000000000..97f14825d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/message/MessageChannelManager.kt
@@ -0,0 +1,91 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.message
+
+import com.google.common.collect.Maps
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.client.NetworkComponentReference
+import eu.thesimplecloud.api.client.NetworkComponentType
+import eu.thesimplecloud.api.external.ICloudModule
+import eu.thesimplecloud.api.network.packets.message.PacketIOChannelMessage
+import eu.thesimplecloud.clientserverapi.client.INettyClient
+import eu.thesimplecloud.clientserverapi.server.INettyServer
+
+class MessageChannelManager : IMessageChannelManager {
+
+ private val channels = Maps.newConcurrentMap>()
+
+ override fun registerMessageChannel(
+ cloudModule: ICloudModule,
+ name: String,
+ clazz: Class
+ ): IMessageChannel {
+ if (this.channels.containsKey(name)) throw IllegalArgumentException("Channel is already registered")
+ val messageChannel = MessageChannel(cloudModule, name, clazz)
+ this.channels[name] = messageChannel
+ return messageChannel
+ }
+
+ override fun getMessageChannelByName(name: String): IMessageChannel? {
+ return this.channels[name] as IMessageChannel?
+ }
+
+ override fun unregisterMessageChannel(name: String) {
+ this.channels.remove(name)
+ }
+
+ override fun unregisterMessageChannel(cloudModule: ICloudModule) {
+ val messageChannelNamesByModule =
+ this.channels.entries.filter { it.value.cloudModule == cloudModule }.map { it.key }
+ messageChannelNamesByModule.forEach { unregisterMessageChannel(it) }
+ }
+
+ fun sendMessage(message: Message) {
+ val packetToSend = PacketIOChannelMessage(message)
+ if (CloudAPI.instance.isManager()) {
+ val server = CloudAPI.instance.getThisSidesCommunicationBootstrap() as INettyServer<*>
+ val allNotManagerReceivers = message.receivers
+ .filter { it.componentType != NetworkComponentType.MANAGER }
+ .mapNotNull { it.getNetworkComponent() }
+ allNotManagerReceivers.forEach {
+ val client = server.getClientManager().getClientByClientValue(it)
+ client?.sendUnitQuery(packetToSend)
+ }
+ } else {
+ val client = CloudAPI.instance.getThisSidesCommunicationBootstrap() as INettyClient
+ client.getConnection().sendUnitQuery(packetToSend)
+ }
+ }
+
+ fun incomingMessage(message: Message) {
+ val channel = this.channels[message.channel]
+ if (CloudAPI.instance.isManager()) {
+ sendMessage(message)
+ if (message.receivers.contains(NetworkComponentReference.MANAGER_COMPONENT_REFERENCE))
+ channel?.notifyListeners(message)
+ } else {
+ channel?.notifyListeners(message)
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/component/IAuthenticatable.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/component/IAuthenticatable.kt
new file mode 100644
index 000000000..852533c9f
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/component/IAuthenticatable.kt
@@ -0,0 +1,39 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.component
+
+import eu.thesimplecloud.clientserverapi.server.client.connectedclient.IConnectedClientValue
+
+interface IAuthenticatable {
+
+ /**
+ * Returns whether this [IConnectedClientValue] is authenticated
+ */
+ fun isAuthenticated(): Boolean
+
+ /**
+ * Sets this [IConnectedClientValue] authenticated
+ */
+ fun setAuthenticated(authenticated: Boolean)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/component/INetworkComponent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/component/INetworkComponent.kt
new file mode 100644
index 000000000..d184e7b16
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/component/INetworkComponent.kt
@@ -0,0 +1,49 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.component
+
+import eu.thesimplecloud.api.client.NetworkComponentReference
+import eu.thesimplecloud.api.client.NetworkComponentType
+import eu.thesimplecloud.api.screen.ICommandExecutable
+
+interface INetworkComponent : IAuthenticatable, ICommandExecutable {
+
+ companion object {
+ @JvmStatic
+ val MANAGER_COMPONENT = ManagerComponent
+ }
+
+ /**
+ * Returns the [NetworkComponentType] of this process
+ */
+ fun getNetworkComponentType(): NetworkComponentType
+
+ /**
+ * Returns the [NetworkComponentReference] of this process.
+ */
+ fun toNetworkComponentReference(): NetworkComponentReference {
+ return NetworkComponentReference(getNetworkComponentType(), getName())
+ }
+
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/component/ManagerComponent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/component/ManagerComponent.kt
new file mode 100644
index 000000000..53c2aebd3
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/component/ManagerComponent.kt
@@ -0,0 +1,50 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.component
+
+import eu.thesimplecloud.api.client.NetworkComponentType
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 01.10.2020
+ * Time: 17:08
+ * @author Frederick Baier
+ */
+object ManagerComponent : INetworkComponent {
+
+ override fun getNetworkComponentType(): NetworkComponentType {
+ return NetworkComponentType.MANAGER
+ }
+
+ override fun isAuthenticated(): Boolean {
+ return true
+ }
+
+ override fun setAuthenticated(authenticated: Boolean) {
+ throw UnsupportedOperationException("Cannot set authenticated state of the manager")
+ }
+
+ override fun getName(): String {
+ return "Manager"
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/PacketIOExecuteFunction.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/PacketIOExecuteFunction.kt
new file mode 100644
index 000000000..9d4dfb291
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/PacketIOExecuteFunction.kt
@@ -0,0 +1,51 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets
+
+import eu.thesimplecloud.api.exception.SerializationException
+import eu.thesimplecloud.api.utils.NoArgsFunction
+import eu.thesimplecloud.api.utils.ObjectSerializer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.BytePacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOExecuteFunction() : BytePacket() {
+
+
+ constructor(function: () -> T) : this() {
+ val noArgsFunction = object : NoArgsFunction {
+ override fun invoke(): T {
+ return function()
+ }
+ }
+ val serializeString = ObjectSerializer.serialize(noArgsFunction)
+ this.buffer.writeBytes(serializeString.toByteArray(Charsets.ISO_8859_1))
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val string = String(this.buffer.array(), Charsets.ISO_8859_1)
+ val noArgsFunction = ObjectSerializer.deserialize>(string) as NoArgsFunction?
+ noArgsFunction ?: return failure(SerializationException("Object was null"))
+ return success(noArgsFunction.invoke())
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/PacketIOPing.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/PacketIOPing.kt
new file mode 100644
index 000000000..f368052ef
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/PacketIOPing.kt
@@ -0,0 +1,40 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets
+
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOPing() : ObjectPacket() {
+
+ constructor(time: Long) : this() {
+ this.value = time
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ return success(System.currentTimeMillis() - value)
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/event/PacketIOCallEvent.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/event/PacketIOCallEvent.kt
new file mode 100644
index 000000000..ad4dcb9c6
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/event/PacketIOCallEvent.kt
@@ -0,0 +1,42 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.event
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.eventapi.ISynchronizedEvent
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOCallEvent() : ObjectPacket() {
+
+ constructor(synchronizedEvent: ISynchronizedEvent) : this() {
+ this.value = synchronizedEvent
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ CloudAPI.instance.getEventManager().call(value, fromPacket = true)
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/language/PacketIOLanguage.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/language/PacketIOLanguage.kt
new file mode 100644
index 000000000..32f126655
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/language/PacketIOLanguage.kt
@@ -0,0 +1,56 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.language
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.language.LanguageProperty
+import eu.thesimplecloud.api.language.LoadedLanguageFile
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 31.10.2020
+ * Time: 22:50
+ * @author Frederick Baier
+ */
+class PacketIOLanguage() : ObjectPacket>() {
+
+
+ constructor(languageProperties: List) : this() {
+ this.value = languageProperties.toTypedArray()
+ }
+
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ val languageManager = CloudAPI.instance.getLanguageManager()
+ languageManager.clearAll()
+ languageManager.registerLanguageFile(
+ CloudAPI.instance.getThisSidesCloudModule(),
+ LoadedLanguageFile(value.toList())
+ )
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/message/PacketIOChannelMessage.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/message/PacketIOChannelMessage.kt
new file mode 100644
index 000000000..3642bad0b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/message/PacketIOChannelMessage.kt
@@ -0,0 +1,45 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.message
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.message.Message
+import eu.thesimplecloud.api.message.MessageChannelManager
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOChannelMessage() : ObjectPacket() {
+
+ constructor(message: Message) : this() {
+ this.value = message
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val message = this.value ?: return contentException("value")
+ val messageChannelManager = CloudAPI.instance.getMessageChannelManager()
+ as MessageChannelManager
+ messageChannelManager.incomingMessage(message)
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOCloudPlayerForceCommandExecution.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOCloudPlayerForceCommandExecution.kt
new file mode 100644
index 000000000..05db55b1f
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOCloudPlayerForceCommandExecution.kt
@@ -0,0 +1,47 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOCloudPlayerForceCommandExecution() : JsonPacket() {
+
+ constructor(cloudPlayer: ICloudPlayer, command: String) : this() {
+ this.jsonLib.append("playerUniqueId", cloudPlayer.getUniqueId())
+ .append("command", command)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val playerUniqueId =
+ this.jsonLib.getObject("playerUniqueId", UUID::class.java) ?: return contentException("playerUniqueId")
+ val command = this.jsonLib.getString("command") ?: return contentException("command")
+ val cloudPlayer = CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(playerUniqueId)
+ cloudPlayer?.forceCommandExecution(command)
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOConnectCloudPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOConnectCloudPlayer.kt
new file mode 100644
index 000000000..4cda90e1c
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOConnectCloudPlayer.kt
@@ -0,0 +1,52 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.exception.UnreachableComponentException
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.api.player.connection.ConnectionResponse
+import eu.thesimplecloud.api.service.ICloudService
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOConnectCloudPlayer() : JsonPacket() {
+
+ constructor(cloudPlayer: ICloudPlayer, service: ICloudService) : this() {
+ this.jsonLib.append("playerUniqueId", cloudPlayer.getUniqueId()).append("serviceName", service.getName())
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val playerUniqueId =
+ this.jsonLib.getObject("playerUniqueId", UUID::class.java) ?: return contentException("playerUniqueId")
+ val serviceName = this.jsonLib.getString("serviceName") ?: return contentException("serviceName")
+ val cloudService =
+ CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(serviceName) ?: return failure(
+ UnreachableComponentException("")
+ )
+ return CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(playerUniqueId)?.connect(cloudService)
+ ?: return failure(NoSuchElementException("Player not found"))
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetAllOnlinePlayers.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetAllOnlinePlayers.kt
new file mode 100644
index 000000000..4baa12cef
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetAllOnlinePlayers.kt
@@ -0,0 +1,36 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOGetAllOnlinePlayers() : ObjectPacket() {
+
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ return CloudAPI.instance.getCloudPlayerManager().getAllOnlinePlayers().then { it.toTypedArray() }
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetCloudPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetCloudPlayer.kt
new file mode 100644
index 000000000..658d16d4f
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetCloudPlayer.kt
@@ -0,0 +1,56 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.CommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOGetCloudPlayer() : JsonPacket() {
+
+
+ constructor(name: String) : this() {
+ this.jsonLib.append("name", name)
+ }
+
+ constructor(uniqueId: UUID) : this() {
+ this.jsonLib.append("uniqueId", uniqueId)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val name = this.jsonLib.getString("name")
+ val uniqueId = this.jsonLib.getObject("uniqueId", UUID::class.java)
+ var cloudPlayer: ICloudPlayer? = null
+ if (name != null) {
+ cloudPlayer = CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(name)
+ }
+ if (uniqueId != null) {
+ cloudPlayer = CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(uniqueId)
+ }
+ return CommunicationPromise.ofNullable(cloudPlayer, NoSuchElementException("Player not found"))
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetNetworkOnlineCount.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetNetworkOnlineCount.kt
new file mode 100644
index 000000000..a8733ead4
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetNetworkOnlineCount.kt
@@ -0,0 +1,40 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 25.09.2020
+ * Time: 20:11
+ * @author Frederick Baier
+ */
+class PacketIOGetNetworkOnlineCount : ObjectPacket() {
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ return success(CloudAPI.instance.getCloudPlayerManager().getAllCachedObjects().size)
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetOfflinePlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetOfflinePlayer.kt
new file mode 100644
index 000000000..dab059c7a
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetOfflinePlayer.kt
@@ -0,0 +1,48 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOGetOfflinePlayer() : JsonPacket() {
+
+ constructor(uniqueId: UUID) : this() {
+ this.jsonLib.append("uniqueId", uniqueId)
+ }
+
+ constructor(name: String) : this() {
+ this.jsonLib.append("name", name)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val uniqueId = this.jsonLib.getObject("uniqueId", UUID::class.java)
+ val name = this.jsonLib.getString("name")
+ if (uniqueId == null && name == null) return contentException("name and uniqueId null")
+ if (uniqueId != null) return CloudAPI.instance.getCloudPlayerManager().getOfflineCloudPlayer(uniqueId)
+ return CloudAPI.instance.getCloudPlayerManager().getOfflineCloudPlayer(name!!)
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetPlayerLocation.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetPlayerLocation.kt
new file mode 100644
index 000000000..6d50cbde7
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetPlayerLocation.kt
@@ -0,0 +1,45 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOGetPlayerLocation() : ObjectPacket() {
+
+ constructor(cloudPlayer: ICloudPlayer) : this() {
+ this.value = cloudPlayer.getUniqueId()
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ val cloudPlayer = CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(value)
+ ?: return failure(NoSuchElementException("Player does not exist"))
+ return cloudPlayer.getLocation()
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetPlayerPing.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetPlayerPing.kt
new file mode 100644
index 000000000..e7a969611
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetPlayerPing.kt
@@ -0,0 +1,28 @@
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+/**
+ * Created by MrManHD
+ * Class create at 20.06.2023 19:48
+ */
+
+class PacketIOGetPlayerPing() : ObjectPacket() {
+
+ constructor(cloudPlayer: ICloudPlayer) : this() {
+ this.value = cloudPlayer.getUniqueId()
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ val cloudPlayer = CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(value)
+ ?: return failure(NoSuchElementException("Player does not exist"))
+ return cloudPlayer.getPing()
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetPlayersConnectedToService.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetPlayersConnectedToService.kt
new file mode 100644
index 000000000..6482bbbba
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetPlayersConnectedToService.kt
@@ -0,0 +1,50 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.exception.NoSuchServiceException
+import eu.thesimplecloud.api.service.ICloudService
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 20.12.2020
+ * Time: 10:01
+ * @author Frederick Baier
+ */
+class PacketIOGetPlayersConnectedToService() : ObjectPacket() {
+
+ constructor(service: ICloudService) : this() {
+ this.value = service.getName()
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ val service = CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(value)
+ ?: return failure(NoSuchServiceException("Service cannot be found"))
+ return service.getOnlinePlayers().then { it.toTypedArray() }
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetRegisteredPlayerCount.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetRegisteredPlayerCount.kt
new file mode 100644
index 000000000..cd9081602
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOGetRegisteredPlayerCount.kt
@@ -0,0 +1,40 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 25.09.2020
+ * Time: 20:11
+ * @author Frederick Baier
+ */
+class PacketIOGetRegisteredPlayerCount : ObjectPacket() {
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ return CloudAPI.instance.getCloudPlayerManager().getRegisteredPlayerCount()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOKickCloudPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOKickCloudPlayer.kt
new file mode 100644
index 000000000..2690ef7e4
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOKickCloudPlayer.kt
@@ -0,0 +1,45 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOKickCloudPlayer() : JsonPacket() {
+
+ constructor(cloudPlayer: ICloudPlayer, message: String) : this() {
+ this.jsonLib.append("playerUniqueId", cloudPlayer.getUniqueId()).append("message", message)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val playerUniqueId =
+ this.jsonLib.getObject("playerUniqueId", UUID::class.java) ?: return contentException("playerUniqueId")
+ val message = this.jsonLib.getString("message") ?: return contentException("message")
+ CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(playerUniqueId)?.kick(message)
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOPlayerHasPermission.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOPlayerHasPermission.kt
new file mode 100644
index 000000000..c47f85677
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOPlayerHasPermission.kt
@@ -0,0 +1,45 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.exception.NoSuchPlayerException
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOPlayerHasPermission() : JsonPacket() {
+
+ constructor(uniqueId: UUID, permission: String) : this() {
+ this.jsonLib.append("uniqueId", uniqueId).append("permission", permission)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val uniqueId = this.jsonLib.getObject("uniqueId", UUID::class.java) ?: return contentException("uniqueId")
+ val permission = this.jsonLib.getString("permission") ?: return contentException("permission")
+ val cloudPlayer = CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(uniqueId)
+ cloudPlayer ?: return failure(NoSuchPlayerException("Player cannot be found"))
+ return cloudPlayer.hasPermission(permission)
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSaveOfflinePlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSaveOfflinePlayer.kt
new file mode 100644
index 000000000..ea4fe33a2
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSaveOfflinePlayer.kt
@@ -0,0 +1,46 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.player.OfflineCloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 16.06.2020
+ * Time: 09:17
+ * @author Frederick Baier
+ */
+class PacketIOSaveOfflinePlayer() : ObjectPacket() {
+
+ constructor(offlinePlayer: OfflineCloudPlayer) : this() {
+ this.value = offlinePlayer
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ return value.update()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendMessageToCloudPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendMessageToCloudPlayer.kt
new file mode 100644
index 000000000..308a07a8a
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendMessageToCloudPlayer.kt
@@ -0,0 +1,54 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import net.kyori.adventure.text.Component
+import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer
+import java.util.*
+
+class PacketIOSendMessageToCloudPlayer() : JsonPacket() {
+
+ constructor(cloudPlayer: ICloudPlayer, component: Component) : this() {
+ val value = GsonComponentSerializer.gson().serialize(component)
+ this.jsonLib
+ .append("playerUniqueId", cloudPlayer.getUniqueId())
+ .append("component", value)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val playerUniqueId =
+ this.jsonLib.getObject("playerUniqueId", UUID::class.java) ?: return contentException("playerUniqueId")
+ val componentString =
+ this.jsonLib.getString("component") ?: return contentException("component")
+
+ val component = GsonComponentSerializer.gson().deserialize(componentString)
+
+ CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(playerUniqueId)?.sendMessage(component)
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendPlayerToLobby.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendPlayerToLobby.kt
new file mode 100644
index 000000000..fa4298e95
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendPlayerToLobby.kt
@@ -0,0 +1,44 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.exception.NoSuchPlayerException
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOSendPlayerToLobby() : ObjectPacket() {
+
+ constructor(uniqueId: UUID) : this() {
+ this.value = uniqueId
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ val cloudPlayer = CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(value)
+ cloudPlayer ?: return failure(NoSuchPlayerException("Player cannot be found"))
+ return cloudPlayer.sendToLobby()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendTablistToPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendTablistToPlayer.kt
new file mode 100644
index 000000000..7a9e93368
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendTablistToPlayer.kt
@@ -0,0 +1,57 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.exception.NoSuchPlayerException
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 20.11.2020
+ * Time: 18:50
+ * @author Frederick Baier
+ */
+class PacketIOSendTablistToPlayer() : JsonPacket() {
+
+ constructor(uniqueId: UUID, headers: Array, footers: Array) : this() {
+ this.jsonLib.append("uniqueId", uniqueId)
+ .append("headers", headers)
+ .append("footers", footers)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val uniqueId = this.jsonLib.getObject("uniqueId", UUID::class.java) ?: return contentException("uniqueId")
+ val headers = this.jsonLib.getObject("headers", Array::class.java) ?: return contentException("headers")
+ val footers = this.jsonLib.getObject("footers", Array::class.java) ?: return contentException("footers")
+ val cloudPlayer = CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(uniqueId)
+ cloudPlayer ?: return failure(NoSuchPlayerException("Player cannot be found"))
+ cloudPlayer.sendTablist(headers, footers)
+ return unit()
+ }
+
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendTitleToCloudPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendTitleToCloudPlayer.kt
new file mode 100644
index 000000000..1214414ab
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSendTitleToCloudPlayer.kt
@@ -0,0 +1,62 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOSendTitleToCloudPlayer() : JsonPacket() {
+
+ constructor(
+ cloudPlayer: ICloudPlayer,
+ title: String,
+ subTitle: String,
+ fadeIn: Int,
+ stay: Int,
+ fadeOut: Int
+ ) : this() {
+ this.jsonLib.append("playerUniqueId", cloudPlayer.getUniqueId())
+ .append("title", title)
+ .append("subTitle", subTitle)
+ .append("fadeIn", fadeIn)
+ .append("stay", stay)
+ .append("fadeOut", fadeOut)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val playerUniqueId =
+ this.jsonLib.getObject("playerUniqueId", UUID::class.java) ?: return contentException("playerUniqueId")
+ val title = this.jsonLib.getString("title") ?: return contentException("title")
+ val subTitle = this.jsonLib.getString("subTitle") ?: return contentException("subTitle")
+ val fadeIn = this.jsonLib.getInt("fadeIn") ?: return contentException("fadeIn")
+ val stay = this.jsonLib.getInt("stay") ?: return contentException("stay")
+ val fadeOut = this.jsonLib.getInt("fadeOut") ?: return contentException("fadeOut")
+ CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(playerUniqueId)
+ ?.sendTitle(title, subTitle, fadeIn, stay, fadeOut)
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSetCloudPlayerUpdates.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSetCloudPlayerUpdates.kt
new file mode 100644
index 000000000..d18001ed4
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOSetCloudPlayerUpdates.kt
@@ -0,0 +1,51 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOSetCloudPlayerUpdates() : JsonPacket() {
+
+ constructor(cloudPlayer: ICloudPlayer, updates: Boolean, serviceName: String) : this() {
+ this.jsonLib.append("playerUniqueId", cloudPlayer.getUniqueId())
+ .append("updates", updates).append("serviceName", serviceName)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val playerUniqueId =
+ this.jsonLib.getObject("playerUniqueId", UUID::class.java) ?: return contentException("playerUniqueId")
+ val updates = this.jsonLib.getBoolean("updates") ?: return contentException("updates")
+ val serviceName = this.jsonLib.getString("serviceName") ?: return contentException("serviceName")
+ val cachedCloudPlayer = CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(playerUniqueId)
+ cachedCloudPlayer?.let {
+ CloudAPI.instance.getCloudPlayerManager().setUpdates(cachedCloudPlayer, updates, serviceName)
+ }
+ return unit()
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOTeleportPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOTeleportPlayer.kt
new file mode 100644
index 000000000..c9f99f8bd
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/player/PacketIOTeleportPlayer.kt
@@ -0,0 +1,50 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.location.SimpleLocation
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class PacketIOTeleportPlayer() : JsonPacket() {
+
+ constructor(cloudPlayer: ICloudPlayer, simpleLocation: SimpleLocation) : this() {
+ this.jsonLib.append("playerUniqueId", cloudPlayer.getUniqueId())
+ .append("simpleLocation", simpleLocation)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val playerUniqueId =
+ this.jsonLib.getObject("playerUniqueId", UUID::class.java) ?: return contentException("playerUniqueId")
+ val simpleLocation = this.jsonLib.getObject("simpleLocation", SimpleLocation::class.java)
+ ?: return contentException("simpleLocation")
+ val cachedCloudPlayer = CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(playerUniqueId)
+ cachedCloudPlayer ?: return failure(NoSuchElementException("Player does not exist"))
+ cachedCloudPlayer.teleport(simpleLocation)
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/screen/PacketIOExecuteCommand.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/screen/PacketIOExecuteCommand.kt
new file mode 100644
index 000000000..4e623289b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/screen/PacketIOExecuteCommand.kt
@@ -0,0 +1,59 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.screen
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.client.NetworkComponentType
+import eu.thesimplecloud.api.network.component.ManagerComponent
+import eu.thesimplecloud.api.screen.ICommandExecutable
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOExecuteCommand() : JsonPacket() {
+
+ constructor(cloudClientType: NetworkComponentType, serviceName: String, command: String) : this() {
+ this.jsonLib.append("cloudClientType", cloudClientType).append("serviceName", serviceName)
+ .append("command", command)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val cloudClientType = this.jsonLib.getObject("cloudClientType", NetworkComponentType::class.java)
+ ?: return contentException("cloudClientType")
+ val serviceName = this.jsonLib.getString("serviceName") ?: return contentException("serviceName")
+ val command = this.jsonLib.getString("command") ?: return contentException("command")
+ val commandExecutable: ICommandExecutable? = when (cloudClientType) {
+ NetworkComponentType.WRAPPER -> {
+ CloudAPI.instance.getWrapperManager().getWrapperByName(serviceName)
+ }
+ NetworkComponentType.SERVICE -> {
+ CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(serviceName)
+ }
+ NetworkComponentType.MANAGER -> {
+ ManagerComponent
+ }
+ }
+ commandExecutable?.executeCommand(command)
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOCopyService.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOCopyService.kt
new file mode 100644
index 000000000..50e0d2e09
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOCopyService.kt
@@ -0,0 +1,51 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.service
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.exception.NoSuchServiceException
+import eu.thesimplecloud.api.service.ICloudService
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 09.06.2020
+ * Time: 14:21
+ * @author Frederick Baier
+ */
+class PacketIOCopyService() : JsonPacket() {
+
+ constructor(service: ICloudService, path: String) : this() {
+ this.jsonLib.append("service", service.getName()).append("path", path)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val serviceName = this.jsonLib.getString("service") ?: return contentException("service")
+ val path = this.jsonLib.getString("path") ?: return contentException("path")
+ val service = CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(serviceName)
+ service ?: return failure(NoSuchServiceException("Service is not registered"))
+ return service.copy(path)
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOStartCloudService.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOStartCloudService.kt
new file mode 100644
index 000000000..e81caf7d0
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOStartCloudService.kt
@@ -0,0 +1,42 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.service
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.service.start.configuration.IServiceStartConfiguration
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOStartCloudService() : ObjectPacket() {
+
+ constructor(configuration: IServiceStartConfiguration) : this() {
+ this.value = configuration
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ val registeredPromise = CloudAPI.instance.getCloudServiceGroupManager().startNewService(value)
+ return registeredPromise.then { it.getName() }
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOStopCloudService.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOStopCloudService.kt
new file mode 100644
index 000000000..a9277083c
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOStopCloudService.kt
@@ -0,0 +1,44 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.service
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOStopCloudService() : ObjectPacket() {
+
+ constructor(name: String) : this() {
+ this.value = name
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val name = this.value ?: return contentException("value")
+ val cloudService = CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(name) ?: return failure(
+ NoSuchElementException("Serve")
+ )
+ cloudService.shutdown()
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOWrapperStartService.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOWrapperStartService.kt
new file mode 100644
index 000000000..d1fd92b86
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/service/PacketIOWrapperStartService.kt
@@ -0,0 +1,43 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.service
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOWrapperStartService() : ObjectPacket() {
+
+ constructor(name: String) : this() {
+ this.value = name
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val name = this.value ?: return contentException("value")
+ val cloudService = CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(name)
+ cloudService ?: throw IllegalStateException("Service to start was null. Name: $name")
+ cloudService.start()
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/servicegroup/PacketIOCloudServiceGroupData.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/servicegroup/PacketIOCloudServiceGroupData.kt
new file mode 100644
index 000000000..c9690caed
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/servicegroup/PacketIOCloudServiceGroupData.kt
@@ -0,0 +1,54 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.servicegroup
+
+import eu.thesimplecloud.api.service.ServiceType
+import eu.thesimplecloud.api.servicegroup.ICloudServiceGroup
+import eu.thesimplecloud.api.servicegroup.impl.DefaultLobbyGroup
+import eu.thesimplecloud.api.servicegroup.impl.DefaultProxyGroup
+import eu.thesimplecloud.api.servicegroup.impl.DefaultServerGroup
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+abstract class PacketIOCloudServiceGroupData() : JsonPacket() {
+
+ constructor(cloudServiceGroup: ICloudServiceGroup) : this() {
+ this.jsonLib.append("serviceType", cloudServiceGroup.getServiceType()).append("group", cloudServiceGroup)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val serviceType =
+ this.jsonLib.getObject("serviceType", ServiceType::class.java) ?: return contentException("serviceType")
+ val serviceGroupClass = when (serviceType) {
+ ServiceType.LOBBY -> DefaultLobbyGroup::class.java
+ ServiceType.SERVER -> DefaultServerGroup::class.java
+ ServiceType.PROXY -> DefaultProxyGroup::class.java
+ }
+ val serviceGroup = this.jsonLib.getObject("group", serviceGroupClass) ?: return contentException("group")
+ return handleData(serviceGroup)
+ }
+
+ abstract fun handleData(cloudServiceGroup: ICloudServiceGroup): ICommunicationPromise
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/servicegroup/PacketIOCreateServiceGroup.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/servicegroup/PacketIOCreateServiceGroup.kt
new file mode 100644
index 000000000..4f7b941ad
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/servicegroup/PacketIOCreateServiceGroup.kt
@@ -0,0 +1,37 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.servicegroup
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.servicegroup.ICloudServiceGroup
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOCreateServiceGroup : PacketIOCloudServiceGroupData {
+
+ constructor(cloudServiceGroup: ICloudServiceGroup) : super(cloudServiceGroup)
+ constructor() : super()
+
+ override fun handleData(cloudServiceGroup: ICloudServiceGroup): ICommunicationPromise {
+ return CloudAPI.instance.getCloudServiceGroupManager().createServiceGroup(cloudServiceGroup)
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/serviceversion/PacketIOServiceVersions.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/serviceversion/PacketIOServiceVersions.kt
new file mode 100644
index 000000000..dc7b0ecff
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/serviceversion/PacketIOServiceVersions.kt
@@ -0,0 +1,50 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.serviceversion
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.service.version.ServiceVersion
+import eu.thesimplecloud.api.service.version.ServiceVersionHandler
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 15.06.2020
+ * Time: 11:15
+ * @author Frederick Baier
+ */
+class PacketIOServiceVersions() : ObjectPacket>() {
+
+ constructor(list: List) : this() {
+ this.value = list.toTypedArray()
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ val serviceVersionHandler = CloudAPI.instance.getServiceVersionHandler() as ServiceVersionHandler
+ serviceVersionHandler.versions = value.asList()
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/cachelist/PacketIOUpdateCacheObject.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/cachelist/PacketIOUpdateCacheObject.kt
new file mode 100644
index 000000000..d542bdca0
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/cachelist/PacketIOUpdateCacheObject.kt
@@ -0,0 +1,72 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.sync.cachelist
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.cachelist.value.ICacheValue
+import eu.thesimplecloud.api.cachelist.value.ICacheValueUpdater
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.CommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOUpdateCacheObject() : JsonPacket() {
+
+ constructor(cacheListName: String, value: Any, action: Action) : this() {
+ this.jsonLib.append("cacheListName", cacheListName)
+ .append("value", value)
+ .append("valueClass", value::class.java.name)
+ .append("action", action)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val cacheListName = this.jsonLib.getString("cacheListName")
+ ?: return contentException("cacheListName")
+ val valueClassName = this.jsonLib.getString("valueClass")
+ ?: return contentException("valueClass")
+ val action = this.jsonLib.getObject("action", Action::class.java)
+ ?: return contentException("action")
+ val valueClass = Class.forName(
+ valueClassName,
+ true,
+ connection.getCommunicationBootstrap().getClassLoaderToSearchObjectPacketsClasses()
+ )
+ val value = this.jsonLib.getObject("value", valueClass) ?: return contentException("value")
+ value as ICacheValue
+
+ return when (action) {
+ Action.UPDATE -> {
+ CloudAPI.instance.getCacheListManager().getCacheListenerByName(cacheListName)
+ ?.update(value, true) ?: CommunicationPromise.UNIT_PROMISE
+ }
+ Action.DELETE -> {
+ CloudAPI.instance.getCacheListManager().getCacheListenerByName(cacheListName)
+ ?.delete(value, true) ?: CommunicationPromise.UNIT_PROMISE
+ }
+ }
+ }
+
+ enum class Action {
+ UPDATE, DELETE
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/list/PacketIOGetAllCachedListProperties.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/list/PacketIOGetAllCachedListProperties.kt
new file mode 100644
index 000000000..337d6dcfa
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/list/PacketIOGetAllCachedListProperties.kt
@@ -0,0 +1,47 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.sync.list
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.combineAllPromises
+
+class PacketIOGetAllCachedListProperties() : ObjectPacket() {
+
+ constructor(name: String) : this() {
+ this.value = name
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ val synchronizedObjectList =
+ CloudAPI.instance.getSynchronizedObjectListManager().getSynchronizedObjectList(value)
+ synchronizedObjectList
+ ?: return failure(NoSuchElementException("No list object found by the specified name: $value"))
+ val allPromises = synchronizedObjectList.getAllCachedObjects()
+ .map { connection.sendUnitQuery(PacketIOUpdateListProperty(value, it)) }
+ return allPromises.combineAllPromises()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/list/PacketIORemoveListProperty.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/list/PacketIORemoveListProperty.kt
new file mode 100644
index 000000000..e8fe337f8
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/list/PacketIORemoveListProperty.kt
@@ -0,0 +1,54 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.sync.list
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.property.IProperty
+import eu.thesimplecloud.api.property.Property
+import eu.thesimplecloud.api.sync.list.ISynchronizedObjectList
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIORemoveListProperty() : JsonPacket() {
+
+ constructor(listName: String, property: IProperty<*>) : this() {
+ this.jsonLib.append("listName", listName).append("property", property)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val listName = this.jsonLib.getString("listName") ?: return contentException("listName")
+ val property = this.jsonLib.getObject("property", Property::class.java) ?: return contentException("property")
+ property as IProperty
+ try {
+ val synchronizedObjectList: ISynchronizedObjectList? =
+ CloudAPI.instance.getSynchronizedObjectListManager().getSynchronizedObjectList(listName)
+ synchronizedObjectList ?: return failure(NoSuchElementException())
+ synchronizedObjectList.remove(property, true)
+
+ } catch (ex: Exception) {
+ throw ex
+ }
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/list/PacketIOUpdateListProperty.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/list/PacketIOUpdateListProperty.kt
new file mode 100644
index 000000000..6dd534c58
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/list/PacketIOUpdateListProperty.kt
@@ -0,0 +1,54 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.sync.list
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.property.IProperty
+import eu.thesimplecloud.api.property.Property
+import eu.thesimplecloud.api.sync.list.ISynchronizedObjectList
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOUpdateListProperty() : JsonPacket() {
+
+ constructor(listName: String, property: IProperty<*>) : this() {
+ this.jsonLib.append("listName", listName).append("property", property)
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val listName = this.jsonLib.getString("listName") ?: return contentException("listName")
+ val property = this.jsonLib.getObject("property", Property::class.java) as Property?
+ ?: return contentException("property")
+ try {
+ val synchronizedObjectList: ISynchronizedObjectList? =
+ CloudAPI.instance.getSynchronizedObjectListManager().getSynchronizedObjectList(listName)
+ synchronizedObjectList ?: return failure(NoSuchElementException())
+ synchronizedObjectList.update(property, true)
+
+ } catch (ex: Exception) {
+ throw ex
+ }
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/object/PacketIOGetGlobalProperty.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/object/PacketIOGetGlobalProperty.kt
new file mode 100644
index 000000000..7fc22ff62
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/object/PacketIOGetGlobalProperty.kt
@@ -0,0 +1,54 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.sync.`object`
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.sync.`object`.GlobalPropertyHolder
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.ObjectPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.CommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 21.06.2020
+ * Time: 09:41
+ * @author Frederick Baier
+ */
+class PacketIOGetGlobalProperty() : ObjectPacket() {
+
+ constructor(name: String) : this() {
+ this.value = name
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val value = this.value ?: return contentException("value")
+ val globalPropertyHolder = CloudAPI.instance.getGlobalPropertyHolder()
+ as GlobalPropertyHolder
+ val property = globalPropertyHolder.getProperty(value)
+ property?.let {
+ globalPropertyHolder.addConnectionToUpdates(value, connection)
+ }
+ return CommunicationPromise.ofNullable(property, NoSuchElementException())
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/object/PacketIORemoveGlobalProperty.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/object/PacketIORemoveGlobalProperty.kt
new file mode 100644
index 000000000..8eb665d7a
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/object/PacketIORemoveGlobalProperty.kt
@@ -0,0 +1,43 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.sync.`object`
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.sync.`object`.GlobalPropertyHolder
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIORemoveGlobalProperty() : JsonPacket() {
+
+ constructor(name: String) : this() {
+ this.jsonLib.append("name", name)
+
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val name = this.jsonLib.getString("name") ?: return contentException("name")
+ (CloudAPI.instance.getGlobalPropertyHolder() as GlobalPropertyHolder).removePropertyFromPacket(name)
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/object/PacketIOUpdateGlobalProperty.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/object/PacketIOUpdateGlobalProperty.kt
new file mode 100644
index 000000000..0497b512d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/network/packets/sync/object/PacketIOUpdateGlobalProperty.kt
@@ -0,0 +1,48 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.network.packets.sync.`object`
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.property.IProperty
+import eu.thesimplecloud.api.property.Property
+import eu.thesimplecloud.api.sync.`object`.GlobalPropertyHolder
+import eu.thesimplecloud.clientserverapi.lib.connection.IConnection
+import eu.thesimplecloud.clientserverapi.lib.packet.packettype.JsonPacket
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+class PacketIOUpdateGlobalProperty() : JsonPacket() {
+
+ constructor(name: String, property: IProperty<*>) : this() {
+ this.jsonLib.append("property", property)
+ .append("name", name)
+
+ }
+
+ override suspend fun handle(connection: IConnection): ICommunicationPromise {
+ val name = this.jsonLib.getString("name") ?: return contentException("name")
+ val property = this.jsonLib.getObject("property", Property::class.java)
+ ?: return contentException("property")
+ (CloudAPI.instance.getGlobalPropertyHolder() as GlobalPropertyHolder).updatePropertyFromPacket(name, property)
+ return unit()
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/ITypeFromClassParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/ITypeFromClassParser.kt
new file mode 100644
index 000000000..477b58d4d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/ITypeFromClassParser.kt
@@ -0,0 +1,38 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser
+
+interface ITypeFromClassParser {
+
+ /**
+ * Returns a set of types this parser supports.
+ */
+ fun supportedTypes(): Set>
+
+ /**
+ * Parses the specified [value] to the specified [clazz]
+ * Returns null if the value could not be parsed
+ */
+ fun parseToObject(value: T, clazz: Class): R?
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/ITypeParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/ITypeParser.kt
new file mode 100644
index 000000000..93170da45
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/ITypeParser.kt
@@ -0,0 +1,41 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser
+
+/**
+ * Parses a object from one type to another
+ */
+interface ITypeParser {
+
+ /**
+ * Parses the object [T] to [R]
+ * @return null if the parse failed
+ */
+ fun parse(value: T): R?
+
+ /**
+ * Returns a list of types this parser can parse
+ */
+ fun allowedTypes(): List>
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/jsondata/IJsonDataTypeParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/jsondata/IJsonDataTypeParser.kt
new file mode 100644
index 000000000..eb081ea3c
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/jsondata/IJsonDataTypeParser.kt
@@ -0,0 +1,29 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.jsondata
+
+import eu.thesimplecloud.api.parser.ITypeParser
+import eu.thesimplecloud.jsonlib.JsonLib
+
+interface IJsonDataTypeParser : ITypeParser {
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/jsondata/JsonDataParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/jsondata/JsonDataParser.kt
new file mode 100644
index 000000000..3b13d140b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/jsondata/JsonDataParser.kt
@@ -0,0 +1,33 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.jsondata
+
+import eu.thesimplecloud.api.parser.ITypeFromClassParser
+import eu.thesimplecloud.jsonlib.JsonLib
+
+class JsonDataParser : ITypeFromClassParser {
+
+ override fun supportedTypes(): Set> = emptySet()
+
+ override fun parseToObject(value: JsonLib, clazz: Class): R? = null
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/IStringTypeParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/IStringTypeParser.kt
new file mode 100644
index 000000000..c16745a2b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/IStringTypeParser.kt
@@ -0,0 +1,28 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string
+
+import eu.thesimplecloud.api.parser.ITypeParser
+
+
+interface IStringTypeParser : ITypeParser
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/StringParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/StringParser.kt
new file mode 100644
index 000000000..526e90fa6
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/StringParser.kt
@@ -0,0 +1,71 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string
+
+import eu.thesimplecloud.api.parser.ITypeFromClassParser
+import eu.thesimplecloud.api.parser.string.typeparser.*
+import eu.thesimplecloud.api.utils.enumValueOf
+import eu.thesimplecloud.api.utils.getEnumValues
+import eu.thesimplecloud.jsonlib.JsonLib
+import java.util.*
+
+class StringParser : ITypeFromClassParser {
+
+ private val parsableTypes = listOf(String::class.java, Int::class.java, UUID::class.java)
+
+ private val customTypeParsers = mutableListOf(
+ CloudLobbyGroupParser(),
+ CloudProxyGroupParser(),
+ CloudServerGroupParser(),
+ CloudServiceGroupParser(),
+ CloudServiceParser(),
+ WrapperInfoParser(),
+ BooleanParser(),
+ TemplateParser(),
+ IntParser(),
+ DoubleParser(),
+ FloatParser()
+ )
+
+ override fun supportedTypes(): Set> =
+ customTypeParsers.map { it.allowedTypes() }.flatten().union(parsableTypes)
+
+ override fun parseToObject(string: String, clazz: Class): R? {
+ if (clazz.isEnum) {
+ clazz as Class>
+ val enumValues = clazz.getEnumValues()
+ val indexOf = enumValues.map { it.toLowerCase() }.indexOf(string.toLowerCase())
+ if (indexOf == -1)
+ return null
+ return clazz.enumValueOf(enumValues[indexOf]) as R
+ }
+ if (parsableTypes.contains(clazz)) {
+ return JsonLib.fromObject(string).getObjectOrNull(clazz)
+ }
+ val parser = customTypeParsers.firstOrNull { it.allowedTypes().contains(clazz) }
+ parser ?: throw IllegalArgumentException("Can't parse class to ${clazz.simpleName}: No parser found.")
+ parser as IStringTypeParser
+ return parser.parse(string)
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/BooleanParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/BooleanParser.kt
new file mode 100644
index 000000000..3a076fda4
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/BooleanParser.kt
@@ -0,0 +1,40 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+
+class BooleanParser : IStringTypeParser {
+
+ override fun allowedTypes(): List> = listOf(Boolean::class.java)
+
+ override fun parse(string: String): Boolean? {
+ when (string.toLowerCase()) {
+ "yes" -> return true
+ "no" -> return false
+ "true" -> return true
+ "false" -> return false
+ }
+ return null
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudLobbyGroupParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudLobbyGroupParser.kt
new file mode 100644
index 000000000..a06cad078
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudLobbyGroupParser.kt
@@ -0,0 +1,35 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+import eu.thesimplecloud.api.servicegroup.grouptype.ICloudLobbyGroup
+
+class CloudLobbyGroupParser : IStringTypeParser {
+
+ override fun allowedTypes(): List> = listOf(ICloudLobbyGroup::class.java)
+
+ override fun parse(string: String): ICloudLobbyGroup? =
+ CloudAPI.instance.getCloudServiceGroupManager().getLobbyGroupByName(string)
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudProxyGroupParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudProxyGroupParser.kt
new file mode 100644
index 000000000..7b7b4ad85
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudProxyGroupParser.kt
@@ -0,0 +1,35 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+import eu.thesimplecloud.api.servicegroup.grouptype.ICloudProxyGroup
+
+class CloudProxyGroupParser : IStringTypeParser {
+
+ override fun allowedTypes(): List> = listOf(ICloudProxyGroup::class.java)
+
+ override fun parse(string: String): ICloudProxyGroup? =
+ CloudAPI.instance.getCloudServiceGroupManager().getProxyGroupByName(string)
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudServerGroupParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudServerGroupParser.kt
new file mode 100644
index 000000000..cd74ba77e
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudServerGroupParser.kt
@@ -0,0 +1,35 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+import eu.thesimplecloud.api.servicegroup.grouptype.ICloudServerGroup
+
+class CloudServerGroupParser : IStringTypeParser {
+
+ override fun allowedTypes(): List> = listOf(ICloudServerGroup::class.java)
+
+ override fun parse(string: String): ICloudServerGroup? =
+ CloudAPI.instance.getCloudServiceGroupManager().getServerGroupByName(string)
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudServiceGroupParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudServiceGroupParser.kt
new file mode 100644
index 000000000..66d107c84
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudServiceGroupParser.kt
@@ -0,0 +1,35 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+import eu.thesimplecloud.api.servicegroup.ICloudServiceGroup
+
+class CloudServiceGroupParser : IStringTypeParser {
+
+ override fun allowedTypes(): List> = listOf(ICloudServiceGroup::class.java)
+
+ override fun parse(string: String): ICloudServiceGroup? =
+ CloudAPI.instance.getCloudServiceGroupManager().getServiceGroupByName(string)
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudServiceParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudServiceParser.kt
new file mode 100644
index 000000000..b7ff93df9
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/CloudServiceParser.kt
@@ -0,0 +1,35 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+import eu.thesimplecloud.api.service.ICloudService
+
+class CloudServiceParser : IStringTypeParser {
+
+ override fun allowedTypes(): List> = listOf(ICloudService::class.java)
+
+ override fun parse(string: String): ICloudService? =
+ CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(string)
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/DoubleParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/DoubleParser.kt
new file mode 100644
index 000000000..599d320f5
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/DoubleParser.kt
@@ -0,0 +1,41 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 07.06.2020
+ * Time: 14:45
+ * @author Frederick Baier
+ */
+class DoubleParser : IStringTypeParser {
+ override fun parse(value: String): Double? {
+ return runCatching { value.toDouble() }.getOrNull()
+ }
+
+ override fun allowedTypes(): List> {
+ return listOf(Double::class.java)
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/FloatParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/FloatParser.kt
new file mode 100644
index 000000000..d8dd30f9d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/FloatParser.kt
@@ -0,0 +1,41 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 07.06.2020
+ * Time: 14:45
+ * @author Frederick Baier
+ */
+class FloatParser : IStringTypeParser {
+ override fun parse(value: String): Float? {
+ return runCatching { value.toFloat() }.getOrNull()
+ }
+
+ override fun allowedTypes(): List> {
+ return listOf(Float::class.java)
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/IntParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/IntParser.kt
new file mode 100644
index 000000000..425572035
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/IntParser.kt
@@ -0,0 +1,41 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+
+/**
+ * Created by IntelliJ IDEA.
+ * Date: 07.06.2020
+ * Time: 14:45
+ * @author Frederick Baier
+ */
+class IntParser : IStringTypeParser {
+ override fun parse(value: String): Int? {
+ return runCatching { value.toInt() }.getOrNull()
+ }
+
+ override fun allowedTypes(): List> {
+ return listOf(Int::class.java)
+ }
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/TemplateParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/TemplateParser.kt
new file mode 100644
index 000000000..d37d7cc3d
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/TemplateParser.kt
@@ -0,0 +1,34 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+import eu.thesimplecloud.api.template.ITemplate
+
+class TemplateParser : IStringTypeParser {
+
+ override fun allowedTypes(): List> = listOf(ITemplate::class.java)
+
+ override fun parse(string: String): ITemplate? = CloudAPI.instance.getTemplateManager().getTemplateByName(string)
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/WrapperInfoParser.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/WrapperInfoParser.kt
new file mode 100644
index 000000000..4ffd525cc
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/parser/string/typeparser/WrapperInfoParser.kt
@@ -0,0 +1,34 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.parser.string.typeparser
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.parser.string.IStringTypeParser
+import eu.thesimplecloud.api.wrapper.IWrapperInfo
+
+class WrapperInfoParser : IStringTypeParser {
+
+ override fun allowedTypes(): List> = listOf(IWrapperInfo::class.java)
+
+ override fun parse(string: String): IWrapperInfo? = CloudAPI.instance.getWrapperManager().getWrapperByName(string)
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/AbstractCloudPlayerManager.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/AbstractCloudPlayerManager.kt
new file mode 100644
index 000000000..13dbe4947
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/AbstractCloudPlayerManager.kt
@@ -0,0 +1,94 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player
+
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.cachelist.AbstractCacheList
+import eu.thesimplecloud.api.cachelist.ICacheObjectUpdateExecutor
+import eu.thesimplecloud.api.event.player.*
+import eu.thesimplecloud.api.eventapi.IEvent
+import eu.thesimplecloud.clientserverapi.lib.promise.CommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+
+abstract class AbstractCloudPlayerManager : AbstractCacheList(spreadUpdates = false),
+ ICloudPlayerManager {
+
+ private val updater = object : ICacheObjectUpdateExecutor {
+ override fun getIdentificationName(): String {
+ return "player-cache"
+ }
+
+ override fun getCachedObjectByUpdateValue(value: ICloudPlayer): ICloudPlayer? {
+ return getCachedCloudPlayer(value.getName())
+ }
+
+ override fun determineEventsToCall(updater: ICloudPlayerUpdater, cachedValue: ICloudPlayer?): List {
+ val events = ArrayList()
+ val playerToUse = cachedValue ?: updater.getCloudPlayer()
+ events.add(CloudPlayerUpdatedEvent(playerToUse))
+ if (cachedValue == null) {
+ events.add(CloudPlayerRegisteredEvent(playerToUse))
+ return events
+ }
+ val connectedServer = updater.getConnectedServer()
+ connectedServer?.let {
+ if (updater.getConnectedServerName() != cachedValue.getConnectedServerName()) {
+ val oldServer = cachedValue.getConnectedServer()
+ events.add(CloudPlayerServerConnectEvent(playerToUse, oldServer, connectedServer))
+ }
+ if (cachedValue.getServerConnectState() == PlayerServerConnectState.CONNECTING && updater.getServerConnectState() == PlayerServerConnectState.CONNECTED) {
+ events.add(CloudPlayerServerConnectedEvent(playerToUse, connectedServer))
+ }
+ }
+
+ return events
+ }
+
+ override fun addNewValue(value: ICloudPlayer) {
+ values.add(value)
+ }
+
+ }
+
+ override fun getUpdateExecutor(): ICacheObjectUpdateExecutor {
+ return this.updater
+ }
+
+ override fun delete(value: ICloudPlayer, fromPacket: Boolean): ICommunicationPromise {
+ val playerToUse = updater.getCachedObjectByUpdateValue(value) ?: value
+ return super.delete(value, fromPacket).addResultListener {
+ CloudAPI.instance.getEventManager().call(CloudPlayerUnregisteredEvent(playerToUse))
+ }
+ }
+
+ /**
+ * Creates a [ICommunicationPromise] with the [cloudPlayer]
+ * If the [cloudPlayer] is not null it will returns a promise completed with the player.
+ * If the [cloudPlayer] is null it will return a promise failed with [NoSuchElementException]
+ */
+ fun promiseOfNullablePlayer(cloudPlayer: ICloudPlayer?): ICommunicationPromise {
+ return CommunicationPromise.ofNullable(cloudPlayer, NoSuchElementException("CloudPlayer not found."))
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/ICloudPlayerUpdater.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/ICloudPlayerUpdater.kt
new file mode 100644
index 000000000..104fa384f
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/ICloudPlayerUpdater.kt
@@ -0,0 +1,51 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.cachelist.value.ICacheValueUpdater
+import eu.thesimplecloud.api.service.ICloudService
+
+interface ICloudPlayerUpdater : ICacheValueUpdater {
+
+ fun getCloudPlayer(): ICloudPlayer
+
+ fun setDisplayName(name: String)
+
+ fun getDisplayName(): String
+
+ fun getServerConnectState(): PlayerServerConnectState
+
+ fun getConnectedServerName(): String?
+
+ fun getConnectedProxyName(): String
+
+ fun getConnectedServer(): ICloudService? {
+ return getConnectedServerName()?.let { CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(it) }
+ }
+
+ fun getConnectedProxy(): ICloudService? {
+ return CloudAPI.instance.getCloudServiceManager().getCloudServiceByName(getConnectedProxyName())
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/IOfflineCloudPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/IOfflineCloudPlayer.kt
new file mode 100644
index 000000000..5f7eeb0f5
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/IOfflineCloudPlayer.kt
@@ -0,0 +1,86 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.player.connection.IPlayerConnection
+import eu.thesimplecloud.api.property.IPropertyMap
+import eu.thesimplecloud.api.utils.Nameable
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+interface IOfflineCloudPlayer : Nameable, IPropertyMap {
+
+ /**
+ * Returns the unique id of this player.
+ */
+ fun getUniqueId(): UUID
+
+ /**
+ * Returns the timestamp of the last login.
+ */
+ fun getLastLogin(): Long
+
+ /**
+ * Returns the timestamp of the first login.
+ */
+ fun getFirstLogin(): Long
+
+ /**
+ * Returns the online time of this player in milliseconds
+ */
+ fun getOnlineTime(): Long
+
+ /**
+ * Returns the las connection of this player.
+ */
+ fun getLastPlayerConnection(): IPlayerConnection
+
+ /**
+ * Returns whether this player is connected to the network.
+ */
+ fun isOnline(): Boolean = false
+
+ /**
+ * Sets the displayname of this player
+ * @param displayName the displayname of this player
+ */
+ fun setDisplayName(displayName: String)
+
+ /**
+ * Returns the displayname of this player
+ */
+ fun getDisplayName(): String
+
+ /**
+ * Returns a new [IOfflineCloudPlayer] with the data of this player
+ */
+ fun toOfflinePlayer(): IOfflineCloudPlayer
+
+ /**
+ * Updates this player to the network
+ * @return a promise that completes when the player was updated
+ */
+ fun update(): ICommunicationPromise = CloudAPI.instance.getCloudPlayerManager().savePlayerToDatabase(this)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/OfflineCloudPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/OfflineCloudPlayer.kt
new file mode 100644
index 000000000..b27cd97bf
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/OfflineCloudPlayer.kt
@@ -0,0 +1,94 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player
+
+import com.google.common.collect.Maps
+import eu.thesimplecloud.api.player.connection.DefaultPlayerConnection
+import eu.thesimplecloud.api.player.connection.IPlayerConnection
+import eu.thesimplecloud.api.property.IProperty
+import eu.thesimplecloud.api.property.Property
+import java.util.*
+import java.util.concurrent.ConcurrentMap
+
+open class OfflineCloudPlayer(
+ name: String,
+ uniqueId: UUID,
+ private val firstLogin: Long,
+ private val lastLogin: Long,
+ private val onlineTime: Long,
+ protected val lastPlayerConnection: DefaultPlayerConnection,
+ @Volatile var propertyMap: ConcurrentMap> = Maps.newConcurrentMap()
+) : SimpleCloudPlayer(name, uniqueId), IOfflineCloudPlayer {
+
+ @Volatile
+ private var displayName = name
+
+ override fun getProperties(): Map> {
+ return this.propertyMap
+ }
+
+ override fun getLastLogin(): Long = this.lastLogin
+
+ override fun getFirstLogin(): Long = this.firstLogin
+
+ override fun getOnlineTime(): Long = this.onlineTime
+
+ override fun getLastPlayerConnection(): IPlayerConnection = this.lastPlayerConnection
+
+ override fun setDisplayName(displayName: String) {
+ this.displayName = displayName
+ }
+
+ override fun getDisplayName(): String {
+ return this.displayName
+ }
+
+ override fun toOfflinePlayer(): IOfflineCloudPlayer {
+ return OfflineCloudPlayer(
+ getName(),
+ getUniqueId(),
+ getFirstLogin(),
+ getLastLogin(),
+ getOnlineTime(),
+ this.lastPlayerConnection,
+ this.propertyMap
+ )
+ }
+
+ override fun setProperty(name: String, value: T): IProperty {
+ require(value !is Property<*>) { "Cannot set ${value::class.java.name} as property" }
+ val property = Property(value)
+ this.propertyMap[name] = property
+ return property
+ }
+
+ override fun clearProperties() {
+ this.propertyMap.clear()
+ }
+
+ override fun removeProperty(name: String) {
+ this.propertyMap.remove(name)
+ }
+
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/PlayerMessageQueue.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/PlayerMessageQueue.kt
new file mode 100644
index 000000000..fd50cb922
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/PlayerMessageQueue.kt
@@ -0,0 +1,61 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.clientserverapi.lib.promise.CommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import net.kyori.adventure.text.Component
+import java.util.concurrent.ConcurrentLinkedQueue
+
+class PlayerMessageQueue(private val player: ICloudPlayer) {
+
+ private val queue = ConcurrentLinkedQueue()
+
+ @Volatile
+ private var lastMessagePromise: ICommunicationPromise = CommunicationPromise.of(Unit)
+
+ @Synchronized
+ fun queueMessage(component: Component): ICommunicationPromise {
+ val promise = CommunicationPromise(500)
+ this.queue.add(QueuedComponent(component, promise))
+ if (this.lastMessagePromise.isDone) {
+ sendNextMessage()
+ }
+ return promise
+ }
+
+ private fun sendNextMessage() {
+ val queuedText = queue.poll()
+ queuedText?.let {
+ val promise = CloudAPI.instance.getCloudPlayerManager().sendMessageToPlayer(player, queuedText.component)
+ this.lastMessagePromise = promise
+ promise.addCompleteListener { sendNextMessage() }
+ promise.addCompleteListener { queuedText.promise.trySuccess(Unit) }
+ }
+ }
+
+
+ private class QueuedComponent(val component: Component, val promise: ICommunicationPromise)
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/PlayerServerConnectState.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/PlayerServerConnectState.kt
new file mode 100644
index 000000000..c31af7e4b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/PlayerServerConnectState.kt
@@ -0,0 +1,37 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player
+
+enum class PlayerServerConnectState {
+
+ /**
+ * The player is currently connecting to a server
+ */
+ CONNECTING,
+
+ /**
+ * The player is fully connected to the server.
+ */
+ CONNECTED
+
+}
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/SimpleCloudPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/SimpleCloudPlayer.kt
new file mode 100644
index 000000000..bdd88986a
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/SimpleCloudPlayer.kt
@@ -0,0 +1,53 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.utils.Nameable
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+open class SimpleCloudPlayer(
+ private val name: String,
+ private val uniqueId: UUID
+) : Nameable {
+
+ override fun getName(): String {
+ return name
+ }
+
+ /**
+ * Returns the uniqueId of this player.
+ */
+ fun getUniqueId(): UUID {
+ return uniqueId
+ }
+
+ /**
+ * Returns a promise of the cloud player of this player.
+ */
+ fun getCloudPlayer(): ICommunicationPromise {
+ return CloudAPI.instance.getCloudPlayerManager().getCloudPlayer(uniqueId)
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/ConnectionResponse.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/ConnectionResponse.kt
new file mode 100644
index 000000000..60a8f3274
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/ConnectionResponse.kt
@@ -0,0 +1,55 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player.connection
+
+import eu.thesimplecloud.api.CloudAPI
+import eu.thesimplecloud.api.event.player.CloudPlayerServerConnectedEvent
+import eu.thesimplecloud.api.listenerextension.cloudListener
+import eu.thesimplecloud.api.player.ICloudPlayer
+import eu.thesimplecloud.api.player.PlayerServerConnectState
+import eu.thesimplecloud.clientserverapi.lib.promise.CommunicationPromise
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import java.util.*
+
+class ConnectionResponse(val playerUniqueId: UUID, val alreadyConnected: Boolean) {
+
+ fun getCloudPlayer(): ICloudPlayer {
+ return CloudAPI.instance.getCloudPlayerManager().getCachedCloudPlayer(playerUniqueId)
+ ?: throw IllegalStateException("Unable to find player by uuid $playerUniqueId")
+ }
+
+ fun createConnectedPromise(): ICommunicationPromise {
+ val cloudPlayer = this.getCloudPlayer()
+ if (alreadyConnected || cloudPlayer.getServerConnectState() == PlayerServerConnectState.CONNECTED)
+ return CommunicationPromise.of(
+ CloudPlayerServerConnectedEvent(
+ cloudPlayer,
+ cloudPlayer.getConnectedServer()!!
+ )
+ )
+ return cloudListener()
+ .addCondition { it.cloudPlayer === cloudPlayer }
+ .toPromise()
+ }
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/DefaultPlayerAddress.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/DefaultPlayerAddress.kt
new file mode 100644
index 000000000..b6fba766a
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/DefaultPlayerAddress.kt
@@ -0,0 +1,33 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player.connection
+
+class DefaultPlayerAddress(
+ private val hostname: String,
+ private val port: Int
+) : IPlayerAddress {
+
+ override fun getHostname(): String = this.hostname
+
+ override fun getPort(): Int = this.port
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/DefaultPlayerConnection.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/DefaultPlayerConnection.kt
new file mode 100644
index 000000000..883551329
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/DefaultPlayerConnection.kt
@@ -0,0 +1,44 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player.connection
+
+import java.util.*
+
+data class DefaultPlayerConnection(
+ private val address: DefaultPlayerAddress,
+ private val name: String,
+ private val uniqueId: UUID,
+ private val onlineMode: Boolean,
+ private val version: Int
+) : IPlayerConnection {
+
+ override fun getAddress(): IPlayerAddress = this.address
+
+ override fun getUniqueId(): UUID = this.uniqueId
+
+ override fun getName(): String = this.name
+
+ override fun isOnlineMode(): Boolean = this.onlineMode
+
+ override fun getVersion(): Int = this.version
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/IPlayerAddress.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/IPlayerAddress.kt
new file mode 100644
index 000000000..f0fb064cb
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/IPlayerAddress.kt
@@ -0,0 +1,37 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player.connection
+
+interface IPlayerAddress {
+
+ /**
+ * Returns the ip address of the player
+ */
+ fun getHostname(): String
+
+ /**
+ * Returns the port of the player
+ */
+ fun getPort(): Int
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/IPlayerConnection.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/IPlayerConnection.kt
new file mode 100644
index 000000000..9ddc7b9ba
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/connection/IPlayerConnection.kt
@@ -0,0 +1,62 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player.connection
+
+import eu.thesimplecloud.api.CloudAPI
+import java.util.*
+
+interface IPlayerConnection {
+
+ /**
+ * Returns the address of this player.
+ */
+ fun getAddress(): IPlayerAddress
+
+ /**
+ * Returns the unique id of this player
+ */
+ fun getUniqueId(): UUID
+
+ /**
+ * Returns the username of this player
+ */
+ fun getName(): String
+
+ /**
+ * Returns whether the player's connection is in online mode.
+ */
+ fun isOnlineMode(): Boolean
+
+ /**
+ * Get the numerical client version of the player attempting to log in.
+ *
+ * @return the protocol version of the client
+ */
+ fun getVersion(): Int
+
+ /**
+ * Returns the cloud player this player connection is linked to
+ */
+ fun getCloudPlayer() = CloudAPI.instance.getCloudPlayerManager().getCloudPlayer(getUniqueId())
+
+}
\ No newline at end of file
diff --git a/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/impl/CloudPlayer.kt b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/impl/CloudPlayer.kt
new file mode 100644
index 000000000..4c68ed52b
--- /dev/null
+++ b/simplecloud-api/src/main/kotlin/eu/thesimplecloud/api/player/impl/CloudPlayer.kt
@@ -0,0 +1,146 @@
+/*
+ * MIT License
+ *
+ * Copyright (C) 2020-2022 The SimpleCloud authors
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+ * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+package eu.thesimplecloud.api.player.impl
+
+import eu.thesimplecloud.api.player.*
+import eu.thesimplecloud.api.player.connection.DefaultPlayerConnection
+import eu.thesimplecloud.api.player.connection.IPlayerConnection
+import eu.thesimplecloud.api.player.text.CloudText
+import eu.thesimplecloud.api.player.text.CloudTextBuilder
+import eu.thesimplecloud.api.property.Property
+import eu.thesimplecloud.clientserverapi.lib.json.PacketExclude
+import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
+import eu.thesimplecloud.jsonlib.JsonLib
+import eu.thesimplecloud.jsonlib.JsonLibExclude
+import net.kyori.adventure.text.Component
+import java.util.*
+import java.util.concurrent.ConcurrentMap
+
+class CloudPlayer(
+ name: String,
+ uniqueId: UUID,
+ firstLogin: Long,
+ lastLogin: Long,
+ onlineTime: Long,
+ @Volatile private var connectedProxyName: String,
+ @Volatile private var connectedServerName: String?,
+ playerConnection: DefaultPlayerConnection,
+ propertyMap: ConcurrentMap>
+) : OfflineCloudPlayer(
+ name,
+ uniqueId,
+ firstLogin,
+ lastLogin,
+ onlineTime,
+ playerConnection,
+ propertyMap
+), ICloudPlayer {
+
+ @Volatile
+ @JsonLibExclude
+ @PacketExclude
+ private var playerUpdater: CloudPlayerUpdater? = CloudPlayerUpdater(this)
+
+ @Volatile
+ private var connectState: PlayerServerConnectState = PlayerServerConnectState.CONNECTING
+
+ @Volatile
+ private var online = true
+
+ @PacketExclude
+ @Volatile
+ private var updatesEnabled = false
+
+ @PacketExclude
+ @JsonLibExclude
+ private var playerMessageQueue: PlayerMessageQueue? = null
+
+ override fun getPlayerConnection(): IPlayerConnection = this.lastPlayerConnection
+
+ override fun getServerConnectState(): PlayerServerConnectState {
+ return this.connectState
+ }
+
+ @Synchronized
+ override fun sendMessage(cloudText: CloudText): ICommunicationPromise