From 64ed1e1b3bea2b187679a7e61a7d56292c47daab Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 20 Jun 2007 15:18:54 +0000 Subject: * Removed ClientThreads from avatar * Deleted SimpleApp2 as it's getting wonkier and wonkier by the minute * Added avatar handling to SimpleApp, still don't have any avatar out on the playing field * Removed some warnings * Went from IWorld to Scene * --- OpenSim/Examples/SimpleApp/MyWorld.cs | 29 ++-- OpenSim/Examples/SimpleApp/Program.cs | 8 +- OpenSim/Examples/SimpleApp/SimpleApp.csproj | 22 ++- OpenSim/Examples/SimpleApp2/MyClientView.cs | 70 -------- OpenSim/Examples/SimpleApp2/MyPacketServer.cs | 32 ---- OpenSim/Examples/SimpleApp2/Program.cs | 178 --------------------- .../Examples/SimpleApp2/Properties/AssemblyInfo.cs | 33 ---- OpenSim/Examples/SimpleApp2/SimpleApp2.csproj | 154 ------------------ OpenSim/Examples/SimpleApp2/SimpleApp2.exe.build | 53 ------ 9 files changed, 43 insertions(+), 536 deletions(-) delete mode 100644 OpenSim/Examples/SimpleApp2/MyClientView.cs delete mode 100644 OpenSim/Examples/SimpleApp2/MyPacketServer.cs delete mode 100644 OpenSim/Examples/SimpleApp2/Program.cs delete mode 100644 OpenSim/Examples/SimpleApp2/Properties/AssemblyInfo.cs delete mode 100644 OpenSim/Examples/SimpleApp2/SimpleApp2.csproj delete mode 100644 OpenSim/Examples/SimpleApp2/SimpleApp2.exe.build (limited to 'OpenSim/Examples') diff --git a/OpenSim/Examples/SimpleApp/MyWorld.cs b/OpenSim/Examples/SimpleApp/MyWorld.cs index d3da1c7..bc7a3b0 100644 --- a/OpenSim/Examples/SimpleApp/MyWorld.cs +++ b/OpenSim/Examples/SimpleApp/MyWorld.cs @@ -5,19 +5,28 @@ using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; using OpenSim.Framework.Console; using libsecondlife; +using OpenSim.Region; +using Avatar=OpenSim.Region.Scenes.Avatar; +using OpenSim.Region.Scenes; +using OpenSim.Framework; +using OpenSim.Caches; +using OpenGrid.Framework.Communications; namespace SimpleApp { - public class MyWorld : IWorld + public class MyWorld : Scene { private RegionInfo m_regionInfo; + private List m_avatars; - public MyWorld(RegionInfo regionInfo) + public MyWorld(Dictionary clientThreads, RegionInfo regionInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach) + : base(clientThreads, regionInfo, authen, commsMan, assetCach) { m_regionInfo = regionInfo; + m_avatars = new List(); } - private void SendLayerData(IClientAPI remoteClient) + public override void SendLayerData(IClientAPI remoteClient) { float[] map = new float[65536]; @@ -34,7 +43,7 @@ namespace SimpleApp #region IWorld Members - void IWorld.AddNewAvatar(IClientAPI client, LLUUID agentID, bool child) + override public void AddNewAvatar(IClientAPI client, LLUUID agentID, bool child) { LLVector3 pos = new LLVector3(128, 128, 128); @@ -65,6 +74,8 @@ namespace SimpleApp client.SendRegionHandshake(m_regionInfo); + OpenSim.Region.Scenes.Avatar avatar = new Avatar( client, this, m_regionInfo ); + } private void SendWearables( IClientAPI client ) @@ -72,30 +83,28 @@ namespace SimpleApp client.SendWearables( AvatarWearable.DefaultWearables ); } - void IWorld.RemoveAvatar(LLUUID agentID) + public void RemoveAvatar(LLUUID agentID) { } - RegionInfo IWorld.RegionInfo + public RegionInfo RegionInfo { get { return m_regionInfo; } } - object IWorld.SyncRoot + public object SyncRoot { get { return this; } } private uint m_nextLocalId = 1; - uint IWorld.NextLocalId + public uint NextLocalId { get { return m_nextLocalId++; } } #endregion - - } } diff --git a/OpenSim/Examples/SimpleApp/Program.cs b/OpenSim/Examples/SimpleApp/Program.cs index 1d0702d..b0b68d9 100644 --- a/OpenSim/Examples/SimpleApp/Program.cs +++ b/OpenSim/Examples/SimpleApp/Program.cs @@ -12,6 +12,8 @@ using OpenSim.UserServer; using OpenSim.Servers; using OpenSim.Framework; using OpenSim.Caches; +using OpenGrid.Framework.Communications; +using OpenSim.LocalCommunications; namespace SimpleApp { @@ -51,9 +53,11 @@ namespace SimpleApp ClientView.TerrainManager = new TerrainManager(new SecondLife()); - RegionInfo regionInfo = new RegionInfo(); + CommunicationsManager communicationsManager = new CommunicationsLocal(); + + RegionInfo regionInfo = new RegionInfo( ); - udpServer.LocalWorld = new MyWorld( regionInfo ); + udpServer.LocalWorld = new MyWorld( packetServer.ClientAPIs, regionInfo, m_circuitManager, communicationsManager, assetCache ); // World world = new World(udpServer.PacketServer.ClientAPIs, regionInfo); // PhysicsScene physicsScene = new NullPhysicsScene(); diff --git a/OpenSim/Examples/SimpleApp/SimpleApp.csproj b/OpenSim/Examples/SimpleApp/SimpleApp.csproj index 810ecd4..00af44a 100644 --- a/OpenSim/Examples/SimpleApp/SimpleApp.csproj +++ b/OpenSim/Examples/SimpleApp/SimpleApp.csproj @@ -62,10 +62,6 @@ ..\..\..\bin\libsecondlife.dll False - - OpenSim.World.dll - False - System.dll False @@ -80,6 +76,12 @@ + + OpenGrid.Framework.Communications + {683344D5-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + OpenSim.Caches {1938EB12-0000-0000-0000-000000000000} @@ -104,6 +106,18 @@ {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} False + + OpenSim.LocalCommunications + {79CED992-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + + + OpenSim.Region + {196916AF-0000-0000-0000-000000000000} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + OpenSim.RegionServer {632E1BFD-0000-0000-0000-000000000000} diff --git a/OpenSim/Examples/SimpleApp2/MyClientView.cs b/OpenSim/Examples/SimpleApp2/MyClientView.cs deleted file mode 100644 index 4ef3c94..0000000 --- a/OpenSim/Examples/SimpleApp2/MyClientView.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using System.Net; -using libsecondlife.Packets; -using OpenSim.Assets; -using OpenSim.Framework.Types; -using OpenSim.Framework; -using OpenSim.Caches; - -namespace SimpleApp2 -{ - public class MyClientView : ClientView - { - private float[] m_map; - private Dictionary m_clientAPIs; - - public MyClientView(float[] map, Dictionary clientAPIs, EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions) - : base(remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions) - { - m_map = map; - m_clientAPIs = clientAPIs; - - OnRegionHandShakeReply += RegionHandShakeReplyHandler; - OnChatFromViewer += ChatHandler; - OnRequestWearables += RequestWearablesHandler; - OnCompleteMovementToRegion += CompleteMovementToRegionHandler; - } - - private void ChatHandler(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) - { - // Echo it (so you know what you typed) - SendChatMessage(message, type, fromPos, fromName, fromAgentID); - SendChatMessage("Ready.", 1, fromPos, "System", LLUUID.Zero); - } - - private void CompleteMovementToRegionHandler() - { - LLVector3 pos = new LLVector3(128, 128, 128); - - MoveAgentIntoRegion(m_world.RegionInfo, pos, LLVector3.Zero ); - - SendAvatarData( m_world.RegionInfo, FirstName, - LastName, AgentId, 0, - pos); - - SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero); - - - - // OpenSim.world.Primitive prim = new OpenSim.world.Primitive( m_clientAPIs, m_world.RegionInfo.RegionHandle, m_world, AgentId ); - - // SendNewPrim( prim ); - - } - - private void RegionHandShakeReplyHandler(IClientAPI client) - { - client.SendLayerData(m_map); - } - - private void RequestWearablesHandler(IClientAPI client) - { - SendWearables(AvatarWearable.DefaultWearables); - } - } -} diff --git a/OpenSim/Examples/SimpleApp2/MyPacketServer.cs b/OpenSim/Examples/SimpleApp2/MyPacketServer.cs deleted file mode 100644 index 67878c4..0000000 --- a/OpenSim/Examples/SimpleApp2/MyPacketServer.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim; -using OpenSim.Assets; -using System.Net; -using libsecondlife.Packets; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework; -using OpenSim.Caches; - -namespace SimpleApp2 -{ - public class MyPacketServer : PacketServer - { - private float[] m_map; - - public MyPacketServer(float[] map, ClientStackNetworkHandler networkHandler, uint port) - : base(networkHandler, port) - { - m_map = map; - } - - protected override ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions) - { - // (EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions) - - - return new MyClientView(m_map, ClientAPIs, remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions); - } - } -} diff --git a/OpenSim/Examples/SimpleApp2/Program.cs b/OpenSim/Examples/SimpleApp2/Program.cs deleted file mode 100644 index 85ce703..0000000 --- a/OpenSim/Examples/SimpleApp2/Program.cs +++ /dev/null @@ -1,178 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim; -using OpenSim.Servers; -using OpenSim.GridInterfaces.Local; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Types; -using OpenSim.UserServer; -using OpenSim.Framework.Console; -using OpenSim.Assets; -using libsecondlife; -using OpenSim.Framework; -using OpenSim.Caches; - -namespace SimpleApp2 -{ - class Program : IWorld, IAssetReceiver, conscmd_callback - { - private ConsoleBase m_console; - private RegionInfo m_regionInfo; - private float[] m_map; - private AuthenticateSessionsBase m_circuitManager; - - private void Run() - { - m_console = new ConsoleBase(null, "SimpleApp", this, false); - MainConsole.Instance = m_console; - - m_map = CreateMap(); - - CheckSumServer checksumServer = new CheckSumServer(12036); - checksumServer.ServerListener(); - - string simAddr = "127.0.0.1"; - int simPort = 9000; - - m_circuitManager = new AuthenticateSessionsBase(); - - LoginServer loginServer = new LoginServer(simAddr, simPort, 0, 0, false); - loginServer.Startup(); - - loginServer.SetSessionHandler( AddNewSessionHandler ); - - InventoryCache inventoryCache = new InventoryCache(); - - LocalAssetServer assetServer = new LocalAssetServer(); - assetServer.SetServerInfo("http://127.0.0.1:8003/", ""); - assetServer.SetReceiver(this); - - AssetCache assetCache = new AssetCache(assetServer); - - UDPServer udpServer = new UDPServer(simPort, assetCache, inventoryCache, m_console, m_circuitManager ); - PacketServer packetServer = new MyPacketServer(m_map, udpServer, (uint) simPort ); - udpServer.ServerListener(); - - ClientView.TerrainManager = new TerrainManager(new SecondLife()); - - m_regionInfo = new RegionInfo(); - - udpServer.LocalWorld = this; - - // World world = new World(udpServer.PacketServer.ClientAPIs, regionInfo); - // PhysicsScene physicsScene = new NullPhysicsScene(); - // world.PhysicsScene = physicsScene; - // udpServer.LocalWorld = world; - - BaseHttpServer httpServer = new BaseHttpServer(simPort); - httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod); - httpServer.Start(); - - m_console.WriteLine(LogPriority.NORMAL, "Press enter to quit."); - m_console.ReadLine(); - } - - private float[] CreateMap() - { - float[] map = new float[65536]; - - for (int i = 0; i < 65536; i++) - { - int x = i % 256; - int y = i / 256; - - map[i] = (float)(x + y / 2); - } - - return map; - } - - private bool AddNewSessionHandler(ulong regionHandle, Login loginData) - { - m_console.WriteLine(LogPriority.NORMAL, "Region [{0}] recieved Login from [{1}] [{2}]", regionHandle, loginData.First, loginData.Last); - - AgentCircuitData agent = new AgentCircuitData(); - agent.AgentID = loginData.Agent; - agent.firstname = loginData.First; - agent.lastname = loginData.Last; - agent.SessionID = loginData.Session; - agent.SecureSessionID = loginData.SecureSession; - agent.circuitcode = loginData.CircuitCode; - agent.BaseFolder = loginData.BaseFolder; - agent.InventoryFolder = loginData.InventoryFolder; - agent.startpos = new LLVector3(128, 128, 70); - - m_circuitManager.AddNewCircuit(agent.circuitcode, agent); - - return true; - } - - static void Main(string[] args) - { - Program app = new Program(); - - app.Run(); - } - - - #region IWorld Members - - void IWorld.AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child) - { - remoteClient.SendRegionHandshake(m_regionInfo); - } - - void IWorld.RemoveAvatar(LLUUID agentID) - { - throw new Exception("The method or operation is not implemented."); - } - - RegionInfo IWorld.RegionInfo - { - get { return m_regionInfo; } - } - - object IWorld.SyncRoot - { - get { return this; } - } - - private uint m_nextLocalId = 1; - - uint IWorld.NextLocalId - { - get { return m_nextLocalId++; } - } - - #endregion - - #region IAssetReceiver Members - - public void AssetReceived(AssetBase asset, bool IsTexture) - { - throw new Exception("The method or operation is not implemented."); - } - - public void AssetNotFound(AssetBase asset) - { - throw new Exception("The method or operation is not implemented."); - } - - #endregion - - #region conscmd_callback Members - - public void RunCmd(string cmd, string[] cmdparams) - { - throw new Exception("The method or operation is not implemented."); - } - - public void Show(string ShowWhat) - { - throw new Exception("The method or operation is not implemented."); - } - - #endregion - } -} diff --git a/OpenSim/Examples/SimpleApp2/Properties/AssemblyInfo.cs b/OpenSim/Examples/SimpleApp2/Properties/AssemblyInfo.cs deleted file mode 100644 index f7d6aae..0000000 --- a/OpenSim/Examples/SimpleApp2/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SimpleApp2")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Playahead AB")] -[assembly: AssemblyProduct("SimpleApp2")] -[assembly: AssemblyCopyright("Copyright © Playahead AB 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("bdda0707-02b4-46ca-87ce-ab3c12558a4a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenSim/Examples/SimpleApp2/SimpleApp2.csproj b/OpenSim/Examples/SimpleApp2/SimpleApp2.csproj deleted file mode 100644 index 5c6e192..0000000 --- a/OpenSim/Examples/SimpleApp2/SimpleApp2.csproj +++ /dev/null @@ -1,154 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {24DF2448-0000-0000-0000-000000000000} - Debug - AnyCPU - - - - - SimpleApp2 - JScript - Grid - IE50 - false - Exe - - - SimpleApp2 - - - - - - - False - 285212672 - False - - - TRACE;DEBUG - - - True - 4096 - False - ..\..\..\bin\ - False - False - False - 4 - - - - - False - 285212672 - False - - - TRACE - - - False - 4096 - True - ..\..\..\bin\ - False - False - False - 4 - - - - - - ..\..\..\bin\libsecondlife.dll - False - - - OpenSim.World.dll - False - - - System.dll - False - - - ..\..\..\bin\System.Data.dll - False - - - System.Xml.dll - False - - - - - OpenSim.Caches - {1938EB12-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Framework - {8ACA2445-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Framework.Console - {A7CD0630-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.GridInterfaces.Local - {546099CD-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.RegionServer - {632E1BFD-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - OpenSim.Servers - {8BB20F0A-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - XMLRPC - {8E81D43C-0000-0000-0000-000000000000} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - - - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - \ No newline at end of file diff --git a/OpenSim/Examples/SimpleApp2/SimpleApp2.exe.build b/OpenSim/Examples/SimpleApp2/SimpleApp2.exe.build deleted file mode 100644 index dc5cc2a..0000000 --- a/OpenSim/Examples/SimpleApp2/SimpleApp2.exe.build +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.1