replace servers.servers singleton with server.Manager
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/pterodactyl/wings/config"
|
||||
"github.com/pterodactyl/wings/installer"
|
||||
"github.com/pterodactyl/wings/server"
|
||||
"github.com/pterodactyl/wings/system"
|
||||
)
|
||||
|
||||
@@ -28,7 +27,8 @@ func getSystemInformation(c *gin.Context) {
|
||||
// Returns all of the servers that are registered and configured correctly on
|
||||
// this wings instance.
|
||||
func getAllServers(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, server.GetServers().All())
|
||||
serverManager := ServerManagerFromContext(c)
|
||||
c.JSON(http.StatusOK, serverManager.GetAll())
|
||||
}
|
||||
|
||||
// Creates a new server on the wings daemon and begins the installation process
|
||||
@@ -52,7 +52,8 @@ func postCreateServer(c *gin.Context) {
|
||||
|
||||
// Plop that server instance onto the request so that it can be referenced in
|
||||
// requests from here-on out.
|
||||
server.GetServers().Add(install.Server())
|
||||
serverManager := ServerManagerFromContext(c)
|
||||
serverManager.Add(install.Server())
|
||||
|
||||
// Begin the installation process in the background to not block the request
|
||||
// cycle. If there are any errors they will be logged and communicated back
|
||||
|
||||
Reference in New Issue
Block a user