aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs268
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs30
2 files changed, 0 insertions, 298 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index bd753cc..5654f67 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2040,7 +2040,6 @@ namespace OpenSim.Region.Framework.Scenes
2040 /// Move the given scene object into a new region depending on which region its absolute position has moved 2040 /// Move the given scene object into a new region depending on which region its absolute position has moved
2041 /// into. 2041 /// into.
2042 /// 2042 ///
2043 /// This method locates the new region handle and offsets the prim position for the new region
2044 /// </summary> 2043 /// </summary>
2045 /// <param name="attemptedPosition">the attempted out of region position of the scene object</param> 2044 /// <param name="attemptedPosition">the attempted out of region position of the scene object</param>
2046 /// <param name="grp">the scene object that we're crossing</param> 2045 /// <param name="grp">the scene object that we're crossing</param>
@@ -2054,202 +2053,6 @@ namespace OpenSim.Region.Framework.Scenes
2054 if (m_teleportModule != null) 2053 if (m_teleportModule != null)
2055 m_teleportModule.Cross(grp, attemptedPosition, silent); 2054 m_teleportModule.Cross(grp, attemptedPosition, silent);
2056 2055
2057 //if (grp.RootPart.DIE_AT_EDGE)
2058 //{
2059 // // We remove the object here
2060 // try
2061 // {
2062 // DeleteSceneObject(grp, false);
2063 // }
2064 // catch (Exception)
2065 // {
2066 // m_log.Warn("[DATABASE]: exception when trying to remove the prim that crossed the border.");
2067 // }
2068 // return;
2069 //}
2070
2071 //int thisx = (int)RegionInfo.RegionLocX;
2072 //int thisy = (int)RegionInfo.RegionLocY;
2073 //Vector3 EastCross = new Vector3(0.1f,0,0);
2074 //Vector3 WestCross = new Vector3(-0.1f, 0, 0);
2075 //Vector3 NorthCross = new Vector3(0, 0.1f, 0);
2076 //Vector3 SouthCross = new Vector3(0, -0.1f, 0);
2077
2078
2079 //// use this if no borders were crossed!
2080 //ulong newRegionHandle
2081 // = Util.UIntsToLong((uint)((thisx) * Constants.RegionSize),
2082 // (uint)((thisy) * Constants.RegionSize));
2083
2084 //Vector3 pos = attemptedPosition;
2085
2086 //int changeX = 1;
2087 //int changeY = 1;
2088
2089 //if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W))
2090 //{
2091 // if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
2092 // {
2093
2094 // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
2095
2096 // if (crossedBorderx.BorderLine.Z > 0)
2097 // {
2098 // pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
2099 // changeX = (int)(crossedBorderx.BorderLine.Z /(int) Constants.RegionSize);
2100 // }
2101 // else
2102 // pos.X = ((pos.X + Constants.RegionSize));
2103
2104 // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
2105 // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
2106
2107 // if (crossedBordery.BorderLine.Z > 0)
2108 // {
2109 // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
2110 // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
2111 // }
2112 // else
2113 // pos.Y = ((pos.Y + Constants.RegionSize));
2114
2115
2116
2117 // newRegionHandle
2118 // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
2119 // (uint)((thisy - changeY) * Constants.RegionSize));
2120 // // x - 1
2121 // // y - 1
2122 // }
2123 // else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N))
2124 // {
2125 // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
2126
2127 // if (crossedBorderx.BorderLine.Z > 0)
2128 // {
2129 // pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
2130 // changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize);
2131 // }
2132 // else
2133 // pos.X = ((pos.X + Constants.RegionSize));
2134
2135
2136 // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
2137 // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
2138
2139 // if (crossedBordery.BorderLine.Z > 0)
2140 // {
2141 // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
2142 // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
2143 // }
2144 // else
2145 // pos.Y = ((pos.Y + Constants.RegionSize));
2146
2147 // newRegionHandle
2148 // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
2149 // (uint)((thisy + changeY) * Constants.RegionSize));
2150 // // x - 1
2151 // // y + 1
2152 // }
2153 // else
2154 // {
2155 // Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
2156
2157 // if (crossedBorderx.BorderLine.Z > 0)
2158 // {
2159 // pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
2160 // changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize);
2161 // }
2162 // else
2163 // pos.X = ((pos.X + Constants.RegionSize));
2164
2165 // newRegionHandle
2166 // = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
2167 // (uint) (thisy*Constants.RegionSize));
2168 // // x - 1
2169 // }
2170 //}
2171 //else if (TestBorderCross(attemptedPosition + EastCross, Cardinals.E))
2172 //{
2173 // if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
2174 // {
2175
2176 // pos.X = ((pos.X - Constants.RegionSize));
2177 // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
2178 // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
2179
2180 // if (crossedBordery.BorderLine.Z > 0)
2181 // {
2182 // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
2183 // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
2184 // }
2185 // else
2186 // pos.Y = ((pos.Y + Constants.RegionSize));
2187
2188
2189 // newRegionHandle
2190 // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
2191 // (uint)((thisy - changeY) * Constants.RegionSize));
2192 // // x + 1
2193 // // y - 1
2194 // }
2195 // else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N))
2196 // {
2197 // pos.X = ((pos.X - Constants.RegionSize));
2198 // pos.Y = ((pos.Y - Constants.RegionSize));
2199 // newRegionHandle
2200 // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
2201 // (uint)((thisy + changeY) * Constants.RegionSize));
2202 // // x + 1
2203 // // y + 1
2204 // }
2205 // else
2206 // {
2207 // pos.X = ((pos.X - Constants.RegionSize));
2208 // newRegionHandle
2209 // = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
2210 // (uint) (thisy*Constants.RegionSize));
2211 // // x + 1
2212 // }
2213 //}
2214 //else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
2215 //{
2216 // Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
2217 // //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
2218
2219 // if (crossedBordery.BorderLine.Z > 0)
2220 // {
2221 // pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
2222 // changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
2223 // }
2224 // else
2225 // pos.Y = ((pos.Y + Constants.RegionSize));
2226
2227 // newRegionHandle
2228 // = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - changeY) * Constants.RegionSize));
2229 // // y - 1
2230 //}
2231 //else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N))
2232 //{
2233
2234 // pos.Y = ((pos.Y - Constants.RegionSize));
2235 // newRegionHandle
2236 // = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + changeY) * Constants.RegionSize));
2237 // // y + 1
2238 //}
2239
2240 //// Offset the positions for the new region across the border
2241 //Vector3 oldGroupPosition = grp.RootPart.GroupPosition;
2242 //grp.OffsetForNewRegion(pos);
2243
2244 //// If we fail to cross the border, then reset the position of the scene object on that border.
2245 //uint x = 0, y = 0;
2246 //Utils.LongToUInts(newRegionHandle, out x, out y);
2247 //GridRegion destination = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
2248 //if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent))
2249 //{
2250 // grp.OffsetForNewRegion(oldGroupPosition);
2251 // grp.ScheduleGroupForFullUpdate();
2252 //}
2253 } 2056 }
2254 2057
2255 public Border GetCrossedBorder(Vector3 position, Cardinals gridline) 2058 public Border GetCrossedBorder(Vector3 position, Cardinals gridline)
@@ -2432,77 +2235,6 @@ namespace OpenSim.Region.Framework.Scenes
2432 } 2235 }
2433 2236
2434 2237
2435 /// <summary>
2436 /// Move the given scene object into a new region
2437 /// </summary>
2438 /// <param name="newRegionHandle"></param>
2439 /// <param name="grp">Scene Object Group that we're crossing</param>
2440 /// <returns>
2441 /// true if the crossing itself was successful, false on failure
2442 /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region
2443 /// </returns>
2444 public bool CrossPrimGroupIntoNewRegion(GridRegion destination, SceneObjectGroup grp, bool silent)
2445 {
2446 //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<");
2447
2448 bool successYN = false;
2449 grp.RootPart.UpdateFlag = 0;
2450 //int primcrossingXMLmethod = 0;
2451
2452 if (destination != null)
2453 {
2454 //string objectState = grp.GetStateSnapshot();
2455
2456 //successYN
2457 // = m_sceneGridService.PrimCrossToNeighboringRegion(
2458 // newRegionHandle, grp.UUID, m_serialiser.SaveGroupToXml2(grp), primcrossingXMLmethod);
2459 //if (successYN && (objectState != "") && m_allowScriptCrossings)
2460 //{
2461 // successYN = m_sceneGridService.PrimCrossToNeighboringRegion(
2462 // newRegionHandle, grp.UUID, objectState, 100);
2463 //}
2464
2465 //// And the new channel...
2466 //if (m_interregionCommsOut != null)
2467 // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true);
2468 if (m_simulationService != null)
2469 successYN = m_simulationService.CreateObject(destination, grp, true);
2470
2471 if (successYN)
2472 {
2473 // We remove the object here
2474 try
2475 {
2476 DeleteSceneObject(grp, silent);
2477 }
2478 catch (Exception e)
2479 {
2480 m_log.ErrorFormat(
2481 "[INTERREGION]: Exception deleting the old object left behind on a border crossing for {0}, {1}",
2482 grp, e);
2483 }
2484 }
2485 else
2486 {
2487 if (!grp.IsDeleted)
2488 {
2489 if (grp.RootPart.PhysActor != null)
2490 {
2491 grp.RootPart.PhysActor.CrossingFailure();
2492 }
2493 }
2494
2495 m_log.ErrorFormat("[INTERREGION]: Prim crossing failed for {0}", grp);
2496 }
2497 }
2498 else
2499 {
2500 m_log.Error("[INTERREGION]: destination was unexpectedly null in Scene.CrossPrimGroupIntoNewRegion()");
2501 }
2502
2503 return successYN;
2504 }
2505
2506 public bool IncomingCreateObject(ISceneObject sog) 2238 public bool IncomingCreateObject(ISceneObject sog)
2507 { 2239 {
2508 //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); 2240 //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index d185fba..afb5b9a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3431,36 +3431,6 @@ namespace OpenSim.Region.Framework.Scenes
3431 } 3431 }
3432 } 3432 }
3433 3433
3434 public bool CrossAttachmentsIntoNewRegion(GridRegion destination, bool silent)
3435 {
3436 lock (m_attachments)
3437 {
3438 // Validate
3439 foreach (SceneObjectGroup gobj in m_attachments)
3440 {
3441 if (gobj == null || gobj.IsDeleted)
3442 return false;
3443 }
3444
3445 foreach (SceneObjectGroup gobj in m_attachments)
3446 {
3447 // If the prim group is null then something must have happened to it!
3448 if (gobj != null && gobj.RootPart != null)
3449 {
3450 // Set the parent localID to 0 so it transfers over properly.
3451 gobj.RootPart.SetParentLocalId(0);
3452 gobj.AbsolutePosition = gobj.RootPart.AttachedPos;
3453 gobj.RootPart.IsAttachment = false;
3454 //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
3455 m_log.DebugFormat("[ATTACHMENT]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName);
3456 m_scene.CrossPrimGroupIntoNewRegion(destination, gobj, silent);
3457 }
3458 }
3459 m_attachments.Clear();
3460
3461 return true;
3462 }
3463 }
3464 3434
3465 public void initializeScenePresence(IClientAPI client, RegionInfo region, Scene scene) 3435 public void initializeScenePresence(IClientAPI client, RegionInfo region, Scene scene)
3466 { 3436 {