Cleanup a bit
Started to add Primitive creation (very basic at the moment) Should now be ready for merging into trunkConvertToPlugins
parent
6a1cc7c70f
commit
0fcaa11f43
|
@ -1,21 +1,31 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Mono Runtime Version: 2.0.50727.42
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
// ------------------------------------------------------------------------------
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: ComVisibleAttribute(false)]
|
||||
[assembly: CLSCompliantAttribute(false)]
|
||||
[assembly: AssemblyVersionAttribute("0.1.*.148")]
|
||||
[assembly: AssemblyTitleAttribute("opensim-simconfig")]
|
||||
[assembly: AssemblyDescriptionAttribute("The default configuration handler")]
|
||||
[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
|
||||
[assembly: AssemblyTitle("SimConfig")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("SimConfig")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
|
|
@ -119,11 +119,6 @@ namespace Db40SimConfig
|
|||
ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - No heightmap found, generating new one");
|
||||
HeightmapGenHills hills = new HeightmapGenHills();
|
||||
blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
|
||||
/* blank.LandMap = new float[65536];
|
||||
for(int i = 0 ; i <65536; i++)
|
||||
{
|
||||
blank.LandMap[i] = 20.49f;
|
||||
}*/
|
||||
ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Saving heightmap to local database");
|
||||
db.Set(blank.LandMap);
|
||||
db.Commit();
|
||||
|
|
|
@ -26,12 +26,8 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="OpenSim">
|
||||
<HintPath>..\..\bin\OpenSim.exe</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Db4objects.Db4o">
|
||||
<HintPath>..\..\..\..\..\Program Files\Db4objects\db4o-6.1\bin\net-2.0\Db4objects.Db4o.dll</HintPath>
|
||||
<HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
@ -44,6 +40,10 @@
|
|||
<Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
|
||||
<Name>ServerConsole</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Second-server.csproj">
|
||||
<Project>{132A6E3E-8F2D-4BF5-BDFB-8555F53F334E}</Project>
|
||||
<Name>Second-server</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||
</Project>
|
|
@ -1,21 +1,31 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Mono Runtime Version: 2.0.50727.42
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
// ------------------------------------------------------------------------------
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: ComVisibleAttribute(false)]
|
||||
[assembly: CLSCompliantAttribute(false)]
|
||||
[assembly: AssemblyVersionAttribute("0.1.*.148")]
|
||||
[assembly: AssemblyTitleAttribute("opensim-gridinterfaces")]
|
||||
[assembly: AssemblyDescriptionAttribute("Definitions for OGS interface")]
|
||||
[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
|
||||
[assembly: AssemblyTitle("GridInterfaces")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("GridInterfaces")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="libsecondlife">
|
||||
<HintPath>..\..\Libsecond-dailys\libsl07-03\trunk\libsecondlife-cs\obj\Debug\libsecondlife.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\Libsecond-dailys\libsl07-03\trunk\libsecondlife-cs\obj\Debug\libsecondlife.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -1,21 +1,31 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Mono Runtime Version: 2.0.50727.42
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
// ------------------------------------------------------------------------------
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: ComVisibleAttribute(false)]
|
||||
[assembly: CLSCompliantAttribute(false)]
|
||||
[assembly: AssemblyVersionAttribute("0.1.*.148")]
|
||||
[assembly: AssemblyTitleAttribute("opensim-localservers")]
|
||||
[assembly: AssemblyDescriptionAttribute("local grid servers")]
|
||||
[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
|
||||
[assembly: AssemblyTitle("LocalGridServers")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("LocalGridServers")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="libsecondlife">
|
||||
<HintPath>..\..\..\Libsecond-dailys\libsl07-03\trunk\libsecondlife-cs\obj\Debug\libsecondlife.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\Libsecond-dailys\libsl07-03\trunk\libsecondlife-cs\obj\Debug\libsecondlife.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -192,7 +192,6 @@ namespace OpenSim
|
|||
int numBytes = Server.EndReceiveFrom(result, ref epSender);
|
||||
int packetEnd = numBytes - 1;
|
||||
packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
|
||||
//Console.Error.WriteLine(packet.ToString());
|
||||
|
||||
// This is either a new client or a packet to send to an old one
|
||||
if(ClientThreads.ContainsKey(epSender)) {
|
||||
|
@ -237,7 +236,7 @@ namespace OpenSim
|
|||
|
||||
void Timer1Tick( object sender, System.EventArgs e )
|
||||
{
|
||||
Console.WriteLine("UPDATE WORLD!");
|
||||
|
||||
local_world.Update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,6 +91,9 @@ namespace OpenSim
|
|||
case PacketType.AgentWearablesRequest:
|
||||
ClientAvatar.SendInitialAppearance();
|
||||
break;
|
||||
case PacketType.ObjectAdd:
|
||||
OpenSim_Main.local_world.AddNewPrim((ObjectAddPacket)Pack, this);
|
||||
break;
|
||||
case PacketType.TransferRequest:
|
||||
//Console.WriteLine("OpenSimClient.cs:ProcessInPacket() - Got transfer request");
|
||||
TransferRequestPacket transfer = (TransferRequestPacket)Pack;
|
||||
|
|
|
@ -1,21 +1,31 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Mono Runtime Version: 2.0.50727.42
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
// ------------------------------------------------------------------------------
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: ComVisibleAttribute(false)]
|
||||
[assembly: CLSCompliantAttribute(false)]
|
||||
[assembly: AssemblyVersionAttribute("0.1.*.148")]
|
||||
[assembly: AssemblyTitleAttribute("opensim-remoteservers")]
|
||||
[assembly: AssemblyDescriptionAttribute("Connects to remote OGS installation")]
|
||||
[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
|
||||
[assembly: AssemblyTitle("RemoteGridServers")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("RemoteGridServers")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="libsecondlife">
|
||||
<HintPath>..\..\..\Libsecond-dailys\libsl07-03\trunk\libsecondlife-cs\obj\Debug\libsecondlife.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\Libsecond-dailys\libsl07-03\trunk\libsecondlife-cs\obj\Debug\libsecondlife.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -39,16 +39,16 @@
|
|||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\Version0_2_myserver\OpenSim\bin\Debug\log4net.dll</HintPath>
|
||||
<Reference Include="libsecondlife">
|
||||
<HintPath>..\..\..\..\..\Libsecond-dailys\libsl07-03\trunk\libsecondlife-cs\obj\Debug\libsecondlife.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="Axiom.MathLib">
|
||||
<HintPath>..\Version0_2_myserver\OpenSim\bin\Debug\Axiom.MathLib.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\Opensim-pluginsystem\bin\Axiom.MathLib.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
<Reference Include="libsecondlife">
|
||||
<HintPath>..\Libsecond-dailys\libsl07-03\trunk\libsecondlife-cs\obj\Debug\libsecondlife.dll</HintPath>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\bin\log4net.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -1,21 +1,31 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Mono Runtime Version: 2.0.50727.42
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
// ------------------------------------------------------------------------------
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: ComVisibleAttribute(false)]
|
||||
[assembly: CLSCompliantAttribute(false)]
|
||||
[assembly: AssemblyVersionAttribute("0.1.*.148")]
|
||||
[assembly: AssemblyTitleAttribute("opensim-serverconsole")]
|
||||
[assembly: AssemblyDescriptionAttribute("The default server console")]
|
||||
[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
|
||||
[assembly: AssemblyTitle("ServerConsole")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ServerConsole")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
|
116
src/Util.cs
116
src/Util.cs
|
@ -84,120 +84,4 @@ namespace OpenSim
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class VoipConnectionPacket : Packet
|
||||
{
|
||||
/// <exclude/>
|
||||
// [XmlType("VoipConnection_Serverblock1")]
|
||||
public class ServerBlock
|
||||
{
|
||||
public uint Test1;
|
||||
public uint IP;
|
||||
public ushort Port;
|
||||
private byte[] userName;
|
||||
public byte[] UserName
|
||||
{
|
||||
get { return userName; }
|
||||
set
|
||||
{
|
||||
if (value == null) { userName = null; return; }
|
||||
if (value.Length > 255) { throw new OverflowException("Value exceeds 255 characters"); }
|
||||
else { userName = new byte[value.Length]; Array.Copy(value, userName, value.Length); }
|
||||
}
|
||||
}
|
||||
|
||||
//[XmlIgnore]
|
||||
public int Length
|
||||
{
|
||||
get
|
||||
{
|
||||
int length = 4;
|
||||
if (UserName != null) { length += 1 + UserName.Length; }
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
public ServerBlock() { }
|
||||
public ServerBlock(byte[] bytes, ref int i)
|
||||
{
|
||||
try
|
||||
{
|
||||
Test1 = (uint)(bytes[i++] + (bytes[i++] << 8) + (bytes[i++] << 16) + (bytes[i++] << 24));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new MalformedDataException();
|
||||
}
|
||||
}
|
||||
|
||||
public void ToBytes(byte[] bytes, ref int i)
|
||||
{
|
||||
bytes[i++] = (byte)(Test1 % 256);
|
||||
bytes[i++] = (byte)((Test1 >> 8) % 256);
|
||||
bytes[i++] = (byte)((Test1 >> 16) % 256);
|
||||
bytes[i++] = (byte)((Test1 >> 24) % 256);
|
||||
if(UserName == null) { Console.WriteLine("Warning: UserName is null, in " + this.GetType()); }
|
||||
bytes[i++] = (byte)UserName.Length;
|
||||
Array.Copy(UserName, 0, bytes, i, UserName.Length);
|
||||
i += UserName.Length;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string output = "-- ServerBlock1 --" + Environment.NewLine;
|
||||
output += "Test1: " + Test1.ToString() + "" + Environment.NewLine;
|
||||
output = output.Trim();
|
||||
return output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Header header;
|
||||
public override Header Header { get { return header; } set { header = value; } }
|
||||
public override PacketType Type { get { return PacketType.TestMessage; } }
|
||||
public ServerBlock ServerBlock1;
|
||||
|
||||
public VoipConnectionPacket()
|
||||
{
|
||||
Header = new LowHeader();
|
||||
Header.ID = 600;
|
||||
Header.Reliable = true;
|
||||
Header.Zerocoded = true;
|
||||
ServerBlock1 = new ServerBlock();
|
||||
}
|
||||
|
||||
public VoipConnectionPacket(byte[] bytes, ref int i)
|
||||
{
|
||||
int packetEnd = bytes.Length - 1;
|
||||
Header = new LowHeader(bytes, ref i, ref packetEnd);
|
||||
ServerBlock1 = new ServerBlock(bytes, ref i);
|
||||
}
|
||||
|
||||
public VoipConnectionPacket(Header head, byte[] bytes, ref int i)
|
||||
{
|
||||
Header = head;
|
||||
ServerBlock1 = new ServerBlock(bytes, ref i);
|
||||
}
|
||||
|
||||
public override byte[] ToBytes()
|
||||
{
|
||||
int length = 8;
|
||||
length += ServerBlock1.Length;;
|
||||
if (header.AckList.Length > 0) { length += header.AckList.Length * 4 + 1; }
|
||||
byte[] bytes = new byte[length];
|
||||
int i = 0;
|
||||
header.ToBytes(bytes, ref i);
|
||||
ServerBlock1.ToBytes(bytes, ref i);
|
||||
if (header.AckList.Length > 0) { header.AcksToBytes(bytes, ref i); }
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string output = "--- VoipConnection ---" + Environment.NewLine;
|
||||
output += ServerBlock1.ToString() + Environment.NewLine;
|
||||
return output;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,31 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Mono Runtime Version: 2.0.50727.42
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
// ------------------------------------------------------------------------------
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: ComVisibleAttribute(false)]
|
||||
[assembly: CLSCompliantAttribute(false)]
|
||||
[assembly: AssemblyVersionAttribute("0.1.*.148")]
|
||||
[assembly: AssemblyTitleAttribute("opensim-physicsmanager")]
|
||||
[assembly: AssemblyDescriptionAttribute("Handles physics plugins")]
|
||||
[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
|
||||
[assembly: AssemblyTitle("PhysicsManager")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("PhysicsManager")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
|
|
@ -1,21 +1,31 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// <autogenerated>
|
||||
// This code was generated by a tool.
|
||||
// Mono Runtime Version: 2.0.50727.42
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </autogenerated>
|
||||
// ------------------------------------------------------------------------------
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: ComVisibleAttribute(false)]
|
||||
[assembly: CLSCompliantAttribute(false)]
|
||||
[assembly: AssemblyVersionAttribute("0.1.*.148")]
|
||||
[assembly: AssemblyTitleAttribute("opensim-physicsmanager-physx")]
|
||||
[assembly: AssemblyDescriptionAttribute("PhysX plugin for OpenSim")]
|
||||
[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
|
||||
[assembly: AssemblyTitle("PhysXplugin")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("PhysXplugin")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
|
|
@ -87,10 +87,8 @@ namespace PhysXplugin
|
|||
|
||||
public override void Simulate(float timeStep)
|
||||
{
|
||||
Console.WriteLine("SIMULATE!");
|
||||
foreach (PhysXActor actor in _actors)
|
||||
{
|
||||
Console.WriteLine("AN ACTOR!");
|
||||
actor.Position.X = actor.Position.X + actor.Velocity.X * timeStep;
|
||||
actor.Position.Y = actor.Position.Y + actor.Velocity.Y * timeStep;
|
||||
actor.Position.Z = actor.Position.Z + actor.Velocity.Z * timeStep;
|
||||
|
@ -120,7 +118,7 @@ namespace PhysXplugin
|
|||
|
||||
public override void GetResults()
|
||||
{
|
||||
Console.WriteLine("GET RESULTS!");
|
||||
|
||||
}
|
||||
|
||||
public override bool IsThreaded
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace OpenSim.world
|
|||
ControllingClient=TheClient;
|
||||
SetupTemplate("avatar-template.dat");
|
||||
position = new LLVector3(100.0f,100.0f,30.0f);
|
||||
position.Z = OpenSim_Main.local_world.LandMap[(int)position.Y * 256 + (int)position.X]+1;
|
||||
}
|
||||
|
||||
public PhysicsActor PhysActor
|
||||
|
@ -43,7 +44,6 @@ namespace OpenSim.world
|
|||
{
|
||||
for(int i=0 ; i < this.forcesList.Count; i++)
|
||||
{
|
||||
Console.WriteLine("ADDING A FORCE!");
|
||||
NewForce force = this.forcesList[i];
|
||||
PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z);
|
||||
this._physActor.Velocity = phyVector;
|
||||
|
@ -61,7 +61,7 @@ namespace OpenSim.world
|
|||
|
||||
public override void update()
|
||||
{
|
||||
Console.WriteLine("UPDATING AVATAR!");
|
||||
|
||||
if(this.updateflag)
|
||||
{
|
||||
//need to send movement info
|
||||
|
@ -81,9 +81,11 @@ namespace OpenSim.world
|
|||
this._updateCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(walking)
|
||||
{
|
||||
_updateCount++;
|
||||
if(_updateCount>5)
|
||||
if(_updateCount>3)
|
||||
{
|
||||
//It has been a while since last update was sent so lets send one.
|
||||
ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock();
|
||||
|
@ -99,6 +101,7 @@ namespace OpenSim.world
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupTemplate(string name)
|
||||
{
|
||||
|
|
|
@ -9,8 +9,8 @@ namespace OpenSim.world
|
|||
{
|
||||
public class Entity
|
||||
{
|
||||
protected libsecondlife.LLUUID uuid;
|
||||
protected uint localid;
|
||||
public libsecondlife.LLUUID uuid;
|
||||
public uint localid;
|
||||
public LLVector3 position;
|
||||
public LLVector3 velocity;
|
||||
public Quaternion rotation;
|
||||
|
|
|
@ -2,6 +2,8 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenSim.types;
|
||||
using libsecondlife;
|
||||
using libsecondlife.Packets;
|
||||
|
||||
namespace OpenSim.world
|
||||
{
|
||||
|
@ -9,6 +11,9 @@ namespace OpenSim.world
|
|||
{
|
||||
protected float mesh_cutbegin;
|
||||
protected float mesh_cutend;
|
||||
protected PrimData primData;
|
||||
protected bool newPrimFlag;
|
||||
protected ObjectUpdatePacket OurPacket;
|
||||
|
||||
public Primitive()
|
||||
{
|
||||
|
@ -29,5 +34,103 @@ namespace OpenSim.world
|
|||
|
||||
return mesh;
|
||||
}
|
||||
|
||||
public override void update()
|
||||
{
|
||||
if(this.newPrimFlag)
|
||||
{
|
||||
foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
|
||||
client.OutPacket(OurPacket);
|
||||
}
|
||||
this.newPrimFlag = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateFromPacket( ObjectAddPacket addPacket, LLUUID agentID, uint localID)
|
||||
{
|
||||
ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
|
||||
objupdate.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle;
|
||||
objupdate.RegionData.TimeDilation = 64096;
|
||||
|
||||
objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
|
||||
PrimData PData = new PrimData();
|
||||
this.primData = PData;
|
||||
objupdate.ObjectData[0] = new ObjectUpdatePacket.ObjectDataBlock();//OpenSim_Main.local_world.PrimTemplate;
|
||||
objupdate.ObjectData[0].PSBlock = new byte[0];
|
||||
objupdate.ObjectData[0].ExtraParams = new byte[1];
|
||||
objupdate.ObjectData[0].MediaURL = new byte[0];
|
||||
objupdate.ObjectData[0].NameValue = new byte[0];
|
||||
objupdate.ObjectData[0].PSBlock = new byte[0];
|
||||
objupdate.ObjectData[0].Text = new byte[0];
|
||||
objupdate.ObjectData[0].TextColor = new byte[4];
|
||||
objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0,0,0);
|
||||
objupdate.ObjectData[0].JointPivot = new LLVector3(0,0,0);
|
||||
objupdate.ObjectData[0].Material = 3;
|
||||
objupdate.ObjectData[0].TextureAnim = new byte[0];
|
||||
objupdate.ObjectData[0].Sound = LLUUID.Zero;
|
||||
LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
|
||||
objupdate.ObjectData[0].TextureEntry = ntex.ToBytes();
|
||||
objupdate.ObjectData[0].State = 0;
|
||||
objupdate.ObjectData[0].Data = new byte[0];
|
||||
PData.OwnerID = objupdate.ObjectData[0].OwnerID = agentID;
|
||||
PData.PCode = objupdate.ObjectData[0].PCode = addPacket.ObjectData.PCode;
|
||||
PData.PathBegin = objupdate.ObjectData[0].PathBegin = addPacket.ObjectData.PathBegin;
|
||||
PData.PathEnd = objupdate.ObjectData[0].PathEnd = addPacket.ObjectData.PathEnd;
|
||||
PData.PathScaleX = objupdate.ObjectData[0].PathScaleX = addPacket.ObjectData.PathScaleX;
|
||||
PData.PathScaleY = objupdate.ObjectData[0].PathScaleY = addPacket.ObjectData.PathScaleY;
|
||||
PData.PathShearX = objupdate.ObjectData[0].PathShearX = addPacket.ObjectData.PathShearX;
|
||||
PData.PathShearY = objupdate.ObjectData[0].PathShearY = addPacket.ObjectData.PathShearY;
|
||||
PData.PathSkew = objupdate.ObjectData[0].PathSkew = addPacket.ObjectData.PathSkew;
|
||||
PData.ProfileBegin = objupdate.ObjectData[0].ProfileBegin = addPacket.ObjectData.ProfileBegin;
|
||||
PData.ProfileEnd = objupdate.ObjectData[0].ProfileEnd = addPacket.ObjectData.ProfileEnd;
|
||||
PData.Scale = objupdate.ObjectData[0].Scale = addPacket.ObjectData.Scale;
|
||||
PData.PathCurve = objupdate.ObjectData[0].PathCurve = addPacket.ObjectData.PathCurve;
|
||||
PData.ProfileCurve = objupdate.ObjectData[0].ProfileCurve = addPacket.ObjectData.ProfileCurve;
|
||||
PData.ParentID = objupdate.ObjectData[0].ParentID = 0;
|
||||
PData.ProfileHollow = objupdate.ObjectData[0].ProfileHollow = addPacket.ObjectData.ProfileHollow;
|
||||
//finish off copying rest of shape data
|
||||
|
||||
objupdate.ObjectData[0].ID = (uint)(localID);
|
||||
objupdate.ObjectData[0].FullID = new LLUUID("edba7151-5857-acc5-b30b-f01efefda" + (localID- 702000).ToString("000"));
|
||||
|
||||
objupdate.ObjectData[0].ObjectData = new byte[60];
|
||||
objupdate.ObjectData[0].ObjectData[46] = 128;
|
||||
objupdate.ObjectData[0].ObjectData[47] = 63;
|
||||
LLVector3 pos1= addPacket.ObjectData.RayEnd;
|
||||
//update position
|
||||
byte[] pb = pos1.GetBytes();
|
||||
Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 0, pb.Length);
|
||||
|
||||
this.newPrimFlag = true;
|
||||
this.uuid = objupdate.ObjectData[0].FullID;
|
||||
this.localid = objupdate.ObjectData[0].ID;
|
||||
this.position = pos1;
|
||||
this.OurPacket = objupdate;
|
||||
}
|
||||
}
|
||||
|
||||
public class PrimData
|
||||
{
|
||||
public LLUUID OwnerID;
|
||||
public byte PCode;
|
||||
public byte PathBegin;
|
||||
public byte PathEnd;
|
||||
public byte PathScaleX;
|
||||
public byte PathScaleY;
|
||||
public byte PathShearX;
|
||||
public byte PathShearY;
|
||||
public sbyte PathSkew;
|
||||
public byte ProfileBegin;
|
||||
public byte ProfileEnd;
|
||||
public LLVector3 Scale;
|
||||
public byte PathCurve;
|
||||
public byte ProfileCurve;
|
||||
public uint ParentID=0;
|
||||
public byte ProfileHollow;
|
||||
|
||||
public PrimData()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace OpenSim.world
|
|||
private libsecondlife.TerrainManager TerrainManager;
|
||||
|
||||
private Random Rand = new Random();
|
||||
private uint _primCount = 702000;
|
||||
|
||||
public World()
|
||||
{
|
||||
|
@ -96,10 +97,21 @@ namespace OpenSim.world
|
|||
this.Entities.Add(AgentClient.AgentID, NewAvatar);
|
||||
}
|
||||
|
||||
public void AddNewPrim(ObjectAddPacket addPacket, OpenSimClient AgentClient)
|
||||
{
|
||||
ServerConsole.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim");
|
||||
Primitive prim = new Primitive();
|
||||
prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount);
|
||||
this.Entities.Add(prim.uuid, prim);
|
||||
this._primCount++;
|
||||
}
|
||||
|
||||
public bool Backup() {
|
||||
/* TODO: Save the current world entities state. */
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue