Started to clean up/ rewrite Primitive class , currently the new version is called Primitive2 and not used, but once it is complete then it will replace the old version.

0.1-prestable
MW 2007-04-04 11:06:39 +00:00
parent 5e81e7ed9d
commit a70ef1c2cb
6 changed files with 160 additions and 181 deletions

View File

@ -207,13 +207,26 @@ namespace OpenSim.Framework.Inventory
public LLUUID CreatorID; public LLUUID CreatorID;
public sbyte InvType; public sbyte InvType;
public sbyte Type; public sbyte Type;
public string Name; public string Name ="";
public string Description; public string Description;
public InventoryItem() public InventoryItem()
{ {
this.CreatorID = LLUUID.Zero; this.CreatorID = LLUUID.Zero;
} }
public string ExportString()
{
string typ = "notecard";
string result = "";
result += "\tinv_object\t0\n\t{\n";
result += "\t\tobj_id\t%s\n";
result += "\t\tparent_id\t"+ ItemID.ToString() +"\n";
result += "\t\ttype\t"+ typ +"\n";
result += "\t\tname\t" + Name+"|\n";
result += "\t}\n";
return result;
}
} }
public class AvatarWearable public class AvatarWearable

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>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid> <ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</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>OpenSim.RegionServer</AssemblyName> <AssemblyName>OpenSim.RegionServer</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>OpenSim.RegionServer</RootNamespace> <RootNamespace>OpenSim.RegionServer</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,13 +61,15 @@
<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">
<HintPath>System.dll</HintPath> <HintPath>System.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml"> <Reference Include="System.Xml">
<HintPath>System.Xml.dll</HintPath> <HintPath>System.Xml.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@ -172,6 +180,7 @@
<Compile Include="world\Primitive.cs"> <Compile Include="world\Primitive.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="world\Primitive2.cs" />
<Compile Include="world\ScriptEngine.cs"> <Compile Include="world\ScriptEngine.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>

View File

@ -345,16 +345,19 @@ namespace OpenSim
AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack;
this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID)); this.UploadAssets.HandleUploadPacket(request, request.AssetBlock.TransactionID.Combine(this.SecureSessionID));
break; break;
case PacketType.RequestXfer:
//Console.WriteLine(Pack.ToString());
break;
case PacketType.SendXferPacket: case PacketType.SendXferPacket:
this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack); this.UploadAssets.HandleXferPacket((SendXferPacketPacket)Pack);
break; break;
case PacketType.CreateInventoryFolder: case PacketType.CreateInventoryFolder:
CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; 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, Helpers.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID);
Console.WriteLine(Pack.ToString()); //Console.WriteLine(Pack.ToString());
break; break;
case PacketType.CreateInventoryItem: case PacketType.CreateInventoryItem:
Console.WriteLine(Pack.ToString()); //Console.WriteLine(Pack.ToString());
CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack;
if (createItem.InventoryBlock.TransactionID != LLUUID.Zero) if (createItem.InventoryBlock.TransactionID != LLUUID.Zero)
{ {
@ -362,7 +365,7 @@ namespace OpenSim
} }
else else
{ {
Console.Write(Pack.ToString()); // Console.Write(Pack.ToString());
this.CreateInventoryItem(createItem); this.CreateInventoryItem(createItem);
} }
break; break;
@ -385,7 +388,7 @@ namespace OpenSim
AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID)); AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionID));
if (asset != null) if (asset != null)
{ {
Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache"); // Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToStringHyphenated() + " already in cache");
m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset);
} }
else else
@ -393,12 +396,12 @@ namespace OpenSim
asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID);
if (asset != null) if (asset != null)
{ {
Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToStringHyphenated() + " to cache"); //Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToStringHyphenated() + " to cache");
m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset);
} }
else else
{ {
Console.WriteLine("trying to update inventory item, but asset is null"); //Console.WriteLine("trying to update inventory item, but asset is null");
} }
} }
} }
@ -441,10 +444,12 @@ namespace OpenSim
} }
break; break;
case PacketType.UpdateTaskInventory: case PacketType.UpdateTaskInventory:
Console.WriteLine(Pack.ToString()); // Console.WriteLine(Pack.ToString());
UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack; UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID); AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
if (myinventory != null) if (myinventory != null)
{
if (updatetask.UpdateData.Key == 0)
{ {
if (myinventory.InventoryItems[updatetask.InventoryData.ItemID] != null) if (myinventory.InventoryItems[updatetask.InventoryData.ItemID] != null)
{ {
@ -457,6 +462,8 @@ namespace OpenSim
foreach (Entity ent in m_world.Entities.Values) foreach (Entity ent in m_world.Entities.Values)
{ {
if (ent.localid == updatetask.UpdateData.LocalID) if (ent.localid == updatetask.UpdateData.LocalID)
{
if (ent is OpenSim.world.Primitive)
{ {
this.m_world.AddScript(ent, Helpers.FieldToString(assBase.Data)); this.m_world.AddScript(ent, Helpers.FieldToString(assBase.Data));
} }
@ -465,6 +472,8 @@ namespace OpenSim
} }
} }
} }
}
}
break; break;
case PacketType.AgentAnimation: case PacketType.AgentAnimation:
//Console.WriteLine(Pack.ToString()); //Console.WriteLine(Pack.ToString());
@ -520,7 +529,7 @@ namespace OpenSim
return; return;
} }
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Sending PacketAck"); //OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Sending PacketAck");
int i = 0; int i = 0;
@ -817,7 +826,7 @@ namespace OpenSim
protected bool AgentTextureCached(SimClient simclient, Packet packet) protected bool AgentTextureCached(SimClient simclient, Packet packet)
{ {
Console.WriteLine(packet.ToString()); // Console.WriteLine(packet.ToString());
AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet; AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet;
AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket(); AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket();
cachedresp.AgentData.AgentID = this.AgentID; cachedresp.AgentData.AgentID = this.AgentID;

View File

@ -23,11 +23,11 @@ namespace OpenSim.world
get { return m_name; } get { return m_name; }
} }
private LLVector3 m_pos; protected LLVector3 m_pos;
protected PhysicsActor _physActor; protected PhysicsActor _physActor;
protected World m_world; protected World m_world;
public LLVector3 Pos public virtual LLVector3 Pos
{ {
get get
{ {

View File

@ -76,32 +76,16 @@ namespace OpenSim.world
scriptend = scriptData.LastIndexOf("</Script>"); scriptend = scriptData.LastIndexOf("</Script>");
substring = scriptData.Substring(scriptstart + 8, scriptend - scriptstart - 8); substring = scriptData.Substring(scriptstart + 8, scriptend - scriptstart - 8);
substring = substring.Trim(); substring = substring.Trim();
Console.WriteLine("searching for script to add: " + substring); //Console.WriteLine("searching for script to add: " + substring);
ScriptFactory scriptFactory; ScriptFactory scriptFactory;
if (this.m_scripts.TryGetValue(substring, out scriptFactory)) if (this.m_scripts.TryGetValue(substring, out scriptFactory))
{ {
Console.WriteLine("added script"); //Console.WriteLine("added script");
this.AddScript(entity, scriptFactory()); this.AddScript(entity, scriptFactory());
} }
/*string delimStr = " ";
char[] delimiter = delimStr.ToCharArray();
string[] line;
line = scriptData.Split(delimiter);
if (line.Length > 1)
{
if (line[0] == "script:")
{
if (this.m_scripts.ContainsKey(line[1]))
{
this.AddScript(entity, this.m_scripts[line[1]]);
}
}
}*/
} }
public InventoryCache InventoryCache public InventoryCache InventoryCache

View File

@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005 # Visual C# Express 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim\OpenSim.csproj", "{438A9556-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim\OpenSim.csproj", "{438A9556-0000-0000-0000-000000000000}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.OdePlugin", "OpenSim.Physics\OdePlugin\OpenSim.Physics.OdePlugin.csproj", "{63A05FE9-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.OdePlugin", "OpenSim.Physics\OdePlugin\OpenSim.Physics.OdePlugin.csproj", "{63A05FE9-0000-0000-0000-000000000000}"
@ -41,42 +41,6 @@ Global
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
({438A9556-0000-0000-0000-000000000000}).5 = ({8ACA2445-0000-0000-0000-000000000000})
({438A9556-0000-0000-0000-000000000000}).6 = ({A7CD0630-0000-0000-0000-000000000000})
({438A9556-0000-0000-0000-000000000000}).7 = ({8BE16150-0000-0000-0000-000000000000})
({438A9556-0000-0000-0000-000000000000}).8 = ({8BB20F0A-0000-0000-0000-000000000000})
({438A9556-0000-0000-0000-000000000000}).9 = ({632E1BFD-0000-0000-0000-000000000000})
({63A05FE9-0000-0000-0000-000000000000}).2 = ({8BE16150-0000-0000-0000-000000000000})
({E88EF749-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
({8BE16150-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
({8BE16150-0000-0000-0000-000000000000}).4 = ({A7CD0630-0000-0000-0000-000000000000})
({66591469-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
({66591469-0000-0000-0000-000000000000}).4 = ({A7CD0630-0000-0000-0000-000000000000})
({83C87BE6-0000-0000-0000-000000000000}).5 = ({8ACA2445-0000-0000-0000-000000000000})
({83C87BE6-0000-0000-0000-000000000000}).6 = ({A7CD0630-0000-0000-0000-000000000000})
({4F874463-0000-0000-0000-000000000000}).2 = ({8BE16150-0000-0000-0000-000000000000})
({B0027747-0000-0000-0000-000000000000}).5 = ({8ACA2445-0000-0000-0000-000000000000})
({B0027747-0000-0000-0000-000000000000}).6 = ({A7CD0630-0000-0000-0000-000000000000})
({8BB20F0A-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
({8BB20F0A-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
({988F0AC4-0000-0000-0000-000000000000}).3 = ({8BE16150-0000-0000-0000-000000000000})
({B55C0B5D-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
({B55C0B5D-0000-0000-0000-000000000000}).4 = ({A7CD0630-0000-0000-0000-000000000000})
({632E1BFD-0000-0000-0000-000000000000}).5 = ({8ACA2445-0000-0000-0000-000000000000})
({632E1BFD-0000-0000-0000-000000000000}).6 = ({A7CD0630-0000-0000-0000-000000000000})
({632E1BFD-0000-0000-0000-000000000000}).7 = ({E88EF749-0000-0000-0000-000000000000})
({632E1BFD-0000-0000-0000-000000000000}).8 = ({8BE16150-0000-0000-0000-000000000000})
({632E1BFD-0000-0000-0000-000000000000}).9 = ({8BB20F0A-0000-0000-0000-000000000000})
({E1B79ECF-0000-0000-0000-000000000000}).4 = ({8ACA2445-0000-0000-0000-000000000000})
({E1B79ECF-0000-0000-0000-000000000000}).5 = ({A7CD0630-0000-0000-0000-000000000000})
({7E494328-0000-0000-0000-000000000000}).5 = ({8ACA2445-0000-0000-0000-000000000000})
({7E494328-0000-0000-0000-000000000000}).6 = ({A7CD0630-0000-0000-0000-000000000000})
({546099CD-0000-0000-0000-000000000000}).4 = ({8ACA2445-0000-0000-0000-000000000000})
({546099CD-0000-0000-0000-000000000000}).5 = ({A7CD0630-0000-0000-0000-000000000000})
({21BFC8E2-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
({21BFC8E2-0000-0000-0000-000000000000}).4 = ({A7CD0630-0000-0000-0000-000000000000})
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU {438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU