mirror of
https://github.com/OpenSim-NGC/OpenSim-Sasquatch.git
synced 2024-11-21 06:26:09 -07:00
Flesh out new server definitions for HG and Grid server.
This commit is contained in:
parent
96b993cd60
commit
994c0690cb
24 changed files with 833 additions and 473 deletions
|
@ -37,7 +37,6 @@
|
|||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Source\OpenSim.Data\OpenSim.Data.csproj" />
|
||||
<ProjectReference Include="..\..\Source\OpenSim.Data.MySQL\OpenSim.Data.MySQL.csproj" />
|
||||
<ProjectReference Include="..\..\Source\OpenSim.Data.PGSQL\OpenSim.Data.PGSQL.csproj" />
|
||||
<ProjectReference Include="..\..\Source\OpenSim.Framework\OpenSim.Framework.csproj" />
|
||||
<ProjectReference Include="..\..\Source\OpenSim.Framework.Servers\OpenSim.Framework.Servers.csproj" />
|
||||
<ProjectReference Include="..\..\Source\OpenSim.Framework.Servers.HttpServer\OpenSim.Framework.Servers.HttpServer.csproj" />
|
||||
|
|
|
@ -41,18 +41,19 @@ namespace OpenSim.OfflineIM
|
|||
IMessageTransferModule m_TransferModule = null;
|
||||
private bool m_ForwardOfflineGroupMessages = true;
|
||||
|
||||
private IOfflineIMService m_OfflineIMService;
|
||||
|
||||
private readonly IConfiguration m_configuration;
|
||||
private readonly ILogger<OfflineIMRegionModule> m_logger;
|
||||
private readonly IOfflineIMService m_OfflineIMService;
|
||||
|
||||
public OfflineIMRegionModule(
|
||||
IConfiguration configuration,
|
||||
ILogger<OfflineIMRegionModule> logger
|
||||
ILogger<OfflineIMRegionModule> logger,
|
||||
IOfflineIMService offlineIMService
|
||||
)
|
||||
{
|
||||
m_configuration = configuration;
|
||||
m_logger = logger;
|
||||
m_OfflineIMService = offlineIMService;
|
||||
}
|
||||
|
||||
public void Initialise(IConfiguration pConfiguration)
|
||||
|
@ -65,11 +66,11 @@ namespace OpenSim.OfflineIM
|
|||
|
||||
m_Enabled = true;
|
||||
|
||||
string serviceLocation = cnf.GetValue("OfflineMessageURL", string.Empty);
|
||||
if (string.IsNullOrEmpty(serviceLocation))
|
||||
m_OfflineIMService = new OfflineIMService(m_configuration);
|
||||
else
|
||||
m_OfflineIMService = new OfflineIMServiceRemoteConnector(m_configuration);
|
||||
// string serviceLocation = cnf.GetValue("OfflineMessageURL", string.Empty);
|
||||
// if (string.IsNullOrEmpty(serviceLocation))
|
||||
// m_OfflineIMService = new OfflineIMService(m_configuration);
|
||||
// else
|
||||
// m_OfflineIMService = new OfflineIMServiceRemoteConnector(m_configuration);
|
||||
|
||||
m_ForwardOfflineGroupMessages = cnf.GetValue<bool>("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages);
|
||||
|
||||
|
|
|
@ -0,0 +1,131 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* (c) 2024 Utopia Skye LLC
|
||||
*/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.ImportExport.Collada14;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Server.GridServer.Controllers;
|
||||
|
||||
[ApiController]
|
||||
public class GridInfoController: ControllerBase //, IGridService
|
||||
{
|
||||
private readonly string LogHeader = "[GRID HANDLER]";
|
||||
private readonly ILogger m_logger;
|
||||
private readonly IConfiguration m_config;
|
||||
|
||||
//private readonly IGridService m_GridService;
|
||||
|
||||
public GridInfoController(IConfiguration configuration, ILogger<GridInfoController> logger)
|
||||
{
|
||||
m_config = configuration;
|
||||
m_logger = logger;
|
||||
}
|
||||
|
||||
[Route("gridinfo/register")]
|
||||
[HttpPost]
|
||||
public string RegisterRegion([FromBody]Services.Interfaces.GridRegion regionInfos)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
// public bool DeregisterRegion(UUID regionID)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public List<Services.Interfaces.GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public Services.Interfaces.GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public Services.Interfaces.GridRegion GetRegionByHandle(UUID scopeID, ulong regionhandle)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public Services.Interfaces.GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public Services.Interfaces.GridRegion GetRegionByName(UUID scopeID, string regionName)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public Services.Interfaces.GridRegion GetRegionByURI(UUID scopeID, RegionURI uri)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public List<Services.Interfaces.GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public List<Services.Interfaces.GridRegion> GetRegionsByURI(UUID scopeID, RegionURI uri, int maxNumber)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public List<Services.Interfaces.GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public List<Services.Interfaces.GridRegion> GetDefaultRegions(UUID scopeID)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public List<Services.Interfaces.GridRegion> GetDefaultHypergridRegions(UUID scopeID)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public List<Services.Interfaces.GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public List<Services.Interfaces.GridRegion> GetHyperlinks(UUID scopeID)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
// public List<Services.Interfaces.GridRegion> GetOnlineRegions(UUID scopeID, int x, int y, int maxCount)
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
|
||||
[Route("gridinfo/get_region_flags/{scopeId}/{regionId}")]
|
||||
[HttpPost]
|
||||
public int GetRegionFlags([FromQuery]UUID scopeID, [FromQuery, BindRequired]UUID regionID)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// public Dictionary<string, object> GetExtraFeatures()
|
||||
// {
|
||||
// throw new NotImplementedException();
|
||||
// }
|
||||
}
|
35
Source/OpenSim.Server.GridServer/Dto/RegisterRegion.cs
Normal file
35
Source/OpenSim.Server.GridServer/Dto/RegisterRegion.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* (c) 2024 Utopia Skye LLC
|
||||
*/
|
||||
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Server.GridServer.Dto;
|
||||
|
||||
public class RegisterRegion
|
||||
{
|
||||
public UUID Scope = UUID.Zero;
|
||||
|
||||
// <region0 type="List">
|
||||
// <uuid>dd5b77f8-bf88-45ac-aace-35bd76426c81</uuid>
|
||||
// <locX>256000</locX>
|
||||
// <locY>256000</locY>
|
||||
// <sizeX>256</sizeX>
|
||||
// <sizeY>256</sizeY>
|
||||
// <regionName>test</regionName>
|
||||
// <serverIP>192.168.1.2</serverIP>
|
||||
// <serverHttpPort>9000</serverHttpPort>
|
||||
// <serverURI>http://192.168.1.2:9000/</serverURI>
|
||||
// <serverPort>9000</serverPort>
|
||||
// <regionMapTexture>fc8fda13-c2e9-4e83-8543-b7fe98231399</regionMapTexture>
|
||||
// <parcelMapTexture>00000000-0000-0000-0000-000000000000</parcelMapTexture>
|
||||
// <access>13</access>
|
||||
// <regionSecret>0ab0a97d-ffcc-4b29-a715-74372b763b88</regionSecret>
|
||||
// <owner_uuid>f2f493c0-27d3-4cf2-be97-b44dfdad13b6</owner_uuid>
|
||||
// <Token/>
|
||||
// </region0>
|
||||
}
|
|
@ -1,219 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
using Autofac;
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Server.Base;
|
||||
using OpenSim.Server.Handlers.Base;
|
||||
|
||||
namespace OpenSim.Server.GridServer
|
||||
{
|
||||
public partial class GridServer
|
||||
{
|
||||
private bool m_NoVerifyCertChain = false;
|
||||
private bool m_NoVerifyCertHostname = false;
|
||||
private OpenSimServer m_baseServer;
|
||||
|
||||
protected List<IServiceConnector> m_ServiceConnectors = new();
|
||||
|
||||
protected Dictionary<string,ServiceEntry> serviceList = new();
|
||||
|
||||
private readonly IComponentContext m_context;
|
||||
private readonly ILogger<GridServer> m_logger;
|
||||
private readonly IConfiguration m_configuration;
|
||||
|
||||
public GridServer(
|
||||
IComponentContext componentContext,
|
||||
IConfiguration configuration,
|
||||
ILogger<GridServer> logger,
|
||||
OpenSimServer openSimServer
|
||||
)
|
||||
{
|
||||
m_context = componentContext;
|
||||
m_configuration = configuration;
|
||||
m_logger = logger;
|
||||
m_baseServer = openSimServer;
|
||||
}
|
||||
|
||||
|
||||
private bool ValidateServerCertificate(
|
||||
object sender,
|
||||
X509Certificate certificate,
|
||||
X509Chain chain,
|
||||
SslPolicyErrors sslPolicyErrors
|
||||
)
|
||||
{
|
||||
if (m_NoVerifyCertChain)
|
||||
sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateChainErrors;
|
||||
|
||||
if (m_NoVerifyCertHostname)
|
||||
sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateNameMismatch;
|
||||
|
||||
if (sslPolicyErrors == SslPolicyErrors.None)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens a file and uses it as input to the console command parser.
|
||||
/// </summary>
|
||||
/// <param name="fileName">name of file to use as input to the console</param>
|
||||
private void PrintFileToConsole(string fileName)
|
||||
{
|
||||
if (File.Exists(fileName))
|
||||
{
|
||||
using (StreamReader readFile = File.OpenText(fileName))
|
||||
{
|
||||
string? currentLine;
|
||||
while ((currentLine = readFile.ReadLine()) is not null)
|
||||
{
|
||||
m_logger.LogInformation("[!]" + currentLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int Startup()
|
||||
{
|
||||
Culture.SetCurrentCulture();
|
||||
Culture.SetDefaultCurrentCulture();
|
||||
|
||||
ServicePointManager.DefaultConnectionLimit = 64;
|
||||
ServicePointManager.MaxServicePointIdleTime = 30000;
|
||||
ServicePointManager.Expect100Continue = false;
|
||||
ServicePointManager.UseNagleAlgorithm = false;
|
||||
|
||||
ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
|
||||
|
||||
WebUtil.SetupHTTPClients(m_NoVerifyCertChain, m_NoVerifyCertHostname, null, 32);
|
||||
|
||||
m_baseServer.Startup();
|
||||
|
||||
if (LoadServices() <= 0)
|
||||
{
|
||||
throw new Exception("GridServer.Startup - No Services Defined");
|
||||
}
|
||||
|
||||
foreach (var kvp in serviceList)
|
||||
{
|
||||
try
|
||||
{
|
||||
var service = m_context.ResolveNamed<IServiceConnector>(kvp.Value.ModuleName);
|
||||
var server = MainServer.Instance;
|
||||
// if (kvp.Value.Port != 0)
|
||||
// server = MainServer.GetHttpServer()
|
||||
|
||||
service.Initialize(server);
|
||||
m_ServiceConnectors.Add(service);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_logger.LogError(e, $"Configuration for {kvp.Key} not found.");
|
||||
}
|
||||
}
|
||||
|
||||
// if (friendlyName == "LLLoginServiceInConnector")
|
||||
// server.AddSimpleStreamHandler(new IndexPHPHandler(server));
|
||||
|
||||
// m_logger.LogInformation("[SERVER]: Loading {0} on port {1}", friendlyName, server.Port);
|
||||
|
||||
// IServiceConnector connector = null;
|
||||
|
||||
// object[] modargs = new object[] { m_configuration, server, configName };
|
||||
// connector = ServerUtils.LoadPlugin<IServiceConnector>(conn, modargs);
|
||||
|
||||
// if (connector == null)
|
||||
// {
|
||||
// modargs = new object[] { m_configuration, server };
|
||||
// connector = ServerUtils.LoadPlugin<IServiceConnector>(conn, modargs);
|
||||
// }
|
||||
|
||||
// if (connector != null)
|
||||
// {
|
||||
// m_ServiceConnectors.Add(connector);
|
||||
// m_logger.LogInformation("[SERVER]: {0} loaded successfully", friendlyName);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// m_logger.LogError($"[SERVER]: Failed to load {conn}");
|
||||
// }
|
||||
|
||||
m_logger.LogInformation("Grid Services Connectors Initialized");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private int LoadServices()
|
||||
{
|
||||
var servicesConfig = m_configuration.GetSection("ServiceList");
|
||||
if (servicesConfig.Exists() is false)
|
||||
{
|
||||
throw new Exception("LoadConfiguration: No ServiceList found");
|
||||
}
|
||||
|
||||
var services = servicesConfig.AsEnumerable();
|
||||
foreach (var kvp in services)
|
||||
{
|
||||
if ((kvp.Key == "ServiceList") && (kvp.Value == null))
|
||||
continue;
|
||||
|
||||
string serviceName = kvp.Key.Split(new char[] { ':' })[1];
|
||||
ServiceEntry entry = new ServiceEntry(kvp.Value);
|
||||
serviceList.Add(serviceName, entry);
|
||||
}
|
||||
|
||||
return serviceList.Count;
|
||||
}
|
||||
|
||||
public void Work()
|
||||
{
|
||||
MainConsole.Instance.DefaultPrompt = "Grid$ ";
|
||||
|
||||
while (true)
|
||||
{
|
||||
MainConsole.Instance.Prompt();
|
||||
}
|
||||
}
|
||||
|
||||
public void Shutdown(int res)
|
||||
{
|
||||
//m_Server?.Shutdown();
|
||||
Util.StopThreadPool();
|
||||
Environment.Exit(res);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
using Autofac;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Server.GridServer
|
||||
{
|
||||
public sealed class GridService : IHostedService
|
||||
{
|
||||
private readonly Task _completedTask = Task.CompletedTask;
|
||||
|
||||
private readonly ApplicationContext _applicationContext;
|
||||
|
||||
private readonly ILogger<GridService> _logger;
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly GridServer _openSimServer;
|
||||
|
||||
public GridService(
|
||||
IComponentContext componentContext,
|
||||
IConfiguration configuration,
|
||||
ILogger<GridService> logger,
|
||||
GridServer openSimServer
|
||||
)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_logger = logger;
|
||||
|
||||
// _applicationContext = ApplicationContext.GetInstance();
|
||||
// _applicationContext?.Initialize(componentContext);
|
||||
|
||||
// _configuration = _applicationContext.Configuration;
|
||||
// _logger = _applicationContext.CreateLogger<GridService>();
|
||||
|
||||
_openSimServer = openSimServer;
|
||||
}
|
||||
|
||||
public Task StartAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
_logger.LogInformation("{Service} is running.", nameof(Server.GridServer));
|
||||
|
||||
_openSimServer.Startup();
|
||||
_openSimServer.Work();
|
||||
|
||||
return _completedTask;
|
||||
}
|
||||
|
||||
public Task StopAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
int m_res = 0;
|
||||
|
||||
_logger.LogInformation("{Service} is stopping.", nameof(Server.GridServer));
|
||||
|
||||
_openSimServer.Shutdown(m_res);
|
||||
|
||||
return _completedTask;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>.</DockerfileContext>
|
||||
<EnableSdkContainerSupport>true</EnableSdkContainerSupport>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ContainerImageName>OpenSim.Server.Gridserver</ContainerImageName>
|
||||
<PublishProfile>DefaultContainer</PublishProfile>
|
||||
<ContainerImageTags>1.1.0;latest</ContainerImageTags>
|
||||
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="OpenMetaverse">
|
||||
<HintPath>..\..\bin\OpenMetaverse.dll</HintPath>
|
||||
|
@ -16,37 +29,36 @@
|
|||
<HintPath>..\..\bin\OpenMetaverseTypes.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="XMLRPC">
|
||||
<HintPath>..\..\bin\XMLRPC.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Source\OpenSim.Framework\OpenSim.Framework.csproj" />
|
||||
<ProjectReference Include="..\..\Source\OpenSim.Server.Base\OpenSim.Server.Base.csproj" />
|
||||
<ProjectReference Include="..\..\Source\OpenSim.Server.Handlers\OpenSim.Server.Handlers.csproj" />
|
||||
<ProjectReference Include="..\OpenSim.Server.Common\OpenSim.Server.Common.csproj" />
|
||||
<ProjectReference Include="..\OpenSim.Data\OpenSim.Data.csproj" />
|
||||
<ProjectReference Include="..\OpenSim.Data.MySQL\OpenSim.Data.MySQL.csproj" />
|
||||
<ProjectReference Include="..\..\Source\OpenSim.Services\OpenSim.Services.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MediatR" Version="12.2.0" />
|
||||
<PackageReference Include="Autofac" Version="8.0.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
|
||||
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="8.0.0" />
|
||||
<PackageReference Include="ConfigurationSubstitutor" Version="1.5.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Events/**"/>
|
||||
<Compile Remove="Models/**"/>
|
||||
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageReference Include="MediatR" Version="12.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.6">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.6" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenSim.Data.Model\OpenSim.Data.Model.csproj" />
|
||||
<ProjectReference Include="..\OpenSim.Services.Interfaces\OpenSim.Services.Interfaces.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -1,108 +1,110 @@
|
|||
/*
|
||||
* OpenSim.NGC Tranquillity
|
||||
* Copyright (C) 2024 Utopia Skye LLC and its affiliates.
|
||||
* All rights reserved.
|
||||
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
|
||||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
using System.CommandLine;
|
||||
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using ConfigurationSubstitution;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Data.Model.Core;
|
||||
using OpenSim.Data.Model.Economy;
|
||||
using OpenSim.Data.Model.Identity;
|
||||
using OpenSim.Data.Model.Region;
|
||||
using OpenSim.Data.Model.Search;
|
||||
|
||||
using OpenSim.Server.Base;
|
||||
using OpenSim.Server.Common;
|
||||
using OpenSim.Server.Handlers;
|
||||
using OpenSim.Data.MySQL;
|
||||
using OpenSim.Services;
|
||||
namespace OpenSim.Server.GridServer;
|
||||
|
||||
namespace OpenSim.Server.GridServer
|
||||
public class Program
|
||||
{
|
||||
class Program
|
||||
public static void SetCommandLineArgs(string console, List<string> inifiles, string prompt)
|
||||
{
|
||||
public static async Task<int> Main(string[] args)
|
||||
|
||||
}
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
// var rootCommand = new RootCommand("Grid Server");
|
||||
|
||||
// var consoleOption = new Option<string>
|
||||
// (name: "--console", description: "console type, one of basic, local or rest.", getDefaultValue: () => "local")
|
||||
// .FromAmong("basic", "local", "rest");
|
||||
// var inifileOption = new Option<List<string>>
|
||||
// (name: "--inifile", description: "Specify the location of zero or more .ini file(s) to read.");
|
||||
// var promptOption = new Option<string>
|
||||
// (name: "--prompt", description: "Overide the server prompt",
|
||||
// getDefaultValue: () => "GRID> ");
|
||||
|
||||
// rootCommand.Add(consoleOption);
|
||||
// rootCommand.Add(inifileOption);
|
||||
// rootCommand.Add(promptOption);
|
||||
|
||||
// rootCommand.SetHandler(
|
||||
// (consoleOptionValue, inifileOptionValue, promptOptionValue) =>
|
||||
// {
|
||||
// SetCommandLineArgs(consoleOptionValue, inifileOptionValue, promptOptionValue);
|
||||
// },
|
||||
// consoleOption, inifileOption, promptOption);
|
||||
|
||||
// await rootCommand.InvokeAsync(args);
|
||||
|
||||
// Create Builder and run program
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// builder.Configuration.AddCommandLine(args, switchMappings);
|
||||
|
||||
// builder.Configuration.EnableSubstitutions("$(", ")");
|
||||
builder.Configuration.AddIniFile("GridServer.ini", optional: true, reloadOnChange: false);
|
||||
|
||||
// foreach (var item in inifile)
|
||||
// {
|
||||
// builder.Configuration.AddIniFile(item, optional: true, reloadOnChange: true);
|
||||
// }
|
||||
|
||||
// Initialize Database
|
||||
var connectionString = builder.Configuration.GetConnectionString("IdentityConnection");
|
||||
builder.Services.AddDbContext<IdentityContext>(
|
||||
options => options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)));
|
||||
|
||||
var coreConnectionString = builder.Configuration.GetConnectionString("OpenSimCoreConnection");
|
||||
builder.Services.AddDbContext<OpenSimCoreContext>(
|
||||
options => options.UseMySql(coreConnectionString, ServerVersion.AutoDetect(coreConnectionString)));
|
||||
|
||||
var regionConnectionString = builder.Configuration.GetConnectionString("OpenSimRegionConnection");
|
||||
builder.Services.AddDbContext<OpenSimRegionContext>(
|
||||
options => options.UseMySql(regionConnectionString, ServerVersion.AutoDetect(regionConnectionString)));
|
||||
|
||||
var economyConnectionString = builder.Configuration.GetConnectionString("OpenSimEconomyConnection");
|
||||
builder.Services.AddDbContext<OpenSimEconomyContext>(
|
||||
options => options.UseMySql(economyConnectionString, ServerVersion.AutoDetect(economyConnectionString)));
|
||||
|
||||
var searchConnectionString = builder.Configuration.GetConnectionString("OpenSimSearchConnection");
|
||||
builder.Services.AddDbContext<OpenSimSearchContext>(
|
||||
options => options.UseMySql(searchConnectionString, ServerVersion.AutoDetect(searchConnectionString)));
|
||||
|
||||
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
|
||||
|
||||
builder.Services.AddControllers()
|
||||
.AddXmlDataContractSerializerFormatters();
|
||||
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen(c =>
|
||||
{
|
||||
var rootCommand = new RootCommand();
|
||||
c.SwaggerDoc("v1", new OpenApiInfo { Title = "OpenSimulator Grid Services v0.8", Version = "v1" });
|
||||
});
|
||||
|
||||
var consoleOption = new Option<string>
|
||||
(name: "--console", description: "console type, one of basic, local or rest.", getDefaultValue: () => "local")
|
||||
.FromAmong("basic", "local", "rest");
|
||||
var inifileOption = new Option<List<string>>
|
||||
(name: "--inifile", description: "Specify the location of zero or more .ini file(s) to read.");
|
||||
var promptOption = new Option<string>
|
||||
(name: "--prompt", description: "Overide the server prompt",
|
||||
getDefaultValue: () => "GRID> ");
|
||||
var app = builder.Build();
|
||||
|
||||
rootCommand.AddGlobalOption(consoleOption);
|
||||
rootCommand.AddGlobalOption(inifileOption);
|
||||
rootCommand.AddGlobalOption(promptOption);
|
||||
|
||||
rootCommand.SetHandler((console, inifile, prompt) =>
|
||||
{
|
||||
StartGrid(console, inifile, prompt);
|
||||
},
|
||||
consoleOption, inifileOption, promptOption);
|
||||
|
||||
return await rootCommand.InvokeAsync(args);
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
private static void StartGrid(string console, List<string> inifile, string prompt)
|
||||
{
|
||||
IHostBuilder builder = Host.CreateDefaultBuilder()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureAppConfiguration(configuration =>
|
||||
{
|
||||
//configuration.AddCommandLine(args, switchMappings);
|
||||
configuration.AddIniFile("GridServer.ini", optional: true, reloadOnChange: false);
|
||||
foreach (var item in inifile)
|
||||
{
|
||||
configuration.AddIniFile(item, optional: true, reloadOnChange: true);
|
||||
}
|
||||
configuration.EnableSubstitutions("$(", ")");
|
||||
})
|
||||
.ConfigureContainer<ContainerBuilder>(builder =>
|
||||
{
|
||||
builder.RegisterType<OpenSimServer>().SingleInstance();
|
||||
builder.RegisterType<GridServer>().SingleInstance();
|
||||
app.UseHttpsRedirection();
|
||||
app.UseAuthorization();
|
||||
|
||||
builder.RegisterType<BaseHttpServer>().As<IHttpServer>();
|
||||
app.MapControllers();
|
||||
|
||||
if (console == "basic")
|
||||
builder.RegisterType<MainConsole>().As<ICommandConsole>().SingleInstance();
|
||||
else if (console == "rest")
|
||||
builder.RegisterType<RemoteConsole>().As<ICommandConsole>().SingleInstance();
|
||||
else if (console == "mock")
|
||||
builder.RegisterType<MockConsole>().As<ICommandConsole>().SingleInstance();
|
||||
else
|
||||
builder.RegisterType<LocalConsole>().As<ICommandConsole>().SingleInstance();
|
||||
|
||||
// Register Grid Modules
|
||||
builder.RegisterModule(new MySQLDataModule());
|
||||
builder.RegisterModule(new OpenSimServicesModule());
|
||||
builder.RegisterModule(new OpenSimServerHandlersModule());
|
||||
})
|
||||
.ConfigureServices(services =>
|
||||
{
|
||||
services.AddHostedService<GridService>();
|
||||
services.AddHostedService<PidFileService>();
|
||||
});
|
||||
|
||||
IHost host = builder.Build();
|
||||
|
||||
host.Run();
|
||||
}
|
||||
app.Run();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,16 @@
|
|||
}
|
||||
},
|
||||
"profiles": {
|
||||
"OpenSim.Server.GridServer": {
|
||||
"commandName": "Project",
|
||||
"commandLineArgs": "--console local --inifile L:\\Documents\\Projects\\OpenSimulator\\Config\\OpenSim.Server.Grid.ini",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"OpenSim.Server.RobustServer": {
|
||||
"commandName": "Project",
|
||||
"commandLineArgs": "--console local --inifile L:\\Documents\\Projects\\OpenSimulator\\Config\\Robust.Grid.ini"
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
namespace OpenSim.Server.GridServer
|
||||
{
|
||||
public partial class GridServer
|
||||
{
|
||||
public struct ServiceEntry
|
||||
{
|
||||
public ServiceEntry(uint port, string module) { Port = port; ModuleName = module; }
|
||||
public ServiceEntry(string entry)
|
||||
{
|
||||
string[] split = entry.Split(new char[] { ':' });
|
||||
Port = Convert.ToUInt32(split[0]);
|
||||
ModuleName = string.IsNullOrEmpty(split[1]) ? string.Empty : split[1];
|
||||
}
|
||||
|
||||
public uint Port { get; }
|
||||
public string ModuleName { get; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
|
||||
"DetailedErrors": true,
|
||||
|
||||
"ConnectionStrings": {
|
||||
"IdentityConnection": "server=localhost; port=3306; database=identity; user=opensim; password=*M1ke.Chase*;GuidFormat=None",
|
||||
"OpenSimCoreConnection": "server=localhost; port=3306; database=opensim; user=opensim; password=*M1ke.Chase*;GuidFormat=None",
|
||||
"OpenSimRegionConnection": "server=localhost; port=3306; database=opensim; user=opensim; password=*M1ke.Chase*;GuidFormat=None",
|
||||
"OpenSimEconomyConnection": "server=localhost; port=3306; database=osmoney; user=opensim; password=*M1ke.Chase*; GuidFormat=None",
|
||||
"OpenSimSearchConnection": "server=localhost; port=3306; database=ossearch; user=opensim; password=*M1ke.Chase*; GuidFormat=None",
|
||||
"OpenSimMarketConnection": "server=localhost; port=3306; database=market; user=opensim; password=*M1ke.Chase*; GuidFormat=None"
|
||||
},
|
||||
|
||||
"DefaultGroups": {
|
||||
"GroupNames": [ "Utopia Skye Welcome" ]
|
||||
},
|
||||
|
||||
"RemoteAdmin": {
|
||||
"UserName": "radmin",
|
||||
"AccessCode": "N0tAChance",
|
||||
"UserService_URL": "http://localhost:9000/xmlrpc/RemoteAdmin"
|
||||
},
|
||||
|
||||
"AuthMessageSenderOptions": {
|
||||
"FromEmailAddress": "noreply@utopiaskye.com",
|
||||
"SendGridKey": "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"
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"OpenSimDatabase": "Your database connect string here"
|
||||
}
|
||||
}
|
|
@ -1,19 +1,35 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"Microsoft.Hosting.Lifetime": "Information",
|
||||
"Microsoft.EntityFrameworkCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore.Database": "Warning"
|
||||
},
|
||||
"Console": {
|
||||
"FormatterName": "Console",
|
||||
"FormatterOptions": {
|
||||
"SingleLine": false,
|
||||
"IncludeScopes": true,
|
||||
"TimestampFormat": "yyyy-MM-ddTHH:mm:ss.fffffffK : ",
|
||||
"UseUtcTimestamp": true
|
||||
}
|
||||
}
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
|
||||
"DetailedErrors": true,
|
||||
|
||||
"ConnectionStrings": {
|
||||
"IdentityConnection": "server=localhost; port=3306; database=identity; user=opensim; password=*M1ke.Chase*;GuidFormat=None",
|
||||
"OpenSimCoreConnection": "server=localhost; port=3306; database=opensim; user=opensim; password=*M1ke.Chase*;GuidFormat=None",
|
||||
"OpenSimRegionConnection": "server=localhost; port=3306; database=opensim; user=opensim; password=*M1ke.Chase*;GuidFormat=None",
|
||||
"OpenSimEconomyConnection": "server=localhost; port=3306; database=osmoney; user=opensim; password=*M1ke.Chase*; GuidFormat=None",
|
||||
"OpenSimSearchConnection": "server=localhost; port=3306; database=ossearch; user=opensim; password=*M1ke.Chase*; GuidFormat=None",
|
||||
"OpenSimMarketConnection": "server=localhost; port=3306; database=market; user=opensim; password=*M1ke.Chase*; GuidFormat=None"
|
||||
},
|
||||
|
||||
"DefaultGroups": {
|
||||
"GroupNames": [ "Utopia Skye Welcome" ]
|
||||
},
|
||||
|
||||
"RemoteAdmin": {
|
||||
"UserName": "radmin",
|
||||
"AccessCode": "N0tAChance",
|
||||
"UserService_URL": "http://localhost:9000/xmlrpc/RemoteAdmin"
|
||||
},
|
||||
|
||||
"AuthMessageSenderOptions": {
|
||||
"FromEmailAddress": "noreply@utopiaskye.com",
|
||||
"SendGridKey": "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"
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"OpenSimDatabase": "Your database connect string here"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using OpenSim.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
namespace OpenSim.Server.HyperGrid.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class GatekeeperServiceController : ControllerBase, IGatekeeperService
|
||||
{
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly ILogger<GatekeeperServiceController> _logger;
|
||||
|
||||
public GatekeeperServiceController(
|
||||
IConfiguration configuration,
|
||||
ILogger<GatekeeperServiceController> logger)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[HttpGet(Name = "GetHyperLinkRegion")]
|
||||
[Produces("application/xml")]
|
||||
public GridRegion GetHyperlinkRegion(global::OpenMetaverse.UUID regionID, global::OpenMetaverse.UUID agentID, string agentHomeURI, out string message)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
[HttpGet(Name = "LinkRegion")]
|
||||
[Produces("application/xml")]
|
||||
public bool LinkRegion(string regionDescriptor, out global::OpenMetaverse.UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason, out int sizeX, out int sizeY)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "LoginAgent")]
|
||||
[Produces("application/xml")]
|
||||
public bool LoginAgent(GridRegion source, AgentCircuitData aCircuit, GridRegion destination, out string reason)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using OpenSim.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
namespace OpenSim.Server.HyperGrid.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class UserAgentServiceController : ControllerBase, IUserAgentService
|
||||
{
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly ILogger<UserAgentServiceController> _logger;
|
||||
|
||||
public UserAgentServiceController(
|
||||
IConfiguration configuration,
|
||||
ILogger<UserAgentServiceController> logger)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[HttpGet(Name = "LoginAgentToGrid")]
|
||||
[Produces("application/xml")]
|
||||
public bool LoginAgentToGrid(GridRegion source, AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, bool fromLogin, out string reason)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "LogoutAgent")]
|
||||
[Produces("application/xml")]
|
||||
public void LogoutAgent(UUID userID, UUID sessionID)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "GetHomeRegion")]
|
||||
[Produces("application/xml")]
|
||||
public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "GetServerURLs")]
|
||||
[Produces("application/xml")]
|
||||
public Dictionary<string, object> GetServerURLs(UUID userID)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "GetUserInfo")]
|
||||
[Produces("application/xml")]
|
||||
public Dictionary<string, object> GetUserInfo(UUID userID)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "LocateUser")]
|
||||
[Produces("application/xml")]
|
||||
public string LocateUser(UUID userID)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "GetUUI")]
|
||||
[Produces("application/xml")]
|
||||
public string GetUUI(UUID userID, UUID targetUserID)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "GetUUID")]
|
||||
[Produces("application/xml")]
|
||||
public UUID GetUUID(string first, string last)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "StatusNotification")]
|
||||
[Produces("application/xml")]
|
||||
public List<UUID> StatusNotification(List<string> friends, UUID userID, bool online)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "IsAgentComingHome")]
|
||||
[Produces("application/xml")]
|
||||
public bool IsAgentComingHome(UUID sessionID, string thisGridExternalName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "VerifyAgent")]
|
||||
[Produces("application/xml")]
|
||||
public bool VerifyAgent(UUID sessionID, string token)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpGet(Name = "VerifyClient")]
|
||||
[Produces("application/xml")]
|
||||
public bool VerifyClient(UUID sessionID, string reportedIP)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
21
Source/OpenSim.Server.HyperGridServer/Dockerfile
Normal file
21
Source/OpenSim.Server.HyperGridServer/Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
|||
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
|
||||
WORKDIR /app
|
||||
|
||||
USER app
|
||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG configuration=Release
|
||||
WORKDIR /src
|
||||
COPY ["Source/OpenSim.Server.HyperGridServer/OpenSim.Server.HyperGridServer.csproj", "Source/OpenSim.Server.HyperGridServer/"]
|
||||
RUN dotnet restore "Source/OpenSim.Server.HyperGridServer/OpenSim.Server.HyperGridServer.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/Source/OpenSim.Server.HyperGridServer"
|
||||
RUN dotnet build "OpenSim.Server.HyperGridServer.csproj" -c $configuration -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG configuration=Release
|
||||
RUN dotnet publish "OpenSim.Server.HyperGridServer.csproj" -c $configuration -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "OpenSim.Server.HyperGridServer.dll"]
|
|
@ -0,0 +1,64 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>.</DockerfileContext>
|
||||
<EnableSdkContainerSupport>true</EnableSdkContainerSupport>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ContainerImageName>OpenSim.Server.HyperGridServer</ContainerImageName>
|
||||
<PublishProfile>DefaultContainer</PublishProfile>
|
||||
<ContainerImageTags>1.1.0;latest</ContainerImageTags>
|
||||
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="OpenMetaverse">
|
||||
<HintPath>..\..\bin\OpenMetaverse.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="OpenMetaverse.StructuredData">
|
||||
<HintPath>..\..\bin\OpenMetaverse.StructuredData.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="OpenMetaverseTypes">
|
||||
<HintPath>..\..\bin\OpenMetaverseTypes.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageReference Include="MediatR" Version="12.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.6">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.6" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenSim.Data.Model\OpenSim.Data.Model.csproj" />
|
||||
<ProjectReference Include="..\OpenSim.Services.Interfaces\OpenSim.Services.Interfaces.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
@OpenSim.Server.HyperGrid_HostAddress = http://localhost:5075
|
||||
|
||||
GET {{OpenSim.Server.HyperGrid_HostAddress}}/weatherforecast/
|
||||
Accept: application/json
|
||||
|
||||
###
|
107
Source/OpenSim.Server.HyperGridServer/Program.cs
Normal file
107
Source/OpenSim.Server.HyperGridServer/Program.cs
Normal file
|
@ -0,0 +1,107 @@
|
|||
using System.CommandLine;
|
||||
|
||||
using FluentValidation;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OpenSim.Data.Model;
|
||||
using OpenSim.Data.Model.Core;
|
||||
using OpenSim.Data.Model.Economy;
|
||||
using OpenSim.Data.Model.Identity;
|
||||
using OpenSim.Data.Model.Region;
|
||||
using OpenSim.Data.Model.Search;
|
||||
|
||||
namespace OpenSim.Server.HyperGrid;
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static void SetCommandLineArgs(string console, List<string> inifiles, string prompt)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
// var rootCommand = new RootCommand("Grid Server");
|
||||
|
||||
// var consoleOption = new Option<string>
|
||||
// (name: "--console", description: "console type, one of basic, local or rest.", getDefaultValue: () => "local")
|
||||
// .FromAmong("basic", "local", "rest");
|
||||
// var inifileOption = new Option<List<string>>
|
||||
// (name: "--inifile", description: "Specify the location of zero or more .ini file(s) to read.");
|
||||
// var promptOption = new Option<string>
|
||||
// (name: "--prompt", description: "Overide the server prompt",
|
||||
// getDefaultValue: () => "GRID> ");
|
||||
|
||||
// rootCommand.Add(consoleOption);
|
||||
// rootCommand.Add(inifileOption);
|
||||
// rootCommand.Add(promptOption);
|
||||
|
||||
// rootCommand.SetHandler(
|
||||
// (consoleOptionValue, inifileOptionValue, promptOptionValue) =>
|
||||
// {
|
||||
// SetCommandLineArgs(consoleOptionValue, inifileOptionValue, promptOptionValue);
|
||||
// },
|
||||
// consoleOption, inifileOption, promptOption);
|
||||
|
||||
// await rootCommand.InvokeAsync(args);
|
||||
|
||||
// Create Builder and run program
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// builder.Configuration.AddCommandLine(args, switchMappings);
|
||||
|
||||
// builder.Configuration.EnableSubstitutions("$(", ")");
|
||||
builder.Configuration.AddIniFile("GridServer.ini", optional: true, reloadOnChange: false);
|
||||
|
||||
// foreach (var item in inifile)
|
||||
// {
|
||||
// builder.Configuration.AddIniFile(item, optional: true, reloadOnChange: true);
|
||||
// }
|
||||
|
||||
// Initialize Database
|
||||
var connectionString = builder.Configuration.GetConnectionString("IdentityConnection");
|
||||
builder.Services.AddDbContext<IdentityContext>(
|
||||
options => options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)));
|
||||
|
||||
var coreConnectionString = builder.Configuration.GetConnectionString("OpenSimCoreConnection");
|
||||
builder.Services.AddDbContext<OpenSimCoreContext>(
|
||||
options => options.UseMySql(coreConnectionString, ServerVersion.AutoDetect(coreConnectionString)));
|
||||
|
||||
var regionConnectionString = builder.Configuration.GetConnectionString("OpenSimRegionConnection");
|
||||
builder.Services.AddDbContext<OpenSimRegionContext>(
|
||||
options => options.UseMySql(regionConnectionString, ServerVersion.AutoDetect(regionConnectionString)));
|
||||
|
||||
var economyConnectionString = builder.Configuration.GetConnectionString("OpenSimEconomyConnection");
|
||||
builder.Services.AddDbContext<OpenSimEconomyContext>(
|
||||
options => options.UseMySql(economyConnectionString, ServerVersion.AutoDetect(economyConnectionString)));
|
||||
|
||||
var searchConnectionString = builder.Configuration.GetConnectionString("OpenSimSearchConnection");
|
||||
builder.Services.AddDbContext<OpenSimSearchContext>(
|
||||
options => options.UseMySql(searchConnectionString, ServerVersion.AutoDetect(searchConnectionString)));
|
||||
|
||||
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
|
||||
|
||||
builder.Services.AddControllers()
|
||||
.AddXmlDataContractSerializerFormatters();
|
||||
|
||||
// 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.UseHttpsRedirection();
|
||||
app.UseAuthorization();
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:47573",
|
||||
"sslPort": 44304
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://localhost:5075",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:7178;http://localhost:5075",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
35
Source/OpenSim.Server.HyperGridServer/appsettings.json
Normal file
35
Source/OpenSim.Server.HyperGridServer/appsettings.json
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
|
||||
"DetailedErrors": true,
|
||||
|
||||
"ConnectionStrings": {
|
||||
"IdentityConnection": "server=localhost; port=3306; database=identity; user=opensim; password=*M1ke.Chase*;GuidFormat=None",
|
||||
"OpenSimCoreConnection": "server=localhost; port=3306; database=opensim; user=opensim; password=*M1ke.Chase*;GuidFormat=None",
|
||||
"OpenSimRegionConnection": "server=localhost; port=3306; database=opensim; user=opensim; password=*M1ke.Chase*;GuidFormat=None",
|
||||
"OpenSimEconomyConnection": "server=localhost; port=3306; database=osmoney; user=opensim; password=*M1ke.Chase*; GuidFormat=None",
|
||||
"OpenSimSearchConnection": "server=localhost; port=3306; database=ossearch; user=opensim; password=*M1ke.Chase*; GuidFormat=None",
|
||||
"OpenSimMarketConnection": "server=localhost; port=3306; database=market; user=opensim; password=*M1ke.Chase*; GuidFormat=None"
|
||||
},
|
||||
|
||||
"DefaultGroups": {
|
||||
"GroupNames": [ "Utopia Skye Welcome" ]
|
||||
},
|
||||
|
||||
"RemoteAdmin": {
|
||||
"UserName": "radmin",
|
||||
"AccessCode": "N0tAChance",
|
||||
"UserService_URL": "http://localhost:9000/xmlrpc/RemoteAdmin"
|
||||
},
|
||||
|
||||
"AuthMessageSenderOptions": {
|
||||
"FromEmailAddress": "noreply@utopiaskye.com",
|
||||
"SendGridKey": "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"
|
||||
}
|
||||
}
|
|
@ -153,6 +153,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Services.Controller
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Server.AssetServer", "Source\OpenSim.Server.AssetServer\OpenSim.Server.AssetServer.csproj", "{7FC7566A-5B1E-4D36-BCC6-CEE993315C57}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Server.HyperGridServer", "Source\OpenSim.Server.HyperGridServer\OpenSim.Server.HyperGridServer.csproj", "{5169C3AF-84E2-4722-8BD3-7F87337826E6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -415,6 +417,10 @@ Global
|
|||
{7FC7566A-5B1E-4D36-BCC6-CEE993315C57}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7FC7566A-5B1E-4D36-BCC6-CEE993315C57}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7FC7566A-5B1E-4D36-BCC6-CEE993315C57}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5169C3AF-84E2-4722-8BD3-7F87337826E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5169C3AF-84E2-4722-8BD3-7F87337826E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5169C3AF-84E2-4722-8BD3-7F87337826E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5169C3AF-84E2-4722-8BD3-7F87337826E6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -484,6 +490,7 @@ Global
|
|||
{362A017B-80DE-4FA2-8AC3-0226F51AAB56} = {02C09046-CFF3-40BA-9E3F-629241EB25A5}
|
||||
{CCABE946-99E9-4877-B6A7-6F53544D1739} = {02C09046-CFF3-40BA-9E3F-629241EB25A5}
|
||||
{7FC7566A-5B1E-4D36-BCC6-CEE993315C57} = {02C09046-CFF3-40BA-9E3F-629241EB25A5}
|
||||
{5169C3AF-84E2-4722-8BD3-7F87337826E6} = {02C09046-CFF3-40BA-9E3F-629241EB25A5}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A40AD54B-8BC7-41E4-B241-19B59EA65D2A}
|
||||
|
|
Loading…
Reference in a new issue