Skip to content

Commit

Permalink
Merge pull request #87 from theSimpleCloud/dev/2.0
Browse files Browse the repository at this point in the history
Dev/2.0
  • Loading branch information
FllipEis authored Jun 25, 2022
2 parents 77a0fa7 + 17cc58b commit cc11bb2
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 47 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ This wrapper does only run when the manager is running. It connects **automatica
The wrapper will be automatically named **"InternalWrapper"** and it will have **2GB of memory**.
<br />
You can **download**
it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-internalwrapper/2.3.0/simplecloud-module-internalwrapper-2.3.0.jar)
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)
<br />

To edit the memory of the wrapper you can use the command: <br />
Expand All @@ -131,7 +131,7 @@ The **Sign Module** is used to show available services for players in the lobby
The players can click on that sign and will be sent to the server. The layout of the signs is **fully customizable**.
<br />
You can **download**
it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-sign/2.3.0/simplecloud-module-sign-2.3.0.jar)
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")

Expand All @@ -143,7 +143,7 @@ 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.
<br />
You can **download**
it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-proxy/2.3.0/simplecloud-module-proxy-2.3.0.jar)
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")

Expand All @@ -156,7 +156,7 @@ 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.
<br />
You can **download**
it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-proxy/2.3.0/simplecloud-module-proxy-2.3.0.jar)
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")

Expand All @@ -181,7 +181,7 @@ Full join: cloud.full.join
The **Hub Module** provides a hub command for players to switch to a **lobby server**.
<br />
You can **download**
it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-hubcommand/2.3.0/simplecloud-module-hubcommand-2.3.0.jar)
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)

<br />

Expand All @@ -191,7 +191,7 @@ The **Notify Module** sends notifications to players that have the required perm
or **stopped**.
<br />
You can **download**
it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-notify/2.3.0/simplecloud-module-notify-2.3.0.jar)
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")

Expand All @@ -211,7 +211,7 @@ cloud.module.notify.messages
The **REST Module** provides a **restful API**. It is necessary for the **dashboard**.
<br />
You can **download**
it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-rest/2.3.0/simplecloud-module-rest-2.3.0.jar)
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)

<br />

Expand All @@ -220,7 +220,7 @@ it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/the
The **Statistics Module** saves some statistics of the cloud. The data is displayed on the **dashboard**.
<br />
You can **download**
it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-statistics/2.3.0/simplecloud-module-statistics-2.3.0.jar)
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)

<br />

Expand All @@ -229,4 +229,4 @@ it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/the
The **Chat + Tab Module** provides **prefixes** and **suffixes** in the tablist and adds a **chat configuration**.
<br />
You can **download**
it [here](https://repo.thesimplecloud.eu/artifactory/gradle-release-local/eu/thesimplecloud/simplecloud/simplecloud-module-chat-tab/2.3.0/simplecloud-module-chat-tab-2.3.0.jar)
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)
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ plugins {
allprojects {

group 'eu.thesimplecloud.simplecloud'
version '2.4.0'
version '2.4.1'

repositories {
mavenCentral()
Expand Down
1 change: 0 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# 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-6.5.1-bin.zip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

package eu.thesimplecloud.api.player.text

import eu.thesimplecloud.api.player.text.CloudText
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.event.ClickEvent
import java.util.function.Consumer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ class ListCommand : ICommandHandler {

@CommandSubPath("", "Lists some information about the cloud")
fun handleList(commandSender: ICommandSender) {
val darkChatColor = if (commandSender is ICloudPlayer) "&8" else "&7"
val darkChatColor = if (commandSender is ICloudPlayer) "§8" else "§7"

CloudAPI.instance.getWrapperManager().getAllCachedObjects().forEach {
val connectedMessage = if (it.isAuthenticated()) "&aConnected" else "§cNot Connected"
val connectedMessage = if (it.isAuthenticated()) "§aConnected" else "§cNot Connected"
commandSender.sendMessage(
darkChatColor + ">> &3" + it.getName() + darkChatColor + " (&f" + it.getUsedMemory()
+ darkChatColor + "/&f"
darkChatColor + ">> §3" + it.getName() + darkChatColor + " (§f" + it.getUsedMemory()
+ darkChatColor + "/§f"
+ it.getMaxMemory() + "MB" + darkChatColor + " | " + connectedMessage + darkChatColor + ")"
)
}
Expand All @@ -59,40 +59,40 @@ class ListCommand : ICommandHandler {
val serviceName = if (groups.getRegisteredServiceCount() == 1) "Service" else "Services"

commandSender.sendMessage(
darkChatColor + ">> &7" + groups.getName() + darkChatColor + " (&f" + groups.getMaxMemory()
+ "MB " + darkChatColor + "/&f "
darkChatColor + ">> §7" + groups.getName() + darkChatColor + " (§f" + groups.getMaxMemory()
+ "MB " + darkChatColor + "/§f "
+ groups.getRegisteredServiceCount() + " " + serviceName + darkChatColor + ")"
)

groups.getAllServices().forEach {
val wrapperDesign =
if (it.getWrapperName() != null) " " + darkChatColor + "|&3 " + it.getWrapperName() else ""
if (it.getWrapperName() != null) " " + darkChatColor + "|§3 " + it.getWrapperName() else ""
commandSender.sendMessage(
darkChatColor + "- &b" + it.getName() + " " + darkChatColor + "(&f"
darkChatColor + "- §b" + it.getName() + " " + darkChatColor + "(§f"
+ it.getUsedMemory() + "MB" + " ${darkChatColor}| "
+ "&f" + it.getOnlineCount()
+ darkChatColor + "/&f"
+ it.getMaxPlayers() + " " + darkChatColor + "|&3 " + it.getState() + wrapperDesign + darkChatColor + ")"
+ "§f" + it.getOnlineCount()
+ darkChatColor + "/§f"
+ it.getMaxPlayers() + " " + darkChatColor + "|§3 " + it.getState() + wrapperDesign + darkChatColor + ")"
)
}

commandSender.sendMessage(" ")
}

val unusedGroups = cloudServiceGroups.filter { it.getAllServices().isEmpty() }
.joinToString(darkChatColor + ",&f ") { it.getName() }
.joinToString("$darkChatColorf ") { it.getName() }

val maxMemory = CloudAPI.instance.getWrapperManager().getAllCachedObjects().sumBy { it.getMaxMemory() }
val usedMemory = CloudAPI.instance.getWrapperManager().getAllCachedObjects().sumBy { it.getUsedMemory() }

if (unusedGroups.isNotEmpty()) commandSender.sendMessage(
darkChatColor + ">>&7 Unused Groups"
+ darkChatColor + ":&f " + unusedGroups
darkChatColor + ">>§7 Unused Groups"
+ darkChatColor + ":§f " + unusedGroups
)
commandSender.sendMessage(darkChatColor + ">>&7 Online Services" + darkChatColor + ":&f " + cloudServices.size)
commandSender.sendMessage(darkChatColor + ">>§7 Online Services" + darkChatColor + ":§f " + cloudServices.size)
commandSender.sendMessage(
darkChatColor + ">>&7 Memory" + darkChatColor + ":&f " + usedMemory
+ darkChatColor + "/&f" + maxMemory + "MB"
darkChatColor + ">>§7 Memory" + darkChatColor + ":§f " + usedMemory
+ darkChatColor + "/§f" + maxMemory + "MB"
)

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ class MongoOfflineCloudPlayerHandler(val databaseConnectionInformation: Database
val userName = databaseConnectionInformation.userName
val password = databaseConnectionInformation.password
if (password.isBlank() || userName.isBlank()) {
return ConnectionString("mongodb://$host:$port/$databaseName")
return ConnectionString("mongodb://$host:$port/?authSource=$databaseName")
}

return ConnectionString("mongodb://$userName:$password@$host:$port/$databaseName")
return ConnectionString("mongodb://$userName:$password@$host:$port/?authSource=$databaseName")
}

private fun createMongoClient(): MongoClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import eu.thesimplecloud.api.player.ICloudPlayer
import eu.thesimplecloud.api.player.IOfflineCloudPlayer
import eu.thesimplecloud.api.player.SimpleCloudPlayer
import eu.thesimplecloud.api.player.connection.ConnectionResponse
import eu.thesimplecloud.api.player.text.CloudText
import eu.thesimplecloud.api.service.ICloudService
import eu.thesimplecloud.clientserverapi.lib.promise.ICommunicationPromise
import net.kyori.adventure.text.Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#

#Minecraft server properties
#Tue Aug 22 15:33:36 CEST 2017
generator-settings=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

package eu.thesimplecloud.launcher.console.command.provider

import eu.thesimplecloud.api.CloudAPI
import eu.thesimplecloud.api.command.ICommandSender
import eu.thesimplecloud.api.service.ServiceState

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ class BungeeListener(private val plugin: BungeePluginMain) : Listener {
if (!player.hasPermission(ProxyHandler.JOIN_MAINTENANCE_PERMISSION) &&
!proxyConfiguration.whitelist.mapToLowerCase().contains(player.name.lowercase())
) {
player.disconnect(ProxyHandler.getHexColorComponent(ProxyHandler.replaceString(config.maintenanceKickMessage)).toBaseComponent())
player.disconnect(
ProxyHandler.getHexColorComponent(ProxyHandler.replaceString(config.maintenanceKickMessage))
.toBaseComponent()
)
event.isCancelled = true
return
}
Expand All @@ -69,7 +72,10 @@ class BungeeListener(private val plugin: BungeePluginMain) : Listener {
if (!player.hasPermission(ProxyHandler.JOIN_FULL_PERMISSION) &&
!proxyConfiguration.whitelist.mapToLowerCase().contains(player.name.lowercase())
) {
player.disconnect(ProxyHandler.getHexColorComponent(ProxyHandler.replaceString(config.fullProxyKickMessage)).toBaseComponent())
player.disconnect(
ProxyHandler.getHexColorComponent(ProxyHandler.replaceString(config.fullProxyKickMessage))
.toBaseComponent()
)
event.isCancelled = true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import eu.thesimplecloud.api.location.SimpleLocation
import eu.thesimplecloud.api.network.packets.player.*
import eu.thesimplecloud.api.player.ICloudPlayer
import eu.thesimplecloud.api.player.connection.ConnectionResponse
import eu.thesimplecloud.api.player.text.CloudText
import eu.thesimplecloud.api.service.ICloudService
import eu.thesimplecloud.clientserverapi.lib.packet.packetsender.sendQuery
import eu.thesimplecloud.clientserverapi.lib.promise.CommunicationPromise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ import eu.thesimplecloud.plugin.network.packets.PacketOutGetTabSuggestions
import eu.thesimplecloud.plugin.network.packets.PacketOutPlayerConnectToServer
import eu.thesimplecloud.plugin.network.packets.PacketOutPlayerLoginRequest
import eu.thesimplecloud.plugin.startup.CloudPlugin
import net.md_5.bungee.api.ProxyServer
import java.util.*
import java.util.concurrent.CompletableFuture

/**
* Created by IntelliJ IDEA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ class CloudBungeePlugin : Plugin(), ICloudProxyPlugin {

synchronizeOnlineCountTask()
runOfflinePlayerChecker()

CloudAPI.instance.getEventManager().registerListener(CloudPlugin.instance, CloudPlayerDisconnectListener(this.proxy))

CloudAPI.instance.getEventManager()
.registerListener(CloudPlugin.instance, CloudPlayerDisconnectListener(this.proxy))
}

override fun onDisable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import net.md_5.bungee.api.ProxyServer

class CloudPlayerDisconnectListener(
private val proxyServer: ProxyServer
): IListener {
) : IListener {

@CloudEventHandler
fun handle(event: CloudPlayerDisconnectEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ class CloudVelocityPlugin @Inject constructor(val proxyServer: ProxyServer) : IC

synchronizeOnlineCountTask()
runOfflinePlayerChecker()

CloudAPI.instance.getEventManager().registerListener(CloudPlugin.instance, CloudPlayerDisconnectListener(this.proxyServer))

CloudAPI.instance.getEventManager()
.registerListener(CloudPlugin.instance, CloudPlayerDisconnectListener(this.proxyServer))
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import eu.thesimplecloud.plugin.proxy.ProxyEventHandler
import eu.thesimplecloud.plugin.proxy.velocity.CloudVelocityPlugin
import eu.thesimplecloud.plugin.startup.CloudPlugin
import java.util.concurrent.CompletableFuture
import java.util.function.Supplier

/**
* Created by IntelliJ IDEA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import net.kyori.adventure.text.Component

class CloudPlayerDisconnectListener(
private val proxyServer: ProxyServer
): IListener {
) : IListener {

@CloudEventHandler
fun handle(event: CloudPlayerDisconnectEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import com.velocitypowered.api.event.player.ServerPreConnectEvent
import eu.thesimplecloud.api.CloudAPI
import eu.thesimplecloud.api.player.connection.DefaultPlayerAddress
import eu.thesimplecloud.api.player.connection.DefaultPlayerConnection
import eu.thesimplecloud.api.player.text.CloudText
import eu.thesimplecloud.plugin.extension.getCloudPlayer
import eu.thesimplecloud.plugin.proxy.CancelType
import eu.thesimplecloud.plugin.proxy.ProxyEventHandler
Expand Down

0 comments on commit cc11bb2

Please sign in to comment.