Number of small changes.

Sugilite
MW 2007-06-09 11:13:02 +00:00
parent dd5848668c
commit 3658015de8
10 changed files with 111 additions and 76 deletions

View File

@ -93,6 +93,7 @@ namespace OpenSim.Framework.Interfaces
void OutPacket(Packet newPack); void OutPacket(Packet newPack);
void SendWearables(AvatarWearable[] wearables); void SendWearables(AvatarWearable[] wearables);
void SendRegionHandshake(RegionInfo regionInfo);
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID); void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
void SendLayerData(float[] map); void SendLayerData(float[] map);
void MoveAgentIntoRegion(RegionInfo regInfo); void MoveAgentIntoRegion(RegionInfo regInfo);

View File

@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005 # Visual C# Express 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Console", "Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj", "{A7CD0630-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Console", "Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj", "{A7CD0630-0000-0000-0000-000000000000}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Terrain.BasicTerrain", "OpenSim\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj", "{2270B8FE-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Terrain.BasicTerrain", "OpenSim\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj", "{2270B8FE-0000-0000-0000-000000000000}"

Binary file not shown.

View File

@ -95,6 +95,46 @@ namespace OpenSim
#region World/Avatar to Client #region World/Avatar to Client
/// <summary>
///
/// </summary>
/// <param name="regionInfo"></param>
public void SendRegionHandshake(RegionInfo regionInfo)
{
System.Text.Encoding _enc = System.Text.Encoding.ASCII;
RegionHandshakePacket handshake = new RegionHandshakePacket();
handshake.RegionInfo.BillableFactor = regionInfo.estateSettings.billableFactor;
handshake.RegionInfo.IsEstateManager = false;
handshake.RegionInfo.TerrainHeightRange00 = regionInfo.estateSettings.terrainHeightRange0;
handshake.RegionInfo.TerrainHeightRange01 = regionInfo.estateSettings.terrainHeightRange1;
handshake.RegionInfo.TerrainHeightRange10 = regionInfo.estateSettings.terrainHeightRange2;
handshake.RegionInfo.TerrainHeightRange11 = regionInfo.estateSettings.terrainHeightRange3;
handshake.RegionInfo.TerrainStartHeight00 = regionInfo.estateSettings.terrainStartHeight0;
handshake.RegionInfo.TerrainStartHeight01 = regionInfo.estateSettings.terrainStartHeight1;
handshake.RegionInfo.TerrainStartHeight10 = regionInfo.estateSettings.terrainStartHeight2;
handshake.RegionInfo.TerrainStartHeight11 = regionInfo.estateSettings.terrainStartHeight3;
handshake.RegionInfo.SimAccess = (byte)regionInfo.estateSettings.simAccess;
handshake.RegionInfo.WaterHeight = regionInfo.estateSettings.waterHeight;
handshake.RegionInfo.RegionFlags = (uint)regionInfo.estateSettings.regionFlags;
handshake.RegionInfo.SimName = _enc.GetBytes(regionInfo.estateSettings.waterHeight + "\0");
handshake.RegionInfo.SimOwner = regionInfo.MasterAvatarAssignedUUID;
handshake.RegionInfo.TerrainBase0 = regionInfo.estateSettings.terrainBase0;
handshake.RegionInfo.TerrainBase1 = regionInfo.estateSettings.terrainBase1;
handshake.RegionInfo.TerrainBase2 = regionInfo.estateSettings.terrainBase2;
handshake.RegionInfo.TerrainBase3 = regionInfo.estateSettings.terrainBase3;
handshake.RegionInfo.TerrainDetail0 = regionInfo.estateSettings.terrainDetail0;
handshake.RegionInfo.TerrainDetail1 = regionInfo.estateSettings.terrainDetail1;
handshake.RegionInfo.TerrainDetail2 =regionInfo.estateSettings.terrainDetail2;
handshake.RegionInfo.TerrainDetail3 = regionInfo.estateSettings.terrainDetail3;
handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting?
this.OutPacket(handshake);
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>

View File

@ -457,19 +457,31 @@ namespace OpenSim
#region Parcel related packets #region Parcel related packets
case PacketType.ParcelPropertiesRequest: case PacketType.ParcelPropertiesRequest:
ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack; ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack;
if(OnParcelPropertiesRequest != null)
{
OnParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), (int)Math.Round(propertiesRequest.ParcelData.South), (int)Math.Round(propertiesRequest.ParcelData.East), (int)Math.Round(propertiesRequest.ParcelData.North), propertiesRequest.ParcelData.SequenceID, propertiesRequest.ParcelData.SnapSelection, this); OnParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), (int)Math.Round(propertiesRequest.ParcelData.South), (int)Math.Round(propertiesRequest.ParcelData.East), (int)Math.Round(propertiesRequest.ParcelData.North), propertiesRequest.ParcelData.SequenceID, propertiesRequest.ParcelData.SnapSelection, this);
}
break; break;
case PacketType.ParcelDivide: case PacketType.ParcelDivide:
ParcelDividePacket parcelDivide = (ParcelDividePacket)Pack; ParcelDividePacket parcelDivide = (ParcelDividePacket)Pack;
OnParcelDivideRequest((int)Math.Round(parcelDivide.ParcelData.West), (int)Math.Round(parcelDivide.ParcelData.South), (int)Math.Round(parcelDivide.ParcelData.East), (int)Math.Round(parcelDivide.ParcelData.North), this); if (OnParcelDivideRequest != null)
{
OnParcelDivideRequest((int)Math.Round(parcelDivide.ParcelData.West), (int)Math.Round(parcelDivide.ParcelData.South), (int)Math.Round(parcelDivide.ParcelData.East), (int)Math.Round(parcelDivide.ParcelData.North), this);
}
break; break;
case PacketType.ParcelJoin: case PacketType.ParcelJoin:
ParcelJoinPacket parcelJoin = (ParcelJoinPacket)Pack; ParcelJoinPacket parcelJoin = (ParcelJoinPacket)Pack;
OnParcelJoinRequest((int)Math.Round(parcelJoin.ParcelData.West), (int)Math.Round(parcelJoin.ParcelData.South), (int)Math.Round(parcelJoin.ParcelData.East), (int)Math.Round(parcelJoin.ParcelData.North), this); if (OnParcelJoinRequest != null)
{
OnParcelJoinRequest((int)Math.Round(parcelJoin.ParcelData.West), (int)Math.Round(parcelJoin.ParcelData.South), (int)Math.Round(parcelJoin.ParcelData.East), (int)Math.Round(parcelJoin.ParcelData.North), this);
}
break; break;
case PacketType.ParcelPropertiesUpdate: case PacketType.ParcelPropertiesUpdate:
ParcelPropertiesUpdatePacket updatePacket = (ParcelPropertiesUpdatePacket)Pack; ParcelPropertiesUpdatePacket updatePacket = (ParcelPropertiesUpdatePacket)Pack;
OnParcelPropertiesUpdateRequest(updatePacket, this); if (OnParcelPropertiesUpdateRequest != null)
{
OnParcelPropertiesUpdateRequest(updatePacket, this);
}
break; break;
#endregion #endregion

View File

@ -175,38 +175,7 @@ namespace OpenSim.world
/// </summary> /// </summary>
public void SendRegionHandshake() public void SendRegionHandshake()
{ {
System.Text.Encoding _enc = System.Text.Encoding.ASCII;
RegionHandshakePacket handshake = new RegionHandshakePacket();
handshake.RegionInfo.BillableFactor = m_regInfo.estateSettings.billableFactor;
handshake.RegionInfo.IsEstateManager = false;
handshake.RegionInfo.TerrainHeightRange00 = m_regInfo.estateSettings.terrainHeightRange0;
handshake.RegionInfo.TerrainHeightRange01 = m_regInfo.estateSettings.terrainHeightRange1;
handshake.RegionInfo.TerrainHeightRange10 = m_regInfo.estateSettings.terrainHeightRange2;
handshake.RegionInfo.TerrainHeightRange11 = m_regInfo.estateSettings.terrainHeightRange3;
handshake.RegionInfo.TerrainStartHeight00 = m_regInfo.estateSettings.terrainStartHeight0;
handshake.RegionInfo.TerrainStartHeight01 = m_regInfo.estateSettings.terrainStartHeight1;
handshake.RegionInfo.TerrainStartHeight10 = m_regInfo.estateSettings.terrainStartHeight2;
handshake.RegionInfo.TerrainStartHeight11 = m_regInfo.estateSettings.terrainStartHeight3;
handshake.RegionInfo.SimAccess = (byte)m_regInfo.estateSettings.simAccess;
handshake.RegionInfo.WaterHeight = m_regInfo.estateSettings.waterHeight;
handshake.RegionInfo.RegionFlags = (uint)m_regInfo.estateSettings.regionFlags;
handshake.RegionInfo.SimName = _enc.GetBytes(m_regInfo.estateSettings.waterHeight + "\0");
handshake.RegionInfo.SimOwner = m_regInfo.MasterAvatarAssignedUUID;
handshake.RegionInfo.TerrainBase0 = m_regInfo.estateSettings.terrainBase0;
handshake.RegionInfo.TerrainBase1 = m_regInfo.estateSettings.terrainBase1;
handshake.RegionInfo.TerrainBase2 = m_regInfo.estateSettings.terrainBase2;
handshake.RegionInfo.TerrainBase3 = m_regInfo.estateSettings.terrainBase3;
handshake.RegionInfo.TerrainDetail0 = m_regInfo.estateSettings.terrainDetail0;
handshake.RegionInfo.TerrainDetail1 = m_regInfo.estateSettings.terrainDetail1;
handshake.RegionInfo.TerrainDetail2 = m_regInfo.estateSettings.terrainDetail2;
handshake.RegionInfo.TerrainDetail3 = m_regInfo.estateSettings.terrainDetail3;
handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting?
this.ControllingClient.OutPacket(handshake);
} }
/// <summary> /// <summary>

View File

@ -217,17 +217,21 @@ namespace OpenSim.world.Estate
public void sendRegionInfoPacketToAll() public void sendRegionInfoPacketToAll()
{ {
foreach (OpenSim.world.Avatar av in m_world.Avatars.Values) List<Avatar> avatars = m_world.RequestAvatarList();
{
this.sendRegionInfoPacket(av.ControllingClient); for (int i = 0; i < avatars.Count; i++)
} {
this.sendRegionInfoPacket(avatars[i].ControllingClient);
}
} }
public void sendRegionHandshakeToAll() public void sendRegionHandshakeToAll()
{ {
foreach (OpenSim.world.Avatar av in m_world.Avatars.Values) List<Avatar> avatars = m_world.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{ {
av.SendRegionHandshake(); this.sendRegionHandshake(avatars[i].ControllingClient);
} }
} }
@ -259,5 +263,10 @@ namespace OpenSim.world.Estate
remote_client.OutPacket(regionInfoPacket); remote_client.OutPacket(regionInfoPacket);
} }
public void sendRegionHandshake(IClientAPI remoteClient)
{
remoteClient.SendRegionHandshake(m_regInfo);
}
} }
} }

View File

@ -62,7 +62,7 @@ namespace OpenSim.world
public const byte PARCEL_FLAG_PROPERTY_BORDER_SOUTH = (byte)128; //Equals 10000000 public const byte PARCEL_FLAG_PROPERTY_BORDER_SOUTH = (byte)128; //Equals 10000000
//RequestResults (I think these are right, they seem to work): //RequestResults (I think these are right, they seem to work):
public const int PARCEL_RESULT_ONE_PARCEL = 0; // The request they made contained only one parcel public const int PARCEL_RESULT_ONE_PARCEL = 0; // The request they made contained only one parcel
public const int PARCEL_RESULT_MULTIPLE_PARCELS = 1; // The request they made contained more than one parcel public const int PARCEL_RESULT_MULTIPLE_PARCELS = 1; // The request they made contained more than one parcel
//These are other constants. Yay! //These are other constants. Yay!
@ -565,7 +565,7 @@ namespace OpenSim.world
updatePacket.ParcelData.AABBMin = parcelData.AABBMin; updatePacket.ParcelData.AABBMin = parcelData.AABBMin;
updatePacket.ParcelData.Area = parcelData.area; updatePacket.ParcelData.Area = parcelData.area;
updatePacket.ParcelData.AuctionID = parcelData.auctionID; updatePacket.ParcelData.AuctionID = parcelData.auctionID;
updatePacket.ParcelData.AuthBuyerID =parcelData.authBuyerID; //unemplemented updatePacket.ParcelData.AuthBuyerID = parcelData.authBuyerID; //unemplemented
updatePacket.ParcelData.Bitmap = parcelData.parcelBitmapByteArray; updatePacket.ParcelData.Bitmap = parcelData.parcelBitmapByteArray;
@ -638,14 +638,17 @@ namespace OpenSim.world
parcelData.userLocation = packet.ParcelData.UserLocation; parcelData.userLocation = packet.ParcelData.UserLocation;
parcelData.userLookAt = packet.ParcelData.UserLookAt; parcelData.userLookAt = packet.ParcelData.UserLookAt;
foreach (Avatar av in m_world.Avatars.Values) List<Avatar> avatars = m_world.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{ {
Parcel over = m_world.parcelManager.getParcel((int)Math.Round(av.Pos.X), (int)Math.Round(av.Pos.Y)); Parcel over = m_world.parcelManager.getParcel((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y));
if (over == this) if (over == this)
{ {
sendParcelProperties(0, false, 0, av.ControllingClient); sendParcelProperties(0, false, 0, avatars[i].ControllingClient);
} }
} }
} }
} }
#endregion #endregion
@ -764,15 +767,15 @@ namespace OpenSim.world
tempConvertMap.Initialize(); tempConvertMap.Initialize();
byte tempByte = 0; byte tempByte = 0;
int x = 0, y = 0, i = 0, bitNum = 0; int x = 0, y = 0, i = 0, bitNum = 0;
for(i = 0; i < 512; i++) for (i = 0; i < 512; i++)
{ {
tempByte = parcelData.parcelBitmapByteArray[i]; tempByte = parcelData.parcelBitmapByteArray[i];
for(bitNum = 0; bitNum < 8; bitNum++) for (bitNum = 0; bitNum < 8; bitNum++)
{ {
bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte)1); bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte)1);
tempConvertMap[x, y] = bit; tempConvertMap[x, y] = bit;
x++; x++;
if(x > 63) if (x > 63)
{ {
x = 0; x = 0;
y++; y++;

View File

@ -24,9 +24,8 @@ namespace OpenSim.world
{ {
protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer(); protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
public object LockPhysicsEngine = new object(); public object LockPhysicsEngine = new object();
public Dictionary<libsecondlife.LLUUID, Avatar> Avatars; protected Dictionary<libsecondlife.LLUUID, Avatar> Avatars;
public Dictionary<libsecondlife.LLUUID, Primitive> Prims; protected Dictionary<libsecondlife.LLUUID, Primitive> Prims;
//public ScriptEngine Scripts;
public uint _localNumber = 0; public uint _localNumber = 0;
private PhysicsScene phyScene; private PhysicsScene phyScene;
private float timeStep = 0.1f; private float timeStep = 0.1f;
@ -83,8 +82,8 @@ namespace OpenSim.world
this.m_datastore = m_regInfo.DataStore; this.m_datastore = m_regInfo.DataStore;
this.RegisterRegionWithComms(); this.RegisterRegionWithComms();
parcelManager = new ParcelManager(this,this.m_regInfo); parcelManager = new ParcelManager(this, this.m_regInfo);
estateManager = new EstateManager(this,this.m_regInfo); estateManager = new EstateManager(this, this.m_regInfo);
m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>(); m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>();
m_scripts = new Dictionary<string, ScriptFactory>(); m_scripts = new Dictionary<string, ScriptFactory>();
@ -476,10 +475,12 @@ namespace OpenSim.world
try try
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
newAvatar = new Avatar(remoteClient, this, m_clientThreads,this.m_regInfo); newAvatar = new Avatar(remoteClient, this, m_clientThreads, this.m_regInfo);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Adding new avatar to world"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Adding new avatar to world");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake "); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake ");
newAvatar.SendRegionHandshake();
//newAvatar.SendRegionHandshake();
this.estateManager.sendRegionHandshake(remoteClient);
PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
lock (this.LockPhysicsEngine) lock (this.LockPhysicsEngine)
@ -522,7 +523,7 @@ namespace OpenSim.world
/// </summary> /// </summary>
protected void InformClientOfNeighbours(IClientAPI remoteClient) protected void InformClientOfNeighbours(IClientAPI remoteClient)
{ {
// Console.WriteLine("informing client of neighbouring regions"); // Console.WriteLine("informing client of neighbouring regions");
List<RegionInfo> neighbours = this.commsManager.RequestNeighbours(this.m_regInfo); List<RegionInfo> neighbours = this.commsManager.RequestNeighbours(this.m_regInfo);
//Console.WriteLine("we have " + neighbours.Count + " neighbouring regions"); //Console.WriteLine("we have " + neighbours.Count + " neighbouring regions");
@ -530,7 +531,7 @@ namespace OpenSim.world
{ {
for (int i = 0; i < neighbours.Count; i++) for (int i = 0; i < neighbours.Count; i++)
{ {
// Console.WriteLine("sending neighbours data"); // Console.WriteLine("sending neighbours data");
AgentCircuitData agent = remoteClient.RequestClientInfo(); AgentCircuitData agent = remoteClient.RequestClientInfo();
agent.BaseFolder = LLUUID.Zero; agent.BaseFolder = LLUUID.Zero;
agent.InventoryFolder = LLUUID.Zero; agent.InventoryFolder = LLUUID.Zero;
@ -556,7 +557,7 @@ namespace OpenSim.world
// ie it could be all Avatars within a certain range of the calling prim/avatar. // ie it could be all Avatars within a certain range of the calling prim/avatar.
/// <summary> /// <summary>
/// /// Request a List of all Avatars in this World
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public List<Avatar> RequestAvatarList() public List<Avatar> RequestAvatarList()

Binary file not shown.