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

Commit

Permalink
fixed build failing
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsMePepijn committed Nov 12, 2023
1 parent 8de43cd commit 463c298
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/pages/Server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import {
SaveServer,
StartServer,
SetServerStatus,
HandleServerCrash
StartServer, StopServer
HandleServerCrash,
StopServer
} from "../../wailsjs/go/server/ServerController";
import {InstallUpdater} from "./InstallUpdater";
import {useAlert} from "../components/AlertProvider";
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/server/Administration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function Administration({setServ, serv, onServerFilesDeleted}: Props) {
<div className={'space-x-4 w-full flex'}>
<div className={'inline-block'}>
<Checkbox label="Disable update on server start" checked={serv?.disableUpdateOnStart} onChange={(e) => setServ((p) => ({ ...p, disableUpdateOnStart: e.target.checked, convertValues: p.convertValues }))} /><br/>
<Checkbox label="Restart server on crash" checked={serv?.restartOnServerQuit} onChange={(e) => setServ((p) => ({ ...p, restartOnServerQuit: e.target.checked }))} />
<Checkbox label="Restart server on crash" checked={serv?.restartOnServerQuit} onChange={(e) => setServ((p) => ({ ...p, restartOnServerQuit: e.target.checked, convertValues: p.convertValues }))} />

<FormLabel>Custom server "dash" arguments (only use args like: -EnableIdlePlayerKick -ForceAllowCaveFlyers)</FormLabel>
<Input value={serv?.extraDashArgs} onChange={(e) => setServ((p) => ({ ...p, extraDashArgs: e.target.value, convertValues: p.convertValues }))}></Input>
Expand Down
6 changes: 5 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"strconv"
"strings"
"time"

"github.com/JensvandeWiel/ArkAscendedServerManager/helpers"
"github.com/keybase/go-ps"
"github.com/wailsapp/wails/v2/pkg/runtime"
)
Expand All @@ -19,6 +21,7 @@ type Server struct {
Command *exec.Cmd `json:"-"`
ctx context.Context
IsRunning bool `json:"-"`
helpers *helpers.HelpersController

//PREFERENCES

Expand Down Expand Up @@ -122,7 +125,7 @@ func (s *Server) Start() error {
runtime.EventsEmit(s.ctx, "onServerStart", s.Id)

s.SetStatus(true)

if s.DiscordWebHookEnabled {
err := helpers.SendToDiscord(time.Now().Format(time.RFC822)+" ("+s.ServerAlias+") Server has started", s.DiscordWebHook)
if err != nil {
Expand Down Expand Up @@ -158,6 +161,7 @@ func (s *Server) HandleCrash() {
}
}
}
}

// CreateServerCmd returns the command to start the server
func (s *Server) CreateServerCmd() *exec.Cmd {
Expand Down
2 changes: 2 additions & 0 deletions server/server_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"path"
"strconv"

"github.com/JensvandeWiel/ArkAscendedServerManager/helpers"
"github.com/adrg/xdg"
"github.com/wailsapp/wails/v2/pkg/runtime"
)
Expand Down Expand Up @@ -347,6 +348,7 @@ func (c *ServerController) HandleServerCrash(id int) error {
server.HandleCrash()

return nil
}

func (c *ServerController) GetServerStartupCommand(id int) (string, error) {
server, err := c.GetServerWithError(id, false)
Expand Down

0 comments on commit 463c298

Please sign in to comment.