diff --git a/Minecraft-Realms-Emulator.sln b/Minecraft-Realms-Emulator.sln new file mode 100644 index 0000000..a86118c --- /dev/null +++ b/Minecraft-Realms-Emulator.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34511.84 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Minecraft-Realms-Emulator", "Minecraft-Realms-Emulator\Minecraft-Realms-Emulator.csproj", "{A9A21AAF-EF1B-4723-9407-51FD6B831B98}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A9A21AAF-EF1B-4723-9407-51FD6B831B98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9A21AAF-EF1B-4723-9407-51FD6B831B98}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9A21AAF-EF1B-4723-9407-51FD6B831B98}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9A21AAF-EF1B-4723-9407-51FD6B831B98}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BA6B23CA-D2DE-4AD2-9958-A8A4E3976210} + EndGlobalSection +EndGlobal diff --git a/Minecraft-Realms-Emulator/Controllers/WeatherForecastController.cs b/Minecraft-Realms-Emulator/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..d997571 --- /dev/null +++ b/Minecraft-Realms-Emulator/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Minecraft_Realms_Emulator.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj b/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj new file mode 100644 index 0000000..95b1282 --- /dev/null +++ b/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.csproj @@ -0,0 +1,15 @@ + + + + net8.0 + enable + enable + true + Minecraft_Realms_Emulator + + + + + + + diff --git a/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.http b/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.http new file mode 100644 index 0000000..bc29861 --- /dev/null +++ b/Minecraft-Realms-Emulator/Minecraft-Realms-Emulator.http @@ -0,0 +1,6 @@ +@Minecraft_Realms_Emulator_HostAddress = http://localhost:8080 + +GET {{Minecraft_Realms_Emulator_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/Minecraft-Realms-Emulator/Program.cs b/Minecraft-Realms-Emulator/Program.cs new file mode 100644 index 0000000..df2434c --- /dev/null +++ b/Minecraft-Realms-Emulator/Program.cs @@ -0,0 +1,23 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/Minecraft-Realms-Emulator/Properties/launchSettings.json b/Minecraft-Realms-Emulator/Properties/launchSettings.json new file mode 100644 index 0000000..49068ad --- /dev/null +++ b/Minecraft-Realms-Emulator/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:35751", + "sslPort": 0 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:8080", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Minecraft-Realms-Emulator/WeatherForecast.cs b/Minecraft-Realms-Emulator/WeatherForecast.cs new file mode 100644 index 0000000..af49903 --- /dev/null +++ b/Minecraft-Realms-Emulator/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace Minecraft_Realms_Emulator +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/Minecraft-Realms-Emulator/appsettings.Development.json b/Minecraft-Realms-Emulator/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/Minecraft-Realms-Emulator/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/Minecraft-Realms-Emulator/appsettings.json b/Minecraft-Realms-Emulator/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/Minecraft-Realms-Emulator/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}