//? Create new servers
        // download jar files
        // add instance to DB
        // Setup EULA and ServerProperties files.
        public async Task <McServer> CreateNewServer(baseMcServer baseMcServer, IProgress <ActionProgressUpdate> createProgress = default, CancellationToken cancellationToken = default)
        {
            McServer createdMcServer = await _mcServerInstallManager.CreateMcServerOnDisk(baseMcServer, createProgress, cancellationToken);

            await _serverContext.Servers.AddAsync(createdMcServer.ToMinecraftServer(), cancellationToken);

            await _serverContext.SaveChangesAsync(cancellationToken);

            return(createdMcServer);
        }
Exemple #2
0
        //? GET
        public async Task <McServer> GetMinecraftServerFromDisk(baseMcServer mcServerIdentifier)
        {
            //Already have base properties
            var mcServer = new McServer(mcServerIdentifier);

            mcServer.ServerProperties = await _mcServerPropertyManager.GetServerPropertiesForServerAsync(mcServerIdentifier.WorkingFolder);

            //mcServer.BannedList = await _mcServerPropertyManager.GetBannedListForServerAsync(mcServerIdentifier);
            //mcServer.Usernames = await _mcServerPropertyManager.GetUsernamesForServerAsync(mcServerIdentifier);
            mcServer.IsEulaTrue = await _mcServerPropertyManager.GetEulaValue(mcServerIdentifier.WorkingFolder);

            return(mcServer);
        }
Exemple #3
0
 public Task ServerCreated(McServer server)
 {
     throw new NotImplementedException();
 }