aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples
diff options
context:
space:
mode:
authorMW2007-09-04 13:43:56 +0000
committerMW2007-09-04 13:43:56 +0000
commitbfd36e2e836f92539e68bba077104d5016c5bf8b (patch)
tree36491a61df9cb936500cf349fa7a1ac377b2f350 /OpenSim/Region/Examples
parentreverting opensim.ini to proper default state (diff)
downloadopensim-SC_OLD-bfd36e2e836f92539e68bba077104d5016c5bf8b.zip
opensim-SC_OLD-bfd36e2e836f92539e68bba077104d5016c5bf8b.tar.gz
opensim-SC_OLD-bfd36e2e836f92539e68bba077104d5016c5bf8b.tar.bz2
opensim-SC_OLD-bfd36e2e836f92539e68bba077104d5016c5bf8b.tar.xz
Some work on Module loading/management.
Some more modules templates classes (hoping that someone will pick some of these and work on implementing them). Early version of the "Dynamic Texture Module", although currently there are no render modules included (so not really functional without them). Added osSetDynamicTextureURL script function, for attaching a dynamic texture to a prim. Some work on the console command handling. Added "change-region <regionname>" and "exit-region" so that after the use of change-region, the commands entered will apply to that region only. Then use exit-region to return to the top level (so commands then function as they did before and either apply to all regions or to the first region) (Note: this hasn't been tested very much)
Diffstat (limited to 'OpenSim/Region/Examples')
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs9
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs30
2 files changed, 33 insertions, 6 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 003d3d4..4b05287 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -98,12 +98,14 @@ namespace SimpleApp
98 private LLUUID myID = LLUUID.Random(); 98 private LLUUID myID = LLUUID.Random();
99 public MyNpcCharacter( EventManager eventManager ) 99 public MyNpcCharacter( EventManager eventManager )
100 { 100 {
101 // startPos = new LLVector3(128, (float)(Util.RandomClass.NextDouble()*100), 2);
101 eventManager.OnFrame += Update; 102 eventManager.OnFrame += Update;
102 } 103 }
103 104
105 private LLVector3 startPos = new LLVector3(128, 128,2);
104 public virtual LLVector3 StartPos 106 public virtual LLVector3 StartPos
105 { 107 {
106 get { return new LLVector3(128, 100, 2); } 108 get { return startPos; }
107 set { } 109 set { }
108 } 110 }
109 111
@@ -122,9 +124,10 @@ namespace SimpleApp
122 get { return "Annoying"; } 124 get { return "Annoying"; }
123 } 125 }
124 126
127 private string lastName = "NPC" + Util.RandomClass.Next(1, 1000);
125 public virtual string LastName 128 public virtual string LastName
126 { 129 {
127 get { return "NPC"; } 130 get { return lastName; }
128 } 131 }
129 132
130 public virtual void OutPacket(Packet newPack) { } 133 public virtual void OutPacket(Packet newPack) { }
@@ -203,7 +206,7 @@ namespace SimpleApp
203 flyState = 0; 206 flyState = 0;
204 } 207 }
205 208
206 if (count >= 40) 209 if (count >= 200)
207 { 210 {
208 if (OnChatFromViewer != null) 211 if (OnChatFromViewer != null)
209 { 212 {
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index a1d331d..52e279b 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -1,4 +1,5 @@
1using System; 1using System;
2using System.Collections.Generic;
2using System.Net; 3using System.Net;
3using libsecondlife; 4using libsecondlife;
4using OpenSim.Framework; 5using OpenSim.Framework;
@@ -22,6 +23,7 @@ namespace SimpleApp
22{ 23{
23 class Program : RegionApplicationBase, conscmd_callback 24 class Program : RegionApplicationBase, conscmd_callback
24 { 25 {
26 private ModuleLoader m_moduleLoader;
25 protected override LogBase CreateLog() 27 protected override LogBase CreateLog()
26 { 28 {
27 return new LogBase(null, "SimpleApp", this, false); 29 return new LogBase(null, "SimpleApp", this, false);
@@ -59,8 +61,19 @@ namespace SimpleApp
59 61
60 UDPServer udpServer; 62 UDPServer udpServer;
61 63
64 m_moduleLoader = new ModuleLoader();
65 m_moduleLoader.LoadDefaultSharedModules("");
66
62 Scene scene = SetupScene(regionInfo, out udpServer); 67 Scene scene = SetupScene(regionInfo, out udpServer);
68
69 m_moduleLoader.InitialiseSharedModules(scene);
70 m_moduleLoader.CreateDefaultModules(scene, "");
71 scene.SetModuleInterfaces();
72
63 scene.StartTimer(); 73 scene.StartTimer();
74
75 m_moduleLoader.PostInitialise();
76 m_moduleLoader.ClearCache();
64 77
65 udpServer.ServerListener(); 78 udpServer.ServerListener();
66 79
@@ -75,10 +88,21 @@ namespace SimpleApp
75 ComplexObject complexObject = new ComplexObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(), pos + posOffset ); 88 ComplexObject complexObject = new ComplexObject(scene, regionInfo.RegionHandle, LLUUID.Zero, scene.PrimIDAllocate(), pos + posOffset );
76 scene.AddEntity(complexObject); 89 scene.AddEntity(complexObject);
77 } 90 }
78 91
79 MyNpcCharacter m_character = new MyNpcCharacter(scene.EventManager); 92 /*for (int i = 0; i < 500; i++)
80 scene.AddNewClient(m_character, false); 93 {
94 MyNpcCharacter m_character = new MyNpcCharacter(scene.EventManager);
95 scene.AddNewClient(m_character, false);
96 }
97
98 List<ScenePresence> avatars = scene.RequestAvatarList();
99 foreach (ScenePresence avatar in avatars)
100 {
101 avatar.AbsolutePosition = new LLVector3((float)OpenSim.Framework.Utilities.Util.RandomClass.Next(100,200), (float)OpenSim.Framework.Utilities.Util.RandomClass.Next(30, 200), 2);
102
103 }*/
81 104
105
82 DirectoryInfo dirInfo = new DirectoryInfo( "." ); 106 DirectoryInfo dirInfo = new DirectoryInfo( "." );
83 107
84 float x = 0; 108 float x = 0;