From 95676b298819d6b2d1df74d1f52668e2549a2c2f Mon Sep 17 00:00:00 2001
From: MW
Date: Fri, 15 Jun 2007 13:11:26 +0000
Subject: Preliminary movement added to sugilite, forwards walking only and no
animations.
---
Common/OpenSim.Framework/Interfaces/IClientAPI.cs | 7 +-
OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs | 27 +++--
OpenSim/OpenSim.Region/Scenes/Avatar.cs | 102 +++++++++++++---
OpenSim/OpenSim.Region/Scenes/Scene.cs | 8 +-
.../ClientStackNetworkHandler.cs | 46 ++++++++
OpenSim/OpenSim.RegionServer/ClientView.API.cs | 99 +++++++++++++++-
.../ClientView.ProcessPackets.cs | 3 +-
.../OpenSim.RegionServer.csproj | 11 +-
.../OpenSim.RegionServer.dll.build | 5 +-
.../OpenSim.RegionServer/OpenSimNetworkHandler.cs | 46 --------
OpenSim/OpenSim.RegionServer/PacketServer.cs | 4 +-
.../OpenSim.RegionServer/RegionApplicationBase.cs | 130 +++++++++++++++++++++
OpenSim/OpenSim.RegionServer/RegionServerBase.cs | 130 ---------------------
OpenSim/OpenSim.RegionServer/UDPServer.cs | 2 +-
OpenSim/OpenSim.RegionServer/UserConfigUtility.cs | 37 ------
OpenSim/OpenSim/OpenSimMain.cs | 2 +-
16 files changed, 392 insertions(+), 267 deletions(-)
create mode 100644 OpenSim/OpenSim.RegionServer/ClientStackNetworkHandler.cs
delete mode 100644 OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs
create mode 100644 OpenSim/OpenSim.RegionServer/RegionApplicationBase.cs
delete mode 100644 OpenSim/OpenSim.RegionServer/RegionServerBase.cs
delete mode 100644 OpenSim/OpenSim.RegionServer/UserConfigUtility.cs
diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
index feccf36..cebfd9a 100644
--- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
+++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Framework.Interfaces
public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient);
public delegate void StatusChange(bool status);
public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status);
+ public delegate void UpdateAgent(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation);
public delegate void ParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client);
public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client);
@@ -75,7 +76,7 @@ namespace OpenSim.Framework.Interfaces
event GenericCall OnRegionHandShakeReply;
event GenericCall OnRequestWearables;
event GenericCall2 OnCompleteMovementToRegion;
- event GenericCall3 OnAgentUpdate;
+ event UpdateAgent OnAgentUpdate;
event GenericCall OnRequestAvatarsData;
event GenericCall4 OnAddPrim;
event UpdateShape OnUpdatePrimShape;
@@ -125,10 +126,12 @@ namespace OpenSim.Framework.Interfaces
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
void SendLayerData(float[] map);
void MoveAgentIntoRegion(RegionInfo regInfo);
- void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos);
void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort);
AgentCircuitData RequestClientInfo();
+ void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos);
+ void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity);
+
void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID);
diff --git a/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs b/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs
index d5c25f3..3f87e10 100644
--- a/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs
+++ b/OpenSim/OpenSim.Region/Scenes/Avatar.Update.cs
@@ -36,14 +36,26 @@ using OpenSim.Framework.Interfaces;
namespace OpenSim.Region.Scenes
{
partial class Avatar
- {
+ {
///
///
///
public override void update()
{
-
-
+ if (this.newForce)
+ {
+ this.SendTerseUpdateToALLClients();
+ _updateCount = 0;
+ }
+ else if (movementflag != 0)
+ {
+ _updateCount++;
+ if (_updateCount > 3)
+ {
+ this.SendTerseUpdateToALLClients();
+ _updateCount = 0;
+ }
+ }
}
///
@@ -117,15 +129,6 @@ namespace OpenSim.Region.Scenes
}
///
- /// Very likely to be deleted soon!
- ///
- ///
- public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock()
- {
- return null;
- }
-
- ///
///
///
///
diff --git a/OpenSim/OpenSim.Region/Scenes/Avatar.cs b/OpenSim/OpenSim.Region/Scenes/Avatar.cs
index 6ae4319..17b2437 100644
--- a/OpenSim/OpenSim.Region/Scenes/Avatar.cs
+++ b/OpenSim/OpenSim.Region/Scenes/Avatar.cs
@@ -61,6 +61,7 @@ namespace OpenSim.Region.Scenes
private ulong m_regionHandle;
private Dictionary m_clientThreads;
private bool childAvatar = false;
+ private bool newForce = false;
protected RegionInfo m_regionInfo;
///
@@ -78,6 +79,7 @@ namespace OpenSim.Region.Scenes
this.uuid = theClient.AgentId;
m_regionInfo = reginfo;
+ m_regionHandle = reginfo.RegionHandle;
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Avatar.cs - Loading details from grid (DUMMY)");
ControllingClient = theClient;
this.firstname = ControllingClient.FirstName;
@@ -99,8 +101,8 @@ namespace OpenSim.Region.Scenes
//ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.CompleteMovement);
ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.SendInitialPosition);
- /* ControllingClient.OnAgentUpdate += new GenericCall3(this.HandleAgentUpdate);
- ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
+ ControllingClient.OnAgentUpdate += new UpdateAgent(this.HandleAgentUpdate);
+ /* ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
*/
@@ -135,31 +137,51 @@ namespace OpenSim.Region.Scenes
///
public override void addForces()
{
-
+ lock (this.forcesList)
+ {
+ newForce = false;
+ if (this.forcesList.Count > 0)
+ {
+ for (int i = 0; i < this.forcesList.Count; i++)
+ {
+ NewForce force = this.forcesList[i];
+ PhysicsVector phyVector = new PhysicsVector(force.X, force.Y, force.Z);
+ lock (m_world.SyncRoot)
+ {
+ this._physActor.Velocity = phyVector;
+ }
+ this.updateflag = true;
+ this.velocity = new LLVector3(force.X, force.Y, force.Z); //shouldn't really be doing this
+ // but as we are setting the velocity (rather than using real forces) at the moment it is okay.
+ this.newForce = true;
+ }
+ for (int i = 0; i < this.forcesList.Count; i++)
+ {
+ this.forcesList.RemoveAt(0);
+ }
+ }
+ }
}
- ///
- /// likely to removed very soon
- ///
- ///
- public static void SetupTemplate(string name)
+ public void SendTerseUpdateToClient(IClientAPI RemoteClient)
{
-
+ RemoteClient.SendAvatarTerseUpdate(this.m_regionHandle, 64096, this.localid, new LLVector3(this.Pos.X, this.Pos.Y, this.Pos.Z), new LLVector3(this._physActor.Velocity.X, this._physActor.Velocity.Y, this._physActor.Velocity.Z));
}
///
- /// likely to removed very soon
+ ///
///
- ///
- protected static void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
+ public void SendTerseUpdateToALLClients()
{
-
-
-
+ List avatars = this.m_world.RequestAvatarList();
+ for (int i = 0; i < avatars.Count; i++)
+ {
+ this.SendTerseUpdateToClient(avatars[i].ControllingClient);
+ }
}
///
- ///
+ /// Complete Avatar's movement into the region
///
public void CompleteMovement()
{
@@ -187,9 +209,55 @@ namespace OpenSim.Region.Scenes
///
///
///
- public void SendRegionHandshake()
+ ///
+ public void HandleAgentUpdate(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation)
{
+ if ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS) != 0)
+ {
+ Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
+ if (((movementflag & 1) == 0) || (q != this.bodyRot))
+ {
+ //we should add a new force to the list
+ // but for now we will deal with velocities
+ NewForce newVelocity = new NewForce();
+ Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0);
+ Axiom.MathLib.Vector3 direc = q * v3;
+ direc.Normalize();
+
+ //work out velocity for sim physics system
+ direc = direc * ((0.03f) * 128f);
+ if (this._physActor.Flying)
+ direc *= 4;
+
+ newVelocity.X = direc.x;
+ newVelocity.Y = direc.y;
+ newVelocity.Z = direc.z;
+ this.forcesList.Add(newVelocity);
+ movementflag = 1;
+ this.bodyRot = q;
+ }
+ }
+ else
+ {
+ if (movementflag == 16)
+ {
+ movementflag = 0;
+ }
+ if ((movementflag) != 0)
+ {
+ NewForce newVelocity = new NewForce();
+ newVelocity.X = 0;
+ newVelocity.Y = 0;
+ newVelocity.Z = 0;
+ this.forcesList.Add(newVelocity);
+ movementflag = 0;
+
+ this.movementflag = 16;
+
+ }
+ }
+
}
///
diff --git a/OpenSim/OpenSim.Region/Scenes/Scene.cs b/OpenSim/OpenSim.Region/Scenes/Scene.cs
index 7c61c90..98f5027 100644
--- a/OpenSim/OpenSim.Region/Scenes/Scene.cs
+++ b/OpenSim/OpenSim.Region/Scenes/Scene.cs
@@ -123,14 +123,8 @@ namespace OpenSim.Region.Scenes
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs - creating LandMap");
TerrainManager = new TerrainManager(new SecondLife());
Terrain = new TerrainEngine();
- Avatar.SetupTemplate("avatar-texture.dat");
-
+
Avatar.LoadAnims();
-
- //this.SetDefaultScripts();
- //this.LoadScriptEngines();
-
-
}
catch (Exception e)
{
diff --git a/OpenSim/OpenSim.RegionServer/ClientStackNetworkHandler.cs b/OpenSim/OpenSim.RegionServer/ClientStackNetworkHandler.cs
new file mode 100644
index 0000000..7552195
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/ClientStackNetworkHandler.cs
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) Contributors, http://www.openmetaverse.org/
+* See CONTRIBUTORS.TXT for a full list of copyright holders.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+* * Neither the name of the OpenSim Project nor the
+* names of its contributors may be used to endorse or promote products
+* derived from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Net;
+using System.Net.Sockets;
+using libsecondlife;
+
+
+namespace OpenSim
+{
+
+ public interface ClientStackNetworkHandler
+ {
+ void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender);
+ void RemoveClientCircuit(uint circuitcode);
+ void RegisterPacketServer(PacketServer server);
+ }
+
+}
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
index 484ecc1..33727c4 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
@@ -47,7 +47,7 @@ namespace OpenSim
public event GenericCall OnRequestWearables;
public event SetAppearance OnSetAppearance;
public event GenericCall2 OnCompleteMovementToRegion;
- public event GenericCall3 OnAgentUpdate;
+ public event UpdateAgent OnAgentUpdate;
public event StartAnim OnStartAnim;
public event GenericCall OnRequestAvatarsData;
public event LinkObjects OnLinkObjects;
@@ -393,6 +393,26 @@ namespace OpenSim
}
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLVector3 velocity)
+ {
+ ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = this.CreateAvatarImprovedBlock(localID, position, velocity);
+ ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
+ terse.RegionData.RegionHandle = regionHandle;
+ terse.RegionData.TimeDilation = timeDilation;
+ terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
+ terse.ObjectData[0] = terseBlock;
+
+ this.OutPacket(terse);
+ }
+
#endregion
#region Primitive Packet/data Sending Methods
@@ -491,6 +511,83 @@ namespace OpenSim
#region Helper Methods
+ protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateAvatarImprovedBlock(uint localID, LLVector3 pos, LLVector3 velocity)
+ {
+ byte[] bytes = new byte[60];
+ int i = 0;
+ ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
+
+ dat.TextureEntry = new byte[0];// AvatarTemplate.TextureEntry;
+
+ uint ID = localID;
+
+ bytes[i++] = (byte)(ID % 256);
+ bytes[i++] = (byte)((ID >> 8) % 256);
+ bytes[i++] = (byte)((ID >> 16) % 256);
+ bytes[i++] = (byte)((ID >> 24) % 256);
+ bytes[i++] = 0;
+ bytes[i++] = 1;
+ i += 14;
+ bytes[i++] = 128;
+ bytes[i++] = 63;
+
+ byte[] pb = pos.GetBytes();
+ Array.Copy(pb, 0, bytes, i, pb.Length);
+ i += 12;
+ ushort InternVelocityX;
+ ushort InternVelocityY;
+ ushort InternVelocityZ;
+ Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0);
+
+ internDirec = new Axiom.MathLib.Vector3(velocity.X, velocity.Y, velocity.Z);
+
+ internDirec = internDirec / 128.0f;
+ internDirec.x += 1;
+ internDirec.y += 1;
+ internDirec.z += 1;
+
+ InternVelocityX = (ushort)(32768 * internDirec.x);
+ InternVelocityY = (ushort)(32768 * internDirec.y);
+ InternVelocityZ = (ushort)(32768 * internDirec.z);
+
+ ushort ac = 32767;
+ bytes[i++] = (byte)(InternVelocityX % 256);
+ bytes[i++] = (byte)((InternVelocityX >> 8) % 256);
+ bytes[i++] = (byte)(InternVelocityY % 256);
+ bytes[i++] = (byte)((InternVelocityY >> 8) % 256);
+ bytes[i++] = (byte)(InternVelocityZ % 256);
+ bytes[i++] = (byte)((InternVelocityZ >> 8) % 256);
+
+ //accel
+ bytes[i++] = (byte)(ac % 256);
+ bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte)(ac % 256);
+ bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte)(ac % 256);
+ bytes[i++] = (byte)((ac >> 8) % 256);
+
+ //rot
+ bytes[i++] = (byte)(ac % 256);
+ bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte)(ac % 256);
+ bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte)(ac % 256);
+ bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte)(ac % 256);
+ bytes[i++] = (byte)((ac >> 8) % 256);
+
+ //rotation vel
+ bytes[i++] = (byte)(ac % 256);
+ bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte)(ac % 256);
+ bytes[i++] = (byte)((ac >> 8) % 256);
+ bytes[i++] = (byte)(ac % 256);
+ bytes[i++] = (byte)((ac >> 8) % 256);
+
+ dat.Data = bytes;
+ return (dat);
+ }
+
///
///
///
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
index dbe0bd9..f8c7cdb 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.ProcessPackets.cs
@@ -168,7 +168,8 @@ namespace OpenSim
case PacketType.AgentUpdate:
if (OnAgentUpdate != null)
{
- OnAgentUpdate(Pack);
+ AgentUpdatePacket agenUpdate = (AgentUpdatePacket) Pack;
+ OnAgentUpdate(this, agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotation );
}
break;
case PacketType.AgentAnimation:
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index 4231f40..63eeb9c 100644
--- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -130,6 +130,9 @@
+
+ Code
+
Code
@@ -151,21 +154,15 @@
Code
-
- Code
-
Code
-
+
Code
Code
-
- Code
-
Code
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
index f5f8440..23eca3a 100644
--- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
@@ -11,6 +11,7 @@
+
@@ -18,11 +19,9 @@
-
-
+
-
diff --git a/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs b/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs
deleted file mode 100644
index 382ba21..0000000
--- a/OpenSim/OpenSim.RegionServer/OpenSimNetworkHandler.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) Contributors, http://www.openmetaverse.org/
-* See CONTRIBUTORS.TXT for a full list of copyright holders.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the distribution.
-* * Neither the name of the OpenSim Project nor the
-* names of its contributors may be used to endorse or promote products
-* derived from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
-* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*
-*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Net;
-using System.Net.Sockets;
-using libsecondlife;
-
-
-namespace OpenSim
-{
-
- public interface OpenSimNetworkHandler
- {
- void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender);
- void RemoveClientCircuit(uint circuitcode);
- void RegisterPacketServer(PacketServer server);
- }
-
-}
diff --git a/OpenSim/OpenSim.RegionServer/PacketServer.cs b/OpenSim/OpenSim.RegionServer/PacketServer.cs
index f0bf44f..229570c 100644
--- a/OpenSim/OpenSim.RegionServer/PacketServer.cs
+++ b/OpenSim/OpenSim.RegionServer/PacketServer.cs
@@ -40,13 +40,13 @@ namespace OpenSim
{
public class PacketServer
{
- private OpenSimNetworkHandler _networkHandler;
+ private ClientStackNetworkHandler _networkHandler;
private IWorld _localWorld;
public Dictionary ClientThreads = new Dictionary();
public Dictionary ClientAPIs = new Dictionary();
protected uint serverPort;
- public PacketServer(OpenSimNetworkHandler networkHandler, uint port)
+ public PacketServer(ClientStackNetworkHandler networkHandler, uint port)
{
_networkHandler = networkHandler;
this.serverPort = port;
diff --git a/OpenSim/OpenSim.RegionServer/RegionApplicationBase.cs b/OpenSim/OpenSim.RegionServer/RegionApplicationBase.cs
new file mode 100644
index 0000000..8509dcc
--- /dev/null
+++ b/OpenSim/OpenSim.RegionServer/RegionApplicationBase.cs
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) Contributors, http://www.openmetaverse.org/
+* See CONTRIBUTORS.TXT for a full list of copyright holders.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the distribution.
+* * Neither the name of the OpenSim Project nor the
+* names of its contributors may be used to endorse or promote products
+* derived from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+using System;
+using System.Text;
+using System.IO;
+using System.Threading;
+using System.Net;
+using System.Net.Sockets;
+using System.Timers;
+using System.Reflection;
+using System.Collections;
+using System.Collections.Generic;
+using libsecondlife;
+using libsecondlife.Packets;
+using OpenSim.Terrain;
+using OpenSim.Framework.Interfaces;
+using OpenSim.Framework.Types;
+using OpenSim.Framework;
+using OpenSim.UserServer;
+using OpenSim.Assets;
+using OpenSim.Caches;
+using OpenSim.Framework.Console;
+using OpenSim.Physics.Manager;
+using Nwc.XmlRpc;
+using OpenSim.Servers;
+using OpenSim.GenericConfig;
+
+namespace OpenSim
+{
+ public class RegionApplicationBase
+ {
+ protected IGenericConfig localConfig;
+ protected PhysicsManager physManager;
+ protected AssetCache AssetCache;
+ protected InventoryCache InventoryCache;
+ protected Dictionary clientCircuits = new Dictionary();
+ protected DateTime startuptime;
+ protected NetworkServersInfo serversData;
+
+ public string m_physicsEngine;
+ public bool m_sandbox = false;
+ public bool m_loginserver;
+ public bool user_accounts = false;
+ public bool gridLocalAsset = false;
+ protected bool configFileSetup = false;
+ public string m_config;
+
+ protected List m_udpServer = new List();
+ protected List regionData = new List();
+ protected List m_localWorld = new List();
+ protected BaseHttpServer httpServer;
+ protected List AuthenticateSessionsHandler = new List();
+
+ protected ConsoleBase m_console;
+
+ public RegionApplicationBase()
+ {
+
+ }
+
+ public RegionApplicationBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
+ {
+ this.configFileSetup = useConfigFile;
+ m_sandbox = sandBoxMode;
+ m_loginserver = startLoginServer;
+ m_physicsEngine = physicsEngine;
+ m_config = configFile;
+ }
+
+ /*protected World m_localWorld;
+ public World LocalWorld
+ {
+ get { return m_localWorld; }
+ }*/
+
+ ///
+ /// Performs initialisation of the world, such as loading configuration from disk.
+ ///
+ public virtual void StartUp()
+ {
+ }
+
+ protected virtual void SetupLocalGridServers()
+ {
+ }
+
+ protected virtual void SetupRemoteGridServers()
+ {
+
+ }
+
+ protected virtual void SetupWorld()
+ {
+ }
+
+ protected virtual void SetupHttpListener()
+ {
+ }
+
+ protected virtual void ConnectToRemoteGridServer()
+ {
+
+ }
+ }
+}
diff --git a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs b/OpenSim/OpenSim.RegionServer/RegionServerBase.cs
deleted file mode 100644
index c059d7c..0000000
--- a/OpenSim/OpenSim.RegionServer/RegionServerBase.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
-* Copyright (c) Contributors, http://www.openmetaverse.org/
-* See CONTRIBUTORS.TXT for a full list of copyright holders.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the distribution.
-* * Neither the name of the OpenSim Project nor the
-* names of its contributors may be used to endorse or promote products
-* derived from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
-* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*
-*/
-using System;
-using System.Text;
-using System.IO;
-using System.Threading;
-using System.Net;
-using System.Net.Sockets;
-using System.Timers;
-using System.Reflection;
-using System.Collections;
-using System.Collections.Generic;
-using libsecondlife;
-using libsecondlife.Packets;
-using OpenSim.Terrain;
-using OpenSim.Framework.Interfaces;
-using OpenSim.Framework.Types;
-using OpenSim.Framework;
-using OpenSim.UserServer;
-using OpenSim.Assets;
-using OpenSim.Caches;
-using OpenSim.Framework.Console;
-using OpenSim.Physics.Manager;
-using Nwc.XmlRpc;
-using OpenSim.Servers;
-using OpenSim.GenericConfig;
-
-namespace OpenSim
-{
- public class RegionServerBase
- {
- protected IGenericConfig localConfig;
- protected PhysicsManager physManager;
- protected AssetCache AssetCache;
- protected InventoryCache InventoryCache;
- protected Dictionary clientCircuits = new Dictionary();
- protected DateTime startuptime;
- protected NetworkServersInfo serversData;
-
- public string m_physicsEngine;
- public bool m_sandbox = false;
- public bool m_loginserver;
- public bool user_accounts = false;
- public bool gridLocalAsset = false;
- protected bool configFileSetup = false;
- public string m_config;
-
- protected List m_udpServer = new List();
- protected List regionData = new List();
- protected List m_localWorld = new List();
- protected BaseHttpServer httpServer;
- protected List AuthenticateSessionsHandler = new List();
-
- protected ConsoleBase m_console;
-
- public RegionServerBase()
- {
-
- }
-
- public RegionServerBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
- {
- this.configFileSetup = useConfigFile;
- m_sandbox = sandBoxMode;
- m_loginserver = startLoginServer;
- m_physicsEngine = physicsEngine;
- m_config = configFile;
- }
-
- /*protected World m_localWorld;
- public World LocalWorld
- {
- get { return m_localWorld; }
- }*/
-
- ///
- /// Performs initialisation of the world, such as loading configuration from disk.
- ///
- public virtual void StartUp()
- {
- }
-
- protected virtual void SetupLocalGridServers()
- {
- }
-
- protected virtual void SetupRemoteGridServers()
- {
-
- }
-
- protected virtual void SetupWorld()
- {
- }
-
- protected virtual void SetupHttpListener()
- {
- }
-
- protected virtual void ConnectToRemoteGridServer()
- {
-
- }
- }
-}
diff --git a/OpenSim/OpenSim.RegionServer/UDPServer.cs b/OpenSim/OpenSim.RegionServer/UDPServer.cs
index 090ed7d..315cb2c 100644
--- a/OpenSim/OpenSim.RegionServer/UDPServer.cs
+++ b/OpenSim/OpenSim.RegionServer/UDPServer.cs
@@ -52,7 +52,7 @@ using OpenSim.GenericConfig;
namespace OpenSim
{
- public class UDPServer : OpenSimNetworkHandler
+ public class UDPServer : ClientStackNetworkHandler
{
protected Dictionary clientCircuits = new Dictionary();
public Socket Server;
diff --git a/OpenSim/OpenSim.RegionServer/UserConfigUtility.cs b/OpenSim/OpenSim.RegionServer/UserConfigUtility.cs
deleted file mode 100644
index 2f04c07..0000000
--- a/OpenSim/OpenSim.RegionServer/UserConfigUtility.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-* Copyright (c) Contributors, http://www.openmetaverse.org/
-* See CONTRIBUTORS.TXT for a full list of copyright holders.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the distribution.
-* * Neither the name of the OpenSim Project nor the
-* names of its contributors may be used to endorse or promote products
-* derived from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
-* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*
-*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace OpenSim
-{
- public class UserConfigUtility
- {
- }
-}
diff --git a/OpenSim/OpenSim/OpenSimMain.cs b/OpenSim/OpenSim/OpenSimMain.cs
index ea71330..9fe9581 100644
--- a/OpenSim/OpenSim/OpenSimMain.cs
+++ b/OpenSim/OpenSim/OpenSimMain.cs
@@ -57,7 +57,7 @@ using OpenGrid.Framework.Communications;
namespace OpenSim
{
- public class OpenSimMain : RegionServerBase, conscmd_callback
+ public class OpenSimMain : RegionApplicationBase, conscmd_callback
{
private CheckSumServer checkServer;
protected RegionServerCommsManager commsManager;
--
cgit v1.1