From 5e805656db1215518a344d6d5364629a4997fd47 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Sun, 1 Jul 2007 13:17:27 +0000 Subject: Fixed SimpleApp - aka thankgoditssundaycommit * Updated SimpleApp with various introduced dependencies * Extracted ScenePrescence creation in Scene * removed try-catchall from UserManagerBase (that actually hid a bug) * Refactored RegionInfo * handle is calculated * it will explode upon accessing x,y,ip,port,externalip if not explicitly initialized * Removed superfluous 'ref' keywords * Removed a shitload of 'catch Exception e' that causes build warnings * Lots of small refactorings, renames et c * Ignored some bins --- .../OpenSim.Framework.Communications.csproj | 6 +- .../OpenSim.Framework.Communications.dll.build | 4 +- .../Console/OpenSim.Framework.Console.csproj | 4 +- .../Console/OpenSim.Framework.Console.dll.build | 2 +- OpenSim/Framework/Data.DB4o/DB4oManager.cs | 4 +- OpenSim/Framework/Data.DB4o/DB4oUserData.cs | 4 +- .../Data.DB4o/OpenSim.Framework.Data.DB4o.csproj | 4 +- .../OpenSim.Framework.Data.DB4o.dll.build | 4 +- OpenSim/Framework/Data.MSSQL/MSSQLManager.cs | 2 +- .../Data.MySQL/OpenSim.Framework.Data.MySQL.csproj | 10 +- .../OpenSim.Framework.Data.MySQL.dll.build | 6 +- .../OpenSim.Framework.Data.SQLite.csproj | 4 +- .../OpenSim.Framework.Data.SQLite.dll.build | 2 +- OpenSim/Framework/Data.SQLite/SQLiteManager.cs | 2 +- .../Framework/Data/OpenSim.Framework.Data.csproj | 12 +- .../Data/OpenSim.Framework.Data.dll.build | 4 +- OpenSim/Framework/Data/UserProfileData.cs | 2 +- OpenSim/Framework/General/Interfaces/IWorld.cs | 2 +- OpenSim/Framework/General/OpenSim.Framework.csproj | 100 ++++++++-------- .../Framework/General/OpenSim.Framework.dll.build | 39 ++++--- OpenSim/Framework/General/Types/RegionInfo.cs | 127 +++++++++++++++------ .../Servers/OpenSim.Framework.Servers.csproj | 8 +- .../Servers/OpenSim.Framework.Servers.dll.build | 4 +- .../OpenSim.Framework.UserManagement.csproj | 4 +- .../OpenSim.Framework.UserManagement.dll.build | 2 +- OpenSim/Framework/UserManager/UserManagerBase.cs | 60 ++++------ .../AssetServer/OpenSim.Grid.AssetServer.csproj | 4 +- .../AssetServer/OpenSim.Grid.AssetServer.exe.build | 2 +- OpenSim/Grid/GridServer/GridManager.cs | 8 +- OpenSim/Grid/GridServer/Main.cs | 2 +- OpenSim/Grid/UserServer/Main.cs | 2 +- OpenSim/Grid/UserServer/UserManager.cs | 2 +- OpenSim/Region/Application/OpenSim.csproj | 6 +- OpenSim/Region/Application/OpenSim.exe.build | 2 +- .../OpenSim.Region.Capabilities.csproj | 20 ++-- .../OpenSim.Region.Capabilities.dll.build | 16 +-- OpenSim/Region/ClientStack/ClientView.cs | 2 +- .../ClientStack/OpenSim.Region.ClientStack.csproj | 18 +-- .../OpenSim.Region.ClientStack.dll.build | 12 +- .../Communications/Local/LocalUserServices.cs | 4 +- .../OpenSim.Region.Communications.Local.csproj | 6 +- .../OpenSim.Region.Communications.Local.dll.build | 2 +- .../Region/Communications/OGS1/OGS1GridServices.cs | 10 +- .../OGS1/OpenSim.Region.Communications.OGS1.csproj | 6 +- .../OpenSim.Region.Communications.OGS1.dll.build | 2 +- .../Environment/OpenSim.Region.Environment.csproj | 28 ++--- .../OpenSim.Region.Environment.dll.build | 20 ++-- OpenSim/Region/Environment/Scenes/Scene.cs | 61 +++++----- OpenSim/Region/Environment/Scenes/SceneBase.cs | 2 +- OpenSim/Region/Examples/SimpleApp/MyWorld.cs | 18 +-- OpenSim/Region/Examples/SimpleApp/Program.cs | 24 ++-- OpenSim/Region/Examples/SimpleApp/SimpleApp.csproj | 18 +++ .../Region/Examples/SimpleApp/SimpleApp.exe.build | 3 + .../OpenSim.Region.Storage.LocalStorageDb4o.csproj | 6 +- ...enSim.Region.Storage.LocalStorageDb4o.dll.build | 2 +- 55 files changed, 392 insertions(+), 338 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Communications/OpenSim.Framework.Communications.csproj b/OpenSim/Framework/Communications/OpenSim.Framework.Communications.csproj index 0ee62e9..31ab172 100644 --- a/OpenSim/Framework/Communications/OpenSim.Framework.Communications.csproj +++ b/OpenSim/Framework/Communications/OpenSim.Framework.Communications.csproj @@ -86,16 +86,16 @@ - + Code Code - + Code - + Code diff --git a/OpenSim/Framework/Communications/OpenSim.Framework.Communications.dll.build b/OpenSim/Framework/Communications/OpenSim.Framework.Communications.dll.build index 8b0e0f6..52d29f6 100644 --- a/OpenSim/Framework/Communications/OpenSim.Framework.Communications.dll.build +++ b/OpenSim/Framework/Communications/OpenSim.Framework.Communications.dll.build @@ -11,10 +11,10 @@ - - + + diff --git a/OpenSim/Framework/Console/OpenSim.Framework.Console.csproj b/OpenSim/Framework/Console/OpenSim.Framework.Console.csproj index c02a506..f3dcec5 100644 --- a/OpenSim/Framework/Console/OpenSim.Framework.Console.csproj +++ b/OpenSim/Framework/Console/OpenSim.Framework.Console.csproj @@ -69,10 +69,10 @@ Code - + Code - + Code diff --git a/OpenSim/Framework/Console/OpenSim.Framework.Console.dll.build b/OpenSim/Framework/Console/OpenSim.Framework.Console.dll.build index 10e72a1..eb40c0d 100644 --- a/OpenSim/Framework/Console/OpenSim.Framework.Console.dll.build +++ b/OpenSim/Framework/Console/OpenSim.Framework.Console.dll.build @@ -12,8 +12,8 @@ - + diff --git a/OpenSim/Framework/Data.DB4o/DB4oManager.cs b/OpenSim/Framework/Data.DB4o/DB4oManager.cs index 3870a8c..bd4cea8 100644 --- a/OpenSim/Framework/Data.DB4o/DB4oManager.cs +++ b/OpenSim/Framework/Data.DB4o/DB4oManager.cs @@ -89,7 +89,7 @@ namespace OpenSim.Framework.Data.DB4o database.Close(); return true; } - catch (Exception e) + catch (Exception) { return false; } @@ -154,7 +154,7 @@ namespace OpenSim.Framework.Data.DB4o database.Close(); return true; } - catch (Exception e) + catch (Exception) { return false; } diff --git a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs index 8caa75d..3ab0073 100644 --- a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs +++ b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs @@ -100,7 +100,7 @@ namespace OpenSim.Framework.Data.DB4o { return getUserByUUID(uuid).currentAgent; } - catch (Exception e) + catch (Exception) { return null; } @@ -128,7 +128,7 @@ namespace OpenSim.Framework.Data.DB4o { return getUserByName(fname,lname).currentAgent; } - catch (Exception e) + catch (Exception) { return null; } diff --git a/OpenSim/Framework/Data.DB4o/OpenSim.Framework.Data.DB4o.csproj b/OpenSim/Framework/Data.DB4o/OpenSim.Framework.Data.DB4o.csproj index f6e8311..b09cecf 100644 --- a/OpenSim/Framework/Data.DB4o/OpenSim.Framework.Data.DB4o.csproj +++ b/OpenSim/Framework/Data.DB4o/OpenSim.Framework.Data.DB4o.csproj @@ -88,13 +88,13 @@ - + Code Code - + Code diff --git a/OpenSim/Framework/Data.DB4o/OpenSim.Framework.Data.DB4o.dll.build b/OpenSim/Framework/Data.DB4o/OpenSim.Framework.Data.DB4o.dll.build index 2c5e31b..f124eb5 100644 --- a/OpenSim/Framework/Data.DB4o/OpenSim.Framework.Data.DB4o.dll.build +++ b/OpenSim/Framework/Data.DB4o/OpenSim.Framework.Data.DB4o.dll.build @@ -11,9 +11,9 @@ - - + + diff --git a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs index 7cf1a56..3c83c1f 100644 --- a/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs +++ b/OpenSim/Framework/Data.MSSQL/MSSQLManager.cs @@ -203,7 +203,7 @@ namespace OpenSim.Framework.Data.MSSQL result.Dispose(); } - catch (Exception e) + catch (Exception) { return false; } diff --git a/OpenSim/Framework/Data.MySQL/OpenSim.Framework.Data.MySQL.csproj b/OpenSim/Framework/Data.MySQL/OpenSim.Framework.Data.MySQL.csproj index 09a32b5..62e3887 100644 --- a/OpenSim/Framework/Data.MySQL/OpenSim.Framework.Data.MySQL.csproj +++ b/OpenSim/Framework/Data.MySQL/OpenSim.Framework.Data.MySQL.csproj @@ -88,19 +88,19 @@ - + Code - + Code - + Code - + Code - + Code diff --git a/OpenSim/Framework/Data.MySQL/OpenSim.Framework.Data.MySQL.dll.build b/OpenSim/Framework/Data.MySQL/OpenSim.Framework.Data.MySQL.dll.build index 3aeebbc..594ec52 100644 --- a/OpenSim/Framework/Data.MySQL/OpenSim.Framework.Data.MySQL.dll.build +++ b/OpenSim/Framework/Data.MySQL/OpenSim.Framework.Data.MySQL.dll.build @@ -11,11 +11,11 @@ + - - - + + diff --git a/OpenSim/Framework/Data.SQLite/OpenSim.Framework.Data.SQLite.csproj b/OpenSim/Framework/Data.SQLite/OpenSim.Framework.Data.SQLite.csproj index dab22ea..4ba24f1 100644 --- a/OpenSim/Framework/Data.SQLite/OpenSim.Framework.Data.SQLite.csproj +++ b/OpenSim/Framework/Data.SQLite/OpenSim.Framework.Data.SQLite.csproj @@ -88,10 +88,10 @@ - + Code - + Code diff --git a/OpenSim/Framework/Data.SQLite/OpenSim.Framework.Data.SQLite.dll.build b/OpenSim/Framework/Data.SQLite/OpenSim.Framework.Data.SQLite.dll.build index 719fbc6..e28d0a6 100644 --- a/OpenSim/Framework/Data.SQLite/OpenSim.Framework.Data.SQLite.dll.build +++ b/OpenSim/Framework/Data.SQLite/OpenSim.Framework.Data.SQLite.dll.build @@ -11,8 +11,8 @@ - + diff --git a/OpenSim/Framework/Data.SQLite/SQLiteManager.cs b/OpenSim/Framework/Data.SQLite/SQLiteManager.cs index b67b79c..3397e0d 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteManager.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteManager.cs @@ -198,7 +198,7 @@ namespace OpenSim.Framework.Data.SQLite result.Dispose(); } - catch (Exception e) + catch (Exception) { return false; } diff --git a/OpenSim/Framework/Data/OpenSim.Framework.Data.csproj b/OpenSim/Framework/Data/OpenSim.Framework.Data.csproj index 47b9ba3..dcafbcd 100644 --- a/OpenSim/Framework/Data/OpenSim.Framework.Data.csproj +++ b/OpenSim/Framework/Data/OpenSim.Framework.Data.csproj @@ -78,15 +78,9 @@ - - Code - Code - - Code - Code @@ -96,6 +90,12 @@ Code + + Code + + + Code + Code diff --git a/OpenSim/Framework/Data/OpenSim.Framework.Data.dll.build b/OpenSim/Framework/Data/OpenSim.Framework.Data.dll.build index 881bb3a..aefb02b 100644 --- a/OpenSim/Framework/Data/OpenSim.Framework.Data.dll.build +++ b/OpenSim/Framework/Data/OpenSim.Framework.Data.dll.build @@ -11,12 +11,12 @@ - - + + diff --git a/OpenSim/Framework/Data/UserProfileData.cs b/OpenSim/Framework/Data/UserProfileData.cs index 00d422d..ac168e0 100644 --- a/OpenSim/Framework/Data/UserProfileData.cs +++ b/OpenSim/Framework/Data/UserProfileData.cs @@ -136,7 +136,7 @@ namespace OpenSim.Framework.Data /// /// The IP address of the user /// - public string agentIP; + public string agentIP = String.Empty; /// /// The port of the user /// diff --git a/OpenSim/Framework/General/Interfaces/IWorld.cs b/OpenSim/Framework/General/Interfaces/IWorld.cs index 4857417..2edc0b4 100644 --- a/OpenSim/Framework/General/Interfaces/IWorld.cs +++ b/OpenSim/Framework/General/Interfaces/IWorld.cs @@ -35,7 +35,7 @@ namespace OpenSim.Framework.Interfaces { public interface IWorld { - void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child); + void AddNewClient(IClientAPI client, bool child); void RemoveClient(LLUUID agentID); RegionInfo RegionInfo { get; } diff --git a/OpenSim/Framework/General/OpenSim.Framework.csproj b/OpenSim/Framework/General/OpenSim.Framework.csproj index 57076a1..7d3d53a 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.csproj +++ b/OpenSim/Framework/General/OpenSim.Framework.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,8 +6,7 @@ {8ACA2445-0000-0000-0000-000000000000} Debug AnyCPU - - + OpenSim.Framework @@ -16,11 +15,9 @@ IE50 false Library - - + OpenSim.Framework - - + @@ -31,8 +28,7 @@ TRACE;DEBUG - - + True 4096 False @@ -41,8 +37,7 @@ False False 4 - - + False @@ -51,8 +46,7 @@ TRACE - - + False 4096 True @@ -61,28 +55,26 @@ False False 4 - - + - + ..\..\..\bin\Db4objects.Db4o.dll False - + ..\..\..\bin\libsecondlife.dll False - + System.dll False - - + System.Xml.dll False - + ..\..\..\bin\XMLRPC.dll False @@ -92,17 +84,14 @@ OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False - - Code - - + Code - + Code @@ -111,92 +100,97 @@ Code - - + Code - + + Code + + Code Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code - + + Code + + Code @@ -207,4 +201,4 @@ - \ No newline at end of file + diff --git a/OpenSim/Framework/General/OpenSim.Framework.dll.build b/OpenSim/Framework/General/OpenSim.Framework.dll.build index 0d8077b..239e3e5 100644 --- a/OpenSim/Framework/General/OpenSim.Framework.dll.build +++ b/OpenSim/Framework/General/OpenSim.Framework.dll.build @@ -11,40 +11,41 @@ + - - - - - - + + + + + - - + + - + - - - - - + - - + + - - - + + + + + + + + diff --git a/OpenSim/Framework/General/Types/RegionInfo.cs b/OpenSim/Framework/General/Types/RegionInfo.cs index 0fba6ca..1ead3c4 100644 --- a/OpenSim/Framework/General/Types/RegionInfo.cs +++ b/OpenSim/Framework/General/Types/RegionInfo.cs @@ -40,9 +40,38 @@ namespace OpenSim.Framework.Types { public LLUUID SimUUID = new LLUUID(); public string RegionName = ""; - public uint RegionLocX = 0; - public uint RegionLocY = 0; - public ulong RegionHandle = 0; + + private uint? m_regionLocX; + public uint RegionLocX + { + get + { + return m_regionLocX.Value; + } + } + + private uint? m_regionLocY; + public uint RegionLocY + { + get + { + return m_regionLocY.Value; + } + } + + private ulong? m_regionHandle; + public ulong RegionHandle + { + get + { + if (!m_regionHandle.HasValue) + { + m_regionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); + } + + return m_regionHandle.Value; + } + } public string DataStore = ""; public bool isSandbox = false; @@ -52,19 +81,43 @@ namespace OpenSim.Framework.Types public string MasterAvatarLastName = ""; public string MasterAvatarSandboxPassword = ""; + private int? m_commsIPListenPort; + /// /// Port used for listening (TCP and UDP) /// /// Seperate TCP and UDP - public int CommsIPListenPort = 0; + public int CommsIPListenPort + { + get + { + return m_commsIPListenPort.Value; + } + } + + private string m_commsIPListenAddr; /// /// Address used for internal listening (default: 0.0.0.0?) /// - public string CommsIPListenAddr = ""; + public string CommsIPListenAddr + { + get + { + return m_commsIPListenAddr; + } + } + + private string m_commsExternalAddress; /// /// Address used for external addressing (DNS or IP) /// - public string CommsExternalAddress = ""; + public string CommsExternalAddress + { + get + { + return m_commsExternalAddress; + } + } public EstateSettings estateSettings; @@ -73,7 +126,16 @@ namespace OpenSim.Framework.Types { estateSettings = new EstateSettings(); } - + + public RegionInfo( uint regionLocX, uint regionLocY, string simIp, int simPort, string simUri ) : this() + { + m_regionLocX = regionLocX; + m_regionLocY = regionLocY; + + m_commsIPListenAddr = simIp; + m_commsIPListenPort = simPort; + m_commsExternalAddress = simUri; + } public void InitConfig(bool sandboxMode, IGenericConfig configData) { @@ -112,11 +174,11 @@ namespace OpenSim.Framework.Types { string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location X", "1000"); configData.SetAttribute("SimLocationX", location); - this.RegionLocX = (uint)Convert.ToUInt32(location); + m_regionLocX = (uint)Convert.ToUInt32(location); } else { - this.RegionLocX = (uint)Convert.ToUInt32(attri); + m_regionLocX = (uint)Convert.ToUInt32(attri); } // Sim/Grid location Y attri = ""; @@ -125,13 +187,15 @@ namespace OpenSim.Framework.Types { string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid Location Y", "1000"); configData.SetAttribute("SimLocationY", location); - this.RegionLocY = (uint)Convert.ToUInt32(location); + m_regionLocY = (uint)Convert.ToUInt32(location); } else { - this.RegionLocY = (uint)Convert.ToUInt32(attri); + m_regionLocY = (uint)Convert.ToUInt32(attri); } + m_regionHandle = null; + // Local storage datastore attri = ""; attri = configData.GetAttribute("Datastore"); @@ -153,11 +217,11 @@ namespace OpenSim.Framework.Types { string port = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("UDP port for client connections", "9000"); configData.SetAttribute("SimListenPort", port); - this.CommsIPListenPort = Convert.ToInt32(port); + m_commsIPListenPort = Convert.ToInt32(port); } else { - this.CommsIPListenPort = Convert.ToInt32(attri); + m_commsIPListenPort = Convert.ToInt32(attri); } //Sim Listen Address @@ -165,8 +229,8 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("SimListenAddress"); if (attri == "") { - this.CommsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); - configData.SetAttribute("SimListenAddress", this.CommsIPListenAddr); + m_commsIPListenAddr = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP Address to listen on for client connections", "0.0.0.0"); + configData.SetAttribute("SimListenAddress", CommsIPListenAddr ); } else { @@ -177,26 +241,25 @@ namespace OpenSim.Framework.Types System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname); try { - this.CommsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found + m_commsIPListenAddr = "0.0.0.0"; // Incase a IPv4 address isnt found foreach (System.Net.IPAddress ip in ips) { if (ip.AddressFamily.ToString() == System.Net.Sockets.ProtocolFamily.InterNetwork.ToString()) { - this.CommsIPListenAddr = ip.ToString(); + m_commsIPListenAddr = ip.ToString(); break; } } } - catch (Exception e) + catch (Exception) { - e.ToString(); - this.CommsIPListenAddr = "0.0.0.0"; // Use the default if we fail + m_commsIPListenAddr = "0.0.0.0"; // Use the default if we fail } } else { - this.CommsIPListenAddr = attri; + m_commsIPListenAddr = attri; } } @@ -205,12 +268,12 @@ namespace OpenSim.Framework.Types attri = configData.GetAttribute("SimExternalAddress"); if (attri == "") { - this.CommsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); - configData.SetAttribute("SimExternalAddress", this.CommsExternalAddress); + m_commsExternalAddress = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("IP or DNS address to send external clients to", "localhost"); + configData.SetAttribute("SimExternalAddress", CommsExternalAddress); } else { - this.CommsExternalAddress = attri; + m_commsExternalAddress = attri; } attri = ""; @@ -281,8 +344,6 @@ namespace OpenSim.Framework.Types } } - this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256)); - configData.Commit(); } catch (Exception e) @@ -292,13 +353,13 @@ namespace OpenSim.Framework.Types } OpenSim.Framework.Console.MainLog.Instance.Verbose("Sim settings loaded:"); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "UUID: " + this.SimUUID.ToStringHyphenated()); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Name: " + this.RegionName); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Region Handle: " + this.RegionHandle.ToString()); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Listening on IP: " + this.CommsIPListenAddr + ":" + this.CommsIPListenPort); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Sandbox Mode? " + isSandbox.ToString()); - + OpenSim.Framework.Console.MainLog.Instance.Verbose("UUID: " + this.SimUUID.ToStringHyphenated()); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Name: " + this.RegionName); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Region Handle: " + this.RegionHandle.ToString()); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Listening on IP: " + this.CommsIPListenAddr + ":" + this.CommsIPListenPort); + OpenSim.Framework.Console.MainLog.Instance.Verbose("Sandbox Mode? " + isSandbox.ToString()); + } } } diff --git a/OpenSim/Framework/Servers/OpenSim.Framework.Servers.csproj b/OpenSim/Framework/Servers/OpenSim.Framework.Servers.csproj index 5262224..399f456 100644 --- a/OpenSim/Framework/Servers/OpenSim.Framework.Servers.csproj +++ b/OpenSim/Framework/Servers/OpenSim.Framework.Servers.csproj @@ -93,16 +93,16 @@ Code - + Code - + Code - + Code - + Code diff --git a/OpenSim/Framework/Servers/OpenSim.Framework.Servers.dll.build b/OpenSim/Framework/Servers/OpenSim.Framework.Servers.dll.build index 96b937c..7401b07 100644 --- a/OpenSim/Framework/Servers/OpenSim.Framework.Servers.dll.build +++ b/OpenSim/Framework/Servers/OpenSim.Framework.Servers.dll.build @@ -12,10 +12,10 @@ - - + + diff --git a/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.csproj b/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.csproj index 60c4b2f..02aa3f3 100644 --- a/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.csproj +++ b/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.csproj @@ -108,10 +108,10 @@ - + Code - + Code diff --git a/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.dll.build b/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.dll.build index ced9276..3ea339b 100644 --- a/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.dll.build +++ b/OpenSim/Framework/UserManager/OpenSim.Framework.UserManagement.dll.build @@ -11,8 +11,8 @@ - + diff --git a/OpenSim/Framework/UserManager/UserManagerBase.cs b/OpenSim/Framework/UserManager/UserManagerBase.cs index d06059e..560752e 100644 --- a/OpenSim/Framework/UserManager/UserManagerBase.cs +++ b/OpenSim/Framework/UserManager/UserManagerBase.cs @@ -43,7 +43,7 @@ using System.Security.Cryptography; namespace OpenSim.Framework.UserManagement { - public class UserManagerBase + public abstract class UserManagerBase { public OpenSim.Framework.Interfaces.UserConfig _config; Dictionary _plugins = new Dictionary(); @@ -142,14 +142,9 @@ namespace OpenSim.Framework.UserManagement try { UserProfileData profile = plugin.Value.getUserByName(fname,lname); - try - { - profile.currentAgent = getUserAgent(profile.UUID); - } - catch (Exception e) - { - // Ignore - } + + profile.currentAgent = getUserAgent(profile.UUID); + return profile; } catch (Exception e) @@ -238,16 +233,14 @@ namespace OpenSim.Framework.UserManagement /// /// The users profile /// The users loginrequest - public void CreateAgent(ref UserProfileData profile, XmlRpcRequest request) + public void CreateAgent(UserProfileData profile, XmlRpcRequest request) { Hashtable requestData = (Hashtable)request.Params[0]; UserAgentData agent = new UserAgentData(); // User connection - agent.agentIP = ""; agent.agentOnline = true; - agent.agentPort = 0; // Generate sessions RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider(); @@ -282,7 +275,7 @@ namespace OpenSim.Framework.UserManagement //SimProfile SimInfo = new SimProfile(); //SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); } - catch (Exception e) + catch (Exception) { } @@ -319,7 +312,7 @@ namespace OpenSim.Framework.UserManagement /// The users profile /// The supplied password /// Authenticated? - public virtual bool AuthenticateUser(ref UserProfileData profile, string password) + public virtual bool AuthenticateUser(UserProfileData profile, string password) { OpenSim.Framework.Console.MainLog.Instance.Verbose( "Authenticating " + profile.username + " " + profile.surname); @@ -358,10 +351,7 @@ namespace OpenSim.Framework.UserManagement /// /// The existing response /// The user profile - public virtual void CustomiseResponse(ref LoginResponse response, ref UserProfileData theUser) - { - - } + public abstract void CustomiseResponse( LoginResponse response, UserProfileData theUser); /// /// Main user login function @@ -379,7 +369,7 @@ namespace OpenSim.Framework.UserManagement string lastname = ""; string passwd = ""; - UserProfileData TheUser; + UserProfileData userProfile; LoginResponse logResponse = new LoginResponse(); if (GoodXML) @@ -388,11 +378,11 @@ namespace OpenSim.Framework.UserManagement lastname = (string)requestData["last"]; passwd = (string)requestData["passwd"]; - TheUser = GetTheUser(firstname, lastname); - if (TheUser == null) + userProfile = GetTheUser(firstname, lastname); + if (userProfile == null) return logResponse.CreateLoginFailedResponse(); - GoodLogin = AuthenticateUser(ref TheUser, passwd); + GoodLogin = AuthenticateUser(userProfile, passwd); } else { @@ -406,19 +396,19 @@ namespace OpenSim.Framework.UserManagement else { // If we already have a session... - if (TheUser.currentAgent != null && TheUser.currentAgent.agentOnline) + if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) { // Reject the login return logResponse.CreateAlreadyLoggedInResponse(); } // Otherwise... // Create a new agent session - CreateAgent(ref TheUser, request); + CreateAgent( userProfile, request); try { - LLUUID AgentID = TheUser.UUID; + LLUUID AgentID = userProfile.UUID; // Inventory Library Section ArrayList AgentInventoryArray = new ArrayList(); @@ -446,32 +436,32 @@ namespace OpenSim.Framework.UserManagement // Circuit Code uint circode = (uint)(Util.RandomClass.Next()); - logResponse.Lastname = TheUser.surname; - logResponse.Firstname = TheUser.username; + logResponse.Lastname = userProfile.surname; + logResponse.Firstname = userProfile.username; logResponse.AgentID = AgentID.ToStringHyphenated(); - logResponse.SessionID = TheUser.currentAgent.sessionID.ToStringHyphenated(); - logResponse.SecureSessionID = TheUser.currentAgent.secureSessionID.ToStringHyphenated(); + logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated(); + logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated(); logResponse.InventoryRoot = InventoryRoot; logResponse.InventorySkeleton = AgentInventoryArray; logResponse.CircuitCode = (Int32)circode; - logResponse.RegionX = 0; //overwritten - logResponse.RegionY = 0; //overwritten + //logResponse.RegionX = 0; //overwritten + //logResponse.RegionY = 0; //overwritten logResponse.Home = "!!null temporary value {home}!!"; // Overwritten //logResponse.LookAt = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n"; - logResponse.SimAddress = "127.0.0.1"; //overwritten - logResponse.SimPort = 0; //overwritten + //logResponse.SimAddress = "127.0.0.1"; //overwritten + //logResponse.SimPort = 0; //overwritten logResponse.Message = this.GetMessage(); try { - this.CustomiseResponse(ref logResponse, ref TheUser); + this.CustomiseResponse( logResponse, userProfile); } catch (Exception e) { System.Console.WriteLine(e.ToString()); return logResponse.CreateDeadRegionResponse(); } - CommitAgent(ref TheUser); + CommitAgent(ref userProfile); return logResponse.ToXmlRpcResponse(); } diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj index 945b7a5..caebca3 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.csproj @@ -98,10 +98,10 @@ - + Code - + Code diff --git a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build index 0a1b533..88724f6 100644 --- a/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build +++ b/OpenSim/Grid/AssetServer/OpenSim.Grid.AssetServer.exe.build @@ -11,8 +11,8 @@ - + diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index c78d14a..47f7d00 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -108,7 +108,7 @@ namespace OpenSim.Grid.GridServer { kvp.Value.saveLog("Gridserver", target, method, args, priority, message); } - catch (Exception e) + catch (Exception) { OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: unable to write log via " + kvp.Key); } @@ -127,7 +127,7 @@ namespace OpenSim.Grid.GridServer { return kvp.Value.GetProfileByLLUUID(uuid); } - catch (Exception e) + catch (Exception) { OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key); } @@ -148,7 +148,7 @@ namespace OpenSim.Grid.GridServer { return kvp.Value.GetProfileByHandle(handle); } - catch (Exception e) + catch { OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key); } @@ -172,7 +172,7 @@ namespace OpenSim.Grid.GridServer regions[neighbour.regionHandle] = neighbour; } } - catch (Exception e) + catch { OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to query regionblock via " + kvp.Key); } diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index b225214..5ac64b2 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -262,7 +262,7 @@ namespace OpenSim.Grid.GridServer } configData.Commit(); } - catch (Exception e) + catch { } diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 640f91a..c65bb97 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -178,7 +178,7 @@ namespace OpenSim.Grid.UserServer } configData.Commit(); } - catch (Exception e) + catch { } diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index c99cf87..a3e3322 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -56,7 +56,7 @@ namespace OpenSim.Grid.UserServer /// /// The existing response /// The user profile - public override void CustomiseResponse(ref LoginResponse response, ref UserProfileData theUser) + public override void CustomiseResponse( LoginResponse response, UserProfileData theUser) { // Load information from the gridserver SimProfile SimInfo = new SimProfile(); diff --git a/OpenSim/Region/Application/OpenSim.csproj b/OpenSim/Region/Application/OpenSim.csproj index 13619eb..bec85cc 100644 --- a/OpenSim/Region/Application/OpenSim.csproj +++ b/OpenSim/Region/Application/OpenSim.csproj @@ -170,13 +170,13 @@ - + Code - + Code - + Code diff --git a/OpenSim/Region/Application/OpenSim.exe.build b/OpenSim/Region/Application/OpenSim.exe.build index 355092b..6c7d7ac 100644 --- a/OpenSim/Region/Application/OpenSim.exe.build +++ b/OpenSim/Region/Application/OpenSim.exe.build @@ -11,9 +11,9 @@ + - diff --git a/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.csproj b/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.csproj index 1ed28d2..4667d52 100644 --- a/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.csproj +++ b/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.csproj @@ -96,40 +96,40 @@ - + Code Code - + Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code - + Code diff --git a/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.dll.build b/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.dll.build index dd853e7..a091b5c 100644 --- a/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.dll.build +++ b/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.dll.build @@ -11,18 +11,18 @@ - + + + - - - - - - - + + + + + diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 9c4462d..402a3ca 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -211,7 +211,7 @@ namespace OpenSim.Region.ClientStack protected virtual void InitNewClient() { OpenSim.Framework.Console.MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); - this.m_world.AddNewClient(this, this.AgentID, false); + this.m_world.AddNewClient(this, false); } protected virtual void AuthUser() diff --git a/OpenSim/Region/ClientStack/OpenSim.Region.ClientStack.csproj b/OpenSim/Region/ClientStack/OpenSim.Region.ClientStack.csproj index 2e1d8e2..3093eb0 100644 --- a/OpenSim/Region/ClientStack/OpenSim.Region.ClientStack.csproj +++ b/OpenSim/Region/ClientStack/OpenSim.Region.ClientStack.csproj @@ -122,34 +122,34 @@ - + Code - + Code - + Code - + Code Code - + Code - + Code - + Code - + Code - + Code diff --git a/OpenSim/Region/ClientStack/OpenSim.Region.ClientStack.dll.build b/OpenSim/Region/ClientStack/OpenSim.Region.ClientStack.dll.build index 1c791d3..f76a4c8 100644 --- a/OpenSim/Region/ClientStack/OpenSim.Region.ClientStack.dll.build +++ b/OpenSim/Region/ClientStack/OpenSim.Region.ClientStack.dll.build @@ -11,16 +11,16 @@ - - - - + + + - - + + + diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 6cf254b..5a2a5c8 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -69,14 +69,14 @@ namespace OpenSim.Region.Communications.Local return profile; } - public override bool AuthenticateUser(ref UserProfileData profile, string password) + public override bool AuthenticateUser(UserProfileData profile, string password) { //for now we will accept any password in sandbox mode Console.WriteLine("authorising user"); return true; } - public override void CustomiseResponse(ref LoginResponse response, ref UserProfileData theUser) + public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) { ulong currentRegion = theUser.currentAgent.currentHandle; RegionInfo reg = m_Parent.GridServer.RequestNeighbourInfo(currentRegion); diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj index f9f6b7d..0a15a49 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.csproj @@ -98,15 +98,15 @@ - - Code - Code Code + + Code + Code diff --git a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build index bfefabf..3cac9d3 100644 --- a/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build +++ b/OpenSim/Region/Communications/Local/OpenSim.Region.Communications.Local.dll.build @@ -11,9 +11,9 @@ - + diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 5f0c80c..2ac7297 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -75,18 +75,14 @@ namespace OpenSim.Region.Communications.OGS1 foreach (Hashtable n in (Hashtable)respData.Values) { - RegionInfo neighbour = new RegionInfo(); + RegionInfo neighbour = new RegionInfo( (uint)n["x"], (uint)n["y"], (string)n["sim_ip"], (int)n["sim_port"], (string)n["sim_uri"] ); //OGS1 - neighbour.RegionHandle = (ulong)n["regionhandle"]; - neighbour.RegionLocX = (uint)n["x"]; - neighbour.RegionLocY = (uint)n["y"]; + //neighbour.RegionHandle = (ulong)n["regionhandle"]; is now calculated locally + neighbour.RegionName = (string)n["name"]; //OGS1+ - neighbour.CommsIPListenAddr = (string)n["sim_ip"]; - neighbour.CommsIPListenPort = (int)n["sim_port"]; - neighbour.CommsExternalAddress = (string)n["sim_uri"]; neighbour.SimUUID = (string)n["uuid"]; neighbours.Add(neighbour); diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj index 90a01b6..d6abd13 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.csproj @@ -116,9 +116,6 @@ - - Code - Code @@ -128,6 +125,9 @@ Code + + Code + Code diff --git a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build index 960a84a..04d61b9 100644 --- a/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build +++ b/OpenSim/Region/Communications/OGS1/OpenSim.Region.Communications.OGS1.dll.build @@ -11,10 +11,10 @@ - + diff --git a/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj b/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj index 6dabd05..428f381 100644 --- a/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj +++ b/OpenSim/Region/Environment/OpenSim.Region.Environment.csproj @@ -144,55 +144,55 @@ - - Code - Code Code + + Code + Code - + Code - + Code - + Code - + Code - + Code - + Code Code - + Code - + Code - + Code - + Code Code - + Code diff --git a/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build b/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build index eb26ea0..2fa5e76 100644 --- a/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build +++ b/OpenSim/Region/Environment/OpenSim.Region.Environment.dll.build @@ -11,23 +11,23 @@ - + + + - - - - - - - - - + + + + + + + diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 8c912d0..d5406b6 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -493,19 +493,19 @@ namespace OpenSim.Region.Environment.Scenes /// /// - public override void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child) + public override void AddNewClient(IClientAPI client, bool child) { - remoteClient.OnRegionHandShakeReply += this.SendLayerData; + client.OnRegionHandShakeReply += this.SendLayerData; //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); - remoteClient.OnChatFromViewer += this.SimChat; - remoteClient.OnRequestWearables += this.InformClientOfNeighbours; - remoteClient.OnAddPrim += this.AddNewPrim; - remoteClient.OnUpdatePrimPosition += this.UpdatePrimPosition; - remoteClient.OnRequestMapBlocks += this.RequestMapBlocks; - remoteClient.OnTeleportLocationRequest += this.RequestTeleportLocation; + client.OnChatFromViewer += this.SimChat; + client.OnRequestWearables += this.InformClientOfNeighbours; + client.OnAddPrim += this.AddNewPrim; + client.OnUpdatePrimPosition += this.UpdatePrimPosition; + client.OnRequestMapBlocks += this.RequestMapBlocks; + client.OnTeleportLocationRequest += this.RequestTeleportLocation; //remoteClient.OnObjectSelect += this.SelectPrim; - remoteClient.OnGrapUpdate += this.MoveObject; - remoteClient.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; + client.OnGrapUpdate += this.MoveObject; + client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; /* remoteClient.OnParcelPropertiesRequest += new ParcelPropertiesRequest(parcelManager.handleParcelPropertiesRequest); remoteClient.OnParcelDivideRequest += new ParcelDivideRequest(parcelManager.handleParcelDivideRequest); @@ -513,19 +513,21 @@ namespace OpenSim.Region.Environment.Scenes remoteClient.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest); remoteClient.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage); */ - + this.estateManager.sendRegionHandshake(client); + + CreateAndAddScenePresence(client); + return; + } + + protected void CreateAndAddScenePresence(IClientAPI client) + { ScenePresence newAvatar = null; - try - { - OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); - newAvatar = new ScenePresence(remoteClient, this, this.m_regInfo); + OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); + newAvatar = new ScenePresence(client, this, this.m_regInfo); OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Adding new avatar to world"); OpenSim.Framework.Console.MainLog.Instance.Verbose( "World.cs:AddViewerAgent() - Starting RegionHandshake "); - //newAvatar.SendRegionHandshake(); - this.estateManager.sendRegionHandshake(remoteClient); - PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); lock (this.m_syncRoot) { @@ -534,36 +536,29 @@ namespace OpenSim.Region.Environment.Scenes lock (Entities) { - if (!Entities.ContainsKey(agentID)) + if (!Entities.ContainsKey(client.AgentId)) { - this.Entities.Add(agentID, newAvatar); + this.Entities.Add(client.AgentId, newAvatar); } else { - Entities[agentID] = newAvatar; + Entities[client.AgentId] = newAvatar; } } lock (Avatars) { - if (Avatars.ContainsKey(agentID)) + if (Avatars.ContainsKey(client.AgentId)) { - Avatars[agentID] = newAvatar; + Avatars[client.AgentId] = newAvatar; } else { - this.Avatars.Add(agentID, newAvatar); + this.Avatars.Add(client.AgentId, newAvatar); } } - } - catch (Exception e) - { - OpenSim.Framework.Console.MainLog.Instance.Warn("World.cs: AddViewerAgent() - Failed with exception " + e.ToString()); - } - return; } - /// /// /// @@ -642,8 +637,8 @@ namespace OpenSim.Region.Environment.Scenes this.regionCommsHost = this.commsManager.GridServer.RegisterRegion(this.m_regInfo,gridSettings); if (this.regionCommsHost != null) { - this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection); - this.regionCommsHost.OnAvatarCrossingIntoRegion += new AgentCrossing(this.AgentCrossing); + this.regionCommsHost.OnExpectUser += this.NewUserConnection; + this.regionCommsHost.OnAvatarCrossingIntoRegion += this.AgentCrossing; } } diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 50d3b82..e06acbd 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs @@ -148,7 +148,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public abstract void AddNewClient(IClientAPI remoteClient, LLUUID agentID, bool child); + public abstract void AddNewClient(IClientAPI client, bool child); /// /// diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs index 89f39d3..fe1fc16 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs @@ -44,7 +44,7 @@ namespace SimpleApp #region IWorld Members - override public void AddNewClient(IClientAPI client, LLUUID agentID, bool child) + override public void AddNewClient(IClientAPI client, bool child) { LLVector3 pos = new LLVector3(128, 128, 128); @@ -59,7 +59,13 @@ namespace SimpleApp }; client.OnRequestWearables += SendWearables; - + client.OnAddPrim += AddNewPrim; + client.OnUpdatePrimPosition += this.UpdatePrimPosition; + client.OnRequestMapBlocks += this.RequestMapBlocks; + client.OnTeleportLocationRequest += this.RequestTeleportLocation; + client.OnGrapUpdate += this.MoveObject; + client.OnNameFromUUIDRequest += this.commsManager.HandleUUIDNameRequest; + client.OnCompleteMovementToRegion += delegate() { client.MoveAgentIntoRegion(m_regionInfo, pos, LLVector3.Zero ); @@ -76,7 +82,7 @@ namespace SimpleApp client.SendRegionHandshake(m_regionInfo); - OpenSim.Region.Environment.Scenes.ScenePresence avatar = new Avatar( client, this, m_regionInfo ); + CreateAndAddScenePresence(client); } @@ -85,12 +91,6 @@ namespace SimpleApp client.SendWearables( AvatarWearable.DefaultWearables ); } - - override public void RemoveClient(LLUUID agentID) - { - - } - public RegionInfo RegionInfo { get { return m_regionInfo; } diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 4060d68..0d5b4b3 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -14,6 +14,7 @@ using OpenSim.Region.Caches; using OpenSim.Framework.Communications; using OpenSim.Region.Communications.Local; using OpenSim.Region.ClientStack; +using OpenSim.Region.Physics.BasicPhysicsPlugin; namespace SimpleApp { @@ -32,11 +33,7 @@ namespace SimpleApp string simAddr = "127.0.0.1"; int simPort = 9000; - /* - LoginServer loginServer = new LoginServer( simAddr, simPort, 0, 0, false ); - loginServer.Startup(); - loginServer.SetSessionHandler( AddNewSessionHandler );*/ - + m_circuitManager = new AuthenticateSessionsBase(); InventoryCache inventoryCache = new InventoryCache(); @@ -53,18 +50,17 @@ namespace SimpleApp ClientView.TerrainManager = new TerrainManager(new SecondLife()); - CommunicationsManager communicationsManager = new CommunicationsLocal(null); + NetworkServersInfo serverInfo = new NetworkServersInfo(); + CommunicationsLocal communicationsManager = new CommunicationsLocal(serverInfo); + + RegionInfo regionInfo = new RegionInfo( 1000, 1000, simAddr, simPort, simAddr ); - RegionInfo regionInfo = new RegionInfo( ); BaseHttpServer httpServer = new BaseHttpServer(simPort); - udpServer.LocalWorld = new MyWorld( packetServer.ClientAPIs, regionInfo, m_circuitManager, communicationsManager, assetCache, httpServer ); - - // World world = new World(udpServer.PacketServer.ClientAPIs, regionInfo); - // PhysicsScene physicsScene = new NullPhysicsScene(); - // world.PhysicsScene = physicsScene; - // udpServer.LocalWorld = world; + MyWorld world = new MyWorld(packetServer.ClientAPIs, regionInfo, m_circuitManager, communicationsManager, assetCache, httpServer); + world.PhysScene = new BasicScene(); + udpServer.LocalWorld = world; - // httpServer.AddXmlRPCHandler( "login_to_simulator", loginServer.XmlRpcLoginMethod ); + httpServer.AddXmlRPCHandler("login_to_simulator", communicationsManager.UserServices.XmlRpcLoginMethod ); httpServer.Start(); m_log.WriteLine( LogPriority.NORMAL, "Press enter to quit."); diff --git a/OpenSim/Region/Examples/SimpleApp/SimpleApp.csproj b/OpenSim/Region/Examples/SimpleApp/SimpleApp.csproj index 0a82172..d39d091 100644 --- a/OpenSim/Region/Examples/SimpleApp/SimpleApp.csproj +++ b/OpenSim/Region/Examples/SimpleApp/SimpleApp.csproj @@ -104,6 +104,12 @@ {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} False + + OpenSim.Framework.UserManagement + {586E2916-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + OpenSim.Region.Caches {61FCCDB3-0000-0000-0000-000000000000} @@ -134,6 +140,18 @@ {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} False + + OpenSim.Region.Physics.BasicPhysicsPlugin + {15B4FEF3-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + + + OpenSim.Region.Physics.Manager + {F4FF31EB-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + diff --git a/OpenSim/Region/Examples/SimpleApp/SimpleApp.exe.build b/OpenSim/Region/Examples/SimpleApp/SimpleApp.exe.build index f8896fa..db44992 100644 --- a/OpenSim/Region/Examples/SimpleApp/SimpleApp.exe.build +++ b/OpenSim/Region/Examples/SimpleApp/SimpleApp.exe.build @@ -25,11 +25,14 @@ + + + diff --git a/OpenSim/Region/Storage/LocalStorageDb4o/OpenSim.Region.Storage.LocalStorageDb4o.csproj b/OpenSim/Region/Storage/LocalStorageDb4o/OpenSim.Region.Storage.LocalStorageDb4o.csproj index 716fd57..147158c 100644 --- a/OpenSim/Region/Storage/LocalStorageDb4o/OpenSim.Region.Storage.LocalStorageDb4o.csproj +++ b/OpenSim/Region/Storage/LocalStorageDb4o/OpenSim.Region.Storage.LocalStorageDb4o.csproj @@ -93,6 +93,9 @@ Code + + Code + Code @@ -102,9 +105,6 @@ Code - - Code - diff --git a/OpenSim/Region/Storage/LocalStorageDb4o/OpenSim.Region.Storage.LocalStorageDb4o.dll.build b/OpenSim/Region/Storage/LocalStorageDb4o/OpenSim.Region.Storage.LocalStorageDb4o.dll.build index 112ff1c..fc9f055 100644 --- a/OpenSim/Region/Storage/LocalStorageDb4o/OpenSim.Region.Storage.LocalStorageDb4o.dll.build +++ b/OpenSim/Region/Storage/LocalStorageDb4o/OpenSim.Region.Storage.LocalStorageDb4o.dll.build @@ -12,10 +12,10 @@ + - -- cgit v1.1