Made the service into a daemon that you can route IPC commands to
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
type VsServerConfigOptions struct {
|
||||
Version string `json:"Version"`
|
||||
ServerName string `json:"ServerName"`
|
||||
Port int `json:"Port"`
|
||||
IpAddress string `json:"IpAddress"`
|
||||
@@ -20,29 +21,6 @@ type VsServerConfigOptions struct {
|
||||
PreApprovedRole string `json:"PreApprovedRole"`
|
||||
}
|
||||
|
||||
// func WriteInstanceConfig(instanceDir string, settings VsServerConfig) error {
|
||||
// configPath := filepath.Join(instanceDir, "serverconfig.json")
|
||||
|
||||
// if settings.IpAddress == "" {
|
||||
// settings.IpAddress = "0.0.0.0"
|
||||
// }
|
||||
// if settings.MaxClients == 0 {
|
||||
// settings.MaxClients = 16
|
||||
// }
|
||||
|
||||
// data, err := json.MarshalIndent(settings, "", " ")
|
||||
// if err != nil {
|
||||
// return fmt.Errorf("failed to marshal server configuration: %w", err)
|
||||
// }
|
||||
|
||||
// err = os.WriteFile(configPath, data, 0644)
|
||||
// if err != nil {
|
||||
// return fmt.Errorf("failed writing serverconfig.json to instance: %w", err)
|
||||
// }
|
||||
|
||||
// return nil
|
||||
// }
|
||||
|
||||
func PrepareInstanceConfig(templateVersion string, instanceConfigPath string, config VsServerConfigOptions, cfg *AppConfig) error {
|
||||
templatePath := filepath.Join(cfg.Storage.ConfigTemplatesDir, templateVersion, "serverconfig.json")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user