mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
* Made new Framework.Constants class, added RegionSize member.
* Converted all instances of "256" spotted to use RegionSize instead. Some approximations used for border crossings (ie 255.9f) are still using that value, but should be updated to use something based on RegionSize. * Moving Terrain to a RegionModule, implemented ITerrainChannel and TerrainModule - nonfunctional, but will be soon.
This commit is contained in:
@@ -152,7 +152,7 @@ namespace OpenSim.Framework.UserManagement
|
||||
ErrorReason = "key";
|
||||
welcomeMessage = "Welcome to OpenSim!";
|
||||
seedCapability = String.Empty;
|
||||
home = "{'region_handle':[r" + (1000*256).ToString() + ",r" + (1000*256).ToString() + "], 'position':[r" +
|
||||
home = "{'region_handle':[r" + (1000*Constants.RegionSize).ToString() + ",r" + (1000*Constants.RegionSize).ToString() + "], 'position':[r" +
|
||||
userProfile.homepos.X.ToString() + ",r" + userProfile.homepos.Y.ToString() + ",r" +
|
||||
userProfile.homepos.Z.ToString() + "], 'look_at':[r" + userProfile.homelookat.X.ToString() + ",r" +
|
||||
userProfile.homelookat.Y.ToString() + ",r" + userProfile.homelookat.Z.ToString() + "]}";
|
||||
@@ -347,8 +347,8 @@ namespace OpenSim.Framework.UserManagement
|
||||
responseData["home"] = home;
|
||||
responseData["look_at"] = lookAt;
|
||||
responseData["message"] = welcomeMessage;
|
||||
responseData["region_x"] = (Int32) RegionX*256;
|
||||
responseData["region_y"] = (Int32) RegionY*256;
|
||||
responseData["region_x"] = (Int32)RegionX * Constants.RegionSize;
|
||||
responseData["region_y"] = (Int32)RegionY * Constants.RegionSize;
|
||||
|
||||
//responseData["inventory-lib-root"] = new ArrayList(); // todo
|
||||
|
||||
@@ -447,8 +447,8 @@ namespace OpenSim.Framework.UserManagement
|
||||
map["home"] = LLSD.FromString(home);
|
||||
map["look_at"] = LLSD.FromString(lookAt);
|
||||
map["message"] = LLSD.FromString(welcomeMessage);
|
||||
map["region_x"] = LLSD.FromInteger(RegionX * 256);
|
||||
map["region_y"] = LLSD.FromInteger(RegionY * 256);
|
||||
map["region_x"] = LLSD.FromInteger(RegionX * Constants.RegionSize);
|
||||
map["region_y"] = LLSD.FromInteger(RegionY * Constants.RegionSize);
|
||||
|
||||
if (m_buddyList != null)
|
||||
{
|
||||
|
||||
11
OpenSim/Framework/Constants.cs
Normal file
11
OpenSim/Framework/Constants.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
public class Constants
|
||||
{
|
||||
public const uint RegionSize = 256;
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ namespace OpenSim.Framework.Data
|
||||
RegionProfileData simData = new RegionProfileData();
|
||||
simData.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]);
|
||||
simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]);
|
||||
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX*256), (simData.regionLocY*256));
|
||||
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * Constants.RegionSize), (simData.regionLocY * Constants.RegionSize));
|
||||
simData.serverIP = (string) responseData["sim_ip"];
|
||||
simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]);
|
||||
simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]);
|
||||
@@ -203,7 +203,7 @@ namespace OpenSim.Framework.Data
|
||||
RegionProfileData simData = new RegionProfileData();
|
||||
simData.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]);
|
||||
simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]);
|
||||
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX*256), (simData.regionLocY*256));
|
||||
simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * Constants.RegionSize), (simData.regionLocY * Constants.RegionSize));
|
||||
simData.serverIP = (string) responseData["sim_ip"];
|
||||
simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]);
|
||||
simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]);
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace OpenSim.Framework
|
||||
uint ny = (uint) y;
|
||||
|
||||
// Multiply grid coords to get region coords
|
||||
nx *= 256;
|
||||
ny *= 256;
|
||||
nx *= Constants.RegionSize;
|
||||
ny *= Constants.RegionSize;
|
||||
|
||||
// Stuff the IP address in too
|
||||
nx = (uint) a << 16;
|
||||
@@ -80,7 +80,7 @@ namespace OpenSim.Framework
|
||||
/// <param name="y">Grid Y Coordinate</param>
|
||||
public RegionHandle(uint x, uint y)
|
||||
{
|
||||
handle = ((x*256) << 32) | (y*256);
|
||||
handle = ((x * Constants.RegionSize) << 32) | (y * Constants.RegionSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace OpenSim.Framework
|
||||
|
||||
public ulong RegionHandle
|
||||
{
|
||||
get { return Util.UIntsToLong((RegionLocX*256), (RegionLocY*256)); }
|
||||
get { return Util.UIntsToLong((RegionLocX * (uint)Constants.RegionSize), (RegionLocY * (uint)Constants.RegionSize)); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace OpenSim.Framework
|
||||
|
||||
public ulong RegionHandle
|
||||
{
|
||||
get { return Util.UIntsToLong((RegionLocX*256), (RegionLocY*256)); }
|
||||
get { return Util.UIntsToLong((RegionLocX * (uint)Constants.RegionSize), (RegionLocY * (uint)Constants.RegionSize)); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
public ulong homeRegion
|
||||
{
|
||||
get { return Helpers.UIntsToLong((homeRegionX*256), (homeRegionY*256)); }
|
||||
get { return Helpers.UIntsToLong((homeRegionX * (uint)Constants.RegionSize), (homeRegionY * (uint)Constants.RegionSize)); }
|
||||
set
|
||||
{
|
||||
homeRegionX = (uint) (value >> 40);
|
||||
|
||||
Reference in New Issue
Block a user