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/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 +++ 4 files changed, 40 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/Examples') 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 @@ + + + -- cgit v1.1