aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/MyWorld.cs')
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyWorld.cs46
1 files changed, 19 insertions, 27 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
index f46e403..d7a0ab2 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
@@ -8,13 +8,12 @@ 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{
15 public class MyWorld : Scene 15 public class MyWorld : Scene
16 { 16 {
17 private bool firstlogin = true;
18 private List<ScenePresence> m_avatars; 17 private List<ScenePresence> m_avatars;
19 18
20 public MyWorld(ClientManager clientManager, RegionInfo regionInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, BaseHttpServer httpServer) 19 public MyWorld(ClientManager clientManager, RegionInfo regionInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, BaseHttpServer httpServer)
@@ -58,53 +57,46 @@ namespace SimpleApp
58 #region IWorld Members 57 #region IWorld Members
59 58
60 override public void AddNewClient(IClientAPI client, bool child) 59 override public void AddNewClient(IClientAPI client, bool child)
61
62 { 60 {
63 NewLoggin();
64
65 LLVector3 pos = new LLVector3(128, 128, 128); 61 LLVector3 pos = new LLVector3(128, 128, 128);
66 62
67 client.OnRegionHandShakeReply += SendLayerData; 63 client.OnRegionHandShakeReply += SendLayerData;
68 client.OnChatFromViewer += 64 client.OnChatFromViewer +=
69 delegate(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 65 delegate(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
70 { 66 {
71 // Echo it (so you know what you typed) 67 // Echo it (so you know what you typed)
72 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID); 68 client.SendChatMessage(message, type, fromPos, fromName, fromAgentID);
73 client.SendChatMessage("Ready.", 1, pos, "System", LLUUID.Zero ); 69 client.SendChatMessage("Ready.", 1, pos, "System", LLUUID.Zero);
74 }; 70 };
75 71
76 client.OnAddPrim += AddNewPrim; 72 client.OnAddPrim += AddNewPrim;
77 client.OnUpdatePrimGroupPosition += this.UpdatePrimPosition; 73 client.OnUpdatePrimGroupPosition += this.UpdatePrimPosition;
78 client.OnRequestMapBlocks += this.RequestMapBlocks; 74 client.OnRequestMapBlocks += this.RequestMapBlocks;
79 client.OnTeleportLocationRequest += this.RequestTeleportLocation; 75 client.OnTeleportLocationRequest += this.RequestTeleportLocation;
80 client.OnGrapUpdate += this.MoveObject; 76 client.OnGrapUpdate += this.MoveObject;
81 client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; 77 client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest;
82 78
83 client.OnCompleteMovementToRegion += delegate() 79 client.OnCompleteMovementToRegion += delegate()
84 { 80 {
85 client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero ); 81 client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero);
86 }; 82 };
87 83
88 client.SendRegionHandshake(m_regInfo); 84 client.SendRegionHandshake(m_regInfo);
89 85
90 ScenePresence avatar =CreateAndAddScenePresence(client); 86 ScenePresence avatar = CreateAndAddScenePresence(client);
91 avatar.Pos = new LLVector3(128, 128, 26); 87 avatar.Pos = new LLVector3(128, 128, 26);
92 } 88 }
93 89
94 public void NewLoggin() 90 public void CustomStartup()
95 { 91 {
96 if (firstlogin) 92 this.StartTimer();
97 {
98 this.StartTimer();
99 93
100 ScriptManager.AddPreCompiledScript(new PulseScript()); 94 ScriptManager.AddPreCompiledScript(new PulseScript());
101 95
102 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); 96 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox();
103 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); 97 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
104 LLVector3 pos1 = new LLVector3(129, 129, 27); 98 LLVector3 pos1 = new LLVector3(129, 129, 27);
105 AddNewPrim(LLUUID.Random(), pos1, shape); 99 AddNewPrim(LLUUID.Random(), pos1, shape);
106 firstlogin = false;
107 }
108 } 100 }
109 101
110 public override void Update() 102 public override void Update()