aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
diff options
context:
space:
mode:
authorlbsa712007-07-14 15:33:25 +0000
committerlbsa712007-07-14 15:33:25 +0000
commit811d2b69c9c5d07dbb196cd2ee6353916d0b51c5 (patch)
treead6cb65aee221bdab5a0cd7deddb49950ba98241 /OpenSim/Region/Examples/SimpleApp/MyWorld.cs
parent*Added support for prim counting on parcels (diff)
downloadopensim-SC_OLD-811d2b69c9c5d07dbb196cd2ee6353916d0b51c5.zip
opensim-SC_OLD-811d2b69c9c5d07dbb196cd2ee6353916d0b51c5.tar.gz
opensim-SC_OLD-811d2b69c9c5d07dbb196cd2ee6353916d0b51c5.tar.bz2
opensim-SC_OLD-811d2b69c9c5d07dbb196cd2ee6353916d0b51c5.tar.xz
* Worked some more on SimpleApp
* Removed SceneObject references to RegionHandle, ParcelManager, EventManager as they are public on Scene * Moved PulseScript behaviour into MySceneObject
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/MyWorld.cs')
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyWorld.cs61
1 files changed, 12 insertions, 49 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
index d7a0ab2..d0e3fed 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
@@ -8,7 +8,7 @@ using 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 OpenSim.Region.Terrain;
11using Avatar = OpenSim.Region.Environment.Scenes.ScenePresence; 11using Avatar=OpenSim.Region.Environment.Scenes.ScenePresence;
12 12
13namespace SimpleApp 13namespace SimpleApp
14{ 14{
@@ -22,22 +22,6 @@ namespace SimpleApp
22 m_avatars = new List<Avatar>(); 22 m_avatars = new List<Avatar>();
23 } 23 }
24 24
25 /*
26 public override void SendLayerData(IClientAPI remoteClient)
27 {
28 float[] map = new float[65536];
29
30 for (int i = 0; i < 65536; i++)
31 {
32 int x = i % 256;
33 int y = i / 256;
34
35 map[i] = 0f;
36 }
37
38 remoteClient.SendLayerData(map);
39 }*/
40
41 public override void LoadWorldMap() 25 public override void LoadWorldMap()
42 { 26 {
43 float[] map = new float[65536]; 27 float[] map = new float[65536];
@@ -59,55 +43,34 @@ namespace SimpleApp
59 override public void AddNewClient(IClientAPI client, bool child) 43 override public void AddNewClient(IClientAPI client, bool child)
60 { 44 {
61 LLVector3 pos = new LLVector3(128, 128, 128); 45 LLVector3 pos = new LLVector3(128, 128, 128);
62 46
63 client.OnRegionHandShakeReply += SendLayerData; 47 client.OnRegionHandShakeReply += SendLayerData;
64 client.OnChatFromViewer += 48 client.OnChatFromViewer +=
65 delegate(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 49 delegate(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
66 { 50 {
67 // Echo it (so you know what you typed) 51 // Echo it (so you know what you typed)
68 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); 52 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID);
69 client.SendChatMessage("Ready.", 1, pos, "System", LLUUID.Zero); 53 client.SendChatMessage("Ready.", 1, pos, "System", LLUUID.Zero );
70 }; 54 };
71 55
72 client.OnAddPrim += AddNewPrim; 56 client.OnAddPrim += AddNewPrim;
73 client.OnUpdatePrimGroupPosition += this.UpdatePrimPosition; 57 client.OnUpdatePrimGroupPosition += this.UpdatePrimPosition;
74 client.OnRequestMapBlocks += this.RequestMapBlocks; 58 client.OnRequestMapBlocks += this.RequestMapBlocks;
75 client.OnTeleportLocationRequest += this.RequestTeleportLocation; 59 client.OnTeleportLocationRequest += this.RequestTeleportLocation;
76 client.OnGrapUpdate += this.MoveObject; 60 client.OnGrapUpdate += this.MoveObject;
77 client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; 61 client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest;
78 62
79 client.OnCompleteMovementToRegion += delegate() 63 client.OnCompleteMovementToRegion += delegate()
80 { 64 {
81 client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero); 65 client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero );
82 }; 66 };
83 67
84 client.SendRegionHandshake(m_regInfo); 68 client.SendRegionHandshake(m_regInfo);
85 69
86 ScenePresence avatar = CreateAndAddScenePresence(client); 70 ScenePresence avatar = CreateAndAddScenePresence(client);
87 avatar.Pos = new LLVector3(128, 128, 26); 71 avatar.Pos = new LLVector3(128, 128, 26);
88 }
89
90 public void CustomStartup()
91 {
92 this.StartTimer();
93
94 ScriptManager.AddPreCompiledScript(new PulseScript());
95
96 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox();
97 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
98 LLVector3 pos1 = new LLVector3(129, 129, 27);
99 AddNewPrim(LLUUID.Random(), pos1, shape);
100 } 72 }
101 73
102 public override void Update()
103 {
104 foreach (LLUUID UUID in Entities.Keys)
105 {
106 Entities[UUID].update();
107 }
108 EventManager.TriggerOnFrame();
109 }
110
111 #endregion 74 #endregion
112 } 75 }
113} 76}