Class CloudServerManager

java.lang.Object
net.streamlinecloud.main.core.server.CloudServerManager

public class CloudServerManager extends Object
  • Constructor Details

    • CloudServerManager

      public CloudServerManager()
  • Method Details

    • task

      public void task()
    • startNextServer

      public void startNextServer()
    • fallbackControlTask

      public void fallbackControlTask()
    • getServerByName

      public CloudServer getServerByName(String name)
      Parameters:
      name - The name of the wanted server (without the uuid) (like just lobby-1)
      Returns:
      Returns the prioritized server with this name. Could return different servers if the server gets replaced
    • getServerByUuid

      public CloudServer getServerByUuid(String uuid)
      Parameters:
      uuid - The uuid of the wanted server
      Returns:
      Returns the unique server with the same uuid
    • getServersByName

      @Nullable public @Nullable List<CloudServer> getServersByName(String name)
      Returns a list of CloudServers by the given name.
      This function support wildcard and is intended to use for wildcards.
      Normally it returns only one CloudServer if not used with a wildcard.
      Example: lobby-1 or proxy-1 would return a list with only one server.
      Example: lobby-* or proxy-* would return a list with all servers in a specific group or with a specific naming pattern.
      You cannot use * alone. This is intended and disabled for security reasons.
      Parameters:
      name - name of the server or wildcard.
      Returns:
      list of a CloudServer if found otherwise null
    • startServersIfNeeded

      public void startServersIfNeeded()
      Executes startServersIfNeeded(CloudGroup) for every active group. Groups are processed by priority.
    • startServerByGroup

      public String startServerByGroup(CloudGroup cloudGroup)
    • startServerByGroup

      public String startServerByGroup(CloudGroup cloudGroup, List<String> templates)
    • calculateServerNumber

      public int calculateServerNumber(CloudGroup g)