From 8ff1d0968ff3c4173b036398359ef62a356ad2b2 Mon Sep 17 00:00:00 2001 From: mingchen Date: Tue, 26 Jun 2007 17:50:27 +0000 Subject: *Added support for reservations in OpenGridServices (mysql only for now) *SQL file coming soon (as soon as I can figure out how to get the --- .../OpenGridServices.GridServer/GridManager.cs | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'OpenGridServices/OpenGridServices.GridServer/GridManager.cs') diff --git a/OpenGridServices/OpenGridServices.GridServer/GridManager.cs b/OpenGridServices/OpenGridServices.GridServer/GridManager.cs index cfbf591..bf80652 100644 --- a/OpenGridServices/OpenGridServices.GridServer/GridManager.cs +++ b/OpenGridServices/OpenGridServices.GridServer/GridManager.cs @@ -392,11 +392,11 @@ namespace OpenGridServices.GridServer simProfileBlock["map-image-id"] = simProfile.regionMapTextureID.ToString(); // For Sugilite compatibility - simProfileBlock["regionhandle"] = aSim.Value.regionHandle.ToString(); - simProfileBlock["sim_ip"] = aSim.Value.serverIP.ToString(); - simProfileBlock["sim_port"] = aSim.Value.serverPort.ToString(); - simProfileBlock["sim_uri"] = aSim.Value.serverURI.ToString(); - simProfileBlock["uuid"] = aSim.Value.UUID.ToStringHyphenated(); + simProfileBlock["regionhandle"] = simProfile.regionHandle.ToString(); + simProfileBlock["sim_ip"] = simProfile.serverIP.ToString(); + simProfileBlock["sim_port"] = simProfile.serverPort.ToString(); + simProfileBlock["sim_uri"] = simProfile.serverURI.ToString(); + simProfileBlock["uuid"] = simProfile.UUID.ToStringHyphenated(); simProfileList.Add(simProfileBlock); } @@ -561,6 +561,7 @@ namespace OpenGridServices.GridServer return "ERROR! Servers must register with public addresses."; } + try { OpenSim.Framework.Console.MainLog.Instance.Verbose("Updating / adding via " + _plugins.Count + " storage provider(s) registered."); @@ -568,9 +569,18 @@ namespace OpenGridServices.GridServer { try { - kvp.Value.AddProfile(TheSim); - OpenSim.Framework.Console.MainLog.Instance.Verbose("New sim added to grid (" + TheSim.regionName + ")"); - logToDB(TheSim.UUID.ToStringHyphenated(), "RestSetSimMethod", "", 5, "Region successfully updated and connected to grid."); + //Check reservations + ReservationData reserveData = kvp.Value.GetReservationAtPoint(TheSim.regionLocX, TheSim.regionLocY); + if ((reserveData != null && reserveData.gridRecvKey == TheSim.regionRecvKey) || (reserveData == null)) + { + kvp.Value.AddProfile(TheSim); + OpenSim.Framework.Console.MainLog.Instance.Verbose("New sim added to grid (" + TheSim.regionName + ")"); + logToDB(TheSim.UUID.ToStringHyphenated(), "RestSetSimMethod", "", 5, "Region successfully updated and connected to grid."); + } + else + { + return "Unable to update region (RestSetSimMethod): Incorrect auth key."; + } } catch (Exception e) { -- cgit v1.1