aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Examples/SimpleApp2
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Examples/SimpleApp2')
-rw-r--r--OpenSim/Examples/SimpleApp2/MyClientView.cs70
-rw-r--r--OpenSim/Examples/SimpleApp2/MyPacketServer.cs32
-rw-r--r--OpenSim/Examples/SimpleApp2/Program.cs178
-rw-r--r--OpenSim/Examples/SimpleApp2/Properties/AssemblyInfo.cs33
-rw-r--r--OpenSim/Examples/SimpleApp2/SimpleApp2.csproj154
-rw-r--r--OpenSim/Examples/SimpleApp2/SimpleApp2.exe.build53
6 files changed, 0 insertions, 520 deletions
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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim;
5using libsecondlife;
6using OpenSim.Framework.Interfaces;
7using System.Net;
8using libsecondlife.Packets;
9using OpenSim.Assets;
10using OpenSim.Framework.Types;
11using OpenSim.Framework;
12using OpenSim.Caches;
13
14namespace SimpleApp2
15{
16 public class MyClientView : ClientView
17 {
18 private float[] m_map;
19 private Dictionary<uint, IClientAPI> m_clientAPIs;
20
21 public MyClientView(float[] map, Dictionary<uint, IClientAPI> clientAPIs, EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions)
22 : base(remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions)
23 {
24 m_map = map;
25 m_clientAPIs = clientAPIs;
26
27 OnRegionHandShakeReply += RegionHandShakeReplyHandler;
28 OnChatFromViewer += ChatHandler;
29 OnRequestWearables += RequestWearablesHandler;
30 OnCompleteMovementToRegion += CompleteMovementToRegionHandler;
31 }
32
33 private void ChatHandler(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
34 {
35 // Echo it (so you know what you typed)
36 SendChatMessage(message, type, fromPos, fromName, fromAgentID);
37 SendChatMessage("Ready.", 1, fromPos, "System", LLUUID.Zero);
38 }
39
40 private void CompleteMovementToRegionHandler()
41 {
42 LLVector3 pos = new LLVector3(128, 128, 128);
43
44 MoveAgentIntoRegion(m_world.RegionInfo, pos, LLVector3.Zero );
45
46 SendAvatarData( m_world.RegionInfo, FirstName,
47 LastName, AgentId, 0,
48 pos);
49
50 SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero);
51
52
53
54 // OpenSim.world.Primitive prim = new OpenSim.world.Primitive( m_clientAPIs, m_world.RegionInfo.RegionHandle, m_world, AgentId );
55
56 // SendNewPrim( prim );
57
58 }
59
60 private void RegionHandShakeReplyHandler(IClientAPI client)
61 {
62 client.SendLayerData(m_map);
63 }
64
65 private void RequestWearablesHandler(IClientAPI client)
66 {
67 SendWearables(AvatarWearable.DefaultWearables);
68 }
69 }
70}
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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim;
5using OpenSim.Assets;
6using System.Net;
7using libsecondlife.Packets;
8using OpenSim.Framework.Interfaces;
9using OpenSim.Framework;
10using OpenSim.Caches;
11
12namespace SimpleApp2
13{
14 public class MyPacketServer : PacketServer
15 {
16 private float[] m_map;
17
18 public MyPacketServer(float[] map, ClientStackNetworkHandler networkHandler, uint port)
19 : base(networkHandler, port)
20 {
21 m_map = map;
22 }
23
24 protected override ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions)
25 {
26 // (EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions)
27
28
29 return new MyClientView(m_map, ClientAPIs, remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions);
30 }
31 }
32}
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 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim;
5using OpenSim.Servers;
6using OpenSim.GridInterfaces.Local;
7using OpenSim.Framework.Interfaces;
8using OpenSim.Framework.Types;
9using OpenSim.UserServer;
10using OpenSim.Framework.Console;
11using OpenSim.Assets;
12using libsecondlife;
13using OpenSim.Framework;
14using OpenSim.Caches;
15
16namespace SimpleApp2
17{
18 class Program : IWorld, IAssetReceiver, conscmd_callback
19 {
20 private ConsoleBase m_console;
21 private RegionInfo m_regionInfo;
22 private float[] m_map;
23 private AuthenticateSessionsBase m_circuitManager;
24
25 private void Run()
26 {
27 m_console = new ConsoleBase(null, "SimpleApp", this, false);
28 MainConsole.Instance = m_console;
29
30 m_map = CreateMap();
31
32 CheckSumServer checksumServer = new CheckSumServer(12036);
33 checksumServer.ServerListener();
34
35 string simAddr = "127.0.0.1";
36 int simPort = 9000;
37
38 m_circuitManager = new AuthenticateSessionsBase();
39
40 LoginServer loginServer = new LoginServer(simAddr, simPort, 0, 0, false);
41 loginServer.Startup();
42
43 loginServer.SetSessionHandler( AddNewSessionHandler );
44
45 InventoryCache inventoryCache = new InventoryCache();
46
47 LocalAssetServer assetServer = new LocalAssetServer();
48 assetServer.SetServerInfo("http://127.0.0.1:8003/", "");
49 assetServer.SetReceiver(this);
50
51 AssetCache assetCache = new AssetCache(assetServer);
52
53 UDPServer udpServer = new UDPServer(simPort, assetCache, inventoryCache, m_console, m_circuitManager );
54 PacketServer packetServer = new MyPacketServer(m_map, udpServer, (uint) simPort );
55 udpServer.ServerListener();
56
57 ClientView.TerrainManager = new TerrainManager(new SecondLife());
58
59 m_regionInfo = new RegionInfo();
60
61 udpServer.LocalWorld = this;
62
63 // World world = new World(udpServer.PacketServer.ClientAPIs, regionInfo);
64 // PhysicsScene physicsScene = new NullPhysicsScene();
65 // world.PhysicsScene = physicsScene;
66 // udpServer.LocalWorld = world;
67
68 BaseHttpServer httpServer = new BaseHttpServer(simPort);
69 httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
70 httpServer.Start();
71
72 m_console.WriteLine(LogPriority.NORMAL, "Press enter to quit.");
73 m_console.ReadLine();
74 }
75
76 private float[] CreateMap()
77 {
78 float[] map = new float[65536];
79
80 for (int i = 0; i < 65536; i++)
81 {
82 int x = i % 256;
83 int y = i / 256;
84
85 map[i] = (float)(x + y / 2);
86 }
87
88 return map;
89 }
90
91 private bool AddNewSessionHandler(ulong regionHandle, Login loginData)
92 {
93 m_console.WriteLine(LogPriority.NORMAL, "Region [{0}] recieved Login from [{1}] [{2}]", regionHandle, loginData.First, loginData.Last);
94
95 AgentCircuitData agent = new AgentCircuitData();
96 agent.AgentID = loginData.Agent;
97 agent.firstname = loginData.First;
98 agent.lastname = loginData.Last;
99 agent.SessionID = loginData.Session;
100 agent.SecureSessionID = loginData.SecureSession;
101 agent.circuitcode = loginData.CircuitCode;
102 agent.BaseFolder = loginData.BaseFolder;
103 agent.InventoryFolder = loginData.InventoryFolder;
104 agent.startpos = new LLVector3(128, 128, 70);
105
106 m_circuitManager.AddNewCircuit(agent.circuitcode, agent);
107
108 return true;
109 }
110
111 static void Main(string[] args)
112 {
113 Program app = new Program();
114
115 app.Run();
116 }
117
118
119 #region IWorld Members
120
121 void IWorld.AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child)
122 {
123 remoteClient.SendRegionHandshake(m_regionInfo);
124 }
125
126 void IWorld.RemoveAvatar(LLUUID agentID)
127 {
128 throw new Exception("The method or operation is not implemented.");
129 }
130
131 RegionInfo IWorld.RegionInfo
132 {
133 get { return m_regionInfo; }
134 }
135
136 object IWorld.SyncRoot
137 {
138 get { return this; }
139 }
140
141 private uint m_nextLocalId = 1;
142
143 uint IWorld.NextLocalId
144 {
145 get { return m_nextLocalId++; }
146 }
147
148 #endregion
149
150 #region IAssetReceiver Members
151
152 public void AssetReceived(AssetBase asset, bool IsTexture)
153 {
154 throw new Exception("The method or operation is not implemented.");
155 }
156
157 public void AssetNotFound(AssetBase asset)
158 {
159 throw new Exception("The method or operation is not implemented.");
160 }
161
162 #endregion
163
164 #region conscmd_callback Members
165
166 public void RunCmd(string cmd, string[] cmdparams)
167 {
168 throw new Exception("The method or operation is not implemented.");
169 }
170
171 public void Show(string ShowWhat)
172 {
173 throw new Exception("The method or operation is not implemented.");
174 }
175
176 #endregion
177 }
178}
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 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("SimpleApp2")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("Playahead AB")]
12[assembly: AssemblyProduct("SimpleApp2")]
13[assembly: AssemblyCopyright("Copyright © Playahead AB 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("bdda0707-02b4-46ca-87ce-ab3c12558a4a")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32[assembly: AssemblyVersion("1.0.0.0")]
33[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 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{24DF2448-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon>
10 </ApplicationIcon>
11 <AssemblyKeyContainerName>
12 </AssemblyKeyContainerName>
13 <AssemblyName>SimpleApp2</AssemblyName>
14 <DefaultClientScript>JScript</DefaultClientScript>
15 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
17 <DelaySign>false</DelaySign>
18 <OutputType>Exe</OutputType>
19 <AppDesignerFolder>
20 </AppDesignerFolder>
21 <RootNamespace>SimpleApp2</RootNamespace>
22 <StartupObject>
23 </StartupObject>
24 <FileUpgradeFlags>
25 </FileUpgradeFlags>
26 </PropertyGroup>
27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
28 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
29 <BaseAddress>285212672</BaseAddress>
30 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
31 <ConfigurationOverrideFile>
32 </ConfigurationOverrideFile>
33 <DefineConstants>TRACE;DEBUG</DefineConstants>
34 <DocumentationFile>
35 </DocumentationFile>
36 <DebugSymbols>True</DebugSymbols>
37 <FileAlignment>4096</FileAlignment>
38 <Optimize>False</Optimize>
39 <OutputPath>..\..\..\bin\</OutputPath>
40 <RegisterForComInterop>False</RegisterForComInterop>
41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
43 <WarningLevel>4</WarningLevel>
44 <NoWarn>
45 </NoWarn>
46 </PropertyGroup>
47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
49 <BaseAddress>285212672</BaseAddress>
50 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
51 <ConfigurationOverrideFile>
52 </ConfigurationOverrideFile>
53 <DefineConstants>TRACE</DefineConstants>
54 <DocumentationFile>
55 </DocumentationFile>
56 <DebugSymbols>False</DebugSymbols>
57 <FileAlignment>4096</FileAlignment>
58 <Optimize>True</Optimize>
59 <OutputPath>..\..\..\bin\</OutputPath>
60 <RegisterForComInterop>False</RegisterForComInterop>
61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
63 <WarningLevel>4</WarningLevel>
64 <NoWarn>
65 </NoWarn>
66 </PropertyGroup>
67 <ItemGroup>
68 <Reference Include="libsecondlife.dll">
69 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
70 <Private>False</Private>
71 </Reference>
72 <Reference Include="OpenSim.World">
73 <HintPath>OpenSim.World.dll</HintPath>
74 <Private>False</Private>
75 </Reference>
76 <Reference Include="System">
77 <HintPath>System.dll</HintPath>
78 <Private>False</Private>
79 </Reference>
80 <Reference Include="System.Data.dll">
81 <HintPath>..\..\..\bin\System.Data.dll</HintPath>
82 <Private>False</Private>
83 </Reference>
84 <Reference Include="System.Xml">
85 <HintPath>System.Xml.dll</HintPath>
86 <Private>False</Private>
87 </Reference>
88 </ItemGroup>
89 <ItemGroup>
90 <ProjectReference Include="..\..\OpenSim.Caches\OpenSim.Caches.csproj">
91 <Name>OpenSim.Caches</Name>
92 <Project>{1938EB12-0000-0000-0000-000000000000}</Project>
93 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
94 <Private>False</Private>
95 </ProjectReference>
96 <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
97 <Name>OpenSim.Framework</Name>
98 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
99 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
100 <Private>False</Private>
101 </ProjectReference>
102 <ProjectReference Include="..\..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
103 <Name>OpenSim.Framework.Console</Name>
104 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
105 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
106 <Private>False</Private>
107 </ProjectReference>
108 <ProjectReference Include="..\..\OpenSim.GridInterfaces\Local\OpenSim.GridInterfaces.Local.csproj">
109 <Name>OpenSim.GridInterfaces.Local</Name>
110 <Project>{546099CD-0000-0000-0000-000000000000}</Project>
111 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
112 <Private>False</Private>
113 </ProjectReference>
114 <ProjectReference Include="..\..\OpenSim.RegionServer\OpenSim.RegionServer.csproj">
115 <Name>OpenSim.RegionServer</Name>
116 <Project>{632E1BFD-0000-0000-0000-000000000000}</Project>
117 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
118 <Private>False</Private>
119 </ProjectReference>
120 <ProjectReference Include="..\..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
121 <Name>OpenSim.Servers</Name>
122 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
123 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
124 <Private>False</Private>
125 </ProjectReference>
126 <ProjectReference Include="..\..\..\Common\XmlRpcCS\XMLRPC.csproj">
127 <Name>XMLRPC</Name>
128 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
129 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
130 <Private>False</Private>
131 </ProjectReference>
132 </ItemGroup>
133 <ItemGroup>
134 <Compile Include="MyClientView.cs">
135 <SubType>Code</SubType>
136 </Compile>
137 <Compile Include="MyPacketServer.cs">
138 <SubType>Code</SubType>
139 </Compile>
140 <Compile Include="Program.cs">
141 <SubType>Code</SubType>
142 </Compile>
143 <Compile Include="Properties\AssemblyInfo.cs">
144 <SubType>Code</SubType>
145 </Compile>
146 </ItemGroup>
147 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
148 <PropertyGroup>
149 <PreBuildEvent>
150 </PreBuildEvent>
151 <PostBuildEvent>
152 </PostBuildEvent>
153 </PropertyGroup>
154</Project> \ 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 @@
1<?xml version="1.0" ?>
2<project name="SimpleApp2" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
11 <resources prefix="SimpleApp2" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="MyClientView.cs" />
15 <include name="MyPacketServer.cs" />
16 <include name="Program.cs" />
17 <include name="Properties/AssemblyInfo.cs" />
18 </sources>
19 <references basedir="${project::get-base-directory()}">
20 <lib>
21 <include name="${project::get-base-directory()}" />
22 <include name="${project::get-base-directory()}/${build.dir}" />
23 </lib>
24 <include name="../../../bin/libsecondlife.dll" />
25 <include name="../../../bin/OpenSim.Caches.dll" />
26 <include name="../../../bin/OpenSim.Framework.dll" />
27 <include name="../../../bin/OpenSim.Framework.Console.dll" />
28 <include name="../../../bin/OpenSim.GridInterfaces.Local.dll" />
29 <include name="../../../bin/OpenSim.RegionServer.dll" />
30 <include name="../../../bin/OpenSim.Servers.dll" />
31 <include name="OpenSim.World.dll" />
32 <include name="System.dll" />
33 <include name="System.Data.dll.dll" />
34 <include name="System.Xml.dll" />
35 <include name="../../../bin/XMLRPC.dll" />
36 </references>
37 </csc>
38 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
39 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
40 <copy todir="${project::get-base-directory()}/../../../bin/">
41 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
42 <include name="*.dll"/>
43 <include name="*.exe"/>
44 </fileset>
45 </copy>
46 </target>
47 <target name="clean">
48 <delete dir="${bin.dir}" failonerror="false" />
49 <delete dir="${obj.dir}" failonerror="false" />
50 </target>
51 <target name="doc" description="Creates documentation.">
52 </target>
53</project>