Fixed the bug that makes a region use its water height as its name (in regionhandshake), which lead to most regions being called "20". (applied fix to sugilite)

Rearranged some of the methods in ClientView.API.
Sugilite
MW 2007-06-14 10:16:28 +00:00
parent 62c6c9fe8b
commit fd8ead61f6
4 changed files with 222 additions and 187 deletions

View File

@ -245,26 +245,26 @@ namespace OpenSim.Region
/// ///
/// </summary> /// </summary>
/// <param name="addPacket"></param> /// <param name="addPacket"></param>
public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket) public void UpdateShape(ObjectShapePacket.ObjectDataBlock updatePacket)
{ {
this.primData.PathBegin = addPacket.PathBegin; this.primData.PathBegin = updatePacket.PathBegin;
this.primData.PathEnd = addPacket.PathEnd; this.primData.PathEnd = updatePacket.PathEnd;
this.primData.PathScaleX = addPacket.PathScaleX; this.primData.PathScaleX = updatePacket.PathScaleX;
this.primData.PathScaleY = addPacket.PathScaleY; this.primData.PathScaleY = updatePacket.PathScaleY;
this.primData.PathShearX = addPacket.PathShearX; this.primData.PathShearX = updatePacket.PathShearX;
this.primData.PathShearY = addPacket.PathShearY; this.primData.PathShearY = updatePacket.PathShearY;
this.primData.PathSkew = addPacket.PathSkew; this.primData.PathSkew = updatePacket.PathSkew;
this.primData.ProfileBegin = addPacket.ProfileBegin; this.primData.ProfileBegin = updatePacket.ProfileBegin;
this.primData.ProfileEnd = addPacket.ProfileEnd; this.primData.ProfileEnd = updatePacket.ProfileEnd;
this.primData.PathCurve = addPacket.PathCurve; this.primData.PathCurve = updatePacket.PathCurve;
this.primData.ProfileCurve = addPacket.ProfileCurve; this.primData.ProfileCurve = updatePacket.ProfileCurve;
this.primData.ProfileHollow = addPacket.ProfileHollow; this.primData.ProfileHollow = updatePacket.ProfileHollow;
this.primData.PathRadiusOffset = addPacket.PathRadiusOffset; this.primData.PathRadiusOffset = updatePacket.PathRadiusOffset;
this.primData.PathRevolutions = addPacket.PathRevolutions; this.primData.PathRevolutions = updatePacket.PathRevolutions;
this.primData.PathTaperX = addPacket.PathTaperX; this.primData.PathTaperX = updatePacket.PathTaperX;
this.primData.PathTaperY = addPacket.PathTaperY; this.primData.PathTaperY = updatePacket.PathTaperY;
this.primData.PathTwist = addPacket.PathTwist; this.primData.PathTwist = updatePacket.PathTwist;
this.primData.PathTwistBegin = addPacket.PathTwistBegin; this.primData.PathTwistBegin = updatePacket.PathTwistBegin;
} }
/// <summary> /// <summary>

View File

@ -312,7 +312,6 @@ namespace OpenSim.Region
#endregion #endregion
#region Regenerate Terrain #region Regenerate Terrain
/// <summary> /// <summary>
@ -638,6 +637,11 @@ namespace OpenSim.Region
return result; return result;
} }
/// <summary>
/// Request a Avatar by UUID
/// </summary>
/// <param name="avatarID"></param>
/// <returns></returns>
public Avatar RequestAvatar(LLUUID avatarID) public Avatar RequestAvatar(LLUUID avatarID)
{ {
if (this.Avatars.ContainsKey(avatarID)) if (this.Avatars.ContainsKey(avatarID))

View File

@ -147,7 +147,7 @@ namespace OpenSim
handshake.RegionInfo.RegionFlags = (uint)regionInfo.estateSettings.regionFlags; handshake.RegionInfo.RegionFlags = (uint)regionInfo.estateSettings.regionFlags;
handshake.RegionInfo.SimName = _enc.GetBytes(regionInfo.estateSettings.waterHeight + "\0"); handshake.RegionInfo.SimName = _enc.GetBytes(regionInfo.RegionName + "\0");
handshake.RegionInfo.SimOwner = regionInfo.MasterAvatarAssignedUUID; handshake.RegionInfo.SimOwner = regionInfo.MasterAvatarAssignedUUID;
handshake.RegionInfo.TerrainBase0 = regionInfo.estateSettings.terrainBase0; handshake.RegionInfo.TerrainBase0 = regionInfo.estateSettings.terrainBase0;
handshake.RegionInfo.TerrainBase1 = regionInfo.estateSettings.terrainBase1; handshake.RegionInfo.TerrainBase1 = regionInfo.estateSettings.terrainBase1;
@ -266,6 +266,12 @@ namespace OpenSim
} }
} }
/// <summary>
///
/// </summary>
/// <param name="neighbourHandle"></param>
/// <param name="neighbourIP"></param>
/// <param name="neighbourPort"></param>
public void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort) public void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort)
{ {
EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
@ -281,6 +287,10 @@ namespace OpenSim
OutPacket(enablesimpacket); OutPacket(enablesimpacket);
} }
/// <summary>
///
/// </summary>
/// <returns></returns>
public AgentCircuitData RequestClientInfo() public AgentCircuitData RequestClientInfo()
{ {
AgentCircuitData agentData = new AgentCircuitData(); AgentCircuitData agentData = new AgentCircuitData();
@ -383,70 +393,6 @@ namespace OpenSim
} }
/// <summary>
///
/// </summary>
/// <param name="objdata"></param>
protected void SetDefaultAvatarPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata)
{
objdata.PSBlock = new byte[0];
objdata.ExtraParams = new byte[1];
objdata.MediaURL = new byte[0];
objdata.NameValue = new byte[0];
objdata.Text = new byte[0];
objdata.TextColor = new byte[4];
objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0);
objdata.JointPivot = new LLVector3(0, 0, 0);
objdata.Material = 4;
objdata.TextureAnim = new byte[0];
objdata.Sound = LLUUID.Zero;
LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
objdata.TextureEntry = ntex.ToBytes();
objdata.State = 0;
objdata.Data = new byte[0];
objdata.ObjectData = new byte[76];
objdata.ObjectData[15] = 128;
objdata.ObjectData[16] = 63;
objdata.ObjectData[56] = 128;
objdata.ObjectData[61] = 102;
objdata.ObjectData[62] = 40;
objdata.ObjectData[63] = 61;
objdata.ObjectData[64] = 189;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket()
{
libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
SetDefaultAvatarPacketValues(ref objdata);
objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24);
objdata.PathCurve = 16;
objdata.ProfileCurve = 1;
objdata.PathScaleX = 100;
objdata.PathScaleY = 100;
objdata.ParentID = 0;
objdata.OwnerID = LLUUID.Zero;
objdata.Scale = new LLVector3(1, 1, 1);
objdata.PCode = 47;
System.Text.Encoding enc = System.Text.Encoding.ASCII;
libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
pos.X = 100f;
objdata.ID = 8880000;
objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0");
libsecondlife.LLVector3 pos2 = new LLVector3(100f, 100f, 23f);
//objdata.FullID=user.AgentID;
byte[] pb = pos.GetBytes();
Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length);
return objdata;
}
#endregion #endregion
#region Primitive Packet/data Sending Methods #region Primitive Packet/data Sending Methods
@ -521,78 +467,13 @@ namespace OpenSim
} }
/// <summary> /// <summary>
/// Create the ObjectDataBlock for a ObjectUpdatePacket (for a Primitive) ///
/// </summary> /// </summary>
/// <param name="primData"></param> /// <param name="regionHandle"></param>
/// <returns></returns> /// <param name="timeDilation"></param>
protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID) /// <param name="localID"></param>
{ /// <param name="position"></param>
ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock(); /// <param name="rotation"></param>
this.SetDefaultPrimPacketValues(objupdate);
objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456;
this.SetPrimPacketShapeData(objupdate, primData, textureID);
return objupdate;
}
/// <summary>
/// Set some default values in a ObjectUpdatePacket
/// </summary>
/// <param name="objdata"></param>
protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
{
objdata.PSBlock = new byte[0];
objdata.ExtraParams = new byte[1];
objdata.MediaURL = new byte[0];
objdata.NameValue = new byte[0];
objdata.Text = new byte[0];
objdata.TextColor = new byte[4];
objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0);
objdata.JointPivot = new LLVector3(0, 0, 0);
objdata.Material = 3;
objdata.TextureAnim = new byte[0];
objdata.Sound = LLUUID.Zero;
objdata.State = 0;
objdata.Data = new byte[0];
objdata.ObjectData = new byte[60];
objdata.ObjectData[46] = 128;
objdata.ObjectData[47] = 63;
}
/// <summary>
/// Copy the data from a PrimData object to a ObjectUpdatePacket
/// </summary>
/// <param name="objectData"></param>
/// <param name="primData"></param>
protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData, LLUUID textureID)
{
LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID);
objectData.TextureEntry = ntex.ToBytes();
objectData.OwnerID = primData.OwnerID;
objectData.PCode = primData.PCode;
objectData.PathBegin =primData.PathBegin;
objectData.PathEnd = primData.PathEnd;
objectData.PathScaleX = primData.PathScaleX;
objectData.PathScaleY = primData.PathScaleY;
objectData.PathShearX = primData.PathShearX;
objectData.PathShearY = primData.PathShearY;
objectData.PathSkew = primData.PathSkew;
objectData.ProfileBegin = primData.ProfileBegin;
objectData.ProfileEnd = primData.ProfileEnd;
objectData.Scale = primData.Scale;
objectData.PathCurve = primData.PathCurve;
objectData.ProfileCurve = primData.ProfileCurve;
objectData.ParentID = primData.ParentID;
objectData.ProfileHollow = primData.ProfileHollow;
objectData.PathRadiusOffset = primData.PathRadiusOffset;
objectData.PathRevolutions = primData.PathRevolutions;
objectData.PathTaperX = primData.PathTaperX;
objectData.PathTaperY = primData.PathTaperY;
objectData.PathTwist = primData.PathTwist;
objectData.PathTwistBegin = primData.PathTwistBegin;
}
public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation) public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation)
{ {
ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
@ -604,6 +485,12 @@ namespace OpenSim
this.OutPacket(terse); this.OutPacket(terse);
} }
#endregion
#endregion
#region Helper Methods
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -674,8 +561,178 @@ namespace OpenSim
dat.Data = bytes; dat.Data = bytes;
return dat; return dat;
} }
#endregion
/// <summary>
/// Create the ObjectDataBlock for a ObjectUpdatePacket (for a Primitive)
/// </summary>
/// <param name="primData"></param>
/// <returns></returns>
protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID)
{
ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock();
this.SetDefaultPrimPacketValues(objupdate);
objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456;
this.SetPrimPacketShapeData(objupdate, primData, textureID);
return objupdate;
}
/// <summary>
/// Copy the data from a PrimData object to a ObjectUpdatePacket
/// </summary>
/// <param name="objectData"></param>
/// <param name="primData"></param>
protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData, LLUUID textureID)
{
LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID);
objectData.TextureEntry = ntex.ToBytes();
objectData.OwnerID = primData.OwnerID;
objectData.PCode = primData.PCode;
objectData.PathBegin = primData.PathBegin;
objectData.PathEnd = primData.PathEnd;
objectData.PathScaleX = primData.PathScaleX;
objectData.PathScaleY = primData.PathScaleY;
objectData.PathShearX = primData.PathShearX;
objectData.PathShearY = primData.PathShearY;
objectData.PathSkew = primData.PathSkew;
objectData.ProfileBegin = primData.ProfileBegin;
objectData.ProfileEnd = primData.ProfileEnd;
objectData.Scale = primData.Scale;
objectData.PathCurve = primData.PathCurve;
objectData.ProfileCurve = primData.ProfileCurve;
objectData.ParentID = primData.ParentID;
objectData.ProfileHollow = primData.ProfileHollow;
objectData.PathRadiusOffset = primData.PathRadiusOffset;
objectData.PathRevolutions = primData.PathRevolutions;
objectData.PathTaperX = primData.PathTaperX;
objectData.PathTaperY = primData.PathTaperY;
objectData.PathTwist = primData.PathTwist;
objectData.PathTwistBegin = primData.PathTwistBegin;
}
/// <summary>
/// Set some default values in a ObjectUpdatePacket
/// </summary>
/// <param name="objdata"></param>
protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
{
objdata.PSBlock = new byte[0];
objdata.ExtraParams = new byte[1];
objdata.MediaURL = new byte[0];
objdata.NameValue = new byte[0];
objdata.Text = new byte[0];
objdata.TextColor = new byte[4];
objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0);
objdata.JointPivot = new LLVector3(0, 0, 0);
objdata.Material = 3;
objdata.TextureAnim = new byte[0];
objdata.Sound = LLUUID.Zero;
objdata.State = 0;
objdata.Data = new byte[0];
objdata.ObjectData = new byte[60];
objdata.ObjectData[46] = 128;
objdata.ObjectData[47] = 63;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket()
{
libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
SetDefaultAvatarPacketValues(ref objdata);
objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24);
objdata.PathCurve = 16;
objdata.ProfileCurve = 1;
objdata.PathScaleX = 100;
objdata.PathScaleY = 100;
objdata.ParentID = 0;
objdata.OwnerID = LLUUID.Zero;
objdata.Scale = new LLVector3(1, 1, 1);
objdata.PCode = 47;
System.Text.Encoding enc = System.Text.Encoding.ASCII;
libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
pos.X = 100f;
objdata.ID = 8880000;
objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0");
libsecondlife.LLVector3 pos2 = new LLVector3(100f, 100f, 23f);
//objdata.FullID=user.AgentID;
byte[] pb = pos.GetBytes();
Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length);
return objdata;
}
/// <summary>
///
/// </summary>
/// <param name="objdata"></param>
protected void SetDefaultAvatarPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata)
{
objdata.PSBlock = new byte[0];
objdata.ExtraParams = new byte[1];
objdata.MediaURL = new byte[0];
objdata.NameValue = new byte[0];
objdata.Text = new byte[0];
objdata.TextColor = new byte[4];
objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0);
objdata.JointPivot = new LLVector3(0, 0, 0);
objdata.Material = 4;
objdata.TextureAnim = new byte[0];
objdata.Sound = LLUUID.Zero;
LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
objdata.TextureEntry = ntex.ToBytes();
objdata.State = 0;
objdata.Data = new byte[0];
objdata.ObjectData = new byte[76];
objdata.ObjectData[15] = 128;
objdata.ObjectData[16] = 63;
objdata.ObjectData[56] = 128;
objdata.ObjectData[61] = 102;
objdata.ObjectData[62] = 40;
objdata.ObjectData[63] = 61;
objdata.ObjectData[64] = 189;
}
/// <summary>
///
/// </summary>
/// <param name="addPacket"></param>
/// <returns></returns>
protected PrimData CreatePrimFromObjectAdd(ObjectAddPacket addPacket)
{
PrimData PData = new PrimData();
PData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
PData.PCode = addPacket.ObjectData.PCode;
PData.PathBegin = addPacket.ObjectData.PathBegin;
PData.PathEnd = addPacket.ObjectData.PathEnd;
PData.PathScaleX = addPacket.ObjectData.PathScaleX;
PData.PathScaleY = addPacket.ObjectData.PathScaleY;
PData.PathShearX = addPacket.ObjectData.PathShearX;
PData.PathShearY = addPacket.ObjectData.PathShearY;
PData.PathSkew = addPacket.ObjectData.PathSkew;
PData.ProfileBegin = addPacket.ObjectData.ProfileBegin;
PData.ProfileEnd = addPacket.ObjectData.ProfileEnd;
PData.Scale = addPacket.ObjectData.Scale;
PData.PathCurve = addPacket.ObjectData.PathCurve;
PData.ProfileCurve = addPacket.ObjectData.ProfileCurve;
PData.ParentID = 0;
PData.ProfileHollow = addPacket.ObjectData.ProfileHollow;
PData.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset;
PData.PathRevolutions = addPacket.ObjectData.PathRevolutions;
PData.PathTaperX = addPacket.ObjectData.PathTaperX;
PData.PathTaperY = addPacket.ObjectData.PathTaperY;
PData.PathTwist = addPacket.ObjectData.PathTwist;
PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
return PData;
}
#endregion #endregion
} }

View File

@ -145,8 +145,9 @@ namespace OpenSim
return true; return true;
} }
public void RequestMapLayer() //should be getting the map layer from the grid server public void RequestMapLayer()
{ {
//should be getting the map layer from the grid server
//send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area) //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area)
MapLayerReplyPacket mapReply = new MapLayerReplyPacket(); MapLayerReplyPacket mapReply = new MapLayerReplyPacket();
mapReply.AgentData.AgentID = this.AgentID; mapReply.AgentData.AgentID = this.AgentID;
@ -190,33 +191,6 @@ namespace OpenSim
this.OutPacket(mbReply); this.OutPacket(mbReply);
} }
protected PrimData CreatePrimFromObjectAdd(ObjectAddPacket addPacket)
{
PrimData PData = new PrimData();
PData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
PData.PCode = addPacket.ObjectData.PCode;
PData.PathBegin = addPacket.ObjectData.PathBegin;
PData.PathEnd = addPacket.ObjectData.PathEnd;
PData.PathScaleX = addPacket.ObjectData.PathScaleX;
PData.PathScaleY = addPacket.ObjectData.PathScaleY;
PData.PathShearX = addPacket.ObjectData.PathShearX;
PData.PathShearY = addPacket.ObjectData.PathShearY;
PData.PathSkew = addPacket.ObjectData.PathSkew;
PData.ProfileBegin = addPacket.ObjectData.ProfileBegin;
PData.ProfileEnd = addPacket.ObjectData.ProfileEnd;
PData.Scale = addPacket.ObjectData.Scale;
PData.PathCurve = addPacket.ObjectData.PathCurve;
PData.ProfileCurve = addPacket.ObjectData.ProfileCurve;
PData.ParentID = 0;
PData.ProfileHollow = addPacket.ObjectData.ProfileHollow;
PData.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset;
PData.PathRevolutions = addPacket.ObjectData.PathRevolutions;
PData.PathTaperX = addPacket.ObjectData.PathTaperX;
PData.PathTaperY = addPacket.ObjectData.PathTaperY;
PData.PathTwist = addPacket.ObjectData.PathTwist;
PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
return PData;
}
} }
} }