aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorlbsa712007-07-18 09:36:47 +0000
committerlbsa712007-07-18 09:36:47 +0000
commitf70ec1fa75ef526266ad359d2db0e25f2635c182 (patch)
tree0ce6f6df1702d849532d1818c76c2bd301fb4579 /OpenSim/Region
parent* One hopefully-final attempt at fixing this remoting issue. (diff)
downloadopensim-SC_OLD-f70ec1fa75ef526266ad359d2db0e25f2635c182.zip
opensim-SC_OLD-f70ec1fa75ef526266ad359d2db0e25f2635c182.tar.gz
opensim-SC_OLD-f70ec1fa75ef526266ad359d2db0e25f2635c182.tar.bz2
opensim-SC_OLD-f70ec1fa75ef526266ad359d2db0e25f2635c182.tar.xz
* Added a FileSystemObject to SimpleApp
* Added Some ShapeTypes (shapes doesn't work though!) * Fixed some \0 issues
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs4
-rw-r--r--OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs31
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs26
3 files changed, 56 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 2ac1000..044ad68 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -779,7 +779,7 @@ namespace OpenSim.Region.ClientStack
779 outPacket.ObjectData[0].ID = localID; 779 outPacket.ObjectData[0].ID = localID;
780 outPacket.ObjectData[0].FullID = objectID; 780 outPacket.ObjectData[0].FullID = objectID;
781 outPacket.ObjectData[0].OwnerID = ownerID; 781 outPacket.ObjectData[0].OwnerID = ownerID;
782 outPacket.ObjectData[0].Text = enc.GetBytes(text); 782 outPacket.ObjectData[0].Text = Helpers.StringToField( text );
783 outPacket.ObjectData[0].ParentID = parentID; 783 outPacket.ObjectData[0].ParentID = parentID;
784 byte[] pb = pos.GetBytes(); 784 byte[] pb = pos.GetBytes();
785 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); 785 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
@@ -798,7 +798,7 @@ namespace OpenSim.Region.ClientStack
798 outPacket.ObjectData[0].ID = localID; 798 outPacket.ObjectData[0].ID = localID;
799 outPacket.ObjectData[0].FullID = objectID; 799 outPacket.ObjectData[0].FullID = objectID;
800 outPacket.ObjectData[0].OwnerID = ownerID; 800 outPacket.ObjectData[0].OwnerID = ownerID;
801 outPacket.ObjectData[0].Text = enc.GetBytes(text); 801 outPacket.ObjectData[0].Text = Helpers.StringToField( text );
802 outPacket.ObjectData[0].ParentID = parentID; 802 outPacket.ObjectData[0].ParentID = parentID;
803 byte[] pb = pos.GetBytes(); 803 byte[] pb = pos.GetBytes();
804 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); 804 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
diff --git a/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs b/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs
new file mode 100644
index 0000000..2e43fe6
--- /dev/null
+++ b/OpenSim/Region/Examples/SimpleApp/FileSystemObject.cs
@@ -0,0 +1,31 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Region.Environment.Scenes;
5using libsecondlife;
6using OpenSim.Framework.Types;
7using System.Timers;
8using System.Diagnostics;
9using System.IO;
10using Primitive=OpenSim.Region.Environment.Scenes.Primitive;
11
12namespace SimpleApp
13{
14 public class FileSystemObject : SceneObject
15 {
16 public FileSystemObject(Scene world, FileInfo fileInfo, LLVector3 pos)
17 : base( world, world.EventManager, LLUUID.Zero, world.NextLocalId, pos, BoxShape.Default )
18 {
19
20
21 float size = (float)Math.Pow((double)fileInfo.Length, (double) 1 / 3) / 5;
22 rootPrimitive.ResizeGoup(new LLVector3(size, size, size));
23 rootPrimitive.Text = fileInfo.Name;
24 }
25
26 public override void Update()
27 {
28 base.Update();
29 }
30 }
31}
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 4dae461..82dba0e 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -17,6 +17,7 @@ using System.Timers;
17using OpenSim.Region.Environment.Scenes; 17using OpenSim.Region.Environment.Scenes;
18using OpenSim.Framework.Data; 18using OpenSim.Framework.Data;
19using OpenSim.Region.Environment; 19using OpenSim.Region.Environment;
20using System.IO;
20 21
21namespace SimpleApp 22namespace SimpleApp
22{ 23{
@@ -58,16 +59,35 @@ namespace SimpleApp
58 59
59 udpServer.ServerListener(); 60 udpServer.ServerListener();
60 61
61 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); 62 PrimitiveBaseShape shape = BoxShape.Default;
62 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); 63 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
63 LLVector3 pos = new LLVector3(138, 129, 27); 64 LLVector3 pos = new LLVector3(138, 129, 27);
64 65
65 SceneObject m_sceneObject = new CpuCounterObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape); 66 SceneObject sceneObject = new CpuCounterObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape);
66 scene.AddEntity(m_sceneObject); 67 scene.AddEntity(sceneObject);
67 68
68 MyNpcCharacter m_character = new MyNpcCharacter( scene.EventManager ); 69 MyNpcCharacter m_character = new MyNpcCharacter( scene.EventManager );
69 scene.AddNewClient(m_character, false); 70 scene.AddNewClient(m_character, false);
70 71
72 DirectoryInfo dirInfo = new DirectoryInfo( "." );
73
74 float x = 0;
75 float z = 0;
76
77 foreach( FileInfo fileInfo in dirInfo.GetFiles())
78 {
79 LLVector3 filePos = new LLVector3(100 + x, 129, 27 + z);
80 x = x + 2;
81 if( x > 50 )
82 {
83 x = 0;
84 z = z + 2;
85 }
86
87 FileSystemObject fileObject = new FileSystemObject( scene, fileInfo, filePos );
88 scene.AddEntity(fileObject);
89 }
90
71 m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); 91 m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit.");
72 m_log.ReadLine(); 92 m_log.ReadLine();
73 } 93 }