number of changes

merge
MW 2007-05-29 09:16:18 +00:00
parent c746a2f9f4
commit b2eb26e4ba
16 changed files with 383 additions and 153 deletions

View File

@ -237,15 +237,4 @@ namespace OpenSim.Framework.Inventory
return result;
}
}
public class AvatarWearable
{
public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000");
public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000");
public AvatarWearable()
{
}
}
}

View File

@ -18,6 +18,8 @@ namespace OpenSim.Framework.Interfaces
public delegate void GenericCall2();
public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary.
public delegate void GenericCall4(Packet packet, IClientAPI remoteClient);
public delegate void GenericCall5(IClientAPI remoteClient, bool status);
public delegate void GenericCall6(LLUUID uid);
public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
public delegate void ObjectSelect(uint localID, IClientAPI remoteClient);
public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient);
@ -25,6 +27,7 @@ namespace OpenSim.Framework.Interfaces
public delegate void UpdatePrimVector(uint localID, LLVector3 pos, IClientAPI remoteClient);
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 interface IClientAPI
{
@ -50,6 +53,8 @@ namespace OpenSim.Framework.Interfaces
event UpdatePrimVector OnUpdatePrimScale;
event StatusChange OnChildAgentStatus;
event GenericCall2 OnStopMovement;
event NewAvatar OnNewAvatar;
event GenericCall6 OnRemoveAvatar;
LLVector3 StartPos
{
@ -63,7 +68,7 @@ namespace OpenSim.Framework.Interfaces
}
void OutPacket(Packet newPack);
void SendAppearance(AvatarWearable[] wearables);
void SendWearables(AvatarWearable[] wearables);
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
}
}

View File

@ -8,8 +8,8 @@ namespace OpenSim.Framework.Interfaces
{
public interface IWorld
{
bool AddNewAvatar(IClientAPI remoteClient, bool childAgent);
bool RemoveAvatar(LLUUID agentID);
void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child);
void RemoveAvatar(LLUUID agentID);
RegionInfo GetRegionInfo();
}
}

View File

@ -110,6 +110,7 @@
</Compile>
<Compile Include="SimProfile.cs" />
<Compile Include="SimProfileBase.cs" />
<Compile Include="Types\AgentWearable.cs" />
<Compile Include="Types\NetworkServersInfo.cs" />
<Compile Include="UserProfile.cs">
<SubType>Code</SubType>

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Types
{
public class AvatarWearable
{
public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000");
public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000");
public AvatarWearable()
{
}
}
}

View File

@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
# Visual C# Express 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenUser.Config.UserConfigDb4o", "OpenGridServices\OpenUser.Config\UserConfigDb4o\OpenUser.Config.UserConfigDb4o.csproj", "{7E494328-0000-0000-0000-000000000000}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGridServices.AssetServer", "OpenGridServices\OpenGridServices.AssetServer\OpenGridServices.AssetServer.csproj", "{0021261B-0000-0000-0000-000000000000}"
@ -29,15 +29,6 @@ Global
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
({1E3F341A-0000-0000-0000-000000000000}).4 = ({62CDF671-0000-0000-0000-000000000000})
({39BD9497-0000-0000-0000-000000000000}).3 = ({62CDF671-0000-0000-0000-000000000000})
({21BFC8E2-0000-0000-0000-000000000000}).6 = ({62CDF671-0000-0000-0000-000000000000})
({21BFC8E2-0000-0000-0000-000000000000}).7 = ({7924FD35-0000-0000-0000-000000000000})
({0A563AC1-0000-0000-0000-000000000000}).3 = ({62CDF671-0000-0000-0000-000000000000})
({66591469-0000-0000-0000-000000000000}).5 = ({62CDF671-0000-0000-0000-000000000000})
({0F3C3AC1-0000-0000-0000-000000000000}).3 = ({62CDF671-0000-0000-0000-000000000000})
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7E494328-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E494328-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU

View File

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
@ -6,7 +6,8 @@
<ProjectGuid>{E141F4EE-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>ServiceManager</AssemblyName>
@ -15,9 +16,11 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Exe</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>ServiceManager</RootNamespace>
<StartupObject></StartupObject>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
@ -28,7 +31,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
@ -37,7 +41,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -46,7 +51,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
@ -55,7 +61,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
@ -75,7 +82,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="ServiceManager.cs">
<SubType>Code</SubType>
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />

View File

@ -49,11 +49,7 @@ namespace OpenSim.Physics.BasicPhysicsPlugin
public PhysicsScene GetScene()
{
if(_mScene == null)
{
_mScene = new BasicScene();
}
return(_mScene);
return new BasicScene();
}
public string GetName()

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.Types;
using libsecondlife;
using libsecondlife.Packets;
@ -32,6 +33,8 @@ namespace OpenSim
public event UpdatePrimVector OnUpdatePrimScale;
public event StatusChange OnChildAgentStatus;
public event GenericCall2 OnStopMovement;
public event NewAvatar OnNewAvatar;
public event GenericCall6 OnRemoveAvatar;
public LLVector3 StartPos
{
@ -70,7 +73,7 @@ namespace OpenSim
this.OutPacket(reply);
}
public void SendAppearance(AvatarWearable[] wearables)
public void SendWearables(AvatarWearable[] wearables)
{
AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket();
aw.AgentData.AgentID = this.AgentID;
@ -90,6 +93,199 @@ namespace OpenSim
this.OutPacket(aw);
}
public void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry)
{
AvatarAppearancePacket avp = new AvatarAppearancePacket();
avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218];
avp.ObjectData.TextureEntry = textureEntry;
AvatarAppearancePacket.VisualParamBlock avblock = null;
for (int i = 0; i < 218; i++)
{
avblock = new AvatarAppearancePacket.VisualParamBlock();
avblock.ParamValue = visualParams[i];
avp.VisualParam[i] = avblock;
}
avp.Sender.IsTrial = false;
avp.Sender.ID = agentID;
OutPacket(avp);
}
/// <summary>
/// Send the region heightmap to the client
/// </summary>
/// <param name="map">heightmap</param>
public virtual void SendLayerData(float[] map)
{
try
{
int[] patches = new int[4];
for (int y = 0; y < 16; y++)
{
for (int x = 0; x < 16; x = x + 4)
{
patches[0] = x + 0 + y * 16;
patches[1] = x + 1 + y * 16;
patches[2] = x + 2 + y * 16;
patches[3] = x + 3 + y * 16;
Packet layerpack = TerrainManager.CreateLandPacket(map, patches);
OutPacket(layerpack);
}
}
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString());
}
}
/// <summary>
/// Sends a specified patch to a client
/// </summary>
/// <param name="px">Patch coordinate (x) 0..16</param>
/// <param name="py">Patch coordinate (y) 0..16</param>
/// <param name="map">heightmap</param>
public void SendLayerData(int px, int py, float[] map)
{
try
{
int[] patches = new int[1];
int patchx, patchy;
patchx = px / 16;
patchy = py / 16;
patches[0] = patchx + 0 + patchy * 16;
Packet layerpack = TerrainManager.CreateLandPacket(map, patches);
OutPacket(layerpack);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString());
}
}
public void SendRegionHandshake(RegionInfo regionInfo)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
System.Text.Encoding _enc = System.Text.Encoding.ASCII;
RegionHandshakePacket handshake = new RegionHandshakePacket();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details");
handshake.RegionInfo.BillableFactor = 0;
handshake.RegionInfo.IsEstateManager = false;
handshake.RegionInfo.TerrainHeightRange00 = regionInfo.TerrainHeightRange00;
handshake.RegionInfo.TerrainHeightRange01 = regionInfo.TerrainHeightRange01;
handshake.RegionInfo.TerrainHeightRange10 = regionInfo.TerrainHeightRange10;
handshake.RegionInfo.TerrainHeightRange11 = regionInfo.TerrainHeightRange11;
handshake.RegionInfo.TerrainStartHeight00 = regionInfo.TerrainStartHeight00;
handshake.RegionInfo.TerrainStartHeight01 = regionInfo.TerrainStartHeight01;
handshake.RegionInfo.TerrainStartHeight10 = regionInfo.TerrainStartHeight10;
handshake.RegionInfo.TerrainStartHeight11 = regionInfo.TerrainStartHeight11;
handshake.RegionInfo.SimAccess = 13;
handshake.RegionInfo.WaterHeight = regionInfo.RegionWaterHeight;
uint regionFlags = 72458694;
if (regionInfo.RegionTerraform)
{
regionFlags -= 64;
}
handshake.RegionInfo.RegionFlags = regionFlags;
handshake.RegionInfo.SimName = _enc.GetBytes(regionInfo.RegionName + "\0");
handshake.RegionInfo.SimOwner = new LLUUID("00000000-0000-0000-0000-000000000000");
handshake.RegionInfo.TerrainBase0 = regionInfo.TerrainBase0;
handshake.RegionInfo.TerrainBase1 = regionInfo.TerrainBase1;
handshake.RegionInfo.TerrainBase2 = regionInfo.TerrainBase2;
handshake.RegionInfo.TerrainBase3 = regionInfo.TerrainBase3;
handshake.RegionInfo.TerrainDetail0 = regionInfo.TerrainDetail0;
handshake.RegionInfo.TerrainDetail1 = regionInfo.TerrainDetail1;
handshake.RegionInfo.TerrainDetail2 = regionInfo.TerrainDetail2;
handshake.RegionInfo.TerrainDetail3 = regionInfo.TerrainDetail3;
handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37");
OutPacket(handshake);
}
public void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos)
{
System.Text.Encoding _enc = System.Text.Encoding.ASCII;
//send a objectupdate packet with information about the clients avatar
ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
objupdate.RegionData.RegionHandle = regionInfo.RegionHandle;
objupdate.RegionData.TimeDilation = 64096;
objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket();
//give this avatar object a local id and assign the user a name
objupdate.ObjectData[0].ID = avatarLocalID;
objupdate.ObjectData[0].FullID = avatarID;
objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName + " \0");
libsecondlife.LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z);
byte[] pb = pos2.GetBytes();
Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
OutPacket(objupdate);
}
protected void SetDefaultPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata)
{
objdata.PSBlock = new byte[0];
objdata.ExtraParams = new byte[1];
objdata.MediaURL = new byte[0];
objdata.NameValue = new byte[0];
objdata.Text = new byte[0];
objdata.TextColor = new byte[4];
objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0);
objdata.JointPivot = new LLVector3(0, 0, 0);
objdata.Material = 4;
objdata.TextureAnim = new byte[0];
objdata.Sound = LLUUID.Zero;
LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
objdata.TextureEntry = ntex.ToBytes();
objdata.State = 0;
objdata.Data = new byte[0];
objdata.ObjectData = new byte[76];
objdata.ObjectData[15] = 128;
objdata.ObjectData[16] = 63;
objdata.ObjectData[56] = 128;
objdata.ObjectData[61] = 102;
objdata.ObjectData[62] = 40;
objdata.ObjectData[63] = 61;
objdata.ObjectData[64] = 189;
}
protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket()
{
libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
SetDefaultPacketValues(ref objdata);
objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24);
objdata.PathCurve = 16;
objdata.ProfileCurve = 1;
objdata.PathScaleX = 100;
objdata.PathScaleY = 100;
objdata.ParentID = 0;
objdata.OwnerID = LLUUID.Zero;
objdata.Scale = new LLVector3(1, 1, 1);
objdata.PCode = 47;
System.Text.Encoding enc = System.Text.Encoding.ASCII;
libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
pos.X = 100f;
objdata.ID = 8880000;
objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0");
libsecondlife.LLVector3 pos2 = new LLVector3(100f, 100f, 23f);
//objdata.FullID=user.AgentID;
byte[] pb = pos.GetBytes();
Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length);
return objdata;
}
#endregion
}

View File

@ -52,12 +52,16 @@ namespace OpenSim
/// </summary>
public partial class ClientView : ClientViewBase, IClientAPI
{
public static TerrainManager TerrainManager;
protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
protected Dictionary<PacketType, PacketMethod> m_packetHandlers = new Dictionary<PacketType, PacketMethod>(); //local handlers for this instance
public LLUUID AgentID;
public LLUUID SessionID;
public LLUUID SecureSessionID = LLUUID.Zero;
public string FirstName;
public string LastName;
public bool m_child = false;
private UseCircuitCodePacket cirpack;
public Thread ClientThread;
@ -112,13 +116,9 @@ namespace OpenSim
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent");
this.m_child = false;
//this.m_world.RemoveViewerAgent(this);
this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode);
m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false);
OnChildAgentStatus(this.m_child);
//this.InitNewClient();
}
public void DowngradeClient()
@ -126,8 +126,7 @@ namespace OpenSim
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - changing full agent to child");
this.m_child = true;
OnChildAgentStatus(this.m_child);
//this.m_world.RemoveViewerAgent(this);
//this.m_world.AddViewerAgent(this);
}
public void KillClient()
@ -231,7 +230,7 @@ namespace OpenSim
protected virtual void InitNewClient()
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
// this.ClientAvatar = m_world.AddViewerAgent(this);
OnNewAvatar(this, this.AgentID, this.m_child);
}
protected virtual void AuthUser()
@ -251,13 +250,14 @@ namespace OpenSim
this.AgentID = cirpack.CircuitCode.ID;
this.SessionID = cirpack.CircuitCode.SessionID;
this.CircuitCode = cirpack.CircuitCode.Code;
InitNewClient();
//this.ClientAvatar.firstname = sessionInfo.LoginInfo.First;
// this.ClientAvatar.lastname = sessionInfo.LoginInfo.Last;
this.FirstName = sessionInfo.LoginInfo.First;
this.LastName = sessionInfo.LoginInfo.Last;
if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero)
{
this.SecureSessionID = sessionInfo.LoginInfo.SecureSession;
}
InitNewClient();
ClientLoop();
}

View File

@ -46,7 +46,7 @@ namespace OpenSim
protected List<RegionInfo> regionData = new List<RegionInfo>();
protected List<IWorld> m_localWorld = new List<IWorld>();
protected BaseHttpServer httpServer;
protected AuthenticateSessionsBase AuthenticateSessionsHandler;
protected List<AuthenticateSessionsBase> AuthenticateSessionsHandler = new List<AuthenticateSessionsBase>();
protected ConsoleBase m_console;

View File

@ -32,6 +32,6 @@ namespace OpenSim
/// </summary>
public class VersionInfo
{
public static string Version = "0.2, SVN build ";
public static string Version = "0.3, SVN build ";
}
}

View File

@ -7,6 +7,7 @@ using libsecondlife.Packets;
using OpenSim.Physics.Manager;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
using Axiom.MathLib;
namespace OpenSim.world
@ -65,6 +66,7 @@ namespace OpenSim.world
this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
/*
//register for events
ControllingClient.OnRequestWearables += new GenericCall(this.SendOurAppearance);
ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
@ -74,6 +76,7 @@ namespace OpenSim.world
ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
* */
}
public PhysicsActor PhysActor
@ -140,7 +143,7 @@ namespace OpenSim.world
{
}
}
public class NewForce
{
@ -153,5 +156,6 @@ namespace OpenSim.world
}
}
}
}

View File

@ -501,15 +501,14 @@ namespace OpenSim.world
#region Add/Remove Avatar Methods
public override bool AddNewAvatar(IClientAPI agentClient, bool child)
public override void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child)
{
return false;
return ;
}
public override bool RemoveAvatar(LLUUID agentID)
public override void RemoveAvatar(LLUUID agentID)
{
return false;
return ;
}
#endregion

View File

@ -137,14 +137,14 @@ namespace OpenSim.world
#endregion
#region Add/Remove Agent/Avatar
public virtual bool AddNewAvatar(IClientAPI remoteClient, bool child)
public virtual void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child)
{
return false;
return ;
}
public virtual bool RemoveAvatar(LLUUID agentID)
public virtual void RemoveAvatar(LLUUID agentID)
{
return false;
return ;
}
#endregion

View File

@ -96,18 +96,12 @@ namespace OpenSim
if (m_sandbox)
{
this.SetupLocalGridServers();
//Authenticate Session Handler
AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
this.AuthenticateSessionsHandler = authen;
this.checkServer = new CheckSumServer(12036);
this.checkServer.ServerListener();
}
else
{
this.SetupRemoteGridServers();
//Authenticate Session Handler
AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote();
this.AuthenticateSessionsHandler = authen;
}
startuptime = DateTime.Now;
@ -129,7 +123,7 @@ namespace OpenSim
{
loginServer = new LoginServer(regionData[0].IPListenAddr, regionData[0].IPListenPort, regionData[0].RegionLocX, regionData[0].RegionLocY, this.user_accounts);
loginServer.Startup();
loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler).AddNewSession);
loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler[0]).AddNewSession);
//sandbox mode with loginserver not using accounts
httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
@ -187,18 +181,46 @@ namespace OpenSim
World LocalWorld;
UDPServer udpServer;
RegionInfo regionDat = new RegionInfo();
AuthenticateSessionsBase authenBase;
string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Regions");
string[] pluginFiles = Directory.GetFiles(path, "*.xml");
string[] configFiles = Directory.GetFiles(path, "*.xml");
for (int i = 0; i < pluginFiles.Length; i++)
if (configFiles.Length == 0)
{
regionConfig = new XmlConfig(pluginFiles[i]);
string path2 = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Regions");
string path3 = Path.Combine(path2, "default.xml");
Console.WriteLine("Creating default region config file");
//TODO create default region
IGenericConfig defaultConfig = new XmlConfig(path3);
defaultConfig.LoadData();
defaultConfig.Commit();
defaultConfig.Close();
defaultConfig = null;
configFiles = Directory.GetFiles(path, "*.xml");
}
for (int i = 0; i < configFiles.Length; i++)
{
if (m_sandbox)
{
AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
this.AuthenticateSessionsHandler.Add(authen);
authenBase = authen;
}
else
{
AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote();
this.AuthenticateSessionsHandler.Add (authen);
authenBase = authen;
}
Console.WriteLine("Loading region config file");
regionConfig = new XmlConfig(configFiles[i]);
regionConfig.LoadData();
regionDat.InitConfig(this.m_sandbox, regionConfig);
regionConfig.Close();
udpServer = new UDPServer(regionDat.IPListenPort, this.AssetCache, this.InventoryCache, this.m_console, this.AuthenticateSessionsHandler);
udpServer = new UDPServer(regionDat.IPListenPort, this.AssetCache, this.InventoryCache, this.m_console, authenBase);
m_udpServer.Add(udpServer);
this.regionData.Add(regionDat);
@ -223,6 +245,8 @@ namespace OpenSim
LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
LocalWorld.LoadPrimsFromStorage();
LocalWorld.StartTimer();
}
}
@ -234,7 +258,7 @@ namespace OpenSim
{
// we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler).ExpectUser);
httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler[0]).ExpectUser);
httpServer.AddXmlRPCHandler("agent_crossing",
delegate(XmlRpcRequest request)
@ -248,7 +272,7 @@ namespace OpenSim
agent_data.circuitcode = circuitcode;
agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]), Single.Parse((string)requestData["pos_y"]), Single.Parse((string)requestData["pos_z"]));
AuthenticateSessionsHandler.UpdateAgentData(agent_data);
AuthenticateSessionsHandler[0].UpdateAgentData(agent_data);
return new XmlRpcResponse();
});