diff options
Diffstat (limited to 'src/LocalServers/LocalGridServers')
-rw-r--r-- | src/LocalServers/LocalGridServers/AssemblyInfo.cs | 21 | ||||
-rw-r--r-- | src/LocalServers/LocalGridServers/LocalGrid.cs | 211 | ||||
-rw-r--r-- | src/LocalServers/LocalGridServers/LocalGridServers.csproj | 48 |
3 files changed, 0 insertions, 280 deletions
diff --git a/src/LocalServers/LocalGridServers/AssemblyInfo.cs b/src/LocalServers/LocalGridServers/AssemblyInfo.cs deleted file mode 100644 index 4b17ba2..0000000 --- a/src/LocalServers/LocalGridServers/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | using System; | ||
2 | using System.Reflection; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // ------------------------------------------------------------------------------ | ||
6 | // <autogenerated> | ||
7 | // This code was generated by a tool. | ||
8 | // Mono Runtime Version: 2.0.50727.42 | ||
9 | // | ||
10 | // Changes to this file may cause incorrect behavior and will be lost if | ||
11 | // the code is regenerated. | ||
12 | // </autogenerated> | ||
13 | // ------------------------------------------------------------------------------ | ||
14 | |||
15 | [assembly: ComVisibleAttribute(false)] | ||
16 | [assembly: CLSCompliantAttribute(false)] | ||
17 | [assembly: AssemblyVersionAttribute("0.1.0.240")] | ||
18 | [assembly: AssemblyTitleAttribute("opensim-localservers")] | ||
19 | [assembly: AssemblyDescriptionAttribute("local grid servers")] | ||
20 | [assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")] | ||
21 | |||
diff --git a/src/LocalServers/LocalGridServers/LocalGrid.cs b/src/LocalServers/LocalGridServers/LocalGrid.cs deleted file mode 100644 index bd377d3..0000000 --- a/src/LocalServers/LocalGridServers/LocalGrid.cs +++ /dev/null | |||
@@ -1,211 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) OpenSim project, http://sim.opensecondlife.org/ | ||
3 | * | ||
4 | * Redistribution and use in source and binary forms, with or without | ||
5 | * modification, are permitted provided that the following conditions are met: | ||
6 | * * Redistributions of source code must retain the above copyright | ||
7 | * notice, this list of conditions and the following disclaimer. | ||
8 | * * Redistributions in binary form must reproduce the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer in the | ||
10 | * documentation and/or other materials provided with the distribution. | ||
11 | * * Neither the name of the <organization> nor the | ||
12 | * names of its contributors may be used to endorse or promote products | ||
13 | * derived from this software without specific prior written permission. | ||
14 | * | ||
15 | * THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY | ||
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
18 | * DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY | ||
19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
25 | * | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using System.Threading; | ||
30 | using OpenSim.GridServers; | ||
31 | using libsecondlife; | ||
32 | |||
33 | namespace LocalGridServers | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// | ||
37 | /// </summary> | ||
38 | /// | ||
39 | public class LocalGridPlugin : IGridPlugin | ||
40 | { | ||
41 | public LocalGridPlugin() | ||
42 | { | ||
43 | |||
44 | } | ||
45 | |||
46 | public IGridServer GetGridServer() | ||
47 | { | ||
48 | return(new LocalGridServer()); | ||
49 | } | ||
50 | } | ||
51 | |||
52 | public class LocalAssetPlugin : IAssetPlugin | ||
53 | { | ||
54 | public LocalAssetPlugin() | ||
55 | { | ||
56 | |||
57 | } | ||
58 | |||
59 | public IAssetServer GetAssetServer() | ||
60 | { | ||
61 | return(new LocalAssetServer()); | ||
62 | } | ||
63 | } | ||
64 | |||
65 | public class LocalAssetServer : IAssetServer | ||
66 | { | ||
67 | private IAssetReceiver _receiver; | ||
68 | private BlockingQueue<ARequest> _assetRequests; | ||
69 | |||
70 | public LocalAssetServer() | ||
71 | { | ||
72 | this._assetRequests = new BlockingQueue<ARequest>(); | ||
73 | ServerConsole.MainConsole.Instance.WriteLine("Local Asset Server class created"); | ||
74 | } | ||
75 | |||
76 | public void SetReceiver(IAssetReceiver receiver) | ||
77 | { | ||
78 | this._receiver = receiver; | ||
79 | } | ||
80 | |||
81 | public void RequestAsset(LLUUID assetID, bool isTexture) | ||
82 | { | ||
83 | ARequest req = new ARequest(); | ||
84 | req.AssetID = assetID; | ||
85 | req.IsTexture = isTexture; | ||
86 | //this._assetRequests.Enqueue(req); | ||
87 | } | ||
88 | |||
89 | public void UpdateAsset(AssetBase asset) | ||
90 | { | ||
91 | |||
92 | } | ||
93 | |||
94 | public void UploadNewAsset(AssetBase asset) | ||
95 | { | ||
96 | |||
97 | } | ||
98 | |||
99 | public void SetServerInfo(string ServerUrl, string SendKey) | ||
100 | { | ||
101 | |||
102 | } | ||
103 | |||
104 | private void RunRequests() | ||
105 | { | ||
106 | while(true) | ||
107 | { | ||
108 | Thread.Sleep(1000); | ||
109 | } | ||
110 | } | ||
111 | } | ||
112 | |||
113 | public class LocalGridServer : LocalGridBase | ||
114 | { | ||
115 | public List<Login> Sessions = new List<Login>(); | ||
116 | |||
117 | public LocalGridServer() | ||
118 | { | ||
119 | Sessions = new List<Login>(); | ||
120 | ServerConsole.MainConsole.Instance.WriteLine("Local Grid Server class created"); | ||
121 | } | ||
122 | |||
123 | public override string GetName() | ||
124 | { | ||
125 | return "Local"; | ||
126 | } | ||
127 | |||
128 | public override bool RequestConnection() | ||
129 | { | ||
130 | return true; | ||
131 | } | ||
132 | public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode) | ||
133 | { | ||
134 | //we are running local | ||
135 | AuthenticateResponse user = new AuthenticateResponse(); | ||
136 | |||
137 | lock(this.Sessions) | ||
138 | { | ||
139 | |||
140 | for(int i = 0; i < Sessions.Count; i++) | ||
141 | { | ||
142 | if((Sessions[i].Agent == agentID) && (Sessions[i].Session == sessionID)) | ||
143 | { | ||
144 | user.Authorised = true; | ||
145 | user.LoginInfo = Sessions[i]; | ||
146 | } | ||
147 | } | ||
148 | } | ||
149 | return(user); | ||
150 | } | ||
151 | |||
152 | public override bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode) | ||
153 | { | ||
154 | return(true); | ||
155 | } | ||
156 | |||
157 | public override UUIDBlock RequestUUIDBlock() | ||
158 | { | ||
159 | UUIDBlock uuidBlock = new UUIDBlock(); | ||
160 | return(uuidBlock); | ||
161 | } | ||
162 | |||
163 | public override neighbourinfo[] RequestNeighbours(ulong regionhandle) | ||
164 | { | ||
165 | return new neighbourinfo[8]; | ||
166 | } | ||
167 | |||
168 | public override void SetServerInfo(string GridServerUrl, string GridSendKey, string GridRecvKey, string UserServerUrl, string UserSendKey, string UserRecvKey) | ||
169 | { | ||
170 | |||
171 | } | ||
172 | |||
173 | /// <summary> | ||
174 | /// used by the local login server to inform us of new sessions | ||
175 | /// </summary> | ||
176 | /// <param name="session"></param> | ||
177 | public override void AddNewSession(Login session) | ||
178 | { | ||
179 | lock(this.Sessions) | ||
180 | { | ||
181 | this.Sessions.Add(session); | ||
182 | } | ||
183 | } | ||
184 | } | ||
185 | |||
186 | public class BlockingQueue< T > { | ||
187 | private Queue< T > _queue = new Queue< T >(); | ||
188 | private object _queueSync = new object(); | ||
189 | |||
190 | public void Enqueue(T value) | ||
191 | { | ||
192 | lock(_queueSync) | ||
193 | { | ||
194 | _queue.Enqueue(value); | ||
195 | Monitor.Pulse(_queueSync); | ||
196 | } | ||
197 | } | ||
198 | |||
199 | public T Dequeue() | ||
200 | { | ||
201 | lock(_queueSync) | ||
202 | { | ||
203 | if( _queue.Count < 1) | ||
204 | Monitor.Wait(_queueSync); | ||
205 | |||
206 | return _queue.Dequeue(); | ||
207 | } | ||
208 | } | ||
209 | } | ||
210 | |||
211 | } | ||
diff --git a/src/LocalServers/LocalGridServers/LocalGridServers.csproj b/src/LocalServers/LocalGridServers/LocalGridServers.csproj deleted file mode 100644 index 7a5ce3d..0000000 --- a/src/LocalServers/LocalGridServers/LocalGridServers.csproj +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
2 | <PropertyGroup> | ||
3 | <OutputType>Library</OutputType> | ||
4 | <RootNamespace>LocalGridServers</RootNamespace> | ||
5 | <AssemblyName>LocalGridServers</AssemblyName> | ||
6 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
7 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
8 | <ProjectGuid>{D7F0395B-FADC-4936-80A0-D95AACE92F62}</ProjectGuid> | ||
9 | </PropertyGroup> | ||
10 | <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> | ||
11 | <OutputPath>bin\Debug\</OutputPath> | ||
12 | <Optimize>False</Optimize> | ||
13 | <DefineConstants>DEBUG;TRACE</DefineConstants> | ||
14 | <DebugSymbols>True</DebugSymbols> | ||
15 | <DebugType>Full</DebugType> | ||
16 | <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> | ||
17 | </PropertyGroup> | ||
18 | <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
19 | <OutputPath>bin\Release\</OutputPath> | ||
20 | <Optimize>True</Optimize> | ||
21 | <DefineConstants>TRACE</DefineConstants> | ||
22 | <DebugSymbols>False</DebugSymbols> | ||
23 | <DebugType>None</DebugType> | ||
24 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
25 | </PropertyGroup> | ||
26 | <ItemGroup> | ||
27 | <Reference Include="System" /> | ||
28 | <Reference Include="System.Xml" /> | ||
29 | <Reference Include="libsecondlife"> | ||
30 | <HintPath>..\..\..\bin\libsecondlife.dll</HintPath> | ||
31 | <SpecificVersion>False</SpecificVersion> | ||
32 | </Reference> | ||
33 | </ItemGroup> | ||
34 | <ItemGroup> | ||
35 | <Compile Include="LocalGrid.cs" /> | ||
36 | </ItemGroup> | ||
37 | <ItemGroup> | ||
38 | <ProjectReference Include="..\..\ServerConsole\ServerConsole\ServerConsole.csproj"> | ||
39 | <Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project> | ||
40 | <Name>ServerConsole</Name> | ||
41 | </ProjectReference> | ||
42 | <ProjectReference Include="..\..\GridInterfaces\GridInterfaces.csproj"> | ||
43 | <Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project> | ||
44 | <Name>GridInterfaces</Name> | ||
45 | </ProjectReference> | ||
46 | </ItemGroup> | ||
47 | <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> | ||
48 | </Project> \ No newline at end of file | ||