updated to use lastest version of libsl but is currently broke when using SL viewer 1.15.02, due to big changes in the message templates.

This commit is contained in:
MW
2007-04-25 18:12:06 +00:00
parent 68b33294b1
commit 9ed0a8dbad
48 changed files with 2539 additions and 135 deletions

View File

@@ -196,8 +196,8 @@ namespace OpenSim
if (this.transactions.ContainsKey(packet.InventoryBlock.TransactionID))
{
AssetTransaction trans = this.transactions[packet.InventoryBlock.TransactionID];
trans.Asset.Description = Helpers.FieldToString(packet.InventoryBlock.Description);
trans.Asset.Name = Helpers.FieldToString(packet.InventoryBlock.Name);
trans.Asset.Description = Util.FieldToString(packet.InventoryBlock.Description);
trans.Asset.Name = Util.FieldToString(packet.InventoryBlock.Name);
trans.Asset.Type = packet.InventoryBlock.Type;
trans.Asset.InvType = packet.InventoryBlock.InvType;
if (trans.UploadComplete)

View File

@@ -116,6 +116,12 @@
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
<Name>XMLRPC</Name>
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="AgentAssetUpload.cs">

View File

@@ -58,6 +58,7 @@
<include name="../bin/OpenSim.GenericConfig.Xml.dll" />
<include name="../bin/OpenSim.Physics.Manager.dll" />
<include name="../bin/OpenSim.Servers.dll" />
<include name="../bin/XMLRPC.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />

View File

@@ -374,7 +374,7 @@ namespace OpenSim
this.gridLocalAsset = Convert.ToBoolean(attri);
}
// Grid mode hack to use local asset server
// Grid mode hack to use local asset server
attri = "";
attri = configData.GetAttribute("PhysicsEngine");
if (attri == "")
@@ -437,6 +437,7 @@ namespace OpenSim
Packet packet = null;
int numBytes = Server.EndReceiveFrom(result, ref epSender);
int packetEnd = numBytes - 1;
packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
// This is either a new client or a packet to send to an old one
@@ -509,6 +510,7 @@ namespace OpenSim
{ // invalid client
Console.Error.WriteLine("Main.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString());
}
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
}

View File

@@ -17,6 +17,8 @@ namespace OpenSim
public uint RegionLocX;
public uint RegionLocY;
public ulong RegionHandle;
public ushort RegionWaterHeight = 20;
public bool RegionTerraform = true;
public int IPListenPort;
public string IPListenAddr;

View File

@@ -491,7 +491,7 @@ namespace OpenSim
break;
case PacketType.CreateInventoryFolder:
CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack;
m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Helpers.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID);
m_inventoryCache.CreateNewInventoryFolder(this, invFolder.FolderData.FolderID, (ushort)invFolder.FolderData.Type, Util.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID);
//Console.WriteLine(Pack.ToString());
break;
case PacketType.CreateInventoryItem:
@@ -603,7 +603,7 @@ namespace OpenSim
{
if (ent is OpenSim.world.Primitive)
{
this.m_world.AddScript(ent, Helpers.FieldToString(assBase.Data));
this.m_world.AddScript(ent, Util.FieldToString(assBase.Data));
}
}
}
@@ -1081,8 +1081,8 @@ namespace OpenSim
{
//lets try this out with creating a notecard
AssetBase asset = new AssetBase();
asset.Name = Helpers.FieldToString(packet.InventoryBlock.Name);
asset.Description = Helpers.FieldToString(packet.InventoryBlock.Description);
asset.Name = Util.FieldToString(packet.InventoryBlock.Name);
asset.Description = Util.FieldToString(packet.InventoryBlock.Description);
asset.InvType = packet.InventoryBlock.InvType;
asset.Type = packet.InventoryBlock.Type;
asset.FullID = LLUUID.Random();

View File

@@ -32,14 +32,18 @@ namespace OpenSim.world
private ulong m_regionHandle;
private Dictionary<uint, SimClient> m_clientThreads;
private string m_regionName;
private ushort m_regionWaterHeight;
private bool m_regionTerraform;
//private bool childShadowAvatar = false;
public Avatar(SimClient TheClient, World world, string regionName, Dictionary<uint, SimClient> clientThreads, ulong regionHandle)
public Avatar(SimClient TheClient, World world, string regionName, Dictionary<uint, SimClient> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater)
{
m_world = world;
m_clientThreads = clientThreads;
m_regionName = regionName;
m_regionHandle = regionHandle;
m_regionTerraform = regionTerraform;
m_regionWaterHeight = regionWater;
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)");
ControllingClient = TheClient;
@@ -139,7 +143,7 @@ namespace OpenSim.world
public void HandleUpdate(AgentUpdatePacket pack)
{
if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_FLY) != 0)
if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0)
{
if (this._physActor.Flying == false)
{
@@ -160,7 +164,7 @@ namespace OpenSim.world
}
this._physActor.Flying = false;
}
if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_POS) != 0)
if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS) != 0)
{
Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z);
if (((movementflag & 1) == 0) || (q != this.bodyRot))
@@ -194,7 +198,7 @@ namespace OpenSim.world
this.bodyRot = q;
}
}
else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_UP_POS) != 0) && (PhysicsEngineFlying))
else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS) != 0) && (PhysicsEngineFlying))
{
if (((movementflag & 2) == 0) && this._physActor.Flying)
{
@@ -214,7 +218,7 @@ namespace OpenSim.world
movementflag = 2;
}
}
else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_UP_NEG) != 0) && (PhysicsEngineFlying))
else if ((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && (PhysicsEngineFlying))
{
if (((movementflag & 4) == 0) && this._physActor.Flying)
{
@@ -235,7 +239,7 @@ namespace OpenSim.world
movementflag = 4;
}
}
else if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_NEG) != 0)
else if (((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG) != 0)
{
Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z);
if (((movementflag & 8) == 0) || (q != this.bodyRot))
@@ -287,7 +291,7 @@ namespace OpenSim.world
}
}
//really really should be moved somewhere else
//really really should be moved somewhere else (RegionInfo.cs ?)
public void SendRegionHandshake(World RegionInfo)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
@@ -306,8 +310,13 @@ namespace OpenSim.world
handshake.RegionInfo.TerrainStartHeight10 = 10;
handshake.RegionInfo.TerrainStartHeight11 = 10;
handshake.RegionInfo.SimAccess = 13;
handshake.RegionInfo.WaterHeight = 20;
handshake.RegionInfo.RegionFlags = 72458694 - 32;
handshake.RegionInfo.WaterHeight = m_regionWaterHeight;
uint regionFlags = 72458694;
if (this.m_regionTerraform)
{
regionFlags -= 64;
}
handshake.RegionInfo.RegionFlags = regionFlags;
handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0");
handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
handshake.RegionInfo.TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975");

View File

@@ -272,7 +272,7 @@ namespace OpenSim.world
PData.PathTwist = objupdate.ObjectData[0].PathTwist = addPacket.ObjectData.PathTwist;
PData.PathTwistBegin = objupdate.ObjectData[0].PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
objupdate.ObjectData[0].ID = (uint)(localID);
objupdate.ObjectData[0].FullID = new LLUUID("edba7151-5857-acc5-b30b-f01efef" + (localID - 702000).ToString("00000"));
objupdate.ObjectData[0].FullID = LLUUID.Random();
LLVector3 pos1 = addPacket.ObjectData.RayEnd;
//update position
byte[] pb = pos1.GetBytes();

View File

@@ -542,7 +542,7 @@ namespace OpenSim.world
try
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
Avatar newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle);
Avatar newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle, true, 20);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake ");
newAvatar.SendRegionHandshake(this);

View File

@@ -8,6 +8,7 @@ using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
using OpenSim.Framework.Terrain;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.Utilities;
using OpenSim.Assets;
namespace OpenSim.world
@@ -44,7 +45,7 @@ namespace OpenSim.world
{
System.Text.Encoding enc = System.Text.Encoding.ASCII;
ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)packet;
if (Helpers.FieldToString(inchatpack.ChatData.Message) == "")
if (Util.FieldToString(inchatpack.ChatData.Message) == "")
{
//empty message so don't bother with it
return true;
@@ -53,7 +54,7 @@ namespace OpenSim.world
libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
reply.ChatData.Audible = 1;
reply.ChatData.Message = inchatpack.ChatData.Message;
reply.ChatData.ChatType = 1;
reply.ChatData.ChatType = inchatpack.ChatData.Type;
reply.ChatData.SourceType = 1;
reply.ChatData.Position = simClient.ClientAvatar.Pos;
reply.ChatData.FromName = enc.GetBytes(simClient.ClientAvatar.firstname + " " + simClient.ClientAvatar.lastname + "\0");
@@ -61,7 +62,31 @@ namespace OpenSim.world
reply.ChatData.SourceID = simClient.AgentID;
foreach (SimClient client in m_clientThreads.Values)
{
client.OutPacket(reply);
switch (inchatpack.ChatData.Type)
{
case 0:
int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X),(int)( client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
if ((dis < 10) && (dis > -10))
{
client.OutPacket(reply);
}
break;
case 1:
dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
if ((dis < 30) && (dis > -30))
{
client.OutPacket(reply);
}
break;
case 2:
dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X),(int)( client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
if ((dis < 100) && (dis > -100))
{
client.OutPacket(reply);
}
break;
}
}
return true;
}