From f741e00ad8b87485d98e8bca82e4256cb30615d1 Mon Sep 17 00:00:00 2001 From: gareth Date: Wed, 4 Apr 2007 18:57:13 +0000 Subject: [PATCH] Added SimUUID Added empty POST for /sims in REST on gridserver --- OpenGridServices.GridServer/GridHttp.cs | 2 ++ OpenSim.RegionServer/OpenSimMain.cs | 18 ++++-------------- OpenSim.RegionServer/RegionInfo.cs | 20 ++++++++++++++++++-- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/OpenGridServices.GridServer/GridHttp.cs b/OpenGridServices.GridServer/GridHttp.cs index 774c90a2ff..0986061835 100644 --- a/OpenGridServices.GridServer/GridHttp.cs +++ b/OpenGridServices.GridServer/GridHttp.cs @@ -160,6 +160,8 @@ namespace OpenGridServices.GridServer respstring+="1"; respstring+=""; break; + case "POST": + break; } } break; diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs index 5db654e0e3..a3dfa6dbb9 100644 --- a/OpenSim.RegionServer/OpenSimMain.cs +++ b/OpenSim.RegionServer/OpenSimMain.cs @@ -55,6 +55,7 @@ namespace OpenSim public class OpenSimMain : OpenSimNetworkHandler, conscmd_callback { + LLUUID SimUUID; //private SimConfig Cfg; private IGenericConfig localConfig; //private IGenericConfig remoteConfig; @@ -110,20 +111,9 @@ namespace OpenSim Console.WriteLine(e.Message); } m_console.WriteLine("Main.cs:Startup() - Loading configuration"); - string configfromgrid = localConfig.GetAttribute("ConfigFromGrid"); - if (configfromgrid == "true") - { - //config from remote server is not implemented yet - //this.remoteConfig = new RemoteConfig(localConfig.GetAttribute("RemoteConfigURL"), localConfig.GetAttribute("SimUUID")); - //this.remoteConfig.LoadData(); - //this.regionData.InitConfig(this.m_sandbox, this.remoteConfig); - //this.remoteConfig.Close(); - } - else - { - this.regionData.InitConfig(this.m_sandbox, this.localConfig); - } - this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change + this.regionData.InitConfig(this.m_sandbox, this.localConfig); + SimUUID = new LLUUID(localConfig.GetAttribute("SimUUID")); + this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change GridServers = new Grid(); if (m_sandbox) diff --git a/OpenSim.RegionServer/RegionInfo.cs b/OpenSim.RegionServer/RegionInfo.cs index 806d7ccfea..15998cf4b5 100644 --- a/OpenSim.RegionServer/RegionInfo.cs +++ b/OpenSim.RegionServer/RegionInfo.cs @@ -3,12 +3,14 @@ using System.Collections.Generic; using System.Text; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Utilities; +using libsecondlife; namespace OpenSim { public class RegionInfo // could inherit from SimProfileBase { public string RegionName; + public LLUUID SimUUID; public uint RegionLocX; public uint RegionLocY; @@ -40,8 +42,21 @@ namespace OpenSim this.isSandbox = sandboxMode; try { + // Sim UUID + string attri =""; + attri = configData.GetAttribute("SimUUID"); + if (attri == "") + { + this.SimUUID = LLUUID.Random(); + configData.SetAttribute("SimUUID", this.SimUUID.ToString()); + } + else + { + this.SimUUID = new LLUUID(attri); + } + // Sim name - string attri =""; + attri =""; attri = configData.GetAttribute("SimName"); if (attri == "") { @@ -215,7 +230,8 @@ namespace OpenSim } OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Sim settings loaded:"); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Name: " + this.RegionName); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("UUID: " + this.SimUUID.ToStringHyphenated()); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Name: " + this.RegionName); OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Region Handle: " + this.RegionHandle.ToString()); OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort);