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>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
@ -6,7 +6,8 @@
<ProjectGuid>{7DC4E7C8-89A4-4A8D-9617-3DF262990663}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGridServices.ServerConsole</AssemblyName>
@ -15,9 +16,11 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenGridServices.ServerConsole</RootNamespace>
<StartupObject></StartupObject>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
@ -28,7 +31,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
@ -37,7 +41,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -46,7 +51,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
@ -55,25 +61,22 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<Reference Include="System">
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<Reference Include="System.Data">
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<Reference Include="System.Xml">
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework.dll" >
<HintPath>..\bin\OpenSim.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
</ItemGroup>
@ -85,6 +88,12 @@
<SubType>Code</SubType>
</Compile>
</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" />
<PropertyGroup>
<PreBuildEvent>
@ -92,4 +101,4 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>

View File

@ -119,84 +119,89 @@ namespace OpenSim.CAPS
private string ParseREST(string requestBody, string requestURL, string requestMethod)
{
string responseString = "";
switch (requestURL)
try
{
case "/Admin/Accounts":
if (requestMethod == "GET")
{
responseString = "<p> Account management </p>";
responseString += "<br> ";
responseString += "<p> Create New Account </p>";
responseString += NewAccountForm;
}
break;
case "/Admin/Clients":
if (requestMethod == "GET")
{
responseString = " <p> Listing connected Clients </p>" ;
OpenSim.world.Avatar TempAv;
foreach (libsecondlife.LLUUID UUID in OpenSimRoot.Instance.LocalWorld.Entities.Keys)
switch (requestURL)
{
case "/Admin/Accounts":
if (requestMethod == "GET")
{
if (OpenSimRoot.Instance.LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
responseString = "<p> Account management </p>";
responseString += "<br> ";
responseString += "<p> Create New Account </p>";
responseString += NewAccountForm;
}
break;
case "/Admin/Clients":
if (requestMethod == "GET")
{
responseString = " <p> Listing connected Clients </p>";
OpenSim.world.Avatar TempAv;
foreach (libsecondlife.LLUUID UUID in OpenSimRoot.Instance.LocalWorld.Entities.Keys)
{
TempAv = (OpenSim.world.Avatar)OpenSimRoot.Instance.LocalWorld.Entities[UUID];
responseString += "<p>";
responseString += String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString());
responseString += "</p>";
if (OpenSimRoot.Instance.LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
{
TempAv = (OpenSim.world.Avatar)OpenSimRoot.Instance.LocalWorld.Entities[UUID];
responseString += "<p>";
responseString += String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString());
responseString += "</p>";
}
}
}
}
break;
case "/Admin/NewAccount":
if (requestMethod == "POST")
{
string[] comp = new string[10];
string[] passw = new string[3];
string delimStr = "&";
char[] delimiter = delimStr.ToCharArray();
string delimStr2 = "=";
char[] delimiter2 = delimStr2.ToCharArray();
break;
case "/Admin/NewAccount":
if (requestMethod == "POST")
{
string[] comp = new string[10];
string[] passw = new string[3];
string delimStr = "&";
char[] delimiter = delimStr.ToCharArray();
string delimStr2 = "=";
char[] delimiter2 = delimStr2.ToCharArray();
//Console.WriteLine(requestBody);
comp = requestBody.Split(delimiter);
passw = comp[3].Split(delimiter2);
if (passw[1] == passWord)
{
responseString = "<p> New Account created </p>";
//Console.WriteLine(requestBody);
comp = requestBody.Split(delimiter);
passw = comp[3].Split(delimiter2);
if (passw[1] == passWord)
{
responseString = "<p> New Account created </p>";
}
else
{
responseString = "<p> Admin password is incorrect, please login with the correct password</p>";
responseString += "<br><br>" + LoginForm;
}
}
else
break;
case "/Admin/Login":
if (requestMethod == "POST")
{
responseString = "<p> Admin password is incorrect, please login with the correct password</p>";
responseString += "<br><br>" + LoginForm;
// Console.WriteLine(requestBody);
if (requestBody == passWord)
{
responseString = "<p> Login Successful </p>";
}
else
{
responseString = "<p> Password Error </p>";
responseString += "<p> Please Login with the correct password </p>";
responseString += "<br><br> " + LoginForm;
}
}
}
break;
case "/Admin/Login":
if (requestMethod == "POST")
{
Console.WriteLine(requestBody);
if (requestBody == passWord)
break;
case "/Admin/Welcome":
if (requestMethod == "GET")
{
responseString = "<p> Login Successful </p>";
}
else
{
responseString = "<p> PassWord Error </p>";
responseString += "<p> Please Login with the correct password </p>";
responseString += "<br><br> " + LoginForm;
}
}
break;
case "/Admin/Welcome":
if (requestMethod == "GET")
{
responseString = "Welcome to the OpenSim Admin Page";
responseString += "<br><br><br> " + LoginForm;
responseString = "Welcome to the OpenSim Admin Page";
responseString += "<br><br><br> " + LoginForm;
}
break;
}
break;
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
return responseString;
@ -210,7 +215,7 @@ namespace OpenSim.CAPS
public void HandleRequest(Object stateinfo)
{
// Console.WriteLine("new http incoming");
// Console.WriteLine("new http incoming");
HttpListenerContext context = (HttpListenerContext)stateinfo;
HttpListenerRequest request = context.Request;
@ -265,7 +270,7 @@ namespace OpenSim.CAPS
response.AddHeader("Content-type", "text/html");
}
break;
}
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);

View File

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

View File

@ -5,6 +5,7 @@ using System.Text;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.Physics.Manager;
using OpenSim.Framework.Inventory;
using Axiom.MathLib;
namespace OpenSim.world
@ -25,6 +26,9 @@ namespace OpenSim.world
private List<NewForce> forcesList = new List<NewForce>();
private short _updateCount = 0;
private Axiom.MathLib.Quaternion bodyRot;
private LLObject.TextureEntry avatarAppearanceTexture = null;
private byte[] visualParams;
private AvatarWearable[] Wearables;
private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
public Avatar(SimClient TheClient)
@ -34,6 +38,21 @@ namespace OpenSim.world
localid = 8880000 + (OpenSimRoot.Instance.LocalWorld._localNumber++);
position = new LLVector3(100.0f, 100.0f, 30.0f);
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
@ -97,7 +116,6 @@ namespace OpenSim.world
_updateCount++;
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.
ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
@ -119,6 +137,7 @@ namespace OpenSim.world
}
}
this.positionLastFrame = pos2;
}
public static void SetupTemplate(string name)
@ -204,18 +223,13 @@ namespace OpenSim.world
aw.AgentData.SessionID = ControllingClient.SessionID;
aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13];
AgentWearablesUpdatePacket.WearableDataBlock awb = new AgentWearablesUpdatePacket.WearableDataBlock();
awb.WearableType = (byte)0;
awb.AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
awb.ItemID = LLUUID.Random();
aw.WearableData[0] = awb;
for (int i = 1; i < 13; i++)
AgentWearablesUpdatePacket.WearableDataBlock awb;
for (int i = 0; i < 13; i++)
{
awb = new AgentWearablesUpdatePacket.WearableDataBlock();
awb.WearableType = (byte)i;
awb.AssetID = new LLUUID("00000000-0000-0000-0000-000000000000");
awb.ItemID = new LLUUID("00000000-0000-0000-0000-000000000000");
awb.AssetID = this.Wearables[i].AssetID;
awb.ItemID = this.Wearables[i].ItemID;
aw.WearableData[i] = awb;
}
@ -253,14 +267,15 @@ namespace OpenSim.world
avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218];
//avp.ObjectData.TextureEntry=this.avatar_template.TextureEntry;// br.ReadBytes((int)numBytes);
LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-0000-000000000005"));
avp.ObjectData.TextureEntry = ntex.ToBytes();
//LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-0000-000000000005"));
//avp.ObjectData.TextureEntry = ntex.ToBytes();
avp.ObjectData.TextureEntry = this.avatarAppearanceTexture.ToBytes();
AvatarAppearancePacket.VisualParamBlock avblock = null;
for (int i = 0; i < 218; i++)
{
avblock = new AvatarAppearancePacket.VisualParamBlock();
avblock.ParamValue = (byte)100;
avblock.ParamValue = visualParams[i];
avp.VisualParam[i] = avblock;
}
@ -269,6 +284,24 @@ namespace OpenSim.world
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)
{
@ -479,7 +512,7 @@ namespace OpenSim.world
int i = 0;
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);
uint ID = this.localid;

View File

@ -40,11 +40,11 @@ namespace OpenSim
OpenSim.world.Avatar.PhysicsEngineFlying = true;
}
if (args[i] == "-ode")
{
sim._physicsEngine = "OpenDynamicsEngine";
OpenSim.world.Avatar.PhysicsEngineFlying = true;
}
}
{
sim._physicsEngine = "OpenDynamicsEngine";
OpenSim.world.Avatar.PhysicsEngineFlying = true;
}
}
OpenSimRoot.Instance.GridServers = new Grid();