aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMW2007-05-29 09:16:18 +0000
committerMW2007-05-29 09:16:18 +0000
commitb2eb26e4babbf87c8db84e67de116ef145feb2d6 (patch)
treeb5feafcaa4ee0dbe18c502203595d7e0d9014987 /OpenSim
parentShould allow multiple worlds (and UDP servers) to be ran in one instance, jus... (diff)
downloadopensim-SC_OLD-b2eb26e4babbf87c8db84e67de116ef145feb2d6.zip
opensim-SC_OLD-b2eb26e4babbf87c8db84e67de116ef145feb2d6.tar.gz
opensim-SC_OLD-b2eb26e4babbf87c8db84e67de116ef145feb2d6.tar.bz2
opensim-SC_OLD-b2eb26e4babbf87c8db84e67de116ef145feb2d6.tar.xz
number of changes
Diffstat (limited to '')
-rw-r--r--OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs6
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.API.cs198
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.cs22
-rw-r--r--OpenSim/OpenSim.RegionServer/RegionServerBase.cs2
-rw-r--r--OpenSim/OpenSim.RegionServer/VersionInfo.cs2
-rw-r--r--OpenSim/OpenSim.World/Avatar.cs40
-rw-r--r--OpenSim/OpenSim.World/World.cs9
-rw-r--r--OpenSim/OpenSim.World/WorldBase.cs8
-rw-r--r--OpenSim/OpenSim/OpenSimMain.cs50
9 files changed, 278 insertions, 59 deletions
diff --git a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
index 54be853..69f5915 100644
--- a/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
+++ b/OpenSim/OpenSim.Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
@@ -49,11 +49,7 @@ namespace OpenSim.Physics.BasicPhysicsPlugin
49 49
50 public PhysicsScene GetScene() 50 public PhysicsScene GetScene()
51 { 51 {
52 if(_mScene == null) 52 return new BasicScene();
53 {
54 _mScene = new BasicScene();
55 }
56 return(_mScene);
57 } 53 }
58 54
59 public string GetName() 55 public string GetName()
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
index 579928c..55ff8a1 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using OpenSim.Framework.Interfaces; 4using OpenSim.Framework.Interfaces;
5using OpenSim.Framework.Inventory; 5using OpenSim.Framework.Inventory;
6using OpenSim.Framework.Types;
6using libsecondlife; 7using libsecondlife;
7using libsecondlife.Packets; 8using libsecondlife.Packets;
8 9
@@ -32,6 +33,8 @@ namespace OpenSim
32 public event UpdatePrimVector OnUpdatePrimScale; 33 public event UpdatePrimVector OnUpdatePrimScale;
33 public event StatusChange OnChildAgentStatus; 34 public event StatusChange OnChildAgentStatus;
34 public event GenericCall2 OnStopMovement; 35 public event GenericCall2 OnStopMovement;
36 public event NewAvatar OnNewAvatar;
37 public event GenericCall6 OnRemoveAvatar;
35 38
36 public LLVector3 StartPos 39 public LLVector3 StartPos
37 { 40 {
@@ -70,7 +73,7 @@ namespace OpenSim
70 this.OutPacket(reply); 73 this.OutPacket(reply);
71 } 74 }
72 75
73 public void SendAppearance(AvatarWearable[] wearables) 76 public void SendWearables(AvatarWearable[] wearables)
74 { 77 {
75 AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket(); 78 AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket();
76 aw.AgentData.AgentID = this.AgentID; 79 aw.AgentData.AgentID = this.AgentID;
@@ -90,6 +93,199 @@ namespace OpenSim
90 93
91 this.OutPacket(aw); 94 this.OutPacket(aw);
92 } 95 }
96
97 public void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry)
98 {
99 AvatarAppearancePacket avp = new AvatarAppearancePacket();
100 avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218];
101 avp.ObjectData.TextureEntry = textureEntry;
102
103 AvatarAppearancePacket.VisualParamBlock avblock = null;
104 for (int i = 0; i < 218; i++)
105 {
106 avblock = new AvatarAppearancePacket.VisualParamBlock();
107 avblock.ParamValue = visualParams[i];
108 avp.VisualParam[i] = avblock;
109 }
110
111 avp.Sender.IsTrial = false;
112 avp.Sender.ID = agentID;
113 OutPacket(avp);
114 }
115
116 /// <summary>
117 /// Send the region heightmap to the client
118 /// </summary>
119 /// <param name="map">heightmap</param>
120 public virtual void SendLayerData(float[] map)
121 {
122 try
123 {
124 int[] patches = new int[4];
125
126 for (int y = 0; y < 16; y++)
127 {
128 for (int x = 0; x < 16; x = x + 4)
129 {
130 patches[0] = x + 0 + y * 16;
131 patches[1] = x + 1 + y * 16;
132 patches[2] = x + 2 + y * 16;
133 patches[3] = x + 3 + y * 16;
134
135 Packet layerpack = TerrainManager.CreateLandPacket(map, patches);
136 OutPacket(layerpack);
137 }
138 }
139 }
140 catch (Exception e)
141 {
142 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString());
143 }
144 }
145
146 /// <summary>
147 /// Sends a specified patch to a client
148 /// </summary>
149 /// <param name="px">Patch coordinate (x) 0..16</param>
150 /// <param name="py">Patch coordinate (y) 0..16</param>
151 /// <param name="map">heightmap</param>
152 public void SendLayerData(int px, int py, float[] map)
153 {
154 try
155 {
156 int[] patches = new int[1];
157 int patchx, patchy;
158 patchx = px / 16;
159 patchy = py / 16;
160
161 patches[0] = patchx + 0 + patchy * 16;
162
163 Packet layerpack = TerrainManager.CreateLandPacket(map, patches);
164 OutPacket(layerpack);
165 }
166 catch (Exception e)
167 {
168 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString());
169 }
170 }
171
172 public void SendRegionHandshake(RegionInfo regionInfo)
173 {
174 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
175 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
176 RegionHandshakePacket handshake = new RegionHandshakePacket();
177
178 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details");
179 handshake.RegionInfo.BillableFactor = 0;
180 handshake.RegionInfo.IsEstateManager = false;
181 handshake.RegionInfo.TerrainHeightRange00 = regionInfo.TerrainHeightRange00;
182 handshake.RegionInfo.TerrainHeightRange01 = regionInfo.TerrainHeightRange01;
183 handshake.RegionInfo.TerrainHeightRange10 = regionInfo.TerrainHeightRange10;
184 handshake.RegionInfo.TerrainHeightRange11 = regionInfo.TerrainHeightRange11;
185 handshake.RegionInfo.TerrainStartHeight00 = regionInfo.TerrainStartHeight00;
186 handshake.RegionInfo.TerrainStartHeight01 = regionInfo.TerrainStartHeight01;
187 handshake.RegionInfo.TerrainStartHeight10 = regionInfo.TerrainStartHeight10;
188 handshake.RegionInfo.TerrainStartHeight11 = regionInfo.TerrainStartHeight11;
189 handshake.RegionInfo.SimAccess = 13;
190 handshake.RegionInfo.WaterHeight = regionInfo.RegionWaterHeight;
191 uint regionFlags = 72458694;
192 if (regionInfo.RegionTerraform)
193 {
194 regionFlags -= 64;
195 }
196 handshake.RegionInfo.RegionFlags = regionFlags;
197 handshake.RegionInfo.SimName = _enc.GetBytes(regionInfo.RegionName + "\0");
198 handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
199 handshake.RegionInfo.TerrainBase0 = regionInfo.TerrainBase0;
200 handshake.RegionInfo.TerrainBase1 = regionInfo.TerrainBase1;
201 handshake.RegionInfo.TerrainBase2 = regionInfo.TerrainBase2;
202 handshake.RegionInfo.TerrainBase3 = regionInfo.TerrainBase3;
203 handshake.RegionInfo.TerrainDetail0 = regionInfo.TerrainDetail0;
204 handshake.RegionInfo.TerrainDetail1 = regionInfo.TerrainDetail1;
205 handshake.RegionInfo.TerrainDetail2 = regionInfo.TerrainDetail2;
206 handshake.RegionInfo.TerrainDetail3 = regionInfo.TerrainDetail3;
207 handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37");
208
209 OutPacket(handshake);
210 }
211
212 public void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos)
213 {
214 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
215 //send a objectupdate packet with information about the clients avatar
216
217 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
218 objupdate.RegionData.RegionHandle = regionInfo.RegionHandle;
219 objupdate.RegionData.TimeDilation = 64096;
220 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
221 objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket();
222 //give this avatar object a local id and assign the user a name
223
224 objupdate.ObjectData[0].ID = avatarLocalID;
225 objupdate.ObjectData[0].FullID = avatarID;
226 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName + " \0");
227 libsecondlife.LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z);
228 byte[] pb = pos2.GetBytes();
229 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
230
231 OutPacket(objupdate);
232
233 }
234
235 protected void SetDefaultPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata)
236 {
237 objdata.PSBlock = new byte[0];
238 objdata.ExtraParams = new byte[1];
239 objdata.MediaURL = new byte[0];
240 objdata.NameValue = new byte[0];
241 objdata.Text = new byte[0];
242 objdata.TextColor = new byte[4];
243 objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0);
244 objdata.JointPivot = new LLVector3(0, 0, 0);
245 objdata.Material = 4;
246 objdata.TextureAnim = new byte[0];
247 objdata.Sound = LLUUID.Zero;
248 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
249 objdata.TextureEntry = ntex.ToBytes();
250 objdata.State = 0;
251 objdata.Data = new byte[0];
252
253 objdata.ObjectData = new byte[76];
254 objdata.ObjectData[15] = 128;
255 objdata.ObjectData[16] = 63;
256 objdata.ObjectData[56] = 128;
257 objdata.ObjectData[61] = 102;
258 objdata.ObjectData[62] = 40;
259 objdata.ObjectData[63] = 61;
260 objdata.ObjectData[64] = 189;
261 }
262
263 protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket()
264 {
265 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
266
267 SetDefaultPacketValues(ref objdata);
268 objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24);
269 objdata.PathCurve = 16;
270 objdata.ProfileCurve = 1;
271 objdata.PathScaleX = 100;
272 objdata.PathScaleY = 100;
273 objdata.ParentID = 0;
274 objdata.OwnerID = LLUUID.Zero;
275 objdata.Scale = new LLVector3(1, 1, 1);
276 objdata.PCode = 47;
277 System.Text.Encoding enc = System.Text.Encoding.ASCII;
278 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
279 pos.X = 100f;
280 objdata.ID = 8880000;
281 objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0");
282 libsecondlife.LLVector3 pos2 = new LLVector3(100f, 100f, 23f);
283 //objdata.FullID=user.AgentID;
284 byte[] pb = pos.GetBytes();
285 Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length);
286
287 return objdata;
288 }
93 #endregion 289 #endregion
94 290
95 } 291 }
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.cs b/OpenSim/OpenSim.RegionServer/ClientView.cs
index 0419b7a..4d1634c 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.cs
@@ -52,12 +52,16 @@ namespace OpenSim
52 /// </summary> 52 /// </summary>
53 public partial class ClientView : ClientViewBase, IClientAPI 53 public partial class ClientView : ClientViewBase, IClientAPI
54 { 54 {
55 public static TerrainManager TerrainManager;
56
55 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients 57 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
56 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); //local handlers for this instance 58 protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); //local handlers for this instance
57 59
58 public LLUUID AgentID; 60 public LLUUID AgentID;
59 public LLUUID SessionID; 61 public LLUUID SessionID;
60 public LLUUID SecureSessionID = LLUUID.Zero; 62 public LLUUID SecureSessionID = LLUUID.Zero;
63 public string FirstName;
64 public string LastName;
61 public bool m_child = false; 65 public bool m_child = false;
62 private UseCircuitCodePacket cirpack; 66 private UseCircuitCodePacket cirpack;
63 public Thread ClientThread; 67 public Thread ClientThread;
@@ -112,13 +116,9 @@ namespace OpenSim
112 { 116 {
113 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent"); 117 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent");
114 this.m_child = false; 118 this.m_child = false;
115 //this.m_world.RemoveViewerAgent(this);
116
117 this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode); 119 this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode);
118 m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false); 120 m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false);
119
120 OnChildAgentStatus(this.m_child); 121 OnChildAgentStatus(this.m_child);
121 //this.InitNewClient();
122 } 122 }
123 123
124 public void DowngradeClient() 124 public void DowngradeClient()
@@ -126,8 +126,7 @@ namespace OpenSim
126 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - changing full agent to child"); 126 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - changing full agent to child");
127 this.m_child = true; 127 this.m_child = true;
128 OnChildAgentStatus(this.m_child); 128 OnChildAgentStatus(this.m_child);
129 //this.m_world.RemoveViewerAgent(this); 129
130 //this.m_world.AddViewerAgent(this);
131 } 130 }
132 131
133 public void KillClient() 132 public void KillClient()
@@ -230,8 +229,8 @@ namespace OpenSim
230 229
231 protected virtual void InitNewClient() 230 protected virtual void InitNewClient()
232 { 231 {
233 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); 232 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
234 // this.ClientAvatar = m_world.AddViewerAgent(this); 233 OnNewAvatar(this, this.AgentID, this.m_child);
235 } 234 }
236 235
237 protected virtual void AuthUser() 236 protected virtual void AuthUser()
@@ -251,13 +250,14 @@ namespace OpenSim
251 this.AgentID = cirpack.CircuitCode.ID; 250 this.AgentID = cirpack.CircuitCode.ID;
252 this.SessionID = cirpack.CircuitCode.SessionID; 251 this.SessionID = cirpack.CircuitCode.SessionID;
253 this.CircuitCode = cirpack.CircuitCode.Code; 252 this.CircuitCode = cirpack.CircuitCode.Code;
254 InitNewClient(); 253 this.FirstName = sessionInfo.LoginInfo.First;
255 //this.ClientAvatar.firstname = sessionInfo.LoginInfo.First; 254 this.LastName = sessionInfo.LoginInfo.Last;
256 // this.ClientAvatar.lastname = sessionInfo.LoginInfo.Last; 255
257 if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero) 256 if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero)
258 { 257 {
259 this.SecureSessionID = sessionInfo.LoginInfo.SecureSession; 258 this.SecureSessionID = sessionInfo.LoginInfo.SecureSession;
260 } 259 }
260 InitNewClient();
261 261
262 ClientLoop(); 262 ClientLoop();
263 } 263 }
diff --git a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs b/OpenSim/OpenSim.RegionServer/RegionServerBase.cs
index 7f18d34..3b9c6e0 100644
--- a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs
+++ b/OpenSim/OpenSim.RegionServer/RegionServerBase.cs
@@ -46,7 +46,7 @@ namespace OpenSim
46 protected List<RegionInfo> regionData = new List<RegionInfo>(); 46 protected List<RegionInfo> regionData = new List<RegionInfo>();
47 protected List<IWorld> m_localWorld = new List<IWorld>(); 47 protected List<IWorld> m_localWorld = new List<IWorld>();
48 protected BaseHttpServer httpServer; 48 protected BaseHttpServer httpServer;
49 protected AuthenticateSessionsBase AuthenticateSessionsHandler; 49 protected List<AuthenticateSessionsBase> AuthenticateSessionsHandler = new List<AuthenticateSessionsBase>();
50 50
51 protected ConsoleBase m_console; 51 protected ConsoleBase m_console;
52 52
diff --git a/OpenSim/OpenSim.RegionServer/VersionInfo.cs b/OpenSim/OpenSim.RegionServer/VersionInfo.cs
index 38b6685..686024e 100644
--- a/OpenSim/OpenSim.RegionServer/VersionInfo.cs
+++ b/OpenSim/OpenSim.RegionServer/VersionInfo.cs
@@ -32,6 +32,6 @@ namespace OpenSim
32 /// </summary> 32 /// </summary>
33 public class VersionInfo 33 public class VersionInfo
34 { 34 {
35 public static string Version = "0.2, SVN build "; 35 public static string Version = "0.3, SVN build ";
36 } 36 }
37} 37}
diff --git a/OpenSim/OpenSim.World/Avatar.cs b/OpenSim/OpenSim.World/Avatar.cs
index 551283a..77c18bf 100644
--- a/OpenSim/OpenSim.World/Avatar.cs
+++ b/OpenSim/OpenSim.World/Avatar.cs
@@ -7,6 +7,7 @@ using libsecondlife.Packets;
7using OpenSim.Physics.Manager; 7using OpenSim.Physics.Manager;
8using OpenSim.Framework.Inventory; 8using OpenSim.Framework.Inventory;
9using OpenSim.Framework.Interfaces; 9using OpenSim.Framework.Interfaces;
10using OpenSim.Framework.Types;
10using Axiom.MathLib; 11using Axiom.MathLib;
11 12
12namespace OpenSim.world 13namespace OpenSim.world
@@ -40,13 +41,13 @@ namespace OpenSim.world
40 public Avatar(IClientAPI TheClient, World world, string regionName, Dictionary<uint, IClientAPI> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater) 41 public Avatar(IClientAPI TheClient, World world, string regionName, Dictionary<uint, IClientAPI> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater)
41 { 42 {
42 m_world = world; 43 m_world = world;
43 // m_clientThreads = clientThreads; 44 // m_clientThreads = clientThreads;
44 m_regionName = regionName; 45 m_regionName = regionName;
45 m_regionHandle = regionHandle; 46 m_regionHandle = regionHandle;
46 m_regionTerraform = regionTerraform; 47 m_regionTerraform = regionTerraform;
47 m_regionWaterHeight = regionWater; 48 m_regionWaterHeight = regionWater;
48 49
49 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs - Loading details from grid (DUMMY)"); 50 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Avatar.cs - Loading details from grid (DUMMY)");
50 ControllingClient = TheClient; 51 ControllingClient = TheClient;
51 localid = 8880000 + (this.m_world._localNumber++); 52 localid = 8880000 + (this.m_world._localNumber++);
52 Pos = ControllingClient.StartPos; 53 Pos = ControllingClient.StartPos;
@@ -65,6 +66,7 @@ namespace OpenSim.world
65 66
66 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); 67 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
67 68
69 /*
68 //register for events 70 //register for events
69 ControllingClient.OnRequestWearables += new GenericCall(this.SendOurAppearance); 71 ControllingClient.OnRequestWearables += new GenericCall(this.SendOurAppearance);
70 ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance); 72 ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
@@ -74,6 +76,7 @@ namespace OpenSim.world
74 ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack); 76 ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
75 ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange); 77 ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
76 ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement); 78 ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
79 * */
77 } 80 }
78 81
79 public PhysicsActor PhysActor 82 public PhysicsActor PhysActor
@@ -90,29 +93,29 @@ namespace OpenSim.world
90 93
91 public void ChildStatusChange(bool status) 94 public void ChildStatusChange(bool status)
92 { 95 {
93 96
94 } 97 }
95 98
96 public override void addForces() 99 public override void addForces()
97 { 100 {
98 101
99 } 102 }
100 103
101 public static void SetupTemplate(string name) 104 public static void SetupTemplate(string name)
102 { 105 {
103 106
104 } 107 }
105 108
106 protected static void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata) 109 protected static void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
107 { 110 {
108 111
109 112
110 113
111 } 114 }
112 115
113 public void CompleteMovement() 116 public void CompleteMovement()
114 { 117 {
115 118
116 } 119 }
117 120
118 public void HandleAgentUpdate(Packet pack) 121 public void HandleAgentUpdate(Packet pack)
@@ -122,35 +125,36 @@ namespace OpenSim.world
122 125
123 public void HandleUpdate(AgentUpdatePacket pack) 126 public void HandleUpdate(AgentUpdatePacket pack)
124 { 127 {
125 128
126 } 129 }
127 130
128 //really really should be moved somewhere else (RegionInfo.cs ?) 131 //really really should be moved somewhere else (RegionInfo.cs ?)
129 public void SendRegionHandshake(World regionInfo) 132 public void SendRegionHandshake(World regionInfo)
130 { 133 {
131 134
132 } 135 }
133 136
134 public static void LoadAnims() 137 public static void LoadAnims()
135 { 138 {
136 139
137 } 140 }
138 141
139 public override void LandRenegerated() 142 public override void LandRenegerated()
140 { 143 {
141 144
142 } 145 }
143 }
144 146
145 public class NewForce
146 {
147 public float X;
148 public float Y;
149 public float Z;
150 147
151 public NewForce() 148 public class NewForce
152 { 149 {
150 public float X;
151 public float Y;
152 public float Z;
153 153
154 public NewForce()
155 {
156
157 }
154 } 158 }
155 } 159 }
156 160
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs
index 2580761..8c8c2a6 100644
--- a/OpenSim/OpenSim.World/World.cs
+++ b/OpenSim/OpenSim.World/World.cs
@@ -501,15 +501,14 @@ namespace OpenSim.world
501 501
502 #region Add/Remove Avatar Methods 502 #region Add/Remove Avatar Methods
503 503
504 public override bool AddNewAvatar(IClientAPI agentClient, bool child) 504 public override void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child)
505 { 505 {
506 506 return ;
507 return false;
508 } 507 }
509 508
510 public override bool RemoveAvatar(LLUUID agentID) 509 public override void RemoveAvatar(LLUUID agentID)
511 { 510 {
512 return false; 511 return ;
513 } 512 }
514 #endregion 513 #endregion
515 514
diff --git a/OpenSim/OpenSim.World/WorldBase.cs b/OpenSim/OpenSim.World/WorldBase.cs
index 33952bf..f8a4eda 100644
--- a/OpenSim/OpenSim.World/WorldBase.cs
+++ b/OpenSim/OpenSim.World/WorldBase.cs
@@ -137,14 +137,14 @@ namespace OpenSim.world
137 #endregion 137 #endregion
138 138
139 #region Add/Remove Agent/Avatar 139 #region Add/Remove Agent/Avatar
140 public virtual bool AddNewAvatar(IClientAPI remoteClient, bool child) 140 public virtual void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child)
141 { 141 {
142 return false; 142 return ;
143 } 143 }
144 144
145 public virtual bool RemoveAvatar(LLUUID agentID) 145 public virtual void RemoveAvatar(LLUUID agentID)
146 { 146 {
147 return false; 147 return ;
148 } 148 }
149 149
150 #endregion 150 #endregion
diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs
index aa41aeb..22a5799 100644
--- a/OpenSim/OpenSim/OpenSimMain.cs
+++ b/OpenSim/OpenSim/OpenSimMain.cs
@@ -96,18 +96,12 @@ namespace OpenSim
96 if (m_sandbox) 96 if (m_sandbox)
97 { 97 {
98 this.SetupLocalGridServers(); 98 this.SetupLocalGridServers();
99 //Authenticate Session Handler
100 AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
101 this.AuthenticateSessionsHandler = authen;
102 this.checkServer = new CheckSumServer(12036); 99 this.checkServer = new CheckSumServer(12036);
103 this.checkServer.ServerListener(); 100 this.checkServer.ServerListener();
104 } 101 }
105 else 102 else
106 { 103 {
107 this.SetupRemoteGridServers(); 104 this.SetupRemoteGridServers();
108 //Authenticate Session Handler
109 AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote();
110 this.AuthenticateSessionsHandler = authen;
111 } 105 }
112 106
113 startuptime = DateTime.Now; 107 startuptime = DateTime.Now;
@@ -129,7 +123,7 @@ namespace OpenSim
129 { 123 {
130 loginServer = new LoginServer(regionData[0].IPListenAddr, regionData[0].IPListenPort, regionData[0].RegionLocX, regionData[0].RegionLocY, this.user_accounts); 124 loginServer = new LoginServer(regionData[0].IPListenAddr, regionData[0].IPListenPort, regionData[0].RegionLocX, regionData[0].RegionLocY, this.user_accounts);
131 loginServer.Startup(); 125 loginServer.Startup();
132 loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler).AddNewSession); 126 loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler[0]).AddNewSession);
133 127
134 //sandbox mode with loginserver not using accounts 128 //sandbox mode with loginserver not using accounts
135 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod); 129 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
@@ -187,18 +181,46 @@ namespace OpenSim
187 World LocalWorld; 181 World LocalWorld;
188 UDPServer udpServer; 182 UDPServer udpServer;
189 RegionInfo regionDat = new RegionInfo(); 183 RegionInfo regionDat = new RegionInfo();
184 AuthenticateSessionsBase authenBase;
190 185
191 string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Regions"); 186 string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Regions");
192 string[] pluginFiles = Directory.GetFiles(path, "*.xml"); 187 string[] configFiles = Directory.GetFiles(path, "*.xml");
193 188
194 for (int i = 0; i < pluginFiles.Length; i++) 189 if (configFiles.Length == 0)
195 { 190 {
196 regionConfig = new XmlConfig(pluginFiles[i]); 191 string path2 = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Regions");
192 string path3 = Path.Combine(path2, "default.xml");
193 Console.WriteLine("Creating default region config file");
194 //TODO create default region
195 IGenericConfig defaultConfig = new XmlConfig(path3);
196 defaultConfig.LoadData();
197 defaultConfig.Commit();
198 defaultConfig.Close();
199 defaultConfig = null;
200 configFiles = Directory.GetFiles(path, "*.xml");
201 }
202
203 for (int i = 0; i < configFiles.Length; i++)
204 {
205 if (m_sandbox)
206 {
207 AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
208 this.AuthenticateSessionsHandler.Add(authen);
209 authenBase = authen;
210 }
211 else
212 {
213 AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote();
214 this.AuthenticateSessionsHandler.Add (authen);
215 authenBase = authen;
216 }
217 Console.WriteLine("Loading region config file");
218 regionConfig = new XmlConfig(configFiles[i]);
197 regionConfig.LoadData(); 219 regionConfig.LoadData();
198 regionDat.InitConfig(this.m_sandbox, regionConfig); 220 regionDat.InitConfig(this.m_sandbox, regionConfig);
199 regionConfig.Close(); 221 regionConfig.Close();
200 222
201 udpServer = new UDPServer(regionDat.IPListenPort, this.AssetCache, this.InventoryCache, this.m_console, this.AuthenticateSessionsHandler); 223 udpServer = new UDPServer(regionDat.IPListenPort, this.AssetCache, this.InventoryCache, this.m_console, authenBase);
202 224
203 m_udpServer.Add(udpServer); 225 m_udpServer.Add(udpServer);
204 this.regionData.Add(regionDat); 226 this.regionData.Add(regionDat);
@@ -223,6 +245,8 @@ namespace OpenSim
223 LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); 245 LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
224 LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D()); 246 LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
225 LocalWorld.LoadPrimsFromStorage(); 247 LocalWorld.LoadPrimsFromStorage();
248
249 LocalWorld.StartTimer();
226 } 250 }
227 } 251 }
228 252
@@ -234,7 +258,7 @@ namespace OpenSim
234 { 258 {
235 259
236 // we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server 260 // we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
237 httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler).ExpectUser); 261 httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler[0]).ExpectUser);
238 262
239 httpServer.AddXmlRPCHandler("agent_crossing", 263 httpServer.AddXmlRPCHandler("agent_crossing",
240 delegate(XmlRpcRequest request) 264 delegate(XmlRpcRequest request)
@@ -248,7 +272,7 @@ namespace OpenSim
248 agent_data.circuitcode = circuitcode; 272 agent_data.circuitcode = circuitcode;
249 agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]), Single.Parse((string)requestData["pos_y"]), Single.Parse((string)requestData["pos_z"])); 273 agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]), Single.Parse((string)requestData["pos_y"]), Single.Parse((string)requestData["pos_z"]));
250 274
251 AuthenticateSessionsHandler.UpdateAgentData(agent_data); 275 AuthenticateSessionsHandler[0].UpdateAgentData(agent_data);
252 276
253 return new XmlRpcResponse(); 277 return new XmlRpcResponse();
254 }); 278 });