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 SendWearables(AvatarWearable[] wearables);
void SendRegionHandshake(RegionInfo regionInfo);
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
void SendLayerData(float[] map);
void MoveAgentIntoRegion(RegionInfo regInfo);

View File

@ -1,5 +1,5 @@
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}"
EndProject
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
/// <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>

View File

@ -457,19 +457,31 @@ namespace OpenSim
#region Parcel related packets
case PacketType.ParcelPropertiesRequest:
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);
}
break;
case PacketType.ParcelDivide:
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;
case PacketType.ParcelJoin:
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;
case PacketType.ParcelPropertiesUpdate:
ParcelPropertiesUpdatePacket updatePacket = (ParcelPropertiesUpdatePacket)Pack;
OnParcelPropertiesUpdateRequest(updatePacket, this);
if (OnParcelPropertiesUpdateRequest != null)
{
OnParcelPropertiesUpdateRequest(updatePacket, this);
}
break;
#endregion

View File

@ -175,38 +175,7 @@ namespace OpenSim.world
/// </summary>
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>

View File

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

View File

@ -35,7 +35,7 @@ using OpenSim.Framework.Types;
namespace OpenSim.world
{
#region ParcelManager Class
/// <summary>
@ -62,7 +62,7 @@ namespace OpenSim.world
public const byte PARCEL_FLAG_PROPERTY_BORDER_SOUTH = (byte)128; //Equals 10000000
//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
//These are other constants. Yay!
@ -143,7 +143,7 @@ namespace OpenSim.world
}
parcelList[lastParcelLocalID].forceUpdateParcelInfo();
}
/// <summary>
/// Removes a parcel from the list. Will not remove if local_id is still owning an area in parcelIDList
@ -258,12 +258,12 @@ namespace OpenSim.world
int startParcelIndex = startParcel.parcelData.localID;
parcelList[startParcelIndex].setParcelBitmap(Parcel.modifyParcelBitmapSquare(startParcel.getParcelBitmap(), start_x, start_y, end_x, end_y, false));
parcelList[startParcelIndex].forceUpdateParcelInfo();
//Now add the new parcel
addParcel(newParcel);
@ -282,7 +282,7 @@ namespace OpenSim.world
{
end_x -= 4;
end_y -= 4;
//NOTE: The following only connects the parcels in each corner and not all the parcels that are within the selection box!
//This should be fixed later -- somewhat "incomplete code" --Ming
Parcel startParcel, endParcel;
@ -456,7 +456,7 @@ namespace OpenSim.world
public void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client)
{
join(west, south, east, north, remote_client.AgentId);
}
#endregion
@ -543,7 +543,7 @@ namespace OpenSim.world
//Place all new variables here!
newParcel.parcelBitmap = (bool[,])(this.parcelBitmap.Clone());
newParcel.parcelData = parcelData.Copy();
return newParcel;
}
@ -565,7 +565,7 @@ namespace OpenSim.world
updatePacket.ParcelData.AABBMin = parcelData.AABBMin;
updatePacket.ParcelData.Area = parcelData.area;
updatePacket.ParcelData.AuctionID = parcelData.auctionID;
updatePacket.ParcelData.AuthBuyerID =parcelData.authBuyerID; //unemplemented
updatePacket.ParcelData.AuthBuyerID = parcelData.authBuyerID; //unemplemented
updatePacket.ParcelData.Bitmap = parcelData.parcelBitmapByteArray;
@ -606,7 +606,7 @@ namespace OpenSim.world
updatePacket.ParcelData.SequenceID = sequence_id;
updatePacket.ParcelData.SimWideMaxPrims = 15000; //unemplemented
updatePacket.ParcelData.SimWideTotalPrims = 0; //unemplemented
updatePacket.ParcelData.SnapSelection = snap_selection;
updatePacket.ParcelData.SnapSelection = snap_selection;
updatePacket.ParcelData.SnapshotID = parcelData.snapshotID;
updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus;
updatePacket.ParcelData.TotalPrims = 0; //unemplemented
@ -638,14 +638,17 @@ namespace OpenSim.world
parcelData.userLocation = packet.ParcelData.UserLocation;
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)
{
sendParcelProperties(0, false, 0, av.ControllingClient);
sendParcelProperties(0, false, 0, avatars[i].ControllingClient);
}
}
}
}
#endregion
@ -720,7 +723,7 @@ namespace OpenSim.world
//Valid: Lets set it
parcelBitmap = bitmap;
forceUpdateParcelInfo();
}
}
/// <summary>
@ -761,23 +764,23 @@ namespace OpenSim.world
private bool[,] convertBytesToParcelBitmap()
{
bool[,] tempConvertMap = new bool[64, 64];
tempConvertMap.Initialize();
tempConvertMap.Initialize();
byte tempByte = 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];
for(bitNum = 0; bitNum < 8; bitNum++)
for (bitNum = 0; bitNum < 8; bitNum++)
{
bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte)1);
tempConvertMap[x, y] = bit;
x++;
if(x > 63)
if (x > 63)
{
x = 0;
x = 0;
y++;
}
}
}
@ -859,7 +862,7 @@ namespace OpenSim.world
{
//Throw an exception - The bitmap is not 64x64
throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_add in mergeParcelBitmaps");
}
int x, y;
@ -879,9 +882,9 @@ namespace OpenSim.world
#endregion
}
#endregion
}

View File

@ -24,9 +24,8 @@ namespace OpenSim.world
{
protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
public object LockPhysicsEngine = new object();
public Dictionary<libsecondlife.LLUUID, Avatar> Avatars;
public Dictionary<libsecondlife.LLUUID, Primitive> Prims;
//public ScriptEngine Scripts;
protected Dictionary<libsecondlife.LLUUID, Avatar> Avatars;
protected Dictionary<libsecondlife.LLUUID, Primitive> Prims;
public uint _localNumber = 0;
private PhysicsScene phyScene;
private float timeStep = 0.1f;
@ -83,8 +82,8 @@ namespace OpenSim.world
this.m_datastore = m_regInfo.DataStore;
this.RegisterRegionWithComms();
parcelManager = new ParcelManager(this,this.m_regInfo);
estateManager = new EstateManager(this,this.m_regInfo);
parcelManager = new ParcelManager(this, this.m_regInfo);
estateManager = new EstateManager(this, this.m_regInfo);
m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>();
m_scripts = new Dictionary<string, ScriptFactory>();
@ -476,10 +475,12 @@ namespace OpenSim.world
try
{
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() - Starting RegionHandshake ");
newAvatar.SendRegionHandshake();
//newAvatar.SendRegionHandshake();
this.estateManager.sendRegionHandshake(remoteClient);
PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
lock (this.LockPhysicsEngine)
@ -522,7 +523,7 @@ namespace OpenSim.world
/// </summary>
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);
//Console.WriteLine("we have " + neighbours.Count + " neighbouring regions");
@ -530,7 +531,7 @@ namespace OpenSim.world
{
for (int i = 0; i < neighbours.Count; i++)
{
// Console.WriteLine("sending neighbours data");
// Console.WriteLine("sending neighbours data");
AgentCircuitData agent = remoteClient.RequestClientInfo();
agent.BaseFolder = 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.
/// <summary>
///
/// Request a List of all Avatars in this World
/// </summary>
/// <returns></returns>
public List<Avatar> RequestAvatarList()

Binary file not shown.