preparing to add full clothes/body part support.

Currently you can:
now create new body parts and clothes. 
edit those clothes and wear them.
But currently you will not see most of the edited effects on your own avatar, although often other clients will see those changes on your avatar.
tourmaline
MW 2007-03-26 19:05:50 +00:00
parent 42ba071276
commit ff71d2d4cd
5 changed files with 162 additions and 107 deletions

View File

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectType>Local</ProjectType> <ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>8.0.50727</ProductVersion>
@ -6,7 +6,8 @@
<ProjectGuid>{7DC4E7C8-89A4-4A8D-9617-3DF262990663}</ProjectGuid> <ProjectGuid>{7DC4E7C8-89A4-4A8D-9617-3DF262990663}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon> <ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName> <AssemblyKeyContainerName>
</AssemblyKeyContainerName> </AssemblyKeyContainerName>
<AssemblyName>OpenGridServices.ServerConsole</AssemblyName> <AssemblyName>OpenGridServices.ServerConsole</AssemblyName>
@ -15,9 +16,11 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema> <DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign> <DelaySign>false</DelaySign>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder> <AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenGridServices.ServerConsole</RootNamespace> <RootNamespace>OpenGridServices.ServerConsole</RootNamespace>
<StartupObject></StartupObject> <StartupObject>
</StartupObject>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
</PropertyGroup> </PropertyGroup>
@ -28,7 +31,8 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile> <DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize> <Optimize>False</Optimize>
@ -37,7 +41,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn></NoWarn> <NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -46,7 +51,8 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile> <DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize> <Optimize>True</Optimize>
@ -55,7 +61,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn></NoWarn> <NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System"> <Reference Include="System">
@ -70,10 +77,6 @@
<HintPath>System.Xml.dll</HintPath> <HintPath>System.Xml.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="OpenSim.Framework.dll" >
<HintPath>..\bin\OpenSim.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
</ItemGroup> </ItemGroup>
@ -85,6 +88,12 @@
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
<Project>{26E437F6-BA50-44CD-BB44-E911E25CA88C}</Project>
<Name>OpenSim.Framework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent> <PreBuildEvent>

View File

@ -119,6 +119,8 @@ namespace OpenSim.CAPS
private string ParseREST(string requestBody, string requestURL, string requestMethod) private string ParseREST(string requestBody, string requestURL, string requestMethod)
{ {
string responseString = ""; string responseString = "";
try
{
switch (requestURL) switch (requestURL)
{ {
case "/Admin/Accounts": case "/Admin/Accounts":
@ -169,21 +171,19 @@ namespace OpenSim.CAPS
responseString = "<p> Admin password is incorrect, please login with the correct password</p>"; responseString = "<p> Admin password is incorrect, please login with the correct password</p>";
responseString += "<br><br>" + LoginForm; responseString += "<br><br>" + LoginForm;
} }
} }
break; break;
case "/Admin/Login": case "/Admin/Login":
if (requestMethod == "POST") if (requestMethod == "POST")
{ {
Console.WriteLine(requestBody); // Console.WriteLine(requestBody);
if (requestBody == passWord) if (requestBody == passWord)
{ {
responseString = "<p> Login Successful </p>"; responseString = "<p> Login Successful </p>";
} }
else else
{ {
responseString = "<p> PassWord Error </p>"; responseString = "<p> Password Error </p>";
responseString += "<p> Please Login with the correct password </p>"; responseString += "<p> Please Login with the correct password </p>";
responseString += "<br><br> " + LoginForm; responseString += "<br><br> " + LoginForm;
} }
@ -198,6 +198,11 @@ namespace OpenSim.CAPS
} }
break; break;
} }
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
return responseString; return responseString;
} }

View File

@ -124,6 +124,15 @@ namespace OpenSim
} }
OpenSimRoot.Instance.LocalWorld.GetInitialPrims(this); OpenSimRoot.Instance.LocalWorld.GetInitialPrims(this);
break; break;
case PacketType.AgentIsNowWearing:
AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack;
//Console.WriteLine(Pack.ToString());
break;
case PacketType.AgentSetAppearance:
AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack;
// Console.WriteLine(appear.ToString());
this.ClientAvatar.SetAppearance(appear);
break;
case PacketType.ObjectAdd: case PacketType.ObjectAdd:
OpenSimRoot.Instance.LocalWorld.AddNewPrim((ObjectAddPacket)Pack, this); OpenSimRoot.Instance.LocalWorld.AddNewPrim((ObjectAddPacket)Pack, this);
break; break;
@ -279,7 +288,7 @@ namespace OpenSim
break; break;
case PacketType.AssetUploadRequest: case PacketType.AssetUploadRequest:
//this.debug = true; this.debug = true;
AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
// Console.WriteLine(Pack.ToString()); // Console.WriteLine(Pack.ToString());
// if (request.AssetBlock.Type == 0) // if (request.AssetBlock.Type == 0)
@ -318,7 +327,6 @@ namespace OpenSim
OpenSimRoot.Instance.InventoryCache.FetchInventoryDescendents(this, Fetch); OpenSimRoot.Instance.InventoryCache.FetchInventoryDescendents(this, Fetch);
break; break;
case PacketType.UpdateInventoryItem: case PacketType.UpdateInventoryItem:
/*
UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack; UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack;
for (int i = 0; i < update.InventoryData.Length; i++) for (int i = 0; i < update.InventoryData.Length; i++)
{ {
@ -338,7 +346,7 @@ namespace OpenSim
} }
} }
} }
}*/ }
break; break;
case PacketType.ViewerEffect: case PacketType.ViewerEffect:
ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; ViewerEffectPacket viewer = (ViewerEffectPacket)Pack;

View File

@ -5,6 +5,7 @@ using System.Text;
using libsecondlife; using libsecondlife;
using libsecondlife.Packets; using libsecondlife.Packets;
using OpenSim.Physics.Manager; using OpenSim.Physics.Manager;
using OpenSim.Framework.Inventory;
using Axiom.MathLib; using Axiom.MathLib;
namespace OpenSim.world namespace OpenSim.world
@ -25,6 +26,9 @@ namespace OpenSim.world
private List<NewForce> forcesList = new List<NewForce>(); private List<NewForce> forcesList = new List<NewForce>();
private short _updateCount = 0; private short _updateCount = 0;
private Axiom.MathLib.Quaternion bodyRot; private Axiom.MathLib.Quaternion bodyRot;
private LLObject.TextureEntry avatarAppearanceTexture = null;
private byte[] visualParams;
private AvatarWearable[] Wearables;
private LLVector3 positionLastFrame = new LLVector3(0, 0, 0); private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
public Avatar(SimClient TheClient) public Avatar(SimClient TheClient)
@ -34,6 +38,21 @@ namespace OpenSim.world
localid = 8880000 + (OpenSimRoot.Instance.LocalWorld._localNumber++); localid = 8880000 + (OpenSimRoot.Instance.LocalWorld._localNumber++);
position = new LLVector3(100.0f, 100.0f, 30.0f); position = new LLVector3(100.0f, 100.0f, 30.0f);
position.Z = OpenSimRoot.Instance.LocalWorld.LandMap[(int)position.Y * 256 + (int)position.X] + 1; position.Z = OpenSimRoot.Instance.LocalWorld.LandMap[(int)position.Y * 256 + (int)position.X] + 1;
visualParams = new byte[218];
for (int i = 0; i < 218; i++)
{
visualParams[i] = 100;
}
Wearables = new AvatarWearable[13]; //should be 13 of these
for (int i = 0; i < 13; i++)
{
Wearables[i] = new AvatarWearable();
}
this.Wearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
this.Wearables[0].ItemID = LLUUID.Random();
this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
} }
public PhysicsActor PhysActor public PhysicsActor PhysActor
@ -97,7 +116,6 @@ namespace OpenSim.world
_updateCount++; _updateCount++;
if (((!PhysicsEngineFlying) && (_updateCount > 3)) || (PhysicsEngineFlying) && (_updateCount > 0)) if (((!PhysicsEngineFlying) && (_updateCount > 3)) || (PhysicsEngineFlying) && (_updateCount > 0))
{ {
//Console.WriteLine("been a while since update so have one");
//It has been a while since last update was sent so lets send one. //It has been a while since last update was sent so lets send one.
ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
@ -119,6 +137,7 @@ namespace OpenSim.world
} }
} }
this.positionLastFrame = pos2;
} }
public static void SetupTemplate(string name) public static void SetupTemplate(string name)
@ -204,18 +223,13 @@ namespace OpenSim.world
aw.AgentData.SessionID = ControllingClient.SessionID; aw.AgentData.SessionID = ControllingClient.SessionID;
aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13]; aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13];
AgentWearablesUpdatePacket.WearableDataBlock awb = new AgentWearablesUpdatePacket.WearableDataBlock(); AgentWearablesUpdatePacket.WearableDataBlock awb;
awb.WearableType = (byte)0; for (int i = 0; i < 13; i++)
awb.AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
awb.ItemID = LLUUID.Random();
aw.WearableData[0] = awb;
for (int i = 1; i < 13; i++)
{ {
awb = new AgentWearablesUpdatePacket.WearableDataBlock(); awb = new AgentWearablesUpdatePacket.WearableDataBlock();
awb.WearableType = (byte)i; awb.WearableType = (byte)i;
awb.AssetID = new LLUUID("00000000-0000-0000-0000-000000000000"); awb.AssetID = this.Wearables[i].AssetID;
awb.ItemID = new LLUUID("00000000-0000-0000-0000-000000000000"); awb.ItemID = this.Wearables[i].ItemID;
aw.WearableData[i] = awb; aw.WearableData[i] = awb;
} }
@ -253,14 +267,15 @@ namespace OpenSim.world
avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218];
//avp.ObjectData.TextureEntry=this.avatar_template.TextureEntry;// br.ReadBytes((int)numBytes); //avp.ObjectData.TextureEntry=this.avatar_template.TextureEntry;// br.ReadBytes((int)numBytes);
LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-0000-000000000005")); //LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-0000-000000000005"));
avp.ObjectData.TextureEntry = ntex.ToBytes(); //avp.ObjectData.TextureEntry = ntex.ToBytes();
avp.ObjectData.TextureEntry = this.avatarAppearanceTexture.ToBytes();
AvatarAppearancePacket.VisualParamBlock avblock = null; AvatarAppearancePacket.VisualParamBlock avblock = null;
for (int i = 0; i < 218; i++) for (int i = 0; i < 218; i++)
{ {
avblock = new AvatarAppearancePacket.VisualParamBlock(); avblock = new AvatarAppearancePacket.VisualParamBlock();
avblock.ParamValue = (byte)100; avblock.ParamValue = visualParams[i];
avp.VisualParam[i] = avblock; avp.VisualParam[i] = avblock;
} }
@ -269,6 +284,24 @@ namespace OpenSim.world
userInfo.OutPacket(avp); userInfo.OutPacket(avp);
} }
public void SetAppearance(AgentSetAppearancePacket appear)
{
LLObject.TextureEntry tex = new LLObject.TextureEntry(appear.ObjectData.TextureEntry, 0, appear.ObjectData.TextureEntry.Length);
this.avatarAppearanceTexture = tex;
for (int i = 0; i < appear.VisualParam.Length; i++)
{
this.visualParams[i] = appear.VisualParam[i].ParamValue;
}
foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values)
{
if (client.AgentID != ControllingClient.AgentID)
{
SendAppearanceToOtherAgent(client);
}
}
}
public void HandleUpdate(AgentUpdatePacket pack) public void HandleUpdate(AgentUpdatePacket pack)
{ {
@ -479,7 +512,7 @@ namespace OpenSim.world
int i = 0; int i = 0;
ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
dat.TextureEntry = AvatarTemplate.TextureEntry; dat.TextureEntry = new byte[0];// AvatarTemplate.TextureEntry;
libsecondlife.LLVector3 pos2 = new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z); libsecondlife.LLVector3 pos2 = new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z);
uint ID = this.localid; uint ID = this.localid;