aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
diff options
context:
space:
mode:
authorMW2007-07-14 13:18:02 +0000
committerMW2007-07-14 13:18:02 +0000
commita04602d9c136b882a6c72d4c3c09c3ca0d526c37 (patch)
tree5ff7df736ea67a6ab7830fa0d41a85610d900bbb /OpenSim/Region/Examples/SimpleApp/MyWorld.cs
parent*Moved the OnSignificantClientMovement event to ScenePresence. (diff)
downloadopensim-SC-a04602d9c136b882a6c72d4c3c09c3ca0d526c37.zip
opensim-SC-a04602d9c136b882a6c72d4c3c09c3ca0d526c37.tar.gz
opensim-SC-a04602d9c136b882a6c72d4c3c09c3ca0d526c37.tar.bz2
opensim-SC-a04602d9c136b882a6c72d4c3c09c3ca0d526c37.tar.xz
Added AddPreCompiledScript method to ScriptManager.
Done some work on lbsa71's simpleApp(hope he doesn't mind): now have the avatar showing up and the terrain and his pulsating box (well except its not a box, as there seems to be something wrong with our PrimitiveBaseShape..DefaultBox() settings). Also noticed a few other problems that I had to work around, so these need looking into.
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/MyWorld.cs')
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyWorld.cs50
1 files changed, 48 insertions, 2 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
index 39666fb..1f40052 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
@@ -7,12 +7,14 @@ using OpenSim.Framework.Servers;
7using OpenSim.Framework.Types; 7using OpenSim.Framework.Types;
8using OpenSim.Region.Caches; 8using OpenSim.Region.Caches;
9using OpenSim.Region.Environment.Scenes; 9using OpenSim.Region.Environment.Scenes;
10using OpenSim.Region.Terrain;
10using Avatar=OpenSim.Region.Environment.Scenes.ScenePresence; 11using Avatar=OpenSim.Region.Environment.Scenes.ScenePresence;
11 12
12namespace SimpleApp 13namespace SimpleApp
13{ 14{
14 public class MyWorld : Scene 15 public class MyWorld : Scene
15 { 16 {
17 private bool firstlogin = true;
16 private List<ScenePresence> m_avatars; 18 private List<ScenePresence> m_avatars;
17 19
18 public MyWorld(ClientManager clientManager, RegionInfo regionInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, BaseHttpServer httpServer) 20 public MyWorld(ClientManager clientManager, RegionInfo regionInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, BaseHttpServer httpServer)
@@ -21,6 +23,7 @@ namespace SimpleApp
21 m_avatars = new List<Avatar>(); 23 m_avatars = new List<Avatar>();
22 } 24 }
23 25
26 /*
24 public override void SendLayerData(IClientAPI remoteClient) 27 public override void SendLayerData(IClientAPI remoteClient)
25 { 28 {
26 float[] map = new float[65536]; 29 float[] map = new float[65536];
@@ -34,6 +37,22 @@ namespace SimpleApp
34 } 37 }
35 38
36 remoteClient.SendLayerData(map); 39 remoteClient.SendLayerData(map);
40 }*/
41
42 public override void LoadWorldMap()
43 {
44 float[] map = new float[65536];
45
46 for (int i = 0; i < 65536; i++)
47 {
48 int x = i % 256;
49 int y = i / 256;
50
51 map[i] = 25f;
52 }
53
54 this.Terrain.setHeights1D(map);
55 this.CreateTerrainTexture();
37 } 56 }
38 57
39 #region IWorld Members 58 #region IWorld Members
@@ -41,6 +60,8 @@ namespace SimpleApp
41 override public void AddNewClient(IClientAPI client, bool child) 60 override public void AddNewClient(IClientAPI client, bool child)
42 61
43 { 62 {
63 NewLoggin();
64
44 LLVector3 pos = new LLVector3(128, 128, 128); 65 LLVector3 pos = new LLVector3(128, 128, 128);
45 66
46 client.OnRegionHandShakeReply += SendLayerData; 67 client.OnRegionHandShakeReply += SendLayerData;
@@ -66,8 +87,33 @@ namespace SimpleApp
66 87
67 client.SendRegionHandshake(m_regInfo); 88 client.SendRegionHandshake(m_regInfo);
68 89
69 CreateAndAddScenePresence(client); 90 ScenePresence avatar =CreateAndAddScenePresence(client);
70 91 avatar.Pos = new LLVector3(128, 128, 26);
92 }
93
94 public void NewLoggin()
95 {
96 if (firstlogin)
97 {
98 this.StartTimer();
99
100 scriptManager.AddPreCompiledScript(new PulseScript());
101
102 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox();
103 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
104 LLVector3 pos1 = new LLVector3(129, 129, 27);
105 AddNewPrim(LLUUID.Random(), pos1, shape);
106 firstlogin = false;
107 }
108 }
109
110 public override void Update()
111 {
112 foreach (LLUUID UUID in Entities.Keys)
113 {
114 Entities[UUID].update();
115 }
116 eventManager.TriggerOnFrame();
71 } 117 }
72 118
73 #endregion 119 #endregion