aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMW2007-07-15 22:11:03 +0000
committerMW2007-07-15 22:11:03 +0000
commit4dbad04b9f00924eb58fa371887ab8901faa6ab7 (patch)
treeec976cc11cbf04ad21d65c5599755f8621bab86b /OpenSim
parent* Added new scripting related events, in particular a new event which is trig... (diff)
downloadopensim-SC_OLD-4dbad04b9f00924eb58fa371887ab8901faa6ab7.zip
opensim-SC_OLD-4dbad04b9f00924eb58fa371887ab8901faa6ab7.tar.gz
opensim-SC_OLD-4dbad04b9f00924eb58fa371887ab8901faa6ab7.tar.bz2
opensim-SC_OLD-4dbad04b9f00924eb58fa371887ab8901faa6ab7.tar.xz
It wasn't me who messed up flying when adding a test NPC class. (honestly!)
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs13
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs9
4 files changed, 16 insertions, 10 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 8456b6b..e5a73fd 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Communications.OGS1
84 84
85 // Initialise the background listeners 85 // Initialise the background listeners
86 RegionCommsListener regListener = new RegionCommsListener(); 86 RegionCommsListener regListener = new RegionCommsListener();
87 if (this.listeners.ContainsKey(regionInfo.RegionHandle)) 87 if (!this.listeners.ContainsKey(regionInfo.RegionHandle))
88 { 88 {
89 this.listeners.Add(regionInfo.RegionHandle, regListener); 89 this.listeners.Add(regionInfo.RegionHandle, regListener);
90 } 90 }
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 3558ca3..b619b59 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Region.Environment.Scenes
75 DIR_CONTROL_FLAG_LEFT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_POS, 75 DIR_CONTROL_FLAG_LEFT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_POS,
76 DIR_CONTROL_FLAG_RIGHT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_NEG, 76 DIR_CONTROL_FLAG_RIGHT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_NEG,
77 DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS, 77 DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS,
78 DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG 78 DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG
79 } 79 }
80 /// <summary> 80 /// <summary>
81 /// Position at which a significant movement was made 81 /// Position at which a significant movement was made
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 1c267c6..e6bc715 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -20,6 +20,7 @@ namespace SimpleApp
20 private uint movementDirection = 0; 20 private uint movementDirection = 0;
21 private bool fly = true; 21 private bool fly = true;
22 private LLQuaternion bodyDirection = LLQuaternion.Identity; 22 private LLQuaternion bodyDirection = LLQuaternion.Identity;
23 private short count = 0;
23 24
24 public event ImprovedInstantMessage OnInstantMessage; 25 public event ImprovedInstantMessage OnInstantMessage;
25 public event ChatFromViewer OnChatFromViewer; 26 public event ChatFromViewer OnChatFromViewer;
@@ -144,13 +145,12 @@ namespace SimpleApp
144 { 145 {
145 Timer timer = new Timer(); 146 Timer timer = new Timer();
146 timer.Enabled = true; 147 timer.Enabled = true;
147 timer.Interval = 10000; 148 timer.Interval = 500;
148 timer.Elapsed += new ElapsedEventHandler(this.Heartbeat); 149 timer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
149 } 150 }
150 151
151 public void Heartbeat(object sender, EventArgs e) 152 public void Heartbeat(object sender, EventArgs e)
152 { 153 {
153
154 Encoding enc = Encoding.ASCII; 154 Encoding enc = Encoding.ASCII;
155 155
156 this.OnAgentUpdate(this, movementDirection, bodyDirection); 156 this.OnAgentUpdate(this, movementDirection, bodyDirection);
@@ -165,10 +165,13 @@ namespace SimpleApp
165 movementDirection = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS; 165 movementDirection = (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY | (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS;
166 fly = true; 166 fly = true;
167 } 167 }
168 if (count >= 40)
169 {
170 this.OnChatFromViewer(enc.GetBytes("Kind of quiet around here isn't it! \0"), 2, new LLVector3(128, 128, 26), this.FirstName + " " + this.LastName, this.AgentId);
171 count = -1;
172 }
168 173
169 this.OnChatFromViewer(enc.GetBytes("Kind of quiet around here isn't it! \0"), 2, new LLVector3(128, 128, 26), this.FirstName + " " + this.LastName, this.AgentId); 174 count++;
170
171
172 } 175 }
173 } 176 }
174} 177}
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 0c688ba..3e4bfee 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -47,6 +47,9 @@ namespace SimpleApp
47 47
48 AssetCache assetCache = new AssetCache(assetServer); 48 AssetCache assetCache = new AssetCache(assetServer);
49 49
50 ScenePresence.LoadTextureFile("avatar-texture.dat");
51 ScenePresence.PhysicsEngineFlying = true;
52
50 PhysicsManager physManager = new PhysicsManager(); 53 PhysicsManager physManager = new PhysicsManager();
51 physManager.LoadPlugins(); 54 physManager.LoadPlugins();
52 55
@@ -65,7 +68,7 @@ namespace SimpleApp
65 68
66 world = new MyWorld( regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, httpServer); 69 world = new MyWorld( regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, httpServer);
67 world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null; 70 world.PhysScene = physManager.GetPhysicsScene("basicphysics"); //PhysicsScene.Null;
68 71
69 world.LoadWorldMap(); 72 world.LoadWorldMap();
70 world.PhysScene.SetTerrain(world.Terrain.getHeights1D()); 73 world.PhysScene.SetTerrain(world.Terrain.getHeights1D());
71 74
@@ -81,6 +84,8 @@ namespace SimpleApp
81 world.ParcelManager.NoParcelDataFromStorage(); 84 world.ParcelManager.NoParcelDataFromStorage();
82 } 85 }
83 86
87 world.StartTimer();
88
84 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); 89 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox();
85 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); 90 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
86 LLVector3 pos = new LLVector3(138, 129, 27); 91 LLVector3 pos = new LLVector3(138, 129, 27);
@@ -91,8 +96,6 @@ namespace SimpleApp
91 m_character = new MyNpcCharacter(); 96 m_character = new MyNpcCharacter();
92 world.AddNewClient(m_character, false); 97 world.AddNewClient(m_character, false);
93 98
94 world.StartTimer();
95
96 m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); 99 m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit.");
97 m_log.ReadLine(); 100 m_log.ReadLine();
98 101