diff --git a/LICENSE.txt b/LICENSE.txt
index 12d66cd3..fd74d70d 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,24 +1,24 @@
-Copyright (c) 2006, Second Life Reverse Engineering Team
-All rights reserved.
-
-- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
-- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-- Neither the name of the Second Life Reverse Engineering Team nor the names
- of its contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
+Copyright (c) 2006, Second Life Reverse Engineering Team
+All rights reserved.
+
+- Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+- Neither the name of the Second Life Reverse Engineering Team nor the names
+ of its contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/Ovatsus.CSharp.targets b/Ovatsus.CSharp.targets
index be59e83a..1f124607 100644
--- a/Ovatsus.CSharp.targets
+++ b/Ovatsus.CSharp.targets
@@ -1,587 +1,587 @@
-
-
-
-
-
-
-
-
- $(SystemRoot)\Microsoft.NET\Framework\v1.0.3705
- $(SystemRoot)\Microsoft.NET\Framework\v1.1.4322
- C:\Program Files\Mono-1.1.9.2
- $(MonoPath)\bin\mcs.bat
- $(MonoPath)\bin\gmcs.bat
- $(MonoPath)\lib\mono\1.0
- $(MonoPath)\lib\mono\2.0
-
-
-
-
-
-
-
-
- .NET 1.0
- .NET 1.1
- .NET 2.0
- .NET CF 1.0 (Pocket PC 2003)
- .NET CF 1.0 (Smartphone 2003)
- .NET CF 2.0 (Pocket PC 2003)
- .NET CF 2.0 (Windows CE 5.0)
- .NET 1.1 (Mono Compiler & Libraries)
- .NET 2.0 (Mono Compiler & Libraries)
- .NET 1.1 (Mono Libraries)
- .NET 2.0 (Mono Libraries)
- Build All Platforms Simultaneously
- Build All 2.0 Platforms Simultaneously
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
- false
- true
-
-
-
-
-
-
-
-
-
- NET_1_0
- NET_1_1
- NET_2_0
- NET_CF_1_0
- NET_CF_2_0
- NET_CF
- Mono
-
-
-
-
-
-
-
-
- true
- full
- false
- DEBUG;TRACE
-
-
-
- pdbonly
- true
- TRACE
-
-
-
-
-
-
-
-
-
- bin
-
-
-
- bin\$(Platform)\$(Configuration)
-
-
-
- 4
-
-
-
- prompt
-
-
-
- false
-
-
-
- $(DefineConstants);$(NET_1_0_Constant)
- $(NET_1_0_Path)
- v1.0
-
-
-
- $(DefineConstants);$(NET_1_1_Constant)
- v1.1
-
-
-
- $(NET_1_1_Path)
-
-
-
- $(DefineConstants);$(NET_2_0_Constant)
-
-
-
- $(DefineConstants);$(NET_CF_1_0_Constant)
-
-
-
- $(DefineConstants);$(NET_CF_2_0_Constant)
-
-
-
- 3C41C503-53EF-4c2a-8DD4-A8217CAD115E
- PocketPC
- 4.20
-
-
-
- 4DE813A2-67E0-4a00-945C-3188240A8243
- Smartphone
- 4.20
-
-
-
- E2BECB1F-8C8C-41ba-B736-9BE7D946A398
- WindowsCE
- 5.0
-
-
-
- $(AssemblyName)
- 512
- $(DefineConstants);$(PlatformFamilyName)
- {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- $(DefineConstants);$(NET_CF_Constant)
-
-
-
- $(DefineConstants);$(Mono_Constant)
-
-
-
- true
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(NET_1_0_Path)
-
-
-
- $(NET_1_1_Path)
-
-
-
- $(Mono_1_1_LibPath)
-
-
-
- $(Mono_2_0_LibPath)
-
-
-
-
-
- false
-
-
-
-
-
- false
-
-
-
-
-
- false
-
-
-
-
-
- false
-
-
-
-
-
-
-
-
-
-
-
- ResolveAssemblyReferences;BeforeResGen;_CoreResGen_1_x;AfterResGen
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(CheckUnsupportedFeaturesDependsOn);Check_MS_1_x_UnsupportedFeatures
-
-
- $(CheckUnsupportedFeaturesDependsOn);Check_All_Mono_UnsupportedFeatures
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ResolveReferences;
- ResolveKeySource;
- BeforeCompile;
- _TimeStampBeforeCompile;
- MonoCoreCompile;
- _TimeStampAfterCompile;
- AfterCompile
-
-
-
-
-
-
-
-
-
- "$(Mono_1_1_CompilerPath)"
- "$(Mono_2_0_CompilerPath)"
- $(MonoCommandLine) /lib:$(AdditionalLibPaths)
- $(MonoCommandLine)@(AddModules->' /addmodule:"%(Identity)"', '')
- $(MonoCommandLine) /unsafe+
- $(MonoCommandLine) /checked+
- $(MonoCommandLine) /codepage:$(CodePage)
- $(MonoCommandLine) /define:$(DefineConstants)
- $(MonoCommandLine) /delaysign+
- $(MonoCommandLine) /doc:$(DocumentationFile)
- $(MonoCommandLine) /debug+
- $(MonoCommandLine) /keycontainer:$(KeyContainerName)
- $(MonoCommandLine) /keyfile:$(KeyContainerName)
- $(MonoCommandLine) /langversion:$(LangVersion)
- $(MonoCommandLine) /main:$(StartupObject)
- $(MonoCommandLine) /noconfig+
- $(MonoCommandLine) /nostdlib+
- $(MonoCommandLine) /optimize+
- $(MonoCommandLine) /out:"@(IntermediateAssembly)"
- $(MonoCommandLine)@(ReferencePath->' /reference:"%(Identity)"', '')
- $(MonoCommandLine) $(CompilerResponseFile)
- $(MonoCommandLine)@(Compile->' "%(Identity)"', '')
- $(MonoCommandLine) /waraserror+
- $(MonoCommandLine) /warn:$(WarningLevel)
- $(MonoCommandLine) /win32icon:$(Win32Icon)
- $(MonoCommandLine) /win32res:$(Win32Resource)
- exe
- winexe
- library
- module
- $(MonoCommandLine) /target:$(MonoTargetType)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- BuildAll
- CleanAll
- PublishOnlyAll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ $(SystemRoot)\Microsoft.NET\Framework\v1.0.3705
+ $(SystemRoot)\Microsoft.NET\Framework\v1.1.4322
+ C:\Program Files\Mono-1.1.9.2
+ $(MonoPath)\bin\mcs.bat
+ $(MonoPath)\bin\gmcs.bat
+ $(MonoPath)\lib\mono\1.0
+ $(MonoPath)\lib\mono\2.0
+
+
+
+
+
+
+
+
+ .NET 1.0
+ .NET 1.1
+ .NET 2.0
+ .NET CF 1.0 (Pocket PC 2003)
+ .NET CF 1.0 (Smartphone 2003)
+ .NET CF 2.0 (Pocket PC 2003)
+ .NET CF 2.0 (Windows CE 5.0)
+ .NET 1.1 (Mono Compiler & Libraries)
+ .NET 2.0 (Mono Compiler & Libraries)
+ .NET 1.1 (Mono Libraries)
+ .NET 2.0 (Mono Libraries)
+ Build All Platforms Simultaneously
+ Build All 2.0 Platforms Simultaneously
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+ false
+ true
+
+
+
+
+
+
+
+
+
+ NET_1_0
+ NET_1_1
+ NET_2_0
+ NET_CF_1_0
+ NET_CF_2_0
+ NET_CF
+ Mono
+
+
+
+
+
+
+
+
+ true
+ full
+ false
+ DEBUG;TRACE
+
+
+
+ pdbonly
+ true
+ TRACE
+
+
+
+
+
+
+
+
+
+ bin
+
+
+
+ bin\$(Platform)\$(Configuration)
+
+
+
+ 4
+
+
+
+ prompt
+
+
+
+ false
+
+
+
+ $(DefineConstants);$(NET_1_0_Constant)
+ $(NET_1_0_Path)
+ v1.0
+
+
+
+ $(DefineConstants);$(NET_1_1_Constant)
+ v1.1
+
+
+
+ $(NET_1_1_Path)
+
+
+
+ $(DefineConstants);$(NET_2_0_Constant)
+
+
+
+ $(DefineConstants);$(NET_CF_1_0_Constant)
+
+
+
+ $(DefineConstants);$(NET_CF_2_0_Constant)
+
+
+
+ 3C41C503-53EF-4c2a-8DD4-A8217CAD115E
+ PocketPC
+ 4.20
+
+
+
+ 4DE813A2-67E0-4a00-945C-3188240A8243
+ Smartphone
+ 4.20
+
+
+
+ E2BECB1F-8C8C-41ba-B736-9BE7D946A398
+ WindowsCE
+ 5.0
+
+
+
+ $(AssemblyName)
+ 512
+ $(DefineConstants);$(PlatformFamilyName)
+ {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ $(DefineConstants);$(NET_CF_Constant)
+
+
+
+ $(DefineConstants);$(Mono_Constant)
+
+
+
+ true
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(NET_1_0_Path)
+
+
+
+ $(NET_1_1_Path)
+
+
+
+ $(Mono_1_1_LibPath)
+
+
+
+ $(Mono_2_0_LibPath)
+
+
+
+
+
+ false
+
+
+
+
+
+ false
+
+
+
+
+
+ false
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+ ResolveAssemblyReferences;BeforeResGen;_CoreResGen_1_x;AfterResGen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(CheckUnsupportedFeaturesDependsOn);Check_MS_1_x_UnsupportedFeatures
+
+
+ $(CheckUnsupportedFeaturesDependsOn);Check_All_Mono_UnsupportedFeatures
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ResolveReferences;
+ ResolveKeySource;
+ BeforeCompile;
+ _TimeStampBeforeCompile;
+ MonoCoreCompile;
+ _TimeStampAfterCompile;
+ AfterCompile
+
+
+
+
+
+
+
+
+
+ "$(Mono_1_1_CompilerPath)"
+ "$(Mono_2_0_CompilerPath)"
+ $(MonoCommandLine) /lib:$(AdditionalLibPaths)
+ $(MonoCommandLine)@(AddModules->' /addmodule:"%(Identity)"', '')
+ $(MonoCommandLine) /unsafe+
+ $(MonoCommandLine) /checked+
+ $(MonoCommandLine) /codepage:$(CodePage)
+ $(MonoCommandLine) /define:$(DefineConstants)
+ $(MonoCommandLine) /delaysign+
+ $(MonoCommandLine) /doc:$(DocumentationFile)
+ $(MonoCommandLine) /debug+
+ $(MonoCommandLine) /keycontainer:$(KeyContainerName)
+ $(MonoCommandLine) /keyfile:$(KeyContainerName)
+ $(MonoCommandLine) /langversion:$(LangVersion)
+ $(MonoCommandLine) /main:$(StartupObject)
+ $(MonoCommandLine) /noconfig+
+ $(MonoCommandLine) /nostdlib+
+ $(MonoCommandLine) /optimize+
+ $(MonoCommandLine) /out:"@(IntermediateAssembly)"
+ $(MonoCommandLine)@(ReferencePath->' /reference:"%(Identity)"', '')
+ $(MonoCommandLine) $(CompilerResponseFile)
+ $(MonoCommandLine)@(Compile->' "%(Identity)"', '')
+ $(MonoCommandLine) /waraserror+
+ $(MonoCommandLine) /warn:$(WarningLevel)
+ $(MonoCommandLine) /win32icon:$(Win32Icon)
+ $(MonoCommandLine) /win32res:$(Win32Resource)
+ exe
+ winexe
+ library
+ module
+ $(MonoCommandLine) /target:$(MonoTargetType)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BuildAll
+ CleanAll
+ PublishOnlyAll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.txt b/README.txt
index 4af986a5..58bd549b 100644
--- a/README.txt
+++ b/README.txt
@@ -1,112 +1,112 @@
-
-libsecondlife
--------------
-
-We're still working on getting some documentation prepared for our first
-"official" release, so bear with us for now. If you need any help we
-have a couple of resources, the primary one being the #libsl IRC channel
-on EFNet. There are also the web forums at
-http://www.libsecondlife.org/forums/ and the libsecondlife-dev mailing
-list at https://gna.org/mail/?group=libsecondlife and lastly you can use
-the e-mail contact@libsecondlife.org for any general inquiries (although
-we prefer developer-related questions to go to IRC, forums, or the
-mailing list).
-
-To checkout a copy of libsecondlife trunk see
-https://gna.org/svn/?group=libsecondlife for details. The HTTP method
-seems to be more reliable.
-
-Windows
------------------------------------------------------------------
------------------------------------------------------------------
-
-
-Microsoft Visual Studio
------------------------
-
-Visual Studio 2005 project files are included to ease compiling on Windows
-platforms. Some of the projects use a custom targets file that allows you
-to compile against .NET 1.0/1.1, mono, or the Compact Framework. You will
-need to authorize this custom file when you first open the solution file.
-
-
-Software Needed (all Freeware)
-------------------------------
-
-Basic Stuff (Windows):
- MS .NET Framework (1.1 and/or 2.0 depending on what you're working on;
- preferably both). Get directly from Windows Update.
- Visual C# Express - http://msdn.microsoft.com/vstudio/express/visualcsharp/
- nAnt (0.85) - http://nant.sourceforge.net/
- nUnit Framework (2.2.8 or greater) - http://www.nunit.org/
-
-3D Stuff (i.e. sceneviewer) for Windows:
- XNA - http://msdn.microsoft.com/directx/XNA/default.aspx
- XGE - http://msdn.microsoft.com/directx/xna/gse/
-
-If you are using Visual Studio or Visual C# Express you can simply open
-the libsecondlife.sln solution file and begin compiling. It will complain
-about a missing dependency if you didn't install the nUnit framework, you
-can either install it now or remove libsecondlife.Tests from the solution
-file.
-
-
-NAnt under Windows
------------------------------------------------------------------
-
-1) Get .Net Frameworks (1.1 and 2.0) plus any patches installed via
-Windows Update. Multiple reboots may be needed.
-
-2) Install Visual C# Express (defaults are fine)
-
-3) Install nUnit Framework (defaults are fine)
-
-4) Unpack the 0.85 binary of nAnt in a directory you can be happy with
- (I chose C:\bin\nant-0.85\bin). Add this to your XP PATH variable:
-
- * Start->My Computer->[Right Click]->Properties (new window)
- * Advanced Tab -> Environment Variables (new window)
- * System Variables is bottom subwindow, click on 'path' and then the
- 'Edit' button below that. (new window)
- * Add ';C:\bin\nant-0.85\bin' or whereever it is to the line and click
- OK.
- * Click OK twice more to close out system config windows.
-
-5) In a Command Prompt (yea you heard that right) cd to where you checked
-out the trunk (You're looking for the dir that has libsecondlife.build and
-Ovastus.CSharp.targets). I'm going to call this %TRUNK% from here on.
-
- * Run 'nant' and sit back. 'cd bin' and enjoy!
-
-6) [Optional] Not all apps and examples will be in nant due to various
-compatibility and stability issues. If you're still interested:
-
- * Under %TRUNK%\libsecondlife-cs, open the libsecondlife.sln file and
- Build the Solution (you're likely going to get warnings and such here).
- * This may overwrite some of the files you created in step 5; If they
- don't work re-run nant.
-
-
-Linux
------------------------------------------------------------------
------------------------------------------------------------------
-
-
-Software Needed
----------------
-
-mono - http://www.mono-project.com/
-nAnt (0.85) - http://nant.sourceforge.net/
-nUnit Framework (2.2.8 or greater) - http://www.nunit.org/
-
-
-Compiling
----------
-
-Simply go to the directory where you extracted libsecondlife, where the
-libsecondlife.build file is located and type "nant". To build a zip file
-package use "nant package", and to generate documentation use "nant doc".
-
-
-Happy fiddling,
---libsecondlife Team
+
+libsecondlife
+-------------
+
+We're still working on getting some documentation prepared for our first
+"official" release, so bear with us for now. If you need any help we
+have a couple of resources, the primary one being the #libsl IRC channel
+on EFNet. There are also the web forums at
+http://www.libsecondlife.org/forums/ and the libsecondlife-dev mailing
+list at https://gna.org/mail/?group=libsecondlife and lastly you can use
+the e-mail contact@libsecondlife.org for any general inquiries (although
+we prefer developer-related questions to go to IRC, forums, or the
+mailing list).
+
+To checkout a copy of libsecondlife trunk see
+https://gna.org/svn/?group=libsecondlife for details. The HTTP method
+seems to be more reliable.
+
+Windows
+-----------------------------------------------------------------
+-----------------------------------------------------------------
+
+
+Microsoft Visual Studio
+-----------------------
+
+Visual Studio 2005 project files are included to ease compiling on Windows
+platforms. Some of the projects use a custom targets file that allows you
+to compile against .NET 1.0/1.1, mono, or the Compact Framework. You will
+need to authorize this custom file when you first open the solution file.
+
+
+Software Needed (all Freeware)
+------------------------------
+
+Basic Stuff (Windows):
+ MS .NET Framework (1.1 and/or 2.0 depending on what you're working on;
+ preferably both). Get directly from Windows Update.
+ Visual C# Express - http://msdn.microsoft.com/vstudio/express/visualcsharp/
+ nAnt (0.85) - http://nant.sourceforge.net/
+ nUnit Framework (2.2.8 or greater) - http://www.nunit.org/
+
+3D Stuff (i.e. sceneviewer) for Windows:
+ XNA - http://msdn.microsoft.com/directx/XNA/default.aspx
+ XGE - http://msdn.microsoft.com/directx/xna/gse/
+
+If you are using Visual Studio or Visual C# Express you can simply open
+the libsecondlife.sln solution file and begin compiling. It will complain
+about a missing dependency if you didn't install the nUnit framework, you
+can either install it now or remove libsecondlife.Tests from the solution
+file.
+
+
+NAnt under Windows
+-----------------------------------------------------------------
+
+1) Get .Net Frameworks (1.1 and 2.0) plus any patches installed via
+Windows Update. Multiple reboots may be needed.
+
+2) Install Visual C# Express (defaults are fine)
+
+3) Install nUnit Framework (defaults are fine)
+
+4) Unpack the 0.85 binary of nAnt in a directory you can be happy with
+ (I chose C:\bin\nant-0.85\bin). Add this to your XP PATH variable:
+
+ * Start->My Computer->[Right Click]->Properties (new window)
+ * Advanced Tab -> Environment Variables (new window)
+ * System Variables is bottom subwindow, click on 'path' and then the
+ 'Edit' button below that. (new window)
+ * Add ';C:\bin\nant-0.85\bin' or whereever it is to the line and click
+ OK.
+ * Click OK twice more to close out system config windows.
+
+5) In a Command Prompt (yea you heard that right) cd to where you checked
+out the trunk (You're looking for the dir that has libsecondlife.build and
+Ovastus.CSharp.targets). I'm going to call this %TRUNK% from here on.
+
+ * Run 'nant' and sit back. 'cd bin' and enjoy!
+
+6) [Optional] Not all apps and examples will be in nant due to various
+compatibility and stability issues. If you're still interested:
+
+ * Under %TRUNK%\libsecondlife-cs, open the libsecondlife.sln file and
+ Build the Solution (you're likely going to get warnings and such here).
+ * This may overwrite some of the files you created in step 5; If they
+ don't work re-run nant.
+
+
+Linux
+-----------------------------------------------------------------
+-----------------------------------------------------------------
+
+
+Software Needed
+---------------
+
+mono - http://www.mono-project.com/
+nAnt (0.85) - http://nant.sourceforge.net/
+nUnit Framework (2.2.8 or greater) - http://www.nunit.org/
+
+
+Compiling
+---------
+
+Simply go to the directory where you extracted libsecondlife, where the
+libsecondlife.build file is located and type "nant". To build a zip file
+package use "nant package", and to generate documentation use "nant doc".
+
+
+Happy fiddling,
+--libsecondlife Team
diff --git a/applications/Decoder/Decoder.cs b/applications/Decoder/Decoder.cs
index 9410a6bb..51ea4dd2 100644
--- a/applications/Decoder/Decoder.cs
+++ b/applications/Decoder/Decoder.cs
@@ -32,12 +32,12 @@ using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
-using libsecondlife;
+using libsecondlife;
using libsecondlife.Packets;
class Decoder {
- private static int BUFSIZE = 8096;
-
+ private static int BUFSIZE = 8096;
+
private static SecondLife client = new SecondLife();
private static ProtocolManager protocol = new ProtocolManager("keywords.txt", "message_template.msg", client);
private static string grep = null;
@@ -171,43 +171,43 @@ class Decoder {
} else
buf = data;
- //Packet packet = new Packet(buf, pos, protocol);
- // FIXME: Is this right? I haven't really looked at this code at all
+ //Packet packet = new Packet(buf, pos, protocol);
+ // FIXME: Is this right? I haven't really looked at this code at all
Packet packet = Packet.BuildPacket(buf, ref pos);
if (grep != null) {
- bool match = false;
-
- //FIXME: This needs to be updated for the new libsecondlife API
- //foreach (Block block in packet.Blocks())
- //{
- // foreach (Field field in block.Fields)
- // {
- // string value;
- // if (field.Layout.Type == FieldType.Variable)
- // value = DataConvert.toChoppedString(field.Data);
- // else
- // value = field.Data.ToString();
- // if (Regex.Match(packet.Layout.Name + "." + block.Layout.Name + "." + field.Layout.Name + " = " + value, grep, RegexOptions.IgnoreCase).Success)
- // {
- // match = true;
- // break;
- // }
-
- // // try matching variable fields in 0x notation
- // if (field.Layout.Type == FieldType.Variable)
- // {
- // StringWriter sw = new StringWriter();
- // sw.Write("0x");
- // foreach (byte b in (byte[])field.Data)
- // sw.Write("{0:x2}", b);
- // if (Regex.Match(packet.Layout.Name + "." + block.Layout.Name + "." + field.Layout.Name + " = " + sw, grep, RegexOptions.IgnoreCase).Success)
- // {
- // match = true;
- // break;
- // }
- // }
- // }
+ bool match = false;
+
+ //FIXME: This needs to be updated for the new libsecondlife API
+ //foreach (Block block in packet.Blocks())
+ //{
+ // foreach (Field field in block.Fields)
+ // {
+ // string value;
+ // if (field.Layout.Type == FieldType.Variable)
+ // value = DataConvert.toChoppedString(field.Data);
+ // else
+ // value = field.Data.ToString();
+ // if (Regex.Match(packet.Layout.Name + "." + block.Layout.Name + "." + field.Layout.Name + " = " + value, grep, RegexOptions.IgnoreCase).Success)
+ // {
+ // match = true;
+ // break;
+ // }
+
+ // // try matching variable fields in 0x notation
+ // if (field.Layout.Type == FieldType.Variable)
+ // {
+ // StringWriter sw = new StringWriter();
+ // sw.Write("0x");
+ // foreach (byte b in (byte[])field.Data)
+ // sw.Write("{0:x2}", b);
+ // if (Regex.Match(packet.Layout.Name + "." + block.Layout.Name + "." + field.Layout.Name + " = " + sw, grep, RegexOptions.IgnoreCase).Success)
+ // {
+ // match = true;
+ // break;
+ // }
+ // }
+ // }
//}
if (!match) {
diff --git a/applications/Decoder/Decoder.csproj b/applications/Decoder/Decoder.csproj
index 830cd346..68af62a6 100644
--- a/applications/Decoder/Decoder.csproj
+++ b/applications/Decoder/Decoder.csproj
@@ -1,56 +1,56 @@
-
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {7AE16AC1-E64C-4FDC-9B85-4BB6145D511C}
- Exe
- Properties
- Decoder
- Decoder
- Decoder
-
-
- true
- full
- false
- ..\..\bin\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
- {D9CDEDFB-8169-4B03-B57F-0DF638F044EC}
- libsecondlife
-
-
-
-
-
-
-
-
-
-
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {7AE16AC1-E64C-4FDC-9B85-4BB6145D511C}
+ Exe
+ Properties
+ Decoder
+ Decoder
+ Decoder
+
+
+ true
+ full
+ false
+ ..\..\bin\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+ {D9CDEDFB-8169-4B03-B57F-0DF638F044EC}
+ libsecondlife
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/applications/SLChat/SLChat.sln b/applications/SLChat/SLChat.sln
index 80fab9a2..24b20c31 100644
--- a/applications/SLChat/SLChat.sln
+++ b/applications/SLChat/SLChat.sln
@@ -1,19 +1,19 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# SharpDevelop 2.0.0.1462
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLChat", "SLChat\SLChat.csproj", "{A6D955CD-1F55-459F-A7AD-01E591404989}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A6D955CD-1F55-459F-A7AD-01E591404989}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A6D955CD-1F55-459F-A7AD-01E591404989}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A6D955CD-1F55-459F-A7AD-01E591404989}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A6D955CD-1F55-459F-A7AD-01E591404989}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 9.00
+# SharpDevelop 2.0.0.1462
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLChat", "SLChat\SLChat.csproj", "{A6D955CD-1F55-459F-A7AD-01E591404989}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A6D955CD-1F55-459F-A7AD-01E591404989}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A6D955CD-1F55-459F-A7AD-01E591404989}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A6D955CD-1F55-459F-A7AD-01E591404989}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A6D955CD-1F55-459F-A7AD-01E591404989}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/applications/SLChat/SLChat/Core/ChatTextManager.cs b/applications/SLChat/SLChat/Core/ChatTextManager.cs
index acf0ca31..b0fa8ade 100644
--- a/applications/SLChat/SLChat/Core/ChatTextManager.cs
+++ b/applications/SLChat/SLChat/Core/ChatTextManager.cs
@@ -1,151 +1,151 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using SLNetworkComm;
-using libsecondlife;
-
-namespace SLChat
-{
- public class ChatTextManager
- {
- private ITextPrinter textPrinter;
- private SLNetCom netcom;
- private PrefsManager prefs;
- //Our color set for the different textes.
- private Color colorProgram = Color.RoyalBlue;
- private Color colorSLSystem = Color.Teal;
- private Color colorUserText = Color.Black;
- private Color colorObjectText = Color.DarkGreen;
- private Color colorLindenText = Color.Chocolate;
-
- public ChatTextManager(ITextPrinter textPrinter, SLNetCom netcom, PrefsManager preferences)
- {
- this.textPrinter = textPrinter;
- this.netcom = netcom;
- this.prefs = preferences;
-
- this.AddNetcomEvents();
- }
-
- private void AddNetcomEvents()
- {
- netcom.ClientLoggedIn += new EventHandler(netcom_ClientLoggedIn);
- netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut);
- netcom.ClientLoginError += new EventHandler(netcom_ClientLoginError);
- netcom.ChatReceived += new EventHandler(netcom_ChatReceived);
- }
-
- private void netcom_ChatReceived(object sender, ChatEventArgs e)
- {
- if (string.IsNullOrEmpty(e.Message)) return;
-
- if (prefs.setChatTimestamps)
- {
-
- TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1));
- DateTime tr = (new DateTime(1970,1,1)).AddSeconds(t.TotalSeconds);
- tr = tr.AddHours(int.Parse(prefs.setChatTimeZ));
- textPrinter.ForeColor = Color.Gray;
- textPrinter.PrintText(tr.ToString(prefs.setChatStampFormat));
- }
-
- StringBuilder sb = new StringBuilder();
-
- //If the name is the users, the source is an agent,
- //and a "/me" command is not being done, then we append "you"
- //otherwise we append the full name.
- if (e.FromName == netcom.LoginOptions.FullName & e.SourceType == SLSourceType.Avatar & !e.Message.ToLower().StartsWith("/me ") & !prefs.setUseFullName)
- sb.Append("You");
- else
- sb.Append(e.FromName);
-
- switch (e.Type)
- {
- case SLChatType.Say:
- //sb.Append(": ");
- break;
-
- case SLChatType.Whisper:
- sb.Append(" whisper");
- break;
-
- case SLChatType.Shout:
- sb.Append(" shout");
- break;
- }
-
- //Setting us up for proper grammar, so we don't get "You shouts"
- //but rather "You shout"
- if(e.FromName != netcom.LoginOptions.FullName & e.Type != SLChatType.Say)
- sb.Append("s");
-
- //Checking for a /me command
- string Mess = e.Message;
- if(!e.Message.ToLower().StartsWith("/me "))
- {
- sb.Append(": ");
- }else {
- Mess = e.Message.Remove(0,3);
- }
-
- sb.Append(Mess);
-
- switch (e.SourceType)
- {
- case SLSourceType.Avatar:
- if(e.FromName.Split(' ')[1]=="Linden")
- {
- textPrinter.ForeColor = colorLindenText;
- }else{
- textPrinter.ForeColor = colorUserText;
- }
- break;
-
- case SLSourceType.Object:
- textPrinter.ForeColor = colorObjectText;
- break;
- }
-
- textPrinter.PrintTextLine(sb.ToString());
- sb = null;
- }
-
- private void netcom_ClientLoginError(object sender, ClientLoginEventArgs e)
- {
- textPrinter.ForeColor = colorSLSystem;
- textPrinter.PrintTextLine("Login error: " + e.LoginReply);
- }
-
- private void netcom_ClientLoggedOut(object sender, ClientLoginEventArgs e)
- {
- textPrinter.ForeColor = colorProgram;
- textPrinter.PrintTextLine("Logged out of Second Life.");
-
- textPrinter.ForeColor = colorSLSystem;
- textPrinter.PrintTextLine("Logout reply: " + e.LoginReply);
- }
-
- private void netcom_ClientLoggedIn(object sender, ClientLoginEventArgs e)
- {
- textPrinter.ForeColor = colorProgram;
- textPrinter.PrintTextLine("Logged into Second Life as " + netcom.LoginOptions.FullName + ".");
-
- textPrinter.ForeColor = colorSLSystem;
- textPrinter.PrintTextLine("Login reply: " + e.LoginReply);
- }
-
- public void PrintProgramMessage(string msg)
- {
- textPrinter.ForeColor = colorProgram;
- textPrinter.PrintTextLine(msg);
- }
-
- public ITextPrinter TextPrinter
- {
- get { return textPrinter; }
- set { textPrinter = value; }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using SLNetworkComm;
+using libsecondlife;
+
+namespace SLChat
+{
+ public class ChatTextManager
+ {
+ private ITextPrinter textPrinter;
+ private SLNetCom netcom;
+ private PrefsManager prefs;
+ //Our color set for the different textes.
+ private Color colorProgram = Color.RoyalBlue;
+ private Color colorSLSystem = Color.Teal;
+ private Color colorUserText = Color.Black;
+ private Color colorObjectText = Color.DarkGreen;
+ private Color colorLindenText = Color.Chocolate;
+
+ public ChatTextManager(ITextPrinter textPrinter, SLNetCom netcom, PrefsManager preferences)
+ {
+ this.textPrinter = textPrinter;
+ this.netcom = netcom;
+ this.prefs = preferences;
+
+ this.AddNetcomEvents();
+ }
+
+ private void AddNetcomEvents()
+ {
+ netcom.ClientLoggedIn += new EventHandler(netcom_ClientLoggedIn);
+ netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut);
+ netcom.ClientLoginError += new EventHandler(netcom_ClientLoginError);
+ netcom.ChatReceived += new EventHandler(netcom_ChatReceived);
+ }
+
+ private void netcom_ChatReceived(object sender, ChatEventArgs e)
+ {
+ if (string.IsNullOrEmpty(e.Message)) return;
+
+ if (prefs.setChatTimestamps)
+ {
+
+ TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1));
+ DateTime tr = (new DateTime(1970,1,1)).AddSeconds(t.TotalSeconds);
+ tr = tr.AddHours(int.Parse(prefs.setChatTimeZ));
+ textPrinter.ForeColor = Color.Gray;
+ textPrinter.PrintText(tr.ToString(prefs.setChatStampFormat));
+ }
+
+ StringBuilder sb = new StringBuilder();
+
+ //If the name is the users, the source is an agent,
+ //and a "/me" command is not being done, then we append "you"
+ //otherwise we append the full name.
+ if (e.FromName == netcom.LoginOptions.FullName & e.SourceType == SLSourceType.Avatar & !e.Message.ToLower().StartsWith("/me ") & !prefs.setUseFullName)
+ sb.Append("You");
+ else
+ sb.Append(e.FromName);
+
+ switch (e.Type)
+ {
+ case SLChatType.Say:
+ //sb.Append(": ");
+ break;
+
+ case SLChatType.Whisper:
+ sb.Append(" whisper");
+ break;
+
+ case SLChatType.Shout:
+ sb.Append(" shout");
+ break;
+ }
+
+ //Setting us up for proper grammar, so we don't get "You shouts"
+ //but rather "You shout"
+ if(e.FromName != netcom.LoginOptions.FullName & e.Type != SLChatType.Say)
+ sb.Append("s");
+
+ //Checking for a /me command
+ string Mess = e.Message;
+ if(!e.Message.ToLower().StartsWith("/me "))
+ {
+ sb.Append(": ");
+ }else {
+ Mess = e.Message.Remove(0,3);
+ }
+
+ sb.Append(Mess);
+
+ switch (e.SourceType)
+ {
+ case SLSourceType.Avatar:
+ if(e.FromName.Split(' ')[1]=="Linden")
+ {
+ textPrinter.ForeColor = colorLindenText;
+ }else{
+ textPrinter.ForeColor = colorUserText;
+ }
+ break;
+
+ case SLSourceType.Object:
+ textPrinter.ForeColor = colorObjectText;
+ break;
+ }
+
+ textPrinter.PrintTextLine(sb.ToString());
+ sb = null;
+ }
+
+ private void netcom_ClientLoginError(object sender, ClientLoginEventArgs e)
+ {
+ textPrinter.ForeColor = colorSLSystem;
+ textPrinter.PrintTextLine("Login error: " + e.LoginReply);
+ }
+
+ private void netcom_ClientLoggedOut(object sender, ClientLoginEventArgs e)
+ {
+ textPrinter.ForeColor = colorProgram;
+ textPrinter.PrintTextLine("Logged out of Second Life.");
+
+ textPrinter.ForeColor = colorSLSystem;
+ textPrinter.PrintTextLine("Logout reply: " + e.LoginReply);
+ }
+
+ private void netcom_ClientLoggedIn(object sender, ClientLoginEventArgs e)
+ {
+ textPrinter.ForeColor = colorProgram;
+ textPrinter.PrintTextLine("Logged into Second Life as " + netcom.LoginOptions.FullName + ".");
+
+ textPrinter.ForeColor = colorSLSystem;
+ textPrinter.PrintTextLine("Login reply: " + e.LoginReply);
+ }
+
+ public void PrintProgramMessage(string msg)
+ {
+ textPrinter.ForeColor = colorProgram;
+ textPrinter.PrintTextLine(msg);
+ }
+
+ public ITextPrinter TextPrinter
+ {
+ get { return textPrinter; }
+ set { textPrinter = value; }
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/Core/IMTextManager.cs b/applications/SLChat/SLChat/Core/IMTextManager.cs
index 19c41204..64da424e 100644
--- a/applications/SLChat/SLChat/Core/IMTextManager.cs
+++ b/applications/SLChat/SLChat/Core/IMTextManager.cs
@@ -1,79 +1,79 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Text;
-using SLNetworkComm;
-using libsecondlife;
-
-namespace SLChat
-{
- public class IMTextManager
- {
- private ITextPrinter textPrinter;
- private SLNetCom netcom;
- private PrefsManager prefs;
-
- public IMTextManager(ITextPrinter textPrinter, SLNetCom netcom, PrefsManager preferences)
- {
- this.textPrinter = textPrinter;
- this.netcom = netcom;
- this.prefs = preferences;
-
- this.AddNetcomEvents();
- }
-
- private void AddNetcomEvents()
- {
- netcom.InstantMessageReceived += new EventHandler(netcom_InstantMessageReceived);
- netcom.InstantMessageSent += new EventHandler(netcom_InstantMessageSent);
- }
-
- private void netcom_InstantMessageSent(object sender, InstantMessageSentEventArgs e)
- {
- this.PrintIM(e.Timestamp, netcom.LoginOptions.FullName, e.Message);
- }
-
- private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e)
- {
- this.PrintIM(e.Timestamp, e.FromAgentName, e.Message);
- }
-
- public void PrintIM(DateTime timestamp, string fromName, string message)
- {
- if (prefs.setIMTimestamps)
- {
- timestamp = timestamp.AddHours(int.Parse(prefs.setIMTimeZ));
- textPrinter.ForeColor = Color.Gray;
- textPrinter.PrintText(timestamp.ToString(prefs.setIMStampFormat));
- }
-
- textPrinter.ForeColor = Color.Black;
-
- StringBuilder sb = new StringBuilder();
-
- sb.Append(fromName);
- sb.Append(": ");
- sb.Append(message);
-
- textPrinter.PrintTextLine(sb.ToString());
- sb = null;
- }
-
- public void PrintProgramMessage(string msg)
- {
- textPrinter.ForeColor = Color.RoyalBlue;
- textPrinter.PrintTextLine(msg);
- }
-
- public void PassIMEvent(InstantMessageEventArgs e)
- {
- this.netcom_InstantMessageReceived(netcom, e);
- }
-
- public ITextPrinter TextPrinter
- {
- get { return textPrinter; }
- set { textPrinter = value; }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+using SLNetworkComm;
+using libsecondlife;
+
+namespace SLChat
+{
+ public class IMTextManager
+ {
+ private ITextPrinter textPrinter;
+ private SLNetCom netcom;
+ private PrefsManager prefs;
+
+ public IMTextManager(ITextPrinter textPrinter, SLNetCom netcom, PrefsManager preferences)
+ {
+ this.textPrinter = textPrinter;
+ this.netcom = netcom;
+ this.prefs = preferences;
+
+ this.AddNetcomEvents();
+ }
+
+ private void AddNetcomEvents()
+ {
+ netcom.InstantMessageReceived += new EventHandler(netcom_InstantMessageReceived);
+ netcom.InstantMessageSent += new EventHandler(netcom_InstantMessageSent);
+ }
+
+ private void netcom_InstantMessageSent(object sender, InstantMessageSentEventArgs e)
+ {
+ this.PrintIM(e.Timestamp, netcom.LoginOptions.FullName, e.Message);
+ }
+
+ private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e)
+ {
+ this.PrintIM(e.Timestamp, e.FromAgentName, e.Message);
+ }
+
+ public void PrintIM(DateTime timestamp, string fromName, string message)
+ {
+ if (prefs.setIMTimestamps)
+ {
+ timestamp = timestamp.AddHours(int.Parse(prefs.setIMTimeZ));
+ textPrinter.ForeColor = Color.Gray;
+ textPrinter.PrintText(timestamp.ToString(prefs.setIMStampFormat));
+ }
+
+ textPrinter.ForeColor = Color.Black;
+
+ StringBuilder sb = new StringBuilder();
+
+ sb.Append(fromName);
+ sb.Append(": ");
+ sb.Append(message);
+
+ textPrinter.PrintTextLine(sb.ToString());
+ sb = null;
+ }
+
+ public void PrintProgramMessage(string msg)
+ {
+ textPrinter.ForeColor = Color.RoyalBlue;
+ textPrinter.PrintTextLine(msg);
+ }
+
+ public void PassIMEvent(InstantMessageEventArgs e)
+ {
+ this.netcom_InstantMessageReceived(netcom, e);
+ }
+
+ public ITextPrinter TextPrinter
+ {
+ get { return textPrinter; }
+ set { textPrinter = value; }
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/Core/ITextPrinter.cs b/applications/SLChat/SLChat/Core/ITextPrinter.cs
index 739439b6..3c3c9609 100644
--- a/applications/SLChat/SLChat/Core/ITextPrinter.cs
+++ b/applications/SLChat/SLChat/Core/ITextPrinter.cs
@@ -1,18 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Text;
-
-namespace SLChat
-{
- public interface ITextPrinter
- {
- void PrintText(string text);
- void PrintTextLine(string text);
-
- string Content { get; set; }
- Color ForeColor { get; set; }
- Color BackColor { get; set; }
- Font Font { get; set; }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+
+namespace SLChat
+{
+ public interface ITextPrinter
+ {
+ void PrintText(string text);
+ void PrintTextLine(string text);
+
+ string Content { get; set; }
+ Color ForeColor { get; set; }
+ Color BackColor { get; set; }
+ Font Font { get; set; }
+ }
+}
diff --git a/applications/SLChat/SLChat/Core/PrefsManager.cs b/applications/SLChat/SLChat/Core/PrefsManager.cs
index e58237cb..17649edb 100644
--- a/applications/SLChat/SLChat/Core/PrefsManager.cs
+++ b/applications/SLChat/SLChat/Core/PrefsManager.cs
@@ -1,232 +1,232 @@
-/*
- * Created by SharpDevelop.
- * User: Oz
- * Date: 8/12/2006
- * Time: 2:48 PM
- *
- * To change this template use Tools | Options | Coding | Edit Standard Headers.
- */
-
-using System;
-using System.Xml;
-using System.Xml.XPath;
-using System.IO;
-using System.Collections;
-
-namespace SLChat
-{
- ///
- /// Description of PrefsManager.
- /// Loads, saves, checks, etc. preferences and files related.
- ///
- public class PrefsManager
- {
- public bool setUseFullName = false;
- public bool setListUserName = true;
- public bool setIMTimestamps = true;
- public bool setChatTimestamps = false;
- public string setChatTimeZ = "-7";
- public string setIMTimeZ = "-3"; //For some reason IM timestamps only match PDT if you use -3 instead of -7
- public string setChatStampFormat = "[HH:mm] ";
- public string setIMStampFormat = "[HH:mm] ";
- public bool setSyncTimestamps = true;
- public string[] profiles = new string[100]; //Sending out profiles
- public Hashtable settings = new Hashtable(); //sending out the collected settings
-
- public PrefsManager()
- {
-
- }
-
- public void SaveSettings(string username, string nodeparent, string nodechildren)
- {
- //Saving our login settings
- //username = name of user/profile under which settings are saved
- //nodeparent = name of node grouping to save under, i.e. "LoginSettings"
- //nodechildren = collection of nodes with pre-set values saved under parent.
- //pick whatever filename with .xml extension
- string filename = @"Profiles\\"+username+"\\settings.xml";
- SaveDirectory(@"Profiles\\"+username+"\\");
-
- XmlDocument xmlDoc = new XmlDocument();
-
- try
- {
- xmlDoc.Load(filename);
- }
- catch(System.IO.FileNotFoundException)
- {
- //if file is not found, create a new xml file
- XmlTextWriter xmlWriter = new XmlTextWriter(filename, System.Text.Encoding.UTF8);
- xmlWriter.Formatting = Formatting.Indented;
- xmlWriter.WriteProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
- xmlWriter.WriteStartElement("SLChatSettings");
- //If WriteProcessingInstruction is used as above,
- //Do not use WriteEndElement() here
- //xmlWriter.WriteEndElement();
- //it will cause the <Root> to be <Root />
- xmlWriter.Close();
- xmlDoc.Load(filename);
- }
-
- XmlNode root = xmlDoc.DocumentElement;
- XmlNodeList nodeList = xmlDoc.GetElementsByTagName(nodeparent);
- if(nodeList.Count!=0){
- root.RemoveChild(nodeList[0]);
- }
- XmlElement loginSettings = xmlDoc.CreateElement(nodeparent);
- string strSettings = nodechildren;
- loginSettings.InnerXml = strSettings;
-
- root.AppendChild(loginSettings);
-
- xmlDoc.Save(filename);
- }
-
- private void SaveDirectory(string PathName)
- {
- try
- {
- DirectoryInfo TheFolder = new DirectoryInfo(PathName);
- if (TheFolder.Exists)
- {
- return;
- }
-
- throw new FileNotFoundException();
- }
- catch(FileNotFoundException )
- {
- DirectoryInfo TheDir = new DirectoryInfo(PathName);
- TheDir.Create();
- return;
- }
- }
-
- public void DeleteProfile(string username)
- {
- string PathName = @"Profiles\\"+username;
-
- try
- {
- DirectoryInfo TheFolder = new DirectoryInfo(PathName);
- if (TheFolder.Exists)
- {
- TheFolder.Delete(true);
- profiles[0] = "success";
- return;
- }
-
- throw new FileNotFoundException();
- }
- catch(FileNotFoundException )
- {
- //If the folders are not found, inform user.
- profiles[0] = "Profile not found.";
- return;
- }
- catch(Exception e)
- {
- //An unexpected error occured.
- profiles[0] = "Problem occured: "+e.Message;
- return;
- }
- }
-
- public void LoadProfiles()
- {
- string PathName = @"Profiles\\";
-
- try
- {
- DirectoryInfo TheFolder = new DirectoryInfo(PathName);
- if (TheFolder.Exists)
- {
- int i = 0;
- DirectoryInfo[] dirs = TheFolder.GetDirectories();
- foreach(DirectoryInfo di in dirs)
- {
- profiles[i] = di.Name;
- i++;
- }
- return;
- }
-
- throw new FileNotFoundException();
- }
- catch(FileNotFoundException )
- {
- //If the folders are not found, inform user.
- profiles[0] = "No profiles found.";
- return;
- }
- catch(Exception e)
- {
- //An unexpected error occured.
- profiles[0] = "Problem occured: "+e.Message;
- return;
- }
- }
-
- public void LoadSettings(string username, string parentnode)
- {
- //Load our login settings.
- if(username==string.Empty) return;
-
- string filename = @"Profiles\\"+username+"\\settings.xml";
-
- XmlDocument xmlDoc = new XmlDocument();
-
- try
- {
- xmlDoc.Load(filename);
- }
- catch(System.IO.FileNotFoundException)
- {
- settings.Add("Error","File not found");
- return;
- }
-
- XmlNode root = xmlDoc.DocumentElement;
- XmlNodeList nodeList = xmlDoc.GetElementsByTagName(parentnode);
- if(nodeList.Count>0){
- for(int i = 0;i
+ /// Description of PrefsManager.
+ /// Loads, saves, checks, etc. preferences and files related.
+ ///
+ public class PrefsManager
+ {
+ public bool setUseFullName = false;
+ public bool setListUserName = true;
+ public bool setIMTimestamps = true;
+ public bool setChatTimestamps = false;
+ public string setChatTimeZ = "-7";
+ public string setIMTimeZ = "-3"; //For some reason IM timestamps only match PDT if you use -3 instead of -7
+ public string setChatStampFormat = "[HH:mm] ";
+ public string setIMStampFormat = "[HH:mm] ";
+ public bool setSyncTimestamps = true;
+ public string[] profiles = new string[100]; //Sending out profiles
+ public Hashtable settings = new Hashtable(); //sending out the collected settings
+
+ public PrefsManager()
+ {
+
+ }
+
+ public void SaveSettings(string username, string nodeparent, string nodechildren)
+ {
+ //Saving our login settings
+ //username = name of user/profile under which settings are saved
+ //nodeparent = name of node grouping to save under, i.e. "LoginSettings"
+ //nodechildren = collection of nodes with pre-set values saved under parent.
+ //pick whatever filename with .xml extension
+ string filename = @"Profiles\\"+username+"\\settings.xml";
+ SaveDirectory(@"Profiles\\"+username+"\\");
+
+ XmlDocument xmlDoc = new XmlDocument();
+
+ try
+ {
+ xmlDoc.Load(filename);
+ }
+ catch(System.IO.FileNotFoundException)
+ {
+ //if file is not found, create a new xml file
+ XmlTextWriter xmlWriter = new XmlTextWriter(filename, System.Text.Encoding.UTF8);
+ xmlWriter.Formatting = Formatting.Indented;
+ xmlWriter.WriteProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
+ xmlWriter.WriteStartElement("SLChatSettings");
+ //If WriteProcessingInstruction is used as above,
+ //Do not use WriteEndElement() here
+ //xmlWriter.WriteEndElement();
+ //it will cause the <Root> to be <Root />
+ xmlWriter.Close();
+ xmlDoc.Load(filename);
+ }
+
+ XmlNode root = xmlDoc.DocumentElement;
+ XmlNodeList nodeList = xmlDoc.GetElementsByTagName(nodeparent);
+ if(nodeList.Count!=0){
+ root.RemoveChild(nodeList[0]);
+ }
+ XmlElement loginSettings = xmlDoc.CreateElement(nodeparent);
+ string strSettings = nodechildren;
+ loginSettings.InnerXml = strSettings;
+
+ root.AppendChild(loginSettings);
+
+ xmlDoc.Save(filename);
+ }
+
+ private void SaveDirectory(string PathName)
+ {
+ try
+ {
+ DirectoryInfo TheFolder = new DirectoryInfo(PathName);
+ if (TheFolder.Exists)
+ {
+ return;
+ }
+
+ throw new FileNotFoundException();
+ }
+ catch(FileNotFoundException )
+ {
+ DirectoryInfo TheDir = new DirectoryInfo(PathName);
+ TheDir.Create();
+ return;
+ }
+ }
+
+ public void DeleteProfile(string username)
+ {
+ string PathName = @"Profiles\\"+username;
+
+ try
+ {
+ DirectoryInfo TheFolder = new DirectoryInfo(PathName);
+ if (TheFolder.Exists)
+ {
+ TheFolder.Delete(true);
+ profiles[0] = "success";
+ return;
+ }
+
+ throw new FileNotFoundException();
+ }
+ catch(FileNotFoundException )
+ {
+ //If the folders are not found, inform user.
+ profiles[0] = "Profile not found.";
+ return;
+ }
+ catch(Exception e)
+ {
+ //An unexpected error occured.
+ profiles[0] = "Problem occured: "+e.Message;
+ return;
+ }
+ }
+
+ public void LoadProfiles()
+ {
+ string PathName = @"Profiles\\";
+
+ try
+ {
+ DirectoryInfo TheFolder = new DirectoryInfo(PathName);
+ if (TheFolder.Exists)
+ {
+ int i = 0;
+ DirectoryInfo[] dirs = TheFolder.GetDirectories();
+ foreach(DirectoryInfo di in dirs)
+ {
+ profiles[i] = di.Name;
+ i++;
+ }
+ return;
+ }
+
+ throw new FileNotFoundException();
+ }
+ catch(FileNotFoundException )
+ {
+ //If the folders are not found, inform user.
+ profiles[0] = "No profiles found.";
+ return;
+ }
+ catch(Exception e)
+ {
+ //An unexpected error occured.
+ profiles[0] = "Problem occured: "+e.Message;
+ return;
+ }
+ }
+
+ public void LoadSettings(string username, string parentnode)
+ {
+ //Load our login settings.
+ if(username==string.Empty) return;
+
+ string filename = @"Profiles\\"+username+"\\settings.xml";
+
+ XmlDocument xmlDoc = new XmlDocument();
+
+ try
+ {
+ xmlDoc.Load(filename);
+ }
+ catch(System.IO.FileNotFoundException)
+ {
+ settings.Add("Error","File not found");
+ return;
+ }
+
+ XmlNode root = xmlDoc.DocumentElement;
+ XmlNodeList nodeList = xmlDoc.GetElementsByTagName(parentnode);
+ if(nodeList.Count>0){
+ for(int i = 0;i
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.btnClose = new System.Windows.Forms.Button();
- this.rtbCredits = new System.Windows.Forms.RichTextBox();
- this.SuspendLayout();
- //
- // btnClose
- //
- this.btnClose.Location = new System.Drawing.Point(227, 231);
- this.btnClose.Name = "btnClose";
- this.btnClose.Size = new System.Drawing.Size(75, 23);
- this.btnClose.TabIndex = 1;
- this.btnClose.Text = "Close";
- this.btnClose.UseVisualStyleBackColor = true;
- this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
- //
- // rtbCredits
- //
- this.rtbCredits.BackColor = System.Drawing.Color.White;
- this.rtbCredits.Location = new System.Drawing.Point(12, 12);
- this.rtbCredits.Name = "rtbCredits";
- this.rtbCredits.ReadOnly = true;
- this.rtbCredits.Size = new System.Drawing.Size(290, 209);
- this.rtbCredits.TabIndex = 2;
- this.rtbCredits.Text = "";
- this.rtbCredits.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.Link_Clicked);
- //
- // frmAbout
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(314, 266);
- this.Controls.Add(this.rtbCredits);
- this.Controls.Add(this.btnClose);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "frmAbout";
- this.ShowIcon = false;
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "About SLChat";
- this.ResumeLayout(false);
- }
- private System.Windows.Forms.RichTextBox rtbCredits;
-
- #endregion
-
- private System.Windows.Forms.Button btnClose;
- }
-}
+namespace SLChat
+{
+ partial class frmAbout
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.btnClose = new System.Windows.Forms.Button();
+ this.rtbCredits = new System.Windows.Forms.RichTextBox();
+ this.SuspendLayout();
+ //
+ // btnClose
+ //
+ this.btnClose.Location = new System.Drawing.Point(227, 231);
+ this.btnClose.Name = "btnClose";
+ this.btnClose.Size = new System.Drawing.Size(75, 23);
+ this.btnClose.TabIndex = 1;
+ this.btnClose.Text = "Close";
+ this.btnClose.UseVisualStyleBackColor = true;
+ this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+ //
+ // rtbCredits
+ //
+ this.rtbCredits.BackColor = System.Drawing.Color.White;
+ this.rtbCredits.Location = new System.Drawing.Point(12, 12);
+ this.rtbCredits.Name = "rtbCredits";
+ this.rtbCredits.ReadOnly = true;
+ this.rtbCredits.Size = new System.Drawing.Size(290, 209);
+ this.rtbCredits.TabIndex = 2;
+ this.rtbCredits.Text = "";
+ this.rtbCredits.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.Link_Clicked);
+ //
+ // frmAbout
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(314, 266);
+ this.Controls.Add(this.rtbCredits);
+ this.Controls.Add(this.btnClose);
+ this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "frmAbout";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "About SLChat";
+ this.ResumeLayout(false);
+ }
+ private System.Windows.Forms.RichTextBox rtbCredits;
+
+ #endregion
+
+ private System.Windows.Forms.Button btnClose;
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/About.cs b/applications/SLChat/SLChat/GUI/About.cs
index cfc08747..5af4f6f5 100644
--- a/applications/SLChat/SLChat/GUI/About.cs
+++ b/applications/SLChat/SLChat/GUI/About.cs
@@ -1,40 +1,40 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-
-namespace SLChat
-{
- public partial class frmAbout : Form
- {
- private frmMain MainForm;
-
- public frmAbout(frmMain main)
- {
- InitializeComponent();
- MainForm = main;
- rtbCredits.SelectionFont = new Font(rtbCredits.Font, FontStyle.Bold);
- rtbCredits.AppendText("SLChat v0.0.0.3");
- rtbCredits.SelectionFont = new Font(rtbCredits.Font, FontStyle.Regular);
- rtbCredits.AppendText("\nhttp://www.libsecondlife.org/content/view/16/32/"+
- "\n\nUsing the libsecondlife library (http://libsecondlife.org)"+
- "\n\nDeveloped by: Oz Spade, Delta Czukor, Baba Yamamoto"+
- "\n\nBuilt off of Delta Czukor's SLeek"+
- "\n\n\n\nA nark posing as someone who poses as a nark.");
- }
-
- private void Link_Clicked (object sender, System.Windows.Forms.LinkClickedEventArgs e)
- {
- System.Diagnostics.Process.Start(e.LinkText);
- }
-
- private void btnClose_Click(object sender, EventArgs e)
- {
- MainForm.aboutCreated = false;
- this.Close();
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace SLChat
+{
+ public partial class frmAbout : Form
+ {
+ private frmMain MainForm;
+
+ public frmAbout(frmMain main)
+ {
+ InitializeComponent();
+ MainForm = main;
+ rtbCredits.SelectionFont = new Font(rtbCredits.Font, FontStyle.Bold);
+ rtbCredits.AppendText("SLChat v0.0.0.3");
+ rtbCredits.SelectionFont = new Font(rtbCredits.Font, FontStyle.Regular);
+ rtbCredits.AppendText("\nhttp://www.libsecondlife.org/content/view/16/32/"+
+ "\n\nUsing the libsecondlife library (http://libsecondlife.org)"+
+ "\n\nDeveloped by: Oz Spade, Delta Czukor, Baba Yamamoto"+
+ "\n\nBuilt off of Delta Czukor's SLeek"+
+ "\n\n\n\nA nark posing as someone who poses as a nark.");
+ }
+
+ private void Link_Clicked (object sender, System.Windows.Forms.LinkClickedEventArgs e)
+ {
+ System.Diagnostics.Process.Start(e.LinkText);
+ }
+
+ private void btnClose_Click(object sender, EventArgs e)
+ {
+ MainForm.aboutCreated = false;
+ this.Close();
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/About.resx b/applications/SLChat/SLChat/GUI/About.resx
index 5ea0895e..7080a7d1 100644
--- a/applications/SLChat/SLChat/GUI/About.resx
+++ b/applications/SLChat/SLChat/GUI/About.resx
@@ -1,120 +1,120 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
\ No newline at end of file
diff --git a/applications/SLChat/SLChat/GUI/IMTabWindow.Designer.cs b/applications/SLChat/SLChat/GUI/IMTabWindow.Designer.cs
index e559d6d1..2b6e602f 100644
--- a/applications/SLChat/SLChat/GUI/IMTabWindow.Designer.cs
+++ b/applications/SLChat/SLChat/GUI/IMTabWindow.Designer.cs
@@ -1,123 +1,123 @@
-namespace SLChat
-{
- partial class IMTabWindow
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.rtbIMText = new System.Windows.Forms.RichTextBox();
- this.cbxInput = new System.Windows.Forms.ComboBox();
- this.btnSend = new System.Windows.Forms.Button();
- this.btnClose = new System.Windows.Forms.Button();
- this.btnPrintKey = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // rtbIMText
- //
- this.rtbIMText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.rtbIMText.BackColor = System.Drawing.Color.White;
- this.rtbIMText.HideSelection = false;
- this.rtbIMText.Location = new System.Drawing.Point(3, 31);
- this.rtbIMText.Name = "rtbIMText";
- this.rtbIMText.ReadOnly = true;
- this.rtbIMText.Size = new System.Drawing.Size(354, 169);
- this.rtbIMText.TabIndex = 0;
- this.rtbIMText.Text = "";
- this.rtbIMText.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.Link_Clicked);
- //
- // cbxInput
- //
- this.cbxInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.cbxInput.FormattingEnabled = true;
- this.cbxInput.Location = new System.Drawing.Point(3, 208);
- this.cbxInput.Name = "cbxInput";
- this.cbxInput.Size = new System.Drawing.Size(273, 21);
- this.cbxInput.TabIndex = 1;
- this.cbxInput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyUp);
- this.cbxInput.TextChanged += new System.EventHandler(this.cbxInput_TextChanged);
- //
- // btnSend
- //
- this.btnSend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnSend.Enabled = false;
- this.btnSend.Location = new System.Drawing.Point(282, 206);
- this.btnSend.Name = "btnSend";
- this.btnSend.Size = new System.Drawing.Size(75, 23);
- this.btnSend.TabIndex = 2;
- this.btnSend.Text = "Send";
- this.btnSend.UseVisualStyleBackColor = true;
- this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
- //
- // btnClose
- //
- this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btnClose.Location = new System.Drawing.Point(282, 3);
- this.btnClose.Name = "btnClose";
- this.btnClose.Size = new System.Drawing.Size(75, 23);
- this.btnClose.TabIndex = 3;
- this.btnClose.Text = "Close";
- this.btnClose.UseVisualStyleBackColor = true;
- this.btnClose.Visible = false;
- this.btnClose.Click += new System.EventHandler(this.BtnCloseClick);
- //
- // btnPrintKey
- //
- this.btnPrintKey.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btnPrintKey.Location = new System.Drawing.Point(201, 3);
- this.btnPrintKey.Name = "btnPrintKey";
- this.btnPrintKey.Size = new System.Drawing.Size(75, 23);
- this.btnPrintKey.TabIndex = 4;
- this.btnPrintKey.Text = "Print Key";
- this.btnPrintKey.UseVisualStyleBackColor = true;
- this.btnPrintKey.Click += new System.EventHandler(this.BtnPrintKeyClick);
- //
- // IMTabWindow
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.btnPrintKey);
- this.Controls.Add(this.btnClose);
- this.Controls.Add(this.cbxInput);
- this.Controls.Add(this.rtbIMText);
- this.Controls.Add(this.btnSend);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Name = "IMTabWindow";
- this.Size = new System.Drawing.Size(360, 232);
- this.ResumeLayout(false);
- }
- private System.Windows.Forms.Button btnPrintKey;
- private System.Windows.Forms.Button btnClose;
-
- #endregion
-
- private System.Windows.Forms.RichTextBox rtbIMText;
- private System.Windows.Forms.ComboBox cbxInput;
- private System.Windows.Forms.Button btnSend;
- }
-}
+namespace SLChat
+{
+ partial class IMTabWindow
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.rtbIMText = new System.Windows.Forms.RichTextBox();
+ this.cbxInput = new System.Windows.Forms.ComboBox();
+ this.btnSend = new System.Windows.Forms.Button();
+ this.btnClose = new System.Windows.Forms.Button();
+ this.btnPrintKey = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // rtbIMText
+ //
+ this.rtbIMText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.rtbIMText.BackColor = System.Drawing.Color.White;
+ this.rtbIMText.HideSelection = false;
+ this.rtbIMText.Location = new System.Drawing.Point(3, 31);
+ this.rtbIMText.Name = "rtbIMText";
+ this.rtbIMText.ReadOnly = true;
+ this.rtbIMText.Size = new System.Drawing.Size(354, 169);
+ this.rtbIMText.TabIndex = 0;
+ this.rtbIMText.Text = "";
+ this.rtbIMText.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.Link_Clicked);
+ //
+ // cbxInput
+ //
+ this.cbxInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.cbxInput.FormattingEnabled = true;
+ this.cbxInput.Location = new System.Drawing.Point(3, 208);
+ this.cbxInput.Name = "cbxInput";
+ this.cbxInput.Size = new System.Drawing.Size(273, 21);
+ this.cbxInput.TabIndex = 1;
+ this.cbxInput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cbxInput_KeyUp);
+ this.cbxInput.TextChanged += new System.EventHandler(this.cbxInput_TextChanged);
+ //
+ // btnSend
+ //
+ this.btnSend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnSend.Enabled = false;
+ this.btnSend.Location = new System.Drawing.Point(282, 206);
+ this.btnSend.Name = "btnSend";
+ this.btnSend.Size = new System.Drawing.Size(75, 23);
+ this.btnSend.TabIndex = 2;
+ this.btnSend.Text = "Send";
+ this.btnSend.UseVisualStyleBackColor = true;
+ this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
+ //
+ // btnClose
+ //
+ this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnClose.Location = new System.Drawing.Point(282, 3);
+ this.btnClose.Name = "btnClose";
+ this.btnClose.Size = new System.Drawing.Size(75, 23);
+ this.btnClose.TabIndex = 3;
+ this.btnClose.Text = "Close";
+ this.btnClose.UseVisualStyleBackColor = true;
+ this.btnClose.Visible = false;
+ this.btnClose.Click += new System.EventHandler(this.BtnCloseClick);
+ //
+ // btnPrintKey
+ //
+ this.btnPrintKey.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnPrintKey.Location = new System.Drawing.Point(201, 3);
+ this.btnPrintKey.Name = "btnPrintKey";
+ this.btnPrintKey.Size = new System.Drawing.Size(75, 23);
+ this.btnPrintKey.TabIndex = 4;
+ this.btnPrintKey.Text = "Print Key";
+ this.btnPrintKey.UseVisualStyleBackColor = true;
+ this.btnPrintKey.Click += new System.EventHandler(this.BtnPrintKeyClick);
+ //
+ // IMTabWindow
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.btnPrintKey);
+ this.Controls.Add(this.btnClose);
+ this.Controls.Add(this.cbxInput);
+ this.Controls.Add(this.rtbIMText);
+ this.Controls.Add(this.btnSend);
+ this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Name = "IMTabWindow";
+ this.Size = new System.Drawing.Size(360, 232);
+ this.ResumeLayout(false);
+ }
+ private System.Windows.Forms.Button btnPrintKey;
+ private System.Windows.Forms.Button btnClose;
+
+ #endregion
+
+ private System.Windows.Forms.RichTextBox rtbIMText;
+ private System.Windows.Forms.ComboBox cbxInput;
+ private System.Windows.Forms.Button btnSend;
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/IMTabWindow.cs b/applications/SLChat/SLChat/GUI/IMTabWindow.cs
index 4a2f42cb..c43ddbda 100644
--- a/applications/SLChat/SLChat/GUI/IMTabWindow.cs
+++ b/applications/SLChat/SLChat/GUI/IMTabWindow.cs
@@ -1,115 +1,115 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Data;
-using System.Text;
-using System.Windows.Forms;
-using SLNetworkComm;
-using libsecondlife;
-
-namespace SLChat
-{
- public partial class IMTabWindow : UserControl
- {
- private SLNetCom netcom;
- private LLUUID target;
- private LLUUID session;
- private string toName;
- private IMTextManager textManager;
- private PrefsManager prefs;
- public frmMain formMain;
- public frmIMs formIM;
-
- public IMTabWindow(SLNetCom netcom, LLUUID target, LLUUID session, string toName, PrefsManager preferences)
- {
- InitializeComponent();
-
- this.netcom = netcom;
- this.target = target;
- this.session = session;
- this.toName = toName;
- this.prefs = preferences;
-
- textManager = new IMTextManager(new RichTextBoxPrinter(rtbIMText), this.netcom, prefs);
- }
-
- private void btnSend_Click(object sender, EventArgs e)
- {
- netcom.SendInstantMessage(cbxInput.Text, target, session);
- this.ClearIMInput();
- }
-
- private void cbxInput_TextChanged(object sender, EventArgs e)
- {
- btnSend.Enabled = (cbxInput.Text.Length > 0);
- }
-
- private void cbxInput_KeyUp(object sender, KeyEventArgs e)
- {
- if (e.KeyCode != Keys.Enter) return;
- if (cbxInput.Text.Length == 0) return;
-
- netcom.SendInstantMessage(cbxInput.Text, target, session);
- this.ClearIMInput();
- }
-
- private void Link_Clicked (object sender, System.Windows.Forms.LinkClickedEventArgs e)
- {
- System.Diagnostics.Process.Start(e.LinkText);
- }
-
- private void BtnCloseClick(object sender, System.EventArgs e)
- {
- if(formMain!=null)
- {
- formMain.RemoveIMTab(this.toName);
- }
-
- if(formIM!=null)
- {
- formIM.RemoveIMTab(this.toName);
- }
- }
-
- private void BtnPrintKeyClick(object sender, System.EventArgs e)
- {
- string key = target.ToString();
- key = key.Insert(8,"-");
- key = key.Insert(13,"-");
- key = key.Insert(18,"-");
- key = key.Insert(23,"-");
- textManager.PrintProgramMessage("Program: "+ toName + " == " + key);
- }
-
- private void ClearIMInput()
- {
- cbxInput.Items.Add(cbxInput.Text);
- cbxInput.Text = string.Empty;
- }
-
- public LLUUID TargetId
- {
- get { return target; }
- set { target = value; }
- }
-
- public string TargetName
- {
- get { return toName; }
- set { toName = value; }
- }
-
- public LLUUID SessionId
- {
- get { return session; }
- set { session = value; }
- }
-
- public IMTextManager TextManager
- {
- get { return textManager; }
- set { textManager = value; }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using SLNetworkComm;
+using libsecondlife;
+
+namespace SLChat
+{
+ public partial class IMTabWindow : UserControl
+ {
+ private SLNetCom netcom;
+ private LLUUID target;
+ private LLUUID session;
+ private string toName;
+ private IMTextManager textManager;
+ private PrefsManager prefs;
+ public frmMain formMain;
+ public frmIMs formIM;
+
+ public IMTabWindow(SLNetCom netcom, LLUUID target, LLUUID session, string toName, PrefsManager preferences)
+ {
+ InitializeComponent();
+
+ this.netcom = netcom;
+ this.target = target;
+ this.session = session;
+ this.toName = toName;
+ this.prefs = preferences;
+
+ textManager = new IMTextManager(new RichTextBoxPrinter(rtbIMText), this.netcom, prefs);
+ }
+
+ private void btnSend_Click(object sender, EventArgs e)
+ {
+ netcom.SendInstantMessage(cbxInput.Text, target, session);
+ this.ClearIMInput();
+ }
+
+ private void cbxInput_TextChanged(object sender, EventArgs e)
+ {
+ btnSend.Enabled = (cbxInput.Text.Length > 0);
+ }
+
+ private void cbxInput_KeyUp(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode != Keys.Enter) return;
+ if (cbxInput.Text.Length == 0) return;
+
+ netcom.SendInstantMessage(cbxInput.Text, target, session);
+ this.ClearIMInput();
+ }
+
+ private void Link_Clicked (object sender, System.Windows.Forms.LinkClickedEventArgs e)
+ {
+ System.Diagnostics.Process.Start(e.LinkText);
+ }
+
+ private void BtnCloseClick(object sender, System.EventArgs e)
+ {
+ if(formMain!=null)
+ {
+ formMain.RemoveIMTab(this.toName);
+ }
+
+ if(formIM!=null)
+ {
+ formIM.RemoveIMTab(this.toName);
+ }
+ }
+
+ private void BtnPrintKeyClick(object sender, System.EventArgs e)
+ {
+ string key = target.ToString();
+ key = key.Insert(8,"-");
+ key = key.Insert(13,"-");
+ key = key.Insert(18,"-");
+ key = key.Insert(23,"-");
+ textManager.PrintProgramMessage("Program: "+ toName + " == " + key);
+ }
+
+ private void ClearIMInput()
+ {
+ cbxInput.Items.Add(cbxInput.Text);
+ cbxInput.Text = string.Empty;
+ }
+
+ public LLUUID TargetId
+ {
+ get { return target; }
+ set { target = value; }
+ }
+
+ public string TargetName
+ {
+ get { return toName; }
+ set { toName = value; }
+ }
+
+ public LLUUID SessionId
+ {
+ get { return session; }
+ set { session = value; }
+ }
+
+ public IMTextManager TextManager
+ {
+ get { return textManager; }
+ set { textManager = value; }
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/IMTabWindow.resx b/applications/SLChat/SLChat/GUI/IMTabWindow.resx
index 5ea0895e..7080a7d1 100644
--- a/applications/SLChat/SLChat/GUI/IMTabWindow.resx
+++ b/applications/SLChat/SLChat/GUI/IMTabWindow.resx
@@ -1,120 +1,120 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
\ No newline at end of file
diff --git a/applications/SLChat/SLChat/GUI/InstantMessages.Designer.cs b/applications/SLChat/SLChat/GUI/InstantMessages.Designer.cs
index d73353c7..1a0eed35 100644
--- a/applications/SLChat/SLChat/GUI/InstantMessages.Designer.cs
+++ b/applications/SLChat/SLChat/GUI/InstantMessages.Designer.cs
@@ -1,124 +1,124 @@
-namespace SLChat
-{
- partial class frmIMs
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.tabIMs = new System.Windows.Forms.TabControl();
- this.tpgNewIM = new System.Windows.Forms.TabPage();
- this.btnNewIM = new System.Windows.Forms.Button();
- this.lbxFriendsList = new System.Windows.Forms.ListBox();
- this.btnClose = new System.Windows.Forms.Button();
- this.tabIMs.SuspendLayout();
- this.tpgNewIM.SuspendLayout();
- this.SuspendLayout();
- //
- // tabIMs
- //
- this.tabIMs.Controls.Add(this.tpgNewIM);
- this.tabIMs.Dock = System.Windows.Forms.DockStyle.Fill;
- this.tabIMs.Location = new System.Drawing.Point(0, 0);
- this.tabIMs.Name = "tabIMs";
- this.tabIMs.SelectedIndex = 0;
- this.tabIMs.Size = new System.Drawing.Size(364, 266);
- this.tabIMs.TabIndex = 0;
- //
- // tpgNewIM
- //
- this.tpgNewIM.Controls.Add(this.btnClose);
- this.tpgNewIM.Controls.Add(this.btnNewIM);
- this.tpgNewIM.Controls.Add(this.lbxFriendsList);
- this.tpgNewIM.Location = new System.Drawing.Point(4, 22);
- this.tpgNewIM.Name = "tpgNewIM";
- this.tpgNewIM.Padding = new System.Windows.Forms.Padding(3);
- this.tpgNewIM.Size = new System.Drawing.Size(356, 240);
- this.tpgNewIM.TabIndex = 0;
- this.tpgNewIM.Text = "New IM";
- this.tpgNewIM.UseVisualStyleBackColor = true;
- //
- // btnNewIM
- //
- this.btnNewIM.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnNewIM.Location = new System.Drawing.Point(192, 209);
- this.btnNewIM.Name = "btnNewIM";
- this.btnNewIM.Size = new System.Drawing.Size(75, 23);
- this.btnNewIM.TabIndex = 2;
- this.btnNewIM.Text = "New IM";
- this.btnNewIM.UseVisualStyleBackColor = true;
- //
- // lbxFriendsList
- //
- this.lbxFriendsList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.lbxFriendsList.FormattingEnabled = true;
- this.lbxFriendsList.IntegralHeight = false;
- this.lbxFriendsList.Items.AddRange(new object[] {
- "You have no friends, loser. :P"});
- this.lbxFriendsList.Location = new System.Drawing.Point(11, 6);
- this.lbxFriendsList.Name = "lbxFriendsList";
- this.lbxFriendsList.Size = new System.Drawing.Size(337, 197);
- this.lbxFriendsList.TabIndex = 0;
- //
- // btnClose
- //
- this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnClose.Location = new System.Drawing.Point(273, 209);
- this.btnClose.Name = "btnClose";
- this.btnClose.Size = new System.Drawing.Size(75, 23);
- this.btnClose.TabIndex = 3;
- this.btnClose.Text = "Close";
- this.btnClose.UseVisualStyleBackColor = true;
- this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
- //
- // frmIMs
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(364, 266);
- this.Controls.Add(this.tabIMs);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Name = "frmIMs";
- this.ShowIcon = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "SLChat - IMs";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmIMs_FormClosing);
- this.tabIMs.ResumeLayout(false);
- this.tpgNewIM.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.TabControl tabIMs;
- private System.Windows.Forms.TabPage tpgNewIM;
- private System.Windows.Forms.ListBox lbxFriendsList;
- private System.Windows.Forms.Button btnNewIM;
- private System.Windows.Forms.Button btnClose;
- }
-}
+namespace SLChat
+{
+ partial class frmIMs
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.tabIMs = new System.Windows.Forms.TabControl();
+ this.tpgNewIM = new System.Windows.Forms.TabPage();
+ this.btnNewIM = new System.Windows.Forms.Button();
+ this.lbxFriendsList = new System.Windows.Forms.ListBox();
+ this.btnClose = new System.Windows.Forms.Button();
+ this.tabIMs.SuspendLayout();
+ this.tpgNewIM.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // tabIMs
+ //
+ this.tabIMs.Controls.Add(this.tpgNewIM);
+ this.tabIMs.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tabIMs.Location = new System.Drawing.Point(0, 0);
+ this.tabIMs.Name = "tabIMs";
+ this.tabIMs.SelectedIndex = 0;
+ this.tabIMs.Size = new System.Drawing.Size(364, 266);
+ this.tabIMs.TabIndex = 0;
+ //
+ // tpgNewIM
+ //
+ this.tpgNewIM.Controls.Add(this.btnClose);
+ this.tpgNewIM.Controls.Add(this.btnNewIM);
+ this.tpgNewIM.Controls.Add(this.lbxFriendsList);
+ this.tpgNewIM.Location = new System.Drawing.Point(4, 22);
+ this.tpgNewIM.Name = "tpgNewIM";
+ this.tpgNewIM.Padding = new System.Windows.Forms.Padding(3);
+ this.tpgNewIM.Size = new System.Drawing.Size(356, 240);
+ this.tpgNewIM.TabIndex = 0;
+ this.tpgNewIM.Text = "New IM";
+ this.tpgNewIM.UseVisualStyleBackColor = true;
+ //
+ // btnNewIM
+ //
+ this.btnNewIM.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnNewIM.Location = new System.Drawing.Point(192, 209);
+ this.btnNewIM.Name = "btnNewIM";
+ this.btnNewIM.Size = new System.Drawing.Size(75, 23);
+ this.btnNewIM.TabIndex = 2;
+ this.btnNewIM.Text = "New IM";
+ this.btnNewIM.UseVisualStyleBackColor = true;
+ //
+ // lbxFriendsList
+ //
+ this.lbxFriendsList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.lbxFriendsList.FormattingEnabled = true;
+ this.lbxFriendsList.IntegralHeight = false;
+ this.lbxFriendsList.Items.AddRange(new object[] {
+ "You have no friends, loser. :P"});
+ this.lbxFriendsList.Location = new System.Drawing.Point(11, 6);
+ this.lbxFriendsList.Name = "lbxFriendsList";
+ this.lbxFriendsList.Size = new System.Drawing.Size(337, 197);
+ this.lbxFriendsList.TabIndex = 0;
+ //
+ // btnClose
+ //
+ this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnClose.Location = new System.Drawing.Point(273, 209);
+ this.btnClose.Name = "btnClose";
+ this.btnClose.Size = new System.Drawing.Size(75, 23);
+ this.btnClose.TabIndex = 3;
+ this.btnClose.Text = "Close";
+ this.btnClose.UseVisualStyleBackColor = true;
+ this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+ //
+ // frmIMs
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(364, 266);
+ this.Controls.Add(this.tabIMs);
+ this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Name = "frmIMs";
+ this.ShowIcon = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "SLChat - IMs";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmIMs_FormClosing);
+ this.tabIMs.ResumeLayout(false);
+ this.tpgNewIM.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TabControl tabIMs;
+ private System.Windows.Forms.TabPage tpgNewIM;
+ private System.Windows.Forms.ListBox lbxFriendsList;
+ private System.Windows.Forms.Button btnNewIM;
+ private System.Windows.Forms.Button btnClose;
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/InstantMessages.cs b/applications/SLChat/SLChat/GUI/InstantMessages.cs
index 31ec956f..00e8ce7f 100644
--- a/applications/SLChat/SLChat/GUI/InstantMessages.cs
+++ b/applications/SLChat/SLChat/GUI/InstantMessages.cs
@@ -1,88 +1,88 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using SLNetworkComm;
-using libsecondlife;
-
-namespace SLChat
-{
- public partial class frmIMs : Form
- {
- private SLNetCom netcom;
- private Dictionary IMTabs;
- private PrefsManager prefs;
-
- public frmIMs(SLNetCom netcom, PrefsManager preferences)
- {
- InitializeComponent();
-
- this.netcom = netcom;
- IMTabs = new Dictionary();
- prefs = preferences;
-
- this.AddNetcomEvents();
- }
-
- private void AddNetcomEvents()
- {
- netcom.InstantMessageReceived += new EventHandler(netcom_InstantMessageReceived);
- }
-
- private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e)
- {
- if (IMTabs.ContainsKey(e.FromAgentName)) return;
-
- this.AddIMTab(e.FromAgentId, e.Id, e.FromAgentName, e);
- }
-
- public IMTabWindow AddIMTab(LLUUID target, LLUUID session, string targetName)
- {
- TabPage tabpage = new TabPage(targetName);
- IMTabWindow imTab = new IMTabWindow(netcom, target, session, targetName, prefs);
- imTab.Dock = DockStyle.Fill;
- imTab.formIM = this;
-
- tabpage.Controls.Add(imTab);
-
- tabIMs.TabPages.Add(tabpage);
- IMTabs.Add(targetName, imTab);
-
- return imTab;
- }
-
- public IMTabWindow AddIMTab(LLUUID target, LLUUID session, string targetName, InstantMessageEventArgs e)
- {
- IMTabWindow imTab = this.AddIMTab(target, session, targetName);
- imTab.TextManager.PassIMEvent(e);
-
- return imTab;
- }
-
- public void RemoveIMTab(string targetName)
- {
- IMTabWindow imTab = IMTabs[targetName];
- TabPage tabpage = (TabPage)imTab.Parent;
-
- IMTabs.Remove(targetName);
- imTab = null;
-
- tabIMs.TabPages.Remove(tabpage);
- tabpage.Dispose();
- }
-
- private void frmIMs_FormClosing(object sender, FormClosingEventArgs e)
- {
- e.Cancel = true;
- this.Visible = false;
- }
-
- private void btnClose_Click(object sender, EventArgs e)
- {
- this.Visible = false;
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using SLNetworkComm;
+using libsecondlife;
+
+namespace SLChat
+{
+ public partial class frmIMs : Form
+ {
+ private SLNetCom netcom;
+ private Dictionary IMTabs;
+ private PrefsManager prefs;
+
+ public frmIMs(SLNetCom netcom, PrefsManager preferences)
+ {
+ InitializeComponent();
+
+ this.netcom = netcom;
+ IMTabs = new Dictionary();
+ prefs = preferences;
+
+ this.AddNetcomEvents();
+ }
+
+ private void AddNetcomEvents()
+ {
+ netcom.InstantMessageReceived += new EventHandler(netcom_InstantMessageReceived);
+ }
+
+ private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e)
+ {
+ if (IMTabs.ContainsKey(e.FromAgentName)) return;
+
+ this.AddIMTab(e.FromAgentId, e.Id, e.FromAgentName, e);
+ }
+
+ public IMTabWindow AddIMTab(LLUUID target, LLUUID session, string targetName)
+ {
+ TabPage tabpage = new TabPage(targetName);
+ IMTabWindow imTab = new IMTabWindow(netcom, target, session, targetName, prefs);
+ imTab.Dock = DockStyle.Fill;
+ imTab.formIM = this;
+
+ tabpage.Controls.Add(imTab);
+
+ tabIMs.TabPages.Add(tabpage);
+ IMTabs.Add(targetName, imTab);
+
+ return imTab;
+ }
+
+ public IMTabWindow AddIMTab(LLUUID target, LLUUID session, string targetName, InstantMessageEventArgs e)
+ {
+ IMTabWindow imTab = this.AddIMTab(target, session, targetName);
+ imTab.TextManager.PassIMEvent(e);
+
+ return imTab;
+ }
+
+ public void RemoveIMTab(string targetName)
+ {
+ IMTabWindow imTab = IMTabs[targetName];
+ TabPage tabpage = (TabPage)imTab.Parent;
+
+ IMTabs.Remove(targetName);
+ imTab = null;
+
+ tabIMs.TabPages.Remove(tabpage);
+ tabpage.Dispose();
+ }
+
+ private void frmIMs_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ e.Cancel = true;
+ this.Visible = false;
+ }
+
+ private void btnClose_Click(object sender, EventArgs e)
+ {
+ this.Visible = false;
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/InstantMessages.resx b/applications/SLChat/SLChat/GUI/InstantMessages.resx
index ff31a6db..19dc0dd8 100644
--- a/applications/SLChat/SLChat/GUI/InstantMessages.resx
+++ b/applications/SLChat/SLChat/GUI/InstantMessages.resx
@@ -1,120 +1,120 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
\ No newline at end of file
diff --git a/applications/SLChat/SLChat/GUI/Login.Designer.cs b/applications/SLChat/SLChat/GUI/Login.Designer.cs
index 150689ac..b5c17bfe 100644
--- a/applications/SLChat/SLChat/GUI/Login.Designer.cs
+++ b/applications/SLChat/SLChat/GUI/Login.Designer.cs
@@ -1,210 +1,210 @@
-namespace SLChat
-{
- partial class frmLogin
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.label1 = new System.Windows.Forms.Label();
- this.txtFirstName = new System.Windows.Forms.TextBox();
- this.txtLastName = new System.Windows.Forms.TextBox();
- this.label2 = new System.Windows.Forms.Label();
- this.txtPassword = new System.Windows.Forms.TextBox();
- this.label3 = new System.Windows.Forms.Label();
- this.cbxLocation = new System.Windows.Forms.ComboBox();
- this.btnCancel = new System.Windows.Forms.Button();
- this.btnLogin = new System.Windows.Forms.Button();
- this.rtbStatus = new System.Windows.Forms.RichTextBox();
- this.chkSaveLogin = new System.Windows.Forms.CheckBox();
- this.cbxProfiles = new System.Windows.Forms.ComboBox();
- this.lblProfiles = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(11, 46);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(96, 13);
- this.label1.TabIndex = 0;
- this.label1.Text = "First && Last Names";
- //
- // txtFirstName
- //
- this.txtFirstName.Location = new System.Drawing.Point(11, 62);
- this.txtFirstName.Name = "txtFirstName";
- this.txtFirstName.Size = new System.Drawing.Size(130, 21);
- this.txtFirstName.TabIndex = 1;
- //
- // txtLastName
- //
- this.txtLastName.Location = new System.Drawing.Point(147, 62);
- this.txtLastName.Name = "txtLastName";
- this.txtLastName.Size = new System.Drawing.Size(130, 21);
- this.txtLastName.TabIndex = 2;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(11, 86);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(53, 13);
- this.label2.TabIndex = 3;
- this.label2.Text = "Password";
- //
- // txtPassword
- //
- this.txtPassword.Location = new System.Drawing.Point(11, 103);
- this.txtPassword.Name = "txtPassword";
- this.txtPassword.Size = new System.Drawing.Size(130, 21);
- this.txtPassword.TabIndex = 4;
- this.txtPassword.UseSystemPasswordChar = true;
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(147, 86);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(47, 13);
- this.label3.TabIndex = 5;
- this.label3.Text = "Location";
- //
- // cbxLocation
- //
- this.cbxLocation.FormattingEnabled = true;
- this.cbxLocation.Items.AddRange(new object[] {
- "Home",
- "Last"});
- this.cbxLocation.Location = new System.Drawing.Point(147, 103);
- this.cbxLocation.Name = "cbxLocation";
- this.cbxLocation.Size = new System.Drawing.Size(130, 21);
- this.cbxLocation.TabIndex = 6;
- //
- // btnCancel
- //
- this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.btnCancel.Location = new System.Drawing.Point(202, 130);
- this.btnCancel.Name = "btnCancel";
- this.btnCancel.Size = new System.Drawing.Size(75, 23);
- this.btnCancel.TabIndex = 7;
- this.btnCancel.Text = "Cancel";
- this.btnCancel.UseVisualStyleBackColor = true;
- this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
- //
- // btnLogin
- //
- this.btnLogin.Location = new System.Drawing.Point(119, 130);
- this.btnLogin.Name = "btnLogin";
- this.btnLogin.Size = new System.Drawing.Size(75, 23);
- this.btnLogin.TabIndex = 8;
- this.btnLogin.Text = "Login";
- this.btnLogin.UseVisualStyleBackColor = true;
- this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
- //
- // rtbStatus
- //
- this.rtbStatus.Location = new System.Drawing.Point(11, 168);
- this.rtbStatus.Name = "rtbStatus";
- this.rtbStatus.ReadOnly = true;
- this.rtbStatus.Size = new System.Drawing.Size(266, 42);
- this.rtbStatus.TabIndex = 9;
- this.rtbStatus.Text = "Status: Ready";
- //
- // chkSaveLogin
- //
- this.chkSaveLogin.Location = new System.Drawing.Point(11, 130);
- this.chkSaveLogin.Name = "chkSaveLogin";
- this.chkSaveLogin.Size = new System.Drawing.Size(102, 25);
- this.chkSaveLogin.TabIndex = 10;
- this.chkSaveLogin.Text = "Save Login Info";
- this.chkSaveLogin.UseVisualStyleBackColor = true;
- //
- // cbxProfiles
- //
- this.cbxProfiles.FormattingEnabled = true;
- this.cbxProfiles.Location = new System.Drawing.Point(11, 22);
- this.cbxProfiles.Name = "cbxProfiles";
- this.cbxProfiles.Size = new System.Drawing.Size(182, 21);
- this.cbxProfiles.TabIndex = 12;
- this.cbxProfiles.SelectedIndexChanged += new System.EventHandler(this.CbxProfilesSelectedIndexChanged);
- //
- // lblProfiles
- //
- this.lblProfiles.Location = new System.Drawing.Point(11, 6);
- this.lblProfiles.Name = "lblProfiles";
- this.lblProfiles.Size = new System.Drawing.Size(67, 13);
- this.lblProfiles.TabIndex = 13;
- this.lblProfiles.Text = "Profiles";
- //
- // frmLogin
- //
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmLogin_Closing);
- this.AcceptButton = this.btnLogin;
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.CancelButton = this.btnCancel;
- this.ClientSize = new System.Drawing.Size(294, 222);
- this.Controls.Add(this.lblProfiles);
- this.Controls.Add(this.cbxProfiles);
- this.Controls.Add(this.chkSaveLogin);
- this.Controls.Add(this.rtbStatus);
- this.Controls.Add(this.btnLogin);
- this.Controls.Add(this.btnCancel);
- this.Controls.Add(this.cbxLocation);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.txtPassword);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.txtLastName);
- this.Controls.Add(this.txtFirstName);
- this.Controls.Add(this.label1);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.Name = "frmLogin";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "Login";
- this.Shown += new System.EventHandler(this.frmLogin_Shown);
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- private System.Windows.Forms.Label lblProfiles;
- private System.Windows.Forms.ComboBox cbxProfiles;
- private System.Windows.Forms.CheckBox chkSaveLogin;
- private System.Windows.Forms.RichTextBox rtbStatus;
-
- #endregion
-
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.TextBox txtFirstName;
- private System.Windows.Forms.TextBox txtLastName;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.TextBox txtPassword;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.ComboBox cbxLocation;
- private System.Windows.Forms.Button btnCancel;
- private System.Windows.Forms.Button btnLogin;
- }
-}
+namespace SLChat
+{
+ partial class frmLogin
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtFirstName = new System.Windows.Forms.TextBox();
+ this.txtLastName = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this.txtPassword = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.cbxLocation = new System.Windows.Forms.ComboBox();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.btnLogin = new System.Windows.Forms.Button();
+ this.rtbStatus = new System.Windows.Forms.RichTextBox();
+ this.chkSaveLogin = new System.Windows.Forms.CheckBox();
+ this.cbxProfiles = new System.Windows.Forms.ComboBox();
+ this.lblProfiles = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(11, 46);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(96, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "First && Last Names";
+ //
+ // txtFirstName
+ //
+ this.txtFirstName.Location = new System.Drawing.Point(11, 62);
+ this.txtFirstName.Name = "txtFirstName";
+ this.txtFirstName.Size = new System.Drawing.Size(130, 21);
+ this.txtFirstName.TabIndex = 1;
+ //
+ // txtLastName
+ //
+ this.txtLastName.Location = new System.Drawing.Point(147, 62);
+ this.txtLastName.Name = "txtLastName";
+ this.txtLastName.Size = new System.Drawing.Size(130, 21);
+ this.txtLastName.TabIndex = 2;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(11, 86);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(53, 13);
+ this.label2.TabIndex = 3;
+ this.label2.Text = "Password";
+ //
+ // txtPassword
+ //
+ this.txtPassword.Location = new System.Drawing.Point(11, 103);
+ this.txtPassword.Name = "txtPassword";
+ this.txtPassword.Size = new System.Drawing.Size(130, 21);
+ this.txtPassword.TabIndex = 4;
+ this.txtPassword.UseSystemPasswordChar = true;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(147, 86);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(47, 13);
+ this.label3.TabIndex = 5;
+ this.label3.Text = "Location";
+ //
+ // cbxLocation
+ //
+ this.cbxLocation.FormattingEnabled = true;
+ this.cbxLocation.Items.AddRange(new object[] {
+ "Home",
+ "Last"});
+ this.cbxLocation.Location = new System.Drawing.Point(147, 103);
+ this.cbxLocation.Name = "cbxLocation";
+ this.cbxLocation.Size = new System.Drawing.Size(130, 21);
+ this.cbxLocation.TabIndex = 6;
+ //
+ // btnCancel
+ //
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.Location = new System.Drawing.Point(202, 130);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(75, 23);
+ this.btnCancel.TabIndex = 7;
+ this.btnCancel.Text = "Cancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+ //
+ // btnLogin
+ //
+ this.btnLogin.Location = new System.Drawing.Point(119, 130);
+ this.btnLogin.Name = "btnLogin";
+ this.btnLogin.Size = new System.Drawing.Size(75, 23);
+ this.btnLogin.TabIndex = 8;
+ this.btnLogin.Text = "Login";
+ this.btnLogin.UseVisualStyleBackColor = true;
+ this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
+ //
+ // rtbStatus
+ //
+ this.rtbStatus.Location = new System.Drawing.Point(11, 168);
+ this.rtbStatus.Name = "rtbStatus";
+ this.rtbStatus.ReadOnly = true;
+ this.rtbStatus.Size = new System.Drawing.Size(266, 42);
+ this.rtbStatus.TabIndex = 9;
+ this.rtbStatus.Text = "Status: Ready";
+ //
+ // chkSaveLogin
+ //
+ this.chkSaveLogin.Location = new System.Drawing.Point(11, 130);
+ this.chkSaveLogin.Name = "chkSaveLogin";
+ this.chkSaveLogin.Size = new System.Drawing.Size(102, 25);
+ this.chkSaveLogin.TabIndex = 10;
+ this.chkSaveLogin.Text = "Save Login Info";
+ this.chkSaveLogin.UseVisualStyleBackColor = true;
+ //
+ // cbxProfiles
+ //
+ this.cbxProfiles.FormattingEnabled = true;
+ this.cbxProfiles.Location = new System.Drawing.Point(11, 22);
+ this.cbxProfiles.Name = "cbxProfiles";
+ this.cbxProfiles.Size = new System.Drawing.Size(182, 21);
+ this.cbxProfiles.TabIndex = 12;
+ this.cbxProfiles.SelectedIndexChanged += new System.EventHandler(this.CbxProfilesSelectedIndexChanged);
+ //
+ // lblProfiles
+ //
+ this.lblProfiles.Location = new System.Drawing.Point(11, 6);
+ this.lblProfiles.Name = "lblProfiles";
+ this.lblProfiles.Size = new System.Drawing.Size(67, 13);
+ this.lblProfiles.TabIndex = 13;
+ this.lblProfiles.Text = "Profiles";
+ //
+ // frmLogin
+ //
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmLogin_Closing);
+ this.AcceptButton = this.btnLogin;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.btnCancel;
+ this.ClientSize = new System.Drawing.Size(294, 222);
+ this.Controls.Add(this.lblProfiles);
+ this.Controls.Add(this.cbxProfiles);
+ this.Controls.Add(this.chkSaveLogin);
+ this.Controls.Add(this.rtbStatus);
+ this.Controls.Add(this.btnLogin);
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.cbxLocation);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.txtPassword);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.txtLastName);
+ this.Controls.Add(this.txtFirstName);
+ this.Controls.Add(this.label1);
+ this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+ this.MaximizeBox = false;
+ this.Name = "frmLogin";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Login";
+ this.Shown += new System.EventHandler(this.frmLogin_Shown);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+ }
+ private System.Windows.Forms.Label lblProfiles;
+ private System.Windows.Forms.ComboBox cbxProfiles;
+ private System.Windows.Forms.CheckBox chkSaveLogin;
+ private System.Windows.Forms.RichTextBox rtbStatus;
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtFirstName;
+ private System.Windows.Forms.TextBox txtLastName;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox txtPassword;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.ComboBox cbxLocation;
+ private System.Windows.Forms.Button btnCancel;
+ private System.Windows.Forms.Button btnLogin;
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/Login.cs b/applications/SLChat/SLChat/GUI/Login.cs
index 21f3c9d5..400e3f7e 100644
--- a/applications/SLChat/SLChat/GUI/Login.cs
+++ b/applications/SLChat/SLChat/GUI/Login.cs
@@ -1,210 +1,210 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using SLNetworkComm;
-using libsecondlife;
-
-namespace SLChat
-{
- public partial class frmLogin : Form
- {
- private bool mainCreated; //Checks if we've created a mainform
- public frmMain MainForm; //main form tossing back and forth
- private SLNetCom netcom; //Network communication
- public PrefsManager prefs; //Our preferences manger.
- //These are used for our settings loading/saving
- //to see if we have changed our settings since they were last loaded
- private string setFirstName;
- private string setLastName;
- private string setLLocation; //Login Location
- private bool setSaveLogin; //Save Login check box
- private Hashtable settings = new Hashtable(); //Hashtable for our loaded settings.
-
- public frmLogin()
- {
- InitializeComponent();
-
- //Try to load the login settings.
- prefs = new PrefsManager();
- prefs.LoadProfiles();
- //Load the profiles to our combobox.
- string[] profiles = new string[100];
- profiles = prefs.profiles;
- for(int i=0;i(netcom_ClientLoggedIn);
- netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut);
- netcom.ClientLoginError += new EventHandler(netcom_ClientLoginError);
- }
-
- private void netcom_ClientLoginError(object sender, ClientLoginEventArgs e)
- {
- rtbStatus.Text = e.LoginReply;
- btnLogin.Enabled = true;
- }
-
- private void netcom_ClientLoggedIn(object sender, ClientLoginEventArgs e)
- {
- //Check if we've already created the chatscreen
- //and react approprietly.
- if(!mainCreated){
- //create the chat screen and send ourselves
- //so the chatscreen can reference us easily.
- MainForm.Show();
- mainCreated = true;
- MainForm.loginVisible = false;
- this.Hide();
- }else{
- MainForm.Focus();
- this.Hide();
- }
- }
-
- private void netcom_ClientLoggedOut(object sender, ClientLoginEventArgs e)
- {
- btnLogin.Enabled = true;
- }
-
- private void btnCancel_Click(object sender, EventArgs e)
- {
- if(mainCreated)
- {
- MainForm.loginVisible = false;
- this.Hide();
- }else{
- this.Close();
- }
- }
-
- private void btnLogin_Click(object sender, EventArgs e)
- {
- //Save our settings on the following conditions:
- //The user has checked the appropriet checkbox
- //The content has changed from last being loaded.
- if(chkSaveLogin.Checked != false)
- {
- //If the checkbox is checked
- if(chkSaveLogin.Checked != setSaveLogin | txtFirstName.Text != setFirstName | txtLastName.Text != setLastName | cbxLocation.Text != setLLocation)
- {
- //If there have been any changes from when
- //the settings were last loaded.
- //Setting up our child node settings.
- string strSettings = ""+
- ""+
- ""+
- "";
- //Sending off the settings to be saved.
- prefs.SaveSettings(txtFirstName.Text+"_"+txtLastName.Text,"LoginSettings",strSettings);
- //Clean up the combo box that lists profiles.
- if(cbxProfiles.Items.Contains("No profiles found."))
- {
- cbxProfiles.Items.Remove("No profiles found.");
- }
- cbxProfiles.Items.Add(txtFirstName.Text+"_"+txtLastName.Text);
- cbxProfiles.SelectedItem = txtFirstName.Text+"_"+txtLastName.Text;
- }
- }else{
- //If unchecked, delete the login settings
- //no point in having unused information remain.
- prefs.DeleteSettings(cbxProfiles.Text,"LoginSettings");
- }
-
- btnLogin.Enabled = false;
-
- rtbStatus.Text = "Logging in...";
- Application.DoEvents();
-
- netcom.LoginOptions.FirstName = txtFirstName.Text;
- netcom.LoginOptions.LastName = txtLastName.Text;
- netcom.LoginOptions.Password = txtPassword.Text;
- netcom.LoginOptions.StartLocation = cbxLocation.Text;
- netcom.Login();
- }
-
- public void CloseApp()
- {
- this.Dispose();
- }
-
- private void frmLogin_Closing(object sender, FormClosingEventArgs e)
- {
- if(mainCreated==true)
- {
- if(MainForm.Visible==true)
- {
- MainForm.loginVisible = false;
- e.Cancel = true;
- this.Hide();
- }else{
- this.Dispose();
- }
- }else{
- this.Dispose();
- }
- }
-
- private void CbxProfilesSelectedIndexChanged(object sender, System.EventArgs e)
- {
-
- //Load login settings based on what profile is selected
- prefs.LoadSettings(cbxProfiles.Text,"LoginSettings");
-
- settings = prefs.settings;
-
- if(!settings.ContainsKey("Error"))
- {
- IDictionaryEnumerator myEnum = settings.GetEnumerator();
- while (myEnum.MoveNext())
- {
- if(myEnum.Key.ToString()=="SaveLoginInfo")
- {
- chkSaveLogin.Checked = setSaveLogin = true;
- }else if(myEnum.Key.ToString()=="FirstName"){
- txtFirstName.Text = setFirstName = myEnum.Value.ToString();
- }else if(myEnum.Key.ToString()=="LastName"){
- txtLastName.Text = setLastName = myEnum.Value.ToString();
- }else if(myEnum.Key.ToString()=="LoginLocation"){
- cbxLocation.Text = setLLocation = myEnum.Value.ToString();
- }
- }
- }else{
- IDictionaryEnumerator myEnum = settings.GetEnumerator();
- while (myEnum.MoveNext())
- {
- if(myEnum.Key.ToString()=="Error")
- {
- rtbStatus.Text = "Error loading settings: "+myEnum.Value.ToString();
- }
- }
- }
- settings.Clear();
- prefs.settings.Clear();
- }
- }
-}
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using SLNetworkComm;
+using libsecondlife;
+
+namespace SLChat
+{
+ public partial class frmLogin : Form
+ {
+ private bool mainCreated; //Checks if we've created a mainform
+ public frmMain MainForm; //main form tossing back and forth
+ private SLNetCom netcom; //Network communication
+ public PrefsManager prefs; //Our preferences manger.
+ //These are used for our settings loading/saving
+ //to see if we have changed our settings since they were last loaded
+ private string setFirstName;
+ private string setLastName;
+ private string setLLocation; //Login Location
+ private bool setSaveLogin; //Save Login check box
+ private Hashtable settings = new Hashtable(); //Hashtable for our loaded settings.
+
+ public frmLogin()
+ {
+ InitializeComponent();
+
+ //Try to load the login settings.
+ prefs = new PrefsManager();
+ prefs.LoadProfiles();
+ //Load the profiles to our combobox.
+ string[] profiles = new string[100];
+ profiles = prefs.profiles;
+ for(int i=0;i(netcom_ClientLoggedIn);
+ netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut);
+ netcom.ClientLoginError += new EventHandler(netcom_ClientLoginError);
+ }
+
+ private void netcom_ClientLoginError(object sender, ClientLoginEventArgs e)
+ {
+ rtbStatus.Text = e.LoginReply;
+ btnLogin.Enabled = true;
+ }
+
+ private void netcom_ClientLoggedIn(object sender, ClientLoginEventArgs e)
+ {
+ //Check if we've already created the chatscreen
+ //and react approprietly.
+ if(!mainCreated){
+ //create the chat screen and send ourselves
+ //so the chatscreen can reference us easily.
+ MainForm.Show();
+ mainCreated = true;
+ MainForm.loginVisible = false;
+ this.Hide();
+ }else{
+ MainForm.Focus();
+ this.Hide();
+ }
+ }
+
+ private void netcom_ClientLoggedOut(object sender, ClientLoginEventArgs e)
+ {
+ btnLogin.Enabled = true;
+ }
+
+ private void btnCancel_Click(object sender, EventArgs e)
+ {
+ if(mainCreated)
+ {
+ MainForm.loginVisible = false;
+ this.Hide();
+ }else{
+ this.Close();
+ }
+ }
+
+ private void btnLogin_Click(object sender, EventArgs e)
+ {
+ //Save our settings on the following conditions:
+ //The user has checked the appropriet checkbox
+ //The content has changed from last being loaded.
+ if(chkSaveLogin.Checked != false)
+ {
+ //If the checkbox is checked
+ if(chkSaveLogin.Checked != setSaveLogin | txtFirstName.Text != setFirstName | txtLastName.Text != setLastName | cbxLocation.Text != setLLocation)
+ {
+ //If there have been any changes from when
+ //the settings were last loaded.
+ //Setting up our child node settings.
+ string strSettings = ""+
+ ""+
+ ""+
+ "";
+ //Sending off the settings to be saved.
+ prefs.SaveSettings(txtFirstName.Text+"_"+txtLastName.Text,"LoginSettings",strSettings);
+ //Clean up the combo box that lists profiles.
+ if(cbxProfiles.Items.Contains("No profiles found."))
+ {
+ cbxProfiles.Items.Remove("No profiles found.");
+ }
+ cbxProfiles.Items.Add(txtFirstName.Text+"_"+txtLastName.Text);
+ cbxProfiles.SelectedItem = txtFirstName.Text+"_"+txtLastName.Text;
+ }
+ }else{
+ //If unchecked, delete the login settings
+ //no point in having unused information remain.
+ prefs.DeleteSettings(cbxProfiles.Text,"LoginSettings");
+ }
+
+ btnLogin.Enabled = false;
+
+ rtbStatus.Text = "Logging in...";
+ Application.DoEvents();
+
+ netcom.LoginOptions.FirstName = txtFirstName.Text;
+ netcom.LoginOptions.LastName = txtLastName.Text;
+ netcom.LoginOptions.Password = txtPassword.Text;
+ netcom.LoginOptions.StartLocation = cbxLocation.Text;
+ netcom.Login();
+ }
+
+ public void CloseApp()
+ {
+ this.Dispose();
+ }
+
+ private void frmLogin_Closing(object sender, FormClosingEventArgs e)
+ {
+ if(mainCreated==true)
+ {
+ if(MainForm.Visible==true)
+ {
+ MainForm.loginVisible = false;
+ e.Cancel = true;
+ this.Hide();
+ }else{
+ this.Dispose();
+ }
+ }else{
+ this.Dispose();
+ }
+ }
+
+ private void CbxProfilesSelectedIndexChanged(object sender, System.EventArgs e)
+ {
+
+ //Load login settings based on what profile is selected
+ prefs.LoadSettings(cbxProfiles.Text,"LoginSettings");
+
+ settings = prefs.settings;
+
+ if(!settings.ContainsKey("Error"))
+ {
+ IDictionaryEnumerator myEnum = settings.GetEnumerator();
+ while (myEnum.MoveNext())
+ {
+ if(myEnum.Key.ToString()=="SaveLoginInfo")
+ {
+ chkSaveLogin.Checked = setSaveLogin = true;
+ }else if(myEnum.Key.ToString()=="FirstName"){
+ txtFirstName.Text = setFirstName = myEnum.Value.ToString();
+ }else if(myEnum.Key.ToString()=="LastName"){
+ txtLastName.Text = setLastName = myEnum.Value.ToString();
+ }else if(myEnum.Key.ToString()=="LoginLocation"){
+ cbxLocation.Text = setLLocation = myEnum.Value.ToString();
+ }
+ }
+ }else{
+ IDictionaryEnumerator myEnum = settings.GetEnumerator();
+ while (myEnum.MoveNext())
+ {
+ if(myEnum.Key.ToString()=="Error")
+ {
+ rtbStatus.Text = "Error loading settings: "+myEnum.Value.ToString();
+ }
+ }
+ }
+ settings.Clear();
+ prefs.settings.Clear();
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/Login.resx b/applications/SLChat/SLChat/GUI/Login.resx
index 5ea0895e..7080a7d1 100644
--- a/applications/SLChat/SLChat/GUI/Login.resx
+++ b/applications/SLChat/SLChat/GUI/Login.resx
@@ -1,120 +1,120 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
\ No newline at end of file
diff --git a/applications/SLChat/SLChat/GUI/MainForm.Designer.cs b/applications/SLChat/SLChat/GUI/MainForm.Designer.cs
index d744e6c1..a0a6a738 100644
--- a/applications/SLChat/SLChat/GUI/MainForm.Designer.cs
+++ b/applications/SLChat/SLChat/GUI/MainForm.Designer.cs
@@ -1,463 +1,463 @@
-namespace SLChat
-{
- partial class frmMain
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
- this.menuStrip1 = new System.Windows.Forms.MenuStrip();
- this.mnuFile = new System.Windows.Forms.ToolStripMenuItem();
- this.mnuLoginout = new System.Windows.Forms.ToolStripMenuItem();
- this.mnuFileSep = new System.Windows.Forms.ToolStripSeparator();
- this.mnuFileExit = new System.Windows.Forms.ToolStripMenuItem();
- this.mnuEdit = new System.Windows.Forms.ToolStripMenuItem();
- this.mnuEditPrefs = new System.Windows.Forms.ToolStripMenuItem();
- this.mnuView = new System.Windows.Forms.ToolStripMenuItem();
- this.mnuViewFriends = new System.Windows.Forms.ToolStripMenuItem();
- this.mnuViewIMs = new System.Windows.Forms.ToolStripMenuItem();
- this.mnuViewInventory = new System.Windows.Forms.ToolStripMenuItem();
- this.mnuHelp = new System.Windows.Forms.ToolStripMenuItem();
- this.mnuHelpAbout = new System.Windows.Forms.ToolStripMenuItem();
- this.rtbChat = new System.Windows.Forms.RichTextBox();
- this.lbxUsers = new System.Windows.Forms.ListBox();
- this.cnxListNames = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.mnuKey = new System.Windows.Forms.ToolStripMenuItem();
- this.tolSeperator = new System.Windows.Forms.ToolStripSeparator();
- this.mnuRemove = new System.Windows.Forms.ToolStripMenuItem();
- this.pnlInput = new System.Windows.Forms.Panel();
- this.cbxChatType = new System.Windows.Forms.ComboBox();
- this.txtInput = new System.Windows.Forms.TextBox();
- this.btnSend = new System.Windows.Forms.Button();
- this.toolStrip1 = new System.Windows.Forms.ToolStrip();
- this.tbtnIM = new System.Windows.Forms.ToolStripButton();
- this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
- this.tbtnFriends = new System.Windows.Forms.ToolStripButton();
- this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
- this.tbtnInventory = new System.Windows.Forms.ToolStripButton();
- this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
- this.sptChat = new System.Windows.Forms.SplitContainer();
- this.tabIMs = new System.Windows.Forms.TabControl();
- this.tabLocalChat = new System.Windows.Forms.TabPage();
- this.menuStrip1.SuspendLayout();
- this.cnxListNames.SuspendLayout();
- this.pnlInput.SuspendLayout();
- this.toolStrip1.SuspendLayout();
- this.sptChat.Panel1.SuspendLayout();
- this.sptChat.Panel2.SuspendLayout();
- this.sptChat.SuspendLayout();
- this.tabIMs.SuspendLayout();
- this.tabLocalChat.SuspendLayout();
- this.SuspendLayout();
- //
- // menuStrip1
- //
- this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnuFile,
- this.mnuEdit,
- this.mnuView,
- this.mnuHelp});
- this.menuStrip1.Location = new System.Drawing.Point(0, 0);
- this.menuStrip1.Name = "menuStrip1";
- this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
- this.menuStrip1.Size = new System.Drawing.Size(540, 24);
- this.menuStrip1.TabIndex = 6;
- this.menuStrip1.Text = "menuStrip1";
- //
- // mnuFile
- //
- this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnuLoginout,
- this.mnuFileSep,
- this.mnuFileExit});
- this.mnuFile.Name = "mnuFile";
- this.mnuFile.Size = new System.Drawing.Size(35, 20);
- this.mnuFile.Text = "&File";
- //
- // mnuLoginout
- //
- this.mnuLoginout.Name = "mnuLoginout";
- this.mnuLoginout.Size = new System.Drawing.Size(111, 22);
- this.mnuLoginout.Text = "&Login...";
- this.mnuLoginout.Click += new System.EventHandler(this.mnuLoginout_Click);
- //
- // mnuFileSep
- //
- this.mnuFileSep.Name = "mnuFileSep";
- this.mnuFileSep.Size = new System.Drawing.Size(108, 6);
- //
- // mnuFileExit
- //
- this.mnuFileExit.Name = "mnuFileExit";
- this.mnuFileExit.Size = new System.Drawing.Size(111, 22);
- this.mnuFileExit.Text = "E&xit";
- this.mnuFileExit.Click += new System.EventHandler(this.mnuFileExit_Click);
- //
- // mnuEdit
- //
- this.mnuEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnuEditPrefs});
- this.mnuEdit.Name = "mnuEdit";
- this.mnuEdit.Size = new System.Drawing.Size(37, 20);
- this.mnuEdit.Text = "&Edit";
- //
- // mnuEditPrefs
- //
- this.mnuEditPrefs.Name = "mnuEditPrefs";
- this.mnuEditPrefs.Size = new System.Drawing.Size(144, 22);
- this.mnuEditPrefs.Text = "&Preferences...";
- this.mnuEditPrefs.Click += new System.EventHandler(this.MnuEditPrefsClick);
- //
- // mnuView
- //
- this.mnuView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnuViewFriends,
- this.mnuViewIMs,
- this.mnuViewInventory});
- this.mnuView.Name = "mnuView";
- this.mnuView.Size = new System.Drawing.Size(41, 20);
- this.mnuView.Text = "&View";
- //
- // mnuViewFriends
- //
- this.mnuViewFriends.CheckOnClick = true;
- this.mnuViewFriends.Name = "mnuViewFriends";
- this.mnuViewFriends.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
- | System.Windows.Forms.Keys.F)));
- this.mnuViewFriends.Size = new System.Drawing.Size(197, 22);
- this.mnuViewFriends.Text = "&Friends";
- //
- // mnuViewIMs
- //
- this.mnuViewIMs.CheckOnClick = true;
- this.mnuViewIMs.Name = "mnuViewIMs";
- this.mnuViewIMs.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
- this.mnuViewIMs.Size = new System.Drawing.Size(197, 22);
- this.mnuViewIMs.Text = "&Instant Messages";
- this.mnuViewIMs.Click += new System.EventHandler(this.mnuViewIMs_Click);
- //
- // mnuViewInventory
- //
- this.mnuViewInventory.CheckOnClick = true;
- this.mnuViewInventory.Name = "mnuViewInventory";
- this.mnuViewInventory.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
- this.mnuViewInventory.Size = new System.Drawing.Size(197, 22);
- this.mnuViewInventory.Text = "I&nventory";
- //
- // mnuHelp
- //
- this.mnuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnuHelpAbout});
- this.mnuHelp.Name = "mnuHelp";
- this.mnuHelp.Size = new System.Drawing.Size(40, 20);
- this.mnuHelp.Text = "&Help";
- //
- // mnuHelpAbout
- //
- this.mnuHelpAbout.Name = "mnuHelpAbout";
- this.mnuHelpAbout.Size = new System.Drawing.Size(115, 22);
- this.mnuHelpAbout.Text = "&About...";
- this.mnuHelpAbout.Click += new System.EventHandler(this.mnuHelpAbout_Click);
- //
- // rtbChat
- //
- this.rtbChat.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.rtbChat.BackColor = System.Drawing.Color.White;
- this.rtbChat.HideSelection = false;
- this.rtbChat.Location = new System.Drawing.Point(0, 0);
- this.rtbChat.Name = "rtbChat";
- this.rtbChat.ReadOnly = true;
- this.rtbChat.ShowSelectionMargin = true;
- this.rtbChat.Size = new System.Drawing.Size(394, 298);
- this.rtbChat.TabIndex = 4;
- this.rtbChat.Text = "";
- this.rtbChat.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.Link_Clicked);
- //
- // lbxUsers
- //
- this.lbxUsers.ContextMenuStrip = this.cnxListNames;
- this.lbxUsers.Dock = System.Windows.Forms.DockStyle.Fill;
- this.lbxUsers.FormattingEnabled = true;
- this.lbxUsers.IntegralHeight = false;
- this.lbxUsers.Location = new System.Drawing.Point(0, 0);
- this.lbxUsers.Name = "lbxUsers";
- this.lbxUsers.Size = new System.Drawing.Size(128, 298);
- this.lbxUsers.TabIndex = 3;
- //
- // cnxListNames
- //
- this.cnxListNames.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.mnuKey,
- this.tolSeperator,
- this.mnuRemove});
- this.cnxListNames.Name = "cnxListNames";
- this.cnxListNames.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
- this.cnxListNames.Size = new System.Drawing.Size(154, 54);
- //
- // mnuKey
- //
- this.mnuKey.Name = "mnuKey";
- this.mnuKey.Size = new System.Drawing.Size(153, 22);
- this.mnuKey.Text = "Print Key (UUID)";
- this.mnuKey.Click += new System.EventHandler(this.MnuKeyClick);
- //
- // tolSeperator
- //
- this.tolSeperator.Name = "tolSeperator";
- this.tolSeperator.Size = new System.Drawing.Size(150, 6);
- //
- // mnuRemove
- //
- this.mnuRemove.Name = "mnuRemove";
- this.mnuRemove.Size = new System.Drawing.Size(153, 22);
- this.mnuRemove.Text = "Remove";
- this.mnuRemove.Click += new System.EventHandler(this.MnuRemoveClick);
- //
- // pnlInput
- //
- this.pnlInput.Controls.Add(this.cbxChatType);
- this.pnlInput.Controls.Add(this.txtInput);
- this.pnlInput.Controls.Add(this.btnSend);
- this.pnlInput.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.pnlInput.Location = new System.Drawing.Point(3, 301);
- this.pnlInput.Name = "pnlInput";
- this.pnlInput.Size = new System.Drawing.Size(526, 24);
- this.pnlInput.TabIndex = 4;
- //
- // cbxChatType
- //
- this.cbxChatType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.cbxChatType.FlatStyle = System.Windows.Forms.FlatStyle.System;
- this.cbxChatType.FormattingEnabled = true;
- this.cbxChatType.Items.AddRange(new object[] {
- "Say",
- "Shout",
- "Whisper"});
- this.cbxChatType.Location = new System.Drawing.Point(371, 0);
- this.cbxChatType.Name = "cbxChatType";
- this.cbxChatType.Size = new System.Drawing.Size(73, 21);
- this.cbxChatType.TabIndex = 1;
- this.cbxChatType.Text = "Say";
- //
- // txtInput
- //
- this.txtInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.txtInput.Location = new System.Drawing.Point(0, 0);
- this.txtInput.MaxLength = 977;
- this.txtInput.Name = "txtInput";
- this.txtInput.Size = new System.Drawing.Size(365, 21);
- this.txtInput.TabIndex = 0;
- this.txtInput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtInput_KeyUp);
- this.txtInput.TextChanged += new System.EventHandler(this.txtInput_TextChanged);
- //
- // btnSend
- //
- this.btnSend.Dock = System.Windows.Forms.DockStyle.Right;
- this.btnSend.Enabled = false;
- this.btnSend.Location = new System.Drawing.Point(450, 0);
- this.btnSend.Name = "btnSend";
- this.btnSend.Size = new System.Drawing.Size(76, 24);
- this.btnSend.TabIndex = 2;
- this.btnSend.Text = "Send";
- this.btnSend.UseVisualStyleBackColor = true;
- this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
- //
- // toolStrip1
- //
- this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
- this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.tbtnIM,
- this.toolStripSeparator2,
- this.tbtnFriends,
- this.toolStripSeparator1,
- this.tbtnInventory,
- this.toolStripSeparator3});
- this.toolStrip1.Location = new System.Drawing.Point(0, 24);
- this.toolStrip1.Name = "toolStrip1";
- this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
- this.toolStrip1.Size = new System.Drawing.Size(540, 25);
- this.toolStrip1.TabIndex = 5;
- this.toolStrip1.Text = "toolStrip1";
- //
- // tbtnIM
- //
- this.tbtnIM.CheckOnClick = true;
- this.tbtnIM.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
- this.tbtnIM.Image = ((System.Drawing.Image)(resources.GetObject("tbtnIM.Image")));
- this.tbtnIM.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.tbtnIM.Name = "tbtnIM";
- this.tbtnIM.Size = new System.Drawing.Size(23, 22);
- this.tbtnIM.Text = "IM";
- this.tbtnIM.Click += new System.EventHandler(this.tbtnIM_Click);
- //
- // toolStripSeparator2
- //
- this.toolStripSeparator2.Name = "toolStripSeparator2";
- this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
- //
- // tbtnFriends
- //
- this.tbtnFriends.CheckOnClick = true;
- this.tbtnFriends.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
- this.tbtnFriends.Image = ((System.Drawing.Image)(resources.GetObject("tbtnFriends.Image")));
- this.tbtnFriends.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.tbtnFriends.Name = "tbtnFriends";
- this.tbtnFriends.Size = new System.Drawing.Size(46, 22);
- this.tbtnFriends.Text = "Friends";
- //
- // toolStripSeparator1
- //
- this.toolStripSeparator1.Name = "toolStripSeparator1";
- this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
- //
- // tbtnInventory
- //
- this.tbtnInventory.CheckOnClick = true;
- this.tbtnInventory.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
- this.tbtnInventory.Image = ((System.Drawing.Image)(resources.GetObject("tbtnInventory.Image")));
- this.tbtnInventory.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.tbtnInventory.Name = "tbtnInventory";
- this.tbtnInventory.Size = new System.Drawing.Size(59, 22);
- this.tbtnInventory.Text = "Inventory";
- //
- // toolStripSeparator3
- //
- this.toolStripSeparator3.Name = "toolStripSeparator3";
- this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
- //
- // sptChat
- //
- this.sptChat.Dock = System.Windows.Forms.DockStyle.Fill;
- this.sptChat.Location = new System.Drawing.Point(3, 3);
- this.sptChat.Name = "sptChat";
- //
- // sptChat.Panel1
- //
- this.sptChat.Panel1.Controls.Add(this.rtbChat);
- this.sptChat.Panel1MinSize = 0;
- //
- // sptChat.Panel2
- //
- this.sptChat.Panel2.Controls.Add(this.lbxUsers);
- this.sptChat.Panel2MinSize = 0;
- this.sptChat.Size = new System.Drawing.Size(526, 298);
- this.sptChat.SplitterDistance = 394;
- this.sptChat.TabIndex = 7;
- //
- // tabIMs
- //
- this.tabIMs.Appearance = System.Windows.Forms.TabAppearance.Buttons;
- this.tabIMs.Controls.Add(this.tabLocalChat);
- this.tabIMs.Dock = System.Windows.Forms.DockStyle.Fill;
- this.tabIMs.Location = new System.Drawing.Point(0, 49);
- this.tabIMs.Name = "tabIMs";
- this.tabIMs.SelectedIndex = 0;
- this.tabIMs.Size = new System.Drawing.Size(540, 357);
- this.tabIMs.TabIndex = 5;
- //
- // tabLocalChat
- //
- this.tabLocalChat.Controls.Add(this.sptChat);
- this.tabLocalChat.Controls.Add(this.pnlInput);
- this.tabLocalChat.Location = new System.Drawing.Point(4, 25);
- this.tabLocalChat.Name = "tabLocalChat";
- this.tabLocalChat.Padding = new System.Windows.Forms.Padding(3);
- this.tabLocalChat.Size = new System.Drawing.Size(532, 328);
- this.tabLocalChat.TabIndex = 0;
- this.tabLocalChat.Text = "Local Chat";
- this.tabLocalChat.UseVisualStyleBackColor = true;
- //
- // frmMain
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(540, 406);
- this.Controls.Add(this.tabIMs);
- this.Controls.Add(this.toolStrip1);
- this.Controls.Add(this.menuStrip1);
- this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.MainMenuStrip = this.menuStrip1;
- this.Name = "frmMain";
- this.Text = "SLChat";
- this.VisibleChanged += new System.EventHandler(this.frmMain_VisibleChanged);
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_Closing);
- this.menuStrip1.ResumeLayout(false);
- this.menuStrip1.PerformLayout();
- this.cnxListNames.ResumeLayout(false);
- this.pnlInput.ResumeLayout(false);
- this.pnlInput.PerformLayout();
- this.toolStrip1.ResumeLayout(false);
- this.toolStrip1.PerformLayout();
- this.sptChat.Panel1.ResumeLayout(false);
- this.sptChat.Panel2.ResumeLayout(false);
- this.sptChat.ResumeLayout(false);
- this.tabIMs.ResumeLayout(false);
- this.tabLocalChat.ResumeLayout(false);
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- private System.Windows.Forms.TabPage tabLocalChat;
- private System.Windows.Forms.TabControl tabIMs;
- private System.Windows.Forms.ToolStripMenuItem mnuRemove;
- private System.Windows.Forms.ToolStripSeparator tolSeperator;
- private System.Windows.Forms.ToolStripMenuItem mnuKey;
- private System.Windows.Forms.ContextMenuStrip cnxListNames;
- private System.Windows.Forms.ToolStripSeparator mnuFileSep;
- private System.Windows.Forms.Panel pnlInput;
- private System.Windows.Forms.SplitContainer sptChat;
- private System.Windows.Forms.ComboBox cbxChatType;
- private System.Windows.Forms.Button btnSend;
- private System.Windows.Forms.TextBox txtInput;
-
- #endregion
-
- private System.Windows.Forms.MenuStrip menuStrip1;
- private System.Windows.Forms.ToolStripMenuItem mnuFile;
- private System.Windows.Forms.ToolStripMenuItem mnuFileExit;
- private System.Windows.Forms.ToolStripMenuItem mnuEdit;
- private System.Windows.Forms.ToolStripMenuItem mnuEditPrefs;
- private System.Windows.Forms.ToolStripMenuItem mnuHelp;
- private System.Windows.Forms.ToolStripMenuItem mnuHelpAbout;
- private System.Windows.Forms.RichTextBox rtbChat;
- private System.Windows.Forms.ListBox lbxUsers;
- private System.Windows.Forms.ToolStripMenuItem mnuLoginout;
- private System.Windows.Forms.ToolStripMenuItem mnuView;
- private System.Windows.Forms.ToolStripMenuItem mnuViewIMs;
- private System.Windows.Forms.ToolStrip toolStrip1;
- private System.Windows.Forms.ToolStripButton tbtnIM;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
- private System.Windows.Forms.ToolStripButton tbtnInventory;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
- private System.Windows.Forms.ToolStripMenuItem mnuViewInventory;
- private System.Windows.Forms.ToolStripMenuItem mnuViewFriends;
- private System.Windows.Forms.ToolStripButton tbtnFriends;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
- }
-}
+namespace SLChat
+{
+ partial class frmMain
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
+ this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+ this.mnuFile = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuLoginout = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuFileSep = new System.Windows.Forms.ToolStripSeparator();
+ this.mnuFileExit = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuEdit = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuEditPrefs = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuView = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuViewFriends = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuViewIMs = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuViewInventory = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuHelp = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnuHelpAbout = new System.Windows.Forms.ToolStripMenuItem();
+ this.rtbChat = new System.Windows.Forms.RichTextBox();
+ this.lbxUsers = new System.Windows.Forms.ListBox();
+ this.cnxListNames = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.mnuKey = new System.Windows.Forms.ToolStripMenuItem();
+ this.tolSeperator = new System.Windows.Forms.ToolStripSeparator();
+ this.mnuRemove = new System.Windows.Forms.ToolStripMenuItem();
+ this.pnlInput = new System.Windows.Forms.Panel();
+ this.cbxChatType = new System.Windows.Forms.ComboBox();
+ this.txtInput = new System.Windows.Forms.TextBox();
+ this.btnSend = new System.Windows.Forms.Button();
+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+ this.tbtnIM = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.tbtnFriends = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.tbtnInventory = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+ this.sptChat = new System.Windows.Forms.SplitContainer();
+ this.tabIMs = new System.Windows.Forms.TabControl();
+ this.tabLocalChat = new System.Windows.Forms.TabPage();
+ this.menuStrip1.SuspendLayout();
+ this.cnxListNames.SuspendLayout();
+ this.pnlInput.SuspendLayout();
+ this.toolStrip1.SuspendLayout();
+ this.sptChat.Panel1.SuspendLayout();
+ this.sptChat.Panel2.SuspendLayout();
+ this.sptChat.SuspendLayout();
+ this.tabIMs.SuspendLayout();
+ this.tabLocalChat.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // menuStrip1
+ //
+ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnuFile,
+ this.mnuEdit,
+ this.mnuView,
+ this.mnuHelp});
+ this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+ this.menuStrip1.Name = "menuStrip1";
+ this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.menuStrip1.Size = new System.Drawing.Size(540, 24);
+ this.menuStrip1.TabIndex = 6;
+ this.menuStrip1.Text = "menuStrip1";
+ //
+ // mnuFile
+ //
+ this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnuLoginout,
+ this.mnuFileSep,
+ this.mnuFileExit});
+ this.mnuFile.Name = "mnuFile";
+ this.mnuFile.Size = new System.Drawing.Size(35, 20);
+ this.mnuFile.Text = "&File";
+ //
+ // mnuLoginout
+ //
+ this.mnuLoginout.Name = "mnuLoginout";
+ this.mnuLoginout.Size = new System.Drawing.Size(111, 22);
+ this.mnuLoginout.Text = "&Login...";
+ this.mnuLoginout.Click += new System.EventHandler(this.mnuLoginout_Click);
+ //
+ // mnuFileSep
+ //
+ this.mnuFileSep.Name = "mnuFileSep";
+ this.mnuFileSep.Size = new System.Drawing.Size(108, 6);
+ //
+ // mnuFileExit
+ //
+ this.mnuFileExit.Name = "mnuFileExit";
+ this.mnuFileExit.Size = new System.Drawing.Size(111, 22);
+ this.mnuFileExit.Text = "E&xit";
+ this.mnuFileExit.Click += new System.EventHandler(this.mnuFileExit_Click);
+ //
+ // mnuEdit
+ //
+ this.mnuEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnuEditPrefs});
+ this.mnuEdit.Name = "mnuEdit";
+ this.mnuEdit.Size = new System.Drawing.Size(37, 20);
+ this.mnuEdit.Text = "&Edit";
+ //
+ // mnuEditPrefs
+ //
+ this.mnuEditPrefs.Name = "mnuEditPrefs";
+ this.mnuEditPrefs.Size = new System.Drawing.Size(144, 22);
+ this.mnuEditPrefs.Text = "&Preferences...";
+ this.mnuEditPrefs.Click += new System.EventHandler(this.MnuEditPrefsClick);
+ //
+ // mnuView
+ //
+ this.mnuView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnuViewFriends,
+ this.mnuViewIMs,
+ this.mnuViewInventory});
+ this.mnuView.Name = "mnuView";
+ this.mnuView.Size = new System.Drawing.Size(41, 20);
+ this.mnuView.Text = "&View";
+ //
+ // mnuViewFriends
+ //
+ this.mnuViewFriends.CheckOnClick = true;
+ this.mnuViewFriends.Name = "mnuViewFriends";
+ this.mnuViewFriends.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
+ | System.Windows.Forms.Keys.F)));
+ this.mnuViewFriends.Size = new System.Drawing.Size(197, 22);
+ this.mnuViewFriends.Text = "&Friends";
+ //
+ // mnuViewIMs
+ //
+ this.mnuViewIMs.CheckOnClick = true;
+ this.mnuViewIMs.Name = "mnuViewIMs";
+ this.mnuViewIMs.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
+ this.mnuViewIMs.Size = new System.Drawing.Size(197, 22);
+ this.mnuViewIMs.Text = "&Instant Messages";
+ this.mnuViewIMs.Click += new System.EventHandler(this.mnuViewIMs_Click);
+ //
+ // mnuViewInventory
+ //
+ this.mnuViewInventory.CheckOnClick = true;
+ this.mnuViewInventory.Name = "mnuViewInventory";
+ this.mnuViewInventory.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
+ this.mnuViewInventory.Size = new System.Drawing.Size(197, 22);
+ this.mnuViewInventory.Text = "I&nventory";
+ //
+ // mnuHelp
+ //
+ this.mnuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnuHelpAbout});
+ this.mnuHelp.Name = "mnuHelp";
+ this.mnuHelp.Size = new System.Drawing.Size(40, 20);
+ this.mnuHelp.Text = "&Help";
+ //
+ // mnuHelpAbout
+ //
+ this.mnuHelpAbout.Name = "mnuHelpAbout";
+ this.mnuHelpAbout.Size = new System.Drawing.Size(115, 22);
+ this.mnuHelpAbout.Text = "&About...";
+ this.mnuHelpAbout.Click += new System.EventHandler(this.mnuHelpAbout_Click);
+ //
+ // rtbChat
+ //
+ this.rtbChat.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.rtbChat.BackColor = System.Drawing.Color.White;
+ this.rtbChat.HideSelection = false;
+ this.rtbChat.Location = new System.Drawing.Point(0, 0);
+ this.rtbChat.Name = "rtbChat";
+ this.rtbChat.ReadOnly = true;
+ this.rtbChat.ShowSelectionMargin = true;
+ this.rtbChat.Size = new System.Drawing.Size(394, 298);
+ this.rtbChat.TabIndex = 4;
+ this.rtbChat.Text = "";
+ this.rtbChat.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.Link_Clicked);
+ //
+ // lbxUsers
+ //
+ this.lbxUsers.ContextMenuStrip = this.cnxListNames;
+ this.lbxUsers.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lbxUsers.FormattingEnabled = true;
+ this.lbxUsers.IntegralHeight = false;
+ this.lbxUsers.Location = new System.Drawing.Point(0, 0);
+ this.lbxUsers.Name = "lbxUsers";
+ this.lbxUsers.Size = new System.Drawing.Size(128, 298);
+ this.lbxUsers.TabIndex = 3;
+ //
+ // cnxListNames
+ //
+ this.cnxListNames.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnuKey,
+ this.tolSeperator,
+ this.mnuRemove});
+ this.cnxListNames.Name = "cnxListNames";
+ this.cnxListNames.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.cnxListNames.Size = new System.Drawing.Size(154, 54);
+ //
+ // mnuKey
+ //
+ this.mnuKey.Name = "mnuKey";
+ this.mnuKey.Size = new System.Drawing.Size(153, 22);
+ this.mnuKey.Text = "Print Key (UUID)";
+ this.mnuKey.Click += new System.EventHandler(this.MnuKeyClick);
+ //
+ // tolSeperator
+ //
+ this.tolSeperator.Name = "tolSeperator";
+ this.tolSeperator.Size = new System.Drawing.Size(150, 6);
+ //
+ // mnuRemove
+ //
+ this.mnuRemove.Name = "mnuRemove";
+ this.mnuRemove.Size = new System.Drawing.Size(153, 22);
+ this.mnuRemove.Text = "Remove";
+ this.mnuRemove.Click += new System.EventHandler(this.MnuRemoveClick);
+ //
+ // pnlInput
+ //
+ this.pnlInput.Controls.Add(this.cbxChatType);
+ this.pnlInput.Controls.Add(this.txtInput);
+ this.pnlInput.Controls.Add(this.btnSend);
+ this.pnlInput.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.pnlInput.Location = new System.Drawing.Point(3, 301);
+ this.pnlInput.Name = "pnlInput";
+ this.pnlInput.Size = new System.Drawing.Size(526, 24);
+ this.pnlInput.TabIndex = 4;
+ //
+ // cbxChatType
+ //
+ this.cbxChatType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.cbxChatType.FlatStyle = System.Windows.Forms.FlatStyle.System;
+ this.cbxChatType.FormattingEnabled = true;
+ this.cbxChatType.Items.AddRange(new object[] {
+ "Say",
+ "Shout",
+ "Whisper"});
+ this.cbxChatType.Location = new System.Drawing.Point(371, 0);
+ this.cbxChatType.Name = "cbxChatType";
+ this.cbxChatType.Size = new System.Drawing.Size(73, 21);
+ this.cbxChatType.TabIndex = 1;
+ this.cbxChatType.Text = "Say";
+ //
+ // txtInput
+ //
+ this.txtInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtInput.Location = new System.Drawing.Point(0, 0);
+ this.txtInput.MaxLength = 977;
+ this.txtInput.Name = "txtInput";
+ this.txtInput.Size = new System.Drawing.Size(365, 21);
+ this.txtInput.TabIndex = 0;
+ this.txtInput.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtInput_KeyUp);
+ this.txtInput.TextChanged += new System.EventHandler(this.txtInput_TextChanged);
+ //
+ // btnSend
+ //
+ this.btnSend.Dock = System.Windows.Forms.DockStyle.Right;
+ this.btnSend.Enabled = false;
+ this.btnSend.Location = new System.Drawing.Point(450, 0);
+ this.btnSend.Name = "btnSend";
+ this.btnSend.Size = new System.Drawing.Size(76, 24);
+ this.btnSend.TabIndex = 2;
+ this.btnSend.Text = "Send";
+ this.btnSend.UseVisualStyleBackColor = true;
+ this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
+ //
+ // toolStrip1
+ //
+ this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
+ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tbtnIM,
+ this.toolStripSeparator2,
+ this.tbtnFriends,
+ this.toolStripSeparator1,
+ this.tbtnInventory,
+ this.toolStripSeparator3});
+ this.toolStrip1.Location = new System.Drawing.Point(0, 24);
+ this.toolStrip1.Name = "toolStrip1";
+ this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
+ this.toolStrip1.Size = new System.Drawing.Size(540, 25);
+ this.toolStrip1.TabIndex = 5;
+ this.toolStrip1.Text = "toolStrip1";
+ //
+ // tbtnIM
+ //
+ this.tbtnIM.CheckOnClick = true;
+ this.tbtnIM.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tbtnIM.Image = ((System.Drawing.Image)(resources.GetObject("tbtnIM.Image")));
+ this.tbtnIM.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbtnIM.Name = "tbtnIM";
+ this.tbtnIM.Size = new System.Drawing.Size(23, 22);
+ this.tbtnIM.Text = "IM";
+ this.tbtnIM.Click += new System.EventHandler(this.tbtnIM_Click);
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
+ //
+ // tbtnFriends
+ //
+ this.tbtnFriends.CheckOnClick = true;
+ this.tbtnFriends.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tbtnFriends.Image = ((System.Drawing.Image)(resources.GetObject("tbtnFriends.Image")));
+ this.tbtnFriends.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbtnFriends.Name = "tbtnFriends";
+ this.tbtnFriends.Size = new System.Drawing.Size(46, 22);
+ this.tbtnFriends.Text = "Friends";
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+ //
+ // tbtnInventory
+ //
+ this.tbtnInventory.CheckOnClick = true;
+ this.tbtnInventory.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tbtnInventory.Image = ((System.Drawing.Image)(resources.GetObject("tbtnInventory.Image")));
+ this.tbtnInventory.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tbtnInventory.Name = "tbtnInventory";
+ this.tbtnInventory.Size = new System.Drawing.Size(59, 22);
+ this.tbtnInventory.Text = "Inventory";
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
+ //
+ // sptChat
+ //
+ this.sptChat.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.sptChat.Location = new System.Drawing.Point(3, 3);
+ this.sptChat.Name = "sptChat";
+ //
+ // sptChat.Panel1
+ //
+ this.sptChat.Panel1.Controls.Add(this.rtbChat);
+ this.sptChat.Panel1MinSize = 0;
+ //
+ // sptChat.Panel2
+ //
+ this.sptChat.Panel2.Controls.Add(this.lbxUsers);
+ this.sptChat.Panel2MinSize = 0;
+ this.sptChat.Size = new System.Drawing.Size(526, 298);
+ this.sptChat.SplitterDistance = 394;
+ this.sptChat.TabIndex = 7;
+ //
+ // tabIMs
+ //
+ this.tabIMs.Appearance = System.Windows.Forms.TabAppearance.Buttons;
+ this.tabIMs.Controls.Add(this.tabLocalChat);
+ this.tabIMs.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tabIMs.Location = new System.Drawing.Point(0, 49);
+ this.tabIMs.Name = "tabIMs";
+ this.tabIMs.SelectedIndex = 0;
+ this.tabIMs.Size = new System.Drawing.Size(540, 357);
+ this.tabIMs.TabIndex = 5;
+ //
+ // tabLocalChat
+ //
+ this.tabLocalChat.Controls.Add(this.sptChat);
+ this.tabLocalChat.Controls.Add(this.pnlInput);
+ this.tabLocalChat.Location = new System.Drawing.Point(4, 25);
+ this.tabLocalChat.Name = "tabLocalChat";
+ this.tabLocalChat.Padding = new System.Windows.Forms.Padding(3);
+ this.tabLocalChat.Size = new System.Drawing.Size(532, 328);
+ this.tabLocalChat.TabIndex = 0;
+ this.tabLocalChat.Text = "Local Chat";
+ this.tabLocalChat.UseVisualStyleBackColor = true;
+ //
+ // frmMain
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(540, 406);
+ this.Controls.Add(this.tabIMs);
+ this.Controls.Add(this.toolStrip1);
+ this.Controls.Add(this.menuStrip1);
+ this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.MainMenuStrip = this.menuStrip1;
+ this.Name = "frmMain";
+ this.Text = "SLChat";
+ this.VisibleChanged += new System.EventHandler(this.frmMain_VisibleChanged);
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_Closing);
+ this.menuStrip1.ResumeLayout(false);
+ this.menuStrip1.PerformLayout();
+ this.cnxListNames.ResumeLayout(false);
+ this.pnlInput.ResumeLayout(false);
+ this.pnlInput.PerformLayout();
+ this.toolStrip1.ResumeLayout(false);
+ this.toolStrip1.PerformLayout();
+ this.sptChat.Panel1.ResumeLayout(false);
+ this.sptChat.Panel2.ResumeLayout(false);
+ this.sptChat.ResumeLayout(false);
+ this.tabIMs.ResumeLayout(false);
+ this.tabLocalChat.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+ }
+ private System.Windows.Forms.TabPage tabLocalChat;
+ private System.Windows.Forms.TabControl tabIMs;
+ private System.Windows.Forms.ToolStripMenuItem mnuRemove;
+ private System.Windows.Forms.ToolStripSeparator tolSeperator;
+ private System.Windows.Forms.ToolStripMenuItem mnuKey;
+ private System.Windows.Forms.ContextMenuStrip cnxListNames;
+ private System.Windows.Forms.ToolStripSeparator mnuFileSep;
+ private System.Windows.Forms.Panel pnlInput;
+ private System.Windows.Forms.SplitContainer sptChat;
+ private System.Windows.Forms.ComboBox cbxChatType;
+ private System.Windows.Forms.Button btnSend;
+ private System.Windows.Forms.TextBox txtInput;
+
+ #endregion
+
+ private System.Windows.Forms.MenuStrip menuStrip1;
+ private System.Windows.Forms.ToolStripMenuItem mnuFile;
+ private System.Windows.Forms.ToolStripMenuItem mnuFileExit;
+ private System.Windows.Forms.ToolStripMenuItem mnuEdit;
+ private System.Windows.Forms.ToolStripMenuItem mnuEditPrefs;
+ private System.Windows.Forms.ToolStripMenuItem mnuHelp;
+ private System.Windows.Forms.ToolStripMenuItem mnuHelpAbout;
+ private System.Windows.Forms.RichTextBox rtbChat;
+ private System.Windows.Forms.ListBox lbxUsers;
+ private System.Windows.Forms.ToolStripMenuItem mnuLoginout;
+ private System.Windows.Forms.ToolStripMenuItem mnuView;
+ private System.Windows.Forms.ToolStripMenuItem mnuViewIMs;
+ private System.Windows.Forms.ToolStrip toolStrip1;
+ private System.Windows.Forms.ToolStripButton tbtnIM;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripButton tbtnInventory;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripMenuItem mnuViewInventory;
+ private System.Windows.Forms.ToolStripMenuItem mnuViewFriends;
+ private System.Windows.Forms.ToolStripButton tbtnFriends;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/MainForm.cs b/applications/SLChat/SLChat/GUI/MainForm.cs
index 505b249e..4e885cc4 100644
--- a/applications/SLChat/SLChat/GUI/MainForm.cs
+++ b/applications/SLChat/SLChat/GUI/MainForm.cs
@@ -1,558 +1,558 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using SLNetworkComm;
-using libsecondlife;
-
-namespace SLChat
-{
- public partial class frmMain : Form
- {
- private SLNetCom netcom;
- private ChatTextManager chatManager;
- private frmAbout AboutForm;
- private frmLogin LoginForm;
- private frmPrefs PrefsForm;
- private Dictionary IMTabs;
- private PrefsManager prefs;
-
- private frmIMs IMForm;
-
- public bool loginVisible;
- public bool aboutCreated;
- public bool prefsCreated;
- Hashtable settings = new Hashtable();
- //Stores residents who have spoken Name and Key
- //used for printing key to text (and later things).
- Hashtable userHash = new Hashtable();
- private int lastchan;
-
- public frmMain(frmLogin Login, SLNetCom net,PrefsManager preferences)
- {
- InitializeComponent();
-
- LoginForm = Login;
- netcom = net;
-
- prefs = preferences;
-
- netcom.NetcomSync = this;
- netcom.LoginOptions.UserAgent = "SLChat v0.0.0.2";
- netcom.LoginOptions.Author = "ozspade@slinked.net";
- this.AddNetcomEvents();
-
- chatManager = new ChatTextManager(new RichTextBoxPrinter(rtbChat), netcom, prefs);
-
- this.RefreshWindowTitle();
-
- IMTabs = new Dictionary();
- IMForm = new frmIMs(netcom, prefs);
- IMForm.VisibleChanged += new EventHandler(IMForm_VisibleChanged);
- }
-
- private void frmMain_VisibleChanged(object sender, EventArgs e)
- {
- LoadSettings("ChatSettings");
- LoadSettings("TimestampSettings");
- }
-
- private void IMForm_VisibleChanged(object sender, EventArgs e)
- {
- mnuViewIMs.Checked = tbtnIM.Checked = IMForm.Visible;
- }
-
- private void AddNetcomEvents()
- {
- netcom.ClientLoggedIn += new EventHandler(netcom_ClientLoggedIn);
- netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut);
- netcom.ChatReceived += new EventHandler(netcom_ChatReceived);
- netcom.InstantMessageReceived += new EventHandler(netcom_InstantMessageReceived);
- }
-
- private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e)
- {
- if (!tbtnIM.Checked)
- {
- tbtnIM.ForeColor = Color.Red;
- }
-
- if (IMTabs.ContainsKey(e.FromAgentName))
- {
- return;
- }
-
- this.AddIMTab(e.FromAgentId, e.Id, e.FromAgentName, e);
- }
-
- private void netcom_ChatReceived(object sender, ChatEventArgs e)
- {
- if (e.FromName == netcom.LoginOptions.FullName & !prefs.setListUserName) return;
-
- string name = e.FromName;
- if (e.FromName == netcom.LoginOptions.FullName & !prefs.setUseFullName & e.SourceType == SLSourceType.Avatar) name = "You";
-
- if(e.SourceType == SLSourceType.Object) name = "(Ob) " + e.FromName;
-
- //Send our name and UUID to the function along
- //with telling it that we are adding (true) not
- //deleting (false)
- UpdateUserList(name,e.SourceId.ToString(),true);
- }
-
- private void netcom_ClientLoggedOut(object sender, ClientLoginEventArgs e)
- {
- mnuLoginout.Text = "&Login...";
-
- cbxChatType.Enabled = false;
- txtInput.Enabled = false;
- btnSend.Enabled = false;
-
- this.RefreshWindowTitle();
- }
-
- private void netcom_ClientLoggedIn(object sender, ClientLoginEventArgs e)
- {
- mnuLoginout.Text = "&Logout";
-
- txtInput.Enabled = true;
- cbxChatType.Enabled = true;
-
- this.RefreshWindowTitle();
- }
-
- private void mnuLoginout_Click(object sender, EventArgs e)
- {
- switch (mnuLoginout.Text)
- {
- case "&Login...":
- if(loginVisible)
- {
- LoginForm.Focus();
- }else{
- loginVisible = true;
- LoginForm.Show();
- }
- break;
-
- case "&Logout":
- netcom.Logout();
- break;
- }
- }
-
- private void txtInput_KeyUp(object sender, KeyEventArgs e)
- {
- if (e.Control)
- {
- if(e.Shift)
- {
- if(e.KeyCode == Keys.Enter){
- //Ctrl+Shift+Enter = Whisper
- int chan = ChannelGrabber(txtInput.Text);
- string message = MessageCleanup(txtInput.Text,chan);
- netcom.ChatOut(message, SLChatType.Whisper, chan);
- this.ClearChatInput();
- }
- }else{
- if(e.KeyCode == Keys.Enter){
- //Ctrl+Enter = Shout
- int chan = ChannelGrabber(txtInput.Text);
- string message = MessageCleanup(txtInput.Text,chan);
- netcom.ChatOut(message, SLChatType.Shout, chan);
- this.ClearChatInput();
- }else if(e.KeyCode == Keys.A){
- //Ctrl+A = Select all
- txtInput.SelectAll();
- }
- }
- }
- else if(e.KeyCode == Keys.Enter)
- {
- //Enter only = whatever is in the combobox
- int chan = ChannelGrabber(txtInput.Text);
- string message = MessageCleanup(txtInput.Text,chan);
- if(cbxChatType.Text=="Say")
- {
- netcom.ChatOut(message, SLChatType.Say, chan);
- }else if(cbxChatType.Text=="Shout"){
- netcom.ChatOut(message, SLChatType.Shout, chan);
- }else if(cbxChatType.Text=="Whisper"){
- netcom.ChatOut(message, SLChatType.Whisper, chan);
- }
- this.ClearChatInput();
- }
- }
-
- private void btnSend_Click(object sender, EventArgs e)
- {
- //Send whatever is in the combobox
- int chan = ChannelGrabber(txtInput.Text);
- string message = MessageCleanup(txtInput.Text,chan);
- if(cbxChatType.Text=="Say")
- {
- netcom.ChatOut(message, SLChatType.Say, chan);
- }else if(cbxChatType.Text=="Shout"){
- netcom.ChatOut(message, SLChatType.Shout, chan);
- }else if(cbxChatType.Text=="Whisper"){
- netcom.ChatOut(message, SLChatType.Whisper, chan);
- }
- this.ClearChatInput();
- }
-
- private string MessageCleanup(string message, int chan)
- {
- //Here we clean up the message by removing "//"
- //and "/ " from strings if the Channel is not
- //0. Returns the cleaned up message.
- string mess = message;
- if(chan!=0)
- {
- if(message.StartsWith("//")){
- mess = message.Remove(0,2);
- }else{
- mess = message.Remove(0,message.Split(' ')[0].Length + 1);
- }
- }
-
- return mess;
- }
-
- private int ChannelGrabber(string message)
- {
- //Grabs the channel from the message if a channel
- //is given. Returns the found channel.
- if(message.StartsWith("//")){
- return lastchan;
- }else if(message.StartsWith("/")){
- string mes = message.Split(' ')[0];
- if(mes=="/me"){
- return 0;
- }
- mes = mes.Remove(0,1);
- int res = int.Parse(mes);
- lastchan = res;
- return res;
- }else{
- return 0;
- }
- }
-
- private void ClearChatInput()
- {
- //txtInput.Items.Add(txtInput.Text); Need to instead add items to an array to be recalled by Arrow keys?
- txtInput.Text = string.Empty;
- }
-
- private void mnuFileExit_Click(object sender, EventArgs e)
- {
- if (netcom.LoggedIn)
- {
- netcom.Logout();
- }
-
- LoginForm.CloseApp();
- }
-
- private void frmMain_Closing(object sender, FormClosingEventArgs e)
- {
- if (netcom.LoggedIn)
- {
- netcom.Logout();
- }
-
- if(loginVisible==false)
- {
- LoginForm.CloseApp();
- }else{
- e.Cancel = true;
- this.Hide();
- }
- }
-
- private void RefreshWindowTitle()
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("SLChat: ");
-
- if (netcom.LoggedIn)
- {
- sb.Append(netcom.LoginOptions.FullName);
- }
- else
- {
- sb.Append("Logged Out");
- }
-
- this.Text = sb.ToString();
- sb = null;
- }
-
- private void tbtnIM_Click(object sender, EventArgs e)
- {
- IMForm.Visible = tbtnIM.Checked;
- tbtnIM.ForeColor = Color.FromKnownColor(KnownColor.ControlText);
- }
-
- private void mnuViewIMs_Click(object sender, EventArgs e)
- {
- IMForm.Visible = mnuViewIMs.Checked;
- }
-
- private void txtInput_TextChanged(object sender, EventArgs e)
- {
- btnSend.Enabled = (txtInput.Text.Length > 0);
- }
-
- private void Link_Clicked (object sender, System.Windows.Forms.LinkClickedEventArgs e)
- {
- //User clicked a link in the chat, launch default browser
- System.Diagnostics.Process.Start(e.LinkText);
- }
-
- private void mnuHelpAbout_Click(object sender, EventArgs e)
- {
- if(!aboutCreated)
- {
- AboutForm = new frmAbout(this);
- AboutForm.ShowDialog();
- aboutCreated = true;
- }else{
- AboutForm.Focus();
- }
- }
-
- private void MnuEditPrefsClick(object sender, System.EventArgs e)
- {
- if(!prefsCreated)
- {
- PrefsForm = new frmPrefs(this,netcom.LoginOptions.FirstName+"_"+netcom.LoginOptions.LastName,prefs);
- PrefsForm.Show();
- prefsCreated = true;
- }else{
- PrefsForm.Focus();
- }
- }
-
- private void MnuKeyClick(object sender, System.EventArgs e)
- {
- //This prints the selected user's Key to rChatHistory
- //with the pretext of "Program:"
- if(userHash.ContainsValue(lbxUsers.SelectedItem.ToString()))
- {
- IDictionaryEnumerator myEnum = userHash.GetEnumerator();
- while (myEnum.MoveNext())
- {
- if(myEnum.Value.ToString()==lbxUsers.SelectedItem.ToString())
- {
- string name = myEnum.Value.ToString();
- string key = myEnum.Key.ToString();
- key = key.Insert(8,"-");
- key = key.Insert(13,"-");
- key = key.Insert(18,"-");
- key = key.Insert(23,"-");
- chatManager.PrintProgramMessage("Program: "+ name + " == " + key);
- }
- }
- }
- }
-
- private void MnuRemoveClick(object sender, System.EventArgs e)
- {
- //Remove a user from the list and update user list
- if(lbxUsers.SelectedItem.ToString() != null)
- {
- UpdateUserList(lbxUsers.SelectedItem.ToString(),null,false);
- }
- }
-
- public IMTabWindow AddIMTab(LLUUID target, LLUUID session, string targetName)
- {
- TabPage tabpage = new TabPage(targetName);
- IMTabWindow imTab = new IMTabWindow(netcom, target, session, targetName, prefs);
- imTab.Dock = DockStyle.Fill;
- imTab.formMain = this;
-
- tabpage.Controls.Add(imTab);
-
- tabIMs.TabPages.Add(tabpage);
- IMTabs.Add(targetName, imTab);
-
- return imTab;
- }
-
- public IMTabWindow AddIMTab(LLUUID target, LLUUID session, string targetName, InstantMessageEventArgs e)
- {
- IMTabWindow imTab = this.AddIMTab(target, session, targetName);
- imTab.TextManager.PassIMEvent(e);
-
- return imTab;
- }
-
- public void RemoveIMTab(string targetName)
- {
- IMTabWindow imTab = IMTabs[targetName];
- TabPage tabpage = (TabPage)imTab.Parent;
-
- IMTabs.Remove(targetName);
- imTab = null;
-
- tabIMs.TabPages.Remove(tabpage);
- tabpage.Dispose();
- }
-
- private void UpdateUserList(string name, string key, bool adding)
- {
- //Update the user list to either add a user to the
- //userhash and list box or remove a user based on "adding"
- //True = add
- //False = remove
- if(adding==true)
- {
- if(userHash.ContainsKey(key))
- {
- //We loop through the enumerator so that we can
- //compare the matching value.
- IDictionaryEnumerator myEnum = userHash.GetEnumerator();
- while (myEnum.MoveNext())
- {
- //If we find a matching key
- if(myEnum.Key.ToString()==key)
- {
- //And if the name is not the same and
- //has changed
- if(myEnum.Value.ToString()!=name)
- {
- //Remove the old name and key.
- userHash.Remove(key);
- lbxUsers.Items.Remove(myEnum.Value.ToString());
- //Add the Name and Key of the
- //resident who spoke. Used for printing key.
- userHash.Add(key,name);
- //Finaly add the name of the resident to the
- //list box.
- lbxUsers.Items.Add(name);
- return;
- }
-
- }
- }
- }else{
- //We add the fresh new name and key.
- //Add the Name and Key of the
- //resident who spoke. Used for printing key.
- userHash.Add(key,name);
- //and then add it tot he listbox again.
- lbxUsers.Items.Add(name);
- }
- }else{
- //removing from the user list
- //Removing a user from the Names List. This should
- //perhaps be done automaticly somehow, maybe by offline
- //status or distance?
- if(name != null)
- {
- //This is basicly removing the person from our
- //userHash, hashtable, which stores Name and Key used
- //for printing key to chat.
- if(userHash.ContainsValue(name))
- {
- IDictionaryEnumerator myEnum = userHash.GetEnumerator();
- while (myEnum.MoveNext())
- {
- if(myEnum.Value.ToString()==name)
- {
- //Remove from our hashtable, just to keep things clean.
- userHash.Remove(myEnum.Key);
- //Remove from the actual list element.
- lbxUsers.Items.Remove(name);
- return;
- }
- }
- }
- }
- }
- }
-
- public void LoadSettings(string parentnode)
- {
- //Our local load settings, used when we start up the
- //chat/main form.
- prefs.LoadSettings(netcom.LoginOptions.FirstName+"_"+netcom.LoginOptions.LastName,parentnode);
-
- settings = prefs.settings;
-
- if(!settings.ContainsKey("Error"))
- {
- IDictionaryEnumerator myEnum = settings.GetEnumerator();
- while (myEnum.MoveNext())
- {
- if(parentnode=="ChatSettings")
- {
- if(myEnum.Key.ToString()=="UseFullName")
- {
- if(myEnum.Value.ToString()=="true"){
- prefs.setUseFullName = true;
- }else{
- prefs.setUseFullName = false;
- }
- }else if(myEnum.Key.ToString()=="ListUserName"){
- if(myEnum.Value.ToString()=="true"){
- prefs.setListUserName = true;
- }else{
- prefs.setListUserName = false;
- UpdateUserList(netcom.LoginOptions.FullName,null,false);
- UpdateUserList("You",null,false);
- }
- }
- }else if(parentnode=="TimestampSettings"){
- if(myEnum.Key.ToString()=="ShowIMTimestamps")
- {
- if(myEnum.Value.ToString()=="true")
- {
- prefs.setIMTimestamps = true;
- }else{
- prefs.setIMTimestamps = false;
- }
- }else if(myEnum.Key.ToString()=="ShowChatTimestamps"){
- if(myEnum.Value.ToString()=="true"){
- prefs.setChatTimestamps = true;
- }else{
- prefs.setChatTimestamps = false;
- }
- }else if(myEnum.Key.ToString()=="IMTimeZone"){
- prefs.setIMTimeZ = myEnum.Value.ToString();
- }else if(myEnum.Key.ToString()=="ChatTimeZone"){
- prefs.setChatTimeZ = myEnum.Value.ToString();
- }else if(myEnum.Key.ToString()=="IMStampFormat"){
- prefs.setIMStampFormat = myEnum.Value.ToString();
- }else if(myEnum.Key.ToString()=="ChatStampFormat"){
- prefs.setChatStampFormat = myEnum.Value.ToString();
- }else if(myEnum.Key.ToString()=="SyncStampSettings"){
- if(myEnum.Value.ToString()=="true"){
- prefs.setSyncTimestamps = true;
- }else{
- prefs.setSyncTimestamps = false;
- }
- }
- }
- }
- }else{
- IDictionaryEnumerator myEnum = settings.GetEnumerator();
- while (myEnum.MoveNext())
- {
- if(myEnum.Key.ToString()=="Error")
- {
- //rtbStatus.Text = "Error loading settings: "+myEnum.Value.ToString();
- }
- }
- }
- settings.Clear();
- prefs.settings.Clear();
- }
- }
-}
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using SLNetworkComm;
+using libsecondlife;
+
+namespace SLChat
+{
+ public partial class frmMain : Form
+ {
+ private SLNetCom netcom;
+ private ChatTextManager chatManager;
+ private frmAbout AboutForm;
+ private frmLogin LoginForm;
+ private frmPrefs PrefsForm;
+ private Dictionary IMTabs;
+ private PrefsManager prefs;
+
+ private frmIMs IMForm;
+
+ public bool loginVisible;
+ public bool aboutCreated;
+ public bool prefsCreated;
+ Hashtable settings = new Hashtable();
+ //Stores residents who have spoken Name and Key
+ //used for printing key to text (and later things).
+ Hashtable userHash = new Hashtable();
+ private int lastchan;
+
+ public frmMain(frmLogin Login, SLNetCom net,PrefsManager preferences)
+ {
+ InitializeComponent();
+
+ LoginForm = Login;
+ netcom = net;
+
+ prefs = preferences;
+
+ netcom.NetcomSync = this;
+ netcom.LoginOptions.UserAgent = "SLChat v0.0.0.2";
+ netcom.LoginOptions.Author = "ozspade@slinked.net";
+ this.AddNetcomEvents();
+
+ chatManager = new ChatTextManager(new RichTextBoxPrinter(rtbChat), netcom, prefs);
+
+ this.RefreshWindowTitle();
+
+ IMTabs = new Dictionary();
+ IMForm = new frmIMs(netcom, prefs);
+ IMForm.VisibleChanged += new EventHandler(IMForm_VisibleChanged);
+ }
+
+ private void frmMain_VisibleChanged(object sender, EventArgs e)
+ {
+ LoadSettings("ChatSettings");
+ LoadSettings("TimestampSettings");
+ }
+
+ private void IMForm_VisibleChanged(object sender, EventArgs e)
+ {
+ mnuViewIMs.Checked = tbtnIM.Checked = IMForm.Visible;
+ }
+
+ private void AddNetcomEvents()
+ {
+ netcom.ClientLoggedIn += new EventHandler(netcom_ClientLoggedIn);
+ netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut);
+ netcom.ChatReceived += new EventHandler(netcom_ChatReceived);
+ netcom.InstantMessageReceived += new EventHandler(netcom_InstantMessageReceived);
+ }
+
+ private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e)
+ {
+ if (!tbtnIM.Checked)
+ {
+ tbtnIM.ForeColor = Color.Red;
+ }
+
+ if (IMTabs.ContainsKey(e.FromAgentName))
+ {
+ return;
+ }
+
+ this.AddIMTab(e.FromAgentId, e.Id, e.FromAgentName, e);
+ }
+
+ private void netcom_ChatReceived(object sender, ChatEventArgs e)
+ {
+ if (e.FromName == netcom.LoginOptions.FullName & !prefs.setListUserName) return;
+
+ string name = e.FromName;
+ if (e.FromName == netcom.LoginOptions.FullName & !prefs.setUseFullName & e.SourceType == SLSourceType.Avatar) name = "You";
+
+ if(e.SourceType == SLSourceType.Object) name = "(Ob) " + e.FromName;
+
+ //Send our name and UUID to the function along
+ //with telling it that we are adding (true) not
+ //deleting (false)
+ UpdateUserList(name,e.SourceId.ToString(),true);
+ }
+
+ private void netcom_ClientLoggedOut(object sender, ClientLoginEventArgs e)
+ {
+ mnuLoginout.Text = "&Login...";
+
+ cbxChatType.Enabled = false;
+ txtInput.Enabled = false;
+ btnSend.Enabled = false;
+
+ this.RefreshWindowTitle();
+ }
+
+ private void netcom_ClientLoggedIn(object sender, ClientLoginEventArgs e)
+ {
+ mnuLoginout.Text = "&Logout";
+
+ txtInput.Enabled = true;
+ cbxChatType.Enabled = true;
+
+ this.RefreshWindowTitle();
+ }
+
+ private void mnuLoginout_Click(object sender, EventArgs e)
+ {
+ switch (mnuLoginout.Text)
+ {
+ case "&Login...":
+ if(loginVisible)
+ {
+ LoginForm.Focus();
+ }else{
+ loginVisible = true;
+ LoginForm.Show();
+ }
+ break;
+
+ case "&Logout":
+ netcom.Logout();
+ break;
+ }
+ }
+
+ private void txtInput_KeyUp(object sender, KeyEventArgs e)
+ {
+ if (e.Control)
+ {
+ if(e.Shift)
+ {
+ if(e.KeyCode == Keys.Enter){
+ //Ctrl+Shift+Enter = Whisper
+ int chan = ChannelGrabber(txtInput.Text);
+ string message = MessageCleanup(txtInput.Text,chan);
+ netcom.ChatOut(message, SLChatType.Whisper, chan);
+ this.ClearChatInput();
+ }
+ }else{
+ if(e.KeyCode == Keys.Enter){
+ //Ctrl+Enter = Shout
+ int chan = ChannelGrabber(txtInput.Text);
+ string message = MessageCleanup(txtInput.Text,chan);
+ netcom.ChatOut(message, SLChatType.Shout, chan);
+ this.ClearChatInput();
+ }else if(e.KeyCode == Keys.A){
+ //Ctrl+A = Select all
+ txtInput.SelectAll();
+ }
+ }
+ }
+ else if(e.KeyCode == Keys.Enter)
+ {
+ //Enter only = whatever is in the combobox
+ int chan = ChannelGrabber(txtInput.Text);
+ string message = MessageCleanup(txtInput.Text,chan);
+ if(cbxChatType.Text=="Say")
+ {
+ netcom.ChatOut(message, SLChatType.Say, chan);
+ }else if(cbxChatType.Text=="Shout"){
+ netcom.ChatOut(message, SLChatType.Shout, chan);
+ }else if(cbxChatType.Text=="Whisper"){
+ netcom.ChatOut(message, SLChatType.Whisper, chan);
+ }
+ this.ClearChatInput();
+ }
+ }
+
+ private void btnSend_Click(object sender, EventArgs e)
+ {
+ //Send whatever is in the combobox
+ int chan = ChannelGrabber(txtInput.Text);
+ string message = MessageCleanup(txtInput.Text,chan);
+ if(cbxChatType.Text=="Say")
+ {
+ netcom.ChatOut(message, SLChatType.Say, chan);
+ }else if(cbxChatType.Text=="Shout"){
+ netcom.ChatOut(message, SLChatType.Shout, chan);
+ }else if(cbxChatType.Text=="Whisper"){
+ netcom.ChatOut(message, SLChatType.Whisper, chan);
+ }
+ this.ClearChatInput();
+ }
+
+ private string MessageCleanup(string message, int chan)
+ {
+ //Here we clean up the message by removing "//"
+ //and "/ " from strings if the Channel is not
+ //0. Returns the cleaned up message.
+ string mess = message;
+ if(chan!=0)
+ {
+ if(message.StartsWith("//")){
+ mess = message.Remove(0,2);
+ }else{
+ mess = message.Remove(0,message.Split(' ')[0].Length + 1);
+ }
+ }
+
+ return mess;
+ }
+
+ private int ChannelGrabber(string message)
+ {
+ //Grabs the channel from the message if a channel
+ //is given. Returns the found channel.
+ if(message.StartsWith("//")){
+ return lastchan;
+ }else if(message.StartsWith("/")){
+ string mes = message.Split(' ')[0];
+ if(mes=="/me"){
+ return 0;
+ }
+ mes = mes.Remove(0,1);
+ int res = int.Parse(mes);
+ lastchan = res;
+ return res;
+ }else{
+ return 0;
+ }
+ }
+
+ private void ClearChatInput()
+ {
+ //txtInput.Items.Add(txtInput.Text); Need to instead add items to an array to be recalled by Arrow keys?
+ txtInput.Text = string.Empty;
+ }
+
+ private void mnuFileExit_Click(object sender, EventArgs e)
+ {
+ if (netcom.LoggedIn)
+ {
+ netcom.Logout();
+ }
+
+ LoginForm.CloseApp();
+ }
+
+ private void frmMain_Closing(object sender, FormClosingEventArgs e)
+ {
+ if (netcom.LoggedIn)
+ {
+ netcom.Logout();
+ }
+
+ if(loginVisible==false)
+ {
+ LoginForm.CloseApp();
+ }else{
+ e.Cancel = true;
+ this.Hide();
+ }
+ }
+
+ private void RefreshWindowTitle()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.Append("SLChat: ");
+
+ if (netcom.LoggedIn)
+ {
+ sb.Append(netcom.LoginOptions.FullName);
+ }
+ else
+ {
+ sb.Append("Logged Out");
+ }
+
+ this.Text = sb.ToString();
+ sb = null;
+ }
+
+ private void tbtnIM_Click(object sender, EventArgs e)
+ {
+ IMForm.Visible = tbtnIM.Checked;
+ tbtnIM.ForeColor = Color.FromKnownColor(KnownColor.ControlText);
+ }
+
+ private void mnuViewIMs_Click(object sender, EventArgs e)
+ {
+ IMForm.Visible = mnuViewIMs.Checked;
+ }
+
+ private void txtInput_TextChanged(object sender, EventArgs e)
+ {
+ btnSend.Enabled = (txtInput.Text.Length > 0);
+ }
+
+ private void Link_Clicked (object sender, System.Windows.Forms.LinkClickedEventArgs e)
+ {
+ //User clicked a link in the chat, launch default browser
+ System.Diagnostics.Process.Start(e.LinkText);
+ }
+
+ private void mnuHelpAbout_Click(object sender, EventArgs e)
+ {
+ if(!aboutCreated)
+ {
+ AboutForm = new frmAbout(this);
+ AboutForm.ShowDialog();
+ aboutCreated = true;
+ }else{
+ AboutForm.Focus();
+ }
+ }
+
+ private void MnuEditPrefsClick(object sender, System.EventArgs e)
+ {
+ if(!prefsCreated)
+ {
+ PrefsForm = new frmPrefs(this,netcom.LoginOptions.FirstName+"_"+netcom.LoginOptions.LastName,prefs);
+ PrefsForm.Show();
+ prefsCreated = true;
+ }else{
+ PrefsForm.Focus();
+ }
+ }
+
+ private void MnuKeyClick(object sender, System.EventArgs e)
+ {
+ //This prints the selected user's Key to rChatHistory
+ //with the pretext of "Program:"
+ if(userHash.ContainsValue(lbxUsers.SelectedItem.ToString()))
+ {
+ IDictionaryEnumerator myEnum = userHash.GetEnumerator();
+ while (myEnum.MoveNext())
+ {
+ if(myEnum.Value.ToString()==lbxUsers.SelectedItem.ToString())
+ {
+ string name = myEnum.Value.ToString();
+ string key = myEnum.Key.ToString();
+ key = key.Insert(8,"-");
+ key = key.Insert(13,"-");
+ key = key.Insert(18,"-");
+ key = key.Insert(23,"-");
+ chatManager.PrintProgramMessage("Program: "+ name + " == " + key);
+ }
+ }
+ }
+ }
+
+ private void MnuRemoveClick(object sender, System.EventArgs e)
+ {
+ //Remove a user from the list and update user list
+ if(lbxUsers.SelectedItem.ToString() != null)
+ {
+ UpdateUserList(lbxUsers.SelectedItem.ToString(),null,false);
+ }
+ }
+
+ public IMTabWindow AddIMTab(LLUUID target, LLUUID session, string targetName)
+ {
+ TabPage tabpage = new TabPage(targetName);
+ IMTabWindow imTab = new IMTabWindow(netcom, target, session, targetName, prefs);
+ imTab.Dock = DockStyle.Fill;
+ imTab.formMain = this;
+
+ tabpage.Controls.Add(imTab);
+
+ tabIMs.TabPages.Add(tabpage);
+ IMTabs.Add(targetName, imTab);
+
+ return imTab;
+ }
+
+ public IMTabWindow AddIMTab(LLUUID target, LLUUID session, string targetName, InstantMessageEventArgs e)
+ {
+ IMTabWindow imTab = this.AddIMTab(target, session, targetName);
+ imTab.TextManager.PassIMEvent(e);
+
+ return imTab;
+ }
+
+ public void RemoveIMTab(string targetName)
+ {
+ IMTabWindow imTab = IMTabs[targetName];
+ TabPage tabpage = (TabPage)imTab.Parent;
+
+ IMTabs.Remove(targetName);
+ imTab = null;
+
+ tabIMs.TabPages.Remove(tabpage);
+ tabpage.Dispose();
+ }
+
+ private void UpdateUserList(string name, string key, bool adding)
+ {
+ //Update the user list to either add a user to the
+ //userhash and list box or remove a user based on "adding"
+ //True = add
+ //False = remove
+ if(adding==true)
+ {
+ if(userHash.ContainsKey(key))
+ {
+ //We loop through the enumerator so that we can
+ //compare the matching value.
+ IDictionaryEnumerator myEnum = userHash.GetEnumerator();
+ while (myEnum.MoveNext())
+ {
+ //If we find a matching key
+ if(myEnum.Key.ToString()==key)
+ {
+ //And if the name is not the same and
+ //has changed
+ if(myEnum.Value.ToString()!=name)
+ {
+ //Remove the old name and key.
+ userHash.Remove(key);
+ lbxUsers.Items.Remove(myEnum.Value.ToString());
+ //Add the Name and Key of the
+ //resident who spoke. Used for printing key.
+ userHash.Add(key,name);
+ //Finaly add the name of the resident to the
+ //list box.
+ lbxUsers.Items.Add(name);
+ return;
+ }
+
+ }
+ }
+ }else{
+ //We add the fresh new name and key.
+ //Add the Name and Key of the
+ //resident who spoke. Used for printing key.
+ userHash.Add(key,name);
+ //and then add it tot he listbox again.
+ lbxUsers.Items.Add(name);
+ }
+ }else{
+ //removing from the user list
+ //Removing a user from the Names List. This should
+ //perhaps be done automaticly somehow, maybe by offline
+ //status or distance?
+ if(name != null)
+ {
+ //This is basicly removing the person from our
+ //userHash, hashtable, which stores Name and Key used
+ //for printing key to chat.
+ if(userHash.ContainsValue(name))
+ {
+ IDictionaryEnumerator myEnum = userHash.GetEnumerator();
+ while (myEnum.MoveNext())
+ {
+ if(myEnum.Value.ToString()==name)
+ {
+ //Remove from our hashtable, just to keep things clean.
+ userHash.Remove(myEnum.Key);
+ //Remove from the actual list element.
+ lbxUsers.Items.Remove(name);
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public void LoadSettings(string parentnode)
+ {
+ //Our local load settings, used when we start up the
+ //chat/main form.
+ prefs.LoadSettings(netcom.LoginOptions.FirstName+"_"+netcom.LoginOptions.LastName,parentnode);
+
+ settings = prefs.settings;
+
+ if(!settings.ContainsKey("Error"))
+ {
+ IDictionaryEnumerator myEnum = settings.GetEnumerator();
+ while (myEnum.MoveNext())
+ {
+ if(parentnode=="ChatSettings")
+ {
+ if(myEnum.Key.ToString()=="UseFullName")
+ {
+ if(myEnum.Value.ToString()=="true"){
+ prefs.setUseFullName = true;
+ }else{
+ prefs.setUseFullName = false;
+ }
+ }else if(myEnum.Key.ToString()=="ListUserName"){
+ if(myEnum.Value.ToString()=="true"){
+ prefs.setListUserName = true;
+ }else{
+ prefs.setListUserName = false;
+ UpdateUserList(netcom.LoginOptions.FullName,null,false);
+ UpdateUserList("You",null,false);
+ }
+ }
+ }else if(parentnode=="TimestampSettings"){
+ if(myEnum.Key.ToString()=="ShowIMTimestamps")
+ {
+ if(myEnum.Value.ToString()=="true")
+ {
+ prefs.setIMTimestamps = true;
+ }else{
+ prefs.setIMTimestamps = false;
+ }
+ }else if(myEnum.Key.ToString()=="ShowChatTimestamps"){
+ if(myEnum.Value.ToString()=="true"){
+ prefs.setChatTimestamps = true;
+ }else{
+ prefs.setChatTimestamps = false;
+ }
+ }else if(myEnum.Key.ToString()=="IMTimeZone"){
+ prefs.setIMTimeZ = myEnum.Value.ToString();
+ }else if(myEnum.Key.ToString()=="ChatTimeZone"){
+ prefs.setChatTimeZ = myEnum.Value.ToString();
+ }else if(myEnum.Key.ToString()=="IMStampFormat"){
+ prefs.setIMStampFormat = myEnum.Value.ToString();
+ }else if(myEnum.Key.ToString()=="ChatStampFormat"){
+ prefs.setChatStampFormat = myEnum.Value.ToString();
+ }else if(myEnum.Key.ToString()=="SyncStampSettings"){
+ if(myEnum.Value.ToString()=="true"){
+ prefs.setSyncTimestamps = true;
+ }else{
+ prefs.setSyncTimestamps = false;
+ }
+ }
+ }
+ }
+ }else{
+ IDictionaryEnumerator myEnum = settings.GetEnumerator();
+ while (myEnum.MoveNext())
+ {
+ if(myEnum.Key.ToString()=="Error")
+ {
+ //rtbStatus.Text = "Error loading settings: "+myEnum.Value.ToString();
+ }
+ }
+ }
+ settings.Clear();
+ prefs.settings.Clear();
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/MainForm.resx b/applications/SLChat/SLChat/GUI/MainForm.resx
index dd32c7ea..943af53a 100644
--- a/applications/SLChat/SLChat/GUI/MainForm.resx
+++ b/applications/SLChat/SLChat/GUI/MainForm.resx
@@ -1,175 +1,175 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 17, 17
-
-
- 225, 17
-
-
- 126, 17
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL
- U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI
- VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ
- QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4
- /g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9
- cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j
- 3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR
- dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
- NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
- s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL
- U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI
- VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ
- QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4
- /g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9
- cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j
- 3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR
- dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
- NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
- s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL
- U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI
- VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ
- QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4
- /g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9
- cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j
- 3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR
- dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
- NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
- s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 225, 17
+
+
+ 126, 17
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL
+ U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI
+ VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ
+ QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4
+ /g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9
+ cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j
+ 3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR
+ dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
+ NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
+ s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL
+ U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI
+ VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ
+ QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4
+ /g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9
+ cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j
+ 3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR
+ dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
+ NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
+ s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL
+ U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI
+ VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ
+ QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4
+ /g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9
+ cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j
+ 3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR
+ dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
+ NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
+ s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
+
+
\ No newline at end of file
diff --git a/applications/SLChat/SLChat/GUI/Preferences.Designer.cs b/applications/SLChat/SLChat/GUI/Preferences.Designer.cs
index 348c3a7f..3be3515a 100644
--- a/applications/SLChat/SLChat/GUI/Preferences.Designer.cs
+++ b/applications/SLChat/SLChat/GUI/Preferences.Designer.cs
@@ -1,454 +1,454 @@
-/*
- * Created by SharpDevelop.
- * User: ${USER}
- * Date: ${DATE}
- * Time: ${TIME}
- *
- * To change this template use Tools | Options | Coding | Edit Standard Headers.
- */
-namespace SLChat
-{
- partial class frmPrefs : System.Windows.Forms.Form
- {
- ///
- /// Designer variable used to keep track of non-visual components.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Disposes resources used by the form.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing) {
- if (components != null) {
- components.Dispose();
- }
- }
- base.Dispose(disposing);
- }
-
- ///
- /// This method is required for Windows Forms designer support.
- /// Do not change the method contents inside the source code editor. The Forms designer might
- /// not be able to load this method if it was changed manually.
- ///
- private void InitializeComponent()
- {
- this.lbxChoices = new System.Windows.Forms.ListBox();
- this.btnOk = new System.Windows.Forms.Button();
- this.btnCancel = new System.Windows.Forms.Button();
- this.btnApply = new System.Windows.Forms.Button();
- this.gbxGeneral = new System.Windows.Forms.GroupBox();
- this.gbxChat = new System.Windows.Forms.GroupBox();
- this.chkListUserName = new System.Windows.Forms.CheckBox();
- this.chkYouName = new System.Windows.Forms.CheckBox();
- this.gbxProfiles = new System.Windows.Forms.GroupBox();
- this.lblProfNote = new System.Windows.Forms.Label();
- this.lblProfNoteTxt = new System.Windows.Forms.Label();
- this.btnPDelete = new System.Windows.Forms.Button();
- this.cbxProfiles = new System.Windows.Forms.ComboBox();
- this.lblProfile = new System.Windows.Forms.Label();
- this.gbxIM = new System.Windows.Forms.GroupBox();
- this.gbxTimestamps = new System.Windows.Forms.GroupBox();
- this.chkSyncStamps = new System.Windows.Forms.CheckBox();
- this.gbxIMStamps = new System.Windows.Forms.GroupBox();
- this.txtIMStampFormat = new System.Windows.Forms.TextBox();
- this.lblIMStampFormat = new System.Windows.Forms.Label();
- this.numIMTimeZ = new System.Windows.Forms.NumericUpDown();
- this.lblIMTimeZ = new System.Windows.Forms.Label();
- this.gbxChatStamps = new System.Windows.Forms.GroupBox();
- this.txtChatStampFormat = new System.Windows.Forms.TextBox();
- this.lblChatStampFormat = new System.Windows.Forms.Label();
- this.numChatTimeZ = new System.Windows.Forms.NumericUpDown();
- this.lblChatTimeZ = new System.Windows.Forms.Label();
- this.chkIMTimestamps = new System.Windows.Forms.CheckBox();
- this.chkChatTimestamps = new System.Windows.Forms.CheckBox();
- this.btnDefaults = new System.Windows.Forms.Button();
- this.gbxChat.SuspendLayout();
- this.gbxProfiles.SuspendLayout();
- this.gbxTimestamps.SuspendLayout();
- this.gbxIMStamps.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numIMTimeZ)).BeginInit();
- this.gbxChatStamps.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numChatTimeZ)).BeginInit();
- this.SuspendLayout();
- //
- // lbxChoices
- //
- this.lbxChoices.FormattingEnabled = true;
- this.lbxChoices.Items.AddRange(new object[] {
- "General",
- "Profiles",
- "Chat",
- "IM",
- "Timestamps"});
- this.lbxChoices.Location = new System.Drawing.Point(3, 6);
- this.lbxChoices.Name = "lbxChoices";
- this.lbxChoices.Size = new System.Drawing.Size(100, 316);
- this.lbxChoices.TabIndex = 0;
- this.lbxChoices.SelectedIndexChanged += new System.EventHandler(this.LbxChoicesSelectedIndexChanged);
- //
- // btnOk
- //
- this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnOk.Location = new System.Drawing.Point(250, 325);
- this.btnOk.Name = "btnOk";
- this.btnOk.Size = new System.Drawing.Size(75, 23);
- this.btnOk.TabIndex = 1;
- this.btnOk.Text = "OK";
- this.btnOk.UseVisualStyleBackColor = true;
- this.btnOk.Click += new System.EventHandler(this.BtnOkClick);
- //
- // btnCancel
- //
- this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.btnCancel.Location = new System.Drawing.Point(330, 325);
- this.btnCancel.Name = "btnCancel";
- this.btnCancel.Size = new System.Drawing.Size(75, 23);
- this.btnCancel.TabIndex = 2;
- this.btnCancel.Text = "Cancel";
- this.btnCancel.UseVisualStyleBackColor = true;
- this.btnCancel.Click += new System.EventHandler(this.BtnCancelClick);
- //
- // btnApply
- //
- this.btnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnApply.Location = new System.Drawing.Point(410, 325);
- this.btnApply.Name = "btnApply";
- this.btnApply.Size = new System.Drawing.Size(75, 23);
- this.btnApply.TabIndex = 3;
- this.btnApply.Text = "Apply";
- this.btnApply.UseVisualStyleBackColor = true;
- this.btnApply.Click += new System.EventHandler(this.BtnApplyClick);
- //
- // gbxGeneral
- //
- this.gbxGeneral.Location = new System.Drawing.Point(106, 6);
- this.gbxGeneral.Name = "gbxGeneral";
- this.gbxGeneral.Size = new System.Drawing.Size(380, 315);
- this.gbxGeneral.TabIndex = 4;
- this.gbxGeneral.TabStop = false;
- this.gbxGeneral.Text = "General";
- //
- // gbxChat
- //
- this.gbxChat.Controls.Add(this.chkListUserName);
- this.gbxChat.Controls.Add(this.chkYouName);
- this.gbxChat.Location = new System.Drawing.Point(106, 6);
- this.gbxChat.Name = "gbxChat";
- this.gbxChat.Size = new System.Drawing.Size(380, 315);
- this.gbxChat.TabIndex = 5;
- this.gbxChat.TabStop = false;
- this.gbxChat.Text = "Chat";
- //
- // chkListUserName
- //
- this.chkListUserName.Location = new System.Drawing.Point(6, 46);
- this.chkListUserName.Name = "chkListUserName";
- this.chkListUserName.Size = new System.Drawing.Size(193, 24);
- this.chkListUserName.TabIndex = 2;
- this.chkListUserName.Text = "List you in local chat\'s resident list";
- this.chkListUserName.UseVisualStyleBackColor = true;
- //
- // chkYouName
- //
- this.chkYouName.Location = new System.Drawing.Point(6, 20);
- this.chkYouName.Name = "chkYouName";
- this.chkYouName.Size = new System.Drawing.Size(179, 24);
- this.chkYouName.TabIndex = 0;
- this.chkYouName.Text = "Use full name instead of \"You\"";
- this.chkYouName.UseVisualStyleBackColor = true;
- //
- // gbxProfiles
- //
- this.gbxProfiles.Controls.Add(this.lblProfNote);
- this.gbxProfiles.Controls.Add(this.lblProfNoteTxt);
- this.gbxProfiles.Controls.Add(this.btnPDelete);
- this.gbxProfiles.Controls.Add(this.cbxProfiles);
- this.gbxProfiles.Controls.Add(this.lblProfile);
- this.gbxProfiles.Location = new System.Drawing.Point(106, 6);
- this.gbxProfiles.Name = "gbxProfiles";
- this.gbxProfiles.Size = new System.Drawing.Size(380, 315);
- this.gbxProfiles.TabIndex = 5;
- this.gbxProfiles.TabStop = false;
- this.gbxProfiles.Text = "Profiles";
- //
- // lblProfNote
- //
- this.lblProfNote.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lblProfNote.ForeColor = System.Drawing.Color.Red;
- this.lblProfNote.Location = new System.Drawing.Point(6, 25);
- this.lblProfNote.Name = "lblProfNote";
- this.lblProfNote.Size = new System.Drawing.Size(38, 14);
- this.lblProfNote.TabIndex = 4;
- this.lblProfNote.Text = "Note:";
- //
- // lblProfNoteTxt
- //
- this.lblProfNoteTxt.Location = new System.Drawing.Point(41, 25);
- this.lblProfNoteTxt.Name = "lblProfNoteTxt";
- this.lblProfNoteTxt.Size = new System.Drawing.Size(336, 14);
- this.lblProfNoteTxt.TabIndex = 3;
- this.lblProfNoteTxt.Text = "Changes to profiles are effective immedietly and can not be undone.";
- //
- // btnPDelete
- //
- this.btnPDelete.Location = new System.Drawing.Point(141, 75);
- this.btnPDelete.Name = "btnPDelete";
- this.btnPDelete.Size = new System.Drawing.Size(75, 23);
- this.btnPDelete.TabIndex = 2;
- this.btnPDelete.Text = "Delete";
- this.btnPDelete.UseVisualStyleBackColor = true;
- this.btnPDelete.Click += new System.EventHandler(this.BtnPDeleteClick);
- //
- // cbxProfiles
- //
- this.cbxProfiles.FormattingEnabled = true;
- this.cbxProfiles.Location = new System.Drawing.Point(50, 48);
- this.cbxProfiles.Name = "cbxProfiles";
- this.cbxProfiles.Size = new System.Drawing.Size(166, 21);
- this.cbxProfiles.TabIndex = 1;
- //
- // lblProfile
- //
- this.lblProfile.Location = new System.Drawing.Point(6, 51);
- this.lblProfile.Name = "lblProfile";
- this.lblProfile.Size = new System.Drawing.Size(50, 17);
- this.lblProfile.TabIndex = 0;
- this.lblProfile.Text = "Profile:";
- //
- // gbxIM
- //
- this.gbxIM.Location = new System.Drawing.Point(106, 6);
- this.gbxIM.Name = "gbxIM";
- this.gbxIM.Size = new System.Drawing.Size(380, 315);
- this.gbxIM.TabIndex = 6;
- this.gbxIM.TabStop = false;
- this.gbxIM.Text = "IM";
- //
- // gbxTimestamps
- //
- this.gbxTimestamps.Controls.Add(this.chkSyncStamps);
- this.gbxTimestamps.Controls.Add(this.gbxIMStamps);
- this.gbxTimestamps.Controls.Add(this.gbxChatStamps);
- this.gbxTimestamps.Controls.Add(this.chkIMTimestamps);
- this.gbxTimestamps.Controls.Add(this.chkChatTimestamps);
- this.gbxTimestamps.Location = new System.Drawing.Point(106, 6);
- this.gbxTimestamps.Name = "gbxTimestamps";
- this.gbxTimestamps.Size = new System.Drawing.Size(380, 315);
- this.gbxTimestamps.TabIndex = 7;
- this.gbxTimestamps.TabStop = false;
- this.gbxTimestamps.Text = "Timestamps";
- //
- // chkSyncStamps
- //
- this.chkSyncStamps.Location = new System.Drawing.Point(6, 132);
- this.chkSyncStamps.Name = "chkSyncStamps";
- this.chkSyncStamps.Size = new System.Drawing.Size(270, 24);
- this.chkSyncStamps.TabIndex = 2;
- this.chkSyncStamps.Text = "Sync Settings (IM matches Chat)(Not yet working)";
- this.chkSyncStamps.UseVisualStyleBackColor = true;
- //
- // gbxIMStamps
- //
- this.gbxIMStamps.Controls.Add(this.txtIMStampFormat);
- this.gbxIMStamps.Controls.Add(this.lblIMStampFormat);
- this.gbxIMStamps.Controls.Add(this.numIMTimeZ);
- this.gbxIMStamps.Controls.Add(this.lblIMTimeZ);
- this.gbxIMStamps.Location = new System.Drawing.Point(6, 200);
- this.gbxIMStamps.Name = "gbxIMStamps";
- this.gbxIMStamps.Size = new System.Drawing.Size(367, 68);
- this.gbxIMStamps.TabIndex = 4;
- this.gbxIMStamps.TabStop = false;
- this.gbxIMStamps.Text = "IM";
- //
- // txtIMStampFormat
- //
- this.txtIMStampFormat.Location = new System.Drawing.Point(115, 38);
- this.txtIMStampFormat.Name = "txtIMStampFormat";
- this.txtIMStampFormat.Size = new System.Drawing.Size(100, 21);
- this.txtIMStampFormat.TabIndex = 1;
- //
- // lblIMStampFormat
- //
- this.lblIMStampFormat.Location = new System.Drawing.Point(6, 41);
- this.lblIMStampFormat.Name = "lblIMStampFormat";
- this.lblIMStampFormat.Size = new System.Drawing.Size(100, 15);
- this.lblIMStampFormat.TabIndex = 3;
- this.lblIMStampFormat.Text = "Timestamp Format:";
- //
- // numIMTimeZ
- //
- this.numIMTimeZ.Location = new System.Drawing.Point(170, 15);
- this.numIMTimeZ.Maximum = new decimal(new int[] {
- 24,
- 0,
- 0,
- 0});
- this.numIMTimeZ.Minimum = new decimal(new int[] {
- 24,
- 0,
- 0,
- -2147483648});
- this.numIMTimeZ.Name = "numIMTimeZ";
- this.numIMTimeZ.Size = new System.Drawing.Size(45, 21);
- this.numIMTimeZ.TabIndex = 0;
- //
- // lblIMTimeZ
- //
- this.lblIMTimeZ.Location = new System.Drawing.Point(6, 17);
- this.lblIMTimeZ.Name = "lblIMTimeZ";
- this.lblIMTimeZ.Size = new System.Drawing.Size(158, 15);
- this.lblIMTimeZ.TabIndex = 2;
- this.lblIMTimeZ.Text = "Time Zone Offset (UTC/GMT):";
- //
- // gbxChatStamps
- //
- this.gbxChatStamps.Controls.Add(this.txtChatStampFormat);
- this.gbxChatStamps.Controls.Add(this.lblChatStampFormat);
- this.gbxChatStamps.Controls.Add(this.numChatTimeZ);
- this.gbxChatStamps.Controls.Add(this.lblChatTimeZ);
- this.gbxChatStamps.Location = new System.Drawing.Point(6, 42);
- this.gbxChatStamps.Name = "gbxChatStamps";
- this.gbxChatStamps.Size = new System.Drawing.Size(367, 68);
- this.gbxChatStamps.TabIndex = 1;
- this.gbxChatStamps.TabStop = false;
- this.gbxChatStamps.Text = "Chat";
- //
- // txtChatStampFormat
- //
- this.txtChatStampFormat.Location = new System.Drawing.Point(115, 38);
- this.txtChatStampFormat.Name = "txtChatStampFormat";
- this.txtChatStampFormat.Size = new System.Drawing.Size(100, 21);
- this.txtChatStampFormat.TabIndex = 1;
- //
- // lblChatStampFormat
- //
- this.lblChatStampFormat.Location = new System.Drawing.Point(6, 41);
- this.lblChatStampFormat.Name = "lblChatStampFormat";
- this.lblChatStampFormat.Size = new System.Drawing.Size(100, 15);
- this.lblChatStampFormat.TabIndex = 3;
- this.lblChatStampFormat.Text = "Timestamp Format:";
- //
- // numChatTimeZ
- //
- this.numChatTimeZ.Location = new System.Drawing.Point(170, 15);
- this.numChatTimeZ.Maximum = new decimal(new int[] {
- 24,
- 0,
- 0,
- 0});
- this.numChatTimeZ.Minimum = new decimal(new int[] {
- 24,
- 0,
- 0,
- -2147483648});
- this.numChatTimeZ.Name = "numChatTimeZ";
- this.numChatTimeZ.Size = new System.Drawing.Size(45, 21);
- this.numChatTimeZ.TabIndex = 0;
- //
- // lblChatTimeZ
- //
- this.lblChatTimeZ.Location = new System.Drawing.Point(6, 17);
- this.lblChatTimeZ.Name = "lblChatTimeZ";
- this.lblChatTimeZ.Size = new System.Drawing.Size(158, 15);
- this.lblChatTimeZ.TabIndex = 2;
- this.lblChatTimeZ.Text = "Time Zone Offset (UTC/GMT):";
- //
- // chkIMTimestamps
- //
- this.chkIMTimestamps.Location = new System.Drawing.Point(6, 172);
- this.chkIMTimestamps.Name = "chkIMTimestamps";
- this.chkIMTimestamps.Size = new System.Drawing.Size(143, 24);
- this.chkIMTimestamps.TabIndex = 3;
- this.chkIMTimestamps.Text = "Show timestamps in IMs";
- this.chkIMTimestamps.UseVisualStyleBackColor = true;
- //
- // chkChatTimestamps
- //
- this.chkChatTimestamps.Location = new System.Drawing.Point(6, 20);
- this.chkChatTimestamps.Name = "chkChatTimestamps";
- this.chkChatTimestamps.Size = new System.Drawing.Size(153, 24);
- this.chkChatTimestamps.TabIndex = 0;
- this.chkChatTimestamps.Text = "Show timestamps in chat";
- this.chkChatTimestamps.UseVisualStyleBackColor = true;
- //
- // btnDefaults
- //
- this.btnDefaults.Location = new System.Drawing.Point(3, 325);
- this.btnDefaults.Name = "btnDefaults";
- this.btnDefaults.Size = new System.Drawing.Size(100, 23);
- this.btnDefaults.TabIndex = 4;
- this.btnDefaults.Text = "Restore Defaults";
- this.btnDefaults.UseVisualStyleBackColor = true;
- this.btnDefaults.Click += new System.EventHandler(this.BtnDefaultsClick);
- //
- // frmPrefs
- //
- this.AcceptButton = this.btnOk;
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.CancelButton = this.btnCancel;
- this.ClientSize = new System.Drawing.Size(494, 352);
- this.Controls.Add(this.gbxTimestamps);
- this.Controls.Add(this.gbxIM);
- this.Controls.Add(this.btnDefaults);
- this.Controls.Add(this.gbxChat);
- this.Controls.Add(this.gbxProfiles);
- this.Controls.Add(this.gbxGeneral);
- this.Controls.Add(this.btnApply);
- this.Controls.Add(this.btnCancel);
- this.Controls.Add(this.btnOk);
- this.Controls.Add(this.lbxChoices);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "frmPrefs";
- this.ShowInTaskbar = false;
- this.Text = "Preferences";
- this.gbxChat.ResumeLayout(false);
- this.gbxProfiles.ResumeLayout(false);
- this.gbxTimestamps.ResumeLayout(false);
- this.gbxIMStamps.ResumeLayout(false);
- this.gbxIMStamps.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numIMTimeZ)).EndInit();
- this.gbxChatStamps.ResumeLayout(false);
- this.gbxChatStamps.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numChatTimeZ)).EndInit();
- this.ResumeLayout(false);
- }
- private System.Windows.Forms.Button btnDefaults;
- private System.Windows.Forms.CheckBox chkSyncStamps;
- private System.Windows.Forms.Label lblChatTimeZ;
- private System.Windows.Forms.NumericUpDown numChatTimeZ;
- private System.Windows.Forms.Label lblChatStampFormat;
- private System.Windows.Forms.TextBox txtChatStampFormat;
- private System.Windows.Forms.GroupBox gbxChatStamps;
- private System.Windows.Forms.Label lblIMTimeZ;
- private System.Windows.Forms.NumericUpDown numIMTimeZ;
- private System.Windows.Forms.Label lblIMStampFormat;
- private System.Windows.Forms.TextBox txtIMStampFormat;
- private System.Windows.Forms.GroupBox gbxIMStamps;
- private System.Windows.Forms.GroupBox gbxTimestamps;
- private System.Windows.Forms.CheckBox chkListUserName;
- private System.Windows.Forms.Label lblProfNoteTxt;
- private System.Windows.Forms.Label lblProfNote;
- private System.Windows.Forms.CheckBox chkIMTimestamps;
- private System.Windows.Forms.GroupBox gbxIM;
- private System.Windows.Forms.Label lblProfile;
- private System.Windows.Forms.ComboBox cbxProfiles;
- private System.Windows.Forms.Button btnPDelete;
- private System.Windows.Forms.GroupBox gbxProfiles;
- private System.Windows.Forms.CheckBox chkYouName;
- private System.Windows.Forms.CheckBox chkChatTimestamps;
- private System.Windows.Forms.GroupBox gbxChat;
- private System.Windows.Forms.GroupBox gbxGeneral;
- private System.Windows.Forms.Button btnApply;
- private System.Windows.Forms.Button btnCancel;
- private System.Windows.Forms.Button btnOk;
- private System.Windows.Forms.ListBox lbxChoices;
- }
-}
+/*
+ * Created by SharpDevelop.
+ * User: ${USER}
+ * Date: ${DATE}
+ * Time: ${TIME}
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+namespace SLChat
+{
+ partial class frmPrefs : System.Windows.Forms.Form
+ {
+ ///
+ /// Designer variable used to keep track of non-visual components.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Disposes resources used by the form.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing) {
+ if (components != null) {
+ components.Dispose();
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+ ///
+ /// This method is required for Windows Forms designer support.
+ /// Do not change the method contents inside the source code editor. The Forms designer might
+ /// not be able to load this method if it was changed manually.
+ ///
+ private void InitializeComponent()
+ {
+ this.lbxChoices = new System.Windows.Forms.ListBox();
+ this.btnOk = new System.Windows.Forms.Button();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.btnApply = new System.Windows.Forms.Button();
+ this.gbxGeneral = new System.Windows.Forms.GroupBox();
+ this.gbxChat = new System.Windows.Forms.GroupBox();
+ this.chkListUserName = new System.Windows.Forms.CheckBox();
+ this.chkYouName = new System.Windows.Forms.CheckBox();
+ this.gbxProfiles = new System.Windows.Forms.GroupBox();
+ this.lblProfNote = new System.Windows.Forms.Label();
+ this.lblProfNoteTxt = new System.Windows.Forms.Label();
+ this.btnPDelete = new System.Windows.Forms.Button();
+ this.cbxProfiles = new System.Windows.Forms.ComboBox();
+ this.lblProfile = new System.Windows.Forms.Label();
+ this.gbxIM = new System.Windows.Forms.GroupBox();
+ this.gbxTimestamps = new System.Windows.Forms.GroupBox();
+ this.chkSyncStamps = new System.Windows.Forms.CheckBox();
+ this.gbxIMStamps = new System.Windows.Forms.GroupBox();
+ this.txtIMStampFormat = new System.Windows.Forms.TextBox();
+ this.lblIMStampFormat = new System.Windows.Forms.Label();
+ this.numIMTimeZ = new System.Windows.Forms.NumericUpDown();
+ this.lblIMTimeZ = new System.Windows.Forms.Label();
+ this.gbxChatStamps = new System.Windows.Forms.GroupBox();
+ this.txtChatStampFormat = new System.Windows.Forms.TextBox();
+ this.lblChatStampFormat = new System.Windows.Forms.Label();
+ this.numChatTimeZ = new System.Windows.Forms.NumericUpDown();
+ this.lblChatTimeZ = new System.Windows.Forms.Label();
+ this.chkIMTimestamps = new System.Windows.Forms.CheckBox();
+ this.chkChatTimestamps = new System.Windows.Forms.CheckBox();
+ this.btnDefaults = new System.Windows.Forms.Button();
+ this.gbxChat.SuspendLayout();
+ this.gbxProfiles.SuspendLayout();
+ this.gbxTimestamps.SuspendLayout();
+ this.gbxIMStamps.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numIMTimeZ)).BeginInit();
+ this.gbxChatStamps.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numChatTimeZ)).BeginInit();
+ this.SuspendLayout();
+ //
+ // lbxChoices
+ //
+ this.lbxChoices.FormattingEnabled = true;
+ this.lbxChoices.Items.AddRange(new object[] {
+ "General",
+ "Profiles",
+ "Chat",
+ "IM",
+ "Timestamps"});
+ this.lbxChoices.Location = new System.Drawing.Point(3, 6);
+ this.lbxChoices.Name = "lbxChoices";
+ this.lbxChoices.Size = new System.Drawing.Size(100, 316);
+ this.lbxChoices.TabIndex = 0;
+ this.lbxChoices.SelectedIndexChanged += new System.EventHandler(this.LbxChoicesSelectedIndexChanged);
+ //
+ // btnOk
+ //
+ this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnOk.Location = new System.Drawing.Point(250, 325);
+ this.btnOk.Name = "btnOk";
+ this.btnOk.Size = new System.Drawing.Size(75, 23);
+ this.btnOk.TabIndex = 1;
+ this.btnOk.Text = "OK";
+ this.btnOk.UseVisualStyleBackColor = true;
+ this.btnOk.Click += new System.EventHandler(this.BtnOkClick);
+ //
+ // btnCancel
+ //
+ this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.Location = new System.Drawing.Point(330, 325);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(75, 23);
+ this.btnCancel.TabIndex = 2;
+ this.btnCancel.Text = "Cancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ this.btnCancel.Click += new System.EventHandler(this.BtnCancelClick);
+ //
+ // btnApply
+ //
+ this.btnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnApply.Location = new System.Drawing.Point(410, 325);
+ this.btnApply.Name = "btnApply";
+ this.btnApply.Size = new System.Drawing.Size(75, 23);
+ this.btnApply.TabIndex = 3;
+ this.btnApply.Text = "Apply";
+ this.btnApply.UseVisualStyleBackColor = true;
+ this.btnApply.Click += new System.EventHandler(this.BtnApplyClick);
+ //
+ // gbxGeneral
+ //
+ this.gbxGeneral.Location = new System.Drawing.Point(106, 6);
+ this.gbxGeneral.Name = "gbxGeneral";
+ this.gbxGeneral.Size = new System.Drawing.Size(380, 315);
+ this.gbxGeneral.TabIndex = 4;
+ this.gbxGeneral.TabStop = false;
+ this.gbxGeneral.Text = "General";
+ //
+ // gbxChat
+ //
+ this.gbxChat.Controls.Add(this.chkListUserName);
+ this.gbxChat.Controls.Add(this.chkYouName);
+ this.gbxChat.Location = new System.Drawing.Point(106, 6);
+ this.gbxChat.Name = "gbxChat";
+ this.gbxChat.Size = new System.Drawing.Size(380, 315);
+ this.gbxChat.TabIndex = 5;
+ this.gbxChat.TabStop = false;
+ this.gbxChat.Text = "Chat";
+ //
+ // chkListUserName
+ //
+ this.chkListUserName.Location = new System.Drawing.Point(6, 46);
+ this.chkListUserName.Name = "chkListUserName";
+ this.chkListUserName.Size = new System.Drawing.Size(193, 24);
+ this.chkListUserName.TabIndex = 2;
+ this.chkListUserName.Text = "List you in local chat\'s resident list";
+ this.chkListUserName.UseVisualStyleBackColor = true;
+ //
+ // chkYouName
+ //
+ this.chkYouName.Location = new System.Drawing.Point(6, 20);
+ this.chkYouName.Name = "chkYouName";
+ this.chkYouName.Size = new System.Drawing.Size(179, 24);
+ this.chkYouName.TabIndex = 0;
+ this.chkYouName.Text = "Use full name instead of \"You\"";
+ this.chkYouName.UseVisualStyleBackColor = true;
+ //
+ // gbxProfiles
+ //
+ this.gbxProfiles.Controls.Add(this.lblProfNote);
+ this.gbxProfiles.Controls.Add(this.lblProfNoteTxt);
+ this.gbxProfiles.Controls.Add(this.btnPDelete);
+ this.gbxProfiles.Controls.Add(this.cbxProfiles);
+ this.gbxProfiles.Controls.Add(this.lblProfile);
+ this.gbxProfiles.Location = new System.Drawing.Point(106, 6);
+ this.gbxProfiles.Name = "gbxProfiles";
+ this.gbxProfiles.Size = new System.Drawing.Size(380, 315);
+ this.gbxProfiles.TabIndex = 5;
+ this.gbxProfiles.TabStop = false;
+ this.gbxProfiles.Text = "Profiles";
+ //
+ // lblProfNote
+ //
+ this.lblProfNote.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblProfNote.ForeColor = System.Drawing.Color.Red;
+ this.lblProfNote.Location = new System.Drawing.Point(6, 25);
+ this.lblProfNote.Name = "lblProfNote";
+ this.lblProfNote.Size = new System.Drawing.Size(38, 14);
+ this.lblProfNote.TabIndex = 4;
+ this.lblProfNote.Text = "Note:";
+ //
+ // lblProfNoteTxt
+ //
+ this.lblProfNoteTxt.Location = new System.Drawing.Point(41, 25);
+ this.lblProfNoteTxt.Name = "lblProfNoteTxt";
+ this.lblProfNoteTxt.Size = new System.Drawing.Size(336, 14);
+ this.lblProfNoteTxt.TabIndex = 3;
+ this.lblProfNoteTxt.Text = "Changes to profiles are effective immedietly and can not be undone.";
+ //
+ // btnPDelete
+ //
+ this.btnPDelete.Location = new System.Drawing.Point(141, 75);
+ this.btnPDelete.Name = "btnPDelete";
+ this.btnPDelete.Size = new System.Drawing.Size(75, 23);
+ this.btnPDelete.TabIndex = 2;
+ this.btnPDelete.Text = "Delete";
+ this.btnPDelete.UseVisualStyleBackColor = true;
+ this.btnPDelete.Click += new System.EventHandler(this.BtnPDeleteClick);
+ //
+ // cbxProfiles
+ //
+ this.cbxProfiles.FormattingEnabled = true;
+ this.cbxProfiles.Location = new System.Drawing.Point(50, 48);
+ this.cbxProfiles.Name = "cbxProfiles";
+ this.cbxProfiles.Size = new System.Drawing.Size(166, 21);
+ this.cbxProfiles.TabIndex = 1;
+ //
+ // lblProfile
+ //
+ this.lblProfile.Location = new System.Drawing.Point(6, 51);
+ this.lblProfile.Name = "lblProfile";
+ this.lblProfile.Size = new System.Drawing.Size(50, 17);
+ this.lblProfile.TabIndex = 0;
+ this.lblProfile.Text = "Profile:";
+ //
+ // gbxIM
+ //
+ this.gbxIM.Location = new System.Drawing.Point(106, 6);
+ this.gbxIM.Name = "gbxIM";
+ this.gbxIM.Size = new System.Drawing.Size(380, 315);
+ this.gbxIM.TabIndex = 6;
+ this.gbxIM.TabStop = false;
+ this.gbxIM.Text = "IM";
+ //
+ // gbxTimestamps
+ //
+ this.gbxTimestamps.Controls.Add(this.chkSyncStamps);
+ this.gbxTimestamps.Controls.Add(this.gbxIMStamps);
+ this.gbxTimestamps.Controls.Add(this.gbxChatStamps);
+ this.gbxTimestamps.Controls.Add(this.chkIMTimestamps);
+ this.gbxTimestamps.Controls.Add(this.chkChatTimestamps);
+ this.gbxTimestamps.Location = new System.Drawing.Point(106, 6);
+ this.gbxTimestamps.Name = "gbxTimestamps";
+ this.gbxTimestamps.Size = new System.Drawing.Size(380, 315);
+ this.gbxTimestamps.TabIndex = 7;
+ this.gbxTimestamps.TabStop = false;
+ this.gbxTimestamps.Text = "Timestamps";
+ //
+ // chkSyncStamps
+ //
+ this.chkSyncStamps.Location = new System.Drawing.Point(6, 132);
+ this.chkSyncStamps.Name = "chkSyncStamps";
+ this.chkSyncStamps.Size = new System.Drawing.Size(270, 24);
+ this.chkSyncStamps.TabIndex = 2;
+ this.chkSyncStamps.Text = "Sync Settings (IM matches Chat)(Not yet working)";
+ this.chkSyncStamps.UseVisualStyleBackColor = true;
+ //
+ // gbxIMStamps
+ //
+ this.gbxIMStamps.Controls.Add(this.txtIMStampFormat);
+ this.gbxIMStamps.Controls.Add(this.lblIMStampFormat);
+ this.gbxIMStamps.Controls.Add(this.numIMTimeZ);
+ this.gbxIMStamps.Controls.Add(this.lblIMTimeZ);
+ this.gbxIMStamps.Location = new System.Drawing.Point(6, 200);
+ this.gbxIMStamps.Name = "gbxIMStamps";
+ this.gbxIMStamps.Size = new System.Drawing.Size(367, 68);
+ this.gbxIMStamps.TabIndex = 4;
+ this.gbxIMStamps.TabStop = false;
+ this.gbxIMStamps.Text = "IM";
+ //
+ // txtIMStampFormat
+ //
+ this.txtIMStampFormat.Location = new System.Drawing.Point(115, 38);
+ this.txtIMStampFormat.Name = "txtIMStampFormat";
+ this.txtIMStampFormat.Size = new System.Drawing.Size(100, 21);
+ this.txtIMStampFormat.TabIndex = 1;
+ //
+ // lblIMStampFormat
+ //
+ this.lblIMStampFormat.Location = new System.Drawing.Point(6, 41);
+ this.lblIMStampFormat.Name = "lblIMStampFormat";
+ this.lblIMStampFormat.Size = new System.Drawing.Size(100, 15);
+ this.lblIMStampFormat.TabIndex = 3;
+ this.lblIMStampFormat.Text = "Timestamp Format:";
+ //
+ // numIMTimeZ
+ //
+ this.numIMTimeZ.Location = new System.Drawing.Point(170, 15);
+ this.numIMTimeZ.Maximum = new decimal(new int[] {
+ 24,
+ 0,
+ 0,
+ 0});
+ this.numIMTimeZ.Minimum = new decimal(new int[] {
+ 24,
+ 0,
+ 0,
+ -2147483648});
+ this.numIMTimeZ.Name = "numIMTimeZ";
+ this.numIMTimeZ.Size = new System.Drawing.Size(45, 21);
+ this.numIMTimeZ.TabIndex = 0;
+ //
+ // lblIMTimeZ
+ //
+ this.lblIMTimeZ.Location = new System.Drawing.Point(6, 17);
+ this.lblIMTimeZ.Name = "lblIMTimeZ";
+ this.lblIMTimeZ.Size = new System.Drawing.Size(158, 15);
+ this.lblIMTimeZ.TabIndex = 2;
+ this.lblIMTimeZ.Text = "Time Zone Offset (UTC/GMT):";
+ //
+ // gbxChatStamps
+ //
+ this.gbxChatStamps.Controls.Add(this.txtChatStampFormat);
+ this.gbxChatStamps.Controls.Add(this.lblChatStampFormat);
+ this.gbxChatStamps.Controls.Add(this.numChatTimeZ);
+ this.gbxChatStamps.Controls.Add(this.lblChatTimeZ);
+ this.gbxChatStamps.Location = new System.Drawing.Point(6, 42);
+ this.gbxChatStamps.Name = "gbxChatStamps";
+ this.gbxChatStamps.Size = new System.Drawing.Size(367, 68);
+ this.gbxChatStamps.TabIndex = 1;
+ this.gbxChatStamps.TabStop = false;
+ this.gbxChatStamps.Text = "Chat";
+ //
+ // txtChatStampFormat
+ //
+ this.txtChatStampFormat.Location = new System.Drawing.Point(115, 38);
+ this.txtChatStampFormat.Name = "txtChatStampFormat";
+ this.txtChatStampFormat.Size = new System.Drawing.Size(100, 21);
+ this.txtChatStampFormat.TabIndex = 1;
+ //
+ // lblChatStampFormat
+ //
+ this.lblChatStampFormat.Location = new System.Drawing.Point(6, 41);
+ this.lblChatStampFormat.Name = "lblChatStampFormat";
+ this.lblChatStampFormat.Size = new System.Drawing.Size(100, 15);
+ this.lblChatStampFormat.TabIndex = 3;
+ this.lblChatStampFormat.Text = "Timestamp Format:";
+ //
+ // numChatTimeZ
+ //
+ this.numChatTimeZ.Location = new System.Drawing.Point(170, 15);
+ this.numChatTimeZ.Maximum = new decimal(new int[] {
+ 24,
+ 0,
+ 0,
+ 0});
+ this.numChatTimeZ.Minimum = new decimal(new int[] {
+ 24,
+ 0,
+ 0,
+ -2147483648});
+ this.numChatTimeZ.Name = "numChatTimeZ";
+ this.numChatTimeZ.Size = new System.Drawing.Size(45, 21);
+ this.numChatTimeZ.TabIndex = 0;
+ //
+ // lblChatTimeZ
+ //
+ this.lblChatTimeZ.Location = new System.Drawing.Point(6, 17);
+ this.lblChatTimeZ.Name = "lblChatTimeZ";
+ this.lblChatTimeZ.Size = new System.Drawing.Size(158, 15);
+ this.lblChatTimeZ.TabIndex = 2;
+ this.lblChatTimeZ.Text = "Time Zone Offset (UTC/GMT):";
+ //
+ // chkIMTimestamps
+ //
+ this.chkIMTimestamps.Location = new System.Drawing.Point(6, 172);
+ this.chkIMTimestamps.Name = "chkIMTimestamps";
+ this.chkIMTimestamps.Size = new System.Drawing.Size(143, 24);
+ this.chkIMTimestamps.TabIndex = 3;
+ this.chkIMTimestamps.Text = "Show timestamps in IMs";
+ this.chkIMTimestamps.UseVisualStyleBackColor = true;
+ //
+ // chkChatTimestamps
+ //
+ this.chkChatTimestamps.Location = new System.Drawing.Point(6, 20);
+ this.chkChatTimestamps.Name = "chkChatTimestamps";
+ this.chkChatTimestamps.Size = new System.Drawing.Size(153, 24);
+ this.chkChatTimestamps.TabIndex = 0;
+ this.chkChatTimestamps.Text = "Show timestamps in chat";
+ this.chkChatTimestamps.UseVisualStyleBackColor = true;
+ //
+ // btnDefaults
+ //
+ this.btnDefaults.Location = new System.Drawing.Point(3, 325);
+ this.btnDefaults.Name = "btnDefaults";
+ this.btnDefaults.Size = new System.Drawing.Size(100, 23);
+ this.btnDefaults.TabIndex = 4;
+ this.btnDefaults.Text = "Restore Defaults";
+ this.btnDefaults.UseVisualStyleBackColor = true;
+ this.btnDefaults.Click += new System.EventHandler(this.BtnDefaultsClick);
+ //
+ // frmPrefs
+ //
+ this.AcceptButton = this.btnOk;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.btnCancel;
+ this.ClientSize = new System.Drawing.Size(494, 352);
+ this.Controls.Add(this.gbxTimestamps);
+ this.Controls.Add(this.gbxIM);
+ this.Controls.Add(this.btnDefaults);
+ this.Controls.Add(this.gbxChat);
+ this.Controls.Add(this.gbxProfiles);
+ this.Controls.Add(this.gbxGeneral);
+ this.Controls.Add(this.btnApply);
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.btnOk);
+ this.Controls.Add(this.lbxChoices);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "frmPrefs";
+ this.ShowInTaskbar = false;
+ this.Text = "Preferences";
+ this.gbxChat.ResumeLayout(false);
+ this.gbxProfiles.ResumeLayout(false);
+ this.gbxTimestamps.ResumeLayout(false);
+ this.gbxIMStamps.ResumeLayout(false);
+ this.gbxIMStamps.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numIMTimeZ)).EndInit();
+ this.gbxChatStamps.ResumeLayout(false);
+ this.gbxChatStamps.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.numChatTimeZ)).EndInit();
+ this.ResumeLayout(false);
+ }
+ private System.Windows.Forms.Button btnDefaults;
+ private System.Windows.Forms.CheckBox chkSyncStamps;
+ private System.Windows.Forms.Label lblChatTimeZ;
+ private System.Windows.Forms.NumericUpDown numChatTimeZ;
+ private System.Windows.Forms.Label lblChatStampFormat;
+ private System.Windows.Forms.TextBox txtChatStampFormat;
+ private System.Windows.Forms.GroupBox gbxChatStamps;
+ private System.Windows.Forms.Label lblIMTimeZ;
+ private System.Windows.Forms.NumericUpDown numIMTimeZ;
+ private System.Windows.Forms.Label lblIMStampFormat;
+ private System.Windows.Forms.TextBox txtIMStampFormat;
+ private System.Windows.Forms.GroupBox gbxIMStamps;
+ private System.Windows.Forms.GroupBox gbxTimestamps;
+ private System.Windows.Forms.CheckBox chkListUserName;
+ private System.Windows.Forms.Label lblProfNoteTxt;
+ private System.Windows.Forms.Label lblProfNote;
+ private System.Windows.Forms.CheckBox chkIMTimestamps;
+ private System.Windows.Forms.GroupBox gbxIM;
+ private System.Windows.Forms.Label lblProfile;
+ private System.Windows.Forms.ComboBox cbxProfiles;
+ private System.Windows.Forms.Button btnPDelete;
+ private System.Windows.Forms.GroupBox gbxProfiles;
+ private System.Windows.Forms.CheckBox chkYouName;
+ private System.Windows.Forms.CheckBox chkChatTimestamps;
+ private System.Windows.Forms.GroupBox gbxChat;
+ private System.Windows.Forms.GroupBox gbxGeneral;
+ private System.Windows.Forms.Button btnApply;
+ private System.Windows.Forms.Button btnCancel;
+ private System.Windows.Forms.Button btnOk;
+ private System.Windows.Forms.ListBox lbxChoices;
+ }
+}
diff --git a/applications/SLChat/SLChat/GUI/Preferences.cs b/applications/SLChat/SLChat/GUI/Preferences.cs
index caf9055f..1bc773de 100644
--- a/applications/SLChat/SLChat/GUI/Preferences.cs
+++ b/applications/SLChat/SLChat/GUI/Preferences.cs
@@ -1,239 +1,239 @@
-/*
- * Created by SharpDevelop.
- * User: Oz
- * Date: 8/12/2006
- * Time: 12:31 AM
- *
- * To change this template use Tools | Options | Coding | Edit Standard Headers.
- */
-
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-using System.Collections;
-
-namespace SLChat
-{
- ///
- /// Description of Preferences.
- ///
- public partial class frmPrefs
- {
- private frmMain MainForm;
- private PrefsManager prefs;
- //The name of the user whose profiles to load
- //NOTE: format is first_last i.e. "Bob_Smith"
- string user;
- Hashtable settings = new Hashtable();
-
- public frmPrefs(frmMain main, string username, PrefsManager preferences)
- {
- //
- // The InitializeComponent() call is required for Windows Forms designer support.
- //
- InitializeComponent();
-
- lbxChoices.SelectedIndex = lbxChoices.FindString("General");
- user = username;
- prefs = preferences;
- MainForm = main;
- LoadDefaults();
- //our private load settings to handle how they turn out
- //LoadSettings("GeneralSettings");
- LoadSettings("ChatSettings");
- LoadSettings("TimestampSettings");
- //
- // TODO: Add constructor code after the InitializeComponent() call.
- //
- }
-
- private void LoadDefaults()
- {
- //Loads the defaults settings before anything else
- //Chat
- chkYouName.Checked = false;
- chkListUserName.Checked = true;
- //Timestamps
- chkIMTimestamps.Checked = true;
- chkChatTimestamps.Checked = false;
- numIMTimeZ.Text = "-3";
- numChatTimeZ.Text = "-7";
- txtIMStampFormat.Text = "[HH:mm] ";
- txtChatStampFormat.Text = "[HH:mm] ";
- chkSyncStamps.Checked = true;
- }
-
- private void LoadSettings(string parentnode)
- {
- prefs.LoadSettings(user,parentnode);
-
- settings = prefs.settings;
-
- if(!settings.ContainsKey("Error"))
- {
- IDictionaryEnumerator myEnum = settings.GetEnumerator();
- while (myEnum.MoveNext())
- {
- if(parentnode=="ChatSettings")
- {
- if(myEnum.Key.ToString()=="UseFullName")
- {
- if(myEnum.Value.ToString()=="true"){
- chkYouName.Checked = prefs.setUseFullName = true;
- }else{
- chkYouName.Checked = prefs.setUseFullName = false;
- }
- }else if(myEnum.Key.ToString()=="ListUserName"){
- if(myEnum.Value.ToString()=="true"){
- chkListUserName.Checked = prefs.setListUserName = true;
- }else{
- chkListUserName.Checked = prefs.setListUserName = false;
- }
- }
- }else if(parentnode=="TimestampSettings"){
- if(myEnum.Key.ToString()=="ShowIMTimestamps")
- {
- if(myEnum.Value.ToString()=="true")
- {
- chkIMTimestamps.Checked = prefs.setIMTimestamps = true;
- }else{
- chkIMTimestamps.Checked = prefs.setIMTimestamps = false;
- }
- }else if(myEnum.Key.ToString()=="ShowChatTimestamps"){
- if(myEnum.Value.ToString()=="true"){
- chkChatTimestamps.Checked = prefs.setChatTimestamps = true;
- }else{
- chkChatTimestamps.Checked = prefs.setChatTimestamps = false;
- }
- }else if(myEnum.Key.ToString()=="IMTimeZone"){
- numIMTimeZ.Text = prefs.setIMTimeZ = myEnum.Value.ToString();
- }else if(myEnum.Key.ToString()=="ChatTimeZone"){
- numChatTimeZ.Text = prefs.setChatTimeZ = myEnum.Value.ToString();
- }else if(myEnum.Key.ToString()=="IMStampFormat"){
- txtIMStampFormat.Text = prefs.setIMStampFormat = myEnum.Value.ToString();
- }else if(myEnum.Key.ToString()=="ChatStampFormat"){
- txtChatStampFormat.Text = prefs.setChatStampFormat = myEnum.Value.ToString();
- }else if(myEnum.Key.ToString()=="SyncStampSettings"){
- if(myEnum.Value.ToString()=="true"){
- chkSyncStamps.Checked = prefs.setSyncTimestamps = true;
- }else{
- chkSyncStamps.Checked = prefs.setSyncTimestamps = false;
- }
- }
- }
- }
- }else{
- IDictionaryEnumerator myEnum = settings.GetEnumerator();
- while (myEnum.MoveNext())
- {
- if(myEnum.Key.ToString()=="Error")
- {
- //rtbStatus.Text = "Error loading settings: "+myEnum.Value.ToString();
- }
- }
- }
- settings.Clear();
- prefs.settings.Clear();
- }
-
- private void SaveSettings()
- {
- if(chkYouName.Checked != prefs.setUseFullName
- | chkListUserName.Checked != prefs.setListUserName)
- {
- string strChat = ""+
- "";
- prefs.SaveSettings(user,"ChatSettings",strChat);
- MainForm.LoadSettings("ChatSettings");
- }
-
- if(chkIMTimestamps.Checked != prefs.setIMTimestamps | chkChatTimestamps.Checked != prefs.setChatTimestamps |
- numIMTimeZ.Text != prefs.setIMTimeZ | numChatTimeZ.Text != prefs.setChatTimeZ |
- txtIMStampFormat.Text != prefs.setIMStampFormat | txtChatStampFormat.Text != prefs.setChatStampFormat |
- chkSyncStamps.Checked != prefs.setSyncTimestamps)
- {
- string strStamps = ""+
- ""+
- ""+
- ""+
- ""+
- ""+
- "";
- prefs.SaveSettings(user,"TimestampSettings",strStamps);
- MainForm.LoadSettings("TimestampSettings");
- }
- }
-
- public void LbxChoicesSelectedIndexChanged(object sender, System.EventArgs e)
- {
- gbxGeneral.Visible = false;
- gbxChat.Visible = false;
- gbxIM.Visible = false;
- gbxTimestamps.Visible = false;
- gbxProfiles.Visible = false;
- if(lbxChoices.SelectedItem.ToString() == "General")
- {
- gbxGeneral.Visible = true;
- }else if(lbxChoices.SelectedItem.ToString() == "Chat"){
- gbxChat.Visible = true;
- }else if(lbxChoices.SelectedItem.ToString() == "IM"){
- gbxIM.Visible = true;
- }else if(lbxChoices.SelectedItem.ToString() == "Timestamps"){
- gbxTimestamps.Visible = true;
- }else if(lbxChoices.SelectedItem.ToString() == "Profiles"){
- gbxProfiles.Visible = true;
- prefs.LoadProfiles();
- //Load the profiles to our combobox.
- cbxProfiles.Items.Clear();
- string[] profiles = new string[100];
- profiles = prefs.profiles;
- for(int i=0;i
+ /// Description of Preferences.
+ ///
+ public partial class frmPrefs
+ {
+ private frmMain MainForm;
+ private PrefsManager prefs;
+ //The name of the user whose profiles to load
+ //NOTE: format is first_last i.e. "Bob_Smith"
+ string user;
+ Hashtable settings = new Hashtable();
+
+ public frmPrefs(frmMain main, string username, PrefsManager preferences)
+ {
+ //
+ // The InitializeComponent() call is required for Windows Forms designer support.
+ //
+ InitializeComponent();
+
+ lbxChoices.SelectedIndex = lbxChoices.FindString("General");
+ user = username;
+ prefs = preferences;
+ MainForm = main;
+ LoadDefaults();
+ //our private load settings to handle how they turn out
+ //LoadSettings("GeneralSettings");
+ LoadSettings("ChatSettings");
+ LoadSettings("TimestampSettings");
+ //
+ // TODO: Add constructor code after the InitializeComponent() call.
+ //
+ }
+
+ private void LoadDefaults()
+ {
+ //Loads the defaults settings before anything else
+ //Chat
+ chkYouName.Checked = false;
+ chkListUserName.Checked = true;
+ //Timestamps
+ chkIMTimestamps.Checked = true;
+ chkChatTimestamps.Checked = false;
+ numIMTimeZ.Text = "-3";
+ numChatTimeZ.Text = "-7";
+ txtIMStampFormat.Text = "[HH:mm] ";
+ txtChatStampFormat.Text = "[HH:mm] ";
+ chkSyncStamps.Checked = true;
+ }
+
+ private void LoadSettings(string parentnode)
+ {
+ prefs.LoadSettings(user,parentnode);
+
+ settings = prefs.settings;
+
+ if(!settings.ContainsKey("Error"))
+ {
+ IDictionaryEnumerator myEnum = settings.GetEnumerator();
+ while (myEnum.MoveNext())
+ {
+ if(parentnode=="ChatSettings")
+ {
+ if(myEnum.Key.ToString()=="UseFullName")
+ {
+ if(myEnum.Value.ToString()=="true"){
+ chkYouName.Checked = prefs.setUseFullName = true;
+ }else{
+ chkYouName.Checked = prefs.setUseFullName = false;
+ }
+ }else if(myEnum.Key.ToString()=="ListUserName"){
+ if(myEnum.Value.ToString()=="true"){
+ chkListUserName.Checked = prefs.setListUserName = true;
+ }else{
+ chkListUserName.Checked = prefs.setListUserName = false;
+ }
+ }
+ }else if(parentnode=="TimestampSettings"){
+ if(myEnum.Key.ToString()=="ShowIMTimestamps")
+ {
+ if(myEnum.Value.ToString()=="true")
+ {
+ chkIMTimestamps.Checked = prefs.setIMTimestamps = true;
+ }else{
+ chkIMTimestamps.Checked = prefs.setIMTimestamps = false;
+ }
+ }else if(myEnum.Key.ToString()=="ShowChatTimestamps"){
+ if(myEnum.Value.ToString()=="true"){
+ chkChatTimestamps.Checked = prefs.setChatTimestamps = true;
+ }else{
+ chkChatTimestamps.Checked = prefs.setChatTimestamps = false;
+ }
+ }else if(myEnum.Key.ToString()=="IMTimeZone"){
+ numIMTimeZ.Text = prefs.setIMTimeZ = myEnum.Value.ToString();
+ }else if(myEnum.Key.ToString()=="ChatTimeZone"){
+ numChatTimeZ.Text = prefs.setChatTimeZ = myEnum.Value.ToString();
+ }else if(myEnum.Key.ToString()=="IMStampFormat"){
+ txtIMStampFormat.Text = prefs.setIMStampFormat = myEnum.Value.ToString();
+ }else if(myEnum.Key.ToString()=="ChatStampFormat"){
+ txtChatStampFormat.Text = prefs.setChatStampFormat = myEnum.Value.ToString();
+ }else if(myEnum.Key.ToString()=="SyncStampSettings"){
+ if(myEnum.Value.ToString()=="true"){
+ chkSyncStamps.Checked = prefs.setSyncTimestamps = true;
+ }else{
+ chkSyncStamps.Checked = prefs.setSyncTimestamps = false;
+ }
+ }
+ }
+ }
+ }else{
+ IDictionaryEnumerator myEnum = settings.GetEnumerator();
+ while (myEnum.MoveNext())
+ {
+ if(myEnum.Key.ToString()=="Error")
+ {
+ //rtbStatus.Text = "Error loading settings: "+myEnum.Value.ToString();
+ }
+ }
+ }
+ settings.Clear();
+ prefs.settings.Clear();
+ }
+
+ private void SaveSettings()
+ {
+ if(chkYouName.Checked != prefs.setUseFullName
+ | chkListUserName.Checked != prefs.setListUserName)
+ {
+ string strChat = ""+
+ "";
+ prefs.SaveSettings(user,"ChatSettings",strChat);
+ MainForm.LoadSettings("ChatSettings");
+ }
+
+ if(chkIMTimestamps.Checked != prefs.setIMTimestamps | chkChatTimestamps.Checked != prefs.setChatTimestamps |
+ numIMTimeZ.Text != prefs.setIMTimeZ | numChatTimeZ.Text != prefs.setChatTimeZ |
+ txtIMStampFormat.Text != prefs.setIMStampFormat | txtChatStampFormat.Text != prefs.setChatStampFormat |
+ chkSyncStamps.Checked != prefs.setSyncTimestamps)
+ {
+ string strStamps = ""+
+ ""+
+ ""+
+ ""+
+ ""+
+ ""+
+ "";
+ prefs.SaveSettings(user,"TimestampSettings",strStamps);
+ MainForm.LoadSettings("TimestampSettings");
+ }
+ }
+
+ public void LbxChoicesSelectedIndexChanged(object sender, System.EventArgs e)
+ {
+ gbxGeneral.Visible = false;
+ gbxChat.Visible = false;
+ gbxIM.Visible = false;
+ gbxTimestamps.Visible = false;
+ gbxProfiles.Visible = false;
+ if(lbxChoices.SelectedItem.ToString() == "General")
+ {
+ gbxGeneral.Visible = true;
+ }else if(lbxChoices.SelectedItem.ToString() == "Chat"){
+ gbxChat.Visible = true;
+ }else if(lbxChoices.SelectedItem.ToString() == "IM"){
+ gbxIM.Visible = true;
+ }else if(lbxChoices.SelectedItem.ToString() == "Timestamps"){
+ gbxTimestamps.Visible = true;
+ }else if(lbxChoices.SelectedItem.ToString() == "Profiles"){
+ gbxProfiles.Visible = true;
+ prefs.LoadProfiles();
+ //Load the profiles to our combobox.
+ cbxProfiles.Items.Clear();
+ string[] profiles = new string[100];
+ profiles = prefs.profiles;
+ for(int i=0;i
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
\ No newline at end of file
diff --git a/applications/SLChat/SLChat/Program.cs b/applications/SLChat/SLChat/Program.cs
index 7ddc73bb..bf41f2db 100644
--- a/applications/SLChat/SLChat/Program.cs
+++ b/applications/SLChat/SLChat/Program.cs
@@ -1,20 +1,20 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace SLChat
-{
- static class Program
- {
- ///
- /// The main entry point for the application.
- ///
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new frmLogin());
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace SLChat
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new frmLogin());
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/Properties/AssemblyInfo.cs b/applications/SLChat/SLChat/Properties/AssemblyInfo.cs
index 3794ed0f..1590c444 100644
--- a/applications/SLChat/SLChat/Properties/AssemblyInfo.cs
+++ b/applications/SLChat/SLChat/Properties/AssemblyInfo.cs
@@ -1,33 +1,33 @@
-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("SLChat")]
-[assembly: AssemblyDescription("Text only SL client")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-//[assembly: AssemblyProduct("SLChat")]
-[assembly: AssemblyCopyright("Copyright © 2006")]
-[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("9b31339a-b5e3-47ad-b6a3-0be444974cf2")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.0.0.3")]
-[assembly: AssemblyFileVersion("0.0.0.3")]
+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("SLChat")]
+[assembly: AssemblyDescription("Text only SL client")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+//[assembly: AssemblyProduct("SLChat")]
+[assembly: AssemblyCopyright("Copyright © 2006")]
+[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("9b31339a-b5e3-47ad-b6a3-0be444974cf2")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("0.0.0.3")]
+[assembly: AssemblyFileVersion("0.0.0.3")]
diff --git a/applications/SLChat/SLChat/Properties/Resources.Designer.cs b/applications/SLChat/SLChat/Properties/Resources.Designer.cs
index 7807b355..4b5699d3 100644
--- a/applications/SLChat/SLChat/Properties/Resources.Designer.cs
+++ b/applications/SLChat/SLChat/Properties/Resources.Designer.cs
@@ -1,71 +1,71 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace SLChat.Properties
-{
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SLChat.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
-}
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.42
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace SLChat.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SLChat.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/Properties/Resources.resx b/applications/SLChat/SLChat/Properties/Resources.resx
index ffecec85..af7dbebb 100644
--- a/applications/SLChat/SLChat/Properties/Resources.resx
+++ b/applications/SLChat/SLChat/Properties/Resources.resx
@@ -1,117 +1,117 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
\ No newline at end of file
diff --git a/applications/SLChat/SLChat/Properties/Settings.Designer.cs b/applications/SLChat/SLChat/Properties/Settings.Designer.cs
index 6a5991ca..f237b06e 100644
--- a/applications/SLChat/SLChat/Properties/Settings.Designer.cs
+++ b/applications/SLChat/SLChat/Properties/Settings.Designer.cs
@@ -1,30 +1,30 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace SLChat.Properties
-{
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
-}
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.42
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace SLChat.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/Properties/Settings.settings b/applications/SLChat/SLChat/Properties/Settings.settings
index abf36c5d..39645652 100644
--- a/applications/SLChat/SLChat/Properties/Settings.settings
+++ b/applications/SLChat/SLChat/Properties/Settings.settings
@@ -1,7 +1,7 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/applications/SLChat/SLChat/SLChat.csproj b/applications/SLChat/SLChat/SLChat.csproj
index 7877134c..c5a9857e 100644
--- a/applications/SLChat/SLChat/SLChat.csproj
+++ b/applications/SLChat/SLChat/SLChat.csproj
@@ -1,131 +1,131 @@
-
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {A6D955CD-1F55-459F-A7AD-01E591404989}
- WinExe
- Properties
- SLChat
- SLChat
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
- D:\Oz's Files\Second Life Stuff\libsecondlife\libsecondlife-cs\bin\Debug\libsecondlife.dll
- False
-
-
-
-
- Form
-
-
- About.cs
-
-
-
- UserControl
-
-
- IMTabWindow.cs
-
-
-
- Form
-
-
- InstantMessages.cs
-
-
-
- Form
-
-
- Login.cs
-
-
- Form
-
-
- MainForm.cs
-
-
-
-
-
-
-
- Designer
- About.cs
-
-
- Designer
- IMTabWindow.cs
-
-
- Designer
- InstantMessages.cs
-
-
- Designer
- Login.cs
-
-
- Designer
- MainForm.cs
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- True
- Settings.settings
- True
-
-
-
-
- Preferences.cs
-
-
-
- Preferences.cs
-
-
-
-
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {A6D955CD-1F55-459F-A7AD-01E591404989}
+ WinExe
+ Properties
+ SLChat
+ SLChat
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+ D:\Oz's Files\Second Life Stuff\libsecondlife\libsecondlife-cs\bin\Debug\libsecondlife.dll
+ False
+
+
+
+
+ Form
+
+
+ About.cs
+
+
+
+ UserControl
+
+
+ IMTabWindow.cs
+
+
+
+ Form
+
+
+ InstantMessages.cs
+
+
+
+ Form
+
+
+ Login.cs
+
+
+ Form
+
+
+ MainForm.cs
+
+
+
+
+
+
+
+ Designer
+ About.cs
+
+
+ Designer
+ IMTabWindow.cs
+
+
+ Designer
+ InstantMessages.cs
+
+
+ Designer
+ Login.cs
+
+
+ Designer
+ MainForm.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+ Preferences.cs
+
+
+
+ Preferences.cs
+
+
+
+
\ No newline at end of file
diff --git a/applications/SLChat/SLChat/SLNetCom/SLLoginOptions.cs b/applications/SLChat/SLChat/SLNetCom/SLLoginOptions.cs
index 5f6af7c0..235d16d3 100644
--- a/applications/SLChat/SLChat/SLNetCom/SLLoginOptions.cs
+++ b/applications/SLChat/SLChat/SLNetCom/SLLoginOptions.cs
@@ -1,68 +1,68 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SLNetworkComm
-{
- public class SLLoginOptions
- {
- private string firstName;
- private string lastName;
- private string password;
- private string author = string.Empty;
- private string userAgent = string.Empty;
- private string startLocation = "Home";
-
- public SLLoginOptions()
- {
-
- }
-
- public string FirstName
- {
- get { return firstName; }
- set { firstName = value; }
- }
-
- public string LastName
- {
- get { return lastName; }
- set { lastName = value; }
- }
-
- public string FullName
- {
- get
- {
- if (string.IsNullOrEmpty(firstName) || string.IsNullOrEmpty(lastName))
- return string.Empty;
- else
- return firstName + " " + lastName;
- }
- }
-
- public string Password
- {
- get { return password; }
- set { password = value; }
- }
-
- public string StartLocation
- {
- get { return startLocation; }
- set { startLocation = value; }
- }
-
- public string UserAgent
- {
- get { return userAgent; }
- set { userAgent = value; }
- }
-
- public string Author
- {
- get { return author; }
- set { author = value; }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SLNetworkComm
+{
+ public class SLLoginOptions
+ {
+ private string firstName;
+ private string lastName;
+ private string password;
+ private string author = string.Empty;
+ private string userAgent = string.Empty;
+ private string startLocation = "Home";
+
+ public SLLoginOptions()
+ {
+
+ }
+
+ public string FirstName
+ {
+ get { return firstName; }
+ set { firstName = value; }
+ }
+
+ public string LastName
+ {
+ get { return lastName; }
+ set { lastName = value; }
+ }
+
+ public string FullName
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(firstName) || string.IsNullOrEmpty(lastName))
+ return string.Empty;
+ else
+ return firstName + " " + lastName;
+ }
+ }
+
+ public string Password
+ {
+ get { return password; }
+ set { password = value; }
+ }
+
+ public string StartLocation
+ {
+ get { return startLocation; }
+ set { startLocation = value; }
+ }
+
+ public string UserAgent
+ {
+ get { return userAgent; }
+ set { userAgent = value; }
+ }
+
+ public string Author
+ {
+ get { return author; }
+ set { author = value; }
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/SLNetCom/SLNetCom.cs b/applications/SLChat/SLChat/SLNetCom/SLNetCom.cs
index da0379f3..e2d2a3ec 100644
--- a/applications/SLChat/SLChat/SLNetCom/SLNetCom.cs
+++ b/applications/SLChat/SLChat/SLNetCom/SLNetCom.cs
@@ -1,357 +1,357 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Text;
-using libsecondlife;
-
-namespace SLNetworkComm
-{
- ///
- /// Description of SLNetCom:
- /// NetCom stands for Network Communication
- /// Basically all functions that have to do with communicating
- /// too and from SL should happen in here. This keeps things
- /// organized and interface seperate from network code.
- ///
- public partial class SLNetCom
- {
- private SecondLife client;
- private bool loggedIn = false;
- private SLLoginOptions loginOptions;
-
- // NetcomSync is used for raising IM/Chat events on the
- // GUI/main thread. Useful if you're modifying GUI controls
- // in the client app when responding to IM/Chat events.
- private ISynchronizeInvoke netcomSync;
-
- public SLNetCom()
- {
- this.InitializeClient();
- loginOptions = new SLLoginOptions();
- }
-
- public SLNetCom(string firstName, string lastName, string password, string loginLocation)
- {
- this.InitializeClient();
-
- loginOptions = new SLLoginOptions();
- loginOptions.FirstName = firstName;
- loginOptions.LastName = lastName;
- loginOptions.Password = password;
- loginOptions.StartLocation = loginLocation;
- }
-
- public SLNetCom(SLLoginOptions logOptions)
- {
- this.InitializeClient();
- loginOptions = logOptions;
- }
-
- private void InitializeClient()
- {
- client = new SecondLife("keywords.txt", "message_template.msg");
- client.Network.RegisterCallback("ChatFromSimulator", new PacketCallback(ChatIncoming));
- client.Network.RegisterCallback("ImprovedInstantMessage", new PacketCallback(InstantMessageIncoming));
- }
-
- private void InstantMessageIncoming(Packet packet, Simulator simulator)
- {
- if (packet.Layout.Name != "ImprovedInstantMessage") return;
-
- LLUUID FromAgentID = new LLUUID();
- LLUUID ToAgentID = new LLUUID();
- uint ParentEstateID = 0;
- LLUUID RegionID = new LLUUID();
- LLVector3 Position = new LLVector3();
- bool Offline = false;
- byte Dialog = 0;
- LLUUID ID = new LLUUID();
- uint Timestamp = 0;
- DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0); //The Unix epoch!
- string FromAgentName = string.Empty;
- string Message = string.Empty;
- string BinaryBucket = string.Empty;
-
- ArrayList blocks = packet.Blocks();
-
- foreach (Block block in blocks)
- {
- foreach (Field field in block.Fields)
- {
- switch (field.Layout.Name)
- {
- case "FromAgentID":
- FromAgentID = (LLUUID)field.Data;
- break;
-
- case "ToAgentID":
- ToAgentID = (LLUUID)field.Data;
- break;
-
- case "ParentEstateID":
- ParentEstateID = (uint)field.Data;
- break;
-
- case "RegionID":
- RegionID = (LLUUID)field.Data;
- break;
-
- case "Position":
- Position = (LLVector3)field.Data;
- break;
-
- case "Offline":
- Offline = ((byte)field.Data == 1 ? true : false);
- break;
-
- case "Dialog":
- Dialog = (byte)field.Data;
- break;
-
- case "ID":
- ID = (LLUUID)field.Data;
- break;
-
- case "Timestamp":
- Timestamp = (uint)field.Data;
-
- if (Timestamp == 0) //User is online
- dt = DateTime.Now;
- else //User is offline
- dt = dt.AddSeconds(Timestamp);
-
- break;
-
- case "FromAgentName":
- FromAgentName = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty);
- break;
-
- case "Message":
- Message = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty);
- break;
-
- case "BinaryBucket":
- BinaryBucket = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty);
- break;
- }
- }
-
- InstantMessageEventArgs eventArgs = new InstantMessageEventArgs(
- FromAgentID, ToAgentID, ParentEstateID, RegionID,
- Position, Offline, Dialog, ID,
- dt, FromAgentName, Message, BinaryBucket);
-
- if (netcomSync != null)
- {
- object[] ea = new object[1];
- ea[0] = eventArgs;
- netcomSync.Invoke(new OnInstantMessageRaise(OnInstantMessageReceived), ea);
- }
- else
- {
- OnInstantMessageReceived(eventArgs);
- }
- }
- }
-
- private void ChatIncoming(Packet packet, Simulator simulator)
- {
- if (packet.Layout.Name != "ChatFromSimulator") return;
-
- string fromname = string.Empty; //Name of source.
- LLUUID sourceid = new LLUUID(); //UUID of source, object/avatar
- LLUUID ownerid = new LLUUID(); //UUID of owner, if object UUID = owner of object, if avatar UUID = same as source
- SLSourceType sourcetype = SLSourceType.None;
- SLChatType chattype = SLChatType.Whisper;
- bool audible = false; //Audible: 1 if audible, 0 if beyond 20m (message is null)
- LLVector3 position = new LLVector3(); //Region local position of source.
- string message = string.Empty; //Message from source
- byte command = 0; //Unused?
- LLUUID commandID = new LLUUID(); //Unused?
-
- ArrayList blocks = packet.Blocks();
-
- foreach (Block block in blocks)
- {
- foreach (Field field in block.Fields)
- {
- switch (field.Layout.Name)
- {
- case "SourceID":
- sourceid = (LLUUID)field.Data;
- break;
-
- case "OwnerID":
- ownerid = (LLUUID)field.Data;
- break;
-
- case "FromName":
- fromname = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty);
- break;
-
- case "SourceType":
- sourcetype = (SLSourceType)(byte)field.Data;
- break;
-
- case "ChatType":
- chattype = (SLChatType)(byte)field.Data;
- break;
-
- case "Audible":
- audible = ((byte)field.Data == 1 ? true : false);
- break;
-
- case "Message":
- message = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty);
- break;
-
- case "Position":
- position = (LLVector3)field.Data;
- break;
-
- case "Command":
- command = (byte)field.Data;
- break;
-
- case "CommandID":
- commandID = (LLUUID)field.Data;
- break;
- }
- }
-
- ChatEventArgs eventArgs = new ChatEventArgs(
- message, chattype,
- position, sourcetype, sourceid, ownerid,
- fromname, audible, command, commandID);
-
- if (netcomSync != null)
- {
- object[] ea = new object[1];
- ea[0] = eventArgs;
- netcomSync.Invoke(new OnChatRaise(OnChatReceived), ea);
- }
- else
- {
- OnChatReceived(eventArgs);
- }
- }
- }
-
- public void Login()
- {
- //LoginReply will be used to contain the output text.
- string loginReply;
-
- //Checking for empty/null login fields. Leave the Login() method if true.
- if (string.IsNullOrEmpty(loginOptions.FirstName) ||
- string.IsNullOrEmpty(loginOptions.LastName) ||
- string.IsNullOrEmpty(loginOptions.Password) ||
- string.IsNullOrEmpty(loginOptions.StartLocation))
- {
- loginReply = "A login field is blank!";
-
- OnClientLoginError(new ClientLoginEventArgs(loginReply));
- return;
- }
-
- Hashtable loginParams = NetworkManager.DefaultLoginValues(
- loginOptions.FirstName, loginOptions.LastName, loginOptions.Password,
- "00:00:00:00:00:00",
- loginOptions.StartLocation.ToLower(),
- 1, 50, 50, 50, "Win",
- "0", loginOptions.UserAgent, loginOptions.Author);
-
- //uri:Ahern&195&233&30
-
- // An example of how to pass additional options to the login server
- // Request information on the Root Inventory Folder, and Inventory Skeleton
- // alAdditionalInfo.Add("inventory-skeleton");
-
- //ArrayList alAdditionalInfo = new ArrayList();
- //alAdditionalInfo.Add("inventory-root");
- //loginParams.Add("options",alAdditionalInfo);
-
- //Hashtable loginReply = new Hashtable();
-
- if (client.Network.Login(loginParams))
- {
- // Login was successful
- loginReply = "Message of the day: " + client.Network.LoginValues["message"];
- loggedIn = true;
-
- OnClientLoggedIn(new ClientLoginEventArgs(loginReply));
- }
- else
- {
- // Login failed
- loginReply = "Error logging in: " + client.Network.LoginError;
-
- OnClientLoginError(new ClientLoginEventArgs(loginReply));
- }
- }
-
- public void Logout()
- {
- if (!loggedIn) return;
-
- client.Network.Logout();
- loggedIn = false;
-
- string logoutReply = "Successfully logged out!";
- OnClientLoggedOut(new ClientLoginEventArgs(logoutReply));
- }
-
- public void ChatOut(string chat, SLChatType type, int channel)
- {
- if (!loggedIn) return;
- if (string.IsNullOrEmpty(chat)) return;
-
- switch (type)
- {
- case SLChatType.Say:
- client.Avatar.Say(chat, channel);
- break;
-
- case SLChatType.Shout:
- client.Avatar.Shout(chat, channel);
- break;
-
- case SLChatType.Whisper:
- client.Avatar.Whisper(chat, channel);
- break;
- }
-
- OnChatSent(new ChatSentEventArgs(chat, type, channel));
- }
-
- public void SendInstantMessage(string message, LLUUID target, LLUUID session)
- {
- if (!loggedIn) return;
-
- client.Avatar.InstantMessage(loginOptions.FullName, session, target, message, null);
- OnInstantMessageSent(new InstantMessageSentEventArgs(message, target, session, DateTime.Now));
- }
-
- public SecondLife Client
- {
- get { return client; }
- }
-
- public bool LoggedIn
- {
- get { return loggedIn; }
- }
-
- public SLLoginOptions LoginOptions
- {
- get { return loginOptions; }
- }
-
- public ISynchronizeInvoke NetcomSync
- {
- get { return netcomSync; }
- set { netcomSync = value; }
- }
- }
-}
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Text;
+using libsecondlife;
+
+namespace SLNetworkComm
+{
+ ///
+ /// Description of SLNetCom:
+ /// NetCom stands for Network Communication
+ /// Basically all functions that have to do with communicating
+ /// too and from SL should happen in here. This keeps things
+ /// organized and interface seperate from network code.
+ ///
+ public partial class SLNetCom
+ {
+ private SecondLife client;
+ private bool loggedIn = false;
+ private SLLoginOptions loginOptions;
+
+ // NetcomSync is used for raising IM/Chat events on the
+ // GUI/main thread. Useful if you're modifying GUI controls
+ // in the client app when responding to IM/Chat events.
+ private ISynchronizeInvoke netcomSync;
+
+ public SLNetCom()
+ {
+ this.InitializeClient();
+ loginOptions = new SLLoginOptions();
+ }
+
+ public SLNetCom(string firstName, string lastName, string password, string loginLocation)
+ {
+ this.InitializeClient();
+
+ loginOptions = new SLLoginOptions();
+ loginOptions.FirstName = firstName;
+ loginOptions.LastName = lastName;
+ loginOptions.Password = password;
+ loginOptions.StartLocation = loginLocation;
+ }
+
+ public SLNetCom(SLLoginOptions logOptions)
+ {
+ this.InitializeClient();
+ loginOptions = logOptions;
+ }
+
+ private void InitializeClient()
+ {
+ client = new SecondLife("keywords.txt", "message_template.msg");
+ client.Network.RegisterCallback("ChatFromSimulator", new PacketCallback(ChatIncoming));
+ client.Network.RegisterCallback("ImprovedInstantMessage", new PacketCallback(InstantMessageIncoming));
+ }
+
+ private void InstantMessageIncoming(Packet packet, Simulator simulator)
+ {
+ if (packet.Layout.Name != "ImprovedInstantMessage") return;
+
+ LLUUID FromAgentID = new LLUUID();
+ LLUUID ToAgentID = new LLUUID();
+ uint ParentEstateID = 0;
+ LLUUID RegionID = new LLUUID();
+ LLVector3 Position = new LLVector3();
+ bool Offline = false;
+ byte Dialog = 0;
+ LLUUID ID = new LLUUID();
+ uint Timestamp = 0;
+ DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0); //The Unix epoch!
+ string FromAgentName = string.Empty;
+ string Message = string.Empty;
+ string BinaryBucket = string.Empty;
+
+ ArrayList blocks = packet.Blocks();
+
+ foreach (Block block in blocks)
+ {
+ foreach (Field field in block.Fields)
+ {
+ switch (field.Layout.Name)
+ {
+ case "FromAgentID":
+ FromAgentID = (LLUUID)field.Data;
+ break;
+
+ case "ToAgentID":
+ ToAgentID = (LLUUID)field.Data;
+ break;
+
+ case "ParentEstateID":
+ ParentEstateID = (uint)field.Data;
+ break;
+
+ case "RegionID":
+ RegionID = (LLUUID)field.Data;
+ break;
+
+ case "Position":
+ Position = (LLVector3)field.Data;
+ break;
+
+ case "Offline":
+ Offline = ((byte)field.Data == 1 ? true : false);
+ break;
+
+ case "Dialog":
+ Dialog = (byte)field.Data;
+ break;
+
+ case "ID":
+ ID = (LLUUID)field.Data;
+ break;
+
+ case "Timestamp":
+ Timestamp = (uint)field.Data;
+
+ if (Timestamp == 0) //User is online
+ dt = DateTime.Now;
+ else //User is offline
+ dt = dt.AddSeconds(Timestamp);
+
+ break;
+
+ case "FromAgentName":
+ FromAgentName = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty);
+ break;
+
+ case "Message":
+ Message = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty);
+ break;
+
+ case "BinaryBucket":
+ BinaryBucket = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty);
+ break;
+ }
+ }
+
+ InstantMessageEventArgs eventArgs = new InstantMessageEventArgs(
+ FromAgentID, ToAgentID, ParentEstateID, RegionID,
+ Position, Offline, Dialog, ID,
+ dt, FromAgentName, Message, BinaryBucket);
+
+ if (netcomSync != null)
+ {
+ object[] ea = new object[1];
+ ea[0] = eventArgs;
+ netcomSync.Invoke(new OnInstantMessageRaise(OnInstantMessageReceived), ea);
+ }
+ else
+ {
+ OnInstantMessageReceived(eventArgs);
+ }
+ }
+ }
+
+ private void ChatIncoming(Packet packet, Simulator simulator)
+ {
+ if (packet.Layout.Name != "ChatFromSimulator") return;
+
+ string fromname = string.Empty; //Name of source.
+ LLUUID sourceid = new LLUUID(); //UUID of source, object/avatar
+ LLUUID ownerid = new LLUUID(); //UUID of owner, if object UUID = owner of object, if avatar UUID = same as source
+ SLSourceType sourcetype = SLSourceType.None;
+ SLChatType chattype = SLChatType.Whisper;
+ bool audible = false; //Audible: 1 if audible, 0 if beyond 20m (message is null)
+ LLVector3 position = new LLVector3(); //Region local position of source.
+ string message = string.Empty; //Message from source
+ byte command = 0; //Unused?
+ LLUUID commandID = new LLUUID(); //Unused?
+
+ ArrayList blocks = packet.Blocks();
+
+ foreach (Block block in blocks)
+ {
+ foreach (Field field in block.Fields)
+ {
+ switch (field.Layout.Name)
+ {
+ case "SourceID":
+ sourceid = (LLUUID)field.Data;
+ break;
+
+ case "OwnerID":
+ ownerid = (LLUUID)field.Data;
+ break;
+
+ case "FromName":
+ fromname = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty);
+ break;
+
+ case "SourceType":
+ sourcetype = (SLSourceType)(byte)field.Data;
+ break;
+
+ case "ChatType":
+ chattype = (SLChatType)(byte)field.Data;
+ break;
+
+ case "Audible":
+ audible = ((byte)field.Data == 1 ? true : false);
+ break;
+
+ case "Message":
+ message = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty);
+ break;
+
+ case "Position":
+ position = (LLVector3)field.Data;
+ break;
+
+ case "Command":
+ command = (byte)field.Data;
+ break;
+
+ case "CommandID":
+ commandID = (LLUUID)field.Data;
+ break;
+ }
+ }
+
+ ChatEventArgs eventArgs = new ChatEventArgs(
+ message, chattype,
+ position, sourcetype, sourceid, ownerid,
+ fromname, audible, command, commandID);
+
+ if (netcomSync != null)
+ {
+ object[] ea = new object[1];
+ ea[0] = eventArgs;
+ netcomSync.Invoke(new OnChatRaise(OnChatReceived), ea);
+ }
+ else
+ {
+ OnChatReceived(eventArgs);
+ }
+ }
+ }
+
+ public void Login()
+ {
+ //LoginReply will be used to contain the output text.
+ string loginReply;
+
+ //Checking for empty/null login fields. Leave the Login() method if true.
+ if (string.IsNullOrEmpty(loginOptions.FirstName) ||
+ string.IsNullOrEmpty(loginOptions.LastName) ||
+ string.IsNullOrEmpty(loginOptions.Password) ||
+ string.IsNullOrEmpty(loginOptions.StartLocation))
+ {
+ loginReply = "A login field is blank!";
+
+ OnClientLoginError(new ClientLoginEventArgs(loginReply));
+ return;
+ }
+
+ Hashtable loginParams = NetworkManager.DefaultLoginValues(
+ loginOptions.FirstName, loginOptions.LastName, loginOptions.Password,
+ "00:00:00:00:00:00",
+ loginOptions.StartLocation.ToLower(),
+ 1, 50, 50, 50, "Win",
+ "0", loginOptions.UserAgent, loginOptions.Author);
+
+ //uri:Ahern&195&233&30
+
+ // An example of how to pass additional options to the login server
+ // Request information on the Root Inventory Folder, and Inventory Skeleton
+ // alAdditionalInfo.Add("inventory-skeleton");
+
+ //ArrayList alAdditionalInfo = new ArrayList();
+ //alAdditionalInfo.Add("inventory-root");
+ //loginParams.Add("options",alAdditionalInfo);
+
+ //Hashtable loginReply = new Hashtable();
+
+ if (client.Network.Login(loginParams))
+ {
+ // Login was successful
+ loginReply = "Message of the day: " + client.Network.LoginValues["message"];
+ loggedIn = true;
+
+ OnClientLoggedIn(new ClientLoginEventArgs(loginReply));
+ }
+ else
+ {
+ // Login failed
+ loginReply = "Error logging in: " + client.Network.LoginError;
+
+ OnClientLoginError(new ClientLoginEventArgs(loginReply));
+ }
+ }
+
+ public void Logout()
+ {
+ if (!loggedIn) return;
+
+ client.Network.Logout();
+ loggedIn = false;
+
+ string logoutReply = "Successfully logged out!";
+ OnClientLoggedOut(new ClientLoginEventArgs(logoutReply));
+ }
+
+ public void ChatOut(string chat, SLChatType type, int channel)
+ {
+ if (!loggedIn) return;
+ if (string.IsNullOrEmpty(chat)) return;
+
+ switch (type)
+ {
+ case SLChatType.Say:
+ client.Avatar.Say(chat, channel);
+ break;
+
+ case SLChatType.Shout:
+ client.Avatar.Shout(chat, channel);
+ break;
+
+ case SLChatType.Whisper:
+ client.Avatar.Whisper(chat, channel);
+ break;
+ }
+
+ OnChatSent(new ChatSentEventArgs(chat, type, channel));
+ }
+
+ public void SendInstantMessage(string message, LLUUID target, LLUUID session)
+ {
+ if (!loggedIn) return;
+
+ client.Avatar.InstantMessage(loginOptions.FullName, session, target, message, null);
+ OnInstantMessageSent(new InstantMessageSentEventArgs(message, target, session, DateTime.Now));
+ }
+
+ public SecondLife Client
+ {
+ get { return client; }
+ }
+
+ public bool LoggedIn
+ {
+ get { return loggedIn; }
+ }
+
+ public SLLoginOptions LoginOptions
+ {
+ get { return loginOptions; }
+ }
+
+ public ISynchronizeInvoke NetcomSync
+ {
+ get { return netcomSync; }
+ set { netcomSync = value; }
+ }
+ }
+}
diff --git a/applications/SLChat/SLChat/SLNetCom/SLNetComEnums.cs b/applications/SLChat/SLChat/SLNetCom/SLNetComEnums.cs
index 4be75703..fdc9695e 100644
--- a/applications/SLChat/SLChat/SLNetCom/SLNetComEnums.cs
+++ b/applications/SLChat/SLChat/SLNetCom/SLNetComEnums.cs
@@ -1,23 +1,23 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace SLNetworkComm
-{
- public enum SLChatType
- {
- Whisper,
- Say,
- Shout,
- Unknown,
- TypingNotification,
- ChatbarToggle
- };
-
- public enum SLSourceType
- {
- None,
- Avatar,
- Object
- };
-}
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SLNetworkComm
+{
+ public enum SLChatType
+ {
+ Whisper,
+ Say,
+ Shout,
+ Unknown,
+ TypingNotification,
+ ChatbarToggle
+ };
+
+ public enum SLSourceType
+ {
+ None,
+ Avatar,
+ Object
+ };
+}
diff --git a/applications/SLChat/SLChat/SLNetCom/SLNetComEvents.cs b/applications/SLChat/SLChat/SLNetCom/SLNetComEvents.cs
index 67813287..16ee8a9c 100644
--- a/applications/SLChat/SLChat/SLNetCom/SLNetComEvents.cs
+++ b/applications/SLChat/SLChat/SLNetCom/SLNetComEvents.cs
@@ -1,314 +1,314 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using libsecondlife;
-
-namespace SLNetworkComm
-{
- public partial class SLNetCom
- {
- // For the NetcomSync stuff
- private delegate void OnClientLoginRaise(ClientLoginEventArgs e);
- private delegate void OnChatRaise(ChatEventArgs e);
- private delegate void OnInstantMessageRaise(InstantMessageEventArgs e);
-
- public event EventHandler ClientLoggedIn;
- public event EventHandler ClientLoginError;
- public event EventHandler ClientLoggedOut;
- public event EventHandler ChatReceived;
- public event EventHandler ChatSent;
- public event EventHandler InstantMessageReceived;
- public event EventHandler InstantMessageSent;
-
- protected virtual void OnClientLoggedIn(ClientLoginEventArgs e)
- {
- if (ClientLoggedIn != null) ClientLoggedIn(this, e);
- }
-
- protected virtual void OnClientLoginError(ClientLoginEventArgs e)
- {
- if (ClientLoginError != null) ClientLoginError(this, e);
- }
-
- protected virtual void OnClientLoggedOut(ClientLoginEventArgs e)
- {
- if (ClientLoggedOut != null) ClientLoggedOut(this, e);
- }
-
- protected virtual void OnChatReceived(ChatEventArgs e)
- {
- if (ChatReceived != null) ChatReceived(this, e);
- }
-
- protected virtual void OnChatSent(ChatSentEventArgs e)
- {
- if (ChatSent != null) ChatSent(this, e);
- }
-
- protected virtual void OnInstantMessageReceived(InstantMessageEventArgs e)
- {
- if (InstantMessageReceived != null) InstantMessageReceived(this, e);
- }
-
- protected virtual void OnInstantMessageSent(InstantMessageSentEventArgs e)
- {
- if (InstantMessageSent != null) InstantMessageSent(this, e);
- }
- }
-
- public class ClientLoginEventArgs : EventArgs
- {
- private string _loginReply;
-
- public ClientLoginEventArgs(string loginReply)
- {
- _loginReply = loginReply;
- }
-
- public string LoginReply
- {
- get { return _loginReply; }
- }
- }
-
- public class ChatEventArgs : EventArgs
- {
- private string _message;
- private SLChatType _type;
- private LLVector3 _sourcePos;
- private SLSourceType _sourceType;
- private LLUUID _sourceId;
- private LLUUID _ownerId;
- private string _fromName;
- private bool _audible;
- private byte _command;
- private LLUUID _commandId;
-
- public ChatEventArgs(
- string message, SLChatType type, LLVector3 sourcePos, SLSourceType sourceType,
- LLUUID sourceId, LLUUID ownerId, string fromName,
- bool audible, byte command, LLUUID commandId)
- {
- _message = message;
- _type = type;
- _sourcePos = sourcePos;
- _sourceType = sourceType;
- _sourceId = sourceId;
- _ownerId = ownerId;
- _fromName = fromName;
- _audible = audible;
- _command = command;
- _commandId = commandId;
- }
-
- public string Message
- {
- get { return _message; }
- }
-
- public SLChatType Type
- {
- get { return _type; }
- }
-
- public LLVector3 SourcePosition
- {
- get { return _sourcePos; }
- }
-
- public SLSourceType SourceType
- {
- get { return _sourceType; }
- }
-
- public LLUUID SourceId
- {
- get { return _sourceId; }
- }
-
- public LLUUID OwnerId
- {
- get { return _ownerId; }
- }
-
- public string FromName
- {
- get { return _fromName; }
- }
-
- public bool Audible
- {
- get { return _audible; }
- }
-
- public byte Command
- {
- get { return _command; }
- }
-
- public LLUUID CommandId
- {
- get { return _commandId; }
- }
- }
-
- public class ChatSentEventArgs : EventArgs
- {
- private string _message;
- private SLChatType _messageType;
- private int _channel;
-
- public ChatSentEventArgs(string message, SLChatType messageType, int channel)
- {
- _message = message;
- _messageType = messageType;
- _channel = channel;
- }
-
- public string Message
- {
- get { return _message; }
- }
-
- public SLChatType MessageType
- {
- get { return _messageType; }
- }
-
- public int Channel
- {
- get { return _channel; }
- }
- }
-
- public class InstantMessageEventArgs : EventArgs
- {
- private LLUUID _fromAgentId;
- private LLUUID _toAgentId;
- private uint _parentEstateId;
- private LLUUID _regionId;
- private LLVector3 _position;
- private bool _offline;
- private byte _dialog;
- private LLUUID _id;
- private DateTime _timestamp;
- private string _fromAgentName;
- private string _message;
- private string _binaryBucket;
-
- public InstantMessageEventArgs(
- LLUUID fromAgentId, LLUUID toAgentId, uint parentEstateId, LLUUID regionId,
- LLVector3 position, bool offline, byte dialog, LLUUID id,
- DateTime timestamp, string fromAgentName, string message, string binaryBucket)
- {
- _fromAgentId = fromAgentId;
- _toAgentId = toAgentId;
- _parentEstateId = parentEstateId;
- _regionId = regionId;
- _position = position;
- _offline = offline;
- _dialog = dialog;
- _id = id;
- _timestamp = timestamp;
- _fromAgentName = fromAgentName;
- _message = message;
- _binaryBucket = binaryBucket;
- }
-
- public LLUUID FromAgentId
- {
- get { return _fromAgentId; }
- }
-
- public LLUUID ToAgentId
- {
- get { return _toAgentId; }
- }
-
- public uint ParentEstateId
- {
- get { return _parentEstateId; }
- }
-
- public LLUUID RegionId
- {
- get { return _regionId; }
- }
-
- public LLVector3 Position
- {
- get { return _position; }
- }
-
- public bool Offline
- {
- get { return _offline; }
- }
-
- public byte Dialog
- {
- get { return _dialog; }
- }
-
- public LLUUID Id
- {
- get { return _id; }
- }
-
- public DateTime Timestamp
- {
- get { return _timestamp; }
- }
-
- public string FromAgentName
- {
- get { return _fromAgentName; }
- }
-
- public string Message
- {
- get { return _message; }
- }
-
- public string BinaryBucket
- {
- get { return _binaryBucket; }
- }
- }
-
- public class InstantMessageSentEventArgs : EventArgs
- {
- private string _message;
- private LLUUID _targetId;
- private LLUUID _sessionId;
- private DateTime _timestamp;
-
- public InstantMessageSentEventArgs(string message, LLUUID targetId, LLUUID sessionId, DateTime timestamp)
- {
- _message = message;
- _targetId = targetId;
- _sessionId = sessionId;
- _timestamp = timestamp;
- }
-
- public string Message
- {
- get { return _message; }
- }
-
- public LLUUID TargetId
- {
- get { return _targetId; }
- }
-
- public LLUUID SessionId
- {
- get { return _sessionId; }
- }
-
- public DateTime Timestamp
- {
- get { return _timestamp; }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Text;
+using libsecondlife;
+
+namespace SLNetworkComm
+{
+ public partial class SLNetCom
+ {
+ // For the NetcomSync stuff
+ private delegate void OnClientLoginRaise(ClientLoginEventArgs e);
+ private delegate void OnChatRaise(ChatEventArgs e);
+ private delegate void OnInstantMessageRaise(InstantMessageEventArgs e);
+
+ public event EventHandler ClientLoggedIn;
+ public event EventHandler ClientLoginError;
+ public event EventHandler ClientLoggedOut;
+ public event EventHandler ChatReceived;
+ public event EventHandler ChatSent;
+ public event EventHandler InstantMessageReceived;
+ public event EventHandler InstantMessageSent;
+
+ protected virtual void OnClientLoggedIn(ClientLoginEventArgs e)
+ {
+ if (ClientLoggedIn != null) ClientLoggedIn(this, e);
+ }
+
+ protected virtual void OnClientLoginError(ClientLoginEventArgs e)
+ {
+ if (ClientLoginError != null) ClientLoginError(this, e);
+ }
+
+ protected virtual void OnClientLoggedOut(ClientLoginEventArgs e)
+ {
+ if (ClientLoggedOut != null) ClientLoggedOut(this, e);
+ }
+
+ protected virtual void OnChatReceived(ChatEventArgs e)
+ {
+ if (ChatReceived != null) ChatReceived(this, e);
+ }
+
+ protected virtual void OnChatSent(ChatSentEventArgs e)
+ {
+ if (ChatSent != null) ChatSent(this, e);
+ }
+
+ protected virtual void OnInstantMessageReceived(InstantMessageEventArgs e)
+ {
+ if (InstantMessageReceived != null) InstantMessageReceived(this, e);
+ }
+
+ protected virtual void OnInstantMessageSent(InstantMessageSentEventArgs e)
+ {
+ if (InstantMessageSent != null) InstantMessageSent(this, e);
+ }
+ }
+
+ public class ClientLoginEventArgs : EventArgs
+ {
+ private string _loginReply;
+
+ public ClientLoginEventArgs(string loginReply)
+ {
+ _loginReply = loginReply;
+ }
+
+ public string LoginReply
+ {
+ get { return _loginReply; }
+ }
+ }
+
+ public class ChatEventArgs : EventArgs
+ {
+ private string _message;
+ private SLChatType _type;
+ private LLVector3 _sourcePos;
+ private SLSourceType _sourceType;
+ private LLUUID _sourceId;
+ private LLUUID _ownerId;
+ private string _fromName;
+ private bool _audible;
+ private byte _command;
+ private LLUUID _commandId;
+
+ public ChatEventArgs(
+ string message, SLChatType type, LLVector3 sourcePos, SLSourceType sourceType,
+ LLUUID sourceId, LLUUID ownerId, string fromName,
+ bool audible, byte command, LLUUID commandId)
+ {
+ _message = message;
+ _type = type;
+ _sourcePos = sourcePos;
+ _sourceType = sourceType;
+ _sourceId = sourceId;
+ _ownerId = ownerId;
+ _fromName = fromName;
+ _audible = audible;
+ _command = command;
+ _commandId = commandId;
+ }
+
+ public string Message
+ {
+ get { return _message; }
+ }
+
+ public SLChatType Type
+ {
+ get { return _type; }
+ }
+
+ public LLVector3 SourcePosition
+ {
+ get { return _sourcePos; }
+ }
+
+ public SLSourceType SourceType
+ {
+ get { return _sourceType; }
+ }
+
+ public LLUUID SourceId
+ {
+ get { return _sourceId; }
+ }
+
+ public LLUUID OwnerId
+ {
+ get { return _ownerId; }
+ }
+
+ public string FromName
+ {
+ get { return _fromName; }
+ }
+
+ public bool Audible
+ {
+ get { return _audible; }
+ }
+
+ public byte Command
+ {
+ get { return _command; }
+ }
+
+ public LLUUID CommandId
+ {
+ get { return _commandId; }
+ }
+ }
+
+ public class ChatSentEventArgs : EventArgs
+ {
+ private string _message;
+ private SLChatType _messageType;
+ private int _channel;
+
+ public ChatSentEventArgs(string message, SLChatType messageType, int channel)
+ {
+ _message = message;
+ _messageType = messageType;
+ _channel = channel;
+ }
+
+ public string Message
+ {
+ get { return _message; }
+ }
+
+ public SLChatType MessageType
+ {
+ get { return _messageType; }
+ }
+
+ public int Channel
+ {
+ get { return _channel; }
+ }
+ }
+
+ public class InstantMessageEventArgs : EventArgs
+ {
+ private LLUUID _fromAgentId;
+ private LLUUID _toAgentId;
+ private uint _parentEstateId;
+ private LLUUID _regionId;
+ private LLVector3 _position;
+ private bool _offline;
+ private byte _dialog;
+ private LLUUID _id;
+ private DateTime _timestamp;
+ private string _fromAgentName;
+ private string _message;
+ private string _binaryBucket;
+
+ public InstantMessageEventArgs(
+ LLUUID fromAgentId, LLUUID toAgentId, uint parentEstateId, LLUUID regionId,
+ LLVector3 position, bool offline, byte dialog, LLUUID id,
+ DateTime timestamp, string fromAgentName, string message, string binaryBucket)
+ {
+ _fromAgentId = fromAgentId;
+ _toAgentId = toAgentId;
+ _parentEstateId = parentEstateId;
+ _regionId = regionId;
+ _position = position;
+ _offline = offline;
+ _dialog = dialog;
+ _id = id;
+ _timestamp = timestamp;
+ _fromAgentName = fromAgentName;
+ _message = message;
+ _binaryBucket = binaryBucket;
+ }
+
+ public LLUUID FromAgentId
+ {
+ get { return _fromAgentId; }
+ }
+
+ public LLUUID ToAgentId
+ {
+ get { return _toAgentId; }
+ }
+
+ public uint ParentEstateId
+ {
+ get { return _parentEstateId; }
+ }
+
+ public LLUUID RegionId
+ {
+ get { return _regionId; }
+ }
+
+ public LLVector3 Position
+ {
+ get { return _position; }
+ }
+
+ public bool Offline
+ {
+ get { return _offline; }
+ }
+
+ public byte Dialog
+ {
+ get { return _dialog; }
+ }
+
+ public LLUUID Id
+ {
+ get { return _id; }
+ }
+
+ public DateTime Timestamp
+ {
+ get { return _timestamp; }
+ }
+
+ public string FromAgentName
+ {
+ get { return _fromAgentName; }
+ }
+
+ public string Message
+ {
+ get { return _message; }
+ }
+
+ public string BinaryBucket
+ {
+ get { return _binaryBucket; }
+ }
+ }
+
+ public class InstantMessageSentEventArgs : EventArgs
+ {
+ private string _message;
+ private LLUUID _targetId;
+ private LLUUID _sessionId;
+ private DateTime _timestamp;
+
+ public InstantMessageSentEventArgs(string message, LLUUID targetId, LLUUID sessionId, DateTime timestamp)
+ {
+ _message = message;
+ _targetId = targetId;
+ _sessionId = sessionId;
+ _timestamp = timestamp;
+ }
+
+ public string Message
+ {
+ get { return _message; }
+ }
+
+ public LLUUID TargetId
+ {
+ get { return _targetId; }
+ }
+
+ public LLUUID SessionId
+ {
+ get { return _sessionId; }
+ }
+
+ public DateTime Timestamp
+ {
+ get { return _timestamp; }
+ }
+ }
+}
diff --git a/applications/SLIRC/Program.cs b/applications/SLIRC/Program.cs
index 54df3d2f..4bd67c80 100644
--- a/applications/SLIRC/Program.cs
+++ b/applications/SLIRC/Program.cs
@@ -1,20 +1,20 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace SLIRC
-{
- static class Program
- {
- ///
- /// The main entry point for the application.
- ///
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new frmSLIRC());
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace SLIRC
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new frmSLIRC());
+ }
+ }
}
\ No newline at end of file
diff --git a/applications/SLIRC/Properties/AssemblyInfo.cs b/applications/SLIRC/Properties/AssemblyInfo.cs
index 55e298bd..5309c733 100644
--- a/applications/SLIRC/Properties/AssemblyInfo.cs
+++ b/applications/SLIRC/Properties/AssemblyInfo.cs
@@ -1,33 +1,33 @@
-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("SLIRC")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Thearis Systems/RedWire Virtual")]
-[assembly: AssemblyProduct("SLIRC")]
-[assembly: AssemblyCopyright("Copyright © Thearis Systems/RedWire Virtual 2006")]
-[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("d8888e7d-b69e-455a-83d0-7ff4bed18b81")]
-
-// 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")]
+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("SLIRC")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Thearis Systems/RedWire Virtual")]
+[assembly: AssemblyProduct("SLIRC")]
+[assembly: AssemblyCopyright("Copyright © Thearis Systems/RedWire Virtual 2006")]
+[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("d8888e7d-b69e-455a-83d0-7ff4bed18b81")]
+
+// 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/applications/SLIRC/Properties/Resources.Designer.cs b/applications/SLIRC/Properties/Resources.Designer.cs
index 63297449..8b83e63f 100644
--- a/applications/SLIRC/Properties/Resources.Designer.cs
+++ b/applications/SLIRC/Properties/Resources.Designer.cs
@@ -1,71 +1,71 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace SLIRC.Properties
-{
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SLIRC.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
-}
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.42
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace SLIRC.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SLIRC.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/applications/SLIRC/Properties/Resources.resx b/applications/SLIRC/Properties/Resources.resx
index ffecec85..af7dbebb 100644
--- a/applications/SLIRC/Properties/Resources.resx
+++ b/applications/SLIRC/Properties/Resources.resx
@@ -1,117 +1,117 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
\ No newline at end of file
diff --git a/applications/SLIRC/Properties/Settings.Designer.cs b/applications/SLIRC/Properties/Settings.Designer.cs
index 4e5b1d24..1c3c6f29 100644
--- a/applications/SLIRC/Properties/Settings.Designer.cs
+++ b/applications/SLIRC/Properties/Settings.Designer.cs
@@ -1,30 +1,30 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace SLIRC.Properties
-{
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
-}
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.42
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace SLIRC.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/applications/SLIRC/Properties/Settings.settings b/applications/SLIRC/Properties/Settings.settings
index abf36c5d..39645652 100644
--- a/applications/SLIRC/Properties/Settings.settings
+++ b/applications/SLIRC/Properties/Settings.settings
@@ -1,7 +1,7 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/applications/SLIRC/SLIRC.csproj b/applications/SLIRC/SLIRC.csproj
index b0998d96..9a52e290 100644
--- a/applications/SLIRC/SLIRC.csproj
+++ b/applications/SLIRC/SLIRC.csproj
@@ -1,83 +1,83 @@
-
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {8855EB2F-BC4C-485A-A577-0989EB16BFDC}
- WinExe
- Properties
- SLIRC
- SLIRC
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
- False
- ..\..\Desktop\SmartIrc4net-0.3.5\bin\net\debug\Meebey.SmartIrc4net.dll
-
-
-
-
-
-
-
-
-
-
- Form
-
-
- frmSLIRC.cs
-
-
-
-
- Designer
- frmSLIRC.cs
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- True
- Settings.settings
- True
-
-
-
-
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {8855EB2F-BC4C-485A-A577-0989EB16BFDC}
+ WinExe
+ Properties
+ SLIRC
+ SLIRC
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+ False
+ ..\..\Desktop\SmartIrc4net-0.3.5\bin\net\debug\Meebey.SmartIrc4net.dll
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ frmSLIRC.cs
+
+
+
+
+ Designer
+ frmSLIRC.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
\ No newline at end of file
diff --git a/applications/SLIRC/SLIRC.sln b/applications/SLIRC/SLIRC.sln
index f14cf2aa..3f926b2b 100644
--- a/applications/SLIRC/SLIRC.sln
+++ b/applications/SLIRC/SLIRC.sln
@@ -1,20 +1,20 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual C# Express 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLIRC", "SLIRC.csproj", "{8855EB2F-BC4C-485A-A577-0989EB16BFDC}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {8855EB2F-BC4C-485A-A577-0989EB16BFDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8855EB2F-BC4C-485A-A577-0989EB16BFDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8855EB2F-BC4C-485A-A577-0989EB16BFDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8855EB2F-BC4C-485A-A577-0989EB16BFDC}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C# Express 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLIRC", "SLIRC.csproj", "{8855EB2F-BC4C-485A-A577-0989EB16BFDC}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8855EB2F-BC4C-485A-A577-0989EB16BFDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8855EB2F-BC4C-485A-A577-0989EB16BFDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8855EB2F-BC4C-485A-A577-0989EB16BFDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8855EB2F-BC4C-485A-A577-0989EB16BFDC}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/applications/SLIRC/frmSLIRC.Designer.cs b/applications/SLIRC/frmSLIRC.Designer.cs
index b65e4c38..3bb4ff61 100644
--- a/applications/SLIRC/frmSLIRC.Designer.cs
+++ b/applications/SLIRC/frmSLIRC.Designer.cs
@@ -1,296 +1,296 @@
-namespace SLIRC
-{
- partial class frmSLIRC
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- try
- {
- ircclient.Disconnect();
- }
- catch
- {
-
- }
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.grpLogin = new System.Windows.Forms.GroupBox();
- this.label3 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.txtPassword = new System.Windows.Forms.TextBox();
- this.txtLastName = new System.Windows.Forms.TextBox();
- this.cmdConnect = new System.Windows.Forms.Button();
- this.txtFirstName = new System.Windows.Forms.TextBox();
- this.lstLog = new System.Windows.Forms.ListBox();
- this.lstAllowedUsers = new System.Windows.Forms.ListBox();
- this.txtServerName = new System.Windows.Forms.TextBox();
- this.label4 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.txtPort = new System.Windows.Forms.TextBox();
- this.txtChannel = new System.Windows.Forms.TextBox();
- this.btnJoin = new System.Windows.Forms.Button();
- this.txtMessage = new System.Windows.Forms.TextBox();
- this.btnSay = new System.Windows.Forms.Button();
- this.grpDebug = new System.Windows.Forms.GroupBox();
- this.btnGetPos = new System.Windows.Forms.Button();
- this.grpLogin.SuspendLayout();
- this.grpDebug.SuspendLayout();
- this.SuspendLayout();
- //
- // grpLogin
- //
- this.grpLogin.Controls.Add(this.label3);
- this.grpLogin.Controls.Add(this.label2);
- this.grpLogin.Controls.Add(this.label1);
- this.grpLogin.Controls.Add(this.txtPassword);
- this.grpLogin.Controls.Add(this.txtLastName);
- this.grpLogin.Controls.Add(this.cmdConnect);
- this.grpLogin.Controls.Add(this.txtFirstName);
- this.grpLogin.Enabled = false;
- this.grpLogin.Location = new System.Drawing.Point(2, 242);
- this.grpLogin.Name = "grpLogin";
- this.grpLogin.Size = new System.Drawing.Size(560, 77);
- this.grpLogin.TabIndex = 51;
- this.grpLogin.TabStop = false;
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(280, 24);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(120, 16);
- this.label3.TabIndex = 50;
- this.label3.Text = "Password";
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(152, 24);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(120, 16);
- this.label2.TabIndex = 50;
- this.label2.Text = "Last Name";
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(16, 24);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(120, 16);
- this.label1.TabIndex = 50;
- this.label1.Text = "First Name";
- //
- // txtPassword
- //
- this.txtPassword.Location = new System.Drawing.Point(280, 40);
- this.txtPassword.Name = "txtPassword";
- this.txtPassword.PasswordChar = '*';
- this.txtPassword.Size = new System.Drawing.Size(120, 20);
- this.txtPassword.TabIndex = 2;
- //
- // txtLastName
- //
- this.txtLastName.Location = new System.Drawing.Point(152, 40);
- this.txtLastName.Name = "txtLastName";
- this.txtLastName.Size = new System.Drawing.Size(112, 20);
- this.txtLastName.TabIndex = 1;
- //
- // cmdConnect
- //
- this.cmdConnect.Location = new System.Drawing.Point(424, 40);
- this.cmdConnect.Name = "cmdConnect";
- this.cmdConnect.Size = new System.Drawing.Size(120, 24);
- this.cmdConnect.TabIndex = 3;
- this.cmdConnect.Text = "Connect";
- this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
- //
- // txtFirstName
- //
- this.txtFirstName.Location = new System.Drawing.Point(16, 40);
- this.txtFirstName.Name = "txtFirstName";
- this.txtFirstName.Size = new System.Drawing.Size(120, 20);
- this.txtFirstName.TabIndex = 0;
- //
- // lstLog
- //
- this.lstLog.Enabled = false;
- this.lstLog.FormattingEnabled = true;
- this.lstLog.Location = new System.Drawing.Point(19, 11);
- this.lstLog.Name = "lstLog";
- this.lstLog.Size = new System.Drawing.Size(315, 225);
- this.lstLog.TabIndex = 52;
- //
- // lstAllowedUsers
- //
- this.lstAllowedUsers.Enabled = false;
- this.lstAllowedUsers.FormattingEnabled = true;
- this.lstAllowedUsers.Location = new System.Drawing.Point(349, 13);
- this.lstAllowedUsers.Name = "lstAllowedUsers";
- this.lstAllowedUsers.Size = new System.Drawing.Size(212, 108);
- this.lstAllowedUsers.TabIndex = 53;
- //
- // txtServerName
- //
- this.txtServerName.Location = new System.Drawing.Point(349, 141);
- this.txtServerName.Name = "txtServerName";
- this.txtServerName.Size = new System.Drawing.Size(130, 20);
- this.txtServerName.TabIndex = 54;
- this.txtServerName.Text = "irc.efnet.pl";
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(351, 125);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(69, 13);
- this.label4.TabIndex = 55;
- this.label4.Text = "Server Name";
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(483, 124);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(26, 13);
- this.label5.TabIndex = 55;
- this.label5.Text = "Port";
- //
- // txtPort
- //
- this.txtPort.Location = new System.Drawing.Point(486, 141);
- this.txtPort.Name = "txtPort";
- this.txtPort.Size = new System.Drawing.Size(60, 20);
- this.txtPort.TabIndex = 56;
- this.txtPort.Text = "6667";
- //
- // txtChannel
- //
- this.txtChannel.Location = new System.Drawing.Point(349, 167);
- this.txtChannel.Name = "txtChannel";
- this.txtChannel.Size = new System.Drawing.Size(130, 20);
- this.txtChannel.TabIndex = 54;
- this.txtChannel.Text = "#libsl";
- //
- // btnJoin
- //
- this.btnJoin.Enabled = false;
- this.btnJoin.Location = new System.Drawing.Point(487, 167);
- this.btnJoin.Name = "btnJoin";
- this.btnJoin.Size = new System.Drawing.Size(58, 20);
- this.btnJoin.TabIndex = 57;
- this.btnJoin.Text = "Join";
- this.btnJoin.UseVisualStyleBackColor = true;
- this.btnJoin.Click += new System.EventHandler(this.btnJoin_Click);
- //
- // txtMessage
- //
- this.txtMessage.Enabled = false;
- this.txtMessage.Location = new System.Drawing.Point(350, 199);
- this.txtMessage.Name = "txtMessage";
- this.txtMessage.Size = new System.Drawing.Size(194, 20);
- this.txtMessage.TabIndex = 58;
- //
- // btnSay
- //
- this.btnSay.Enabled = false;
- this.btnSay.Location = new System.Drawing.Point(470, 219);
- this.btnSay.Name = "btnSay";
- this.btnSay.Size = new System.Drawing.Size(74, 25);
- this.btnSay.TabIndex = 59;
- this.btnSay.Text = "Say";
- this.btnSay.UseVisualStyleBackColor = true;
- this.btnSay.Click += new System.EventHandler(this.btnSay_Click);
- //
- // grpDebug
- //
- this.grpDebug.Controls.Add(this.btnGetPos);
- this.grpDebug.Location = new System.Drawing.Point(2, 325);
- this.grpDebug.Name = "grpDebug";
- this.grpDebug.Size = new System.Drawing.Size(559, 64);
- this.grpDebug.TabIndex = 60;
- this.grpDebug.TabStop = false;
- this.grpDebug.Text = "Debugging";
- //
- // btnGetPos
- //
- this.btnGetPos.Location = new System.Drawing.Point(14, 21);
- this.btnGetPos.Name = "btnGetPos";
- this.btnGetPos.Size = new System.Drawing.Size(87, 24);
- this.btnGetPos.TabIndex = 0;
- this.btnGetPos.Text = "Get Position";
- this.btnGetPos.UseVisualStyleBackColor = true;
- this.btnGetPos.Click += new System.EventHandler(this.btnGetPos_Click);
- //
- // frmSLIRC
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(566, 393);
- this.Controls.Add(this.grpDebug);
- this.Controls.Add(this.btnSay);
- this.Controls.Add(this.txtMessage);
- this.Controls.Add(this.btnJoin);
- this.Controls.Add(this.txtPort);
- this.Controls.Add(this.label5);
- this.Controls.Add(this.label4);
- this.Controls.Add(this.txtChannel);
- this.Controls.Add(this.txtServerName);
- this.Controls.Add(this.lstAllowedUsers);
- this.Controls.Add(this.lstLog);
- this.Controls.Add(this.grpLogin);
- this.Name = "frmSLIRC";
- this.Text = "Second Life <-> IRC";
- this.Load += new System.EventHandler(this.frmSLIRC_Load);
- this.grpLogin.ResumeLayout(false);
- this.grpLogin.PerformLayout();
- this.grpDebug.ResumeLayout(false);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.GroupBox grpLogin;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.TextBox txtPassword;
- private System.Windows.Forms.TextBox txtLastName;
- private System.Windows.Forms.Button cmdConnect;
- private System.Windows.Forms.TextBox txtFirstName;
- private System.Windows.Forms.ListBox lstLog;
- private System.Windows.Forms.ListBox lstAllowedUsers;
- private System.Windows.Forms.TextBox txtServerName;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.TextBox txtPort;
- private System.Windows.Forms.TextBox txtChannel;
- private System.Windows.Forms.Button btnJoin;
- private System.Windows.Forms.TextBox txtMessage;
- private System.Windows.Forms.Button btnSay;
- private System.Windows.Forms.GroupBox grpDebug;
- private System.Windows.Forms.Button btnGetPos;
- }
-}
-
+namespace SLIRC
+{
+ partial class frmSLIRC
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ try
+ {
+ ircclient.Disconnect();
+ }
+ catch
+ {
+
+ }
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.grpLogin = new System.Windows.Forms.GroupBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtPassword = new System.Windows.Forms.TextBox();
+ this.txtLastName = new System.Windows.Forms.TextBox();
+ this.cmdConnect = new System.Windows.Forms.Button();
+ this.txtFirstName = new System.Windows.Forms.TextBox();
+ this.lstLog = new System.Windows.Forms.ListBox();
+ this.lstAllowedUsers = new System.Windows.Forms.ListBox();
+ this.txtServerName = new System.Windows.Forms.TextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.label5 = new System.Windows.Forms.Label();
+ this.txtPort = new System.Windows.Forms.TextBox();
+ this.txtChannel = new System.Windows.Forms.TextBox();
+ this.btnJoin = new System.Windows.Forms.Button();
+ this.txtMessage = new System.Windows.Forms.TextBox();
+ this.btnSay = new System.Windows.Forms.Button();
+ this.grpDebug = new System.Windows.Forms.GroupBox();
+ this.btnGetPos = new System.Windows.Forms.Button();
+ this.grpLogin.SuspendLayout();
+ this.grpDebug.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // grpLogin
+ //
+ this.grpLogin.Controls.Add(this.label3);
+ this.grpLogin.Controls.Add(this.label2);
+ this.grpLogin.Controls.Add(this.label1);
+ this.grpLogin.Controls.Add(this.txtPassword);
+ this.grpLogin.Controls.Add(this.txtLastName);
+ this.grpLogin.Controls.Add(this.cmdConnect);
+ this.grpLogin.Controls.Add(this.txtFirstName);
+ this.grpLogin.Enabled = false;
+ this.grpLogin.Location = new System.Drawing.Point(2, 242);
+ this.grpLogin.Name = "grpLogin";
+ this.grpLogin.Size = new System.Drawing.Size(560, 77);
+ this.grpLogin.TabIndex = 51;
+ this.grpLogin.TabStop = false;
+ //
+ // label3
+ //
+ this.label3.Location = new System.Drawing.Point(280, 24);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(120, 16);
+ this.label3.TabIndex = 50;
+ this.label3.Text = "Password";
+ //
+ // label2
+ //
+ this.label2.Location = new System.Drawing.Point(152, 24);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(120, 16);
+ this.label2.TabIndex = 50;
+ this.label2.Text = "Last Name";
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(16, 24);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(120, 16);
+ this.label1.TabIndex = 50;
+ this.label1.Text = "First Name";
+ //
+ // txtPassword
+ //
+ this.txtPassword.Location = new System.Drawing.Point(280, 40);
+ this.txtPassword.Name = "txtPassword";
+ this.txtPassword.PasswordChar = '*';
+ this.txtPassword.Size = new System.Drawing.Size(120, 20);
+ this.txtPassword.TabIndex = 2;
+ //
+ // txtLastName
+ //
+ this.txtLastName.Location = new System.Drawing.Point(152, 40);
+ this.txtLastName.Name = "txtLastName";
+ this.txtLastName.Size = new System.Drawing.Size(112, 20);
+ this.txtLastName.TabIndex = 1;
+ //
+ // cmdConnect
+ //
+ this.cmdConnect.Location = new System.Drawing.Point(424, 40);
+ this.cmdConnect.Name = "cmdConnect";
+ this.cmdConnect.Size = new System.Drawing.Size(120, 24);
+ this.cmdConnect.TabIndex = 3;
+ this.cmdConnect.Text = "Connect";
+ this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
+ //
+ // txtFirstName
+ //
+ this.txtFirstName.Location = new System.Drawing.Point(16, 40);
+ this.txtFirstName.Name = "txtFirstName";
+ this.txtFirstName.Size = new System.Drawing.Size(120, 20);
+ this.txtFirstName.TabIndex = 0;
+ //
+ // lstLog
+ //
+ this.lstLog.Enabled = false;
+ this.lstLog.FormattingEnabled = true;
+ this.lstLog.Location = new System.Drawing.Point(19, 11);
+ this.lstLog.Name = "lstLog";
+ this.lstLog.Size = new System.Drawing.Size(315, 225);
+ this.lstLog.TabIndex = 52;
+ //
+ // lstAllowedUsers
+ //
+ this.lstAllowedUsers.Enabled = false;
+ this.lstAllowedUsers.FormattingEnabled = true;
+ this.lstAllowedUsers.Location = new System.Drawing.Point(349, 13);
+ this.lstAllowedUsers.Name = "lstAllowedUsers";
+ this.lstAllowedUsers.Size = new System.Drawing.Size(212, 108);
+ this.lstAllowedUsers.TabIndex = 53;
+ //
+ // txtServerName
+ //
+ this.txtServerName.Location = new System.Drawing.Point(349, 141);
+ this.txtServerName.Name = "txtServerName";
+ this.txtServerName.Size = new System.Drawing.Size(130, 20);
+ this.txtServerName.TabIndex = 54;
+ this.txtServerName.Text = "irc.efnet.pl";
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(351, 125);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(69, 13);
+ this.label4.TabIndex = 55;
+ this.label4.Text = "Server Name";
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(483, 124);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(26, 13);
+ this.label5.TabIndex = 55;
+ this.label5.Text = "Port";
+ //
+ // txtPort
+ //
+ this.txtPort.Location = new System.Drawing.Point(486, 141);
+ this.txtPort.Name = "txtPort";
+ this.txtPort.Size = new System.Drawing.Size(60, 20);
+ this.txtPort.TabIndex = 56;
+ this.txtPort.Text = "6667";
+ //
+ // txtChannel
+ //
+ this.txtChannel.Location = new System.Drawing.Point(349, 167);
+ this.txtChannel.Name = "txtChannel";
+ this.txtChannel.Size = new System.Drawing.Size(130, 20);
+ this.txtChannel.TabIndex = 54;
+ this.txtChannel.Text = "#libsl";
+ //
+ // btnJoin
+ //
+ this.btnJoin.Enabled = false;
+ this.btnJoin.Location = new System.Drawing.Point(487, 167);
+ this.btnJoin.Name = "btnJoin";
+ this.btnJoin.Size = new System.Drawing.Size(58, 20);
+ this.btnJoin.TabIndex = 57;
+ this.btnJoin.Text = "Join";
+ this.btnJoin.UseVisualStyleBackColor = true;
+ this.btnJoin.Click += new System.EventHandler(this.btnJoin_Click);
+ //
+ // txtMessage
+ //
+ this.txtMessage.Enabled = false;
+ this.txtMessage.Location = new System.Drawing.Point(350, 199);
+ this.txtMessage.Name = "txtMessage";
+ this.txtMessage.Size = new System.Drawing.Size(194, 20);
+ this.txtMessage.TabIndex = 58;
+ //
+ // btnSay
+ //
+ this.btnSay.Enabled = false;
+ this.btnSay.Location = new System.Drawing.Point(470, 219);
+ this.btnSay.Name = "btnSay";
+ this.btnSay.Size = new System.Drawing.Size(74, 25);
+ this.btnSay.TabIndex = 59;
+ this.btnSay.Text = "Say";
+ this.btnSay.UseVisualStyleBackColor = true;
+ this.btnSay.Click += new System.EventHandler(this.btnSay_Click);
+ //
+ // grpDebug
+ //
+ this.grpDebug.Controls.Add(this.btnGetPos);
+ this.grpDebug.Location = new System.Drawing.Point(2, 325);
+ this.grpDebug.Name = "grpDebug";
+ this.grpDebug.Size = new System.Drawing.Size(559, 64);
+ this.grpDebug.TabIndex = 60;
+ this.grpDebug.TabStop = false;
+ this.grpDebug.Text = "Debugging";
+ //
+ // btnGetPos
+ //
+ this.btnGetPos.Location = new System.Drawing.Point(14, 21);
+ this.btnGetPos.Name = "btnGetPos";
+ this.btnGetPos.Size = new System.Drawing.Size(87, 24);
+ this.btnGetPos.TabIndex = 0;
+ this.btnGetPos.Text = "Get Position";
+ this.btnGetPos.UseVisualStyleBackColor = true;
+ this.btnGetPos.Click += new System.EventHandler(this.btnGetPos_Click);
+ //
+ // frmSLIRC
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(566, 393);
+ this.Controls.Add(this.grpDebug);
+ this.Controls.Add(this.btnSay);
+ this.Controls.Add(this.txtMessage);
+ this.Controls.Add(this.btnJoin);
+ this.Controls.Add(this.txtPort);
+ this.Controls.Add(this.label5);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.txtChannel);
+ this.Controls.Add(this.txtServerName);
+ this.Controls.Add(this.lstAllowedUsers);
+ this.Controls.Add(this.lstLog);
+ this.Controls.Add(this.grpLogin);
+ this.Name = "frmSLIRC";
+ this.Text = "Second Life <-> IRC";
+ this.Load += new System.EventHandler(this.frmSLIRC_Load);
+ this.grpLogin.ResumeLayout(false);
+ this.grpLogin.PerformLayout();
+ this.grpDebug.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.GroupBox grpLogin;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtPassword;
+ private System.Windows.Forms.TextBox txtLastName;
+ private System.Windows.Forms.Button cmdConnect;
+ private System.Windows.Forms.TextBox txtFirstName;
+ private System.Windows.Forms.ListBox lstLog;
+ private System.Windows.Forms.ListBox lstAllowedUsers;
+ private System.Windows.Forms.TextBox txtServerName;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.TextBox txtPort;
+ private System.Windows.Forms.TextBox txtChannel;
+ private System.Windows.Forms.Button btnJoin;
+ private System.Windows.Forms.TextBox txtMessage;
+ private System.Windows.Forms.Button btnSay;
+ private System.Windows.Forms.GroupBox grpDebug;
+ private System.Windows.Forms.Button btnGetPos;
+ }
+}
+
diff --git a/applications/SLIRC/frmSLIRC.cs b/applications/SLIRC/frmSLIRC.cs
index cd62ea13..2b19efea 100644
--- a/applications/SLIRC/frmSLIRC.cs
+++ b/applications/SLIRC/frmSLIRC.cs
@@ -1,163 +1,163 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using System.Collections;
-using System.Threading;
-using libsecondlife;
-using Meebey.SmartIrc4net;
-namespace SLIRC
-{
- public partial class frmSLIRC : Form
- {
- private SecondLife client;
- private IrcClient ircclient;
- private Thread listenthread;
- public frmSLIRC()
- {
- InitializeComponent();
- ircclient = new IrcClient();
- }
- public void Listen()
- {
- ircclient.Listen();
- }
- private void cmdConnect_Click(object sender, EventArgs e)
- {
- if (cmdConnect.Text == "Connect")
- {
- cmdConnect.Text = "Disconnect";
- txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = false;
-
- Hashtable loginParams = NetworkManager.DefaultLoginValues(txtFirstName.Text,
- txtLastName.Text, txtPassword.Text, "00:00:00:00:00:00", "last", 1, 50, 50, 50,
- "Win", "0", "accountant", "jhurliman@wsu.edu");
- if (client.Network.Login(loginParams))
- {
- LogMessage("Logged into Second Life");
- lstAllowedUsers.Enabled = lstLog.Enabled = btnJoin.Enabled = txtMessage.Enabled = btnSay.Enabled = true;
- ircclient.OnChannelMessage += new IrcEventHandler(ircclient_OnChannelMessage);
- //Connect to IRC server, yaydey yadah
- try
- {
- ircclient.Connect(new string[] { txtServerName.Text }, int.Parse(txtPort.Text));
- LogMessage("Connected to IRC Server.");
- ircclient.Login(client.Avatar.FirstName + client.Avatar.LastName, "SLIRC Gateway");
- ircclient.RfcJoin(txtChannel.Text);
- LogMessage("Logged in");
- if(listenthread != null) listenthread.Abort();
- listenthread = new Thread(Listen);
- listenthread.Start();
- }
- catch (Exception ex)
- {
- MessageBox.Show("OH NOES! " + ex.Message);
-
- }
-
- }
- else
- {
- MessageBox.Show(this, "Error logging in: " + client.Network.LoginError);
- //if(listenthread) listenthread.Abort();
- cmdConnect.Text = "Connect";
- lstAllowedUsers.Enabled = lstLog.Enabled = btnJoin.Enabled = btnSay.Enabled = false;
- txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
- }
- }
- else
- {
- cmdConnect.Text = "Connect";
- lstAllowedUsers.Enabled = btnJoin.Enabled = txtMessage.Enabled = btnSay.Enabled = false;
- txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
- ircclient.RfcQuit("SLIRC Disconnect.");
- listenthread.Abort();
- client.Network.Logout();
- }
-
- }
-
- void ircclient_OnChannelMessage(object sender, IrcEventArgs e)
- {
- LogMessage(e.Data.Nick + ": " + e.Data.Message);
- //From IRC -> Inject to SL
- client.Avatar.Say(e.Data.Nick + ": " + e.Data.Message, 0);
- }
-
- private void frmSLIRC_Load(object sender, EventArgs e)
- {
- try
- {
- client = new SecondLife("keywords.txt", "message_template.msg");
- client.Avatar.OnChat += new ChatCallback(Avatar_OnChat);
- grpLogin.Enabled = true;
- }
- catch (Exception error)
- {
- MessageBox.Show(this, error.ToString());
- }
- }
- private delegate void SingleStringDelegate(string s);
- void LogMessage(string msg)
- {
- if (!this.InvokeRequired)
- {
- int i = lstLog.Items.Add(msg);
- lstLog.SelectedIndex = i;
- }
- else
- {
- Invoke(new SingleStringDelegate(LogMessage), new object[] { msg });
- }
- }
- void AddToAllowedList(string name)
- {
- if (!this.InvokeRequired)
- {
- lstAllowedUsers.Items.Add(name);
- }
- else
- {
- Invoke(new SingleStringDelegate(AddToAllowedList), new object[] { name });
- }
- }
- void Avatar_OnChat(string message, byte audible, byte type, byte sourcetype, string name, LLUUID id, byte command, LLUUID commandID)
- {
- if (message.Equals("addme"))
- {
- //Add to the list
- LogMessage("Adding " + name + " to the allowed list");
- AddToAllowedList(name);
- }
- else
- {
- if (lstAllowedUsers.Items.Contains(name) && audible == 1 && !message.Equals(""))
- {
- LogMessage(name + ": " + message);
- ircclient.SendMessage(SendType.Message, txtChannel.Text, name + " : " + message);
- }
- }
- }
-
- private void btnJoin_Click(object sender, EventArgs e)
- {
- ircclient.RfcJoin(txtChannel.Text);
- LogMessage("Joining " + txtChannel.Text);
- }
-
- private void btnGetPos_Click(object sender, EventArgs e)
- {
- LogMessage("Position: " + client.Avatar.Position.X.ToString() + " " + client.Avatar.Position.Y.ToString());
- }
-
- private void btnSay_Click(object sender, EventArgs e)
- {
- client.Avatar.Say(ircclient.Nickname + ": " + txtMessage.Text, 0);
- ircclient.SendMessage(SendType.Message, txtChannel.Text, txtMessage.Text);
- }
-
- }
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Collections;
+using System.Threading;
+using libsecondlife;
+using Meebey.SmartIrc4net;
+namespace SLIRC
+{
+ public partial class frmSLIRC : Form
+ {
+ private SecondLife client;
+ private IrcClient ircclient;
+ private Thread listenthread;
+ public frmSLIRC()
+ {
+ InitializeComponent();
+ ircclient = new IrcClient();
+ }
+ public void Listen()
+ {
+ ircclient.Listen();
+ }
+ private void cmdConnect_Click(object sender, EventArgs e)
+ {
+ if (cmdConnect.Text == "Connect")
+ {
+ cmdConnect.Text = "Disconnect";
+ txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = false;
+
+ Hashtable loginParams = NetworkManager.DefaultLoginValues(txtFirstName.Text,
+ txtLastName.Text, txtPassword.Text, "00:00:00:00:00:00", "last", 1, 50, 50, 50,
+ "Win", "0", "accountant", "jhurliman@wsu.edu");
+ if (client.Network.Login(loginParams))
+ {
+ LogMessage("Logged into Second Life");
+ lstAllowedUsers.Enabled = lstLog.Enabled = btnJoin.Enabled = txtMessage.Enabled = btnSay.Enabled = true;
+ ircclient.OnChannelMessage += new IrcEventHandler(ircclient_OnChannelMessage);
+ //Connect to IRC server, yaydey yadah
+ try
+ {
+ ircclient.Connect(new string[] { txtServerName.Text }, int.Parse(txtPort.Text));
+ LogMessage("Connected to IRC Server.");
+ ircclient.Login(client.Avatar.FirstName + client.Avatar.LastName, "SLIRC Gateway");
+ ircclient.RfcJoin(txtChannel.Text);
+ LogMessage("Logged in");
+ if(listenthread != null) listenthread.Abort();
+ listenthread = new Thread(Listen);
+ listenthread.Start();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("OH NOES! " + ex.Message);
+
+ }
+
+ }
+ else
+ {
+ MessageBox.Show(this, "Error logging in: " + client.Network.LoginError);
+ //if(listenthread) listenthread.Abort();
+ cmdConnect.Text = "Connect";
+ lstAllowedUsers.Enabled = lstLog.Enabled = btnJoin.Enabled = btnSay.Enabled = false;
+ txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
+ }
+ }
+ else
+ {
+ cmdConnect.Text = "Connect";
+ lstAllowedUsers.Enabled = btnJoin.Enabled = txtMessage.Enabled = btnSay.Enabled = false;
+ txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
+ ircclient.RfcQuit("SLIRC Disconnect.");
+ listenthread.Abort();
+ client.Network.Logout();
+ }
+
+ }
+
+ void ircclient_OnChannelMessage(object sender, IrcEventArgs e)
+ {
+ LogMessage(e.Data.Nick + ": " + e.Data.Message);
+ //From IRC -> Inject to SL
+ client.Avatar.Say(e.Data.Nick + ": " + e.Data.Message, 0);
+ }
+
+ private void frmSLIRC_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ client = new SecondLife("keywords.txt", "message_template.msg");
+ client.Avatar.OnChat += new ChatCallback(Avatar_OnChat);
+ grpLogin.Enabled = true;
+ }
+ catch (Exception error)
+ {
+ MessageBox.Show(this, error.ToString());
+ }
+ }
+ private delegate void SingleStringDelegate(string s);
+ void LogMessage(string msg)
+ {
+ if (!this.InvokeRequired)
+ {
+ int i = lstLog.Items.Add(msg);
+ lstLog.SelectedIndex = i;
+ }
+ else
+ {
+ Invoke(new SingleStringDelegate(LogMessage), new object[] { msg });
+ }
+ }
+ void AddToAllowedList(string name)
+ {
+ if (!this.InvokeRequired)
+ {
+ lstAllowedUsers.Items.Add(name);
+ }
+ else
+ {
+ Invoke(new SingleStringDelegate(AddToAllowedList), new object[] { name });
+ }
+ }
+ void Avatar_OnChat(string message, byte audible, byte type, byte sourcetype, string name, LLUUID id, byte command, LLUUID commandID)
+ {
+ if (message.Equals("addme"))
+ {
+ //Add to the list
+ LogMessage("Adding " + name + " to the allowed list");
+ AddToAllowedList(name);
+ }
+ else
+ {
+ if (lstAllowedUsers.Items.Contains(name) && audible == 1 && !message.Equals(""))
+ {
+ LogMessage(name + ": " + message);
+ ircclient.SendMessage(SendType.Message, txtChannel.Text, name + " : " + message);
+ }
+ }
+ }
+
+ private void btnJoin_Click(object sender, EventArgs e)
+ {
+ ircclient.RfcJoin(txtChannel.Text);
+ LogMessage("Joining " + txtChannel.Text);
+ }
+
+ private void btnGetPos_Click(object sender, EventArgs e)
+ {
+ LogMessage("Position: " + client.Avatar.Position.X.ToString() + " " + client.Avatar.Position.Y.ToString());
+ }
+
+ private void btnSay_Click(object sender, EventArgs e)
+ {
+ client.Avatar.Say(ircclient.Nickname + ": " + txtMessage.Text, 0);
+ ircclient.SendMessage(SendType.Message, txtChannel.Text, txtMessage.Text);
+ }
+
+ }
}
\ No newline at end of file
diff --git a/applications/SLIRC/frmSLIRC.resx b/applications/SLIRC/frmSLIRC.resx
index ff31a6db..19dc0dd8 100644
--- a/applications/SLIRC/frmSLIRC.resx
+++ b/applications/SLIRC/frmSLIRC.resx
@@ -1,120 +1,120 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
\ No newline at end of file
diff --git a/applications/SecondSuite/AssemblyInfo.cs b/applications/SecondSuite/AssemblyInfo.cs
index a4267772..4f236967 100644
--- a/applications/SecondSuite/AssemblyInfo.cs
+++ b/applications/SecondSuite/AssemblyInfo.cs
@@ -1,58 +1,58 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// 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("Second Suite")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("John Hurliman")]
-[assembly: AssemblyProduct("Second Suite")]
-[assembly: AssemblyCopyright("(c) 2006 John Hurliman")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// 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("Second Suite")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("John Hurliman")]
+[assembly: AssemblyProduct("Second Suite")]
+[assembly: AssemblyCopyright("(c) 2006 John Hurliman")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/applications/SecondSuite/Global.cs b/applications/SecondSuite/Global.cs
index af62eb49..b1154582 100644
--- a/applications/SecondSuite/Global.cs
+++ b/applications/SecondSuite/Global.cs
@@ -1,19 +1,19 @@
-using System;
-using System.Collections;
-using System.Threading;
-using SecondSuite.Plugins;
-
-namespace SecondSuite
-{
- public class Global
- {
- public Global()
- {
- }
-
- public static PluginCollection Plugins = new PluginCollection();
- public static Mutex PluginsMutex = new Mutex(false, "PluginsMutex");
- public static ArrayList Clients = new ArrayList();
- public static Mutex ClientsMutex = new Mutex(false, "ClientsMutex");
- }
-}
+using System;
+using System.Collections;
+using System.Threading;
+using SecondSuite.Plugins;
+
+namespace SecondSuite
+{
+ public class Global
+ {
+ public Global()
+ {
+ }
+
+ public static PluginCollection Plugins = new PluginCollection();
+ public static Mutex PluginsMutex = new Mutex(false, "PluginsMutex");
+ public static ArrayList Clients = new ArrayList();
+ public static Mutex ClientsMutex = new Mutex(false, "ClientsMutex");
+ }
+}
diff --git a/applications/SecondSuite/Plugins/Accountant/Accountant.cs b/applications/SecondSuite/Plugins/Accountant/Accountant.cs
index d15a5b05..6b44b224 100644
--- a/applications/SecondSuite/Plugins/Accountant/Accountant.cs
+++ b/applications/SecondSuite/Plugins/Accountant/Accountant.cs
@@ -1,68 +1,68 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using libsecondlife;
-using SecondSuite.Plugins;
-
-namespace SecondSuite.Plugins
-{
- ///
- /// Accountant plugin implementation
- ///
- public class Accountant : SSPlugin
- {
- public string Name { get { return "Accountant"; } }
- public string Author { get { return "John Hurliman"; } }
- public string Homepage { get { return "http://www.highenergychemistry.com/"; } }
- public string Description { get { return "Transfer money between accounts"; } }
- public bool SecondLifeClient { get { return true; } }
- public ConnectionEvent ConnectionHandler { get { return OnConnection; } }
- public override string ToString() { return Name; }
-
- private frmAccountant Form;
- private ConnectionEvent OnConnection;
-
- public void Init(SecondLife client)
- {
- Form = new frmAccountant(client);
- OnConnection = new ConnectionEvent(Form.Connected);
- }
-
- public System.Windows.Forms.Form Load()
- {
- return Form;
- }
-
- public void Shutdown()
- {
- if (Form != null)
- {
- Form.Close();
- }
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using libsecondlife;
+using SecondSuite.Plugins;
+
+namespace SecondSuite.Plugins
+{
+ ///
+ /// Accountant plugin implementation
+ ///
+ public class Accountant : SSPlugin
+ {
+ public string Name { get { return "Accountant"; } }
+ public string Author { get { return "John Hurliman"; } }
+ public string Homepage { get { return "http://www.highenergychemistry.com/"; } }
+ public string Description { get { return "Transfer money between accounts"; } }
+ public bool SecondLifeClient { get { return true; } }
+ public ConnectionEvent ConnectionHandler { get { return OnConnection; } }
+ public override string ToString() { return Name; }
+
+ private frmAccountant Form;
+ private ConnectionEvent OnConnection;
+
+ public void Init(SecondLife client)
+ {
+ Form = new frmAccountant(client);
+ OnConnection = new ConnectionEvent(Form.Connected);
+ }
+
+ public System.Windows.Forms.Form Load()
+ {
+ return Form;
+ }
+
+ public void Shutdown()
+ {
+ if (Form != null)
+ {
+ Form.Close();
+ }
+ }
+ }
+}
diff --git a/applications/SecondSuite/Plugins/Accountant/Accountant.csproj b/applications/SecondSuite/Plugins/Accountant/Accountant.csproj
index 99711c2a..0e6bccb8 100644
--- a/applications/SecondSuite/Plugins/Accountant/Accountant.csproj
+++ b/applications/SecondSuite/Plugins/Accountant/Accountant.csproj
@@ -1,132 +1,132 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/SecondSuite/Plugins/Accountant/AssemblyInfo.cs b/applications/SecondSuite/Plugins/Accountant/AssemblyInfo.cs
index 177a4f0e..9f89a328 100644
--- a/applications/SecondSuite/Plugins/Accountant/AssemblyInfo.cs
+++ b/applications/SecondSuite/Plugins/Accountant/AssemblyInfo.cs
@@ -1,58 +1,58 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// 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("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// 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("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/applications/SecondSuite/Plugins/Accountant/frmAccountant.cs b/applications/SecondSuite/Plugins/Accountant/frmAccountant.cs
index 58d595c3..01a56a24 100644
--- a/applications/SecondSuite/Plugins/Accountant/frmAccountant.cs
+++ b/applications/SecondSuite/Plugins/Accountant/frmAccountant.cs
@@ -1,406 +1,406 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-using System.Threading;
-using libsecondlife;
-
-namespace SecondSuite.Plugins
-{
- ///
- /// Summary description for frmAccountant.
- ///
- public class frmAccountant : System.Windows.Forms.Form
- {
- private System.Windows.Forms.ListView lstFind;
- private System.Windows.Forms.ColumnHeader colName;
- private System.Windows.Forms.ColumnHeader colOnline;
- private System.Windows.Forms.ColumnHeader colUuid;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Button cmdTransfer;
- private System.Windows.Forms.TextBox txtTransfer;
- private System.Windows.Forms.TextBox txtFind;
- private System.Windows.Forms.Button cmdFind;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Label lblBalance;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label lblName;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.TextBox txtDescription;
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.Container components = null;
-
- // libsecondlife instance
- private SecondLife Client;
- // Mutex for locking the listview
- Mutex lstFindMutex;
-
- public frmAccountant(SecondLife client)
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- Client = client;
- lstFindMutex = new Mutex(false, "lstFindMutex");
-
- // Install our packet handlers
- Client.Network.RegisterCallback("MoneyBalanceReply", new PacketCallback(BalanceHandler));
- Client.Network.RegisterCallback("DirPeopleReply", new PacketCallback(DirPeopleHandler));
- }
-
- ///
- /// Clean up any resources being used.
- ///
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- public void Connected()
- {
- lblName.Text = Client.Network.LoginValues["first_name"] + " " +
- Client.Network.LoginValues["last_name"];
-
- // MoneyBalanceRequest
- Hashtable blocks = new Hashtable();
- Hashtable fields = new Hashtable();
- blocks = new Hashtable();
- fields = new Hashtable();
- fields["AgentID"] = Client.Network.AgentID;
- fields["TransactionID"] = LLUUID.GenerateUUID();
- blocks[fields] = "MoneyData";
- Packet packet = PacketBuilder.BuildPacket("MoneyBalanceRequest", Client.Protocol, blocks,
- Helpers.MSG_RELIABLE);
-
- Client.Network.SendPacket(packet);
- }
-
- private void BalanceHandler(Packet packet, Simulator simulator)
- {
- if (packet.Layout.Name == "MoneyBalanceReply")
- {
- int balance = 0;
- int squareMetersCredit = 0;
- string description = "";
- LLUUID transactionID = null;
- bool transactionSuccess = false;
-
- foreach (Block block in packet.Blocks())
- {
- foreach (Field field in block.Fields)
- {
- if (field.Layout.Name == "MoneyBalance")
- {
- balance = (int)field.Data;
- }
- else if (field.Layout.Name == "SquareMetersCredit")
- {
- squareMetersCredit = (int)field.Data;
- }
- else if (field.Layout.Name == "Description")
- {
- byte[] byteArray = (byte[])field.Data;
- description = System.Text.Encoding.ASCII.GetString(byteArray).Replace("\0", "");
- }
- else if (field.Layout.Name == "TransactionID")
- {
- transactionID = (LLUUID)field.Data;
- }
- else if (field.Layout.Name == "TransactionSuccess")
- {
- transactionSuccess = (bool)field.Data;
- }
- }
- }
-
- lblBalance.Text = balance.ToString();
- }
- }
-
- private void DirPeopleHandler(Packet packet, Simulator simulator)
- {
- lstFindMutex.WaitOne();
-
- foreach (Block block in packet.Blocks())
- {
- if (block.Layout.Name == "QueryReplies")
- {
- LLUUID id = null;
- string firstName = "";
- string lastName = "";
- bool online = false;
-
- foreach (Field field in block.Fields)
- {
- if (field.Layout.Name == "AgentID")
- {
- id = (LLUUID)field.Data;
- }
- else if (field.Layout.Name == "LastName")
- {
- lastName = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", "");
- }
- else if (field.Layout.Name == "FirstName")
- {
- firstName = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", "");
- }
- else if (field.Layout.Name == "Online")
- {
- online = (bool)field.Data;
- }
- }
-
- if (id != null)
- {
- ListViewItem listItem = new ListViewItem(new string[]
- { firstName + " " + lastName, (online ? "Yes" : "No"), id.ToString() });
- lstFind.Items.Add(listItem);
- }
- }
- }
-
- lstFindMutex.ReleaseMutex();
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.lstFind = new System.Windows.Forms.ListView();
- this.colName = new System.Windows.Forms.ColumnHeader();
- this.colOnline = new System.Windows.Forms.ColumnHeader();
- this.colUuid = new System.Windows.Forms.ColumnHeader();
- this.label7 = new System.Windows.Forms.Label();
- this.cmdTransfer = new System.Windows.Forms.Button();
- this.txtTransfer = new System.Windows.Forms.TextBox();
- this.txtFind = new System.Windows.Forms.TextBox();
- this.cmdFind = new System.Windows.Forms.Button();
- this.label5 = new System.Windows.Forms.Label();
- this.lblBalance = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.lblName = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.txtDescription = new System.Windows.Forms.TextBox();
- this.SuspendLayout();
- //
- // lstFind
- //
- this.lstFind.Activation = System.Windows.Forms.ItemActivation.OneClick;
- this.lstFind.AllowColumnReorder = true;
- this.lstFind.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.colName,
- this.colOnline,
- this.colUuid});
- this.lstFind.FullRowSelect = true;
- this.lstFind.HideSelection = false;
- this.lstFind.Location = new System.Drawing.Point(16, 88);
- this.lstFind.Name = "lstFind";
- this.lstFind.Size = new System.Drawing.Size(336, 248);
- this.lstFind.Sorting = System.Windows.Forms.SortOrder.Ascending;
- this.lstFind.TabIndex = 53;
- this.lstFind.View = System.Windows.Forms.View.Details;
- //
- // colName
- //
- this.colName.Text = "Name";
- this.colName.Width = 120;
- //
- // colOnline
- //
- this.colOnline.Text = "Online";
- this.colOnline.Width = 50;
- //
- // colUuid
- //
- this.colUuid.Text = "UUID";
- this.colUuid.Width = 150;
- //
- // label7
- //
- this.label7.Location = new System.Drawing.Point(360, 152);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(88, 16);
- this.label7.TabIndex = 56;
- this.label7.Text = "Amount:";
- //
- // cmdTransfer
- //
- this.cmdTransfer.Location = new System.Drawing.Point(472, 248);
- this.cmdTransfer.Name = "cmdTransfer";
- this.cmdTransfer.Size = new System.Drawing.Size(104, 24);
- this.cmdTransfer.TabIndex = 55;
- this.cmdTransfer.Text = "Transfer Lindens";
- this.cmdTransfer.Click += new System.EventHandler(this.cmdTransfer_Click);
- //
- // txtTransfer
- //
- this.txtTransfer.Location = new System.Drawing.Point(360, 168);
- this.txtTransfer.MaxLength = 7;
- this.txtTransfer.Name = "txtTransfer";
- this.txtTransfer.Size = new System.Drawing.Size(104, 20);
- this.txtTransfer.TabIndex = 54;
- this.txtTransfer.Text = "";
- //
- // txtFind
- //
- this.txtFind.Location = new System.Drawing.Point(16, 56);
- this.txtFind.Name = "txtFind";
- this.txtFind.Size = new System.Drawing.Size(184, 20);
- this.txtFind.TabIndex = 51;
- this.txtFind.Text = "";
- //
- // cmdFind
- //
- this.cmdFind.Location = new System.Drawing.Point(208, 56);
- this.cmdFind.Name = "cmdFind";
- this.cmdFind.Size = new System.Drawing.Size(48, 24);
- this.cmdFind.TabIndex = 52;
- this.cmdFind.Text = "Find";
- this.cmdFind.Click += new System.EventHandler(this.cmdFind_Click);
- //
- // label5
- //
- this.label5.Location = new System.Drawing.Point(16, 40);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(88, 16);
- this.label5.TabIndex = 60;
- this.label5.Text = "People Search";
- //
- // lblBalance
- //
- this.lblBalance.Location = new System.Drawing.Point(512, 8);
- this.lblBalance.Name = "lblBalance";
- this.lblBalance.Size = new System.Drawing.Size(64, 16);
- this.lblBalance.TabIndex = 61;
- this.lblBalance.TextAlign = System.Drawing.ContentAlignment.TopRight;
- //
- // label6
- //
- this.label6.Location = new System.Drawing.Point(456, 8);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(56, 16);
- this.label6.TabIndex = 59;
- this.label6.Text = "Balance:";
- //
- // lblName
- //
- this.lblName.Location = new System.Drawing.Point(64, 8);
- this.lblName.Name = "lblName";
- this.lblName.Size = new System.Drawing.Size(184, 16);
- this.lblName.TabIndex = 57;
- //
- // label4
- //
- this.label4.Location = new System.Drawing.Point(16, 8);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(48, 16);
- this.label4.TabIndex = 58;
- this.label4.Text = "Name:";
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(360, 200);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(168, 16);
- this.label1.TabIndex = 63;
- this.label1.Text = "Description (optional):";
- //
- // txtDescription
- //
- this.txtDescription.Location = new System.Drawing.Point(360, 216);
- this.txtDescription.MaxLength = 7;
- this.txtDescription.Name = "txtDescription";
- this.txtDescription.Size = new System.Drawing.Size(216, 20);
- this.txtDescription.TabIndex = 62;
- this.txtDescription.Text = "";
- //
- // frmAccountant
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(592, 349);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.txtDescription);
- this.Controls.Add(this.txtTransfer);
- this.Controls.Add(this.txtFind);
- this.Controls.Add(this.lstFind);
- this.Controls.Add(this.label7);
- this.Controls.Add(this.cmdTransfer);
- this.Controls.Add(this.cmdFind);
- this.Controls.Add(this.label5);
- this.Controls.Add(this.lblBalance);
- this.Controls.Add(this.label6);
- this.Controls.Add(this.lblName);
- this.Controls.Add(this.label4);
- this.Name = "frmAccountant";
- this.Text = "Accountant";
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private void cmdFind_Click(object sender, System.EventArgs e)
- {
- lstFind.Items.Clear();
-
- Hashtable blocks = new Hashtable();
- Hashtable fields = new Hashtable();
- fields["QueryID"] = LLUUID.GenerateUUID();
- fields["QueryFlags"] = (uint)1;
- fields["QueryStart"] = (int)0;
- fields["QueryText"] = txtFind.Text;
- blocks[fields] = "QueryData";
-
- fields = new Hashtable();
- fields["AgentID"] = Client.Network.AgentID;
- fields["SessionID"] = Client.Network.SessionID;
- blocks[fields] = "AgentData";
-
- Packet packet = PacketBuilder.BuildPacket("DirFindQuery", Client.Protocol, blocks,
- Helpers.MSG_RELIABLE);
-
- Client.Network.SendPacket(packet);
- }
-
- private void cmdTransfer_Click(object sender, System.EventArgs e)
- {
- int amount = 0;
-
- try
- {
- amount = System.Convert.ToInt32(txtTransfer.Text);
- }
- catch (Exception)
- {
- MessageBox.Show(txtTransfer.Text + " is not a valid amount");
- return;
- }
-
- if (lstFind.SelectedItems.Count != 1)
- {
- MessageBox.Show("Find an avatar using the directory search and select " +
- "their name to transfer money");
- return;
- }
-
- Client.Avatar.GiveMoney(new LLUUID(lstFind.SelectedItems[0].SubItems[2].Text),
- amount, "SLAccountant payment");
- }
- }
-}
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Threading;
+using libsecondlife;
+
+namespace SecondSuite.Plugins
+{
+ ///
+ /// Summary description for frmAccountant.
+ ///
+ public class frmAccountant : System.Windows.Forms.Form
+ {
+ private System.Windows.Forms.ListView lstFind;
+ private System.Windows.Forms.ColumnHeader colName;
+ private System.Windows.Forms.ColumnHeader colOnline;
+ private System.Windows.Forms.ColumnHeader colUuid;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.Button cmdTransfer;
+ private System.Windows.Forms.TextBox txtTransfer;
+ private System.Windows.Forms.TextBox txtFind;
+ private System.Windows.Forms.Button cmdFind;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Label lblBalance;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.Label lblName;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtDescription;
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.Container components = null;
+
+ // libsecondlife instance
+ private SecondLife Client;
+ // Mutex for locking the listview
+ Mutex lstFindMutex;
+
+ public frmAccountant(SecondLife client)
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ Client = client;
+ lstFindMutex = new Mutex(false, "lstFindMutex");
+
+ // Install our packet handlers
+ Client.Network.RegisterCallback("MoneyBalanceReply", new PacketCallback(BalanceHandler));
+ Client.Network.RegisterCallback("DirPeopleReply", new PacketCallback(DirPeopleHandler));
+ }
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if(components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose( disposing );
+ }
+
+ public void Connected()
+ {
+ lblName.Text = Client.Network.LoginValues["first_name"] + " " +
+ Client.Network.LoginValues["last_name"];
+
+ // MoneyBalanceRequest
+ Hashtable blocks = new Hashtable();
+ Hashtable fields = new Hashtable();
+ blocks = new Hashtable();
+ fields = new Hashtable();
+ fields["AgentID"] = Client.Network.AgentID;
+ fields["TransactionID"] = LLUUID.GenerateUUID();
+ blocks[fields] = "MoneyData";
+ Packet packet = PacketBuilder.BuildPacket("MoneyBalanceRequest", Client.Protocol, blocks,
+ Helpers.MSG_RELIABLE);
+
+ Client.Network.SendPacket(packet);
+ }
+
+ private void BalanceHandler(Packet packet, Simulator simulator)
+ {
+ if (packet.Layout.Name == "MoneyBalanceReply")
+ {
+ int balance = 0;
+ int squareMetersCredit = 0;
+ string description = "";
+ LLUUID transactionID = null;
+ bool transactionSuccess = false;
+
+ foreach (Block block in packet.Blocks())
+ {
+ foreach (Field field in block.Fields)
+ {
+ if (field.Layout.Name == "MoneyBalance")
+ {
+ balance = (int)field.Data;
+ }
+ else if (field.Layout.Name == "SquareMetersCredit")
+ {
+ squareMetersCredit = (int)field.Data;
+ }
+ else if (field.Layout.Name == "Description")
+ {
+ byte[] byteArray = (byte[])field.Data;
+ description = System.Text.Encoding.ASCII.GetString(byteArray).Replace("\0", "");
+ }
+ else if (field.Layout.Name == "TransactionID")
+ {
+ transactionID = (LLUUID)field.Data;
+ }
+ else if (field.Layout.Name == "TransactionSuccess")
+ {
+ transactionSuccess = (bool)field.Data;
+ }
+ }
+ }
+
+ lblBalance.Text = balance.ToString();
+ }
+ }
+
+ private void DirPeopleHandler(Packet packet, Simulator simulator)
+ {
+ lstFindMutex.WaitOne();
+
+ foreach (Block block in packet.Blocks())
+ {
+ if (block.Layout.Name == "QueryReplies")
+ {
+ LLUUID id = null;
+ string firstName = "";
+ string lastName = "";
+ bool online = false;
+
+ foreach (Field field in block.Fields)
+ {
+ if (field.Layout.Name == "AgentID")
+ {
+ id = (LLUUID)field.Data;
+ }
+ else if (field.Layout.Name == "LastName")
+ {
+ lastName = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", "");
+ }
+ else if (field.Layout.Name == "FirstName")
+ {
+ firstName = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", "");
+ }
+ else if (field.Layout.Name == "Online")
+ {
+ online = (bool)field.Data;
+ }
+ }
+
+ if (id != null)
+ {
+ ListViewItem listItem = new ListViewItem(new string[]
+ { firstName + " " + lastName, (online ? "Yes" : "No"), id.ToString() });
+ lstFind.Items.Add(listItem);
+ }
+ }
+ }
+
+ lstFindMutex.ReleaseMutex();
+ }
+
+ #region Windows Form Designer generated code
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.lstFind = new System.Windows.Forms.ListView();
+ this.colName = new System.Windows.Forms.ColumnHeader();
+ this.colOnline = new System.Windows.Forms.ColumnHeader();
+ this.colUuid = new System.Windows.Forms.ColumnHeader();
+ this.label7 = new System.Windows.Forms.Label();
+ this.cmdTransfer = new System.Windows.Forms.Button();
+ this.txtTransfer = new System.Windows.Forms.TextBox();
+ this.txtFind = new System.Windows.Forms.TextBox();
+ this.cmdFind = new System.Windows.Forms.Button();
+ this.label5 = new System.Windows.Forms.Label();
+ this.lblBalance = new System.Windows.Forms.Label();
+ this.label6 = new System.Windows.Forms.Label();
+ this.lblName = new System.Windows.Forms.Label();
+ this.label4 = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtDescription = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // lstFind
+ //
+ this.lstFind.Activation = System.Windows.Forms.ItemActivation.OneClick;
+ this.lstFind.AllowColumnReorder = true;
+ this.lstFind.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.colName,
+ this.colOnline,
+ this.colUuid});
+ this.lstFind.FullRowSelect = true;
+ this.lstFind.HideSelection = false;
+ this.lstFind.Location = new System.Drawing.Point(16, 88);
+ this.lstFind.Name = "lstFind";
+ this.lstFind.Size = new System.Drawing.Size(336, 248);
+ this.lstFind.Sorting = System.Windows.Forms.SortOrder.Ascending;
+ this.lstFind.TabIndex = 53;
+ this.lstFind.View = System.Windows.Forms.View.Details;
+ //
+ // colName
+ //
+ this.colName.Text = "Name";
+ this.colName.Width = 120;
+ //
+ // colOnline
+ //
+ this.colOnline.Text = "Online";
+ this.colOnline.Width = 50;
+ //
+ // colUuid
+ //
+ this.colUuid.Text = "UUID";
+ this.colUuid.Width = 150;
+ //
+ // label7
+ //
+ this.label7.Location = new System.Drawing.Point(360, 152);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(88, 16);
+ this.label7.TabIndex = 56;
+ this.label7.Text = "Amount:";
+ //
+ // cmdTransfer
+ //
+ this.cmdTransfer.Location = new System.Drawing.Point(472, 248);
+ this.cmdTransfer.Name = "cmdTransfer";
+ this.cmdTransfer.Size = new System.Drawing.Size(104, 24);
+ this.cmdTransfer.TabIndex = 55;
+ this.cmdTransfer.Text = "Transfer Lindens";
+ this.cmdTransfer.Click += new System.EventHandler(this.cmdTransfer_Click);
+ //
+ // txtTransfer
+ //
+ this.txtTransfer.Location = new System.Drawing.Point(360, 168);
+ this.txtTransfer.MaxLength = 7;
+ this.txtTransfer.Name = "txtTransfer";
+ this.txtTransfer.Size = new System.Drawing.Size(104, 20);
+ this.txtTransfer.TabIndex = 54;
+ this.txtTransfer.Text = "";
+ //
+ // txtFind
+ //
+ this.txtFind.Location = new System.Drawing.Point(16, 56);
+ this.txtFind.Name = "txtFind";
+ this.txtFind.Size = new System.Drawing.Size(184, 20);
+ this.txtFind.TabIndex = 51;
+ this.txtFind.Text = "";
+ //
+ // cmdFind
+ //
+ this.cmdFind.Location = new System.Drawing.Point(208, 56);
+ this.cmdFind.Name = "cmdFind";
+ this.cmdFind.Size = new System.Drawing.Size(48, 24);
+ this.cmdFind.TabIndex = 52;
+ this.cmdFind.Text = "Find";
+ this.cmdFind.Click += new System.EventHandler(this.cmdFind_Click);
+ //
+ // label5
+ //
+ this.label5.Location = new System.Drawing.Point(16, 40);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(88, 16);
+ this.label5.TabIndex = 60;
+ this.label5.Text = "People Search";
+ //
+ // lblBalance
+ //
+ this.lblBalance.Location = new System.Drawing.Point(512, 8);
+ this.lblBalance.Name = "lblBalance";
+ this.lblBalance.Size = new System.Drawing.Size(64, 16);
+ this.lblBalance.TabIndex = 61;
+ this.lblBalance.TextAlign = System.Drawing.ContentAlignment.TopRight;
+ //
+ // label6
+ //
+ this.label6.Location = new System.Drawing.Point(456, 8);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(56, 16);
+ this.label6.TabIndex = 59;
+ this.label6.Text = "Balance:";
+ //
+ // lblName
+ //
+ this.lblName.Location = new System.Drawing.Point(64, 8);
+ this.lblName.Name = "lblName";
+ this.lblName.Size = new System.Drawing.Size(184, 16);
+ this.lblName.TabIndex = 57;
+ //
+ // label4
+ //
+ this.label4.Location = new System.Drawing.Point(16, 8);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(48, 16);
+ this.label4.TabIndex = 58;
+ this.label4.Text = "Name:";
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(360, 200);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(168, 16);
+ this.label1.TabIndex = 63;
+ this.label1.Text = "Description (optional):";
+ //
+ // txtDescription
+ //
+ this.txtDescription.Location = new System.Drawing.Point(360, 216);
+ this.txtDescription.MaxLength = 7;
+ this.txtDescription.Name = "txtDescription";
+ this.txtDescription.Size = new System.Drawing.Size(216, 20);
+ this.txtDescription.TabIndex = 62;
+ this.txtDescription.Text = "";
+ //
+ // frmAccountant
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(592, 349);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.txtDescription);
+ this.Controls.Add(this.txtTransfer);
+ this.Controls.Add(this.txtFind);
+ this.Controls.Add(this.lstFind);
+ this.Controls.Add(this.label7);
+ this.Controls.Add(this.cmdTransfer);
+ this.Controls.Add(this.cmdFind);
+ this.Controls.Add(this.label5);
+ this.Controls.Add(this.lblBalance);
+ this.Controls.Add(this.label6);
+ this.Controls.Add(this.lblName);
+ this.Controls.Add(this.label4);
+ this.Name = "frmAccountant";
+ this.Text = "Accountant";
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ private void cmdFind_Click(object sender, System.EventArgs e)
+ {
+ lstFind.Items.Clear();
+
+ Hashtable blocks = new Hashtable();
+ Hashtable fields = new Hashtable();
+ fields["QueryID"] = LLUUID.GenerateUUID();
+ fields["QueryFlags"] = (uint)1;
+ fields["QueryStart"] = (int)0;
+ fields["QueryText"] = txtFind.Text;
+ blocks[fields] = "QueryData";
+
+ fields = new Hashtable();
+ fields["AgentID"] = Client.Network.AgentID;
+ fields["SessionID"] = Client.Network.SessionID;
+ blocks[fields] = "AgentData";
+
+ Packet packet = PacketBuilder.BuildPacket("DirFindQuery", Client.Protocol, blocks,
+ Helpers.MSG_RELIABLE);
+
+ Client.Network.SendPacket(packet);
+ }
+
+ private void cmdTransfer_Click(object sender, System.EventArgs e)
+ {
+ int amount = 0;
+
+ try
+ {
+ amount = System.Convert.ToInt32(txtTransfer.Text);
+ }
+ catch (Exception)
+ {
+ MessageBox.Show(txtTransfer.Text + " is not a valid amount");
+ return;
+ }
+
+ if (lstFind.SelectedItems.Count != 1)
+ {
+ MessageBox.Show("Find an avatar using the directory search and select " +
+ "their name to transfer money");
+ return;
+ }
+
+ Client.Avatar.GiveMoney(new LLUUID(lstFind.SelectedItems[0].SubItems[2].Text),
+ amount, "SLAccountant payment");
+ }
+ }
+}
diff --git a/applications/SecondSuite/Plugins/Accountant/frmAccountant.resx b/applications/SecondSuite/Plugins/Accountant/frmAccountant.resx
index d36cabfb..9d343c94 100644
--- a/applications/SecondSuite/Plugins/Accountant/frmAccountant.resx
+++ b/applications/SecondSuite/Plugins/Accountant/frmAccountant.resx
@@ -1,265 +1,265 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 1.3
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- False
-
-
- (Default)
-
-
- False
-
-
- False
-
-
- True
-
-
- 8, 8
-
-
- True
-
-
- 80
-
-
- frmAccountant
-
-
- Private
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ (Default)
+
+
+ False
+
+
+ False
+
+
+ True
+
+
+ 8, 8
+
+
+ True
+
+
+ 80
+
+
+ frmAccountant
+
+
+ Private
+
\ No newline at end of file
diff --git a/applications/SecondSuite/Plugins/PrimBuilder/AssemblyInfo.cs b/applications/SecondSuite/Plugins/PrimBuilder/AssemblyInfo.cs
index 177a4f0e..9f89a328 100644
--- a/applications/SecondSuite/Plugins/PrimBuilder/AssemblyInfo.cs
+++ b/applications/SecondSuite/Plugins/PrimBuilder/AssemblyInfo.cs
@@ -1,58 +1,58 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// 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("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// 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("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/applications/SecondSuite/Plugins/PrimBuilder/PrimBuilder.cs b/applications/SecondSuite/Plugins/PrimBuilder/PrimBuilder.cs
index 4b4e98f4..18851c63 100644
--- a/applications/SecondSuite/Plugins/PrimBuilder/PrimBuilder.cs
+++ b/applications/SecondSuite/Plugins/PrimBuilder/PrimBuilder.cs
@@ -1,68 +1,68 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using libsecondlife;
-using SecondSuite.Plugins;
-
-namespace SecondSuite.Plugins
-{
- ///
- /// Accountant plugin implementation
- ///
- public class PrimBuilder : SSPlugin
- {
- public string Name { get { return "Prim Builder"; } }
- public string Author { get { return "John Hurliman"; } }
- public string Homepage { get { return "http://www.highenergychemistry.com/"; } }
- public string Description { get { return "Create prims the hard way"; } }
- public bool SecondLifeClient { get { return true; } }
- public ConnectionEvent ConnectionHandler { get { return OnConnection; } }
- public override string ToString() { return Name; }
-
- private frmPrimBuilder Form;
- private ConnectionEvent OnConnection;
-
- public void Init(SecondLife client)
- {
- Form = new frmPrimBuilder(client);
- OnConnection = new ConnectionEvent(Form.Connected);
- }
-
- public System.Windows.Forms.Form Load()
- {
- return Form;
- }
-
- public void Shutdown()
- {
- if (Form != null)
- {
- Form.Close();
- }
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using libsecondlife;
+using SecondSuite.Plugins;
+
+namespace SecondSuite.Plugins
+{
+ ///
+ /// Accountant plugin implementation
+ ///
+ public class PrimBuilder : SSPlugin
+ {
+ public string Name { get { return "Prim Builder"; } }
+ public string Author { get { return "John Hurliman"; } }
+ public string Homepage { get { return "http://www.highenergychemistry.com/"; } }
+ public string Description { get { return "Create prims the hard way"; } }
+ public bool SecondLifeClient { get { return true; } }
+ public ConnectionEvent ConnectionHandler { get { return OnConnection; } }
+ public override string ToString() { return Name; }
+
+ private frmPrimBuilder Form;
+ private ConnectionEvent OnConnection;
+
+ public void Init(SecondLife client)
+ {
+ Form = new frmPrimBuilder(client);
+ OnConnection = new ConnectionEvent(Form.Connected);
+ }
+
+ public System.Windows.Forms.Form Load()
+ {
+ return Form;
+ }
+
+ public void Shutdown()
+ {
+ if (Form != null)
+ {
+ Form.Close();
+ }
+ }
+ }
+}
diff --git a/applications/SecondSuite/Plugins/PrimBuilder/PrimBuilder.csproj b/applications/SecondSuite/Plugins/PrimBuilder/PrimBuilder.csproj
index 083fab79..80538a62 100644
--- a/applications/SecondSuite/Plugins/PrimBuilder/PrimBuilder.csproj
+++ b/applications/SecondSuite/Plugins/PrimBuilder/PrimBuilder.csproj
@@ -1,130 +1,130 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/SecondSuite/Plugins/PrimBuilder/frmPrimBuilder.cs b/applications/SecondSuite/Plugins/PrimBuilder/frmPrimBuilder.cs
index 16beb5fc..05bd3362 100644
--- a/applications/SecondSuite/Plugins/PrimBuilder/frmPrimBuilder.cs
+++ b/applications/SecondSuite/Plugins/PrimBuilder/frmPrimBuilder.cs
@@ -1,1248 +1,1248 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-using System.Data;
-using libsecondlife;
-
-namespace SecondSuite.Plugins
-{
- ///
- /// Summary description for Form1.
- ///
- public class frmPrimBuilder : System.Windows.Forms.Form
- {
- private System.Windows.Forms.Button cmdBuild;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.Label label9;
- private System.Windows.Forms.Label label10;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Label label11;
- private System.Windows.Forms.Label label12;
- private System.Windows.Forms.Label label13;
- private System.Windows.Forms.Label label14;
- private System.Windows.Forms.Label label15;
- private System.Windows.Forms.Label label16;
- private System.Windows.Forms.Label label19;
- private System.Windows.Forms.Label label20;
- private System.Windows.Forms.Label label21;
- private System.Windows.Forms.Label label22;
- private System.Windows.Forms.Label label23;
- private System.Windows.Forms.Label label24;
- private System.Windows.Forms.Label label25;
- private System.Windows.Forms.Label label28;
- private System.Windows.Forms.Label label26;
- private System.Windows.Forms.Label label27;
- private System.Windows.Forms.Label label29;
- private System.Windows.Forms.Label label30;
- private System.Windows.Forms.Label label31;
- private System.Windows.Forms.Label label32;
- private System.Windows.Forms.Label label33;
- private System.Windows.Forms.Label label34;
- private System.Windows.Forms.NumericUpDown numScaleZ;
- private System.Windows.Forms.Label label35;
- private System.Windows.Forms.NumericUpDown numScaleY;
- private System.Windows.Forms.Label label36;
- private System.Windows.Forms.NumericUpDown numScaleX;
- private System.Windows.Forms.Label label37;
- private System.Windows.Forms.NumericUpDown numRotationZ;
- private System.Windows.Forms.Label label38;
- private System.Windows.Forms.NumericUpDown numRotationY;
- private System.Windows.Forms.Label label39;
- private System.Windows.Forms.NumericUpDown numRotationX;
- private System.Windows.Forms.Label label40;
- private System.Windows.Forms.NumericUpDown numRotationS;
- private System.Windows.Forms.NumericUpDown numProfileHollow;
- private System.Windows.Forms.NumericUpDown numPathCurve;
- private System.Windows.Forms.NumericUpDown numProfileCurve;
- private System.Windows.Forms.NumericUpDown numProfileBegin;
- private System.Windows.Forms.NumericUpDown numProfileEnd;
- private System.Windows.Forms.NumericUpDown numPathTwistBegin;
- private System.Windows.Forms.NumericUpDown numPathTwist;
- private System.Windows.Forms.NumericUpDown numPathTaperX;
- private System.Windows.Forms.NumericUpDown numPathTaperY;
- private System.Windows.Forms.NumericUpDown numPathShearX;
- private System.Windows.Forms.NumericUpDown numPathShearY;
- private System.Windows.Forms.NumericUpDown numPathScaleX;
- private System.Windows.Forms.NumericUpDown numPathScaleY;
- private System.Windows.Forms.NumericUpDown numPathRevolutions;
- private System.Windows.Forms.NumericUpDown numPathRadiusOffset;
- private System.Windows.Forms.NumericUpDown numPathBegin;
- private System.Windows.Forms.NumericUpDown numPathEnd;
- private System.Windows.Forms.NumericUpDown numMaterial;
- private System.Windows.Forms.TextBox txtName;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.NumericUpDown numPositionZ;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.NumericUpDown numPositionY;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.NumericUpDown numPositionX;
- private System.Windows.Forms.Label label41;
- private System.Windows.Forms.NumericUpDown numPathSkew;
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.Container components = null;
-
- //
- SecondLife Client;
-
- public frmPrimBuilder(SecondLife client)
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- Client = client;
- Client.Network.RegisterCallback("CoarseLocationUpdate", new PacketCallback(LocationHandler));
- }
-
- private void LocationHandler(Packet packet, Simulator simulator)
- {
- if (numPositionX.Value == 0)
- {
- numPositionX.Value = (decimal)Client.Avatar.Position.X;
- }
-
- if (numPositionY.Value == 0)
- {
- numPositionY.Value = (decimal)Client.Avatar.Position.Y;
- }
-
- if (numPositionZ.Value == 0)
- {
- numPositionZ.Value = (decimal)Client.Avatar.Position.Z;
- }
- }
-
- public void Connected()
- {
- ;
- }
-
- ///
- /// Clean up any resources being used.
- ///
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if (components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.cmdBuild = new System.Windows.Forms.Button();
- this.label4 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.label8 = new System.Windows.Forms.Label();
- this.label9 = new System.Windows.Forms.Label();
- this.label10 = new System.Windows.Forms.Label();
- this.label7 = new System.Windows.Forms.Label();
- this.label11 = new System.Windows.Forms.Label();
- this.label12 = new System.Windows.Forms.Label();
- this.label13 = new System.Windows.Forms.Label();
- this.label14 = new System.Windows.Forms.Label();
- this.label15 = new System.Windows.Forms.Label();
- this.label16 = new System.Windows.Forms.Label();
- this.label19 = new System.Windows.Forms.Label();
- this.label20 = new System.Windows.Forms.Label();
- this.label21 = new System.Windows.Forms.Label();
- this.label22 = new System.Windows.Forms.Label();
- this.label23 = new System.Windows.Forms.Label();
- this.label24 = new System.Windows.Forms.Label();
- this.label25 = new System.Windows.Forms.Label();
- this.label28 = new System.Windows.Forms.Label();
- this.label26 = new System.Windows.Forms.Label();
- this.label27 = new System.Windows.Forms.Label();
- this.label29 = new System.Windows.Forms.Label();
- this.label30 = new System.Windows.Forms.Label();
- this.label31 = new System.Windows.Forms.Label();
- this.label32 = new System.Windows.Forms.Label();
- this.label33 = new System.Windows.Forms.Label();
- this.label34 = new System.Windows.Forms.Label();
- this.numScaleZ = new System.Windows.Forms.NumericUpDown();
- this.label35 = new System.Windows.Forms.Label();
- this.numScaleY = new System.Windows.Forms.NumericUpDown();
- this.label36 = new System.Windows.Forms.Label();
- this.numScaleX = new System.Windows.Forms.NumericUpDown();
- this.label37 = new System.Windows.Forms.Label();
- this.numRotationZ = new System.Windows.Forms.NumericUpDown();
- this.label38 = new System.Windows.Forms.Label();
- this.numRotationY = new System.Windows.Forms.NumericUpDown();
- this.label39 = new System.Windows.Forms.Label();
- this.numRotationX = new System.Windows.Forms.NumericUpDown();
- this.label40 = new System.Windows.Forms.Label();
- this.numRotationS = new System.Windows.Forms.NumericUpDown();
- this.numProfileHollow = new System.Windows.Forms.NumericUpDown();
- this.numPathCurve = new System.Windows.Forms.NumericUpDown();
- this.numProfileCurve = new System.Windows.Forms.NumericUpDown();
- this.numProfileBegin = new System.Windows.Forms.NumericUpDown();
- this.numProfileEnd = new System.Windows.Forms.NumericUpDown();
- this.numPathTwistBegin = new System.Windows.Forms.NumericUpDown();
- this.numPathTwist = new System.Windows.Forms.NumericUpDown();
- this.numPathTaperX = new System.Windows.Forms.NumericUpDown();
- this.numPathTaperY = new System.Windows.Forms.NumericUpDown();
- this.numPathShearX = new System.Windows.Forms.NumericUpDown();
- this.numPathShearY = new System.Windows.Forms.NumericUpDown();
- this.numPathSkew = new System.Windows.Forms.NumericUpDown();
- this.numPathScaleX = new System.Windows.Forms.NumericUpDown();
- this.numPathScaleY = new System.Windows.Forms.NumericUpDown();
- this.numPathRevolutions = new System.Windows.Forms.NumericUpDown();
- this.numPathRadiusOffset = new System.Windows.Forms.NumericUpDown();
- this.numPathBegin = new System.Windows.Forms.NumericUpDown();
- this.numPathEnd = new System.Windows.Forms.NumericUpDown();
- this.numMaterial = new System.Windows.Forms.NumericUpDown();
- this.txtName = new System.Windows.Forms.TextBox();
- this.label3 = new System.Windows.Forms.Label();
- this.numPositionZ = new System.Windows.Forms.NumericUpDown();
- this.label2 = new System.Windows.Forms.Label();
- this.numPositionY = new System.Windows.Forms.NumericUpDown();
- this.label1 = new System.Windows.Forms.Label();
- this.numPositionX = new System.Windows.Forms.NumericUpDown();
- this.label41 = new System.Windows.Forms.Label();
- ((System.ComponentModel.ISupportInitialize)(this.numScaleZ)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numScaleY)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numScaleX)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numRotationZ)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numRotationY)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numRotationX)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numRotationS)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numProfileHollow)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathCurve)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numProfileCurve)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numProfileBegin)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numProfileEnd)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathTwistBegin)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathTwist)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathTaperX)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathTaperY)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathShearX)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathShearY)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathSkew)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathScaleX)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathScaleY)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathRevolutions)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathRadiusOffset)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathBegin)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathEnd)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numMaterial)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPositionZ)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPositionY)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPositionX)).BeginInit();
- this.SuspendLayout();
- //
- // cmdBuild
- //
- this.cmdBuild.Location = new System.Drawing.Point(408, 536);
- this.cmdBuild.Name = "cmdBuild";
- this.cmdBuild.Size = new System.Drawing.Size(104, 24);
- this.cmdBuild.TabIndex = 31;
- this.cmdBuild.Text = "Build Prim";
- this.cmdBuild.Click += new System.EventHandler(this.cmdBuild_Click);
- //
- // label4
- //
- this.label4.Location = new System.Drawing.Point(16, 16);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(120, 20);
- this.label4.TabIndex = 58;
- this.label4.Text = "Name:";
- //
- // label5
- //
- this.label5.Location = new System.Drawing.Point(16, 48);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(120, 20);
- this.label5.TabIndex = 59;
- this.label5.Text = "Material:";
- //
- // label6
- //
- this.label6.Location = new System.Drawing.Point(16, 80);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(120, 20);
- this.label6.TabIndex = 60;
- this.label6.Text = "Path:";
- //
- // label8
- //
- this.label8.Location = new System.Drawing.Point(16, 112);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(120, 20);
- this.label8.TabIndex = 62;
- this.label8.Text = "Path Radius Offset:";
- //
- // label9
- //
- this.label9.Location = new System.Drawing.Point(16, 144);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(120, 20);
- this.label9.TabIndex = 63;
- this.label9.Text = "Path Revolutions:";
- //
- // label10
- //
- this.label10.Location = new System.Drawing.Point(16, 176);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(120, 20);
- this.label10.TabIndex = 64;
- this.label10.Text = "Path Scale:";
- //
- // label7
- //
- this.label7.Location = new System.Drawing.Point(136, 80);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(96, 20);
- this.label7.TabIndex = 65;
- this.label7.Text = "Begin:";
- //
- // label11
- //
- this.label11.Location = new System.Drawing.Point(328, 80);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(80, 20);
- this.label11.TabIndex = 66;
- this.label11.Text = "End:";
- //
- // label12
- //
- this.label12.Location = new System.Drawing.Point(136, 176);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(96, 20);
- this.label12.TabIndex = 67;
- this.label12.Text = "X:";
- //
- // label13
- //
- this.label13.Location = new System.Drawing.Point(328, 176);
- this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(80, 20);
- this.label13.TabIndex = 68;
- this.label13.Text = "Y:";
- //
- // label14
- //
- this.label14.Location = new System.Drawing.Point(328, 208);
- this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(80, 20);
- this.label14.TabIndex = 71;
- this.label14.Text = "Y:";
- //
- // label15
- //
- this.label15.Location = new System.Drawing.Point(136, 208);
- this.label15.Name = "label15";
- this.label15.Size = new System.Drawing.Size(96, 20);
- this.label15.TabIndex = 70;
- this.label15.Text = "X:";
- //
- // label16
- //
- this.label16.Location = new System.Drawing.Point(16, 208);
- this.label16.Name = "label16";
- this.label16.Size = new System.Drawing.Size(120, 20);
- this.label16.TabIndex = 69;
- this.label16.Text = "Path Shear:";
- //
- // label19
- //
- this.label19.Location = new System.Drawing.Point(16, 336);
- this.label19.Name = "label19";
- this.label19.Size = new System.Drawing.Size(120, 20);
- this.label19.TabIndex = 72;
- this.label19.Text = "Path Skew:";
- //
- // label20
- //
- this.label20.Location = new System.Drawing.Point(328, 240);
- this.label20.Name = "label20";
- this.label20.Size = new System.Drawing.Size(80, 20);
- this.label20.TabIndex = 77;
- this.label20.Text = "Y:";
- //
- // label21
- //
- this.label21.Location = new System.Drawing.Point(136, 240);
- this.label21.Name = "label21";
- this.label21.Size = new System.Drawing.Size(96, 20);
- this.label21.TabIndex = 76;
- this.label21.Text = "X:";
- //
- // label22
- //
- this.label22.Location = new System.Drawing.Point(16, 240);
- this.label22.Name = "label22";
- this.label22.Size = new System.Drawing.Size(120, 20);
- this.label22.TabIndex = 75;
- this.label22.Text = "Path Taper:";
- //
- // label23
- //
- this.label23.Location = new System.Drawing.Point(328, 272);
- this.label23.Name = "label23";
- this.label23.Size = new System.Drawing.Size(80, 20);
- this.label23.TabIndex = 80;
- this.label23.Text = "Path Twist:";
- //
- // label24
- //
- this.label24.Location = new System.Drawing.Point(136, 272);
- this.label24.Name = "label24";
- this.label24.Size = new System.Drawing.Size(96, 20);
- this.label24.TabIndex = 79;
- this.label24.Text = "Path Twist Begin:";
- //
- // label25
- //
- this.label25.Location = new System.Drawing.Point(16, 272);
- this.label25.Name = "label25";
- this.label25.Size = new System.Drawing.Size(120, 20);
- this.label25.TabIndex = 78;
- this.label25.Text = "Twist:";
- //
- // label28
- //
- this.label28.Location = new System.Drawing.Point(16, 304);
- this.label28.Name = "label28";
- this.label28.Size = new System.Drawing.Size(120, 20);
- this.label28.TabIndex = 81;
- this.label28.Text = "Profile:";
- //
- // label26
- //
- this.label26.Location = new System.Drawing.Point(328, 304);
- this.label26.Name = "label26";
- this.label26.Size = new System.Drawing.Size(80, 20);
- this.label26.TabIndex = 83;
- this.label26.Text = "End:";
- //
- // label27
- //
- this.label27.Location = new System.Drawing.Point(136, 304);
- this.label27.Name = "label27";
- this.label27.Size = new System.Drawing.Size(96, 20);
- this.label27.TabIndex = 82;
- this.label27.Text = "Begin:";
- //
- // label29
- //
- this.label29.Location = new System.Drawing.Point(288, 336);
- this.label29.Name = "label29";
- this.label29.Size = new System.Drawing.Size(120, 20);
- this.label29.TabIndex = 84;
- this.label29.Text = "Profile Curve:";
- //
- // label30
- //
- this.label30.Location = new System.Drawing.Point(16, 368);
- this.label30.Name = "label30";
- this.label30.Size = new System.Drawing.Size(120, 20);
- this.label30.TabIndex = 85;
- this.label30.Text = "Path Curve:";
- //
- // label31
- //
- this.label31.Location = new System.Drawing.Point(288, 368);
- this.label31.Name = "label31";
- this.label31.Size = new System.Drawing.Size(120, 20);
- this.label31.TabIndex = 86;
- this.label31.Text = "Profile Hollow:";
- //
- // label32
- //
- this.label32.Location = new System.Drawing.Point(16, 400);
- this.label32.Name = "label32";
- this.label32.Size = new System.Drawing.Size(120, 16);
- this.label32.TabIndex = 87;
- this.label32.Text = "Rotation:";
- //
- // label33
- //
- this.label33.Location = new System.Drawing.Point(16, 456);
- this.label33.Name = "label33";
- this.label33.Size = new System.Drawing.Size(120, 20);
- this.label33.TabIndex = 88;
- this.label33.Text = "Scale:";
- //
- // label34
- //
- this.label34.Location = new System.Drawing.Point(272, 480);
- this.label34.Name = "label34";
- this.label34.Size = new System.Drawing.Size(32, 20);
- this.label34.TabIndex = 94;
- this.label34.Text = "Z:";
- //
- // numScaleZ
- //
- this.numScaleZ.DecimalPlaces = 5;
- this.numScaleZ.Location = new System.Drawing.Point(304, 480);
- this.numScaleZ.Maximum = new System.Decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numScaleZ.Minimum = new System.Decimal(new int[] {
- 10,
- 0,
- 0,
- -2147483648});
- this.numScaleZ.Name = "numScaleZ";
- this.numScaleZ.Size = new System.Drawing.Size(80, 20);
- this.numScaleZ.TabIndex = 27;
- this.numScaleZ.Value = new System.Decimal(new int[] {
- 5,
- 0,
- 0,
- 65536});
- //
- // label35
- //
- this.label35.Location = new System.Drawing.Point(144, 480);
- this.label35.Name = "label35";
- this.label35.Size = new System.Drawing.Size(32, 20);
- this.label35.TabIndex = 92;
- this.label35.Text = "Y:";
- //
- // numScaleY
- //
- this.numScaleY.DecimalPlaces = 5;
- this.numScaleY.Location = new System.Drawing.Point(176, 480);
- this.numScaleY.Maximum = new System.Decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numScaleY.Name = "numScaleY";
- this.numScaleY.Size = new System.Drawing.Size(80, 20);
- this.numScaleY.TabIndex = 26;
- this.numScaleY.Value = new System.Decimal(new int[] {
- 5,
- 0,
- 0,
- 65536});
- //
- // label36
- //
- this.label36.Location = new System.Drawing.Point(16, 480);
- this.label36.Name = "label36";
- this.label36.Size = new System.Drawing.Size(32, 20);
- this.label36.TabIndex = 90;
- this.label36.Text = "X:";
- //
- // numScaleX
- //
- this.numScaleX.DecimalPlaces = 5;
- this.numScaleX.Location = new System.Drawing.Point(48, 480);
- this.numScaleX.Maximum = new System.Decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numScaleX.Name = "numScaleX";
- this.numScaleX.Size = new System.Drawing.Size(80, 20);
- this.numScaleX.TabIndex = 25;
- this.numScaleX.Value = new System.Decimal(new int[] {
- 5,
- 0,
- 0,
- 65536});
- //
- // label37
- //
- this.label37.Location = new System.Drawing.Point(272, 424);
- this.label37.Name = "label37";
- this.label37.Size = new System.Drawing.Size(32, 20);
- this.label37.TabIndex = 100;
- this.label37.Text = "Z:";
- //
- // numRotationZ
- //
- this.numRotationZ.DecimalPlaces = 5;
- this.numRotationZ.Location = new System.Drawing.Point(304, 424);
- this.numRotationZ.Maximum = new System.Decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numRotationZ.Name = "numRotationZ";
- this.numRotationZ.Size = new System.Drawing.Size(80, 20);
- this.numRotationZ.TabIndex = 23;
- //
- // label38
- //
- this.label38.Location = new System.Drawing.Point(144, 424);
- this.label38.Name = "label38";
- this.label38.Size = new System.Drawing.Size(32, 20);
- this.label38.TabIndex = 98;
- this.label38.Text = "Y:";
- //
- // numRotationY
- //
- this.numRotationY.DecimalPlaces = 5;
- this.numRotationY.Location = new System.Drawing.Point(176, 424);
- this.numRotationY.Maximum = new System.Decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numRotationY.Name = "numRotationY";
- this.numRotationY.Size = new System.Drawing.Size(80, 20);
- this.numRotationY.TabIndex = 22;
- //
- // label39
- //
- this.label39.Location = new System.Drawing.Point(16, 424);
- this.label39.Name = "label39";
- this.label39.Size = new System.Drawing.Size(32, 20);
- this.label39.TabIndex = 96;
- this.label39.Text = "X:";
- //
- // numRotationX
- //
- this.numRotationX.DecimalPlaces = 5;
- this.numRotationX.Location = new System.Drawing.Point(48, 424);
- this.numRotationX.Maximum = new System.Decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numRotationX.Name = "numRotationX";
- this.numRotationX.Size = new System.Drawing.Size(80, 20);
- this.numRotationX.TabIndex = 21;
- //
- // label40
- //
- this.label40.Location = new System.Drawing.Point(400, 424);
- this.label40.Name = "label40";
- this.label40.Size = new System.Drawing.Size(32, 20);
- this.label40.TabIndex = 102;
- this.label40.Text = "S:";
- //
- // numRotationS
- //
- this.numRotationS.DecimalPlaces = 5;
- this.numRotationS.Location = new System.Drawing.Point(432, 424);
- this.numRotationS.Maximum = new System.Decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numRotationS.Name = "numRotationS";
- this.numRotationS.Size = new System.Drawing.Size(80, 20);
- this.numRotationS.TabIndex = 24;
- //
- // numProfileHollow
- //
- this.numProfileHollow.Location = new System.Drawing.Point(408, 368);
- this.numProfileHollow.Maximum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- 0});
- this.numProfileHollow.Name = "numProfileHollow";
- this.numProfileHollow.Size = new System.Drawing.Size(80, 20);
- this.numProfileHollow.TabIndex = 20;
- //
- // numPathCurve
- //
- this.numPathCurve.Location = new System.Drawing.Point(136, 368);
- this.numPathCurve.Maximum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- 0});
- this.numPathCurve.Name = "numPathCurve";
- this.numPathCurve.Size = new System.Drawing.Size(80, 20);
- this.numPathCurve.TabIndex = 19;
- this.numPathCurve.Value = new System.Decimal(new int[] {
- 16,
- 0,
- 0,
- 0});
- //
- // numProfileCurve
- //
- this.numProfileCurve.Location = new System.Drawing.Point(408, 336);
- this.numProfileCurve.Maximum = new System.Decimal(new int[] {
- 5,
- 0,
- 0,
- 0});
- this.numProfileCurve.Name = "numProfileCurve";
- this.numProfileCurve.Size = new System.Drawing.Size(80, 20);
- this.numProfileCurve.TabIndex = 18;
- this.numProfileCurve.Value = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- //
- // numProfileBegin
- //
- this.numProfileBegin.Location = new System.Drawing.Point(232, 304);
- this.numProfileBegin.Maximum = new System.Decimal(new int[] {
- 1275,
- 0,
- 0,
- 196608});
- this.numProfileBegin.Name = "numProfileBegin";
- this.numProfileBegin.Size = new System.Drawing.Size(80, 20);
- this.numProfileBegin.TabIndex = 16;
- //
- // numProfileEnd
- //
- this.numProfileEnd.Location = new System.Drawing.Point(408, 304);
- this.numProfileEnd.Maximum = new System.Decimal(new int[] {
- 5,
- 0,
- 0,
- 0});
- this.numProfileEnd.Minimum = new System.Decimal(new int[] {
- 275,
- 0,
- 0,
- -2147287040});
- this.numProfileEnd.Name = "numProfileEnd";
- this.numProfileEnd.Size = new System.Drawing.Size(80, 20);
- this.numProfileEnd.TabIndex = 17;
- //
- // numPathTwistBegin
- //
- this.numPathTwistBegin.Location = new System.Drawing.Point(232, 272);
- this.numPathTwistBegin.Maximum = new System.Decimal(new int[] {
- 459,
- 0,
- 0,
- 0});
- this.numPathTwistBegin.Minimum = new System.Decimal(new int[] {
- 459,
- 0,
- 0,
- -2147483648});
- this.numPathTwistBegin.Name = "numPathTwistBegin";
- this.numPathTwistBegin.Size = new System.Drawing.Size(80, 20);
- this.numPathTwistBegin.TabIndex = 14;
- //
- // numPathTwist
- //
- this.numPathTwist.Location = new System.Drawing.Point(408, 272);
- this.numPathTwist.Maximum = new System.Decimal(new int[] {
- 459,
- 0,
- 0,
- 0});
- this.numPathTwist.Minimum = new System.Decimal(new int[] {
- 459,
- 0,
- 0,
- -2147483648});
- this.numPathTwist.Name = "numPathTwist";
- this.numPathTwist.Size = new System.Drawing.Size(80, 20);
- this.numPathTwist.TabIndex = 15;
- //
- // numPathTaperX
- //
- this.numPathTaperX.DecimalPlaces = 2;
- this.numPathTaperX.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathTaperX.Location = new System.Drawing.Point(232, 240);
- this.numPathTaperX.Maximum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- 131072});
- this.numPathTaperX.Minimum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- -2147352576});
- this.numPathTaperX.Name = "numPathTaperX";
- this.numPathTaperX.Size = new System.Drawing.Size(80, 20);
- this.numPathTaperX.TabIndex = 12;
- //
- // numPathTaperY
- //
- this.numPathTaperY.DecimalPlaces = 2;
- this.numPathTaperY.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathTaperY.Location = new System.Drawing.Point(408, 240);
- this.numPathTaperY.Maximum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- 131072});
- this.numPathTaperY.Minimum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- -2147352576});
- this.numPathTaperY.Name = "numPathTaperY";
- this.numPathTaperY.Size = new System.Drawing.Size(80, 20);
- this.numPathTaperY.TabIndex = 13;
- //
- // numPathShearX
- //
- this.numPathShearX.DecimalPlaces = 2;
- this.numPathShearX.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathShearX.Location = new System.Drawing.Point(232, 208);
- this.numPathShearX.Maximum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- 131072});
- this.numPathShearX.Minimum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- -2147352576});
- this.numPathShearX.Name = "numPathShearX";
- this.numPathShearX.Size = new System.Drawing.Size(80, 20);
- this.numPathShearX.TabIndex = 8;
- //
- // numPathShearY
- //
- this.numPathShearY.DecimalPlaces = 2;
- this.numPathShearY.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathShearY.Location = new System.Drawing.Point(408, 208);
- this.numPathShearY.Maximum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- 131072});
- this.numPathShearY.Minimum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- -2147352576});
- this.numPathShearY.Name = "numPathShearY";
- this.numPathShearY.Size = new System.Drawing.Size(80, 20);
- this.numPathShearY.TabIndex = 9;
- //
- // numPathSkew
- //
- this.numPathSkew.DecimalPlaces = 2;
- this.numPathSkew.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathSkew.Location = new System.Drawing.Point(136, 336);
- this.numPathSkew.Maximum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- 131072});
- this.numPathSkew.Minimum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- -2147352576});
- this.numPathSkew.Name = "numPathSkew";
- this.numPathSkew.Size = new System.Drawing.Size(80, 20);
- this.numPathSkew.TabIndex = 10;
- //
- // numPathScaleX
- //
- this.numPathScaleX.DecimalPlaces = 2;
- this.numPathScaleX.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathScaleX.Location = new System.Drawing.Point(232, 176);
- this.numPathScaleX.Maximum = new System.Decimal(new int[] {
- 155,
- 0,
- 0,
- 131072});
- this.numPathScaleX.Name = "numPathScaleX";
- this.numPathScaleX.Size = new System.Drawing.Size(80, 20);
- this.numPathScaleX.TabIndex = 6;
- //
- // numPathScaleY
- //
- this.numPathScaleY.DecimalPlaces = 2;
- this.numPathScaleY.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathScaleY.Location = new System.Drawing.Point(408, 176);
- this.numPathScaleY.Maximum = new System.Decimal(new int[] {
- 155,
- 0,
- 0,
- 131072});
- this.numPathScaleY.Name = "numPathScaleY";
- this.numPathScaleY.Size = new System.Drawing.Size(80, 20);
- this.numPathScaleY.TabIndex = 7;
- //
- // numPathRevolutions
- //
- this.numPathRevolutions.DecimalPlaces = 2;
- this.numPathRevolutions.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathRevolutions.Location = new System.Drawing.Point(136, 144);
- this.numPathRevolutions.Maximum = new System.Decimal(new int[] {
- 486,
- 0,
- 0,
- 131072});
- this.numPathRevolutions.Name = "numPathRevolutions";
- this.numPathRevolutions.Size = new System.Drawing.Size(80, 20);
- this.numPathRevolutions.TabIndex = 5;
- this.numPathRevolutions.Value = new System.Decimal(new int[] {
- 100,
- 0,
- 0,
- 131072});
- //
- // numPathRadiusOffset
- //
- this.numPathRadiusOffset.DecimalPlaces = 3;
- this.numPathRadiusOffset.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathRadiusOffset.Location = new System.Drawing.Point(136, 112);
- this.numPathRadiusOffset.Maximum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- 131072});
- this.numPathRadiusOffset.Minimum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- -2147352576});
- this.numPathRadiusOffset.Name = "numPathRadiusOffset";
- this.numPathRadiusOffset.Size = new System.Drawing.Size(80, 20);
- this.numPathRadiusOffset.TabIndex = 4;
- //
- // numPathBegin
- //
- this.numPathBegin.DecimalPlaces = 2;
- this.numPathBegin.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathBegin.Location = new System.Drawing.Point(232, 80);
- this.numPathBegin.Maximum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- 131072});
- this.numPathBegin.Name = "numPathBegin";
- this.numPathBegin.Size = new System.Drawing.Size(80, 20);
- this.numPathBegin.TabIndex = 2;
- //
- // numPathEnd
- //
- this.numPathEnd.DecimalPlaces = 2;
- this.numPathEnd.Increment = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.numPathEnd.Location = new System.Drawing.Point(408, 80);
- this.numPathEnd.Maximum = new System.Decimal(new int[] {
- 10,
- 0,
- 0,
- 65536});
- this.numPathEnd.Minimum = new System.Decimal(new int[] {
- 155,
- 0,
- 0,
- -2147352576});
- this.numPathEnd.Name = "numPathEnd";
- this.numPathEnd.Size = new System.Drawing.Size(80, 20);
- this.numPathEnd.TabIndex = 3;
- this.numPathEnd.Value = new System.Decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- //
- // numMaterial
- //
- this.numMaterial.Location = new System.Drawing.Point(136, 48);
- this.numMaterial.Maximum = new System.Decimal(new int[] {
- 255,
- 0,
- 0,
- 0});
- this.numMaterial.Name = "numMaterial";
- this.numMaterial.Size = new System.Drawing.Size(80, 20);
- this.numMaterial.TabIndex = 1;
- //
- // txtName
- //
- this.txtName.Location = new System.Drawing.Point(136, 16);
- this.txtName.Name = "txtName";
- this.txtName.Size = new System.Drawing.Size(176, 20);
- this.txtName.TabIndex = 0;
- this.txtName.Text = "";
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(272, 536);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(32, 16);
- this.label3.TabIndex = 129;
- this.label3.Text = "Z:";
- //
- // numPositionZ
- //
- this.numPositionZ.DecimalPlaces = 5;
- this.numPositionZ.Location = new System.Drawing.Point(304, 536);
- this.numPositionZ.Maximum = new System.Decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numPositionZ.Name = "numPositionZ";
- this.numPositionZ.Size = new System.Drawing.Size(80, 20);
- this.numPositionZ.TabIndex = 30;
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(144, 536);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(32, 16);
- this.label2.TabIndex = 127;
- this.label2.Text = "Y:";
- //
- // numPositionY
- //
- this.numPositionY.DecimalPlaces = 5;
- this.numPositionY.Location = new System.Drawing.Point(176, 536);
- this.numPositionY.Maximum = new System.Decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numPositionY.Name = "numPositionY";
- this.numPositionY.Size = new System.Drawing.Size(80, 20);
- this.numPositionY.TabIndex = 29;
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(16, 536);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(32, 16);
- this.label1.TabIndex = 125;
- this.label1.Text = "X:";
- //
- // numPositionX
- //
- this.numPositionX.DecimalPlaces = 5;
- this.numPositionX.Location = new System.Drawing.Point(48, 536);
- this.numPositionX.Maximum = new System.Decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numPositionX.Name = "numPositionX";
- this.numPositionX.Size = new System.Drawing.Size(80, 20);
- this.numPositionX.TabIndex = 28;
- //
- // label41
- //
- this.label41.Location = new System.Drawing.Point(16, 512);
- this.label41.Name = "label41";
- this.label41.Size = new System.Drawing.Size(120, 20);
- this.label41.TabIndex = 130;
- this.label41.Text = "Sim Position:";
- //
- // frmPrimBuilder
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(528, 573);
- this.Controls.Add(this.label41);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.numPositionZ);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.numPositionY);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.numPositionX);
- this.Controls.Add(this.txtName);
- this.Controls.Add(this.numMaterial);
- this.Controls.Add(this.numPathEnd);
- this.Controls.Add(this.numPathBegin);
- this.Controls.Add(this.numPathRadiusOffset);
- this.Controls.Add(this.numPathRevolutions);
- this.Controls.Add(this.numPathScaleY);
- this.Controls.Add(this.numPathScaleX);
- this.Controls.Add(this.numPathSkew);
- this.Controls.Add(this.numPathShearY);
- this.Controls.Add(this.numPathShearX);
- this.Controls.Add(this.numPathTaperY);
- this.Controls.Add(this.numPathTaperX);
- this.Controls.Add(this.numPathTwist);
- this.Controls.Add(this.numPathTwistBegin);
- this.Controls.Add(this.numProfileEnd);
- this.Controls.Add(this.numProfileBegin);
- this.Controls.Add(this.numProfileCurve);
- this.Controls.Add(this.numPathCurve);
- this.Controls.Add(this.numProfileHollow);
- this.Controls.Add(this.label40);
- this.Controls.Add(this.numRotationS);
- this.Controls.Add(this.label37);
- this.Controls.Add(this.numRotationZ);
- this.Controls.Add(this.label38);
- this.Controls.Add(this.numRotationY);
- this.Controls.Add(this.label39);
- this.Controls.Add(this.numRotationX);
- this.Controls.Add(this.label34);
- this.Controls.Add(this.numScaleZ);
- this.Controls.Add(this.label35);
- this.Controls.Add(this.numScaleY);
- this.Controls.Add(this.label36);
- this.Controls.Add(this.numScaleX);
- this.Controls.Add(this.label33);
- this.Controls.Add(this.label32);
- this.Controls.Add(this.label31);
- this.Controls.Add(this.label30);
- this.Controls.Add(this.label29);
- this.Controls.Add(this.label26);
- this.Controls.Add(this.label27);
- this.Controls.Add(this.label28);
- this.Controls.Add(this.label23);
- this.Controls.Add(this.label24);
- this.Controls.Add(this.label25);
- this.Controls.Add(this.label20);
- this.Controls.Add(this.label21);
- this.Controls.Add(this.label22);
- this.Controls.Add(this.label19);
- this.Controls.Add(this.label14);
- this.Controls.Add(this.label15);
- this.Controls.Add(this.label16);
- this.Controls.Add(this.label13);
- this.Controls.Add(this.label12);
- this.Controls.Add(this.label11);
- this.Controls.Add(this.label7);
- this.Controls.Add(this.label10);
- this.Controls.Add(this.label9);
- this.Controls.Add(this.label8);
- this.Controls.Add(this.label6);
- this.Controls.Add(this.label5);
- this.Controls.Add(this.label4);
- this.Controls.Add(this.cmdBuild);
- this.Name = "frmPrimBuilder";
- this.Text = "Prim Builder";
- ((System.ComponentModel.ISupportInitialize)(this.numScaleZ)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numScaleY)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numScaleX)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numRotationZ)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numRotationY)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numRotationX)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numRotationS)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numProfileHollow)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathCurve)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numProfileCurve)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numProfileBegin)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numProfileEnd)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathTwistBegin)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathTwist)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathTaperX)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathTaperY)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathShearX)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathShearY)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathSkew)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathScaleX)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathScaleY)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathRevolutions)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathRadiusOffset)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathBegin)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPathEnd)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numMaterial)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPositionZ)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPositionY)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numPositionX)).EndInit();
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private void cmdBuild_Click(object sender, System.EventArgs e)
- {
- cmdBuild.Enabled = false;
-
- PrimObject prim = new PrimObject(new LLUUID("8955674724cb43ed920b47caed15465f"));
-
- prim.Material = (uint)numMaterial.Value;
- prim.PathBegin = PrimObject.PathBeginByte((float)numPathBegin.Value);
- prim.PathEnd = PrimObject.PathEndByte((float)numPathEnd.Value);
- prim.PathRadiusOffset = PrimObject.PathRadiusOffsetByte((float)numPathRadiusOffset.Value);
- prim.PathRevolutions = PrimObject.PathRevolutionsByte((float)numPathRevolutions.Value);
- prim.PathScaleX = PrimObject.PathScaleByte((float)numPathScaleX.Value);
- prim.PathScaleY = PrimObject.PathScaleByte((float)numPathScaleY.Value);
- prim.PathShearX = PrimObject.PathShearByte((float)numPathShearX.Value);
- prim.PathShearY = PrimObject.PathShearByte((float)numPathShearY.Value);
- prim.PathTaperX = PrimObject.PathTaperByte((float)numPathTaperX.Value);
- prim.PathTaperY = PrimObject.PathTaperByte((float)numPathTaperY.Value);
- prim.PathTwistBegin = PrimObject.PathTwistByte((float)numPathTwistBegin.Value);
- prim.PathTwist = PrimObject.PathTwistByte((float)numPathTwist.Value);
- prim.ProfileBegin = PrimObject.ProfileBeginByte((float)numProfileBegin.Value);
- prim.ProfileEnd = PrimObject.ProfileEndByte((float)numProfileEnd.Value);
- prim.PathSkew = PrimObject.PathSkewByte((float)numPathSkew.Value);
- prim.ProfileCurve = (uint)numProfileCurve.Value;
- prim.PathCurve = (uint)numPathCurve.Value;
- prim.ProfileHollow = (uint)numProfileHollow.Value;
- prim.Rotation.X = (float)numRotationX.Value;
- prim.Rotation.Y = (float)numRotationY.Value;
- prim.Rotation.Z = (float)numRotationZ.Value;
- prim.Rotation.S = (float)numRotationS.Value;
- prim.Scale.X = (float)numScaleX.Value;
- prim.Scale.Y = (float)numScaleY.Value;
- prim.Scale.Z = (float)numScaleZ.Value;
- prim.Position.X = (float)numPositionX.Value;
- prim.Position.Y = (float)numPositionY.Value;
- prim.Position.Z = (float)numPositionZ.Value;
-
- Client.CurrentRegion.RezObject(prim, prim.Position, new LLVector3(Client.Avatar.Position));
-
- // Rate limiting
- System.Threading.Thread.Sleep(250);
-
- cmdBuild.Enabled = true;
- }
- }
-}
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+using libsecondlife;
+
+namespace SecondSuite.Plugins
+{
+ ///
+ /// Summary description for Form1.
+ ///
+ public class frmPrimBuilder : System.Windows.Forms.Form
+ {
+ private System.Windows.Forms.Button cmdBuild;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.Label label8;
+ private System.Windows.Forms.Label label9;
+ private System.Windows.Forms.Label label10;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.Label label11;
+ private System.Windows.Forms.Label label12;
+ private System.Windows.Forms.Label label13;
+ private System.Windows.Forms.Label label14;
+ private System.Windows.Forms.Label label15;
+ private System.Windows.Forms.Label label16;
+ private System.Windows.Forms.Label label19;
+ private System.Windows.Forms.Label label20;
+ private System.Windows.Forms.Label label21;
+ private System.Windows.Forms.Label label22;
+ private System.Windows.Forms.Label label23;
+ private System.Windows.Forms.Label label24;
+ private System.Windows.Forms.Label label25;
+ private System.Windows.Forms.Label label28;
+ private System.Windows.Forms.Label label26;
+ private System.Windows.Forms.Label label27;
+ private System.Windows.Forms.Label label29;
+ private System.Windows.Forms.Label label30;
+ private System.Windows.Forms.Label label31;
+ private System.Windows.Forms.Label label32;
+ private System.Windows.Forms.Label label33;
+ private System.Windows.Forms.Label label34;
+ private System.Windows.Forms.NumericUpDown numScaleZ;
+ private System.Windows.Forms.Label label35;
+ private System.Windows.Forms.NumericUpDown numScaleY;
+ private System.Windows.Forms.Label label36;
+ private System.Windows.Forms.NumericUpDown numScaleX;
+ private System.Windows.Forms.Label label37;
+ private System.Windows.Forms.NumericUpDown numRotationZ;
+ private System.Windows.Forms.Label label38;
+ private System.Windows.Forms.NumericUpDown numRotationY;
+ private System.Windows.Forms.Label label39;
+ private System.Windows.Forms.NumericUpDown numRotationX;
+ private System.Windows.Forms.Label label40;
+ private System.Windows.Forms.NumericUpDown numRotationS;
+ private System.Windows.Forms.NumericUpDown numProfileHollow;
+ private System.Windows.Forms.NumericUpDown numPathCurve;
+ private System.Windows.Forms.NumericUpDown numProfileCurve;
+ private System.Windows.Forms.NumericUpDown numProfileBegin;
+ private System.Windows.Forms.NumericUpDown numProfileEnd;
+ private System.Windows.Forms.NumericUpDown numPathTwistBegin;
+ private System.Windows.Forms.NumericUpDown numPathTwist;
+ private System.Windows.Forms.NumericUpDown numPathTaperX;
+ private System.Windows.Forms.NumericUpDown numPathTaperY;
+ private System.Windows.Forms.NumericUpDown numPathShearX;
+ private System.Windows.Forms.NumericUpDown numPathShearY;
+ private System.Windows.Forms.NumericUpDown numPathScaleX;
+ private System.Windows.Forms.NumericUpDown numPathScaleY;
+ private System.Windows.Forms.NumericUpDown numPathRevolutions;
+ private System.Windows.Forms.NumericUpDown numPathRadiusOffset;
+ private System.Windows.Forms.NumericUpDown numPathBegin;
+ private System.Windows.Forms.NumericUpDown numPathEnd;
+ private System.Windows.Forms.NumericUpDown numMaterial;
+ private System.Windows.Forms.TextBox txtName;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.NumericUpDown numPositionZ;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.NumericUpDown numPositionY;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.NumericUpDown numPositionX;
+ private System.Windows.Forms.Label label41;
+ private System.Windows.Forms.NumericUpDown numPathSkew;
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.Container components = null;
+
+ //
+ SecondLife Client;
+
+ public frmPrimBuilder(SecondLife client)
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ Client = client;
+ Client.Network.RegisterCallback("CoarseLocationUpdate", new PacketCallback(LocationHandler));
+ }
+
+ private void LocationHandler(Packet packet, Simulator simulator)
+ {
+ if (numPositionX.Value == 0)
+ {
+ numPositionX.Value = (decimal)Client.Avatar.Position.X;
+ }
+
+ if (numPositionY.Value == 0)
+ {
+ numPositionY.Value = (decimal)Client.Avatar.Position.Y;
+ }
+
+ if (numPositionZ.Value == 0)
+ {
+ numPositionZ.Value = (decimal)Client.Avatar.Position.Z;
+ }
+ }
+
+ public void Connected()
+ {
+ ;
+ }
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if (components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.cmdBuild = new System.Windows.Forms.Button();
+ this.label4 = new System.Windows.Forms.Label();
+ this.label5 = new System.Windows.Forms.Label();
+ this.label6 = new System.Windows.Forms.Label();
+ this.label8 = new System.Windows.Forms.Label();
+ this.label9 = new System.Windows.Forms.Label();
+ this.label10 = new System.Windows.Forms.Label();
+ this.label7 = new System.Windows.Forms.Label();
+ this.label11 = new System.Windows.Forms.Label();
+ this.label12 = new System.Windows.Forms.Label();
+ this.label13 = new System.Windows.Forms.Label();
+ this.label14 = new System.Windows.Forms.Label();
+ this.label15 = new System.Windows.Forms.Label();
+ this.label16 = new System.Windows.Forms.Label();
+ this.label19 = new System.Windows.Forms.Label();
+ this.label20 = new System.Windows.Forms.Label();
+ this.label21 = new System.Windows.Forms.Label();
+ this.label22 = new System.Windows.Forms.Label();
+ this.label23 = new System.Windows.Forms.Label();
+ this.label24 = new System.Windows.Forms.Label();
+ this.label25 = new System.Windows.Forms.Label();
+ this.label28 = new System.Windows.Forms.Label();
+ this.label26 = new System.Windows.Forms.Label();
+ this.label27 = new System.Windows.Forms.Label();
+ this.label29 = new System.Windows.Forms.Label();
+ this.label30 = new System.Windows.Forms.Label();
+ this.label31 = new System.Windows.Forms.Label();
+ this.label32 = new System.Windows.Forms.Label();
+ this.label33 = new System.Windows.Forms.Label();
+ this.label34 = new System.Windows.Forms.Label();
+ this.numScaleZ = new System.Windows.Forms.NumericUpDown();
+ this.label35 = new System.Windows.Forms.Label();
+ this.numScaleY = new System.Windows.Forms.NumericUpDown();
+ this.label36 = new System.Windows.Forms.Label();
+ this.numScaleX = new System.Windows.Forms.NumericUpDown();
+ this.label37 = new System.Windows.Forms.Label();
+ this.numRotationZ = new System.Windows.Forms.NumericUpDown();
+ this.label38 = new System.Windows.Forms.Label();
+ this.numRotationY = new System.Windows.Forms.NumericUpDown();
+ this.label39 = new System.Windows.Forms.Label();
+ this.numRotationX = new System.Windows.Forms.NumericUpDown();
+ this.label40 = new System.Windows.Forms.Label();
+ this.numRotationS = new System.Windows.Forms.NumericUpDown();
+ this.numProfileHollow = new System.Windows.Forms.NumericUpDown();
+ this.numPathCurve = new System.Windows.Forms.NumericUpDown();
+ this.numProfileCurve = new System.Windows.Forms.NumericUpDown();
+ this.numProfileBegin = new System.Windows.Forms.NumericUpDown();
+ this.numProfileEnd = new System.Windows.Forms.NumericUpDown();
+ this.numPathTwistBegin = new System.Windows.Forms.NumericUpDown();
+ this.numPathTwist = new System.Windows.Forms.NumericUpDown();
+ this.numPathTaperX = new System.Windows.Forms.NumericUpDown();
+ this.numPathTaperY = new System.Windows.Forms.NumericUpDown();
+ this.numPathShearX = new System.Windows.Forms.NumericUpDown();
+ this.numPathShearY = new System.Windows.Forms.NumericUpDown();
+ this.numPathSkew = new System.Windows.Forms.NumericUpDown();
+ this.numPathScaleX = new System.Windows.Forms.NumericUpDown();
+ this.numPathScaleY = new System.Windows.Forms.NumericUpDown();
+ this.numPathRevolutions = new System.Windows.Forms.NumericUpDown();
+ this.numPathRadiusOffset = new System.Windows.Forms.NumericUpDown();
+ this.numPathBegin = new System.Windows.Forms.NumericUpDown();
+ this.numPathEnd = new System.Windows.Forms.NumericUpDown();
+ this.numMaterial = new System.Windows.Forms.NumericUpDown();
+ this.txtName = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.numPositionZ = new System.Windows.Forms.NumericUpDown();
+ this.label2 = new System.Windows.Forms.Label();
+ this.numPositionY = new System.Windows.Forms.NumericUpDown();
+ this.label1 = new System.Windows.Forms.Label();
+ this.numPositionX = new System.Windows.Forms.NumericUpDown();
+ this.label41 = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.numScaleZ)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numScaleY)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numScaleX)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numRotationZ)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numRotationY)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numRotationX)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numRotationS)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numProfileHollow)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathCurve)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numProfileCurve)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numProfileBegin)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numProfileEnd)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathTwistBegin)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathTwist)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathTaperX)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathTaperY)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathShearX)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathShearY)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathSkew)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathScaleX)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathScaleY)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathRevolutions)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathRadiusOffset)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathBegin)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathEnd)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numMaterial)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPositionZ)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPositionY)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPositionX)).BeginInit();
+ this.SuspendLayout();
+ //
+ // cmdBuild
+ //
+ this.cmdBuild.Location = new System.Drawing.Point(408, 536);
+ this.cmdBuild.Name = "cmdBuild";
+ this.cmdBuild.Size = new System.Drawing.Size(104, 24);
+ this.cmdBuild.TabIndex = 31;
+ this.cmdBuild.Text = "Build Prim";
+ this.cmdBuild.Click += new System.EventHandler(this.cmdBuild_Click);
+ //
+ // label4
+ //
+ this.label4.Location = new System.Drawing.Point(16, 16);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(120, 20);
+ this.label4.TabIndex = 58;
+ this.label4.Text = "Name:";
+ //
+ // label5
+ //
+ this.label5.Location = new System.Drawing.Point(16, 48);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(120, 20);
+ this.label5.TabIndex = 59;
+ this.label5.Text = "Material:";
+ //
+ // label6
+ //
+ this.label6.Location = new System.Drawing.Point(16, 80);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(120, 20);
+ this.label6.TabIndex = 60;
+ this.label6.Text = "Path:";
+ //
+ // label8
+ //
+ this.label8.Location = new System.Drawing.Point(16, 112);
+ this.label8.Name = "label8";
+ this.label8.Size = new System.Drawing.Size(120, 20);
+ this.label8.TabIndex = 62;
+ this.label8.Text = "Path Radius Offset:";
+ //
+ // label9
+ //
+ this.label9.Location = new System.Drawing.Point(16, 144);
+ this.label9.Name = "label9";
+ this.label9.Size = new System.Drawing.Size(120, 20);
+ this.label9.TabIndex = 63;
+ this.label9.Text = "Path Revolutions:";
+ //
+ // label10
+ //
+ this.label10.Location = new System.Drawing.Point(16, 176);
+ this.label10.Name = "label10";
+ this.label10.Size = new System.Drawing.Size(120, 20);
+ this.label10.TabIndex = 64;
+ this.label10.Text = "Path Scale:";
+ //
+ // label7
+ //
+ this.label7.Location = new System.Drawing.Point(136, 80);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(96, 20);
+ this.label7.TabIndex = 65;
+ this.label7.Text = "Begin:";
+ //
+ // label11
+ //
+ this.label11.Location = new System.Drawing.Point(328, 80);
+ this.label11.Name = "label11";
+ this.label11.Size = new System.Drawing.Size(80, 20);
+ this.label11.TabIndex = 66;
+ this.label11.Text = "End:";
+ //
+ // label12
+ //
+ this.label12.Location = new System.Drawing.Point(136, 176);
+ this.label12.Name = "label12";
+ this.label12.Size = new System.Drawing.Size(96, 20);
+ this.label12.TabIndex = 67;
+ this.label12.Text = "X:";
+ //
+ // label13
+ //
+ this.label13.Location = new System.Drawing.Point(328, 176);
+ this.label13.Name = "label13";
+ this.label13.Size = new System.Drawing.Size(80, 20);
+ this.label13.TabIndex = 68;
+ this.label13.Text = "Y:";
+ //
+ // label14
+ //
+ this.label14.Location = new System.Drawing.Point(328, 208);
+ this.label14.Name = "label14";
+ this.label14.Size = new System.Drawing.Size(80, 20);
+ this.label14.TabIndex = 71;
+ this.label14.Text = "Y:";
+ //
+ // label15
+ //
+ this.label15.Location = new System.Drawing.Point(136, 208);
+ this.label15.Name = "label15";
+ this.label15.Size = new System.Drawing.Size(96, 20);
+ this.label15.TabIndex = 70;
+ this.label15.Text = "X:";
+ //
+ // label16
+ //
+ this.label16.Location = new System.Drawing.Point(16, 208);
+ this.label16.Name = "label16";
+ this.label16.Size = new System.Drawing.Size(120, 20);
+ this.label16.TabIndex = 69;
+ this.label16.Text = "Path Shear:";
+ //
+ // label19
+ //
+ this.label19.Location = new System.Drawing.Point(16, 336);
+ this.label19.Name = "label19";
+ this.label19.Size = new System.Drawing.Size(120, 20);
+ this.label19.TabIndex = 72;
+ this.label19.Text = "Path Skew:";
+ //
+ // label20
+ //
+ this.label20.Location = new System.Drawing.Point(328, 240);
+ this.label20.Name = "label20";
+ this.label20.Size = new System.Drawing.Size(80, 20);
+ this.label20.TabIndex = 77;
+ this.label20.Text = "Y:";
+ //
+ // label21
+ //
+ this.label21.Location = new System.Drawing.Point(136, 240);
+ this.label21.Name = "label21";
+ this.label21.Size = new System.Drawing.Size(96, 20);
+ this.label21.TabIndex = 76;
+ this.label21.Text = "X:";
+ //
+ // label22
+ //
+ this.label22.Location = new System.Drawing.Point(16, 240);
+ this.label22.Name = "label22";
+ this.label22.Size = new System.Drawing.Size(120, 20);
+ this.label22.TabIndex = 75;
+ this.label22.Text = "Path Taper:";
+ //
+ // label23
+ //
+ this.label23.Location = new System.Drawing.Point(328, 272);
+ this.label23.Name = "label23";
+ this.label23.Size = new System.Drawing.Size(80, 20);
+ this.label23.TabIndex = 80;
+ this.label23.Text = "Path Twist:";
+ //
+ // label24
+ //
+ this.label24.Location = new System.Drawing.Point(136, 272);
+ this.label24.Name = "label24";
+ this.label24.Size = new System.Drawing.Size(96, 20);
+ this.label24.TabIndex = 79;
+ this.label24.Text = "Path Twist Begin:";
+ //
+ // label25
+ //
+ this.label25.Location = new System.Drawing.Point(16, 272);
+ this.label25.Name = "label25";
+ this.label25.Size = new System.Drawing.Size(120, 20);
+ this.label25.TabIndex = 78;
+ this.label25.Text = "Twist:";
+ //
+ // label28
+ //
+ this.label28.Location = new System.Drawing.Point(16, 304);
+ this.label28.Name = "label28";
+ this.label28.Size = new System.Drawing.Size(120, 20);
+ this.label28.TabIndex = 81;
+ this.label28.Text = "Profile:";
+ //
+ // label26
+ //
+ this.label26.Location = new System.Drawing.Point(328, 304);
+ this.label26.Name = "label26";
+ this.label26.Size = new System.Drawing.Size(80, 20);
+ this.label26.TabIndex = 83;
+ this.label26.Text = "End:";
+ //
+ // label27
+ //
+ this.label27.Location = new System.Drawing.Point(136, 304);
+ this.label27.Name = "label27";
+ this.label27.Size = new System.Drawing.Size(96, 20);
+ this.label27.TabIndex = 82;
+ this.label27.Text = "Begin:";
+ //
+ // label29
+ //
+ this.label29.Location = new System.Drawing.Point(288, 336);
+ this.label29.Name = "label29";
+ this.label29.Size = new System.Drawing.Size(120, 20);
+ this.label29.TabIndex = 84;
+ this.label29.Text = "Profile Curve:";
+ //
+ // label30
+ //
+ this.label30.Location = new System.Drawing.Point(16, 368);
+ this.label30.Name = "label30";
+ this.label30.Size = new System.Drawing.Size(120, 20);
+ this.label30.TabIndex = 85;
+ this.label30.Text = "Path Curve:";
+ //
+ // label31
+ //
+ this.label31.Location = new System.Drawing.Point(288, 368);
+ this.label31.Name = "label31";
+ this.label31.Size = new System.Drawing.Size(120, 20);
+ this.label31.TabIndex = 86;
+ this.label31.Text = "Profile Hollow:";
+ //
+ // label32
+ //
+ this.label32.Location = new System.Drawing.Point(16, 400);
+ this.label32.Name = "label32";
+ this.label32.Size = new System.Drawing.Size(120, 16);
+ this.label32.TabIndex = 87;
+ this.label32.Text = "Rotation:";
+ //
+ // label33
+ //
+ this.label33.Location = new System.Drawing.Point(16, 456);
+ this.label33.Name = "label33";
+ this.label33.Size = new System.Drawing.Size(120, 20);
+ this.label33.TabIndex = 88;
+ this.label33.Text = "Scale:";
+ //
+ // label34
+ //
+ this.label34.Location = new System.Drawing.Point(272, 480);
+ this.label34.Name = "label34";
+ this.label34.Size = new System.Drawing.Size(32, 20);
+ this.label34.TabIndex = 94;
+ this.label34.Text = "Z:";
+ //
+ // numScaleZ
+ //
+ this.numScaleZ.DecimalPlaces = 5;
+ this.numScaleZ.Location = new System.Drawing.Point(304, 480);
+ this.numScaleZ.Maximum = new System.Decimal(new int[] {
+ 256,
+ 0,
+ 0,
+ 0});
+ this.numScaleZ.Minimum = new System.Decimal(new int[] {
+ 10,
+ 0,
+ 0,
+ -2147483648});
+ this.numScaleZ.Name = "numScaleZ";
+ this.numScaleZ.Size = new System.Drawing.Size(80, 20);
+ this.numScaleZ.TabIndex = 27;
+ this.numScaleZ.Value = new System.Decimal(new int[] {
+ 5,
+ 0,
+ 0,
+ 65536});
+ //
+ // label35
+ //
+ this.label35.Location = new System.Drawing.Point(144, 480);
+ this.label35.Name = "label35";
+ this.label35.Size = new System.Drawing.Size(32, 20);
+ this.label35.TabIndex = 92;
+ this.label35.Text = "Y:";
+ //
+ // numScaleY
+ //
+ this.numScaleY.DecimalPlaces = 5;
+ this.numScaleY.Location = new System.Drawing.Point(176, 480);
+ this.numScaleY.Maximum = new System.Decimal(new int[] {
+ 256,
+ 0,
+ 0,
+ 0});
+ this.numScaleY.Name = "numScaleY";
+ this.numScaleY.Size = new System.Drawing.Size(80, 20);
+ this.numScaleY.TabIndex = 26;
+ this.numScaleY.Value = new System.Decimal(new int[] {
+ 5,
+ 0,
+ 0,
+ 65536});
+ //
+ // label36
+ //
+ this.label36.Location = new System.Drawing.Point(16, 480);
+ this.label36.Name = "label36";
+ this.label36.Size = new System.Drawing.Size(32, 20);
+ this.label36.TabIndex = 90;
+ this.label36.Text = "X:";
+ //
+ // numScaleX
+ //
+ this.numScaleX.DecimalPlaces = 5;
+ this.numScaleX.Location = new System.Drawing.Point(48, 480);
+ this.numScaleX.Maximum = new System.Decimal(new int[] {
+ 256,
+ 0,
+ 0,
+ 0});
+ this.numScaleX.Name = "numScaleX";
+ this.numScaleX.Size = new System.Drawing.Size(80, 20);
+ this.numScaleX.TabIndex = 25;
+ this.numScaleX.Value = new System.Decimal(new int[] {
+ 5,
+ 0,
+ 0,
+ 65536});
+ //
+ // label37
+ //
+ this.label37.Location = new System.Drawing.Point(272, 424);
+ this.label37.Name = "label37";
+ this.label37.Size = new System.Drawing.Size(32, 20);
+ this.label37.TabIndex = 100;
+ this.label37.Text = "Z:";
+ //
+ // numRotationZ
+ //
+ this.numRotationZ.DecimalPlaces = 5;
+ this.numRotationZ.Location = new System.Drawing.Point(304, 424);
+ this.numRotationZ.Maximum = new System.Decimal(new int[] {
+ 256,
+ 0,
+ 0,
+ 0});
+ this.numRotationZ.Name = "numRotationZ";
+ this.numRotationZ.Size = new System.Drawing.Size(80, 20);
+ this.numRotationZ.TabIndex = 23;
+ //
+ // label38
+ //
+ this.label38.Location = new System.Drawing.Point(144, 424);
+ this.label38.Name = "label38";
+ this.label38.Size = new System.Drawing.Size(32, 20);
+ this.label38.TabIndex = 98;
+ this.label38.Text = "Y:";
+ //
+ // numRotationY
+ //
+ this.numRotationY.DecimalPlaces = 5;
+ this.numRotationY.Location = new System.Drawing.Point(176, 424);
+ this.numRotationY.Maximum = new System.Decimal(new int[] {
+ 256,
+ 0,
+ 0,
+ 0});
+ this.numRotationY.Name = "numRotationY";
+ this.numRotationY.Size = new System.Drawing.Size(80, 20);
+ this.numRotationY.TabIndex = 22;
+ //
+ // label39
+ //
+ this.label39.Location = new System.Drawing.Point(16, 424);
+ this.label39.Name = "label39";
+ this.label39.Size = new System.Drawing.Size(32, 20);
+ this.label39.TabIndex = 96;
+ this.label39.Text = "X:";
+ //
+ // numRotationX
+ //
+ this.numRotationX.DecimalPlaces = 5;
+ this.numRotationX.Location = new System.Drawing.Point(48, 424);
+ this.numRotationX.Maximum = new System.Decimal(new int[] {
+ 256,
+ 0,
+ 0,
+ 0});
+ this.numRotationX.Name = "numRotationX";
+ this.numRotationX.Size = new System.Drawing.Size(80, 20);
+ this.numRotationX.TabIndex = 21;
+ //
+ // label40
+ //
+ this.label40.Location = new System.Drawing.Point(400, 424);
+ this.label40.Name = "label40";
+ this.label40.Size = new System.Drawing.Size(32, 20);
+ this.label40.TabIndex = 102;
+ this.label40.Text = "S:";
+ //
+ // numRotationS
+ //
+ this.numRotationS.DecimalPlaces = 5;
+ this.numRotationS.Location = new System.Drawing.Point(432, 424);
+ this.numRotationS.Maximum = new System.Decimal(new int[] {
+ 256,
+ 0,
+ 0,
+ 0});
+ this.numRotationS.Name = "numRotationS";
+ this.numRotationS.Size = new System.Drawing.Size(80, 20);
+ this.numRotationS.TabIndex = 24;
+ //
+ // numProfileHollow
+ //
+ this.numProfileHollow.Location = new System.Drawing.Point(408, 368);
+ this.numProfileHollow.Maximum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ 0});
+ this.numProfileHollow.Name = "numProfileHollow";
+ this.numProfileHollow.Size = new System.Drawing.Size(80, 20);
+ this.numProfileHollow.TabIndex = 20;
+ //
+ // numPathCurve
+ //
+ this.numPathCurve.Location = new System.Drawing.Point(136, 368);
+ this.numPathCurve.Maximum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ 0});
+ this.numPathCurve.Name = "numPathCurve";
+ this.numPathCurve.Size = new System.Drawing.Size(80, 20);
+ this.numPathCurve.TabIndex = 19;
+ this.numPathCurve.Value = new System.Decimal(new int[] {
+ 16,
+ 0,
+ 0,
+ 0});
+ //
+ // numProfileCurve
+ //
+ this.numProfileCurve.Location = new System.Drawing.Point(408, 336);
+ this.numProfileCurve.Maximum = new System.Decimal(new int[] {
+ 5,
+ 0,
+ 0,
+ 0});
+ this.numProfileCurve.Name = "numProfileCurve";
+ this.numProfileCurve.Size = new System.Drawing.Size(80, 20);
+ this.numProfileCurve.TabIndex = 18;
+ this.numProfileCurve.Value = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 0});
+ //
+ // numProfileBegin
+ //
+ this.numProfileBegin.Location = new System.Drawing.Point(232, 304);
+ this.numProfileBegin.Maximum = new System.Decimal(new int[] {
+ 1275,
+ 0,
+ 0,
+ 196608});
+ this.numProfileBegin.Name = "numProfileBegin";
+ this.numProfileBegin.Size = new System.Drawing.Size(80, 20);
+ this.numProfileBegin.TabIndex = 16;
+ //
+ // numProfileEnd
+ //
+ this.numProfileEnd.Location = new System.Drawing.Point(408, 304);
+ this.numProfileEnd.Maximum = new System.Decimal(new int[] {
+ 5,
+ 0,
+ 0,
+ 0});
+ this.numProfileEnd.Minimum = new System.Decimal(new int[] {
+ 275,
+ 0,
+ 0,
+ -2147287040});
+ this.numProfileEnd.Name = "numProfileEnd";
+ this.numProfileEnd.Size = new System.Drawing.Size(80, 20);
+ this.numProfileEnd.TabIndex = 17;
+ //
+ // numPathTwistBegin
+ //
+ this.numPathTwistBegin.Location = new System.Drawing.Point(232, 272);
+ this.numPathTwistBegin.Maximum = new System.Decimal(new int[] {
+ 459,
+ 0,
+ 0,
+ 0});
+ this.numPathTwistBegin.Minimum = new System.Decimal(new int[] {
+ 459,
+ 0,
+ 0,
+ -2147483648});
+ this.numPathTwistBegin.Name = "numPathTwistBegin";
+ this.numPathTwistBegin.Size = new System.Drawing.Size(80, 20);
+ this.numPathTwistBegin.TabIndex = 14;
+ //
+ // numPathTwist
+ //
+ this.numPathTwist.Location = new System.Drawing.Point(408, 272);
+ this.numPathTwist.Maximum = new System.Decimal(new int[] {
+ 459,
+ 0,
+ 0,
+ 0});
+ this.numPathTwist.Minimum = new System.Decimal(new int[] {
+ 459,
+ 0,
+ 0,
+ -2147483648});
+ this.numPathTwist.Name = "numPathTwist";
+ this.numPathTwist.Size = new System.Drawing.Size(80, 20);
+ this.numPathTwist.TabIndex = 15;
+ //
+ // numPathTaperX
+ //
+ this.numPathTaperX.DecimalPlaces = 2;
+ this.numPathTaperX.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathTaperX.Location = new System.Drawing.Point(232, 240);
+ this.numPathTaperX.Maximum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ 131072});
+ this.numPathTaperX.Minimum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ -2147352576});
+ this.numPathTaperX.Name = "numPathTaperX";
+ this.numPathTaperX.Size = new System.Drawing.Size(80, 20);
+ this.numPathTaperX.TabIndex = 12;
+ //
+ // numPathTaperY
+ //
+ this.numPathTaperY.DecimalPlaces = 2;
+ this.numPathTaperY.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathTaperY.Location = new System.Drawing.Point(408, 240);
+ this.numPathTaperY.Maximum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ 131072});
+ this.numPathTaperY.Minimum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ -2147352576});
+ this.numPathTaperY.Name = "numPathTaperY";
+ this.numPathTaperY.Size = new System.Drawing.Size(80, 20);
+ this.numPathTaperY.TabIndex = 13;
+ //
+ // numPathShearX
+ //
+ this.numPathShearX.DecimalPlaces = 2;
+ this.numPathShearX.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathShearX.Location = new System.Drawing.Point(232, 208);
+ this.numPathShearX.Maximum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ 131072});
+ this.numPathShearX.Minimum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ -2147352576});
+ this.numPathShearX.Name = "numPathShearX";
+ this.numPathShearX.Size = new System.Drawing.Size(80, 20);
+ this.numPathShearX.TabIndex = 8;
+ //
+ // numPathShearY
+ //
+ this.numPathShearY.DecimalPlaces = 2;
+ this.numPathShearY.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathShearY.Location = new System.Drawing.Point(408, 208);
+ this.numPathShearY.Maximum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ 131072});
+ this.numPathShearY.Minimum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ -2147352576});
+ this.numPathShearY.Name = "numPathShearY";
+ this.numPathShearY.Size = new System.Drawing.Size(80, 20);
+ this.numPathShearY.TabIndex = 9;
+ //
+ // numPathSkew
+ //
+ this.numPathSkew.DecimalPlaces = 2;
+ this.numPathSkew.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathSkew.Location = new System.Drawing.Point(136, 336);
+ this.numPathSkew.Maximum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ 131072});
+ this.numPathSkew.Minimum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ -2147352576});
+ this.numPathSkew.Name = "numPathSkew";
+ this.numPathSkew.Size = new System.Drawing.Size(80, 20);
+ this.numPathSkew.TabIndex = 10;
+ //
+ // numPathScaleX
+ //
+ this.numPathScaleX.DecimalPlaces = 2;
+ this.numPathScaleX.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathScaleX.Location = new System.Drawing.Point(232, 176);
+ this.numPathScaleX.Maximum = new System.Decimal(new int[] {
+ 155,
+ 0,
+ 0,
+ 131072});
+ this.numPathScaleX.Name = "numPathScaleX";
+ this.numPathScaleX.Size = new System.Drawing.Size(80, 20);
+ this.numPathScaleX.TabIndex = 6;
+ //
+ // numPathScaleY
+ //
+ this.numPathScaleY.DecimalPlaces = 2;
+ this.numPathScaleY.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathScaleY.Location = new System.Drawing.Point(408, 176);
+ this.numPathScaleY.Maximum = new System.Decimal(new int[] {
+ 155,
+ 0,
+ 0,
+ 131072});
+ this.numPathScaleY.Name = "numPathScaleY";
+ this.numPathScaleY.Size = new System.Drawing.Size(80, 20);
+ this.numPathScaleY.TabIndex = 7;
+ //
+ // numPathRevolutions
+ //
+ this.numPathRevolutions.DecimalPlaces = 2;
+ this.numPathRevolutions.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathRevolutions.Location = new System.Drawing.Point(136, 144);
+ this.numPathRevolutions.Maximum = new System.Decimal(new int[] {
+ 486,
+ 0,
+ 0,
+ 131072});
+ this.numPathRevolutions.Name = "numPathRevolutions";
+ this.numPathRevolutions.Size = new System.Drawing.Size(80, 20);
+ this.numPathRevolutions.TabIndex = 5;
+ this.numPathRevolutions.Value = new System.Decimal(new int[] {
+ 100,
+ 0,
+ 0,
+ 131072});
+ //
+ // numPathRadiusOffset
+ //
+ this.numPathRadiusOffset.DecimalPlaces = 3;
+ this.numPathRadiusOffset.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathRadiusOffset.Location = new System.Drawing.Point(136, 112);
+ this.numPathRadiusOffset.Maximum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ 131072});
+ this.numPathRadiusOffset.Minimum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ -2147352576});
+ this.numPathRadiusOffset.Name = "numPathRadiusOffset";
+ this.numPathRadiusOffset.Size = new System.Drawing.Size(80, 20);
+ this.numPathRadiusOffset.TabIndex = 4;
+ //
+ // numPathBegin
+ //
+ this.numPathBegin.DecimalPlaces = 2;
+ this.numPathBegin.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathBegin.Location = new System.Drawing.Point(232, 80);
+ this.numPathBegin.Maximum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ 131072});
+ this.numPathBegin.Name = "numPathBegin";
+ this.numPathBegin.Size = new System.Drawing.Size(80, 20);
+ this.numPathBegin.TabIndex = 2;
+ //
+ // numPathEnd
+ //
+ this.numPathEnd.DecimalPlaces = 2;
+ this.numPathEnd.Increment = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 65536});
+ this.numPathEnd.Location = new System.Drawing.Point(408, 80);
+ this.numPathEnd.Maximum = new System.Decimal(new int[] {
+ 10,
+ 0,
+ 0,
+ 65536});
+ this.numPathEnd.Minimum = new System.Decimal(new int[] {
+ 155,
+ 0,
+ 0,
+ -2147352576});
+ this.numPathEnd.Name = "numPathEnd";
+ this.numPathEnd.Size = new System.Drawing.Size(80, 20);
+ this.numPathEnd.TabIndex = 3;
+ this.numPathEnd.Value = new System.Decimal(new int[] {
+ 1,
+ 0,
+ 0,
+ 0});
+ //
+ // numMaterial
+ //
+ this.numMaterial.Location = new System.Drawing.Point(136, 48);
+ this.numMaterial.Maximum = new System.Decimal(new int[] {
+ 255,
+ 0,
+ 0,
+ 0});
+ this.numMaterial.Name = "numMaterial";
+ this.numMaterial.Size = new System.Drawing.Size(80, 20);
+ this.numMaterial.TabIndex = 1;
+ //
+ // txtName
+ //
+ this.txtName.Location = new System.Drawing.Point(136, 16);
+ this.txtName.Name = "txtName";
+ this.txtName.Size = new System.Drawing.Size(176, 20);
+ this.txtName.TabIndex = 0;
+ this.txtName.Text = "";
+ //
+ // label3
+ //
+ this.label3.Location = new System.Drawing.Point(272, 536);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(32, 16);
+ this.label3.TabIndex = 129;
+ this.label3.Text = "Z:";
+ //
+ // numPositionZ
+ //
+ this.numPositionZ.DecimalPlaces = 5;
+ this.numPositionZ.Location = new System.Drawing.Point(304, 536);
+ this.numPositionZ.Maximum = new System.Decimal(new int[] {
+ 256,
+ 0,
+ 0,
+ 0});
+ this.numPositionZ.Name = "numPositionZ";
+ this.numPositionZ.Size = new System.Drawing.Size(80, 20);
+ this.numPositionZ.TabIndex = 30;
+ //
+ // label2
+ //
+ this.label2.Location = new System.Drawing.Point(144, 536);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(32, 16);
+ this.label2.TabIndex = 127;
+ this.label2.Text = "Y:";
+ //
+ // numPositionY
+ //
+ this.numPositionY.DecimalPlaces = 5;
+ this.numPositionY.Location = new System.Drawing.Point(176, 536);
+ this.numPositionY.Maximum = new System.Decimal(new int[] {
+ 256,
+ 0,
+ 0,
+ 0});
+ this.numPositionY.Name = "numPositionY";
+ this.numPositionY.Size = new System.Drawing.Size(80, 20);
+ this.numPositionY.TabIndex = 29;
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(16, 536);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(32, 16);
+ this.label1.TabIndex = 125;
+ this.label1.Text = "X:";
+ //
+ // numPositionX
+ //
+ this.numPositionX.DecimalPlaces = 5;
+ this.numPositionX.Location = new System.Drawing.Point(48, 536);
+ this.numPositionX.Maximum = new System.Decimal(new int[] {
+ 256,
+ 0,
+ 0,
+ 0});
+ this.numPositionX.Name = "numPositionX";
+ this.numPositionX.Size = new System.Drawing.Size(80, 20);
+ this.numPositionX.TabIndex = 28;
+ //
+ // label41
+ //
+ this.label41.Location = new System.Drawing.Point(16, 512);
+ this.label41.Name = "label41";
+ this.label41.Size = new System.Drawing.Size(120, 20);
+ this.label41.TabIndex = 130;
+ this.label41.Text = "Sim Position:";
+ //
+ // frmPrimBuilder
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(528, 573);
+ this.Controls.Add(this.label41);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.numPositionZ);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.numPositionY);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.numPositionX);
+ this.Controls.Add(this.txtName);
+ this.Controls.Add(this.numMaterial);
+ this.Controls.Add(this.numPathEnd);
+ this.Controls.Add(this.numPathBegin);
+ this.Controls.Add(this.numPathRadiusOffset);
+ this.Controls.Add(this.numPathRevolutions);
+ this.Controls.Add(this.numPathScaleY);
+ this.Controls.Add(this.numPathScaleX);
+ this.Controls.Add(this.numPathSkew);
+ this.Controls.Add(this.numPathShearY);
+ this.Controls.Add(this.numPathShearX);
+ this.Controls.Add(this.numPathTaperY);
+ this.Controls.Add(this.numPathTaperX);
+ this.Controls.Add(this.numPathTwist);
+ this.Controls.Add(this.numPathTwistBegin);
+ this.Controls.Add(this.numProfileEnd);
+ this.Controls.Add(this.numProfileBegin);
+ this.Controls.Add(this.numProfileCurve);
+ this.Controls.Add(this.numPathCurve);
+ this.Controls.Add(this.numProfileHollow);
+ this.Controls.Add(this.label40);
+ this.Controls.Add(this.numRotationS);
+ this.Controls.Add(this.label37);
+ this.Controls.Add(this.numRotationZ);
+ this.Controls.Add(this.label38);
+ this.Controls.Add(this.numRotationY);
+ this.Controls.Add(this.label39);
+ this.Controls.Add(this.numRotationX);
+ this.Controls.Add(this.label34);
+ this.Controls.Add(this.numScaleZ);
+ this.Controls.Add(this.label35);
+ this.Controls.Add(this.numScaleY);
+ this.Controls.Add(this.label36);
+ this.Controls.Add(this.numScaleX);
+ this.Controls.Add(this.label33);
+ this.Controls.Add(this.label32);
+ this.Controls.Add(this.label31);
+ this.Controls.Add(this.label30);
+ this.Controls.Add(this.label29);
+ this.Controls.Add(this.label26);
+ this.Controls.Add(this.label27);
+ this.Controls.Add(this.label28);
+ this.Controls.Add(this.label23);
+ this.Controls.Add(this.label24);
+ this.Controls.Add(this.label25);
+ this.Controls.Add(this.label20);
+ this.Controls.Add(this.label21);
+ this.Controls.Add(this.label22);
+ this.Controls.Add(this.label19);
+ this.Controls.Add(this.label14);
+ this.Controls.Add(this.label15);
+ this.Controls.Add(this.label16);
+ this.Controls.Add(this.label13);
+ this.Controls.Add(this.label12);
+ this.Controls.Add(this.label11);
+ this.Controls.Add(this.label7);
+ this.Controls.Add(this.label10);
+ this.Controls.Add(this.label9);
+ this.Controls.Add(this.label8);
+ this.Controls.Add(this.label6);
+ this.Controls.Add(this.label5);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.cmdBuild);
+ this.Name = "frmPrimBuilder";
+ this.Text = "Prim Builder";
+ ((System.ComponentModel.ISupportInitialize)(this.numScaleZ)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numScaleY)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numScaleX)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numRotationZ)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numRotationY)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numRotationX)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numRotationS)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numProfileHollow)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathCurve)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numProfileCurve)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numProfileBegin)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numProfileEnd)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathTwistBegin)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathTwist)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathTaperX)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathTaperY)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathShearX)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathShearY)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathSkew)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathScaleX)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathScaleY)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathRevolutions)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathRadiusOffset)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathBegin)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPathEnd)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numMaterial)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPositionZ)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPositionY)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.numPositionX)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ private void cmdBuild_Click(object sender, System.EventArgs e)
+ {
+ cmdBuild.Enabled = false;
+
+ PrimObject prim = new PrimObject(new LLUUID("8955674724cb43ed920b47caed15465f"));
+
+ prim.Material = (uint)numMaterial.Value;
+ prim.PathBegin = PrimObject.PathBeginByte((float)numPathBegin.Value);
+ prim.PathEnd = PrimObject.PathEndByte((float)numPathEnd.Value);
+ prim.PathRadiusOffset = PrimObject.PathRadiusOffsetByte((float)numPathRadiusOffset.Value);
+ prim.PathRevolutions = PrimObject.PathRevolutionsByte((float)numPathRevolutions.Value);
+ prim.PathScaleX = PrimObject.PathScaleByte((float)numPathScaleX.Value);
+ prim.PathScaleY = PrimObject.PathScaleByte((float)numPathScaleY.Value);
+ prim.PathShearX = PrimObject.PathShearByte((float)numPathShearX.Value);
+ prim.PathShearY = PrimObject.PathShearByte((float)numPathShearY.Value);
+ prim.PathTaperX = PrimObject.PathTaperByte((float)numPathTaperX.Value);
+ prim.PathTaperY = PrimObject.PathTaperByte((float)numPathTaperY.Value);
+ prim.PathTwistBegin = PrimObject.PathTwistByte((float)numPathTwistBegin.Value);
+ prim.PathTwist = PrimObject.PathTwistByte((float)numPathTwist.Value);
+ prim.ProfileBegin = PrimObject.ProfileBeginByte((float)numProfileBegin.Value);
+ prim.ProfileEnd = PrimObject.ProfileEndByte((float)numProfileEnd.Value);
+ prim.PathSkew = PrimObject.PathSkewByte((float)numPathSkew.Value);
+ prim.ProfileCurve = (uint)numProfileCurve.Value;
+ prim.PathCurve = (uint)numPathCurve.Value;
+ prim.ProfileHollow = (uint)numProfileHollow.Value;
+ prim.Rotation.X = (float)numRotationX.Value;
+ prim.Rotation.Y = (float)numRotationY.Value;
+ prim.Rotation.Z = (float)numRotationZ.Value;
+ prim.Rotation.S = (float)numRotationS.Value;
+ prim.Scale.X = (float)numScaleX.Value;
+ prim.Scale.Y = (float)numScaleY.Value;
+ prim.Scale.Z = (float)numScaleZ.Value;
+ prim.Position.X = (float)numPositionX.Value;
+ prim.Position.Y = (float)numPositionY.Value;
+ prim.Position.Z = (float)numPositionZ.Value;
+
+ Client.CurrentRegion.RezObject(prim, prim.Position, new LLVector3(Client.Avatar.Position));
+
+ // Rate limiting
+ System.Threading.Thread.Sleep(250);
+
+ cmdBuild.Enabled = true;
+ }
+ }
+}
diff --git a/applications/SecondSuite/Plugins/PrimBuilder/frmPrimBuilder.resx b/applications/SecondSuite/Plugins/PrimBuilder/frmPrimBuilder.resx
index efd551b6..247435d6 100644
--- a/applications/SecondSuite/Plugins/PrimBuilder/frmPrimBuilder.resx
+++ b/applications/SecondSuite/Plugins/PrimBuilder/frmPrimBuilder.resx
@@ -1,760 +1,760 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 1.3
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Private
-
-
- False
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- (Default)
-
-
- False
-
-
- False
-
-
- 8, 8
-
-
- True
-
-
- 80
-
-
- True
-
-
- Private
-
-
- frmPrimBuilder
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ (Default)
+
+
+ False
+
+
+ False
+
+
+ 8, 8
+
+
+ True
+
+
+ 80
+
+
+ True
+
+
+ Private
+
+
+ frmPrimBuilder
+
\ No newline at end of file
diff --git a/applications/SecondSuite/Plugins/PrimImporter/AssemblyInfo.cs b/applications/SecondSuite/Plugins/PrimImporter/AssemblyInfo.cs
index 177a4f0e..9f89a328 100644
--- a/applications/SecondSuite/Plugins/PrimImporter/AssemblyInfo.cs
+++ b/applications/SecondSuite/Plugins/PrimImporter/AssemblyInfo.cs
@@ -1,58 +1,58 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// 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("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.*")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// 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("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/applications/SecondSuite/Plugins/PrimImporter/PrimImporter.cs b/applications/SecondSuite/Plugins/PrimImporter/PrimImporter.cs
index df8b703c..bcd570af 100644
--- a/applications/SecondSuite/Plugins/PrimImporter/PrimImporter.cs
+++ b/applications/SecondSuite/Plugins/PrimImporter/PrimImporter.cs
@@ -1,68 +1,68 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using libsecondlife;
-using SecondSuite.Plugins;
-
-namespace SecondSuite.Plugins
-{
- ///
- /// Accountant plugin implementation
- ///
- public class PrimImporter : SSPlugin
- {
- public string Name { get { return "Prim Importer"; } }
- public string Author { get { return "John Hurliman"; } }
- public string Homepage { get { return "http://www.highenergychemistry.com/"; } }
- public string Description { get { return "Import structures created with Prim.Blender"; } }
- public bool SecondLifeClient { get { return true; } }
- public ConnectionEvent ConnectionHandler { get { return OnConnection; } }
- public override string ToString() { return Name; }
-
- private frmPrimImporter Form;
- private ConnectionEvent OnConnection;
-
- public void Init(SecondLife client)
- {
- Form = new frmPrimImporter(client);
- OnConnection = new ConnectionEvent(Form.Connected);
- }
-
- public System.Windows.Forms.Form Load()
- {
- return Form;
- }
-
- public void Shutdown()
- {
- if (Form != null)
- {
- Form.Close();
- }
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using libsecondlife;
+using SecondSuite.Plugins;
+
+namespace SecondSuite.Plugins
+{
+ ///
+ /// Accountant plugin implementation
+ ///
+ public class PrimImporter : SSPlugin
+ {
+ public string Name { get { return "Prim Importer"; } }
+ public string Author { get { return "John Hurliman"; } }
+ public string Homepage { get { return "http://www.highenergychemistry.com/"; } }
+ public string Description { get { return "Import structures created with Prim.Blender"; } }
+ public bool SecondLifeClient { get { return true; } }
+ public ConnectionEvent ConnectionHandler { get { return OnConnection; } }
+ public override string ToString() { return Name; }
+
+ private frmPrimImporter Form;
+ private ConnectionEvent OnConnection;
+
+ public void Init(SecondLife client)
+ {
+ Form = new frmPrimImporter(client);
+ OnConnection = new ConnectionEvent(Form.Connected);
+ }
+
+ public System.Windows.Forms.Form Load()
+ {
+ return Form;
+ }
+
+ public void Shutdown()
+ {
+ if (Form != null)
+ {
+ Form.Close();
+ }
+ }
+ }
+}
diff --git a/applications/SecondSuite/Plugins/PrimImporter/PrimImporter.csproj b/applications/SecondSuite/Plugins/PrimImporter/PrimImporter.csproj
index 8629fbdc..5101721d 100644
--- a/applications/SecondSuite/Plugins/PrimImporter/PrimImporter.csproj
+++ b/applications/SecondSuite/Plugins/PrimImporter/PrimImporter.csproj
@@ -1,130 +1,130 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/SecondSuite/Plugins/PrimImporter/frmPrimImporter.cs b/applications/SecondSuite/Plugins/PrimImporter/frmPrimImporter.cs
index ee4ae3ca..dfdc1976 100644
--- a/applications/SecondSuite/Plugins/PrimImporter/frmPrimImporter.cs
+++ b/applications/SecondSuite/Plugins/PrimImporter/frmPrimImporter.cs
@@ -1,351 +1,351 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-using System.Xml;
-using System.Threading;
-using libsecondlife;
-
-namespace SecondSuite.Plugins
-{
- ///
- /// Summary description for frmPrimImporter.
- ///
- public class frmPrimImporter : System.Windows.Forms.Form
- {
- private System.Windows.Forms.Button cmdImport;
- private System.Windows.Forms.TextBox txtLog;
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.Container components = null;
-
- // libsecondlife instance
- private SecondLife Client;
- bool WaitingOnUpdate = false;
- PrimObject CurrentPrim;
- Mutex CurrentPrimMutex = new Mutex(false, "CurrentPrimMutex");
-
- public frmPrimImporter(SecondLife client)
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- Client = client;
-
- // Install our packet handlers
- Client.Network.RegisterCallback("ObjectAdd", new PacketCallback(ObjectAddHandler));
- Client.Network.RegisterCallback("ObjectUpdate", new PacketCallback(ObjectUpdateHandler));
- }
-
- public void ObjectAddHandler(Packet packet, Simulator simulator)
- {
- LLVector3 position = null;
-
- if (WaitingOnUpdate)
- {
- CurrentPrimMutex.WaitOne();
-
- foreach (Block block in packet.Blocks())
- {
- foreach (Field field in block.Fields)
- {
- if (field.Layout.Name == "RayEnd")
- {
- position = (LLVector3)field.Data;
- }
- }
- }
-
- txtLog.AppendText("Received an ObjectAdd, setting CurrentPrim position to " + position.ToString());
- CurrentPrim.Position = position;
-
- CurrentPrimMutex.ReleaseMutex();
- }
- }
-
- public void ObjectUpdateHandler(Packet packet, Simulator simulator)
- {
- uint id = 0;
- LLUUID uuid = null;
-
- if (WaitingOnUpdate)
- {
- CurrentPrimMutex.WaitOne();
-
- foreach (Block block in packet.Blocks())
- {
- foreach (Field field in block.Fields)
- {
- if (field.Layout.Name == "ID")
- {
- id = (uint)field.Data;
- }
- else if (field.Layout.Name == "FullID")
- {
- uuid = (LLUUID)field.Data;
- }
- else if (field.Layout.Name == "ObjectData")
- {
- byte[] byteArray = (byte[])field.Data;
- LLVector3 position = new LLVector3(byteArray, 0);
- if (CurrentPrim != null && position != CurrentPrim.Position)
- {
- txtLog.AppendText(position.ToString() + " doesn't match CurrentPrim.Position " +
- CurrentPrim.Position.ToString() + "\n"/* + ", ignoring"*/);
- //return;
- }
- }
- }
- }
-
- CurrentPrim.ID = id;
- CurrentPrim.UUID = uuid;
-
- WaitingOnUpdate = false;
-
- CurrentPrimMutex.ReleaseMutex();
- }
- }
-
- ///
- /// Clean up any resources being used.
- ///
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- public void Connected()
- {
- ;
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.cmdImport = new System.Windows.Forms.Button();
- this.txtLog = new System.Windows.Forms.TextBox();
- this.SuspendLayout();
- //
- // cmdImport
- //
- this.cmdImport.Location = new System.Drawing.Point(376, 304);
- this.cmdImport.Name = "cmdImport";
- this.cmdImport.Size = new System.Drawing.Size(104, 24);
- this.cmdImport.TabIndex = 56;
- this.cmdImport.Text = "Import Structure";
- this.cmdImport.Click += new System.EventHandler(this.cmdImport_Click);
- //
- // txtLog
- //
- this.txtLog.Location = new System.Drawing.Point(16, 16);
- this.txtLog.Multiline = true;
- this.txtLog.Name = "txtLog";
- this.txtLog.Size = new System.Drawing.Size(464, 232);
- this.txtLog.TabIndex = 57;
- this.txtLog.Text = "";
- //
- // frmPrimImporter
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(496, 349);
- this.Controls.Add(this.txtLog);
- this.Controls.Add(this.cmdImport);
- this.MaximizeBox = false;
- this.MinimumSize = new System.Drawing.Size(456, 320);
- this.Name = "frmPrimImporter";
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
- this.Text = "Prim Importer";
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private void cmdImport_Click(object sender, System.EventArgs e)
- {
- OpenFileDialog openDialog = new OpenFileDialog();
- openDialog.Title = "Open Prim.Blender File";
- openDialog.Filter = "All files (*.*)|*.*|Prim files (*.prims)|*.prims" ;
- openDialog.FilterIndex = 2;
-
- if(openDialog.ShowDialog() != DialogResult.OK)
- {
- return;
- }
-
- XmlDocument xml = new XmlDocument();
- XmlNodeList list = null;
-
- try
- {
- // Try to load the xml file
- xml.Load(openDialog.FileName);
-
- //If there is a document and it has children,
- if(xml != null && xml.HasChildNodes)
- {
- //Get the children into the temp list
- list = xml.GetElementsByTagName("primitive");
- }
- else
- {
- txtLog.AppendText("ERROR: Failed to parse " + openDialog.FileName + "\n");
- return;
- }
- }
- catch (Exception err)
- {
- txtLog.AppendText("ERROR: " + err.ToString() + "\n");
- return;
- }
-
- foreach (XmlNode node in list)
- {
- txtLog.AppendText("Parsing primitive " + node.Attributes["key"].Value + "\n");
-
- XmlNode properties = node["properties"];
-
- PrimObject prim = new PrimObject(new LLUUID("8955674724cb43ed920b47caed15465f"));
-
- prim.Material = Convert.ToUInt16(properties["material"].Attributes["val"].Value);
- prim.Name = node.Attributes["key"].Value;
- // Either PathBegin/End or ProfileBegin/End should be dimple
- prim.PathBegin = PrimObject.PathBeginByte(Convert.ToSingle(properties["cut"].Attributes["x"].Value));
- prim.PathEnd = PrimObject.PathEndByte(Convert.ToSingle(properties["cut"].Attributes["y"].Value));
- prim.PathRadiusOffset = PrimObject.PathRadiusOffsetByte(Convert.ToSingle(properties["radiusoffset"].Attributes["val"].Value));
- prim.PathRevolutions = PrimObject.PathRevolutionsByte(Convert.ToSingle(properties["revolutions"].Attributes["val"].Value));
- prim.PathScaleX = PrimObject.PathScaleByte(Convert.ToSingle(properties["topsize"].Attributes["x"].Value));
- prim.PathScaleY = PrimObject.PathScaleByte(Convert.ToSingle(properties["topsize"].Attributes["y"].Value));
- prim.PathShearX = PrimObject.PathShearByte(Convert.ToSingle(properties["topshear"].Attributes["x"].Value));
- prim.PathShearY = PrimObject.PathShearByte(Convert.ToSingle(properties["topshear"].Attributes["y"].Value));
- prim.PathSkew = PrimObject.PathSkewByte(Convert.ToSingle(properties["skew"].Attributes["val"].Value));
- prim.PathTaperX = PrimObject.PathTaperByte(Convert.ToSingle(properties["taper"].Attributes["x"].Value));
- prim.PathTaperY = PrimObject.PathTaperByte(Convert.ToSingle(properties["taper"].Attributes["y"].Value));
- prim.PathTwist = PrimObject.PathTwistByte(Convert.ToSingle(properties["twist"].Attributes["y"].Value));
- prim.PathTwistBegin = PrimObject.PathTwistByte(Convert.ToSingle(properties["twist"].Attributes["x"].Value));
- prim.ProfileBegin = PrimObject.ProfileBeginByte(Convert.ToSingle(properties["cut"].Attributes["x"].Value));
- prim.ProfileEnd = PrimObject.ProfileEndByte(Convert.ToSingle(properties["cut"].Attributes["y"].Value));
- ushort curve = Convert.ToUInt16(properties["type"].Attributes["val"].Value);
- switch (curve)
- {
- case 0:
- // Box
- prim.ProfileCurve = 1;
- prim.PathCurve = 16;
- break;
- case 1:
- // Cylinder
- prim.ProfileCurve = 0;
- prim.PathCurve = 16;
- break;
- case 2:
- // Prism
- prim.ProfileCurve = 3;
- prim.PathCurve = 16;
- break;
- case 3:
- // Sphere
- prim.ProfileCurve = 5;
- prim.PathCurve = 32;
- break;
- case 4:
- // Torus
- prim.ProfileCurve = 0;
- prim.PathCurve = 32;
- break;
- case 5:
- // Tube
- prim.ProfileCurve = 1;
- prim.PathCurve = 32;
- break;
- case 6:
- // Ring
- prim.ProfileCurve = 3;
- prim.PathCurve = 16;
- break;
- }
- prim.ProfileHollow = Convert.ToUInt32(properties["hollow"].Attributes["val"].Value);
- prim.Rotation = new LLQuaternion(
- Convert.ToSingle(properties["rotation"].Attributes["x"].Value),
- Convert.ToSingle(properties["rotation"].Attributes["y"].Value),
- Convert.ToSingle(properties["rotation"].Attributes["z"].Value),
- Convert.ToSingle(properties["rotation"].Attributes["s"].Value));
- prim.Scale = new LLVector3(
- Convert.ToSingle(properties["size"].Attributes["x"].Value),
- Convert.ToSingle(properties["size"].Attributes["y"].Value),
- Convert.ToSingle(properties["size"].Attributes["z"].Value));
-
- LLVector3 position = new LLVector3(
- Convert.ToSingle(properties["position"].Attributes["x"].Value) + (float)Client.Avatar.Position.X,
- Convert.ToSingle(properties["position"].Attributes["y"].Value) + (float)Client.Avatar.Position.Y,
- Convert.ToSingle(properties["position"].Attributes["z"].Value) + (float)Client.Avatar.Position.Z + 50.0F);
- prim.Position = position;
-
- CurrentPrim = prim;
- WaitingOnUpdate = true;
-
- Client.CurrentRegion.RezObject(prim, position, new LLVector3(Client.Avatar.Position));
-
- while (WaitingOnUpdate)
- {
- System.Threading.Thread.Sleep(100);
- Application.DoEvents();
- }
-
- txtLog.AppendText("Rezzed primitive with UUID " + CurrentPrim.UUID + " and ID " + CurrentPrim.ID + " \n");
-
- Hashtable blocks = new Hashtable();
- Hashtable fields = new Hashtable();
-
- /*fields["ObjectLocalID"] = CurrentPrim.ID;
- blocks[fields] = "ObjectData";
-
- fields = new Hashtable();
-
- fields["AgentID"] = Client.Network.AgentID;
- blocks[fields] = "AgentData";
-
- Packet packet = PacketBuilder.BuildPacket("ObjectSelect", Client.Protocol, blocks, Helpers.MSG_RELIABLE);
- Client.Network.SendPacket(packet);
-
- System.Threading.Thread.Sleep(100);*/
- Packet packet;
-
- byte[] byteArray = new byte[12];
- Array.Copy(position.GetBytes(), byteArray, 12);
-
- fields["Data"] = byteArray;
- fields["Type"] = (byte)9;
- fields["ObjectLocalID"] = CurrentPrim.ID;
- blocks[fields] = "ObjectData";
-
- fields = new Hashtable();
-
- fields["AgentID"] = Client.Network.AgentID;
- blocks[fields] = "AgentData";
-
- packet = PacketBuilder.BuildPacket("MultipleObjectUpdate", Client.Protocol, blocks, Helpers.MSG_RELIABLE);
- Client.Network.SendPacket(packet);
- Client.Network.SendPacket(packet);
- Client.Network.SendPacket(packet);
-
- System.Threading.Thread.Sleep(500);
- }
- }
- }
-}
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Xml;
+using System.Threading;
+using libsecondlife;
+
+namespace SecondSuite.Plugins
+{
+ ///
+ /// Summary description for frmPrimImporter.
+ ///
+ public class frmPrimImporter : System.Windows.Forms.Form
+ {
+ private System.Windows.Forms.Button cmdImport;
+ private System.Windows.Forms.TextBox txtLog;
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.Container components = null;
+
+ // libsecondlife instance
+ private SecondLife Client;
+ bool WaitingOnUpdate = false;
+ PrimObject CurrentPrim;
+ Mutex CurrentPrimMutex = new Mutex(false, "CurrentPrimMutex");
+
+ public frmPrimImporter(SecondLife client)
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ Client = client;
+
+ // Install our packet handlers
+ Client.Network.RegisterCallback("ObjectAdd", new PacketCallback(ObjectAddHandler));
+ Client.Network.RegisterCallback("ObjectUpdate", new PacketCallback(ObjectUpdateHandler));
+ }
+
+ public void ObjectAddHandler(Packet packet, Simulator simulator)
+ {
+ LLVector3 position = null;
+
+ if (WaitingOnUpdate)
+ {
+ CurrentPrimMutex.WaitOne();
+
+ foreach (Block block in packet.Blocks())
+ {
+ foreach (Field field in block.Fields)
+ {
+ if (field.Layout.Name == "RayEnd")
+ {
+ position = (LLVector3)field.Data;
+ }
+ }
+ }
+
+ txtLog.AppendText("Received an ObjectAdd, setting CurrentPrim position to " + position.ToString());
+ CurrentPrim.Position = position;
+
+ CurrentPrimMutex.ReleaseMutex();
+ }
+ }
+
+ public void ObjectUpdateHandler(Packet packet, Simulator simulator)
+ {
+ uint id = 0;
+ LLUUID uuid = null;
+
+ if (WaitingOnUpdate)
+ {
+ CurrentPrimMutex.WaitOne();
+
+ foreach (Block block in packet.Blocks())
+ {
+ foreach (Field field in block.Fields)
+ {
+ if (field.Layout.Name == "ID")
+ {
+ id = (uint)field.Data;
+ }
+ else if (field.Layout.Name == "FullID")
+ {
+ uuid = (LLUUID)field.Data;
+ }
+ else if (field.Layout.Name == "ObjectData")
+ {
+ byte[] byteArray = (byte[])field.Data;
+ LLVector3 position = new LLVector3(byteArray, 0);
+ if (CurrentPrim != null && position != CurrentPrim.Position)
+ {
+ txtLog.AppendText(position.ToString() + " doesn't match CurrentPrim.Position " +
+ CurrentPrim.Position.ToString() + "\n"/* + ", ignoring"*/);
+ //return;
+ }
+ }
+ }
+ }
+
+ CurrentPrim.ID = id;
+ CurrentPrim.UUID = uuid;
+
+ WaitingOnUpdate = false;
+
+ CurrentPrimMutex.ReleaseMutex();
+ }
+ }
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if(components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose( disposing );
+ }
+
+ public void Connected()
+ {
+ ;
+ }
+
+ #region Windows Form Designer generated code
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.cmdImport = new System.Windows.Forms.Button();
+ this.txtLog = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // cmdImport
+ //
+ this.cmdImport.Location = new System.Drawing.Point(376, 304);
+ this.cmdImport.Name = "cmdImport";
+ this.cmdImport.Size = new System.Drawing.Size(104, 24);
+ this.cmdImport.TabIndex = 56;
+ this.cmdImport.Text = "Import Structure";
+ this.cmdImport.Click += new System.EventHandler(this.cmdImport_Click);
+ //
+ // txtLog
+ //
+ this.txtLog.Location = new System.Drawing.Point(16, 16);
+ this.txtLog.Multiline = true;
+ this.txtLog.Name = "txtLog";
+ this.txtLog.Size = new System.Drawing.Size(464, 232);
+ this.txtLog.TabIndex = 57;
+ this.txtLog.Text = "";
+ //
+ // frmPrimImporter
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(496, 349);
+ this.Controls.Add(this.txtLog);
+ this.Controls.Add(this.cmdImport);
+ this.MaximizeBox = false;
+ this.MinimumSize = new System.Drawing.Size(456, 320);
+ this.Name = "frmPrimImporter";
+ this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+ this.Text = "Prim Importer";
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ private void cmdImport_Click(object sender, System.EventArgs e)
+ {
+ OpenFileDialog openDialog = new OpenFileDialog();
+ openDialog.Title = "Open Prim.Blender File";
+ openDialog.Filter = "All files (*.*)|*.*|Prim files (*.prims)|*.prims" ;
+ openDialog.FilterIndex = 2;
+
+ if(openDialog.ShowDialog() != DialogResult.OK)
+ {
+ return;
+ }
+
+ XmlDocument xml = new XmlDocument();
+ XmlNodeList list = null;
+
+ try
+ {
+ // Try to load the xml file
+ xml.Load(openDialog.FileName);
+
+ //If there is a document and it has children,
+ if(xml != null && xml.HasChildNodes)
+ {
+ //Get the children into the temp list
+ list = xml.GetElementsByTagName("primitive");
+ }
+ else
+ {
+ txtLog.AppendText("ERROR: Failed to parse " + openDialog.FileName + "\n");
+ return;
+ }
+ }
+ catch (Exception err)
+ {
+ txtLog.AppendText("ERROR: " + err.ToString() + "\n");
+ return;
+ }
+
+ foreach (XmlNode node in list)
+ {
+ txtLog.AppendText("Parsing primitive " + node.Attributes["key"].Value + "\n");
+
+ XmlNode properties = node["properties"];
+
+ PrimObject prim = new PrimObject(new LLUUID("8955674724cb43ed920b47caed15465f"));
+
+ prim.Material = Convert.ToUInt16(properties["material"].Attributes["val"].Value);
+ prim.Name = node.Attributes["key"].Value;
+ // Either PathBegin/End or ProfileBegin/End should be dimple
+ prim.PathBegin = PrimObject.PathBeginByte(Convert.ToSingle(properties["cut"].Attributes["x"].Value));
+ prim.PathEnd = PrimObject.PathEndByte(Convert.ToSingle(properties["cut"].Attributes["y"].Value));
+ prim.PathRadiusOffset = PrimObject.PathRadiusOffsetByte(Convert.ToSingle(properties["radiusoffset"].Attributes["val"].Value));
+ prim.PathRevolutions = PrimObject.PathRevolutionsByte(Convert.ToSingle(properties["revolutions"].Attributes["val"].Value));
+ prim.PathScaleX = PrimObject.PathScaleByte(Convert.ToSingle(properties["topsize"].Attributes["x"].Value));
+ prim.PathScaleY = PrimObject.PathScaleByte(Convert.ToSingle(properties["topsize"].Attributes["y"].Value));
+ prim.PathShearX = PrimObject.PathShearByte(Convert.ToSingle(properties["topshear"].Attributes["x"].Value));
+ prim.PathShearY = PrimObject.PathShearByte(Convert.ToSingle(properties["topshear"].Attributes["y"].Value));
+ prim.PathSkew = PrimObject.PathSkewByte(Convert.ToSingle(properties["skew"].Attributes["val"].Value));
+ prim.PathTaperX = PrimObject.PathTaperByte(Convert.ToSingle(properties["taper"].Attributes["x"].Value));
+ prim.PathTaperY = PrimObject.PathTaperByte(Convert.ToSingle(properties["taper"].Attributes["y"].Value));
+ prim.PathTwist = PrimObject.PathTwistByte(Convert.ToSingle(properties["twist"].Attributes["y"].Value));
+ prim.PathTwistBegin = PrimObject.PathTwistByte(Convert.ToSingle(properties["twist"].Attributes["x"].Value));
+ prim.ProfileBegin = PrimObject.ProfileBeginByte(Convert.ToSingle(properties["cut"].Attributes["x"].Value));
+ prim.ProfileEnd = PrimObject.ProfileEndByte(Convert.ToSingle(properties["cut"].Attributes["y"].Value));
+ ushort curve = Convert.ToUInt16(properties["type"].Attributes["val"].Value);
+ switch (curve)
+ {
+ case 0:
+ // Box
+ prim.ProfileCurve = 1;
+ prim.PathCurve = 16;
+ break;
+ case 1:
+ // Cylinder
+ prim.ProfileCurve = 0;
+ prim.PathCurve = 16;
+ break;
+ case 2:
+ // Prism
+ prim.ProfileCurve = 3;
+ prim.PathCurve = 16;
+ break;
+ case 3:
+ // Sphere
+ prim.ProfileCurve = 5;
+ prim.PathCurve = 32;
+ break;
+ case 4:
+ // Torus
+ prim.ProfileCurve = 0;
+ prim.PathCurve = 32;
+ break;
+ case 5:
+ // Tube
+ prim.ProfileCurve = 1;
+ prim.PathCurve = 32;
+ break;
+ case 6:
+ // Ring
+ prim.ProfileCurve = 3;
+ prim.PathCurve = 16;
+ break;
+ }
+ prim.ProfileHollow = Convert.ToUInt32(properties["hollow"].Attributes["val"].Value);
+ prim.Rotation = new LLQuaternion(
+ Convert.ToSingle(properties["rotation"].Attributes["x"].Value),
+ Convert.ToSingle(properties["rotation"].Attributes["y"].Value),
+ Convert.ToSingle(properties["rotation"].Attributes["z"].Value),
+ Convert.ToSingle(properties["rotation"].Attributes["s"].Value));
+ prim.Scale = new LLVector3(
+ Convert.ToSingle(properties["size"].Attributes["x"].Value),
+ Convert.ToSingle(properties["size"].Attributes["y"].Value),
+ Convert.ToSingle(properties["size"].Attributes["z"].Value));
+
+ LLVector3 position = new LLVector3(
+ Convert.ToSingle(properties["position"].Attributes["x"].Value) + (float)Client.Avatar.Position.X,
+ Convert.ToSingle(properties["position"].Attributes["y"].Value) + (float)Client.Avatar.Position.Y,
+ Convert.ToSingle(properties["position"].Attributes["z"].Value) + (float)Client.Avatar.Position.Z + 50.0F);
+ prim.Position = position;
+
+ CurrentPrim = prim;
+ WaitingOnUpdate = true;
+
+ Client.CurrentRegion.RezObject(prim, position, new LLVector3(Client.Avatar.Position));
+
+ while (WaitingOnUpdate)
+ {
+ System.Threading.Thread.Sleep(100);
+ Application.DoEvents();
+ }
+
+ txtLog.AppendText("Rezzed primitive with UUID " + CurrentPrim.UUID + " and ID " + CurrentPrim.ID + " \n");
+
+ Hashtable blocks = new Hashtable();
+ Hashtable fields = new Hashtable();
+
+ /*fields["ObjectLocalID"] = CurrentPrim.ID;
+ blocks[fields] = "ObjectData";
+
+ fields = new Hashtable();
+
+ fields["AgentID"] = Client.Network.AgentID;
+ blocks[fields] = "AgentData";
+
+ Packet packet = PacketBuilder.BuildPacket("ObjectSelect", Client.Protocol, blocks, Helpers.MSG_RELIABLE);
+ Client.Network.SendPacket(packet);
+
+ System.Threading.Thread.Sleep(100);*/
+ Packet packet;
+
+ byte[] byteArray = new byte[12];
+ Array.Copy(position.GetBytes(), byteArray, 12);
+
+ fields["Data"] = byteArray;
+ fields["Type"] = (byte)9;
+ fields["ObjectLocalID"] = CurrentPrim.ID;
+ blocks[fields] = "ObjectData";
+
+ fields = new Hashtable();
+
+ fields["AgentID"] = Client.Network.AgentID;
+ blocks[fields] = "AgentData";
+
+ packet = PacketBuilder.BuildPacket("MultipleObjectUpdate", Client.Protocol, blocks, Helpers.MSG_RELIABLE);
+ Client.Network.SendPacket(packet);
+ Client.Network.SendPacket(packet);
+ Client.Network.SendPacket(packet);
+
+ System.Threading.Thread.Sleep(500);
+ }
+ }
+ }
+}
diff --git a/applications/SecondSuite/Plugins/PrimImporter/frmPrimImporter.resx b/applications/SecondSuite/Plugins/PrimImporter/frmPrimImporter.resx
index f469a013..2c5cf823 100644
--- a/applications/SecondSuite/Plugins/PrimImporter/frmPrimImporter.resx
+++ b/applications/SecondSuite/Plugins/PrimImporter/frmPrimImporter.resx
@@ -1,148 +1,148 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 1.3
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- False
-
-
- (Default)
-
-
- False
-
-
- False
-
-
- 8, 8
-
-
- True
-
-
- frmPrimImporter
-
-
- 80
-
-
- True
-
-
- Private
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ (Default)
+
+
+ False
+
+
+ False
+
+
+ 8, 8
+
+
+ True
+
+
+ frmPrimImporter
+
+
+ 80
+
+
+ True
+
+
+ Private
+
\ No newline at end of file
diff --git a/applications/SecondSuite/SecondSuite.csproj b/applications/SecondSuite/SecondSuite.csproj
index d727768c..d50c266a 100644
--- a/applications/SecondSuite/SecondSuite.csproj
+++ b/applications/SecondSuite/SecondSuite.csproj
@@ -1,155 +1,155 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/SecondSuite/SecondSuite.sln b/applications/SecondSuite/SecondSuite.sln
index 65c9aa0b..700c46dc 100644
--- a/applications/SecondSuite/SecondSuite.sln
+++ b/applications/SecondSuite/SecondSuite.sln
@@ -1,53 +1,53 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecondSuite", "SecondSuite.csproj", "{D1E859D8-70A6-471B-9EBF-7F5D8A4B8EFE}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecondSuiteSDK", "SecondSuiteSDK\SecondSuiteSDK.csproj", "{A1527BBD-7A90-42C6-956F-CA4FE7A7D7B7}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accountant", "Plugins\Accountant\Accountant.csproj", "{2ED068B1-3922-4044-ABEF-B51547F64A53}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrimImporter", "Plugins\PrimImporter\PrimImporter.csproj", "{1F9A11C3-5A68-4618-85CC-1BBC131EACB6}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrimBuilder", "Plugins\PrimBuilder\PrimBuilder.csproj", "{16A48BFA-9B8B-4226-ACE7-BDABADB9E62D}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {D1E859D8-70A6-471B-9EBF-7F5D8A4B8EFE}.Debug.ActiveCfg = Debug|.NET
- {D1E859D8-70A6-471B-9EBF-7F5D8A4B8EFE}.Debug.Build.0 = Debug|.NET
- {D1E859D8-70A6-471B-9EBF-7F5D8A4B8EFE}.Release.ActiveCfg = Release|.NET
- {D1E859D8-70A6-471B-9EBF-7F5D8A4B8EFE}.Release.Build.0 = Release|.NET
- {A1527BBD-7A90-42C6-956F-CA4FE7A7D7B7}.Debug.ActiveCfg = Debug|.NET
- {A1527BBD-7A90-42C6-956F-CA4FE7A7D7B7}.Debug.Build.0 = Debug|.NET
- {A1527BBD-7A90-42C6-956F-CA4FE7A7D7B7}.Release.ActiveCfg = Release|.NET
- {A1527BBD-7A90-42C6-956F-CA4FE7A7D7B7}.Release.Build.0 = Release|.NET
- {2ED068B1-3922-4044-ABEF-B51547F64A53}.Debug.ActiveCfg = Debug|.NET
- {2ED068B1-3922-4044-ABEF-B51547F64A53}.Debug.Build.0 = Debug|.NET
- {2ED068B1-3922-4044-ABEF-B51547F64A53}.Release.ActiveCfg = Release|.NET
- {2ED068B1-3922-4044-ABEF-B51547F64A53}.Release.Build.0 = Release|.NET
- {1F9A11C3-5A68-4618-85CC-1BBC131EACB6}.Debug.ActiveCfg = Debug|.NET
- {1F9A11C3-5A68-4618-85CC-1BBC131EACB6}.Debug.Build.0 = Debug|.NET
- {1F9A11C3-5A68-4618-85CC-1BBC131EACB6}.Release.ActiveCfg = Release|.NET
- {1F9A11C3-5A68-4618-85CC-1BBC131EACB6}.Release.Build.0 = Release|.NET
- {16A48BFA-9B8B-4226-ACE7-BDABADB9E62D}.Debug.ActiveCfg = Debug|.NET
- {16A48BFA-9B8B-4226-ACE7-BDABADB9E62D}.Debug.Build.0 = Debug|.NET
- {16A48BFA-9B8B-4226-ACE7-BDABADB9E62D}.Release.ActiveCfg = Release|.NET
- {16A48BFA-9B8B-4226-ACE7-BDABADB9E62D}.Release.Build.0 = Release|.NET
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecondSuite", "SecondSuite.csproj", "{D1E859D8-70A6-471B-9EBF-7F5D8A4B8EFE}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecondSuiteSDK", "SecondSuiteSDK\SecondSuiteSDK.csproj", "{A1527BBD-7A90-42C6-956F-CA4FE7A7D7B7}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accountant", "Plugins\Accountant\Accountant.csproj", "{2ED068B1-3922-4044-ABEF-B51547F64A53}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrimImporter", "Plugins\PrimImporter\PrimImporter.csproj", "{1F9A11C3-5A68-4618-85CC-1BBC131EACB6}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrimBuilder", "Plugins\PrimBuilder\PrimBuilder.csproj", "{16A48BFA-9B8B-4226-ACE7-BDABADB9E62D}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {D1E859D8-70A6-471B-9EBF-7F5D8A4B8EFE}.Debug.ActiveCfg = Debug|.NET
+ {D1E859D8-70A6-471B-9EBF-7F5D8A4B8EFE}.Debug.Build.0 = Debug|.NET
+ {D1E859D8-70A6-471B-9EBF-7F5D8A4B8EFE}.Release.ActiveCfg = Release|.NET
+ {D1E859D8-70A6-471B-9EBF-7F5D8A4B8EFE}.Release.Build.0 = Release|.NET
+ {A1527BBD-7A90-42C6-956F-CA4FE7A7D7B7}.Debug.ActiveCfg = Debug|.NET
+ {A1527BBD-7A90-42C6-956F-CA4FE7A7D7B7}.Debug.Build.0 = Debug|.NET
+ {A1527BBD-7A90-42C6-956F-CA4FE7A7D7B7}.Release.ActiveCfg = Release|.NET
+ {A1527BBD-7A90-42C6-956F-CA4FE7A7D7B7}.Release.Build.0 = Release|.NET
+ {2ED068B1-3922-4044-ABEF-B51547F64A53}.Debug.ActiveCfg = Debug|.NET
+ {2ED068B1-3922-4044-ABEF-B51547F64A53}.Debug.Build.0 = Debug|.NET
+ {2ED068B1-3922-4044-ABEF-B51547F64A53}.Release.ActiveCfg = Release|.NET
+ {2ED068B1-3922-4044-ABEF-B51547F64A53}.Release.Build.0 = Release|.NET
+ {1F9A11C3-5A68-4618-85CC-1BBC131EACB6}.Debug.ActiveCfg = Debug|.NET
+ {1F9A11C3-5A68-4618-85CC-1BBC131EACB6}.Debug.Build.0 = Debug|.NET
+ {1F9A11C3-5A68-4618-85CC-1BBC131EACB6}.Release.ActiveCfg = Release|.NET
+ {1F9A11C3-5A68-4618-85CC-1BBC131EACB6}.Release.Build.0 = Release|.NET
+ {16A48BFA-9B8B-4226-ACE7-BDABADB9E62D}.Debug.ActiveCfg = Debug|.NET
+ {16A48BFA-9B8B-4226-ACE7-BDABADB9E62D}.Debug.Build.0 = Debug|.NET
+ {16A48BFA-9B8B-4226-ACE7-BDABADB9E62D}.Release.ActiveCfg = Release|.NET
+ {16A48BFA-9B8B-4226-ACE7-BDABADB9E62D}.Release.Build.0 = Release|.NET
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/applications/SecondSuite/SecondSuiteSDK/AssemblyInfo.cs b/applications/SecondSuite/SecondSuiteSDK/AssemblyInfo.cs
index a90514f5..55d014d4 100644
--- a/applications/SecondSuite/SecondSuiteSDK/AssemblyInfo.cs
+++ b/applications/SecondSuite/SecondSuiteSDK/AssemblyInfo.cs
@@ -1,58 +1,58 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// 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("")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("1.0.0")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// 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("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.0")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/applications/SecondSuite/SecondSuiteSDK/SSPlugin.cs b/applications/SecondSuite/SecondSuiteSDK/SSPlugin.cs
index d210d2df..ba86f652 100644
--- a/applications/SecondSuite/SecondSuiteSDK/SSPlugin.cs
+++ b/applications/SecondSuite/SecondSuiteSDK/SSPlugin.cs
@@ -1,25 +1,25 @@
-using System;
-using libsecondlife;
-
-namespace SecondSuite.Plugins
-{
- public delegate void ConnectionEvent();
-
- ///
- /// A public interface for Second Suite plugins
- ///
- public interface SSPlugin
- {
- string Name{get;}
- string Author{get;}
- string Homepage{get;}
- string Description{get;}
- bool SecondLifeClient{get;}
-
- ConnectionEvent ConnectionHandler{get;}
-
- void Init(SecondLife client);
- System.Windows.Forms.Form Load();
- void Shutdown();
- }
-}
+using System;
+using libsecondlife;
+
+namespace SecondSuite.Plugins
+{
+ public delegate void ConnectionEvent();
+
+ ///
+ /// A public interface for Second Suite plugins
+ ///
+ public interface SSPlugin
+ {
+ string Name{get;}
+ string Author{get;}
+ string Homepage{get;}
+ string Description{get;}
+ bool SecondLifeClient{get;}
+
+ ConnectionEvent ConnectionHandler{get;}
+
+ void Init(SecondLife client);
+ System.Windows.Forms.Form Load();
+ void Shutdown();
+ }
+}
diff --git a/applications/SecondSuite/SecondSuiteSDK/SSPluginCollection.cs b/applications/SecondSuite/SecondSuiteSDK/SSPluginCollection.cs
index 45900f3b..5cfa6623 100644
--- a/applications/SecondSuite/SecondSuiteSDK/SSPluginCollection.cs
+++ b/applications/SecondSuite/SecondSuiteSDK/SSPluginCollection.cs
@@ -1,142 +1,142 @@
-using System;
-using System.Collections;
-
-namespace SecondSuite.Plugins
-{
- public class PluginCollection : CollectionBase
- {
- public PluginCollection()
- {
- }
-
- public PluginCollection(PluginCollection value)
- {
- this.AddRange(value);
- }
-
- public PluginCollection(SSPlugin[] value)
- {
- this.AddRange(value);
- }
-
- public SSPlugin this[int index]
- {
- get {return ((SSPlugin)(this.List[index]));}
- }
-
- public int Add(SSPlugin value)
- {
- return this.List.Add(value);
- }
-
- public void AddRange(SSPlugin[] value)
- {
- for (int i = 0; (i < value.Length); i = (i + 1))
- {
- this.Add(value[i]);
- }
- }
-
- public void AddRange(PluginCollection value)
- {
- for (int i = 0; (i < value.Count); i = (i + 1))
- {
- this.Add((SSPlugin)value.List[i]);
- }
- }
-
- public bool Contains(SSPlugin value)
- {
- return this.List.Contains(value);
- }
-
- public void CopyTo(SSPlugin[] array, int index)
- {
- this.List.CopyTo(array, index);
- }
-
- public SSPlugin[] ToArray()
- {
- SSPlugin[] array = new SSPlugin[this.Count];
- this.CopyTo(array, 0);
-
- return array;
- }
-
- public int IndexOf(SSPlugin value)
- {
- return this.List.IndexOf(value);
- }
-
- public void Insert(int index, SSPlugin value)
- {
- List.Insert(index, value);
- }
-
- public void Remove(SSPlugin value)
- {
- List.Remove(value);
- }
-
- public new PluginCollectionEnumerator GetEnumerator()
- {
- return new PluginCollectionEnumerator(this);
- }
-
- public class PluginCollectionEnumerator : IEnumerator
- {
- private IEnumerator _enumerator;
- private IEnumerable _temp;
-
- ///
- /// Initializes a new instance of the PluginCollectionEnumerator class referencing the specified PluginCollection object.
- ///
- /// The PluginCollection to enumerate.
- public PluginCollectionEnumerator(PluginCollection mappings)
- {
- _temp = ((IEnumerable)(mappings));
- _enumerator = _temp.GetEnumerator();
- }
-
- ///
- /// Gets the current element in the collection.
- ///
- public SSPlugin Current
- {
- get {return ((SSPlugin)(_enumerator.Current));}
- }
-
- object IEnumerator.Current
- {
- get {return _enumerator.Current;}
- }
-
- ///
- /// Advances the enumerator to the next element of the collection.
- ///
- /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
- public bool MoveNext()
- {
- return _enumerator.MoveNext();
- }
-
- bool IEnumerator.MoveNext()
- {
- return _enumerator.MoveNext();
- }
-
- ///
- /// Sets the enumerator to its initial position, which is before the first element in the collection.
- ///
- public void Reset()
- {
- _enumerator.Reset();
- }
-
- void IEnumerator.Reset()
- {
- _enumerator.Reset();
- }
- }
- }
-}
+using System;
+using System.Collections;
+
+namespace SecondSuite.Plugins
+{
+ public class PluginCollection : CollectionBase
+ {
+ public PluginCollection()
+ {
+ }
+
+ public PluginCollection(PluginCollection value)
+ {
+ this.AddRange(value);
+ }
+
+ public PluginCollection(SSPlugin[] value)
+ {
+ this.AddRange(value);
+ }
+
+ public SSPlugin this[int index]
+ {
+ get {return ((SSPlugin)(this.List[index]));}
+ }
+
+ public int Add(SSPlugin value)
+ {
+ return this.List.Add(value);
+ }
+
+ public void AddRange(SSPlugin[] value)
+ {
+ for (int i = 0; (i < value.Length); i = (i + 1))
+ {
+ this.Add(value[i]);
+ }
+ }
+
+ public void AddRange(PluginCollection value)
+ {
+ for (int i = 0; (i < value.Count); i = (i + 1))
+ {
+ this.Add((SSPlugin)value.List[i]);
+ }
+ }
+
+ public bool Contains(SSPlugin value)
+ {
+ return this.List.Contains(value);
+ }
+
+ public void CopyTo(SSPlugin[] array, int index)
+ {
+ this.List.CopyTo(array, index);
+ }
+
+ public SSPlugin[] ToArray()
+ {
+ SSPlugin[] array = new SSPlugin[this.Count];
+ this.CopyTo(array, 0);
+
+ return array;
+ }
+
+ public int IndexOf(SSPlugin value)
+ {
+ return this.List.IndexOf(value);
+ }
+
+ public void Insert(int index, SSPlugin value)
+ {
+ List.Insert(index, value);
+ }
+
+ public void Remove(SSPlugin value)
+ {
+ List.Remove(value);
+ }
+
+ public new PluginCollectionEnumerator GetEnumerator()
+ {
+ return new PluginCollectionEnumerator(this);
+ }
+
+ public class PluginCollectionEnumerator : IEnumerator
+ {
+ private IEnumerator _enumerator;
+ private IEnumerable _temp;
+
+ ///
+ /// Initializes a new instance of the PluginCollectionEnumerator class referencing the specified PluginCollection object.
+ ///
+ /// The PluginCollection to enumerate.
+ public PluginCollectionEnumerator(PluginCollection mappings)
+ {
+ _temp = ((IEnumerable)(mappings));
+ _enumerator = _temp.GetEnumerator();
+ }
+
+ ///
+ /// Gets the current element in the collection.
+ ///
+ public SSPlugin Current
+ {
+ get {return ((SSPlugin)(_enumerator.Current));}
+ }
+
+ object IEnumerator.Current
+ {
+ get {return _enumerator.Current;}
+ }
+
+ ///
+ /// Advances the enumerator to the next element of the collection.
+ ///
+ /// true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.
+ public bool MoveNext()
+ {
+ return _enumerator.MoveNext();
+ }
+
+ bool IEnumerator.MoveNext()
+ {
+ return _enumerator.MoveNext();
+ }
+
+ ///
+ /// Sets the enumerator to its initial position, which is before the first element in the collection.
+ ///
+ public void Reset()
+ {
+ _enumerator.Reset();
+ }
+
+ void IEnumerator.Reset()
+ {
+ _enumerator.Reset();
+ }
+ }
+ }
+}
diff --git a/applications/SecondSuite/SecondSuiteSDK/SSPluginContext.cs b/applications/SecondSuite/SecondSuiteSDK/SSPluginContext.cs
index 17586844..f00d1c3d 100644
--- a/applications/SecondSuite/SecondSuiteSDK/SSPluginContext.cs
+++ b/applications/SecondSuite/SecondSuiteSDK/SSPluginContext.cs
@@ -1,12 +1,12 @@
-using System;
-
-namespace SecondSuite.Plugins
-{
- ///
- /// A public interface used to pass context to plugins
- ///
- public interface SSPluginContext
- {
- //string CurrentDocumentText{get;set;}
- }
-}
+using System;
+
+namespace SecondSuite.Plugins
+{
+ ///
+ /// A public interface used to pass context to plugins
+ ///
+ public interface SSPluginContext
+ {
+ //string CurrentDocumentText{get;set;}
+ }
+}
diff --git a/applications/SecondSuite/SecondSuiteSDK/SecondSuiteSDK.csproj b/applications/SecondSuite/SecondSuiteSDK/SecondSuiteSDK.csproj
index 1a8c9e3a..a57c4419 100644
--- a/applications/SecondSuite/SecondSuiteSDK/SecondSuiteSDK.csproj
+++ b/applications/SecondSuite/SecondSuiteSDK/SecondSuiteSDK.csproj
@@ -1,121 +1,121 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/SecondSuite/frmLogin.cs b/applications/SecondSuite/frmLogin.cs
index 01d64b4c..fa03decb 100644
--- a/applications/SecondSuite/frmLogin.cs
+++ b/applications/SecondSuite/frmLogin.cs
@@ -1,259 +1,259 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-using SecondSuite.Plugins;
-using libsecondlife;
-
-namespace SecondSuite
-{
- ///
- /// Summary description for frmLogin.
- ///
- public class frmLogin : System.Windows.Forms.Form
- {
- private System.Windows.Forms.GroupBox grpLogin;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.TextBox txtPassword;
- private System.Windows.Forms.TextBox txtLastName;
- private System.Windows.Forms.Button cmdConnect;
- private System.Windows.Forms.TextBox txtFirstName;
- public System.Windows.Forms.ListBox lstAvatars;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Button cmdSelect;
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.Container components = null;
-
- //
- private frmSecondSuite SecondSuite;
- private SSPlugin Plugin;
-
- public frmLogin(frmSecondSuite secondSuite, SSPlugin plugin)
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- SecondSuite = secondSuite;
- Plugin = plugin;
- }
-
- ///
- /// Clean up any resources being used.
- ///
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.grpLogin = new System.Windows.Forms.GroupBox();
- this.label3 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.txtPassword = new System.Windows.Forms.TextBox();
- this.txtLastName = new System.Windows.Forms.TextBox();
- this.cmdConnect = new System.Windows.Forms.Button();
- this.txtFirstName = new System.Windows.Forms.TextBox();
- this.lstAvatars = new System.Windows.Forms.ListBox();
- this.label4 = new System.Windows.Forms.Label();
- this.cmdSelect = new System.Windows.Forms.Button();
- this.grpLogin.SuspendLayout();
- this.SuspendLayout();
- //
- // grpLogin
- //
- this.grpLogin.Controls.Add(this.label3);
- this.grpLogin.Controls.Add(this.label2);
- this.grpLogin.Controls.Add(this.label1);
- this.grpLogin.Controls.Add(this.txtPassword);
- this.grpLogin.Controls.Add(this.txtLastName);
- this.grpLogin.Controls.Add(this.cmdConnect);
- this.grpLogin.Controls.Add(this.txtFirstName);
- this.grpLogin.Location = new System.Drawing.Point(16, 304);
- this.grpLogin.Name = "grpLogin";
- this.grpLogin.Size = new System.Drawing.Size(552, 80);
- this.grpLogin.TabIndex = 51;
- this.grpLogin.TabStop = false;
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(280, 24);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(120, 16);
- this.label3.TabIndex = 50;
- this.label3.Text = "Password";
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(152, 24);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(120, 16);
- this.label2.TabIndex = 50;
- this.label2.Text = "Last Name";
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(16, 24);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(120, 16);
- this.label1.TabIndex = 50;
- this.label1.Text = "First Name";
- //
- // txtPassword
- //
- this.txtPassword.Location = new System.Drawing.Point(280, 40);
- this.txtPassword.Name = "txtPassword";
- this.txtPassword.PasswordChar = '*';
- this.txtPassword.Size = new System.Drawing.Size(120, 20);
- this.txtPassword.TabIndex = 2;
- this.txtPassword.Text = "";
- //
- // txtLastName
- //
- this.txtLastName.Location = new System.Drawing.Point(152, 40);
- this.txtLastName.Name = "txtLastName";
- this.txtLastName.Size = new System.Drawing.Size(112, 20);
- this.txtLastName.TabIndex = 1;
- this.txtLastName.Text = "";
- //
- // cmdConnect
- //
- this.cmdConnect.Location = new System.Drawing.Point(416, 40);
- this.cmdConnect.Name = "cmdConnect";
- this.cmdConnect.Size = new System.Drawing.Size(120, 24);
- this.cmdConnect.TabIndex = 3;
- this.cmdConnect.Text = "Connect";
- this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
- //
- // txtFirstName
- //
- this.txtFirstName.Location = new System.Drawing.Point(16, 40);
- this.txtFirstName.Name = "txtFirstName";
- this.txtFirstName.Size = new System.Drawing.Size(120, 20);
- this.txtFirstName.TabIndex = 0;
- this.txtFirstName.Text = "";
- //
- // lstAvatars
- //
- this.lstAvatars.Location = new System.Drawing.Point(16, 40);
- this.lstAvatars.Name = "lstAvatars";
- this.lstAvatars.Size = new System.Drawing.Size(216, 225);
- this.lstAvatars.TabIndex = 52;
- //
- // label4
- //
- this.label4.Location = new System.Drawing.Point(16, 16);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(216, 16);
- this.label4.TabIndex = 53;
- this.label4.Text = "Logged in Avatars:";
- //
- // cmdSelect
- //
- this.cmdSelect.Enabled = false;
- this.cmdSelect.Location = new System.Drawing.Point(112, 272);
- this.cmdSelect.Name = "cmdSelect";
- this.cmdSelect.Size = new System.Drawing.Size(120, 24);
- this.cmdSelect.TabIndex = 54;
- this.cmdSelect.Text = "Select";
- this.cmdSelect.Click += new System.EventHandler(this.cmdSelect_Click);
- //
- // frmLogin
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(584, 397);
- this.Controls.Add(this.cmdSelect);
- this.Controls.Add(this.label4);
- this.Controls.Add(this.lstAvatars);
- this.Controls.Add(this.grpLogin);
- this.MaximizeBox = false;
- this.MaximumSize = new System.Drawing.Size(592, 424);
- this.MinimizeBox = false;
- this.MinimumSize = new System.Drawing.Size(592, 424);
- this.Name = "frmLogin";
- this.ShowInTaskbar = false;
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
- this.Text = "New Plugin Connection";
- this.grpLogin.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private void cmdConnect_Click(object sender, System.EventArgs e)
- {
- SecondLife client = null;
-
- cmdConnect.Enabled = false;
- cmdSelect.Enabled = false;
-
- try
- {
- client = new SecondLife("keywords.txt", "message_template.msg");
- }
- catch (Exception error)
- {
- MessageBox.Show(this, error.ToString());
- this.Close();
- }
-
- // Initialize the plugin, to allow it to register callbacks and get ready
- Plugin.Init(client);
-
- Hashtable loginParams = NetworkManager.DefaultLoginValues(txtFirstName.Text,
- txtLastName.Text, txtPassword.Text, "00:00:00:00:00:00", "last", 1, 10, 10, 0,
- "Win", "0", "accountant", "jhurliman@wsu.edu");
-
- if (client.Network.Login(loginParams))
- {
- // Register this logged in avatar
- SecondSuite.AddClient(client);
-
- // Show the plugin form
- Form form = Plugin.Load();
- form.MdiParent = SecondSuite;
- form.Show();
-
- Plugin.ConnectionHandler();
-
- // Exit this form
- this.Close();
- }
- else
- {
- // Show an error
- MessageBox.Show(this, "Error logging in: " + client.Network.LoginError);
- cmdConnect.Enabled = true;
- cmdSelect.Enabled = true;
- }
- }
-
- private void cmdSelect_Click(object sender, System.EventArgs e)
- {
- cmdConnect.Enabled = false;
- cmdSelect.Enabled = false;
-
- // FIXME
- }
- }
-}
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using SecondSuite.Plugins;
+using libsecondlife;
+
+namespace SecondSuite
+{
+ ///
+ /// Summary description for frmLogin.
+ ///
+ public class frmLogin : System.Windows.Forms.Form
+ {
+ private System.Windows.Forms.GroupBox grpLogin;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtPassword;
+ private System.Windows.Forms.TextBox txtLastName;
+ private System.Windows.Forms.Button cmdConnect;
+ private System.Windows.Forms.TextBox txtFirstName;
+ public System.Windows.Forms.ListBox lstAvatars;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Button cmdSelect;
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.Container components = null;
+
+ //
+ private frmSecondSuite SecondSuite;
+ private SSPlugin Plugin;
+
+ public frmLogin(frmSecondSuite secondSuite, SSPlugin plugin)
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ SecondSuite = secondSuite;
+ Plugin = plugin;
+ }
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if(components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.grpLogin = new System.Windows.Forms.GroupBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtPassword = new System.Windows.Forms.TextBox();
+ this.txtLastName = new System.Windows.Forms.TextBox();
+ this.cmdConnect = new System.Windows.Forms.Button();
+ this.txtFirstName = new System.Windows.Forms.TextBox();
+ this.lstAvatars = new System.Windows.Forms.ListBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.cmdSelect = new System.Windows.Forms.Button();
+ this.grpLogin.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // grpLogin
+ //
+ this.grpLogin.Controls.Add(this.label3);
+ this.grpLogin.Controls.Add(this.label2);
+ this.grpLogin.Controls.Add(this.label1);
+ this.grpLogin.Controls.Add(this.txtPassword);
+ this.grpLogin.Controls.Add(this.txtLastName);
+ this.grpLogin.Controls.Add(this.cmdConnect);
+ this.grpLogin.Controls.Add(this.txtFirstName);
+ this.grpLogin.Location = new System.Drawing.Point(16, 304);
+ this.grpLogin.Name = "grpLogin";
+ this.grpLogin.Size = new System.Drawing.Size(552, 80);
+ this.grpLogin.TabIndex = 51;
+ this.grpLogin.TabStop = false;
+ //
+ // label3
+ //
+ this.label3.Location = new System.Drawing.Point(280, 24);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(120, 16);
+ this.label3.TabIndex = 50;
+ this.label3.Text = "Password";
+ //
+ // label2
+ //
+ this.label2.Location = new System.Drawing.Point(152, 24);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(120, 16);
+ this.label2.TabIndex = 50;
+ this.label2.Text = "Last Name";
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(16, 24);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(120, 16);
+ this.label1.TabIndex = 50;
+ this.label1.Text = "First Name";
+ //
+ // txtPassword
+ //
+ this.txtPassword.Location = new System.Drawing.Point(280, 40);
+ this.txtPassword.Name = "txtPassword";
+ this.txtPassword.PasswordChar = '*';
+ this.txtPassword.Size = new System.Drawing.Size(120, 20);
+ this.txtPassword.TabIndex = 2;
+ this.txtPassword.Text = "";
+ //
+ // txtLastName
+ //
+ this.txtLastName.Location = new System.Drawing.Point(152, 40);
+ this.txtLastName.Name = "txtLastName";
+ this.txtLastName.Size = new System.Drawing.Size(112, 20);
+ this.txtLastName.TabIndex = 1;
+ this.txtLastName.Text = "";
+ //
+ // cmdConnect
+ //
+ this.cmdConnect.Location = new System.Drawing.Point(416, 40);
+ this.cmdConnect.Name = "cmdConnect";
+ this.cmdConnect.Size = new System.Drawing.Size(120, 24);
+ this.cmdConnect.TabIndex = 3;
+ this.cmdConnect.Text = "Connect";
+ this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
+ //
+ // txtFirstName
+ //
+ this.txtFirstName.Location = new System.Drawing.Point(16, 40);
+ this.txtFirstName.Name = "txtFirstName";
+ this.txtFirstName.Size = new System.Drawing.Size(120, 20);
+ this.txtFirstName.TabIndex = 0;
+ this.txtFirstName.Text = "";
+ //
+ // lstAvatars
+ //
+ this.lstAvatars.Location = new System.Drawing.Point(16, 40);
+ this.lstAvatars.Name = "lstAvatars";
+ this.lstAvatars.Size = new System.Drawing.Size(216, 225);
+ this.lstAvatars.TabIndex = 52;
+ //
+ // label4
+ //
+ this.label4.Location = new System.Drawing.Point(16, 16);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(216, 16);
+ this.label4.TabIndex = 53;
+ this.label4.Text = "Logged in Avatars:";
+ //
+ // cmdSelect
+ //
+ this.cmdSelect.Enabled = false;
+ this.cmdSelect.Location = new System.Drawing.Point(112, 272);
+ this.cmdSelect.Name = "cmdSelect";
+ this.cmdSelect.Size = new System.Drawing.Size(120, 24);
+ this.cmdSelect.TabIndex = 54;
+ this.cmdSelect.Text = "Select";
+ this.cmdSelect.Click += new System.EventHandler(this.cmdSelect_Click);
+ //
+ // frmLogin
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(584, 397);
+ this.Controls.Add(this.cmdSelect);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.lstAvatars);
+ this.Controls.Add(this.grpLogin);
+ this.MaximizeBox = false;
+ this.MaximumSize = new System.Drawing.Size(592, 424);
+ this.MinimizeBox = false;
+ this.MinimumSize = new System.Drawing.Size(592, 424);
+ this.Name = "frmLogin";
+ this.ShowInTaskbar = false;
+ this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+ this.Text = "New Plugin Connection";
+ this.grpLogin.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ private void cmdConnect_Click(object sender, System.EventArgs e)
+ {
+ SecondLife client = null;
+
+ cmdConnect.Enabled = false;
+ cmdSelect.Enabled = false;
+
+ try
+ {
+ client = new SecondLife("keywords.txt", "message_template.msg");
+ }
+ catch (Exception error)
+ {
+ MessageBox.Show(this, error.ToString());
+ this.Close();
+ }
+
+ // Initialize the plugin, to allow it to register callbacks and get ready
+ Plugin.Init(client);
+
+ Hashtable loginParams = NetworkManager.DefaultLoginValues(txtFirstName.Text,
+ txtLastName.Text, txtPassword.Text, "00:00:00:00:00:00", "last", 1, 10, 10, 0,
+ "Win", "0", "accountant", "jhurliman@wsu.edu");
+
+ if (client.Network.Login(loginParams))
+ {
+ // Register this logged in avatar
+ SecondSuite.AddClient(client);
+
+ // Show the plugin form
+ Form form = Plugin.Load();
+ form.MdiParent = SecondSuite;
+ form.Show();
+
+ Plugin.ConnectionHandler();
+
+ // Exit this form
+ this.Close();
+ }
+ else
+ {
+ // Show an error
+ MessageBox.Show(this, "Error logging in: " + client.Network.LoginError);
+ cmdConnect.Enabled = true;
+ cmdSelect.Enabled = true;
+ }
+ }
+
+ private void cmdSelect_Click(object sender, System.EventArgs e)
+ {
+ cmdConnect.Enabled = false;
+ cmdSelect.Enabled = false;
+
+ // FIXME
+ }
+ }
+}
diff --git a/applications/SecondSuite/frmLogin.resx b/applications/SecondSuite/frmLogin.resx
index 6b3489e1..ebb7527b 100644
--- a/applications/SecondSuite/frmLogin.resx
+++ b/applications/SecondSuite/frmLogin.resx
@@ -1,238 +1,238 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 1.3
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Private
-
-
- 8, 8
-
-
- True
-
-
- False
-
-
- True
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Public
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- (Default)
-
-
- False
-
-
- frmLogin
-
-
- False
-
-
- 8, 8
-
-
- True
-
-
- 80
-
-
- True
-
-
- Private
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Private
+
+
+ 8, 8
+
+
+ True
+
+
+ False
+
+
+ True
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Public
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ (Default)
+
+
+ False
+
+
+ frmLogin
+
+
+ False
+
+
+ 8, 8
+
+
+ True
+
+
+ 80
+
+
+ True
+
+
+ Private
+
\ No newline at end of file
diff --git a/applications/SecondSuite/frmOverview.cs b/applications/SecondSuite/frmOverview.cs
index f2d18a35..2c8d001a 100644
--- a/applications/SecondSuite/frmOverview.cs
+++ b/applications/SecondSuite/frmOverview.cs
@@ -1,281 +1,281 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-using SecondSuite.Plugins;
-using libsecondlife;
-
-namespace SecondSuite
-{
- ///
- /// Summary description for frmOverview.
- ///
- public class frmOverview : System.Windows.Forms.Form
- {
- private System.Windows.Forms.ListBox lstAvatars;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
- public System.Windows.Forms.ListBox lstPlugins;
- private System.Windows.Forms.GroupBox framePluginInfo;
- private System.Windows.Forms.Label lblDescription;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Label lblAuthor;
- private System.Windows.Forms.LinkLabel lblHomepage;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Button cmdNewInstance;
- private System.Windows.Forms.Button cmdDisconnect;
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.Container components = null;
-
- //
- private frmSecondSuite SecondSuite;
-
- public frmOverview(frmSecondSuite secondSuite)
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- SecondSuite = secondSuite;
- }
-
- ///
- /// Clean up any resources being used.
- ///
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.lstAvatars = new System.Windows.Forms.ListBox();
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.lstPlugins = new System.Windows.Forms.ListBox();
- this.framePluginInfo = new System.Windows.Forms.GroupBox();
- this.label7 = new System.Windows.Forms.Label();
- this.lblHomepage = new System.Windows.Forms.LinkLabel();
- this.lblAuthor = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.lblDescription = new System.Windows.Forms.Label();
- this.cmdNewInstance = new System.Windows.Forms.Button();
- this.cmdDisconnect = new System.Windows.Forms.Button();
- this.framePluginInfo.SuspendLayout();
- this.SuspendLayout();
- //
- // lstAvatars
- //
- this.lstAvatars.Location = new System.Drawing.Point(16, 40);
- this.lstAvatars.Name = "lstAvatars";
- this.lstAvatars.Size = new System.Drawing.Size(184, 277);
- this.lstAvatars.TabIndex = 0;
- this.lstAvatars.SelectedIndexChanged += new System.EventHandler(this.lstAvatars_SelectedIndexChanged);
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(16, 16);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(184, 16);
- this.label1.TabIndex = 1;
- this.label1.Text = "Online Avatars";
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(208, 16);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(184, 16);
- this.label2.TabIndex = 3;
- this.label2.Text = "Loaded Plugins";
- //
- // lstPlugins
- //
- this.lstPlugins.Location = new System.Drawing.Point(208, 40);
- this.lstPlugins.Name = "lstPlugins";
- this.lstPlugins.Size = new System.Drawing.Size(184, 277);
- this.lstPlugins.TabIndex = 2;
- this.lstPlugins.SelectedIndexChanged += new System.EventHandler(this.lstPlugins_SelectedIndexChanged);
- //
- // framePluginInfo
- //
- this.framePluginInfo.Controls.Add(this.label7);
- this.framePluginInfo.Controls.Add(this.lblHomepage);
- this.framePluginInfo.Controls.Add(this.lblAuthor);
- this.framePluginInfo.Controls.Add(this.label5);
- this.framePluginInfo.Controls.Add(this.label4);
- this.framePluginInfo.Controls.Add(this.lblDescription);
- this.framePluginInfo.Location = new System.Drawing.Point(400, 32);
- this.framePluginInfo.Name = "framePluginInfo";
- this.framePluginInfo.Size = new System.Drawing.Size(288, 288);
- this.framePluginInfo.TabIndex = 4;
- this.framePluginInfo.TabStop = false;
- this.framePluginInfo.Text = "Plugin Information";
- //
- // label7
- //
- this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.label7.Location = new System.Drawing.Point(8, 120);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(88, 16);
- this.label7.TabIndex = 5;
- this.label7.Text = "Description:";
- //
- // lblHomepage
- //
- this.lblHomepage.Location = new System.Drawing.Point(8, 96);
- this.lblHomepage.Name = "lblHomepage";
- this.lblHomepage.Size = new System.Drawing.Size(272, 16);
- this.lblHomepage.TabIndex = 4;
- //
- // lblAuthor
- //
- this.lblAuthor.Location = new System.Drawing.Point(8, 48);
- this.lblAuthor.Name = "lblAuthor";
- this.lblAuthor.Size = new System.Drawing.Size(272, 16);
- this.lblAuthor.TabIndex = 3;
- //
- // label5
- //
- this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.label5.Location = new System.Drawing.Point(8, 72);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(88, 16);
- this.label5.TabIndex = 2;
- this.label5.Text = "Homepage:";
- //
- // label4
- //
- this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
- this.label4.Location = new System.Drawing.Point(8, 24);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(88, 16);
- this.label4.TabIndex = 1;
- this.label4.Text = "Author:";
- //
- // lblDescription
- //
- this.lblDescription.Location = new System.Drawing.Point(8, 144);
- this.lblDescription.Name = "lblDescription";
- this.lblDescription.Size = new System.Drawing.Size(272, 136);
- this.lblDescription.TabIndex = 0;
- //
- // cmdNewInstance
- //
- this.cmdNewInstance.Enabled = false;
- this.cmdNewInstance.Location = new System.Drawing.Point(280, 328);
- this.cmdNewInstance.Name = "cmdNewInstance";
- this.cmdNewInstance.Size = new System.Drawing.Size(112, 24);
- this.cmdNewInstance.TabIndex = 5;
- this.cmdNewInstance.Text = "New Instance";
- this.cmdNewInstance.Click += new System.EventHandler(this.cmdNewInstance_Click);
- //
- // cmdDisconnect
- //
- this.cmdDisconnect.Enabled = false;
- this.cmdDisconnect.Location = new System.Drawing.Point(88, 328);
- this.cmdDisconnect.Name = "cmdDisconnect";
- this.cmdDisconnect.Size = new System.Drawing.Size(112, 24);
- this.cmdDisconnect.TabIndex = 6;
- this.cmdDisconnect.Text = "Disconnect";
- this.cmdDisconnect.Click += new System.EventHandler(this.cmdDisconnect_Click);
- //
- // frmOverview
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(704, 365);
- this.ControlBox = false;
- this.Controls.Add(this.cmdDisconnect);
- this.Controls.Add(this.cmdNewInstance);
- this.Controls.Add(this.framePluginInfo);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.lstPlugins);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.lstAvatars);
- this.MaximizeBox = false;
- this.MaximumSize = new System.Drawing.Size(712, 392);
- this.MinimumSize = new System.Drawing.Size(712, 392);
- this.Name = "frmOverview";
- this.ShowInTaskbar = false;
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
- this.Text = "Overview";
- this.Load += new System.EventHandler(this.frmOverview_Load);
- this.framePluginInfo.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private void frmOverview_Load(object sender, System.EventArgs e)
- {
- }
-
- public void ClientAdded(SecondLife client)
- {
- lstAvatars.Items.Add(client);
- }
-
- public void ClientRemoved(SecondLife client)
- {
- lstAvatars.Items.Remove(client);
-
- if (lstAvatars.SelectedIndex == -1)
- {
- cmdDisconnect.Enabled = false;
- }
- }
-
- private void lstPlugins_SelectedIndexChanged(object sender, System.EventArgs e)
- {
- SSPlugin plugin = (SSPlugin)lstPlugins.Items[lstPlugins.SelectedIndex];
- lblAuthor.Text = plugin.Author;
- lblHomepage.Text = plugin.Homepage;
- lblDescription.Text = plugin.Description;
-
- cmdNewInstance.Enabled = true;
- }
-
- private void cmdNewInstance_Click(object sender, System.EventArgs e)
- {
- SSPlugin plugin = (SSPlugin)lstPlugins.Items[lstPlugins.SelectedIndex];
-
- frmLogin login = new frmLogin(SecondSuite, plugin);
- login.ShowDialog(this);
- }
-
- private void cmdDisconnect_Click(object sender, System.EventArgs e)
- {
- if (lstAvatars.SelectedIndex >=0)
- {
- SecondSuite.RemoveClient((SecondLife)lstAvatars.Items[lstAvatars.SelectedIndex]);
- }
-
- if (lstAvatars.SelectedIndex == -1)
- {
- cmdDisconnect.Enabled = false;
- }
- }
-
- private void lstAvatars_SelectedIndexChanged(object sender, System.EventArgs e)
- {
- cmdDisconnect.Enabled = true;
- }
- }
-}
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using SecondSuite.Plugins;
+using libsecondlife;
+
+namespace SecondSuite
+{
+ ///
+ /// Summary description for frmOverview.
+ ///
+ public class frmOverview : System.Windows.Forms.Form
+ {
+ private System.Windows.Forms.ListBox lstAvatars;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ public System.Windows.Forms.ListBox lstPlugins;
+ private System.Windows.Forms.GroupBox framePluginInfo;
+ private System.Windows.Forms.Label lblDescription;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Label lblAuthor;
+ private System.Windows.Forms.LinkLabel lblHomepage;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.Button cmdNewInstance;
+ private System.Windows.Forms.Button cmdDisconnect;
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.Container components = null;
+
+ //
+ private frmSecondSuite SecondSuite;
+
+ public frmOverview(frmSecondSuite secondSuite)
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ SecondSuite = secondSuite;
+ }
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if(components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.lstAvatars = new System.Windows.Forms.ListBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.lstPlugins = new System.Windows.Forms.ListBox();
+ this.framePluginInfo = new System.Windows.Forms.GroupBox();
+ this.label7 = new System.Windows.Forms.Label();
+ this.lblHomepage = new System.Windows.Forms.LinkLabel();
+ this.lblAuthor = new System.Windows.Forms.Label();
+ this.label5 = new System.Windows.Forms.Label();
+ this.label4 = new System.Windows.Forms.Label();
+ this.lblDescription = new System.Windows.Forms.Label();
+ this.cmdNewInstance = new System.Windows.Forms.Button();
+ this.cmdDisconnect = new System.Windows.Forms.Button();
+ this.framePluginInfo.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // lstAvatars
+ //
+ this.lstAvatars.Location = new System.Drawing.Point(16, 40);
+ this.lstAvatars.Name = "lstAvatars";
+ this.lstAvatars.Size = new System.Drawing.Size(184, 277);
+ this.lstAvatars.TabIndex = 0;
+ this.lstAvatars.SelectedIndexChanged += new System.EventHandler(this.lstAvatars_SelectedIndexChanged);
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(16, 16);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(184, 16);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "Online Avatars";
+ //
+ // label2
+ //
+ this.label2.Location = new System.Drawing.Point(208, 16);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(184, 16);
+ this.label2.TabIndex = 3;
+ this.label2.Text = "Loaded Plugins";
+ //
+ // lstPlugins
+ //
+ this.lstPlugins.Location = new System.Drawing.Point(208, 40);
+ this.lstPlugins.Name = "lstPlugins";
+ this.lstPlugins.Size = new System.Drawing.Size(184, 277);
+ this.lstPlugins.TabIndex = 2;
+ this.lstPlugins.SelectedIndexChanged += new System.EventHandler(this.lstPlugins_SelectedIndexChanged);
+ //
+ // framePluginInfo
+ //
+ this.framePluginInfo.Controls.Add(this.label7);
+ this.framePluginInfo.Controls.Add(this.lblHomepage);
+ this.framePluginInfo.Controls.Add(this.lblAuthor);
+ this.framePluginInfo.Controls.Add(this.label5);
+ this.framePluginInfo.Controls.Add(this.label4);
+ this.framePluginInfo.Controls.Add(this.lblDescription);
+ this.framePluginInfo.Location = new System.Drawing.Point(400, 32);
+ this.framePluginInfo.Name = "framePluginInfo";
+ this.framePluginInfo.Size = new System.Drawing.Size(288, 288);
+ this.framePluginInfo.TabIndex = 4;
+ this.framePluginInfo.TabStop = false;
+ this.framePluginInfo.Text = "Plugin Information";
+ //
+ // label7
+ //
+ this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+ this.label7.Location = new System.Drawing.Point(8, 120);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(88, 16);
+ this.label7.TabIndex = 5;
+ this.label7.Text = "Description:";
+ //
+ // lblHomepage
+ //
+ this.lblHomepage.Location = new System.Drawing.Point(8, 96);
+ this.lblHomepage.Name = "lblHomepage";
+ this.lblHomepage.Size = new System.Drawing.Size(272, 16);
+ this.lblHomepage.TabIndex = 4;
+ //
+ // lblAuthor
+ //
+ this.lblAuthor.Location = new System.Drawing.Point(8, 48);
+ this.lblAuthor.Name = "lblAuthor";
+ this.lblAuthor.Size = new System.Drawing.Size(272, 16);
+ this.lblAuthor.TabIndex = 3;
+ //
+ // label5
+ //
+ this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+ this.label5.Location = new System.Drawing.Point(8, 72);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(88, 16);
+ this.label5.TabIndex = 2;
+ this.label5.Text = "Homepage:";
+ //
+ // label4
+ //
+ this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+ this.label4.Location = new System.Drawing.Point(8, 24);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(88, 16);
+ this.label4.TabIndex = 1;
+ this.label4.Text = "Author:";
+ //
+ // lblDescription
+ //
+ this.lblDescription.Location = new System.Drawing.Point(8, 144);
+ this.lblDescription.Name = "lblDescription";
+ this.lblDescription.Size = new System.Drawing.Size(272, 136);
+ this.lblDescription.TabIndex = 0;
+ //
+ // cmdNewInstance
+ //
+ this.cmdNewInstance.Enabled = false;
+ this.cmdNewInstance.Location = new System.Drawing.Point(280, 328);
+ this.cmdNewInstance.Name = "cmdNewInstance";
+ this.cmdNewInstance.Size = new System.Drawing.Size(112, 24);
+ this.cmdNewInstance.TabIndex = 5;
+ this.cmdNewInstance.Text = "New Instance";
+ this.cmdNewInstance.Click += new System.EventHandler(this.cmdNewInstance_Click);
+ //
+ // cmdDisconnect
+ //
+ this.cmdDisconnect.Enabled = false;
+ this.cmdDisconnect.Location = new System.Drawing.Point(88, 328);
+ this.cmdDisconnect.Name = "cmdDisconnect";
+ this.cmdDisconnect.Size = new System.Drawing.Size(112, 24);
+ this.cmdDisconnect.TabIndex = 6;
+ this.cmdDisconnect.Text = "Disconnect";
+ this.cmdDisconnect.Click += new System.EventHandler(this.cmdDisconnect_Click);
+ //
+ // frmOverview
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(704, 365);
+ this.ControlBox = false;
+ this.Controls.Add(this.cmdDisconnect);
+ this.Controls.Add(this.cmdNewInstance);
+ this.Controls.Add(this.framePluginInfo);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.lstPlugins);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.lstAvatars);
+ this.MaximizeBox = false;
+ this.MaximumSize = new System.Drawing.Size(712, 392);
+ this.MinimumSize = new System.Drawing.Size(712, 392);
+ this.Name = "frmOverview";
+ this.ShowInTaskbar = false;
+ this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+ this.Text = "Overview";
+ this.Load += new System.EventHandler(this.frmOverview_Load);
+ this.framePluginInfo.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ private void frmOverview_Load(object sender, System.EventArgs e)
+ {
+ }
+
+ public void ClientAdded(SecondLife client)
+ {
+ lstAvatars.Items.Add(client);
+ }
+
+ public void ClientRemoved(SecondLife client)
+ {
+ lstAvatars.Items.Remove(client);
+
+ if (lstAvatars.SelectedIndex == -1)
+ {
+ cmdDisconnect.Enabled = false;
+ }
+ }
+
+ private void lstPlugins_SelectedIndexChanged(object sender, System.EventArgs e)
+ {
+ SSPlugin plugin = (SSPlugin)lstPlugins.Items[lstPlugins.SelectedIndex];
+ lblAuthor.Text = plugin.Author;
+ lblHomepage.Text = plugin.Homepage;
+ lblDescription.Text = plugin.Description;
+
+ cmdNewInstance.Enabled = true;
+ }
+
+ private void cmdNewInstance_Click(object sender, System.EventArgs e)
+ {
+ SSPlugin plugin = (SSPlugin)lstPlugins.Items[lstPlugins.SelectedIndex];
+
+ frmLogin login = new frmLogin(SecondSuite, plugin);
+ login.ShowDialog(this);
+ }
+
+ private void cmdDisconnect_Click(object sender, System.EventArgs e)
+ {
+ if (lstAvatars.SelectedIndex >=0)
+ {
+ SecondSuite.RemoveClient((SecondLife)lstAvatars.Items[lstAvatars.SelectedIndex]);
+ }
+
+ if (lstAvatars.SelectedIndex == -1)
+ {
+ cmdDisconnect.Enabled = false;
+ }
+ }
+
+ private void lstAvatars_SelectedIndexChanged(object sender, System.EventArgs e)
+ {
+ cmdDisconnect.Enabled = true;
+ }
+ }
+}
diff --git a/applications/SecondSuite/frmOverview.resx b/applications/SecondSuite/frmOverview.resx
index a7f19839..fe8d1971 100644
--- a/applications/SecondSuite/frmOverview.resx
+++ b/applications/SecondSuite/frmOverview.resx
@@ -1,256 +1,256 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 1.3
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Private
-
-
- False
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Public
-
-
- Private
-
-
- 8, 8
-
-
- True
-
-
- False
-
-
- True
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- Private
-
-
- False
-
-
- Private
-
-
- Private
-
-
- False
-
-
- frmOverview
-
-
- (Default)
-
-
- False
-
-
- False
-
-
- 8, 8
-
-
- True
-
-
- 80
-
-
- True
-
-
- Private
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Public
+
+
+ Private
+
+
+ 8, 8
+
+
+ True
+
+
+ False
+
+
+ True
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ frmOverview
+
+
+ (Default)
+
+
+ False
+
+
+ False
+
+
+ 8, 8
+
+
+ True
+
+
+ 80
+
+
+ True
+
+
+ Private
+
\ No newline at end of file
diff --git a/applications/SecondSuite/frmSecondSuite.cs b/applications/SecondSuite/frmSecondSuite.cs
index 13581ac8..00606783 100644
--- a/applications/SecondSuite/frmSecondSuite.cs
+++ b/applications/SecondSuite/frmSecondSuite.cs
@@ -1,278 +1,278 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Windows.Forms;
-using System.Data;
-using System.IO;
-using System.Reflection;
-using libsecondlife;
-using SecondSuite.Plugins;
-
-namespace SecondSuite
-{
- public class frmSecondSuite : System.Windows.Forms.Form
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.Container components = null;
- private System.Windows.Forms.StatusBar statusBar;
- private System.Windows.Forms.MenuItem menuItem3;
- private System.Windows.Forms.MainMenu mainMenu;
- private System.Windows.Forms.MenuItem menuFile;
- private System.Windows.Forms.MenuItem menuExit;
- private System.Windows.Forms.MenuItem menuHelp;
- private System.Windows.Forms.MenuItem menuAbout;
- private System.Windows.Forms.MenuItem menuReload;
-
- //
- private frmOverview Overview;
-
- public frmSecondSuite()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- Overview = new frmOverview(this);
- Overview.MdiParent = this;
-
- FindPlugins();
-
- Overview.Show();
- }
-
- ///
- /// Clean up any resources being used.
- ///
- protected override void Dispose( bool disposing )
- {
- // Kill all the clients and plugins
- DisconnectAllClients();
- ShutdownAllPlugins();
-
- if( disposing )
- {
- if (components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- public void AddClient(SecondLife client)
- {
- Global.ClientsMutex.WaitOne();
- Global.Clients.Add(client);
- Global.ClientsMutex.ReleaseMutex();
-
- Overview.ClientAdded(client);
- }
-
- public void RemoveClient(SecondLife client)
- {
- Global.ClientsMutex.WaitOne();
- client.Network.Logout();
- Global.Clients.Remove(client);
- Global.ClientsMutex.ReleaseMutex();
-
- Overview.ClientRemoved(client);
- }
-
- public void DisconnectAllClients()
- {
- Global.ClientsMutex.WaitOne();
-
- foreach (SecondLife client in Global.Clients)
- {
- client.Network.Logout();
- }
-
- Global.Clients.Clear();
-
- Global.ClientsMutex.ReleaseMutex();
- }
-
- public void ShutdownAllPlugins()
- {
- Global.PluginsMutex.WaitOne();
-
- foreach (SSPlugin plugin in Global.Plugins)
- {
- plugin.Shutdown();
- }
-
- Global.Plugins.Clear();
-
- Global.PluginsMutex.ReleaseMutex();
- }
-
- public void FindPlugins()
- {
- //First empty the collection, we're reloading them all
- Global.PluginsMutex.WaitOne();
- Global.Plugins = new PluginCollection();
- Overview.lstPlugins.Items.Clear();
- Global.PluginsMutex.ReleaseMutex();
-
- //Go through all the files in the plugin directory
- foreach (string filename in Directory.GetFiles(
- AppDomain.CurrentDomain.BaseDirectory + "\\plugins\\"))
- {
- FileInfo file = new FileInfo(filename);
-
- //Preliminary check, must be .dll
- if (file.Extension.Equals(".dll"))
- {
- //Add the 'plugin'
- this.AddPlugin(filename);
- }
- }
- }
-
- private void AddPlugin(string filename)
- {
- SSPlugin plugin;
-
- try
- {
- Assembly pluginAssembly = Assembly.LoadFrom(filename);
-
- foreach (Type pluginType in pluginAssembly.GetTypes())
- {
- if (pluginType.IsPublic && !pluginType.IsAbstract)
- {
- Type typeInterface = pluginType.GetInterface("SecondSuite.Plugins.SSPlugin", true);
-
- if (typeInterface != null)
- {
- plugin = (SSPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
-
- Global.PluginsMutex.WaitOne();
- Global.Plugins.Add(plugin);
- Global.PluginsMutex.ReleaseMutex();
-
- Overview.lstPlugins.Items.Add(plugin);
- }
- }
- }
- }
- catch (ReflectionTypeLoadException e)
- {
- MessageBox.Show(e.LoaderExceptions[0].ToString());
- }
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.statusBar = new System.Windows.Forms.StatusBar();
- this.mainMenu = new System.Windows.Forms.MainMenu();
- this.menuFile = new System.Windows.Forms.MenuItem();
- this.menuReload = new System.Windows.Forms.MenuItem();
- this.menuItem3 = new System.Windows.Forms.MenuItem();
- this.menuExit = new System.Windows.Forms.MenuItem();
- this.menuHelp = new System.Windows.Forms.MenuItem();
- this.menuAbout = new System.Windows.Forms.MenuItem();
- this.SuspendLayout();
- //
- // statusBar
- //
- this.statusBar.Location = new System.Drawing.Point(0, 681);
- this.statusBar.Name = "statusBar";
- this.statusBar.ShowPanels = true;
- this.statusBar.Size = new System.Drawing.Size(992, 22);
- this.statusBar.TabIndex = 1;
- //
- // mainMenu
- //
- this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
- this.menuFile,
- this.menuHelp});
- //
- // menuFile
- //
- this.menuFile.Index = 0;
- this.menuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
- this.menuReload,
- this.menuItem3,
- this.menuExit});
- this.menuFile.Text = "File";
- //
- // menuReload
- //
- this.menuReload.Index = 0;
- this.menuReload.Text = "Reload Plugins";
- this.menuReload.Click += new System.EventHandler(this.menuReload_Click);
- //
- // menuItem3
- //
- this.menuItem3.Index = 1;
- this.menuItem3.Text = "-";
- //
- // menuExit
- //
- this.menuExit.Index = 2;
- this.menuExit.Text = "Exit";
- this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
- //
- // menuHelp
- //
- this.menuHelp.Index = 1;
- this.menuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
- this.menuAbout});
- this.menuHelp.Text = "Help";
- //
- // menuAbout
- //
- this.menuAbout.Index = 0;
- this.menuAbout.Text = "About";
- //
- // frmSecondSuite
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(992, 703);
- this.Controls.Add(this.statusBar);
- this.IsMdiContainer = true;
- this.Menu = this.mainMenu;
- this.Name = "frmSecondSuite";
- this.Text = "Second Suite";
- this.Load += new System.EventHandler(this.frmSecondSuite_Load);
- this.ResumeLayout(false);
-
- }
- #endregion
-
- ///
- /// The main entry point for the application.
- ///
- [STAThread]
- static void Main()
- {
- Application.Run(new frmSecondSuite());
- }
-
- private void frmSecondSuite_Load(object sender, System.EventArgs e)
- {
-
- }
-
- private void menuExit_Click(object sender, System.EventArgs e)
- {
- this.Close();
- }
-
- private void menuReload_Click(object sender, System.EventArgs e)
- {
- ShutdownAllPlugins();
- FindPlugins();
- }
- }
-}
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+using System.IO;
+using System.Reflection;
+using libsecondlife;
+using SecondSuite.Plugins;
+
+namespace SecondSuite
+{
+ public class frmSecondSuite : System.Windows.Forms.Form
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.Container components = null;
+ private System.Windows.Forms.StatusBar statusBar;
+ private System.Windows.Forms.MenuItem menuItem3;
+ private System.Windows.Forms.MainMenu mainMenu;
+ private System.Windows.Forms.MenuItem menuFile;
+ private System.Windows.Forms.MenuItem menuExit;
+ private System.Windows.Forms.MenuItem menuHelp;
+ private System.Windows.Forms.MenuItem menuAbout;
+ private System.Windows.Forms.MenuItem menuReload;
+
+ //
+ private frmOverview Overview;
+
+ public frmSecondSuite()
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ Overview = new frmOverview(this);
+ Overview.MdiParent = this;
+
+ FindPlugins();
+
+ Overview.Show();
+ }
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ protected override void Dispose( bool disposing )
+ {
+ // Kill all the clients and plugins
+ DisconnectAllClients();
+ ShutdownAllPlugins();
+
+ if( disposing )
+ {
+ if (components != null)
+ {
+ components.Dispose();
+ }
+ }
+ base.Dispose( disposing );
+ }
+
+ public void AddClient(SecondLife client)
+ {
+ Global.ClientsMutex.WaitOne();
+ Global.Clients.Add(client);
+ Global.ClientsMutex.ReleaseMutex();
+
+ Overview.ClientAdded(client);
+ }
+
+ public void RemoveClient(SecondLife client)
+ {
+ Global.ClientsMutex.WaitOne();
+ client.Network.Logout();
+ Global.Clients.Remove(client);
+ Global.ClientsMutex.ReleaseMutex();
+
+ Overview.ClientRemoved(client);
+ }
+
+ public void DisconnectAllClients()
+ {
+ Global.ClientsMutex.WaitOne();
+
+ foreach (SecondLife client in Global.Clients)
+ {
+ client.Network.Logout();
+ }
+
+ Global.Clients.Clear();
+
+ Global.ClientsMutex.ReleaseMutex();
+ }
+
+ public void ShutdownAllPlugins()
+ {
+ Global.PluginsMutex.WaitOne();
+
+ foreach (SSPlugin plugin in Global.Plugins)
+ {
+ plugin.Shutdown();
+ }
+
+ Global.Plugins.Clear();
+
+ Global.PluginsMutex.ReleaseMutex();
+ }
+
+ public void FindPlugins()
+ {
+ //First empty the collection, we're reloading them all
+ Global.PluginsMutex.WaitOne();
+ Global.Plugins = new PluginCollection();
+ Overview.lstPlugins.Items.Clear();
+ Global.PluginsMutex.ReleaseMutex();
+
+ //Go through all the files in the plugin directory
+ foreach (string filename in Directory.GetFiles(
+ AppDomain.CurrentDomain.BaseDirectory + "\\plugins\\"))
+ {
+ FileInfo file = new FileInfo(filename);
+
+ //Preliminary check, must be .dll
+ if (file.Extension.Equals(".dll"))
+ {
+ //Add the 'plugin'
+ this.AddPlugin(filename);
+ }
+ }
+ }
+
+ private void AddPlugin(string filename)
+ {
+ SSPlugin plugin;
+
+ try
+ {
+ Assembly pluginAssembly = Assembly.LoadFrom(filename);
+
+ foreach (Type pluginType in pluginAssembly.GetTypes())
+ {
+ if (pluginType.IsPublic && !pluginType.IsAbstract)
+ {
+ Type typeInterface = pluginType.GetInterface("SecondSuite.Plugins.SSPlugin", true);
+
+ if (typeInterface != null)
+ {
+ plugin = (SSPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
+
+ Global.PluginsMutex.WaitOne();
+ Global.Plugins.Add(plugin);
+ Global.PluginsMutex.ReleaseMutex();
+
+ Overview.lstPlugins.Items.Add(plugin);
+ }
+ }
+ }
+ }
+ catch (ReflectionTypeLoadException e)
+ {
+ MessageBox.Show(e.LoaderExceptions[0].ToString());
+ }
+ }
+
+ #region Windows Form Designer generated code
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.statusBar = new System.Windows.Forms.StatusBar();
+ this.mainMenu = new System.Windows.Forms.MainMenu();
+ this.menuFile = new System.Windows.Forms.MenuItem();
+ this.menuReload = new System.Windows.Forms.MenuItem();
+ this.menuItem3 = new System.Windows.Forms.MenuItem();
+ this.menuExit = new System.Windows.Forms.MenuItem();
+ this.menuHelp = new System.Windows.Forms.MenuItem();
+ this.menuAbout = new System.Windows.Forms.MenuItem();
+ this.SuspendLayout();
+ //
+ // statusBar
+ //
+ this.statusBar.Location = new System.Drawing.Point(0, 681);
+ this.statusBar.Name = "statusBar";
+ this.statusBar.ShowPanels = true;
+ this.statusBar.Size = new System.Drawing.Size(992, 22);
+ this.statusBar.TabIndex = 1;
+ //
+ // mainMenu
+ //
+ this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+ this.menuFile,
+ this.menuHelp});
+ //
+ // menuFile
+ //
+ this.menuFile.Index = 0;
+ this.menuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+ this.menuReload,
+ this.menuItem3,
+ this.menuExit});
+ this.menuFile.Text = "File";
+ //
+ // menuReload
+ //
+ this.menuReload.Index = 0;
+ this.menuReload.Text = "Reload Plugins";
+ this.menuReload.Click += new System.EventHandler(this.menuReload_Click);
+ //
+ // menuItem3
+ //
+ this.menuItem3.Index = 1;
+ this.menuItem3.Text = "-";
+ //
+ // menuExit
+ //
+ this.menuExit.Index = 2;
+ this.menuExit.Text = "Exit";
+ this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
+ //
+ // menuHelp
+ //
+ this.menuHelp.Index = 1;
+ this.menuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+ this.menuAbout});
+ this.menuHelp.Text = "Help";
+ //
+ // menuAbout
+ //
+ this.menuAbout.Index = 0;
+ this.menuAbout.Text = "About";
+ //
+ // frmSecondSuite
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(992, 703);
+ this.Controls.Add(this.statusBar);
+ this.IsMdiContainer = true;
+ this.Menu = this.mainMenu;
+ this.Name = "frmSecondSuite";
+ this.Text = "Second Suite";
+ this.Load += new System.EventHandler(this.frmSecondSuite_Load);
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.Run(new frmSecondSuite());
+ }
+
+ private void frmSecondSuite_Load(object sender, System.EventArgs e)
+ {
+
+ }
+
+ private void menuExit_Click(object sender, System.EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void menuReload_Click(object sender, System.EventArgs e)
+ {
+ ShutdownAllPlugins();
+ FindPlugins();
+ }
+ }
+}
diff --git a/applications/SecondSuite/frmSecondSuite.resx b/applications/SecondSuite/frmSecondSuite.resx
index 1a8835a7..333b0287 100644
--- a/applications/SecondSuite/frmSecondSuite.resx
+++ b/applications/SecondSuite/frmSecondSuite.resx
@@ -1,184 +1,184 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 1.3
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- False
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- 17, 17
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- Private
-
-
- False
-
-
- (Default)
-
-
- False
-
-
- False
-
-
- 8, 8
-
-
- frmSecondSuite
-
-
- True
-
-
- 80
-
-
- True
-
-
- Private
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ False
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ 17, 17
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ Private
+
+
+ False
+
+
+ (Default)
+
+
+ False
+
+
+ False
+
+
+ 8, 8
+
+
+ frmSecondSuite
+
+
+ True
+
+
+ 80
+
+
+ True
+
+
+ Private
+
\ No newline at end of file
diff --git a/applications/libjaspernet/Properties/AssemblyInfo.cs b/applications/libjaspernet/Properties/AssemblyInfo.cs
index 9c6ee6fb..fa3a31da 100644
--- a/applications/libjaspernet/Properties/AssemblyInfo.cs
+++ b/applications/libjaspernet/Properties/AssemblyInfo.cs
@@ -1,35 +1,35 @@
-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("libjaspernet")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("libjaspernet")]
-[assembly: AssemblyCopyright("Copyright © libsecondlife 2006")]
-[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("50d5e6b6-1a19-4095-9b8a-a46bd56f4223")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.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("libjaspernet")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("libjaspernet")]
+[assembly: AssemblyCopyright("Copyright © libsecondlife 2006")]
+[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("50d5e6b6-1a19-4095-9b8a-a46bd56f4223")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/applications/libjaspernet/libjaspernet.csproj b/applications/libjaspernet/libjaspernet.csproj
index 29d35ced..36887432 100644
--- a/applications/libjaspernet/libjaspernet.csproj
+++ b/applications/libjaspernet/libjaspernet.csproj
@@ -1,49 +1,49 @@
-
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {7D4C4807-7705-48A7-9D82-F6689FBBCC8B}
- Exe
- Properties
- libjaspernet
- libjaspernet
-
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {7D4C4807-7705-48A7-9D82-F6689FBBCC8B}
+ Exe
+ Properties
+ libjaspernet
+ libjaspernet
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/applications/libjaspernet/libjaspernet.dll.config b/applications/libjaspernet/libjaspernet.dll.config
index 85b4bf9c..380b4549 100644
--- a/applications/libjaspernet/libjaspernet.dll.config
+++ b/applications/libjaspernet/libjaspernet.dll.config
@@ -1,5 +1,5 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/applications/libjaspernet/libjaspernet.sln b/applications/libjaspernet/libjaspernet.sln
index 96cd755a..caf46990 100644
--- a/applications/libjaspernet/libjaspernet.sln
+++ b/applications/libjaspernet/libjaspernet.sln
@@ -1,20 +1,20 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libjaspernet", "libjaspernet.csproj", "{7D4C4807-7705-48A7-9D82-F6689FBBCC8B}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {7D4C4807-7705-48A7-9D82-F6689FBBCC8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7D4C4807-7705-48A7-9D82-F6689FBBCC8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7D4C4807-7705-48A7-9D82-F6689FBBCC8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7D4C4807-7705-48A7-9D82-F6689FBBCC8B}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "libjaspernet", "libjaspernet.csproj", "{7D4C4807-7705-48A7-9D82-F6689FBBCC8B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7D4C4807-7705-48A7-9D82-F6689FBBCC8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7D4C4807-7705-48A7-9D82-F6689FBBCC8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7D4C4807-7705-48A7-9D82-F6689FBBCC8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7D4C4807-7705-48A7-9D82-F6689FBBCC8B}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/applications/sceneviewer/Camera.cs b/applications/sceneviewer/Camera.cs
index fab78c4d..ec16f15d 100644
--- a/applications/sceneviewer/Camera.cs
+++ b/applications/sceneviewer/Camera.cs
@@ -1,188 +1,188 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.Xna.Framework;
-
-namespace sceneviewer
-{
- ///
- /// Simple third-person camera class
- ///
- public class Camera
- {
- #region Constants
- private static readonly float MAX_RADIANS = (float)(Math.PI * 2.0);
- private static readonly float MAX_PHI = (float)((Math.PI) * 2.0);
- private static readonly float MIN_PHI = 0;
- #endregion Constants
-
- #region Private Fields
- private Vector3 _cameraPosition;
- private Vector3 _lookatPosition;
- private Matrix _projection;
-
- private float _theta;
- private float _phi;
- private float _zoom;
- #endregion Private Fields
-
- #region Constructors
- ///
- /// Default constructor. Assumes the camera should be oriented up.
- ///
- ///
- ///
- public Camera(GameWindow window, Vector3 pos, Vector3 lookAt)
- {
- _cameraPosition = pos;
- _lookatPosition = lookAt;
-
- UpdateProjection(window);
- }
- #endregion Constructors
-
- #region Properties
- ///
- /// Generate the current view matrix for the camera
- ///
- public Matrix ViewMatrix
- {
- get
- {
- Vector3 newCameraPosition = _cameraPosition;
- Matrix rotationMatrix;
-
- // Apply zoom
- newCameraPosition += GetZoomVector();
-
- // Apply Z rotation
- rotationMatrix = Matrix.CreateRotationX(_phi);
- newCameraPosition = Vector3.Transform(newCameraPosition,
- rotationMatrix);
-
- // Apply Y rotation
- rotationMatrix = Matrix.CreateRotationY( _theta);
- newCameraPosition = Vector3.Transform(newCameraPosition,
- rotationMatrix);
-
- return Matrix.CreateLookAt(newCameraPosition, _lookatPosition,
- new Vector3(0.0f, 0.0f, 1.0f));
- }
- }
-
- public Matrix ProjectionMatrix
- {
- get
- {
- return _projection;
- }
- }
-
- ///
- /// Gets the view and projection matrices multiplied together
- ///
- public Matrix ViewProjectionMatrix
- {
- get
- {
- return ViewMatrix * _projection;
- }
- }
-
- ///
- /// Gets the camera position
- ///
- public Vector3 Position
- {
- get
- {
- return _cameraPosition;
- }
- }
-
- ///
- /// Get or set the current angle of rotation in radians about the
- /// Y-axis for the camera.
- ///
- public float Theta
- {
- get { return _theta; }
- set
- {
- _theta = value % MAX_RADIANS;
- }
- }
-
- ///
- /// Get or set the current angle of rotation in radians about the
- /// Z-axis for the camera.
- ///
- /// Applies a hard cap on the minimum or maximum values of phi.
- ///
- public float Phi
- {
- get { return _phi; }
- set
- {
- if (value > MAX_PHI)
- {
- _phi = MAX_PHI;
- }
- else if (value < MIN_PHI)
- {
- _phi = MIN_PHI;
- }
- else
- {
- _phi = value;
- }
- }
- }
-
- ///
- /// Get or set the current zoom of the camera.
- ///
- /// TODO: I should set a hard value on how close
- /// the camera can zoom in; it should never be able to go
- /// through the look at point.
- ///
- public float Zoom
- {
- get { return _zoom; }
-
- // TODO: Add a hard limit on zoom amount.
- set { _zoom = value; }
- }
- #endregion Properties
-
- ///
- /// Call this method any time the client window changes.
- ///
- public void UpdateProjection(GameWindow window)
- {
- _projection = Matrix.CreatePerspectiveFieldOfView((float)Math.PI / 4.0f,
- (float)window.ClientWidth / (float)window.ClientHeight,
- 1.0f, 512.0f);
- }
-
- ///
- /// Determine how far the camera should move forward
- /// or backward based on the current zoom value.
- ///
- /// This is calculated by finding the normal vector
- /// between the camera's position and the LookAt
- /// point and multiplying this vector by the zoom
- /// amount.
- ///
- ///
- private Vector3 GetZoomVector()
- {
- Vector3 diff = _cameraPosition - _lookatPosition;
-
- diff.Normalize();
- diff *= _zoom;
-
- return diff;
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.Xna.Framework;
+
+namespace sceneviewer
+{
+ ///
+ /// Simple third-person camera class
+ ///
+ public class Camera
+ {
+ #region Constants
+ private static readonly float MAX_RADIANS = (float)(Math.PI * 2.0);
+ private static readonly float MAX_PHI = (float)((Math.PI) * 2.0);
+ private static readonly float MIN_PHI = 0;
+ #endregion Constants
+
+ #region Private Fields
+ private Vector3 _cameraPosition;
+ private Vector3 _lookatPosition;
+ private Matrix _projection;
+
+ private float _theta;
+ private float _phi;
+ private float _zoom;
+ #endregion Private Fields
+
+ #region Constructors
+ ///
+ /// Default constructor. Assumes the camera should be oriented up.
+ ///
+ ///
+ ///
+ public Camera(GameWindow window, Vector3 pos, Vector3 lookAt)
+ {
+ _cameraPosition = pos;
+ _lookatPosition = lookAt;
+
+ UpdateProjection(window);
+ }
+ #endregion Constructors
+
+ #region Properties
+ ///
+ /// Generate the current view matrix for the camera
+ ///
+ public Matrix ViewMatrix
+ {
+ get
+ {
+ Vector3 newCameraPosition = _cameraPosition;
+ Matrix rotationMatrix;
+
+ // Apply zoom
+ newCameraPosition += GetZoomVector();
+
+ // Apply Z rotation
+ rotationMatrix = Matrix.CreateRotationX(_phi);
+ newCameraPosition = Vector3.Transform(newCameraPosition,
+ rotationMatrix);
+
+ // Apply Y rotation
+ rotationMatrix = Matrix.CreateRotationY( _theta);
+ newCameraPosition = Vector3.Transform(newCameraPosition,
+ rotationMatrix);
+
+ return Matrix.CreateLookAt(newCameraPosition, _lookatPosition,
+ new Vector3(0.0f, 0.0f, 1.0f));
+ }
+ }
+
+ public Matrix ProjectionMatrix
+ {
+ get
+ {
+ return _projection;
+ }
+ }
+
+ ///
+ /// Gets the view and projection matrices multiplied together
+ ///
+ public Matrix ViewProjectionMatrix
+ {
+ get
+ {
+ return ViewMatrix * _projection;
+ }
+ }
+
+ ///
+ /// Gets the camera position
+ ///
+ public Vector3 Position
+ {
+ get
+ {
+ return _cameraPosition;
+ }
+ }
+
+ ///
+ /// Get or set the current angle of rotation in radians about the
+ /// Y-axis for the camera.
+ ///
+ public float Theta
+ {
+ get { return _theta; }
+ set
+ {
+ _theta = value % MAX_RADIANS;
+ }
+ }
+
+ ///
+ /// Get or set the current angle of rotation in radians about the
+ /// Z-axis for the camera.
+ ///
+ /// Applies a hard cap on the minimum or maximum values of phi.
+ ///
+ public float Phi
+ {
+ get { return _phi; }
+ set
+ {
+ if (value > MAX_PHI)
+ {
+ _phi = MAX_PHI;
+ }
+ else if (value < MIN_PHI)
+ {
+ _phi = MIN_PHI;
+ }
+ else
+ {
+ _phi = value;
+ }
+ }
+ }
+
+ ///
+ /// Get or set the current zoom of the camera.
+ ///
+ /// TODO: I should set a hard value on how close
+ /// the camera can zoom in; it should never be able to go
+ /// through the look at point.
+ ///
+ public float Zoom
+ {
+ get { return _zoom; }
+
+ // TODO: Add a hard limit on zoom amount.
+ set { _zoom = value; }
+ }
+ #endregion Properties
+
+ ///
+ /// Call this method any time the client window changes.
+ ///
+ public void UpdateProjection(GameWindow window)
+ {
+ _projection = Matrix.CreatePerspectiveFieldOfView((float)Math.PI / 4.0f,
+ (float)window.ClientWidth / (float)window.ClientHeight,
+ 1.0f, 512.0f);
+ }
+
+ ///
+ /// Determine how far the camera should move forward
+ /// or backward based on the current zoom value.
+ ///
+ /// This is calculated by finding the normal vector
+ /// between the camera's position and the LookAt
+ /// point and multiplying this vector by the zoom
+ /// amount.
+ ///
+ ///
+ private Vector3 GetZoomVector()
+ {
+ Vector3 diff = _cameraPosition - _lookatPosition;
+
+ diff.Normalize();
+ diff *= _zoom;
+
+ return diff;
+ }
+ }
}
\ No newline at end of file
diff --git a/applications/sceneviewer/PrimVisual.cs b/applications/sceneviewer/PrimVisual.cs
index 9bf0e5f2..b29bd564 100644
--- a/applications/sceneviewer/PrimVisual.cs
+++ b/applications/sceneviewer/PrimVisual.cs
@@ -1,31 +1,31 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-
-namespace sceneviewer
-{
- class PrimVisual : GameComponent
- {
- //private World world;
- private float scale;
-
- // effects and shaders
- private CompiledEffect compiledEffect;
- private Effect effect;
-
- // matrices for defining scale, world, and view projection
- private Matrix scaleMatrix;
- private Matrix worldMatrix;
- private Matrix viewProjectionMatrix;
-
- public PrimVisual()
- {
- //InitializeComponent();
-
- // initialize default values
- scale = 1.0f;
- worldMatrix = Matrix.Identity;
- }
- }
-}
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace sceneviewer
+{
+ class PrimVisual : GameComponent
+ {
+ //private World world;
+ private float scale;
+
+ // effects and shaders
+ private CompiledEffect compiledEffect;
+ private Effect effect;
+
+ // matrices for defining scale, world, and view projection
+ private Matrix scaleMatrix;
+ private Matrix worldMatrix;
+ private Matrix viewProjectionMatrix;
+
+ public PrimVisual()
+ {
+ //InitializeComponent();
+
+ // initialize default values
+ scale = 1.0f;
+ worldMatrix = Matrix.Identity;
+ }
+ }
+}
diff --git a/applications/sceneviewer/Prims/CrossSection.cs b/applications/sceneviewer/Prims/CrossSection.cs
index 556e940a..03d3bbf2 100644
--- a/applications/sceneviewer/Prims/CrossSection.cs
+++ b/applications/sceneviewer/Prims/CrossSection.cs
@@ -1,39 +1,39 @@
-using System;
-using System.Text;
-using System.Collections.Generic;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using libsecondlife;
-
-namespace sceneviewer.Prims
-{
- public class CrossSection
- {
- private List Points;
-
- public CrossSection()
- {
- Points = new List();
- }
-
- public void AddPoint(Vector3 point)
- {
- Points.Add(point);
- }
-
- public void RemoveAllPoints()
- {
- Points.Clear();
- }
-
- public int GetNumPoints()
- {
- return Points.Count;
- }
-
- public Vector3 GetRawVertex(int index)
- {
- return Points[index];
- }
- }
-}
+using System;
+using System.Text;
+using System.Collections.Generic;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using libsecondlife;
+
+namespace sceneviewer.Prims
+{
+ public class CrossSection
+ {
+ private List Points;
+
+ public CrossSection()
+ {
+ Points = new List();
+ }
+
+ public void AddPoint(Vector3 point)
+ {
+ Points.Add(point);
+ }
+
+ public void RemoveAllPoints()
+ {
+ Points.Clear();
+ }
+
+ public int GetNumPoints()
+ {
+ return Points.Count;
+ }
+
+ public Vector3 GetRawVertex(int index)
+ {
+ return Points[index];
+ }
+ }
+}
diff --git a/applications/sceneviewer/Prims/LinearPrimVisual.cs b/applications/sceneviewer/Prims/LinearPrimVisual.cs
index 2e0df13b..2a9a60ec 100644
--- a/applications/sceneviewer/Prims/LinearPrimVisual.cs
+++ b/applications/sceneviewer/Prims/LinearPrimVisual.cs
@@ -1,520 +1,520 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using libsecondlife;
-
-namespace sceneviewer.Prims
-{
- public abstract class LinearPrimVisual : PrimVisual
- {
- // Reference vertices of the unscaled/unrotated primitive
- protected Vector3[] ReferenceVertices;
-
- protected CrossSection[] OuterFaces; // Section for each extruded outer face
- protected CrossSection[] InnerFaces; // Section for each extruded inner face (hollow)
- protected CrossSection[] CutFaces; // Two cut faces
-
- protected int NumberFaces; // Number of faces on the base primitive
- protected int FirstOuterFace; // If we're cutting, this might not be 0
- protected int LastOuterFace; // If we're cutting, this might not be iNumberFaces
-
- protected Color color;
-
- // Accessors
- protected int triangleCount = 0;
- public override int TriangleCount
- {
- get { return triangleCount; }
- }
-
- // Abstract functions
- protected abstract int GetCutQuadrant(float cut);
- protected abstract float GetAngleWithXAxis(float cut);
- protected abstract void BuildEndCapHollow(bool top);
-
- public LinearPrimVisual(PrimObject prim) : base(prim)
- {
- // TODO: This is temporary, for debugging and entertainment purposes
- Random rand = new Random((int)prim.LocalID + Environment.TickCount);
- byte r = (byte)rand.Next(256);
- byte g = (byte)rand.Next(256);
- byte b = (byte)rand.Next(256);
- color = new Color(r, g, b);
- }
-
- protected override void BuildFaces()
- {
- Vector3 cutstartouterface = Vector3.Zero;
- Vector3 cutendouterface = Vector3.Zero;
- Vector3 cutstartinnerface = Vector3.Zero;
- Vector3 cutendinnerface = Vector3.Zero;
- int cutStartDiagQuadrant = cutStartDiagQuadrant = GetCutQuadrant(Prim.ProfileBegin);
- int cutEndDiagQuadrant = cutEndDiagQuadrant = GetCutQuadrant(Prim.ProfileEnd);
- float hollowRatio = (float)Prim.ProfileHollow / 100.0f;
-
- cutstartouterface = GetCutIntersect(Prim.ProfileBegin, 0.5f); // coordinates of where the cut starts
- cutendouterface = GetCutIntersect(Prim.ProfileEnd, 0.5f); // coordinates of where the cut starts
-
- if (hollow)
- {
- float halfWidth = hollowRatio * 0.5f;
- cutstartinnerface = GetCutIntersect(Prim.ProfileBegin, halfWidth);
- cutendinnerface = GetCutIntersect(Prim.ProfileEnd, halfWidth);
- }
-
- if (cut)
- {
- if (hollow)
- {
- BuildCutHollowFaces(cutstartouterface, cutstartinnerface, cutendouterface, cutendinnerface);
- }
- else
- {
- BuildCutFaces(cutstartouterface, cutendouterface);
- }
- }
-
- if (cutStartDiagQuadrant == cutEndDiagQuadrant)
- {
- FirstOuterFace = LastOuterFace = cutStartDiagQuadrant;
-
- OuterFaces[0].RemoveAllPoints();
- OuterFaces[0].AddPoint(cutstartouterface);
- OuterFaces[0].AddPoint(cutendouterface);
- //OuterFaces[0].TextureMapping = texturemapping;
-
- if (hollow)
- {
- InnerFaces[0].RemoveAllPoints();
- InnerFaces[0].AddPoint(cutendinnerface);
- InnerFaces[0].AddPoint(cutstartinnerface);
- //InnerFaces[0].TextureMapping = texturemapping;
- }
- }
- else
- {
- FirstOuterFace = cutStartDiagQuadrant;
-
- float totalInnerLength = 0;
- float startSideInnerLength = 0;
- float wholeSideLength = 0;
-
- PopulateSingleCutFacePositiveDirection(ref OuterFaces[FirstOuterFace], cutstartouterface, cutStartDiagQuadrant, 0.5f, true);
- //OuterFaces[FirstOuterFace].TextureMapping = texturemapping;
-
- if (hollow)
- {
- startSideInnerLength = PopulateSingleCutFacePositiveDirection(ref InnerFaces[FirstOuterFace],
- cutstartinnerface, cutStartDiagQuadrant, hollowRatio * 0.5f, false);
- //InnerFaces[FirstOuterFace].TextureMapping = texturemapping;
- totalInnerLength += startSideInnerLength;
- }
-
- int quadrant = cutStartDiagQuadrant + 1;
-
- while (quadrant < cutEndDiagQuadrant)
- {
- PopulateCompleteSide(ref OuterFaces[quadrant], quadrant, 0.5f, true);
- //OuterFaces[quadrant].TextureMapping = texturemapping;
-
- if (hollow)
- {
- wholeSideLength = PopulateCompleteSide(ref InnerFaces[quadrant], quadrant,
- hollowRatio * 0.5f, false);
- //InnerFaces[quadrant].TextureMapping = texturemapping;
- totalInnerLength += wholeSideLength;
- }
-
- quadrant++;
- }
-
- PopulateSingleCutFaceNegativeDirection(ref OuterFaces[quadrant], cutendouterface,
- cutEndDiagQuadrant, 0.5f, true);
- //OuterFaces[quadrant].TextureMapping = texturemapping;
-
- if (hollow)
- {
- float endSideInnerLength = PopulateSingleCutFaceNegativeDirection(ref InnerFaces[quadrant],
- cutendinnerface, cutEndDiagQuadrant, hollowRatio * 0.5f, false);
- //InnerFaces[quadrant].TextureMapping = texturemapping;
- totalInnerLength += endSideInnerLength;
- }
-
- LastOuterFace = quadrant;
-
- if (hollow)
- {
- //SetupInnerFaceTextureOffsets(startSideInnerLength, wholeSideLength, totalInnerLength);
- }
- }
-
- AssignFaces();
-
- BuildVertexes();
- }
-
- protected void BuildCutFaces(Vector3 cutstartouterface, Vector3 cutendouterface)
- {
- CutFaces[0].RemoveAllPoints();
-
- CutFaces[0].AddPoint(Vector3.Zero);
- CutFaces[0].AddPoint(cutstartouterface);
- //CutFaces[0].TextureMapping = texturemapping;
-
- CutFaces[1].RemoveAllPoints();
-
- CutFaces[1].AddPoint(cutendouterface);
- CutFaces[1].AddPoint(Vector3.Zero);
- //CutFaces[1].TextureMapping = texturemapping;
- }
-
- protected void BuildCutHollowFaces(Vector3 cutstartouterface, Vector3 cutstartinnerface, Vector3 cutendouterface, Vector3 cutendinnerface)
- {
- CutFaces[0].RemoveAllPoints();
-
- CutFaces[0].AddPoint(cutstartinnerface);
- CutFaces[0].AddPoint(cutstartouterface);
- //CutFaces[0].TextureMapping = texturemapping;
-
- CutFaces[1].RemoveAllPoints();
-
- CutFaces[1].AddPoint(cutendouterface);
- CutFaces[1].AddPoint(cutendinnerface);
- //CutFaces[1].TextureMapping = texturemapping;
- }
-
- private Vector3 GetCutIntersect(float cut, float cubeHalfWidth)
- {
- int cutQuadrant = GetCutQuadrant(cut);
-
- Vector3 lineend;
- Vector3 linestart = ReferenceVertices[cutQuadrant] * cubeHalfWidth;
- linestart = Vector3.Divide(linestart, 0.5f);
- if (cutQuadrant < NumberFaces - 1)
- {
- lineend = ReferenceVertices[cutQuadrant + 1] * cubeHalfWidth;
- }
- else
- {
- lineend = ReferenceVertices[0] * cubeHalfWidth;
- }
- lineend = Vector3.Divide(lineend, 0.5f);
-
- //
- float angle = GetAngleWithXAxis(cut);
-
- // CutVectorPerp is perpendicular to the radius vector
- Vector3 cutVectorPerp = new Vector3((float)-Math.Sin(angle), (float)Math.Cos(angle), 0);
- Vector3 delta = lineend - linestart;
-
- // From http://softsurfer.com/Archive/algorithm_0104/algorithm_0104B.htm
- Vector3 result = linestart - delta * Vector3.Dot(cutVectorPerp, linestart) / Vector3.Dot(cutVectorPerp, delta);
-
- return result;
- }
-
- // Handles the first face in the cut, starting from cutstart,
- // and running anticlockwise to first reference vertex
- private float PopulateSingleCutFacePositiveDirection(ref CrossSection face, Vector3 cutPoint, int quadrant,
- float halfCubeWidth, bool outer)
- {
- quadrant = NormalizeQuadrant(quadrant);
-
- face.RemoveAllPoints();
-
- Vector3 startPoint = cutPoint;
- Vector3 endPoint;
- if (quadrant < NumberFaces - 1)
- {
- endPoint = ReferenceVertices[quadrant + 1] * halfCubeWidth / 0.5f;
- }
- else
- {
- endPoint = ReferenceVertices[0] * halfCubeWidth / 0.5f;
- }
-
- if (outer)
- {
- face.AddPoint(startPoint);
- face.AddPoint(endPoint);
- }
- else
- {
- face.AddPoint(endPoint);
- face.AddPoint(startPoint);
- }
-
- return Vector3.Distance(startPoint, endPoint);
- }
-
- private float PopulateSingleCutFaceNegativeDirection(ref CrossSection face, Vector3 cutPoint, int quadrant,
- float halfCubeWidth, bool outer)
- {
- quadrant = NormalizeQuadrant(quadrant);
-
- face.RemoveAllPoints();
-
- Vector3 startPoint = ReferenceVertices[quadrant] * halfCubeWidth / 0.5f;
- Vector3 endPoint = cutPoint;
-
- if (outer)
- {
- face.AddPoint(startPoint);
- face.AddPoint(endPoint);
- }
- else
- {
- face.AddPoint(endPoint);
- face.AddPoint(startPoint);
- }
-
- return Vector3.Distance(startPoint, endPoint);
- }
-
- private float PopulateCompleteSide(ref CrossSection face, int quadrant, float halfCubeWidth, bool outer)
- {
- quadrant = NormalizeQuadrant(quadrant);
-
- face.RemoveAllPoints();
-
- Vector3 startPoint = ReferenceVertices[quadrant];
- Vector3 endPoint;
- if (quadrant < NumberFaces - 1)
- {
- endPoint = ReferenceVertices[quadrant + 1];
- }
- else
- {
- endPoint = ReferenceVertices[0];
- }
-
- startPoint = startPoint * halfCubeWidth / 0.5f;
- endPoint = endPoint * halfCubeWidth / 0.5f;
-
- if (outer)
- {
- face.AddPoint(startPoint);
- face.AddPoint(endPoint);
- }
- else
- {
- face.AddPoint(endPoint);
- face.AddPoint(startPoint);
- }
-
- return 2f * halfCubeWidth;
- }
-
- protected void BuildVertexes()
- {
- // For prims with a linear extrusion path, we base the number of transformations on the amount of twist
- int transforms = 1 + Math.Abs((int)((float)(Prim.PathTwist - Prim.PathTwistBegin) / 9f));
-
- // Build the outer sides
- BuildSideVertexes(OuterFaces, transforms);
-
- if (hollow)
- {
- // Build the inner sides
- BuildSideVertexes(InnerFaces, transforms);
- }
-
- if (cut)
- {
- // Build the cut sides (between the inner and outer)
- BuildSideVertexes(CutFaces, transforms);
- }
-
- // Build the top and bottom end caps
- if (hollow)
- {
- BuildEndCapHollow(true);
- BuildEndCapHollow(false);
- }
- else
- {
- if (cut)
- {
- BuildEndCapCutNoHollow(true);
- BuildEndCapCutNoHollow(false);
- }
- else
- {
- BuildEndCapNoCutNoHollow(true);
- BuildEndCapNoCutNoHollow(false);
- }
- }
-
- VertexArray = Vertexes.ToArray();
- }
-
- //private void BuildSideVertexes(CrossSection[] crossSection, int transforms)
- //{
- // float transformOffset = 1.0f / (float)transforms;
- // float currentOffset = -0.5f;
-
- // for (int i = 0; i < transforms; i++)
- // {
- // for (int j = 0; j < crossSection.Length; j++)
- // {
- // int pointCount = crossSection[j].GetNumPoints();
-
- // if (pointCount > 0)
- // {
- // Vector3 lower1 = crossSection[j].GetRawVertex(0);
- // Vector3 lower2 = crossSection[j].GetRawVertex(1);
-
- // lower1.Z = currentOffset;
- // lower2.Z = currentOffset;
-
- // Vector3 upper1 = lower1;
- // Vector3 upper2 = lower2;
-
- // upper1.Z = currentOffset + transformOffset;
- // upper2.Z = currentOffset + transformOffset;
-
- // // FIXME: Perform skew, taper and twist transformations here
- // //lower1 = Vector3.Transform(lower1, lowerTransform);
- // //lower2 = Vector3.Transform(lower2, lowerTransform);
- // //upper1 = Vector3.Transform(upper1, upperTransform);
- // //upper2 = Vector3.Transform(upper2, upperTransform);
-
- // Vertexes.Add(new VertexPositionColor(lower1, color));
- // Vertexes.Add(new VertexPositionColor(lower2, color));
- // Vertexes.Add(new VertexPositionColor(upper2, color));
-
- // Vertexes.Add(new VertexPositionColor(lower1, color));
- // Vertexes.Add(new VertexPositionColor(upper2, color));
- // Vertexes.Add(new VertexPositionColor(upper1, color));
- // }
- // }
-
- // currentOffset += transformOffset;
- // }
- //}
-
- protected void BuildSideVertexes(CrossSection[] crossSection, int transforms)
- {
- float transformOffset = 1.0f / (float)transforms;
- float currentOffset = -0.5f;
-
- for (int i = 0; i < transforms; i++)
- {
- for (int j = 0; j < crossSection.Length; j++)
- {
- int pointCount = crossSection[j].GetNumPoints();
-
- if (pointCount > 0)
- {
- for (int k = 0; k < pointCount - 1; k++)
- {
- Vector3 lower1, lower2, upper1, upper2;
-
- lower1 = crossSection[j].GetRawVertex(k);
- lower2 = crossSection[j].GetRawVertex(k + 1);
-
- lower1.Z = currentOffset;
- lower2.Z = currentOffset;
-
- upper1 = lower1;
- upper2 = lower2;
-
- upper1.Z = currentOffset + transformOffset;
- upper2.Z = currentOffset + transformOffset;
-
- // FIXME: Perform skew, taper and twist transformations here
- //lower1 = Vector3.Transform(lower1, lowerTransform);
- //lower2 = Vector3.Transform(lower2, lowerTransform);
- //upper1 = Vector3.Transform(upper1, upperTransform);
- //upper2 = Vector3.Transform(upper2, upperTransform);
-
- Vertexes.Add(new VertexPositionColor(lower1, color));
- Vertexes.Add(new VertexPositionColor(lower2, color));
- Vertexes.Add(new VertexPositionColor(upper2, color));
-
- Vertexes.Add(new VertexPositionColor(lower1, color));
- Vertexes.Add(new VertexPositionColor(upper2, color));
- Vertexes.Add(new VertexPositionColor(upper1, color));
- }
- }
- }
-
- currentOffset += transformOffset;
- }
- }
-
- protected void BuildEndCapNoCutNoHollow(bool top)
- {
- float z = top ? 0.5f : -0.5f;
-
- for (int i = 0; i < OuterFaces.Length; i++)
- {
- int pointCount = OuterFaces[i].GetNumPoints();
-
- if (pointCount > 0)
- {
- for (int j = 0; j < pointCount - 1; j++)
- {
- Vector3 first = OuterFaces[i].GetRawVertex(j);
- first.Z = z;
- Vector3 second = OuterFaces[i].GetRawVertex(j + 1);
- second.Z = z;
-
- // FIXME: Perform skew, taper and twist transformations here
- if (top)
- {
- ;
- }
- else
- {
- ;
- }
-
- Vertexes.Add(new VertexPositionColor(first, color));
- Vertexes.Add(new VertexPositionColor(second, color));
- Vertexes.Add(new VertexPositionColor(new Vector3(0, 0, z), color));
- }
- }
- }
- }
-
- protected void BuildEndCapCutNoHollow(bool top)
- {
- float z = top ? 0.5f : -0.5f;
-
- // FIXME: Apply transformations to the center point
- Vector3 center = Vector3.Zero;
-
- for (int i = FirstOuterFace; i <= LastOuterFace; i++)
- {
- int pointCount = OuterFaces[i].GetNumPoints();
-
- for (int j = 0; j < pointCount - 1; j++)
- {
- Vector3 p1 = OuterFaces[i].GetRawVertex(j);
- Vector3 p2 = OuterFaces[i].GetRawVertex(j + 1);
-
- center.Z = p1.Z = p2.Z = z;
-
- // TODO: Texturemapping stuff
- //Vector2 t1 = texturemapping.GetTextureCoordinate(new Vector2(1 - (p1.x + 0.5), p1.y + 0.5));
- //Vector2 t2 = texturemapping.GetTextureCoordinate(new Vector2(1 - (p2.x + 0.5), p2.y + 0.5));
-
- // FIXME: Perform skew, taper and twist transformations here
- //p1 = Vector3.Transform(p1, transform);
- //p2 = Vector3.Transform(p2, transform);
-
- Vertexes.Add(new VertexPositionColor(p2, color));
- Vertexes.Add(new VertexPositionColor(p1, color));
- Vertexes.Add(new VertexPositionColor(center, color));
- }
- }
- }
-
- private int NormalizeQuadrant(int quadrant)
- {
- return ((quadrant % NumberFaces) + NumberFaces) % NumberFaces;
- }
- }
-}
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using libsecondlife;
+
+namespace sceneviewer.Prims
+{
+ public abstract class LinearPrimVisual : PrimVisual
+ {
+ // Reference vertices of the unscaled/unrotated primitive
+ protected Vector3[] ReferenceVertices;
+
+ protected CrossSection[] OuterFaces; // Section for each extruded outer face
+ protected CrossSection[] InnerFaces; // Section for each extruded inner face (hollow)
+ protected CrossSection[] CutFaces; // Two cut faces
+
+ protected int NumberFaces; // Number of faces on the base primitive
+ protected int FirstOuterFace; // If we're cutting, this might not be 0
+ protected int LastOuterFace; // If we're cutting, this might not be iNumberFaces
+
+ protected Color color;
+
+ // Accessors
+ protected int triangleCount = 0;
+ public override int TriangleCount
+ {
+ get { return triangleCount; }
+ }
+
+ // Abstract functions
+ protected abstract int GetCutQuadrant(float cut);
+ protected abstract float GetAngleWithXAxis(float cut);
+ protected abstract void BuildEndCapHollow(bool top);
+
+ public LinearPrimVisual(PrimObject prim) : base(prim)
+ {
+ // TODO: This is temporary, for debugging and entertainment purposes
+ Random rand = new Random((int)prim.LocalID + Environment.TickCount);
+ byte r = (byte)rand.Next(256);
+ byte g = (byte)rand.Next(256);
+ byte b = (byte)rand.Next(256);
+ color = new Color(r, g, b);
+ }
+
+ protected override void BuildFaces()
+ {
+ Vector3 cutstartouterface = Vector3.Zero;
+ Vector3 cutendouterface = Vector3.Zero;
+ Vector3 cutstartinnerface = Vector3.Zero;
+ Vector3 cutendinnerface = Vector3.Zero;
+ int cutStartDiagQuadrant = cutStartDiagQuadrant = GetCutQuadrant(Prim.ProfileBegin);
+ int cutEndDiagQuadrant = cutEndDiagQuadrant = GetCutQuadrant(Prim.ProfileEnd);
+ float hollowRatio = (float)Prim.ProfileHollow / 100.0f;
+
+ cutstartouterface = GetCutIntersect(Prim.ProfileBegin, 0.5f); // coordinates of where the cut starts
+ cutendouterface = GetCutIntersect(Prim.ProfileEnd, 0.5f); // coordinates of where the cut starts
+
+ if (hollow)
+ {
+ float halfWidth = hollowRatio * 0.5f;
+ cutstartinnerface = GetCutIntersect(Prim.ProfileBegin, halfWidth);
+ cutendinnerface = GetCutIntersect(Prim.ProfileEnd, halfWidth);
+ }
+
+ if (cut)
+ {
+ if (hollow)
+ {
+ BuildCutHollowFaces(cutstartouterface, cutstartinnerface, cutendouterface, cutendinnerface);
+ }
+ else
+ {
+ BuildCutFaces(cutstartouterface, cutendouterface);
+ }
+ }
+
+ if (cutStartDiagQuadrant == cutEndDiagQuadrant)
+ {
+ FirstOuterFace = LastOuterFace = cutStartDiagQuadrant;
+
+ OuterFaces[0].RemoveAllPoints();
+ OuterFaces[0].AddPoint(cutstartouterface);
+ OuterFaces[0].AddPoint(cutendouterface);
+ //OuterFaces[0].TextureMapping = texturemapping;
+
+ if (hollow)
+ {
+ InnerFaces[0].RemoveAllPoints();
+ InnerFaces[0].AddPoint(cutendinnerface);
+ InnerFaces[0].AddPoint(cutstartinnerface);
+ //InnerFaces[0].TextureMapping = texturemapping;
+ }
+ }
+ else
+ {
+ FirstOuterFace = cutStartDiagQuadrant;
+
+ float totalInnerLength = 0;
+ float startSideInnerLength = 0;
+ float wholeSideLength = 0;
+
+ PopulateSingleCutFacePositiveDirection(ref OuterFaces[FirstOuterFace], cutstartouterface, cutStartDiagQuadrant, 0.5f, true);
+ //OuterFaces[FirstOuterFace].TextureMapping = texturemapping;
+
+ if (hollow)
+ {
+ startSideInnerLength = PopulateSingleCutFacePositiveDirection(ref InnerFaces[FirstOuterFace],
+ cutstartinnerface, cutStartDiagQuadrant, hollowRatio * 0.5f, false);
+ //InnerFaces[FirstOuterFace].TextureMapping = texturemapping;
+ totalInnerLength += startSideInnerLength;
+ }
+
+ int quadrant = cutStartDiagQuadrant + 1;
+
+ while (quadrant < cutEndDiagQuadrant)
+ {
+ PopulateCompleteSide(ref OuterFaces[quadrant], quadrant, 0.5f, true);
+ //OuterFaces[quadrant].TextureMapping = texturemapping;
+
+ if (hollow)
+ {
+ wholeSideLength = PopulateCompleteSide(ref InnerFaces[quadrant], quadrant,
+ hollowRatio * 0.5f, false);
+ //InnerFaces[quadrant].TextureMapping = texturemapping;
+ totalInnerLength += wholeSideLength;
+ }
+
+ quadrant++;
+ }
+
+ PopulateSingleCutFaceNegativeDirection(ref OuterFaces[quadrant], cutendouterface,
+ cutEndDiagQuadrant, 0.5f, true);
+ //OuterFaces[quadrant].TextureMapping = texturemapping;
+
+ if (hollow)
+ {
+ float endSideInnerLength = PopulateSingleCutFaceNegativeDirection(ref InnerFaces[quadrant],
+ cutendinnerface, cutEndDiagQuadrant, hollowRatio * 0.5f, false);
+ //InnerFaces[quadrant].TextureMapping = texturemapping;
+ totalInnerLength += endSideInnerLength;
+ }
+
+ LastOuterFace = quadrant;
+
+ if (hollow)
+ {
+ //SetupInnerFaceTextureOffsets(startSideInnerLength, wholeSideLength, totalInnerLength);
+ }
+ }
+
+ AssignFaces();
+
+ BuildVertexes();
+ }
+
+ protected void BuildCutFaces(Vector3 cutstartouterface, Vector3 cutendouterface)
+ {
+ CutFaces[0].RemoveAllPoints();
+
+ CutFaces[0].AddPoint(Vector3.Zero);
+ CutFaces[0].AddPoint(cutstartouterface);
+ //CutFaces[0].TextureMapping = texturemapping;
+
+ CutFaces[1].RemoveAllPoints();
+
+ CutFaces[1].AddPoint(cutendouterface);
+ CutFaces[1].AddPoint(Vector3.Zero);
+ //CutFaces[1].TextureMapping = texturemapping;
+ }
+
+ protected void BuildCutHollowFaces(Vector3 cutstartouterface, Vector3 cutstartinnerface, Vector3 cutendouterface, Vector3 cutendinnerface)
+ {
+ CutFaces[0].RemoveAllPoints();
+
+ CutFaces[0].AddPoint(cutstartinnerface);
+ CutFaces[0].AddPoint(cutstartouterface);
+ //CutFaces[0].TextureMapping = texturemapping;
+
+ CutFaces[1].RemoveAllPoints();
+
+ CutFaces[1].AddPoint(cutendouterface);
+ CutFaces[1].AddPoint(cutendinnerface);
+ //CutFaces[1].TextureMapping = texturemapping;
+ }
+
+ private Vector3 GetCutIntersect(float cut, float cubeHalfWidth)
+ {
+ int cutQuadrant = GetCutQuadrant(cut);
+
+ Vector3 lineend;
+ Vector3 linestart = ReferenceVertices[cutQuadrant] * cubeHalfWidth;
+ linestart = Vector3.Divide(linestart, 0.5f);
+ if (cutQuadrant < NumberFaces - 1)
+ {
+ lineend = ReferenceVertices[cutQuadrant + 1] * cubeHalfWidth;
+ }
+ else
+ {
+ lineend = ReferenceVertices[0] * cubeHalfWidth;
+ }
+ lineend = Vector3.Divide(lineend, 0.5f);
+
+ //
+ float angle = GetAngleWithXAxis(cut);
+
+ // CutVectorPerp is perpendicular to the radius vector
+ Vector3 cutVectorPerp = new Vector3((float)-Math.Sin(angle), (float)Math.Cos(angle), 0);
+ Vector3 delta = lineend - linestart;
+
+ // From http://softsurfer.com/Archive/algorithm_0104/algorithm_0104B.htm
+ Vector3 result = linestart - delta * Vector3.Dot(cutVectorPerp, linestart) / Vector3.Dot(cutVectorPerp, delta);
+
+ return result;
+ }
+
+ // Handles the first face in the cut, starting from cutstart,
+ // and running anticlockwise to first reference vertex
+ private float PopulateSingleCutFacePositiveDirection(ref CrossSection face, Vector3 cutPoint, int quadrant,
+ float halfCubeWidth, bool outer)
+ {
+ quadrant = NormalizeQuadrant(quadrant);
+
+ face.RemoveAllPoints();
+
+ Vector3 startPoint = cutPoint;
+ Vector3 endPoint;
+ if (quadrant < NumberFaces - 1)
+ {
+ endPoint = ReferenceVertices[quadrant + 1] * halfCubeWidth / 0.5f;
+ }
+ else
+ {
+ endPoint = ReferenceVertices[0] * halfCubeWidth / 0.5f;
+ }
+
+ if (outer)
+ {
+ face.AddPoint(startPoint);
+ face.AddPoint(endPoint);
+ }
+ else
+ {
+ face.AddPoint(endPoint);
+ face.AddPoint(startPoint);
+ }
+
+ return Vector3.Distance(startPoint, endPoint);
+ }
+
+ private float PopulateSingleCutFaceNegativeDirection(ref CrossSection face, Vector3 cutPoint, int quadrant,
+ float halfCubeWidth, bool outer)
+ {
+ quadrant = NormalizeQuadrant(quadrant);
+
+ face.RemoveAllPoints();
+
+ Vector3 startPoint = ReferenceVertices[quadrant] * halfCubeWidth / 0.5f;
+ Vector3 endPoint = cutPoint;
+
+ if (outer)
+ {
+ face.AddPoint(startPoint);
+ face.AddPoint(endPoint);
+ }
+ else
+ {
+ face.AddPoint(endPoint);
+ face.AddPoint(startPoint);
+ }
+
+ return Vector3.Distance(startPoint, endPoint);
+ }
+
+ private float PopulateCompleteSide(ref CrossSection face, int quadrant, float halfCubeWidth, bool outer)
+ {
+ quadrant = NormalizeQuadrant(quadrant);
+
+ face.RemoveAllPoints();
+
+ Vector3 startPoint = ReferenceVertices[quadrant];
+ Vector3 endPoint;
+ if (quadrant < NumberFaces - 1)
+ {
+ endPoint = ReferenceVertices[quadrant + 1];
+ }
+ else
+ {
+ endPoint = ReferenceVertices[0];
+ }
+
+ startPoint = startPoint * halfCubeWidth / 0.5f;
+ endPoint = endPoint * halfCubeWidth / 0.5f;
+
+ if (outer)
+ {
+ face.AddPoint(startPoint);
+ face.AddPoint(endPoint);
+ }
+ else
+ {
+ face.AddPoint(endPoint);
+ face.AddPoint(startPoint);
+ }
+
+ return 2f * halfCubeWidth;
+ }
+
+ protected void BuildVertexes()
+ {
+ // For prims with a linear extrusion path, we base the number of transformations on the amount of twist
+ int transforms = 1 + Math.Abs((int)((float)(Prim.PathTwist - Prim.PathTwistBegin) / 9f));
+
+ // Build the outer sides
+ BuildSideVertexes(OuterFaces, transforms);
+
+ if (hollow)
+ {
+ // Build the inner sides
+ BuildSideVertexes(InnerFaces, transforms);
+ }
+
+ if (cut)
+ {
+ // Build the cut sides (between the inner and outer)
+ BuildSideVertexes(CutFaces, transforms);
+ }
+
+ // Build the top and bottom end caps
+ if (hollow)
+ {
+ BuildEndCapHollow(true);
+ BuildEndCapHollow(false);
+ }
+ else
+ {
+ if (cut)
+ {
+ BuildEndCapCutNoHollow(true);
+ BuildEndCapCutNoHollow(false);
+ }
+ else
+ {
+ BuildEndCapNoCutNoHollow(true);
+ BuildEndCapNoCutNoHollow(false);
+ }
+ }
+
+ VertexArray = Vertexes.ToArray();
+ }
+
+ //private void BuildSideVertexes(CrossSection[] crossSection, int transforms)
+ //{
+ // float transformOffset = 1.0f / (float)transforms;
+ // float currentOffset = -0.5f;
+
+ // for (int i = 0; i < transforms; i++)
+ // {
+ // for (int j = 0; j < crossSection.Length; j++)
+ // {
+ // int pointCount = crossSection[j].GetNumPoints();
+
+ // if (pointCount > 0)
+ // {
+ // Vector3 lower1 = crossSection[j].GetRawVertex(0);
+ // Vector3 lower2 = crossSection[j].GetRawVertex(1);
+
+ // lower1.Z = currentOffset;
+ // lower2.Z = currentOffset;
+
+ // Vector3 upper1 = lower1;
+ // Vector3 upper2 = lower2;
+
+ // upper1.Z = currentOffset + transformOffset;
+ // upper2.Z = currentOffset + transformOffset;
+
+ // // FIXME: Perform skew, taper and twist transformations here
+ // //lower1 = Vector3.Transform(lower1, lowerTransform);
+ // //lower2 = Vector3.Transform(lower2, lowerTransform);
+ // //upper1 = Vector3.Transform(upper1, upperTransform);
+ // //upper2 = Vector3.Transform(upper2, upperTransform);
+
+ // Vertexes.Add(new VertexPositionColor(lower1, color));
+ // Vertexes.Add(new VertexPositionColor(lower2, color));
+ // Vertexes.Add(new VertexPositionColor(upper2, color));
+
+ // Vertexes.Add(new VertexPositionColor(lower1, color));
+ // Vertexes.Add(new VertexPositionColor(upper2, color));
+ // Vertexes.Add(new VertexPositionColor(upper1, color));
+ // }
+ // }
+
+ // currentOffset += transformOffset;
+ // }
+ //}
+
+ protected void BuildSideVertexes(CrossSection[] crossSection, int transforms)
+ {
+ float transformOffset = 1.0f / (float)transforms;
+ float currentOffset = -0.5f;
+
+ for (int i = 0; i < transforms; i++)
+ {
+ for (int j = 0; j < crossSection.Length; j++)
+ {
+ int pointCount = crossSection[j].GetNumPoints();
+
+ if (pointCount > 0)
+ {
+ for (int k = 0; k < pointCount - 1; k++)
+ {
+ Vector3 lower1, lower2, upper1, upper2;
+
+ lower1 = crossSection[j].GetRawVertex(k);
+ lower2 = crossSection[j].GetRawVertex(k + 1);
+
+ lower1.Z = currentOffset;
+ lower2.Z = currentOffset;
+
+ upper1 = lower1;
+ upper2 = lower2;
+
+ upper1.Z = currentOffset + transformOffset;
+ upper2.Z = currentOffset + transformOffset;
+
+ // FIXME: Perform skew, taper and twist transformations here
+ //lower1 = Vector3.Transform(lower1, lowerTransform);
+ //lower2 = Vector3.Transform(lower2, lowerTransform);
+ //upper1 = Vector3.Transform(upper1, upperTransform);
+ //upper2 = Vector3.Transform(upper2, upperTransform);
+
+ Vertexes.Add(new VertexPositionColor(lower1, color));
+ Vertexes.Add(new VertexPositionColor(lower2, color));
+ Vertexes.Add(new VertexPositionColor(upper2, color));
+
+ Vertexes.Add(new VertexPositionColor(lower1, color));
+ Vertexes.Add(new VertexPositionColor(upper2, color));
+ Vertexes.Add(new VertexPositionColor(upper1, color));
+ }
+ }
+ }
+
+ currentOffset += transformOffset;
+ }
+ }
+
+ protected void BuildEndCapNoCutNoHollow(bool top)
+ {
+ float z = top ? 0.5f : -0.5f;
+
+ for (int i = 0; i < OuterFaces.Length; i++)
+ {
+ int pointCount = OuterFaces[i].GetNumPoints();
+
+ if (pointCount > 0)
+ {
+ for (int j = 0; j < pointCount - 1; j++)
+ {
+ Vector3 first = OuterFaces[i].GetRawVertex(j);
+ first.Z = z;
+ Vector3 second = OuterFaces[i].GetRawVertex(j + 1);
+ second.Z = z;
+
+ // FIXME: Perform skew, taper and twist transformations here
+ if (top)
+ {
+ ;
+ }
+ else
+ {
+ ;
+ }
+
+ Vertexes.Add(new VertexPositionColor(first, color));
+ Vertexes.Add(new VertexPositionColor(second, color));
+ Vertexes.Add(new VertexPositionColor(new Vector3(0, 0, z), color));
+ }
+ }
+ }
+ }
+
+ protected void BuildEndCapCutNoHollow(bool top)
+ {
+ float z = top ? 0.5f : -0.5f;
+
+ // FIXME: Apply transformations to the center point
+ Vector3 center = Vector3.Zero;
+
+ for (int i = FirstOuterFace; i <= LastOuterFace; i++)
+ {
+ int pointCount = OuterFaces[i].GetNumPoints();
+
+ for (int j = 0; j < pointCount - 1; j++)
+ {
+ Vector3 p1 = OuterFaces[i].GetRawVertex(j);
+ Vector3 p2 = OuterFaces[i].GetRawVertex(j + 1);
+
+ center.Z = p1.Z = p2.Z = z;
+
+ // TODO: Texturemapping stuff
+ //Vector2 t1 = texturemapping.GetTextureCoordinate(new Vector2(1 - (p1.x + 0.5), p1.y + 0.5));
+ //Vector2 t2 = texturemapping.GetTextureCoordinate(new Vector2(1 - (p2.x + 0.5), p2.y + 0.5));
+
+ // FIXME: Perform skew, taper and twist transformations here
+ //p1 = Vector3.Transform(p1, transform);
+ //p2 = Vector3.Transform(p2, transform);
+
+ Vertexes.Add(new VertexPositionColor(p2, color));
+ Vertexes.Add(new VertexPositionColor(p1, color));
+ Vertexes.Add(new VertexPositionColor(center, color));
+ }
+ }
+ }
+
+ private int NormalizeQuadrant(int quadrant)
+ {
+ return ((quadrant % NumberFaces) + NumberFaces) % NumberFaces;
+ }
+ }
+}
diff --git a/applications/sceneviewer/Prims/PrimVisual.cs b/applications/sceneviewer/Prims/PrimVisual.cs
index cef1fa4b..a7b55511 100644
--- a/applications/sceneviewer/Prims/PrimVisual.cs
+++ b/applications/sceneviewer/Prims/PrimVisual.cs
@@ -1,124 +1,124 @@
-using System;
-using System.Text;
-using System.Collections.Generic;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using libsecondlife;
-
-namespace sceneviewer.Prims
-{
- public abstract class PrimVisual
- {
- // Constants
- public const int MaxCut = 200;
-
- public Matrix Matrix;
- public VertexPositionColor[] VertexArray;
- public PrimObject Prim;
- public Vector3 Acceleration;
- public Vector3 Velocity;
- public Vector3 RotationVelocity;
- public int LevelOfDetail = 16;
-
- // Accessors
- public abstract int TriangleCount { get; }
- //public abstract int Twist { set; get; }
- //public abstract double Shear { set; get; }
- //public abstract double TopSizeX { set; get;}
- //public abstract double TopSizeY { set; get; }
- //public abstract int CutStart { set; get; }
- //public abstract int CutEnd { set; get; }
- //public virtual int AdvancedCutStart { set { } get { return 0; } }
- //public virtual int AdvancedCutEnd { set { } get { return 0; } }
- //public abstract int Hollow { set; get; }
-
- protected const int MaxFaces = 9;
-
- protected bool hollow;
- protected bool cut;
-
- protected List Vertexes;
- protected Color[] FaceColors = new Color[MaxFaces];
-
- // Abstract methods
- protected abstract void BuildFaces();
- protected abstract void AssignFaces();
-
- public PrimVisual(PrimObject prim)
- {
- Prim = prim;
- Vertexes = new List();
- VertexArray = Vertexes.ToArray();
-
- Acceleration = Vector3.Zero;
- Velocity = Vector3.Zero;
- RotationVelocity = Vector3.Zero;
-
- BuildMatrix();
- }
-
- public void Update(PrimUpdate primUpdate)
- {
- Prim.Position = primUpdate.Position;
- Prim.Rotation = primUpdate.Rotation;
- Acceleration = new Vector3(primUpdate.Acceleration.X, primUpdate.Acceleration.Y, primUpdate.Acceleration.Z);
- Velocity = new Vector3(primUpdate.Velocity.X, primUpdate.Velocity.Y, primUpdate.Velocity.Z);
- RotationVelocity = new Vector3(primUpdate.RotationVelocity.X, primUpdate.RotationVelocity.Y, primUpdate.RotationVelocity.Z);
-
- BuildMatrix();
- }
-
- private void BuildMatrix()
- {
- Matrix offset = Matrix.CreateTranslation(new Vector3(Prim.Position.X, Prim.Position.Y, Prim.Position.Z));
- Matrix rotation = Matrix.FromQuaternion(new Quaternion(Prim.Rotation.X, Prim.Rotation.Y, Prim.Rotation.Z,
- Prim.Rotation.W));
- Matrix scaling = Matrix.CreateScale(Prim.Scale.X, Prim.Scale.Y, Prim.Scale.Z);
-
- Matrix = scaling * rotation * offset;
- }
-
- public static PrimVisual BuildPrimVisual(PrimObject prim)
- {
- if (prim.ProfileCurve == 1 && prim.PathCurve == 16)
- {
- // PRIM_TYPE_BOX
- return new PrimVisualBox(prim);
- }
- else if (prim.ProfileCurve == 0 && prim.PathCurve == 16)
- {
- // PRIM_TYPE_CYLINDER
- return new PrimVisualCylinder(prim);
- }
- else if (prim.ProfileCurve == 3 && prim.PathCurve == 16)
- {
- // PRIM_TYPE_PRISM
- return new PrimVisualPrism(prim);
- }
- else if (prim.ProfileCurve == 5 && prim.PathCurve == 32)
- {
- // PRIM_TYPE_SPHERE
- return new PrimVisualSphere(prim);
- }
- else if (prim.ProfileCurve == 0 && prim.PathCurve == 32)
- {
- // PRIM_TYPE_TORUS
- return new PrimVisualTorus(prim);
- }
- else if (prim.ProfileCurve == 1 && prim.PathCurve == 32)
- {
- // PRIM_TYPE_TUBE
- return new PrimVisualTube(prim);
- }
- else if (prim.ProfileCurve == 3 && prim.PathCurve == 32)
- {
- // PRIM_TYPE_RING
- return new PrimVisualRing(prim);
- }
- else
- {
- return null;
- }
- }
- }
-}
+using System;
+using System.Text;
+using System.Collections.Generic;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using libsecondlife;
+
+namespace sceneviewer.Prims
+{
+ public abstract class PrimVisual
+ {
+ // Constants
+ public const int MaxCut = 200;
+
+ public Matrix Matrix;
+ public VertexPositionColor[] VertexArray;
+ public PrimObject Prim;
+ public Vector3 Acceleration;
+ public Vector3 Velocity;
+ public Vector3 RotationVelocity;
+ public int LevelOfDetail = 16;
+
+ // Accessors
+ public abstract int TriangleCount { get; }
+ //public abstract int Twist { set; get; }
+ //public abstract double Shear { set; get; }
+ //public abstract double TopSizeX { set; get;}
+ //public abstract double TopSizeY { set; get; }
+ //public abstract int CutStart { set; get; }
+ //public abstract int CutEnd { set; get; }
+ //public virtual int AdvancedCutStart { set { } get { return 0; } }
+ //public virtual int AdvancedCutEnd { set { } get { return 0; } }
+ //public abstract int Hollow { set; get; }
+
+ protected const int MaxFaces = 9;
+
+ protected bool hollow;
+ protected bool cut;
+
+ protected List Vertexes;
+ protected Color[] FaceColors = new Color[MaxFaces];
+
+ // Abstract methods
+ protected abstract void BuildFaces();
+ protected abstract void AssignFaces();
+
+ public PrimVisual(PrimObject prim)
+ {
+ Prim = prim;
+ Vertexes = new List();
+ VertexArray = Vertexes.ToArray();
+
+ Acceleration = Vector3.Zero;
+ Velocity = Vector3.Zero;
+ RotationVelocity = Vector3.Zero;
+
+ BuildMatrix();
+ }
+
+ public void Update(PrimUpdate primUpdate)
+ {
+ Prim.Position = primUpdate.Position;
+ Prim.Rotation = primUpdate.Rotation;
+ Acceleration = new Vector3(primUpdate.Acceleration.X, primUpdate.Acceleration.Y, primUpdate.Acceleration.Z);
+ Velocity = new Vector3(primUpdate.Velocity.X, primUpdate.Velocity.Y, primUpdate.Velocity.Z);
+ RotationVelocity = new Vector3(primUpdate.RotationVelocity.X, primUpdate.RotationVelocity.Y, primUpdate.RotationVelocity.Z);
+
+ BuildMatrix();
+ }
+
+ private void BuildMatrix()
+ {
+ Matrix offset = Matrix.CreateTranslation(new Vector3(Prim.Position.X, Prim.Position.Y, Prim.Position.Z));
+ Matrix rotation = Matrix.FromQuaternion(new Quaternion(Prim.Rotation.X, Prim.Rotation.Y, Prim.Rotation.Z,
+ Prim.Rotation.W));
+ Matrix scaling = Matrix.CreateScale(Prim.Scale.X, Prim.Scale.Y, Prim.Scale.Z);
+
+ Matrix = scaling * rotation * offset;
+ }
+
+ public static PrimVisual BuildPrimVisual(PrimObject prim)
+ {
+ if (prim.ProfileCurve == 1 && prim.PathCurve == 16)
+ {
+ // PRIM_TYPE_BOX
+ return new PrimVisualBox(prim);
+ }
+ else if (prim.ProfileCurve == 0 && prim.PathCurve == 16)
+ {
+ // PRIM_TYPE_CYLINDER
+ return new PrimVisualCylinder(prim);
+ }
+ else if (prim.ProfileCurve == 3 && prim.PathCurve == 16)
+ {
+ // PRIM_TYPE_PRISM
+ return new PrimVisualPrism(prim);
+ }
+ else if (prim.ProfileCurve == 5 && prim.PathCurve == 32)
+ {
+ // PRIM_TYPE_SPHERE
+ return new PrimVisualSphere(prim);
+ }
+ else if (prim.ProfileCurve == 0 && prim.PathCurve == 32)
+ {
+ // PRIM_TYPE_TORUS
+ return new PrimVisualTorus(prim);
+ }
+ else if (prim.ProfileCurve == 1 && prim.PathCurve == 32)
+ {
+ // PRIM_TYPE_TUBE
+ return new PrimVisualTube(prim);
+ }
+ else if (prim.ProfileCurve == 3 && prim.PathCurve == 32)
+ {
+ // PRIM_TYPE_RING
+ return new PrimVisualRing(prim);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ }
+}
diff --git a/applications/sceneviewer/Prims/PrimVisualBox.cs b/applications/sceneviewer/Prims/PrimVisualBox.cs
index 0cae5be9..0dc6fc73 100644
--- a/applications/sceneviewer/Prims/PrimVisualBox.cs
+++ b/applications/sceneviewer/Prims/PrimVisualBox.cs
@@ -1,100 +1,100 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using libsecondlife;
-
-namespace sceneviewer.Prims
-{
- public class PrimVisualBox : LinearPrimVisual
- {
- public PrimVisualBox(PrimObject prim) : base(prim)
- {
- NumberFaces = 4;
- FirstOuterFace = 0;
- LastOuterFace = 3;
-
- ReferenceVertices = new Vector3[4];
-
- ReferenceVertices[1] = new Vector3(0.5f, -0.5f, 0f);
- ReferenceVertices[2] = new Vector3(0.5f, 0.5f, 0f);
- ReferenceVertices[3] = new Vector3(-0.5f, 0.5f, 0f);
- ReferenceVertices[0] = new Vector3(-0.5f, -0.5f, 0f);
-
- OuterFaces = new CrossSection[4];
- for (int i = 0; i < 4; i++)
- {
- OuterFaces[i] = new CrossSection();
- }
-
- if (prim.ProfileHollow != 0)
- {
- hollow = true;
- InnerFaces = new CrossSection[4];
- for (int i = 0; i < 4; i++)
- {
- InnerFaces[i] = new CrossSection();
- }
- }
-
- if (prim.ProfileBegin != 0 || prim.ProfileEnd != 1)
- {
- cut = true;
- CutFaces = new CrossSection[2];
- for (int i = 0; i < 2; i++)
- {
- CutFaces[i] = new CrossSection();
- }
- }
-
- BuildFaces();
- }
-
- protected override void AssignFaces()
- {
- }
-
- protected override int GetCutQuadrant(float cut)
- {
- if (cut == 1) { return 3; }
- else { return (int)(cut * 4.0); }
- }
-
- protected override float GetAngleWithXAxis(float cut)
- {
- //return (cut - 0.125f) * 2f * (float)Math.PI;
- return (cut + 0.125f) * 2f * (float)Math.PI;
- }
-
- protected override void BuildEndCapHollow(bool top)
- {
- float z = top ? 0.5f : -0.5f;
-
- for (int i = FirstOuterFace; i <= LastOuterFace; i++)
- {
- int pointCount = OuterFaces[i].GetNumPoints();
-
- Vector3 p1 = OuterFaces[i].GetRawVertex(0);
- Vector3 p2 = OuterFaces[i].GetRawVertex(1);
- Vector3 p3 = InnerFaces[i].GetRawVertex(0);
- Vector3 p4 = InnerFaces[i].GetRawVertex(1);
-
- p1.Z = p2.Z = p3.Z = p4.Z = z;
-
- // TODO: Texturemapping
- //Vector2 t1 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r1.x + 0.5), r1.y + 0.5));
- //Vector2 t2 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r2.x + 0.5), r2.y + 0.5));
- //Vector2 t3 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r3.x + 0.5), r3.y + 0.5));
- //Vector2 t4 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r4.x + 0.5), r4.y + 0.5));
-
- Vertexes.Add(new VertexPositionColor(p4, color));
- Vertexes.Add(new VertexPositionColor(p3, color));
- Vertexes.Add(new VertexPositionColor(p2, color));
-
- Vertexes.Add(new VertexPositionColor(p4, color));
- Vertexes.Add(new VertexPositionColor(p2, color));
- Vertexes.Add(new VertexPositionColor(p1, color));
- }
- }
- }
-}
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using libsecondlife;
+
+namespace sceneviewer.Prims
+{
+ public class PrimVisualBox : LinearPrimVisual
+ {
+ public PrimVisualBox(PrimObject prim) : base(prim)
+ {
+ NumberFaces = 4;
+ FirstOuterFace = 0;
+ LastOuterFace = 3;
+
+ ReferenceVertices = new Vector3[4];
+
+ ReferenceVertices[1] = new Vector3(0.5f, -0.5f, 0f);
+ ReferenceVertices[2] = new Vector3(0.5f, 0.5f, 0f);
+ ReferenceVertices[3] = new Vector3(-0.5f, 0.5f, 0f);
+ ReferenceVertices[0] = new Vector3(-0.5f, -0.5f, 0f);
+
+ OuterFaces = new CrossSection[4];
+ for (int i = 0; i < 4; i++)
+ {
+ OuterFaces[i] = new CrossSection();
+ }
+
+ if (prim.ProfileHollow != 0)
+ {
+ hollow = true;
+ InnerFaces = new CrossSection[4];
+ for (int i = 0; i < 4; i++)
+ {
+ InnerFaces[i] = new CrossSection();
+ }
+ }
+
+ if (prim.ProfileBegin != 0 || prim.ProfileEnd != 1)
+ {
+ cut = true;
+ CutFaces = new CrossSection[2];
+ for (int i = 0; i < 2; i++)
+ {
+ CutFaces[i] = new CrossSection();
+ }
+ }
+
+ BuildFaces();
+ }
+
+ protected override void AssignFaces()
+ {
+ }
+
+ protected override int GetCutQuadrant(float cut)
+ {
+ if (cut == 1) { return 3; }
+ else { return (int)(cut * 4.0); }
+ }
+
+ protected override float GetAngleWithXAxis(float cut)
+ {
+ //return (cut - 0.125f) * 2f * (float)Math.PI;
+ return (cut + 0.125f) * 2f * (float)Math.PI;
+ }
+
+ protected override void BuildEndCapHollow(bool top)
+ {
+ float z = top ? 0.5f : -0.5f;
+
+ for (int i = FirstOuterFace; i <= LastOuterFace; i++)
+ {
+ int pointCount = OuterFaces[i].GetNumPoints();
+
+ Vector3 p1 = OuterFaces[i].GetRawVertex(0);
+ Vector3 p2 = OuterFaces[i].GetRawVertex(1);
+ Vector3 p3 = InnerFaces[i].GetRawVertex(0);
+ Vector3 p4 = InnerFaces[i].GetRawVertex(1);
+
+ p1.Z = p2.Z = p3.Z = p4.Z = z;
+
+ // TODO: Texturemapping
+ //Vector2 t1 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r1.x + 0.5), r1.y + 0.5));
+ //Vector2 t2 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r2.x + 0.5), r2.y + 0.5));
+ //Vector2 t3 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r3.x + 0.5), r3.y + 0.5));
+ //Vector2 t4 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r4.x + 0.5), r4.y + 0.5));
+
+ Vertexes.Add(new VertexPositionColor(p4, color));
+ Vertexes.Add(new VertexPositionColor(p3, color));
+ Vertexes.Add(new VertexPositionColor(p2, color));
+
+ Vertexes.Add(new VertexPositionColor(p4, color));
+ Vertexes.Add(new VertexPositionColor(p2, color));
+ Vertexes.Add(new VertexPositionColor(p1, color));
+ }
+ }
+ }
+}
diff --git a/applications/sceneviewer/Prims/PrimVisualCylinder.cs b/applications/sceneviewer/Prims/PrimVisualCylinder.cs
index 103302c0..245aa48f 100644
--- a/applications/sceneviewer/Prims/PrimVisualCylinder.cs
+++ b/applications/sceneviewer/Prims/PrimVisualCylinder.cs
@@ -1,163 +1,163 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using libsecondlife;
-
-namespace sceneviewer.Prims
-{
- public class PrimVisualCylinder : LinearPrimVisual
- {
- public PrimVisualCylinder(PrimObject prim)
- : base(prim)
- {
- NumberFaces = 1;
- FirstOuterFace = 0;
- LastOuterFace = 0;
-
- OuterFaces = new CrossSection[1];
- OuterFaces[0] = new CrossSection();
-
- if (prim.ProfileHollow != 0)
- {
- hollow = true;
- InnerFaces = new CrossSection[1];
- InnerFaces[0] = new CrossSection();
-
- //for (int i = 0; i < 4; i++)
- //{
- // InnerFaces[i] = new CrossSection();
- //}
- }
-
- if (prim.ProfileBegin != 0 || prim.ProfileEnd != 1)
- {
- cut = true;
- CutFaces = new CrossSection[2];
- for (int i = 0; i < 2; i++)
- {
- CutFaces[i] = new CrossSection();
- }
- }
-
- BuildFaces();
- }
-
- protected override void AssignFaces()
- {
- }
-
- protected Vector3 GetCutIntersect(float cut, float primHalfWidth)
- {
- double angle = cut * 2 * Math.PI;
- return new Vector3((float)(primHalfWidth * Math.Cos(angle)), (float)(primHalfWidth * Math.Sin(angle)), 0);
- }
-
- protected override float GetAngleWithXAxis(float cut)
- {
- return cut * 2 * (float)Math.PI;
- }
-
- protected override int GetCutQuadrant(float cut)
- {
- return 0;
- }
-
- protected override void BuildFaces()
- {
- float hollowRatio = Prim.ProfileHollow / 100.0f;
-
- Vector3 cutstartinnerface;
- Vector3 cutendinnerface;
-
- Vector3 cutstartouterface = GetCutIntersect(Prim.ProfileBegin, 0.5f);
- Vector3 cutendouterface = GetCutIntersect(Prim.ProfileEnd, 0.5f);
-
- OuterFaces[0].RemoveAllPoints();
-
- if (hollow)
- {
- InnerFaces[0].RemoveAllPoints();
-
- cutstartinnerface = GetCutIntersect(Prim.ProfileBegin, hollowRatio * 0.5f);
- cutendinnerface = GetCutIntersect(Prim.ProfileEnd, hollowRatio * 0.5f);
-
- if (cut)
- {
- BuildCutHollowFaces(cutstartouterface, cutstartinnerface, cutendouterface, cutendinnerface);
- }
- }
- else if (cut)
- {
- BuildCutFaces(cutstartouterface, cutendouterface);
- }
-
- double angle = 0;
- double startAngle = Prim.ProfileBegin * 2 * Math.PI;
- double endAngle = Prim.ProfileEnd * 2 * Math.PI;
-
- Vector3 nextOuterPoint = Vector3.Zero;
- Vector3 nextInnerPoint = Vector3.Zero;
-
- for (int facePoint = 0; facePoint <= LevelOfDetail; facePoint++)
- {
- angle = startAngle + ((double)facePoint / (double)LevelOfDetail) * (endAngle - startAngle);
-
- nextOuterPoint.X = (float)(0.5 * Math.Cos(angle));
- nextOuterPoint.Y = (float)(0.5 * Math.Sin(angle));
- OuterFaces[0].AddPoint(nextOuterPoint);
- }
-
- if (hollow)
- {
- //for (int facePoint = LevelOfDetail; facePoint >= 0; facePoint--)
- for (int facePoint = 0; facePoint <= LevelOfDetail; facePoint++)
- {
- angle = startAngle + ((double)facePoint / (double)LevelOfDetail) * (endAngle - startAngle);
-
- nextInnerPoint.X = (float)(0.5 * Math.Cos(angle) * hollowRatio);
- nextInnerPoint.Y = (float)(0.5 * Math.Sin(angle) * hollowRatio);
- InnerFaces[0].AddPoint(nextInnerPoint);
- }
- }
-
- // TODO: Texturemapping
-
- AssignFaces();
-
- BuildVertexes();
- }
-
- protected override void BuildEndCapHollow(bool top)
- {
- float z = top ? 0.5f : -0.5f;
-
- // We assume the innerfaces and outerfaces point counts are the same
- int pointCount = OuterFaces[0].GetNumPoints();
-
- for (int j = 0; j < pointCount - 1; j++)
- {
- Vector3 p1 = OuterFaces[0].GetRawVertex(j);
- Vector3 p2 = OuterFaces[0].GetRawVertex(j + 1);
- Vector3 p3 = InnerFaces[0].GetRawVertex(j);
- Vector3 p4 = InnerFaces[0].GetRawVertex(j + 1);
-
- p1.Z = p2.Z = p3.Z = p4.Z = z;
-
- // TODO: Texturemapping
- //Vector2 t1 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r1.x + 0.5), r1.y + 0.5));
- //Vector2 t2 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r2.x + 0.5), r2.y + 0.5));
- //Vector2 t3 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r3.x + 0.5), r3.y + 0.5));
- //Vector2 t4 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r4.x + 0.5), r4.y + 0.5));
-
- Vertexes.Add(new VertexPositionColor(p4, color));
- Vertexes.Add(new VertexPositionColor(p3, color));
- Vertexes.Add(new VertexPositionColor(p2, color));
-
- Vertexes.Add(new VertexPositionColor(p3, color));
- Vertexes.Add(new VertexPositionColor(p2, color));
- Vertexes.Add(new VertexPositionColor(p1, color));
- }
- }
- }
-}
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using libsecondlife;
+
+namespace sceneviewer.Prims
+{
+ public class PrimVisualCylinder : LinearPrimVisual
+ {
+ public PrimVisualCylinder(PrimObject prim)
+ : base(prim)
+ {
+ NumberFaces = 1;
+ FirstOuterFace = 0;
+ LastOuterFace = 0;
+
+ OuterFaces = new CrossSection[1];
+ OuterFaces[0] = new CrossSection();
+
+ if (prim.ProfileHollow != 0)
+ {
+ hollow = true;
+ InnerFaces = new CrossSection[1];
+ InnerFaces[0] = new CrossSection();
+
+ //for (int i = 0; i < 4; i++)
+ //{
+ // InnerFaces[i] = new CrossSection();
+ //}
+ }
+
+ if (prim.ProfileBegin != 0 || prim.ProfileEnd != 1)
+ {
+ cut = true;
+ CutFaces = new CrossSection[2];
+ for (int i = 0; i < 2; i++)
+ {
+ CutFaces[i] = new CrossSection();
+ }
+ }
+
+ BuildFaces();
+ }
+
+ protected override void AssignFaces()
+ {
+ }
+
+ protected Vector3 GetCutIntersect(float cut, float primHalfWidth)
+ {
+ double angle = cut * 2 * Math.PI;
+ return new Vector3((float)(primHalfWidth * Math.Cos(angle)), (float)(primHalfWidth * Math.Sin(angle)), 0);
+ }
+
+ protected override float GetAngleWithXAxis(float cut)
+ {
+ return cut * 2 * (float)Math.PI;
+ }
+
+ protected override int GetCutQuadrant(float cut)
+ {
+ return 0;
+ }
+
+ protected override void BuildFaces()
+ {
+ float hollowRatio = Prim.ProfileHollow / 100.0f;
+
+ Vector3 cutstartinnerface;
+ Vector3 cutendinnerface;
+
+ Vector3 cutstartouterface = GetCutIntersect(Prim.ProfileBegin, 0.5f);
+ Vector3 cutendouterface = GetCutIntersect(Prim.ProfileEnd, 0.5f);
+
+ OuterFaces[0].RemoveAllPoints();
+
+ if (hollow)
+ {
+ InnerFaces[0].RemoveAllPoints();
+
+ cutstartinnerface = GetCutIntersect(Prim.ProfileBegin, hollowRatio * 0.5f);
+ cutendinnerface = GetCutIntersect(Prim.ProfileEnd, hollowRatio * 0.5f);
+
+ if (cut)
+ {
+ BuildCutHollowFaces(cutstartouterface, cutstartinnerface, cutendouterface, cutendinnerface);
+ }
+ }
+ else if (cut)
+ {
+ BuildCutFaces(cutstartouterface, cutendouterface);
+ }
+
+ double angle = 0;
+ double startAngle = Prim.ProfileBegin * 2 * Math.PI;
+ double endAngle = Prim.ProfileEnd * 2 * Math.PI;
+
+ Vector3 nextOuterPoint = Vector3.Zero;
+ Vector3 nextInnerPoint = Vector3.Zero;
+
+ for (int facePoint = 0; facePoint <= LevelOfDetail; facePoint++)
+ {
+ angle = startAngle + ((double)facePoint / (double)LevelOfDetail) * (endAngle - startAngle);
+
+ nextOuterPoint.X = (float)(0.5 * Math.Cos(angle));
+ nextOuterPoint.Y = (float)(0.5 * Math.Sin(angle));
+ OuterFaces[0].AddPoint(nextOuterPoint);
+ }
+
+ if (hollow)
+ {
+ //for (int facePoint = LevelOfDetail; facePoint >= 0; facePoint--)
+ for (int facePoint = 0; facePoint <= LevelOfDetail; facePoint++)
+ {
+ angle = startAngle + ((double)facePoint / (double)LevelOfDetail) * (endAngle - startAngle);
+
+ nextInnerPoint.X = (float)(0.5 * Math.Cos(angle) * hollowRatio);
+ nextInnerPoint.Y = (float)(0.5 * Math.Sin(angle) * hollowRatio);
+ InnerFaces[0].AddPoint(nextInnerPoint);
+ }
+ }
+
+ // TODO: Texturemapping
+
+ AssignFaces();
+
+ BuildVertexes();
+ }
+
+ protected override void BuildEndCapHollow(bool top)
+ {
+ float z = top ? 0.5f : -0.5f;
+
+ // We assume the innerfaces and outerfaces point counts are the same
+ int pointCount = OuterFaces[0].GetNumPoints();
+
+ for (int j = 0; j < pointCount - 1; j++)
+ {
+ Vector3 p1 = OuterFaces[0].GetRawVertex(j);
+ Vector3 p2 = OuterFaces[0].GetRawVertex(j + 1);
+ Vector3 p3 = InnerFaces[0].GetRawVertex(j);
+ Vector3 p4 = InnerFaces[0].GetRawVertex(j + 1);
+
+ p1.Z = p2.Z = p3.Z = p4.Z = z;
+
+ // TODO: Texturemapping
+ //Vector2 t1 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r1.x + 0.5), r1.y + 0.5));
+ //Vector2 t2 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r2.x + 0.5), r2.y + 0.5));
+ //Vector2 t3 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r3.x + 0.5), r3.y + 0.5));
+ //Vector2 t4 = texturemapping.GetTextureCoordinate(new Vector2(1 - (r4.x + 0.5), r4.y + 0.5));
+
+ Vertexes.Add(new VertexPositionColor(p4, color));
+ Vertexes.Add(new VertexPositionColor(p3, color));
+ Vertexes.Add(new VertexPositionColor(p2, color));
+
+ Vertexes.Add(new VertexPositionColor(p3, color));
+ Vertexes.Add(new VertexPositionColor(p2, color));
+ Vertexes.Add(new VertexPositionColor(p1, color));
+ }
+ }
+ }
+}
diff --git a/applications/sceneviewer/Prims/PrimVisualPrism.cs b/applications/sceneviewer/Prims/PrimVisualPrism.cs
index 09f5eb18..789dd54c 100644
--- a/applications/sceneviewer/Prims/PrimVisualPrism.cs
+++ b/applications/sceneviewer/Prims/PrimVisualPrism.cs
@@ -1,38 +1,38 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using libsecondlife;
-
-namespace sceneviewer.Prims
-{
- public class PrimVisualPrism : LinearPrimVisual
- {
- public PrimVisualPrism(PrimObject prim)
- : base(prim)
- {
- ;
- }
-
- protected override void AssignFaces()
- {
- }
-
- protected override int GetCutQuadrant(float cut)
- {
- // FIXME
- //return cut / 67;
- return 0;
- }
-
- // should return angle in radians for a given cut ratio (?)
- protected override float GetAngleWithXAxis(float cut)
- {
- return (cut - (30f / 360f)) * 2 * (float)Math.PI;
- }
-
- protected override void BuildEndCapHollow(bool top)
- {
- }
- }
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using libsecondlife;
+
+namespace sceneviewer.Prims
+{
+ public class PrimVisualPrism : LinearPrimVisual
+ {
+ public PrimVisualPrism(PrimObject prim)
+ : base(prim)
+ {
+ ;
+ }
+
+ protected override void AssignFaces()
+ {
+ }
+
+ protected override int GetCutQuadrant(float cut)
+ {
+ // FIXME
+ //return cut / 67;
+ return 0;
+ }
+
+ // should return angle in radians for a given cut ratio (?)
+ protected override float GetAngleWithXAxis(float cut)
+ {
+ return (cut - (30f / 360f)) * 2 * (float)Math.PI;
+ }
+
+ protected override void BuildEndCapHollow(bool top)
+ {
+ }
+ }
}
\ No newline at end of file
diff --git a/applications/sceneviewer/Prims/PrimVisualRing.cs b/applications/sceneviewer/Prims/PrimVisualRing.cs
index 278c9fda..ea1ab9b4 100644
--- a/applications/sceneviewer/Prims/PrimVisualRing.cs
+++ b/applications/sceneviewer/Prims/PrimVisualRing.cs
@@ -1,37 +1,37 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using libsecondlife;
-
-namespace sceneviewer.Prims
-{
- public class PrimVisualRing : LinearPrimVisual
- {
- public PrimVisualRing(PrimObject prim)
- : base(prim)
- {
- ;
- }
-
- protected override void AssignFaces()
- {
- }
-
- protected override int GetCutQuadrant(float cut)
- {
- // FIXME: Our cut is already normalized, so this function won't work
- //return ((cut / 67) % 3 + 3) % 3;
- return 0;
- }
-
- protected override float GetAngleWithXAxis(float cut)
- {
- return (cut - 0.125f) * 2 * (float)Math.PI;
- }
-
- protected override void BuildEndCapHollow(bool top)
- {
- }
- }
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using libsecondlife;
+
+namespace sceneviewer.Prims
+{
+ public class PrimVisualRing : LinearPrimVisual
+ {
+ public PrimVisualRing(PrimObject prim)
+ : base(prim)
+ {
+ ;
+ }
+
+ protected override void AssignFaces()
+ {
+ }
+
+ protected override int GetCutQuadrant(float cut)
+ {
+ // FIXME: Our cut is already normalized, so this function won't work
+ //return ((cut / 67) % 3 + 3) % 3;
+ return 0;
+ }
+
+ protected override float GetAngleWithXAxis(float cut)
+ {
+ return (cut - 0.125f) * 2 * (float)Math.PI;
+ }
+
+ protected override void BuildEndCapHollow(bool top)
+ {
+ }
+ }
}
\ No newline at end of file
diff --git a/applications/sceneviewer/Prims/PrimVisualSphere.cs b/applications/sceneviewer/Prims/PrimVisualSphere.cs
index a071e8a6..02a90754 100644
--- a/applications/sceneviewer/Prims/PrimVisualSphere.cs
+++ b/applications/sceneviewer/Prims/PrimVisualSphere.cs
@@ -1,37 +1,37 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using libsecondlife;
-
-namespace sceneviewer.Prims
-{
- public class PrimVisualSphere : LinearPrimVisual
- {
- public PrimVisualSphere(PrimObject prim)
- : base(prim)
- {
- ;
- }
-
- protected override void AssignFaces()
- {
- }
-
- protected override int GetCutQuadrant(float cut)
- {
- // FIXME: ?
- return 0;
- }
-
- protected override float GetAngleWithXAxis(float cut)
- {
- // FIXME: Is this correct?
- return (cut - 0.125f) * 2 * (float)Math.PI;
- }
-
- protected override void BuildEndCapHollow(bool top)
- {
- }
- }
-}
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using libsecondlife;
+
+namespace sceneviewer.Prims
+{
+ public class PrimVisualSphere : LinearPrimVisual
+ {
+ public PrimVisualSphere(PrimObject prim)
+ : base(prim)
+ {
+ ;
+ }
+
+ protected override void AssignFaces()
+ {
+ }
+
+ protected override int GetCutQuadrant(float cut)
+ {
+ // FIXME: ?
+ return 0;
+ }
+
+ protected override float GetAngleWithXAxis(float cut)
+ {
+ // FIXME: Is this correct?
+ return (cut - 0.125f) * 2 * (float)Math.PI;
+ }
+
+ protected override void BuildEndCapHollow(bool top)
+ {
+ }
+ }
+}
diff --git a/applications/sceneviewer/Prims/PrimVisualTorus.cs b/applications/sceneviewer/Prims/PrimVisualTorus.cs
index d191ab50..3612c2f7 100644
--- a/applications/sceneviewer/Prims/PrimVisualTorus.cs
+++ b/applications/sceneviewer/Prims/PrimVisualTorus.cs
@@ -1,35 +1,35 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using libsecondlife;
-
-namespace sceneviewer.Prims
-{
- public class PrimVisualTorus : LinearPrimVisual
- {
- public PrimVisualTorus(PrimObject prim)
- : base(prim)
- {
- ;
- }
-
- protected override void AssignFaces()
- {
- }
-
- protected override int GetCutQuadrant(float cut)
- {
- return 0;
- }
-
- protected override float GetAngleWithXAxis(float cut)
- {
- return cut * 2 * (float)Math.PI;
- }
-
- protected override void BuildEndCapHollow(bool top)
- {
- }
- }
-}
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using libsecondlife;
+
+namespace sceneviewer.Prims
+{
+ public class PrimVisualTorus : LinearPrimVisual
+ {
+ public PrimVisualTorus(PrimObject prim)
+ : base(prim)
+ {
+ ;
+ }
+
+ protected override void AssignFaces()
+ {
+ }
+
+ protected override int GetCutQuadrant(float cut)
+ {
+ return 0;
+ }
+
+ protected override float GetAngleWithXAxis(float cut)
+ {
+ return cut * 2 * (float)Math.PI;
+ }
+
+ protected override void BuildEndCapHollow(bool top)
+ {
+ }
+ }
+}
diff --git a/applications/sceneviewer/Prims/PrimVisualTube.cs b/applications/sceneviewer/Prims/PrimVisualTube.cs
index 796da02b..086e57aa 100644
--- a/applications/sceneviewer/Prims/PrimVisualTube.cs
+++ b/applications/sceneviewer/Prims/PrimVisualTube.cs
@@ -1,37 +1,37 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using libsecondlife;
-
-namespace sceneviewer.Prims
-{
- public class PrimVisualTube : LinearPrimVisual
- {
- public PrimVisualTube(PrimObject prim)
- : base(prim)
- {
- ;
- }
-
- protected override void AssignFaces()
- {
- }
-
- protected override int GetCutQuadrant(float cut)
- {
- // FIXME: This is wrong
- //return ((cut / 50) % 4 + 4) % 4;
- return 0;
- }
-
- protected override float GetAngleWithXAxis(float cut)
- {
- return (cut - 0.125f) * 2 * (float)Math.PI;
- }
-
- protected override void BuildEndCapHollow(bool top)
- {
- }
- }
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using libsecondlife;
+
+namespace sceneviewer.Prims
+{
+ public class PrimVisualTube : LinearPrimVisual
+ {
+ public PrimVisualTube(PrimObject prim)
+ : base(prim)
+ {
+ ;
+ }
+
+ protected override void AssignFaces()
+ {
+ }
+
+ protected override int GetCutQuadrant(float cut)
+ {
+ // FIXME: This is wrong
+ //return ((cut / 50) % 4 + 4) % 4;
+ return 0;
+ }
+
+ protected override float GetAngleWithXAxis(float cut)
+ {
+ return (cut - 0.125f) * 2 * (float)Math.PI;
+ }
+
+ protected override void BuildEndCapHollow(bool top)
+ {
+ }
+ }
}
\ No newline at end of file
diff --git a/applications/sceneviewer/Properties/AssemblyInfo.cs b/applications/sceneviewer/Properties/AssemblyInfo.cs
index 0af0de6e..bcf8c83b 100644
--- a/applications/sceneviewer/Properties/AssemblyInfo.cs
+++ b/applications/sceneviewer/Properties/AssemblyInfo.cs
@@ -1,32 +1,32 @@
-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("sceneviewer")]
-[assembly: AssemblyProduct("sceneviewer")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyCopyright("Copyright © 2006")]
-[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("2deeb61c-062f-4ebf-837d-50924e6145e6")]
-
-// 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")]
+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("sceneviewer")]
+[assembly: AssemblyProduct("sceneviewer")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyCopyright("Copyright © 2006")]
+[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("2deeb61c-062f-4ebf-837d-50924e6145e6")]
+
+// 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/applications/sceneviewer/README.txt b/applications/sceneviewer/README.txt
index 58787d70..f731de2f 100644
--- a/applications/sceneviewer/README.txt
+++ b/applications/sceneviewer/README.txt
@@ -1,7 +1,7 @@
-sceneviewer uses XNA, a Microsoft DirectX technology for the .NET framework.
-Currently the XNA framework requires Visual C# Express (it can be installed
-alongside VS2005 or any other IDE), and the XNA Game Studio Express (XGE).
-
-C# Express: http://msdn.microsoft.com/vstudio/express/visualcsharp/
-XNA: http://msdn.microsoft.com/directx/XNA/default.aspx
+sceneviewer uses XNA, a Microsoft DirectX technology for the .NET framework.
+Currently the XNA framework requires Visual C# Express (it can be installed
+alongside VS2005 or any other IDE), and the XNA Game Studio Express (XGE).
+
+C# Express: http://msdn.microsoft.com/vstudio/express/visualcsharp/
+XNA: http://msdn.microsoft.com/directx/XNA/default.aspx
XGE: http://msdn.microsoft.com/directx/xna/gse/
\ No newline at end of file
diff --git a/applications/sceneviewer/ReallySimpleEffect.fx b/applications/sceneviewer/ReallySimpleEffect.fx
index 258a8771..1d309d60 100644
--- a/applications/sceneviewer/ReallySimpleEffect.fx
+++ b/applications/sceneviewer/ReallySimpleEffect.fx
@@ -1,27 +1,27 @@
-uniform extern float4x4 WorldViewProj : WORLDVIEWPROJECTION;
-
-struct VS_OUTPUT
-{
- float4 position : POSITION;
- float4 color : COLOR0;
-};
-
-VS_OUTPUT Transform(
- float4 Pos : POSITION,
- float4 Color : COLOR0 )
-{
- VS_OUTPUT Out = (VS_OUTPUT)0;
-
- Out.position = mul(Pos, WorldViewProj);
- Out.color = Color;
-
- return Out;
-}
-
-technique TransformTechnique
-{
- pass P0
- {
- vertexShader = compile vs_2_0 Transform();
- }
-}
+uniform extern float4x4 WorldViewProj : WORLDVIEWPROJECTION;
+
+struct VS_OUTPUT
+{
+ float4 position : POSITION;
+ float4 color : COLOR0;
+};
+
+VS_OUTPUT Transform(
+ float4 Pos : POSITION,
+ float4 Color : COLOR0 )
+{
+ VS_OUTPUT Out = (VS_OUTPUT)0;
+
+ Out.position = mul(Pos, WorldViewProj);
+ Out.color = Color;
+
+ return Out;
+}
+
+technique TransformTechnique
+{
+ pass P0
+ {
+ vertexShader = compile vs_2_0 Transform();
+ }
+}
diff --git a/applications/sceneviewer/SceneViewer.cs b/applications/sceneviewer/SceneViewer.cs
index 8702bcbe..58753c94 100644
--- a/applications/sceneviewer/SceneViewer.cs
+++ b/applications/sceneviewer/SceneViewer.cs
@@ -1,19 +1,19 @@
-using System;
-
-namespace sceneviewer
-{
- static class SceneViewer
- {
- ///
- /// The main entry point for the application.
- ///
- static void Main(string[] args)
- {
- using (Viewer game = new Viewer())
- {
- game.Run();
- }
- }
- }
-}
-
+using System;
+
+namespace sceneviewer
+{
+ static class SceneViewer
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ static void Main(string[] args)
+ {
+ using (Viewer game = new Viewer())
+ {
+ game.Run();
+ }
+ }
+ }
+}
+
diff --git a/applications/sceneviewer/Skybox/Skybox.cs b/applications/sceneviewer/Skybox/Skybox.cs
index 9e733285..403468df 100644
--- a/applications/sceneviewer/Skybox/Skybox.cs
+++ b/applications/sceneviewer/Skybox/Skybox.cs
@@ -1,10 +1,10 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace sceneviewer.Skybox
-{
- class Skybox
- {
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace sceneviewer.Skybox
+{
+ class Skybox
+ {
+ }
+}
diff --git a/applications/sceneviewer/Viewer.Designer.cs b/applications/sceneviewer/Viewer.Designer.cs
index 919c7f5d..18f5b2b9 100644
--- a/applications/sceneviewer/Viewer.Designer.cs
+++ b/applications/sceneviewer/Viewer.Designer.cs
@@ -1,21 +1,21 @@
-using System;
-
-namespace sceneviewer
-{
- partial class Viewer
- {
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.graphics = new Microsoft.Xna.Framework.Components.GraphicsComponent();
-
- this.GameComponents.Add(this.graphics);
-
- }
-
- private Microsoft.Xna.Framework.Components.GraphicsComponent graphics;
- }
-}
+using System;
+
+namespace sceneviewer
+{
+ partial class Viewer
+ {
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.graphics = new Microsoft.Xna.Framework.Components.GraphicsComponent();
+
+ this.GameComponents.Add(this.graphics);
+
+ }
+
+ private Microsoft.Xna.Framework.Components.GraphicsComponent graphics;
+ }
+}
diff --git a/applications/sceneviewer/Viewer.cs b/applications/sceneviewer/Viewer.cs
index 119e0081..a083858b 100644
--- a/applications/sceneviewer/Viewer.cs
+++ b/applications/sceneviewer/Viewer.cs
@@ -1,375 +1,375 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input;
-using libsecondlife;
-using sceneviewer.Prims;
-
-namespace sceneviewer
-{
- ///
- /// This is the main type for your game
- ///
- partial class Viewer : Microsoft.Xna.Framework.Game
- {
- private SecondLife Client;
- private Dictionary Prims;
-
- // The shader effect that we're loading
- private Effect effect;
-
- // Variables describing the shapes being drawn
- private VertexDeclaration vertexDeclaration;
-
- private Camera Camera;
- private Matrix World;
- //private WaterSurface Water;
-
- // Variables for keeping track of the state of the mouse
- private ButtonState PreviousLeftButton;
- private Vector2 PreviousMousePosition;
-
- // Keyboard stuff
- Keys[] KeysHeldDown;
- List KeysPressedThisFrame = new List();
- List KeysReleasedThisFrame = new List();
-
- // State tracking
- bool Wireframe = false;
-
- //
- private Timer CameraUpdateTimer;
-
- public Viewer()
- {
- //this.AllowUserResizing = true;
- this.IsMouseVisible = true;
-
- KeysHeldDown = Keyboard.GetState().GetPressedKeys();
-
- Window.ClientSizeChanged += new EventHandler(Window_ClientSizeChanged);
- this.Exiting += new EventHandler(Viewer_Exiting);
-
- Camera = new Camera(this.Window, new Vector3(0, 0, 40), new Vector3(256, 256, 0));
- PreviousLeftButton = ButtonState.Released;
-
- Prims = new Dictionary();
-
- Hashtable loginParams = NetworkManager.DefaultLoginValues("Ron", "Hubbard",
- "radishman", "00:00:00:00:00:00", "last", 1, 50, 50, 50, "Win", "0",
- "botmanager", "contact@libsecondlife.org");
-
- Client = new SecondLife();
-
- Client.Objects.OnNewPrim += new NewPrimCallback(OnNewPrim);
- Client.Objects.OnPrimMoved += new PrimMovedCallback(OnPrimMoved);
- Client.Objects.OnObjectKilled += new KillObjectCallback(OnObjectKilled);
-
- if (!Client.Network.Login(loginParams))
- {
- Exit();
- }
-
- InitializeComponent();
- InitializeTransform();
- InitializeEffect();
- InitializeScene();
-
- // Start the timer
- CameraUpdateTimer = new Timer(new TimerCallback(SendCameraUpdate), null, 0,
- 500);
- }
-
- bool KeyPressedThisFrame(Keys key)
- {
- if (KeysPressedThisFrame.Contains(key))
- {
- return true;
- }
- return false;
- }
-
- bool KeyReleasedThisFrame(Keys key)
- {
- if (KeysReleasedThisFrame.Contains(key))
- {
- return true;
- }
- return false;
- }
-
- Keys[] KeysHeldDownThisFrame()
- {
- return KeysHeldDown;
- }
-
- void Viewer_Exiting(object sender, GameEventArgs e)
- {
- Client.Network.Logout();
- }
-
- void Window_ClientSizeChanged(object sender, EventArgs e)
- {
- Camera.UpdateProjection(this.Window);
- }
-
- void SendCameraUpdate(object obj)
- {
- Client.Avatar.UpdateCamera(false);
- }
-
- void OnNewPrim(Simulator simulator, PrimObject prim, ulong regionHandle, ushort timeDilation)
- {
- PrimVisual primVisual = PrimVisual.BuildPrimVisual(prim);
-
- if (primVisual.GetType() == typeof(PrimVisualBox) || primVisual.GetType() == typeof(PrimVisualCylinder))
- {
- lock (Prims)
- {
- if (Prims.ContainsKey(prim.LocalID))
- {
- Prims.Remove(prim.LocalID);
- }
-
- Prims.Add(prim.LocalID, primVisual);
- }
- }
- }
-
- void OnPrimMoved(Simulator simulator, PrimUpdate primUpdate, ulong regionHandle, ushort timeDilation)
- {
- if (Prims.ContainsKey(primUpdate.LocalID))
- {
- Prims[primUpdate.LocalID].Update(primUpdate);
- }
- else
- {
- Client.Objects.RequestObject(simulator, primUpdate.LocalID);
- }
- }
-
- void OnObjectKilled(Simulator simulator, uint localID)
- {
- lock (Prims)
- {
- Prims.Remove(localID);
- }
- }
-
- private void InitializeTransform()
- {
- World = Matrix.CreateTranslation(Vector3.Zero);
- }
-
- private void InitializeEffect()
- {
- CompiledEffect compiledEffect = Effect.CompileEffectFromFile(
- "ReallySimpleEffect.fx", null, null,
- CompilerOptions.Debug |
- CompilerOptions.SkipOptimization,
- TargetPlatform.Windows);
-
- effect = new Effect(graphics.GraphicsDevice,
- compiledEffect.GetShaderCode(), CompilerOptions.None,
- null);
- }
-
- private void InitializeScene()
- {
- vertexDeclaration = new VertexDeclaration(
- graphics.GraphicsDevice, VertexPositionColor.VertexElements);
-
- //Water = new WaterSurface(graphics.GraphicsDevice, Camera, new Vector3(0, 0, 1), 0, 128, 256);
- }
-
- void UpdateInput()
- {
- // Clear our pressed and released lists.
- KeysPressedThisFrame.Clear();
- KeysReleasedThisFrame.Clear();
-
- // Interpret pressed key data between arrays to
- // figure out just-pressed and just-released keys.
- KeyboardState currentState = Keyboard.GetState();
- Keys[] currentKeys = currentState.GetPressedKeys();
-
- // First loop, looking for keys just pressed.
- for (int currentKey = 0; currentKey < currentKeys.Length; currentKey++)
- {
- bool found = false;
- for (int previousKey = 0; previousKey < KeysHeldDown.Length; previousKey++)
- {
- if (currentKeys[currentKey] == KeysHeldDown[previousKey])
- {
- // The key was pressed both this frame and last; ignore.
- found = true;
- break;
- }
- }
- if (!found)
- {
- // The key was pressed this frame, but not last frame; it was just pressed.
- KeysPressedThisFrame.Add(currentKeys[currentKey]);
- }
- }
-
- // Second loop, looking for keys just released.
- for (int previousKey = 0; previousKey < KeysHeldDown.Length; previousKey++)
- {
- bool found = false;
- for (int currentKey = 0; currentKey < currentKeys.Length; currentKey++)
- {
- if (KeysHeldDown[previousKey] == currentKeys[currentKey])
- {
- // The key was pressed both this frame and last; ignore.
- found = true;
- break;
- }
- }
- if (!found)
- {
- // The key was pressed last frame, but not this frame; it was just released.
- KeysReleasedThisFrame.Add(KeysHeldDown[previousKey]);
- }
- }
-
- // Set the held state to the current state.
- KeysHeldDown = currentKeys;
- }
-
- protected override void Update()
- {
- // The time since Update was called last
- float elapsed = (float)ElapsedTime.TotalSeconds;
-
- MouseState currentState = Mouse.GetState();
-
- Camera.Zoom = currentState.ScrollWheelValue * 0.005f;
-
- if (currentState.LeftButton == ButtonState.Pressed &&
- PreviousLeftButton == ButtonState.Pressed)
- {
- Vector2 curMouse = new Vector2(currentState.X, currentState.Y);
- Vector2 deltaMouse = PreviousMousePosition - curMouse;
-
- Camera.Theta += deltaMouse.X * 0.01f;
- Camera.Phi -= deltaMouse.Y * 0.005f;
- PreviousMousePosition = curMouse;
- }
- // It's implied that the leftPreviousState is unpressed in this situation.
- else if (currentState.LeftButton == ButtonState.Pressed)
- {
- PreviousMousePosition = new Vector2(currentState.X, currentState.Y);
- }
-
- PreviousLeftButton = currentState.LeftButton;
-
- UpdateInput();
- CheckGameKeys();
-
- // Let the GameComponents update
- UpdateComponents();
- }
-
- void CheckGameKeys()
- {
- if (KeyPressedThisFrame(Keys.W))
- {
- Wireframe = !Wireframe;
- }
- }
-
- protected override void Draw()
- {
- Matrix ViewProjectionMatrix = Camera.ViewProjectionMatrix;
-
- // Make sure we have a valid device
- if (!graphics.EnsureDevice())
- return;
-
- graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
- graphics.GraphicsDevice.BeginScene();
-
- // Let the GameComponents draw
- DrawComponents();
-
- //effect.Parameters["WorldViewProj"].SetValue(World * ViewProjectionMatrix);
- //effect.CurrentTechnique = effect.Techniques["TransformTechnique"];
- //effect.CommitChanges();
-
- graphics.GraphicsDevice.VertexDeclaration = vertexDeclaration;
- graphics.GraphicsDevice.RenderState.CullMode = CullMode.None;
-
- graphics.GraphicsDevice.RenderState.FillMode = (Wireframe) ? FillMode.WireFrame : FillMode.Solid;
-
- //graphics.GraphicsDevice.RenderState.MultiSampleAntiAlias = true;
-
- effect.Begin(EffectStateOptions.Default);
- foreach (EffectPass pass in effect.CurrentTechnique.Passes)
- {
- pass.Begin();
-
- //Water.Prepare();
- //Water.RenderCutter();
-
- //pass.End();
-
- //pass.Begin();
-
- lock (Prims)
- {
- foreach (PrimVisual prim in Prims.Values)
- {
- if (prim.Prim.ParentID != 0)
- {
- if (!Prims.ContainsKey(prim.Prim.ParentID))
- {
- // We don't have the base position for this child prim, can't render it
- continue;
- }
- else
- {
- // Child prim in a linkset
-
- // Add the base position of the parent prim and the offset position of this child
- LLVector3 llBasePosition = Prims[prim.Prim.ParentID].Prim.Position;
- LLQuaternion llBaseRotation = Prims[prim.Prim.ParentID].Prim.Rotation;
-
- Vector3 basePosition = new Vector3(llBasePosition.X, llBasePosition.Y, llBasePosition.Z);
-
- Matrix worldOffset = Matrix.CreateTranslation(basePosition);
- Matrix rootRotation = Matrix.FromQuaternion(new Quaternion(llBaseRotation.X, llBaseRotation.Y,
- llBaseRotation.Z, llBaseRotation.W));
-
- effect.Parameters["WorldViewProj"].SetValue(prim.Matrix * rootRotation * worldOffset * ViewProjectionMatrix);
- effect.CommitChanges();
-
- graphics.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList,
- prim.VertexArray.Length / 3, prim.VertexArray);
- }
- }
- else
- {
- // Root prim or not part of a linkset
-
- effect.Parameters["WorldViewProj"].SetValue(prim.Matrix * ViewProjectionMatrix);
- effect.CommitChanges();
-
- graphics.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList,
- prim.VertexArray.Length / 3, prim.VertexArray);
- }
- }
- }
-
- pass.End();
- }
- effect.End();
-
- graphics.GraphicsDevice.EndScene();
- graphics.GraphicsDevice.Present();
- }
- }
-}
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Threading;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using libsecondlife;
+using sceneviewer.Prims;
+
+namespace sceneviewer
+{
+ ///
+ /// This is the main type for your game
+ ///
+ partial class Viewer : Microsoft.Xna.Framework.Game
+ {
+ private SecondLife Client;
+ private Dictionary Prims;
+
+ // The shader effect that we're loading
+ private Effect effect;
+
+ // Variables describing the shapes being drawn
+ private VertexDeclaration vertexDeclaration;
+
+ private Camera Camera;
+ private Matrix World;
+ //private WaterSurface Water;
+
+ // Variables for keeping track of the state of the mouse
+ private ButtonState PreviousLeftButton;
+ private Vector2 PreviousMousePosition;
+
+ // Keyboard stuff
+ Keys[] KeysHeldDown;
+ List KeysPressedThisFrame = new List();
+ List KeysReleasedThisFrame = new List();
+
+ // State tracking
+ bool Wireframe = false;
+
+ //
+ private Timer CameraUpdateTimer;
+
+ public Viewer()
+ {
+ //this.AllowUserResizing = true;
+ this.IsMouseVisible = true;
+
+ KeysHeldDown = Keyboard.GetState().GetPressedKeys();
+
+ Window.ClientSizeChanged += new EventHandler(Window_ClientSizeChanged);
+ this.Exiting += new EventHandler(Viewer_Exiting);
+
+ Camera = new Camera(this.Window, new Vector3(0, 0, 40), new Vector3(256, 256, 0));
+ PreviousLeftButton = ButtonState.Released;
+
+ Prims = new Dictionary();
+
+ Hashtable loginParams = NetworkManager.DefaultLoginValues("Ron", "Hubbard",
+ "radishman", "00:00:00:00:00:00", "last", 1, 50, 50, 50, "Win", "0",
+ "botmanager", "contact@libsecondlife.org");
+
+ Client = new SecondLife();
+
+ Client.Objects.OnNewPrim += new NewPrimCallback(OnNewPrim);
+ Client.Objects.OnPrimMoved += new PrimMovedCallback(OnPrimMoved);
+ Client.Objects.OnObjectKilled += new KillObjectCallback(OnObjectKilled);
+
+ if (!Client.Network.Login(loginParams))
+ {
+ Exit();
+ }
+
+ InitializeComponent();
+ InitializeTransform();
+ InitializeEffect();
+ InitializeScene();
+
+ // Start the timer
+ CameraUpdateTimer = new Timer(new TimerCallback(SendCameraUpdate), null, 0,
+ 500);
+ }
+
+ bool KeyPressedThisFrame(Keys key)
+ {
+ if (KeysPressedThisFrame.Contains(key))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ bool KeyReleasedThisFrame(Keys key)
+ {
+ if (KeysReleasedThisFrame.Contains(key))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ Keys[] KeysHeldDownThisFrame()
+ {
+ return KeysHeldDown;
+ }
+
+ void Viewer_Exiting(object sender, GameEventArgs e)
+ {
+ Client.Network.Logout();
+ }
+
+ void Window_ClientSizeChanged(object sender, EventArgs e)
+ {
+ Camera.UpdateProjection(this.Window);
+ }
+
+ void SendCameraUpdate(object obj)
+ {
+ Client.Avatar.UpdateCamera(false);
+ }
+
+ void OnNewPrim(Simulator simulator, PrimObject prim, ulong regionHandle, ushort timeDilation)
+ {
+ PrimVisual primVisual = PrimVisual.BuildPrimVisual(prim);
+
+ if (primVisual.GetType() == typeof(PrimVisualBox) || primVisual.GetType() == typeof(PrimVisualCylinder))
+ {
+ lock (Prims)
+ {
+ if (Prims.ContainsKey(prim.LocalID))
+ {
+ Prims.Remove(prim.LocalID);
+ }
+
+ Prims.Add(prim.LocalID, primVisual);
+ }
+ }
+ }
+
+ void OnPrimMoved(Simulator simulator, PrimUpdate primUpdate, ulong regionHandle, ushort timeDilation)
+ {
+ if (Prims.ContainsKey(primUpdate.LocalID))
+ {
+ Prims[primUpdate.LocalID].Update(primUpdate);
+ }
+ else
+ {
+ Client.Objects.RequestObject(simulator, primUpdate.LocalID);
+ }
+ }
+
+ void OnObjectKilled(Simulator simulator, uint localID)
+ {
+ lock (Prims)
+ {
+ Prims.Remove(localID);
+ }
+ }
+
+ private void InitializeTransform()
+ {
+ World = Matrix.CreateTranslation(Vector3.Zero);
+ }
+
+ private void InitializeEffect()
+ {
+ CompiledEffect compiledEffect = Effect.CompileEffectFromFile(
+ "ReallySimpleEffect.fx", null, null,
+ CompilerOptions.Debug |
+ CompilerOptions.SkipOptimization,
+ TargetPlatform.Windows);
+
+ effect = new Effect(graphics.GraphicsDevice,
+ compiledEffect.GetShaderCode(), CompilerOptions.None,
+ null);
+ }
+
+ private void InitializeScene()
+ {
+ vertexDeclaration = new VertexDeclaration(
+ graphics.GraphicsDevice, VertexPositionColor.VertexElements);
+
+ //Water = new WaterSurface(graphics.GraphicsDevice, Camera, new Vector3(0, 0, 1), 0, 128, 256);
+ }
+
+ void UpdateInput()
+ {
+ // Clear our pressed and released lists.
+ KeysPressedThisFrame.Clear();
+ KeysReleasedThisFrame.Clear();
+
+ // Interpret pressed key data between arrays to
+ // figure out just-pressed and just-released keys.
+ KeyboardState currentState = Keyboard.GetState();
+ Keys[] currentKeys = currentState.GetPressedKeys();
+
+ // First loop, looking for keys just pressed.
+ for (int currentKey = 0; currentKey < currentKeys.Length; currentKey++)
+ {
+ bool found = false;
+ for (int previousKey = 0; previousKey < KeysHeldDown.Length; previousKey++)
+ {
+ if (currentKeys[currentKey] == KeysHeldDown[previousKey])
+ {
+ // The key was pressed both this frame and last; ignore.
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ // The key was pressed this frame, but not last frame; it was just pressed.
+ KeysPressedThisFrame.Add(currentKeys[currentKey]);
+ }
+ }
+
+ // Second loop, looking for keys just released.
+ for (int previousKey = 0; previousKey < KeysHeldDown.Length; previousKey++)
+ {
+ bool found = false;
+ for (int currentKey = 0; currentKey < currentKeys.Length; currentKey++)
+ {
+ if (KeysHeldDown[previousKey] == currentKeys[currentKey])
+ {
+ // The key was pressed both this frame and last; ignore.
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ // The key was pressed last frame, but not this frame; it was just released.
+ KeysReleasedThisFrame.Add(KeysHeldDown[previousKey]);
+ }
+ }
+
+ // Set the held state to the current state.
+ KeysHeldDown = currentKeys;
+ }
+
+ protected override void Update()
+ {
+ // The time since Update was called last
+ float elapsed = (float)ElapsedTime.TotalSeconds;
+
+ MouseState currentState = Mouse.GetState();
+
+ Camera.Zoom = currentState.ScrollWheelValue * 0.005f;
+
+ if (currentState.LeftButton == ButtonState.Pressed &&
+ PreviousLeftButton == ButtonState.Pressed)
+ {
+ Vector2 curMouse = new Vector2(currentState.X, currentState.Y);
+ Vector2 deltaMouse = PreviousMousePosition - curMouse;
+
+ Camera.Theta += deltaMouse.X * 0.01f;
+ Camera.Phi -= deltaMouse.Y * 0.005f;
+ PreviousMousePosition = curMouse;
+ }
+ // It's implied that the leftPreviousState is unpressed in this situation.
+ else if (currentState.LeftButton == ButtonState.Pressed)
+ {
+ PreviousMousePosition = new Vector2(currentState.X, currentState.Y);
+ }
+
+ PreviousLeftButton = currentState.LeftButton;
+
+ UpdateInput();
+ CheckGameKeys();
+
+ // Let the GameComponents update
+ UpdateComponents();
+ }
+
+ void CheckGameKeys()
+ {
+ if (KeyPressedThisFrame(Keys.W))
+ {
+ Wireframe = !Wireframe;
+ }
+ }
+
+ protected override void Draw()
+ {
+ Matrix ViewProjectionMatrix = Camera.ViewProjectionMatrix;
+
+ // Make sure we have a valid device
+ if (!graphics.EnsureDevice())
+ return;
+
+ graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
+ graphics.GraphicsDevice.BeginScene();
+
+ // Let the GameComponents draw
+ DrawComponents();
+
+ //effect.Parameters["WorldViewProj"].SetValue(World * ViewProjectionMatrix);
+ //effect.CurrentTechnique = effect.Techniques["TransformTechnique"];
+ //effect.CommitChanges();
+
+ graphics.GraphicsDevice.VertexDeclaration = vertexDeclaration;
+ graphics.GraphicsDevice.RenderState.CullMode = CullMode.None;
+
+ graphics.GraphicsDevice.RenderState.FillMode = (Wireframe) ? FillMode.WireFrame : FillMode.Solid;
+
+ //graphics.GraphicsDevice.RenderState.MultiSampleAntiAlias = true;
+
+ effect.Begin(EffectStateOptions.Default);
+ foreach (EffectPass pass in effect.CurrentTechnique.Passes)
+ {
+ pass.Begin();
+
+ //Water.Prepare();
+ //Water.RenderCutter();
+
+ //pass.End();
+
+ //pass.Begin();
+
+ lock (Prims)
+ {
+ foreach (PrimVisual prim in Prims.Values)
+ {
+ if (prim.Prim.ParentID != 0)
+ {
+ if (!Prims.ContainsKey(prim.Prim.ParentID))
+ {
+ // We don't have the base position for this child prim, can't render it
+ continue;
+ }
+ else
+ {
+ // Child prim in a linkset
+
+ // Add the base position of the parent prim and the offset position of this child
+ LLVector3 llBasePosition = Prims[prim.Prim.ParentID].Prim.Position;
+ LLQuaternion llBaseRotation = Prims[prim.Prim.ParentID].Prim.Rotation;
+
+ Vector3 basePosition = new Vector3(llBasePosition.X, llBasePosition.Y, llBasePosition.Z);
+
+ Matrix worldOffset = Matrix.CreateTranslation(basePosition);
+ Matrix rootRotation = Matrix.FromQuaternion(new Quaternion(llBaseRotation.X, llBaseRotation.Y,
+ llBaseRotation.Z, llBaseRotation.W));
+
+ effect.Parameters["WorldViewProj"].SetValue(prim.Matrix * rootRotation * worldOffset * ViewProjectionMatrix);
+ effect.CommitChanges();
+
+ graphics.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList,
+ prim.VertexArray.Length / 3, prim.VertexArray);
+ }
+ }
+ else
+ {
+ // Root prim or not part of a linkset
+
+ effect.Parameters["WorldViewProj"].SetValue(prim.Matrix * ViewProjectionMatrix);
+ effect.CommitChanges();
+
+ graphics.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList,
+ prim.VertexArray.Length / 3, prim.VertexArray);
+ }
+ }
+ }
+
+ pass.End();
+ }
+ effect.End();
+
+ graphics.GraphicsDevice.EndScene();
+ graphics.GraphicsDevice.Present();
+ }
+ }
+}
diff --git a/applications/sceneviewer/Water/NoiseMaker.cs b/applications/sceneviewer/Water/NoiseMaker.cs
index 877f51e1..e1413bbb 100644
--- a/applications/sceneviewer/Water/NoiseMaker.cs
+++ b/applications/sceneviewer/Water/NoiseMaker.cs
@@ -1,525 +1,525 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-
-namespace sceneviewer
-{
- class NoiseMaker
- {
- // Constants
- public const int nbits = 5;
- public const int nsize = 1 << (nbits - 1);
- public const int nsizem1 = nsize - 1;
- public const int nsizesq = nsize * nsize;
- public const int nsizesqm1 = nsizesq - 1;
-
- public const int npacksize = 4;
-
- public const int npbits = nbits + npacksize - 1;
- public const int npsize = 1 << (npbits - 1);
- public const int npsizem1 = npsize - 1;
- public const int npsizesq = npsize * npsize;
- public const int npsizesqm1 = npsizesq - 1;
-
- public const int ndecbits = 12;
- public const int ndecmagn = 4096;
- public const int ndecmagnm1 = 4095;
-
- public const int maxoctaves = 8;
-
- public const int noiseframes = 256;
- public const int noiseframesm1 = noiseframes - 1;
-
- public const int noisedecbits = 15;
- public const int noisemagnitude = 1 << (noisedecbits - 1);
-
- public const int scaledecbits = 15;
- public const int scalemagnitude = 1 << (scaledecbits - 1);
-
- public const int nmapsizex = 512;
- public const int nmapsizey = 1024;
-
- public const float FALLOFF = 0.607f;
- public const float ANIMSPEED = 1.4f;
- public const float TIMEMULTI = 1.27f;
- public const float ELEVATION = 7.0f;
- public const float SCALE = 0.38f;
- public const bool SMOOTH = false;
- public const bool DISPLACE = false;
-
- // Public members
- public VertexPositionNormalTexture[] Vertices;
- public Texture2D HeightMap;
- public Texture2D NormalMap;
- public Texture2D[] PackedNoise;
- public Surface DepthStencil;
-
- private GraphicsDevice Device;
- private int Octaves;
- private float[] Multitable;
- private int then;
- private double time;
- private int[] Onoise;
- private int[] Pnoise;
- private Vector3 eu, ev;
- private Vector4 tcorners0, tcorners1, tcorners2, tcorners3;
- private int sizeX, sizeY; // framebuffer size
- private int fsizeX, fsizeY;
-
- public NoiseMaker(GraphicsDevice device, int gridSizeX, int gridSizeY)
- {
- Device = device;
- Multitable = new float[maxoctaves];
- Onoise = new int[nsizesq * maxoctaves];
- Pnoise = new int[npsizesq * (maxoctaves >> (npacksize - 1))];
-
- sizeX = gridSizeX;
- sizeY = gridSizeY;
- time = 0.0d;
- then = Environment.TickCount;
- Octaves = 0; // Don't want to have the noise accessed before it's calculated
- fsizeX = sizeX;
- fsizeY = sizeY;
-
- // Reset normals
- Vertices = new VertexPositionNormalTexture[sizeX * sizeY];
- for (int v = 0; v < sizeY; v++)
- {
- for (int u = 0; u < sizeX; u++)
- {
- // FIXME: Should this be UnitZ?
- Vertices[v * sizeX + u].Normal = Vector3.UnitY;
- Vertices[v * sizeX + u].TextureCoordinate = new Vector2((float)u / (sizeX - 1), (float)v / (sizeY - 1));
- }
- }
-
- InitNoise();
- LoadEffects();
- InitTextures();
- }
-
- public bool RenderGeometry(Matrix m)
- {
- CalculateNoise();
-
- float magnitude = ndecmagn * SCALE;
- float invmagnitudesq = 1.0f / (SCALE * SCALE);
-
- Matrix minv = Matrix.Invert(m);
- eu = Vector3.Normalize(Vector3.TransformNormal(Vector3.UnitX, m));
- ev = Vector3.Normalize(Vector3.TransformNormal(Vector3.UnitY, m));
-
- tcorners0 = CalculateWorldPos(Vector2.Zero, m);
- tcorners1 = CalculateWorldPos(Vector2.UnitX, m);
- tcorners2 = CalculateWorldPos(Vector2.UnitY, m);
- tcorners3 = CalculateWorldPos(Vector2.One, m);
-
- Matrix surfacetoworld;
-
- float du = 1.0f / (float)(sizeX - 1);
- float dv = 1.0f / (float)(sizeY - 1);
- float u = 0;
- float v = 0;
- Vector4 result;
- int i = 0;
-
- for(int iv = 0; iv < sizeY; iv++)
- {
- u = 0;
-
- for(int iu = 0; iu < sizeX; iu++)
- {
- result.X = (1 - v) * ( (1 - u) * tcorners0.X + u * tcorners1.X ) +
- v * ((1 - u) * tcorners2.X + u * tcorners3.X);
- result.Z = (1 - v) * ( (1 - u) * tcorners0.Z + u * tcorners1.Z ) +
- v * ((1 - u) * tcorners2.Z + u * tcorners3.Z);
- result.W = (1 - v) * ( (1 - u) * tcorners0.W + u * tcorners1.W ) +
- v * ((1 - u) * tcorners2.W + u * tcorners3.W);
-
- float divide = 1 / result.W;
- result.X *= divide;
- result.Z *= divide;
-
- // FIXME: The GetHeightDual should return a Z value instead?
- Vertices[i].Position = new Vector3(result.X,
- GetHeightDual((int)(magnitude * result.X), (int)(magnitude * result.Z)), result.Z);
-
- i++;
- u += du;
- }
-
- v += dv;
- }
-
- // smooth the heightdata
- if(SMOOTH)
- {
- for(int v1 = 1; v1 < (sizeY - 1); v1++)
- {
- for(int u1 = 1; u1 < (sizeX - 1); u1++)
- {
- // FIXME: We should be smoothing the Z values instead
- Vector3 v1sizeXu1 = Vertices[v1 * sizeX + u1].Position;
- v1sizeXu1.Y = 0.2f * (Vertices[v1 * sizeX + u1].Position.Y +
- Vertices[v1 * sizeX + (u1 + 1)].Position.Y +
- Vertices[v1 * sizeX + (u1 - 1)].Position.Y +
- Vertices[(v1 + 1) * sizeX + u1].Position.Y +
- Vertices[(v1 - 1) * sizeX + u1].Position.Y);
- Vertices[v1 * sizeX + u1].Position = v1sizeXu1;
- }
- }
- }
-
- if(!DISPLACE)
- {
- // Reset height to 0
- for(int u1 = 0; u1 < (sizeX * sizeY); u1++)
- {
- // FIXME: Should be Z?
- Vertices[u1].Position = new Vector3(Vertices[u1].Position.X, 0, Vertices[u1].Position.Z);
- }
- }
-
- UploadNoise();
-
- return true;
- }
-
- public void GenerateNormalMap()
- {
- // Do the heightmap thingy
- Surface bb = Device.GetRenderTarget(0);
- Surface target = HeightMap.GetSurfaceLevel(0);
- Surface olddepthstencil = Device.DepthStencilSurface;
-
- //hr = device->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW );
- //device->SetStreamSource( 0, surf_software_vertices, 0, sizeof(SOFTWARESURFACEVERTEX) );
- //hr = device->SetFVF( D3DFVF_SOFTWARESURFACEVERTEX);
- //device->SetIndices(surf->surf_indicies);
- hr = hmap_effect->Begin(NULL,NULL);
- hmap_effect->BeginPass(0);
-
- hmap_effect->SetTexture("noise0",packed_noise_texture[0]);
- hmap_effect->SetTexture("noise1",packed_noise_texture[1]);
-
- hr = device->SetRenderTarget( 0, target );
- device->SetDepthStencilSurface( depthstencil );
- //device->Clear( 0, NULL,D3DCLEAR_TARGET, D3DCOLOR_XRGB(255,128,28), 1.0f, 0 );
- device->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
- device->DrawIndexedPrimitive( D3DPT_TRIANGLELIST, 0, 0, sizeX*sizeY, 0, 2*(sizeX-1)*(sizeY-1) );
- hmap_effect->EndPass();
- hmap_effect->End();
-
- // calculate normalmap
-
- hr = normalmap->GetSurfaceLevel( 0,&target );
- hr = device->SetRenderTarget( 0, target );
- hr = nmap_effect->Begin(NULL,NULL);
- nmap_effect->BeginPass(0);
- nmap_effect->SetFloat("inv_mapsize_x", 1.0f/nmapsize_x);
- nmap_effect->SetFloat("inv_mapsize_y", 1.0f/nmapsize_y);
- nmap_effect->SetVector("corner00", &t_corners0 );
- nmap_effect->SetVector("corner01", &t_corners1 );
- nmap_effect->SetVector("corner10", &t_corners2 );
- nmap_effect->SetVector("corner11", &t_corners3 );
- nmap_effect->SetFloat("amplitude", 2 * STRENGTH);
- nmap_effect->SetTexture("hmap",heightmap);
- device->DrawIndexedPrimitive( D3DPT_TRIANGLELIST, 0, 0, sizeX*sizeY, 0, 2*(sizeX-1)*(sizeY-1) );
- nmap_effect->EndPass();
- nmap_effect->End();
-
- // restore the device
- device->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
- device->SetRenderTarget( 0, bb );
- device->SetDepthStencilSurface( old_depthstencil );
- }
-
- private void InitNoise()
- {
- Random rand = new Random();
-
- // create noise (uniform)
- float[] tempnoise = new float[nsizesq * noiseframes];
- for(int i = 0; i < (nsizesq * noiseframes); i++)
- {
- float temp = (float)rand.NextDouble(RANDMAX);
- tempnoise[i] = 4 * (temp - 0.5f);
- }
-
- for(int frame = 0; frame < noiseframes; frame++)
- {
- for(int v = 0; v < nsize; v++)
- {
- for(int u = 0; u < nsize; u++)
- {
- int v0 = ((v - 1) & nsizem1) * nsize,
- v1 = v * nsize,
- v2 = ((v + 1) & nsizem1) * nsize,
- u0 = ((u - 1) & nsizem1),
- u1 = u,
- u2 = ((u + 1) & nsizem1),
- f = frame * nsizesq;
- float temp = (1.0f / 14.0f) * (tempnoise[f + v0 + u0] + tempnoise[f + v0 + u1] + tempnoise[f + v0 + u2] +
- tempnoise[f + v1 + u0] + 6.0f * tempnoise[f + v1 + u1] + tempnoise[f + v1 + u2] +
- tempnoise[f + v2 + u0] + tempnoise[f + v2 + u1] + tempnoise[f + v2 + u2]);
-
- noise[frame * nsizesq + v * nsize + u] = noisemagnitude * temp;
- }
- }
- }
- }
-
- private void InitTextures()
- {
- PackedNoise = new Texture2D[2];
- PackedNoise[0] = new Texture2D(Device, npsize, npsize, 0, ResourceUsage.Dynamic, SurfaceFormat.Luminance16,
- ResourcePool.Default);
- PackedNoise[1] = new Texture2D(Device, npsize, npsize, 0, ResourceUsage.Dynamic, SurfaceFormat.Luminance16,
- ResourcePool.Default);
-
- HeightMap = new Texture2D(Device, nmapsizex, nmapsizey, 1, ResourceUsage.RenderTarget, SurfaceFormat.Rgba64,
- ResourcePool.Default);
- NormalMap = new Texture2D(Device, nmapsizex, nmapsizey, 1, ResourceUsage.AutoGenerateMipMap |
- ResourceUsage.RenderTarget, SurfaceFormat.Rgba64, ResourcePool.Default);
-
- // Create the stencil buffer
- DepthStencil = Device.CreateDepthStencilSurface(nmapsizex, nmapsizey, DepthFormat.Depth24Stencil8,
- MultiSampleType.None, 0, true);
- }
-
- private void LoadEffects()
- {
- char* errortext;
- LPD3DXBUFFER errors;
- D3DXHANDLE hTechnique;
-
- // load effect
- D3DXCreateEffectFromFile(device, "v2_heightmapgen.fx",
- NULL, NULL, 0, NULL, &hmap_effect, &errors);
-
- if (errors != NULL)
- {
- errortext = (char*)errors->GetBufferPointer();
- MessageBox(NULL, errortext, "hmap_effect", MB_OK);
- }
-
- hmap_effect->FindNextValidTechnique(NULL, &hTechnique);
- hmap_effect->SetTechnique(hTechnique);
-
- // load effect
- D3DXCreateEffectFromFile(device, "v2_normalmapgen.fx",
- NULL, NULL, 0, NULL, &nmap_effect, &errors);
-
- if (errors != NULL)
- {
- errortext = (char*)errors->GetBufferPointer();
- MessageBox(NULL, errortext, "nmap_effect", MB_OK);
- }
-
- nmap_effect->FindNextValidTechnique(NULL, &hTechnique);
- nmap_effect->SetTechnique(hTechnique);
- }
-
- // FIXME: Should this be (0,0,1,0) ?
- // Check the point of intersection with the plane (0,1,0,0) and return the position in homogenous coordinates
- private Vector4 CalculateWorldPos(Vector2 uv, Matrix m)
- {
- Vector4 origin = new Vector4(uv.X, uv.Y, -1, 1);
- Vector4 direction = new Vector4(uv.X, uv.Y, 1, 1);
-
- origin = Vector4.Transform(origin, m);
- direction = Vector4.Transform(direction, m);
-
- float l = -origin.Y / direction.Y;
-
- Vector4 worldpos = origin + direction * l;
- return worldpos;
- }
-
- private void CalculateNoise()
- {
- Octaves = maxoctaves;
-
- // Calculate the strength of each octave
- float sum = 0;
-
- for (int i = 0; i < Octaves; i++)
- {
- Multitable[i] = (float)Math.Pow(FALLOFF, 1 * i);
- sum += Multitable[i];
- }
-
- for (int i = 0; i < Octaves; i++)
- {
- Multitable[i] /= sum;
- }
-
- for (int i = 0; i < Octaves; i++)
- {
- Multitable[i] = scalemagnitude * Multitable[i];
- }
-
- int now = Environment.TickCount;
- double timechange = (double)(now - then);
- then = now;
- timechange *= 0.001d * ANIMSPEED;
- double lptimechange = 0.99d * lptimechange + 0.01d * timechange;
- time += lptimechange;
-
- double rtimemulti = 1;
-
- for(int o = 0; o < Octaves; o++)
- {
- uint[] image = new uint[3];
- int[] amount = new int[3];
- int iimage = (int)(time * rtimemulti);
- double fraction = (time * rtimemulti) - (double)iimage;
-
- amount[0] = scalemagnitude * Multitable[o] * (Math.Pow(Math.Sin((fraction + 2) * Math.PI / 3), 2) / 1.5d);
- amount[1] = scalemagnitude * Multitable[o] * (Math.Pow(Math.Sin((fraction + 1) * Math.PI / 3), 2) / 1.5d);
- amount[2] = scalemagnitude * Multitable[o] * (Math.Pow(Math.Sin((fraction) * Math.PI / 3), 2) / 1.5d);
- image[0] = (iimage) & noiseframesm1;
- image[1] = (iimage + 1) & noiseframesm1;
- image[2] = (iimage + 2) & noiseframesm1;
- {
- for(int i = 0; i < nsizesq; i++)
- {
- o_noise[i + nsizesq*o] = (((amount[0] * noise[i + nsizesq * image[0]])>>scaledecimalbits) +
- ((amount[1] * noise[i + nsizesq * image[1]])>>scaledecimalbits) +
- ((amount[2] * noise[i + nsizesq * image[2]])>>scaledecimalbits));
- }
- }
-
- rtimemulti *= TIMEMULTI;
- }
-
- if (packednoise)
- {
- int octavepack = 0;
-
- for (int o = 0; o < Octaves; o += npacksize)
- {
- for (int v = 0; v < npsize; v++)
- for (int u = 0; u < npsize; u++)
- {
- Pnoise[v*npsize+u+octavepack*npsize_sq] = o_noise[(o+3)*nsizesq + (v&nsizem1)*nsize + (u&nsizem1)];
- Pnoise[v*npsize+u+octavepack*npsize_sq] += mapsample( u, v, 3, o);
- Pnoise[v*npsize+u+octavepack*npsize_sq] += mapsample( u, v, 2, o+1);
- Pnoise[v*npsize+u+octavepack*npsize_sq] += mapsample( u, v, 1, o+2);
- }
-
- octavepack++;
- }
- }
- }
-
- //private void CalculateNormals()
- //{
- // ;
- //}
-
- private void UploadNoise()
- {
- D3DLOCKED_RECT locked;
- ushort data;
- int[] tempdata = new int[npsizesq];
-
- for(int t = 0; t < 2; t++)
- {
- int offset = npsizesq * t;
- // upload the first level
- packed_noise_texture[t]->LockRect( 0, &locked, NULL, D3DLOCK_DISCARD );
- data = (ushort*)locked.pBits;
- for(int i=0; iUnlockRect( 0 );
-
- int c = packed_noise_texture[t]->GetLevelCount();
-
- // calculate the second level, and upload it
- HRESULT hr = packed_noise_texture[t]->LockRect( 1, &locked, NULL, 0 );
- data = (ushort*)locked.pBits;
- int sz = npsize>>1;
- for(int v=0; v>2;
- data[v*sz+u] = 32768+tempdata[v*npsize + u];
- }
- }
-
- packed_noise_texture[t]->UnlockRect( 1 );
-
- for(int j=2; jLockRect( j, &locked, NULL, 0 );
- data = (ushort*)locked.pBits;
- int pitch = (locked.Pitch)>>1;
- sz = npsize>>j;
- for(int v=0; v>2;
- data[v*pitch+u] = 32768+tempdata[v*npsize + u];
- }
- }
- packed_noise_texture[t]->UnlockRect( j );
- }
- }
- }
-
- private int MapSample(int u, int v, int upsamplepower, int octave)
- {
- ;
- }
-
- private float ReadtexelNearest(int u, int v)
- {
- int lu, lv;
- lu = (u>>ndecbits)&nsizem1;
- lv = (v>>ndecbits)&nsizem1;
-
- return (float)noise[lv*nsize + lu];
- }
-
- private int ReadtexelLinearDual(int u, int v, int o)
- {
- int iu, iup, iv, ivp, fu, fv;
- iu = (u>>ndecbits)&npsizem1;
- iv = ((v>>ndecbits)&npsizem1)*npsize;
-
- iup = ((u>>ndecbits) + 1)&npsizem1;
- ivp = (((v>>ndecbits) + 1)&npsizem1)*npsize;
-
- fu = u & ndecmagn_m1;
- fv = v & ndecmagn_m1;
-
- int ut01 = ((ndecmagn-fu)*Rnoise[iv + iu] + fu*Rnoise[iv + iup])>>ndecbits;
- int ut23 = ((ndecmagn-fu)*Rnoise[ivp + iu] + fu*Rnoise[ivp + iup])>>ndecbits;
- int ut = ((ndecmagn-fv)*ut01 + fv*ut23) >> ndecbits;
-
- return ut;
- }
-
- // FIXME: This function uses pointer magic that needs to be fixed for C#
- private float GetHeightDual(int u, int v)
- {
- int value = 0;
- Rnoise = Pnoise; // pointer to the current noise source octave
- int hoct = Octaves / npacksize;
-
- for(int i = 0; i < hoct; i++)
- {
- value += ReadtexelLinearDual(u, v, 0);
- u = u << npacksize;
- v = v << npacksize;
- Rnoise += npsizesq;
- }
-
- return value * STRENGTH / noisemagnitude;
- }
- }
-}
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace sceneviewer
+{
+ class NoiseMaker
+ {
+ // Constants
+ public const int nbits = 5;
+ public const int nsize = 1 << (nbits - 1);
+ public const int nsizem1 = nsize - 1;
+ public const int nsizesq = nsize * nsize;
+ public const int nsizesqm1 = nsizesq - 1;
+
+ public const int npacksize = 4;
+
+ public const int npbits = nbits + npacksize - 1;
+ public const int npsize = 1 << (npbits - 1);
+ public const int npsizem1 = npsize - 1;
+ public const int npsizesq = npsize * npsize;
+ public const int npsizesqm1 = npsizesq - 1;
+
+ public const int ndecbits = 12;
+ public const int ndecmagn = 4096;
+ public const int ndecmagnm1 = 4095;
+
+ public const int maxoctaves = 8;
+
+ public const int noiseframes = 256;
+ public const int noiseframesm1 = noiseframes - 1;
+
+ public const int noisedecbits = 15;
+ public const int noisemagnitude = 1 << (noisedecbits - 1);
+
+ public const int scaledecbits = 15;
+ public const int scalemagnitude = 1 << (scaledecbits - 1);
+
+ public const int nmapsizex = 512;
+ public const int nmapsizey = 1024;
+
+ public const float FALLOFF = 0.607f;
+ public const float ANIMSPEED = 1.4f;
+ public const float TIMEMULTI = 1.27f;
+ public const float ELEVATION = 7.0f;
+ public const float SCALE = 0.38f;
+ public const bool SMOOTH = false;
+ public const bool DISPLACE = false;
+
+ // Public members
+ public VertexPositionNormalTexture[] Vertices;
+ public Texture2D HeightMap;
+ public Texture2D NormalMap;
+ public Texture2D[] PackedNoise;
+ public Surface DepthStencil;
+
+ private GraphicsDevice Device;
+ private int Octaves;
+ private float[] Multitable;
+ private int then;
+ private double time;
+ private int[] Onoise;
+ private int[] Pnoise;
+ private Vector3 eu, ev;
+ private Vector4 tcorners0, tcorners1, tcorners2, tcorners3;
+ private int sizeX, sizeY; // framebuffer size
+ private int fsizeX, fsizeY;
+
+ public NoiseMaker(GraphicsDevice device, int gridSizeX, int gridSizeY)
+ {
+ Device = device;
+ Multitable = new float[maxoctaves];
+ Onoise = new int[nsizesq * maxoctaves];
+ Pnoise = new int[npsizesq * (maxoctaves >> (npacksize - 1))];
+
+ sizeX = gridSizeX;
+ sizeY = gridSizeY;
+ time = 0.0d;
+ then = Environment.TickCount;
+ Octaves = 0; // Don't want to have the noise accessed before it's calculated
+ fsizeX = sizeX;
+ fsizeY = sizeY;
+
+ // Reset normals
+ Vertices = new VertexPositionNormalTexture[sizeX * sizeY];
+ for (int v = 0; v < sizeY; v++)
+ {
+ for (int u = 0; u < sizeX; u++)
+ {
+ // FIXME: Should this be UnitZ?
+ Vertices[v * sizeX + u].Normal = Vector3.UnitY;
+ Vertices[v * sizeX + u].TextureCoordinate = new Vector2((float)u / (sizeX - 1), (float)v / (sizeY - 1));
+ }
+ }
+
+ InitNoise();
+ LoadEffects();
+ InitTextures();
+ }
+
+ public bool RenderGeometry(Matrix m)
+ {
+ CalculateNoise();
+
+ float magnitude = ndecmagn * SCALE;
+ float invmagnitudesq = 1.0f / (SCALE * SCALE);
+
+ Matrix minv = Matrix.Invert(m);
+ eu = Vector3.Normalize(Vector3.TransformNormal(Vector3.UnitX, m));
+ ev = Vector3.Normalize(Vector3.TransformNormal(Vector3.UnitY, m));
+
+ tcorners0 = CalculateWorldPos(Vector2.Zero, m);
+ tcorners1 = CalculateWorldPos(Vector2.UnitX, m);
+ tcorners2 = CalculateWorldPos(Vector2.UnitY, m);
+ tcorners3 = CalculateWorldPos(Vector2.One, m);
+
+ Matrix surfacetoworld;
+
+ float du = 1.0f / (float)(sizeX - 1);
+ float dv = 1.0f / (float)(sizeY - 1);
+ float u = 0;
+ float v = 0;
+ Vector4 result;
+ int i = 0;
+
+ for(int iv = 0; iv < sizeY; iv++)
+ {
+ u = 0;
+
+ for(int iu = 0; iu < sizeX; iu++)
+ {
+ result.X = (1 - v) * ( (1 - u) * tcorners0.X + u * tcorners1.X ) +
+ v * ((1 - u) * tcorners2.X + u * tcorners3.X);
+ result.Z = (1 - v) * ( (1 - u) * tcorners0.Z + u * tcorners1.Z ) +
+ v * ((1 - u) * tcorners2.Z + u * tcorners3.Z);
+ result.W = (1 - v) * ( (1 - u) * tcorners0.W + u * tcorners1.W ) +
+ v * ((1 - u) * tcorners2.W + u * tcorners3.W);
+
+ float divide = 1 / result.W;
+ result.X *= divide;
+ result.Z *= divide;
+
+ // FIXME: The GetHeightDual should return a Z value instead?
+ Vertices[i].Position = new Vector3(result.X,
+ GetHeightDual((int)(magnitude * result.X), (int)(magnitude * result.Z)), result.Z);
+
+ i++;
+ u += du;
+ }
+
+ v += dv;
+ }
+
+ // smooth the heightdata
+ if(SMOOTH)
+ {
+ for(int v1 = 1; v1 < (sizeY - 1); v1++)
+ {
+ for(int u1 = 1; u1 < (sizeX - 1); u1++)
+ {
+ // FIXME: We should be smoothing the Z values instead
+ Vector3 v1sizeXu1 = Vertices[v1 * sizeX + u1].Position;
+ v1sizeXu1.Y = 0.2f * (Vertices[v1 * sizeX + u1].Position.Y +
+ Vertices[v1 * sizeX + (u1 + 1)].Position.Y +
+ Vertices[v1 * sizeX + (u1 - 1)].Position.Y +
+ Vertices[(v1 + 1) * sizeX + u1].Position.Y +
+ Vertices[(v1 - 1) * sizeX + u1].Position.Y);
+ Vertices[v1 * sizeX + u1].Position = v1sizeXu1;
+ }
+ }
+ }
+
+ if(!DISPLACE)
+ {
+ // Reset height to 0
+ for(int u1 = 0; u1 < (sizeX * sizeY); u1++)
+ {
+ // FIXME: Should be Z?
+ Vertices[u1].Position = new Vector3(Vertices[u1].Position.X, 0, Vertices[u1].Position.Z);
+ }
+ }
+
+ UploadNoise();
+
+ return true;
+ }
+
+ public void GenerateNormalMap()
+ {
+ // Do the heightmap thingy
+ Surface bb = Device.GetRenderTarget(0);
+ Surface target = HeightMap.GetSurfaceLevel(0);
+ Surface olddepthstencil = Device.DepthStencilSurface;
+
+ //hr = device->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW );
+ //device->SetStreamSource( 0, surf_software_vertices, 0, sizeof(SOFTWARESURFACEVERTEX) );
+ //hr = device->SetFVF( D3DFVF_SOFTWARESURFACEVERTEX);
+ //device->SetIndices(surf->surf_indicies);
+ hr = hmap_effect->Begin(NULL,NULL);
+ hmap_effect->BeginPass(0);
+
+ hmap_effect->SetTexture("noise0",packed_noise_texture[0]);
+ hmap_effect->SetTexture("noise1",packed_noise_texture[1]);
+
+ hr = device->SetRenderTarget( 0, target );
+ device->SetDepthStencilSurface( depthstencil );
+ //device->Clear( 0, NULL,D3DCLEAR_TARGET, D3DCOLOR_XRGB(255,128,28), 1.0f, 0 );
+ device->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
+ device->DrawIndexedPrimitive( D3DPT_TRIANGLELIST, 0, 0, sizeX*sizeY, 0, 2*(sizeX-1)*(sizeY-1) );
+ hmap_effect->EndPass();
+ hmap_effect->End();
+
+ // calculate normalmap
+
+ hr = normalmap->GetSurfaceLevel( 0,&target );
+ hr = device->SetRenderTarget( 0, target );
+ hr = nmap_effect->Begin(NULL,NULL);
+ nmap_effect->BeginPass(0);
+ nmap_effect->SetFloat("inv_mapsize_x", 1.0f/nmapsize_x);
+ nmap_effect->SetFloat("inv_mapsize_y", 1.0f/nmapsize_y);
+ nmap_effect->SetVector("corner00", &t_corners0 );
+ nmap_effect->SetVector("corner01", &t_corners1 );
+ nmap_effect->SetVector("corner10", &t_corners2 );
+ nmap_effect->SetVector("corner11", &t_corners3 );
+ nmap_effect->SetFloat("amplitude", 2 * STRENGTH);
+ nmap_effect->SetTexture("hmap",heightmap);
+ device->DrawIndexedPrimitive( D3DPT_TRIANGLELIST, 0, 0, sizeX*sizeY, 0, 2*(sizeX-1)*(sizeY-1) );
+ nmap_effect->EndPass();
+ nmap_effect->End();
+
+ // restore the device
+ device->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
+ device->SetRenderTarget( 0, bb );
+ device->SetDepthStencilSurface( old_depthstencil );
+ }
+
+ private void InitNoise()
+ {
+ Random rand = new Random();
+
+ // create noise (uniform)
+ float[] tempnoise = new float[nsizesq * noiseframes];
+ for(int i = 0; i < (nsizesq * noiseframes); i++)
+ {
+ float temp = (float)rand.NextDouble(RANDMAX);
+ tempnoise[i] = 4 * (temp - 0.5f);
+ }
+
+ for(int frame = 0; frame < noiseframes; frame++)
+ {
+ for(int v = 0; v < nsize; v++)
+ {
+ for(int u = 0; u < nsize; u++)
+ {
+ int v0 = ((v - 1) & nsizem1) * nsize,
+ v1 = v * nsize,
+ v2 = ((v + 1) & nsizem1) * nsize,
+ u0 = ((u - 1) & nsizem1),
+ u1 = u,
+ u2 = ((u + 1) & nsizem1),
+ f = frame * nsizesq;
+ float temp = (1.0f / 14.0f) * (tempnoise[f + v0 + u0] + tempnoise[f + v0 + u1] + tempnoise[f + v0 + u2] +
+ tempnoise[f + v1 + u0] + 6.0f * tempnoise[f + v1 + u1] + tempnoise[f + v1 + u2] +
+ tempnoise[f + v2 + u0] + tempnoise[f + v2 + u1] + tempnoise[f + v2 + u2]);
+
+ noise[frame * nsizesq + v * nsize + u] = noisemagnitude * temp;
+ }
+ }
+ }
+ }
+
+ private void InitTextures()
+ {
+ PackedNoise = new Texture2D[2];
+ PackedNoise[0] = new Texture2D(Device, npsize, npsize, 0, ResourceUsage.Dynamic, SurfaceFormat.Luminance16,
+ ResourcePool.Default);
+ PackedNoise[1] = new Texture2D(Device, npsize, npsize, 0, ResourceUsage.Dynamic, SurfaceFormat.Luminance16,
+ ResourcePool.Default);
+
+ HeightMap = new Texture2D(Device, nmapsizex, nmapsizey, 1, ResourceUsage.RenderTarget, SurfaceFormat.Rgba64,
+ ResourcePool.Default);
+ NormalMap = new Texture2D(Device, nmapsizex, nmapsizey, 1, ResourceUsage.AutoGenerateMipMap |
+ ResourceUsage.RenderTarget, SurfaceFormat.Rgba64, ResourcePool.Default);
+
+ // Create the stencil buffer
+ DepthStencil = Device.CreateDepthStencilSurface(nmapsizex, nmapsizey, DepthFormat.Depth24Stencil8,
+ MultiSampleType.None, 0, true);
+ }
+
+ private void LoadEffects()
+ {
+ char* errortext;
+ LPD3DXBUFFER errors;
+ D3DXHANDLE hTechnique;
+
+ // load effect
+ D3DXCreateEffectFromFile(device, "v2_heightmapgen.fx",
+ NULL, NULL, 0, NULL, &hmap_effect, &errors);
+
+ if (errors != NULL)
+ {
+ errortext = (char*)errors->GetBufferPointer();
+ MessageBox(NULL, errortext, "hmap_effect", MB_OK);
+ }
+
+ hmap_effect->FindNextValidTechnique(NULL, &hTechnique);
+ hmap_effect->SetTechnique(hTechnique);
+
+ // load effect
+ D3DXCreateEffectFromFile(device, "v2_normalmapgen.fx",
+ NULL, NULL, 0, NULL, &nmap_effect, &errors);
+
+ if (errors != NULL)
+ {
+ errortext = (char*)errors->GetBufferPointer();
+ MessageBox(NULL, errortext, "nmap_effect", MB_OK);
+ }
+
+ nmap_effect->FindNextValidTechnique(NULL, &hTechnique);
+ nmap_effect->SetTechnique(hTechnique);
+ }
+
+ // FIXME: Should this be (0,0,1,0) ?
+ // Check the point of intersection with the plane (0,1,0,0) and return the position in homogenous coordinates
+ private Vector4 CalculateWorldPos(Vector2 uv, Matrix m)
+ {
+ Vector4 origin = new Vector4(uv.X, uv.Y, -1, 1);
+ Vector4 direction = new Vector4(uv.X, uv.Y, 1, 1);
+
+ origin = Vector4.Transform(origin, m);
+ direction = Vector4.Transform(direction, m);
+
+ float l = -origin.Y / direction.Y;
+
+ Vector4 worldpos = origin + direction * l;
+ return worldpos;
+ }
+
+ private void CalculateNoise()
+ {
+ Octaves = maxoctaves;
+
+ // Calculate the strength of each octave
+ float sum = 0;
+
+ for (int i = 0; i < Octaves; i++)
+ {
+ Multitable[i] = (float)Math.Pow(FALLOFF, 1 * i);
+ sum += Multitable[i];
+ }
+
+ for (int i = 0; i < Octaves; i++)
+ {
+ Multitable[i] /= sum;
+ }
+
+ for (int i = 0; i < Octaves; i++)
+ {
+ Multitable[i] = scalemagnitude * Multitable[i];
+ }
+
+ int now = Environment.TickCount;
+ double timechange = (double)(now - then);
+ then = now;
+ timechange *= 0.001d * ANIMSPEED;
+ double lptimechange = 0.99d * lptimechange + 0.01d * timechange;
+ time += lptimechange;
+
+ double rtimemulti = 1;
+
+ for(int o = 0; o < Octaves; o++)
+ {
+ uint[] image = new uint[3];
+ int[] amount = new int[3];
+ int iimage = (int)(time * rtimemulti);
+ double fraction = (time * rtimemulti) - (double)iimage;
+
+ amount[0] = scalemagnitude * Multitable[o] * (Math.Pow(Math.Sin((fraction + 2) * Math.PI / 3), 2) / 1.5d);
+ amount[1] = scalemagnitude * Multitable[o] * (Math.Pow(Math.Sin((fraction + 1) * Math.PI / 3), 2) / 1.5d);
+ amount[2] = scalemagnitude * Multitable[o] * (Math.Pow(Math.Sin((fraction) * Math.PI / 3), 2) / 1.5d);
+ image[0] = (iimage) & noiseframesm1;
+ image[1] = (iimage + 1) & noiseframesm1;
+ image[2] = (iimage + 2) & noiseframesm1;
+ {
+ for(int i = 0; i < nsizesq; i++)
+ {
+ o_noise[i + nsizesq*o] = (((amount[0] * noise[i + nsizesq * image[0]])>>scaledecimalbits) +
+ ((amount[1] * noise[i + nsizesq * image[1]])>>scaledecimalbits) +
+ ((amount[2] * noise[i + nsizesq * image[2]])>>scaledecimalbits));
+ }
+ }
+
+ rtimemulti *= TIMEMULTI;
+ }
+
+ if (packednoise)
+ {
+ int octavepack = 0;
+
+ for (int o = 0; o < Octaves; o += npacksize)
+ {
+ for (int v = 0; v < npsize; v++)
+ for (int u = 0; u < npsize; u++)
+ {
+ Pnoise[v*npsize+u+octavepack*npsize_sq] = o_noise[(o+3)*nsizesq + (v&nsizem1)*nsize + (u&nsizem1)];
+ Pnoise[v*npsize+u+octavepack*npsize_sq] += mapsample( u, v, 3, o);
+ Pnoise[v*npsize+u+octavepack*npsize_sq] += mapsample( u, v, 2, o+1);
+ Pnoise[v*npsize+u+octavepack*npsize_sq] += mapsample( u, v, 1, o+2);
+ }
+
+ octavepack++;
+ }
+ }
+ }
+
+ //private void CalculateNormals()
+ //{
+ // ;
+ //}
+
+ private void UploadNoise()
+ {
+ D3DLOCKED_RECT locked;
+ ushort data;
+ int[] tempdata = new int[npsizesq];
+
+ for(int t = 0; t < 2; t++)
+ {
+ int offset = npsizesq * t;
+ // upload the first level
+ packed_noise_texture[t]->LockRect( 0, &locked, NULL, D3DLOCK_DISCARD );
+ data = (ushort*)locked.pBits;
+ for(int i=0; iUnlockRect( 0 );
+
+ int c = packed_noise_texture[t]->GetLevelCount();
+
+ // calculate the second level, and upload it
+ HRESULT hr = packed_noise_texture[t]->LockRect( 1, &locked, NULL, 0 );
+ data = (ushort*)locked.pBits;
+ int sz = npsize>>1;
+ for(int v=0; v>2;
+ data[v*sz+u] = 32768+tempdata[v*npsize + u];
+ }
+ }
+
+ packed_noise_texture[t]->UnlockRect( 1 );
+
+ for(int j=2; jLockRect( j, &locked, NULL, 0 );
+ data = (ushort*)locked.pBits;
+ int pitch = (locked.Pitch)>>1;
+ sz = npsize>>j;
+ for(int v=0; v>2;
+ data[v*pitch+u] = 32768+tempdata[v*npsize + u];
+ }
+ }
+ packed_noise_texture[t]->UnlockRect( j );
+ }
+ }
+ }
+
+ private int MapSample(int u, int v, int upsamplepower, int octave)
+ {
+ ;
+ }
+
+ private float ReadtexelNearest(int u, int v)
+ {
+ int lu, lv;
+ lu = (u>>ndecbits)&nsizem1;
+ lv = (v>>ndecbits)&nsizem1;
+
+ return (float)noise[lv*nsize + lu];
+ }
+
+ private int ReadtexelLinearDual(int u, int v, int o)
+ {
+ int iu, iup, iv, ivp, fu, fv;
+ iu = (u>>ndecbits)&npsizem1;
+ iv = ((v>>ndecbits)&npsizem1)*npsize;
+
+ iup = ((u>>ndecbits) + 1)&npsizem1;
+ ivp = (((v>>ndecbits) + 1)&npsizem1)*npsize;
+
+ fu = u & ndecmagn_m1;
+ fv = v & ndecmagn_m1;
+
+ int ut01 = ((ndecmagn-fu)*Rnoise[iv + iu] + fu*Rnoise[iv + iup])>>ndecbits;
+ int ut23 = ((ndecmagn-fu)*Rnoise[ivp + iu] + fu*Rnoise[ivp + iup])>>ndecbits;
+ int ut = ((ndecmagn-fv)*ut01 + fv*ut23) >> ndecbits;
+
+ return ut;
+ }
+
+ // FIXME: This function uses pointer magic that needs to be fixed for C#
+ private float GetHeightDual(int u, int v)
+ {
+ int value = 0;
+ Rnoise = Pnoise; // pointer to the current noise source octave
+ int hoct = Octaves / npacksize;
+
+ for(int i = 0; i < hoct; i++)
+ {
+ value += ReadtexelLinearDual(u, v, 0);
+ u = u << npacksize;
+ v = v << npacksize;
+ Rnoise += npsizesq;
+ }
+
+ return value * STRENGTH / noisemagnitude;
+ }
+ }
+}
diff --git a/applications/sceneviewer/Water/WaterSurface.cs b/applications/sceneviewer/Water/WaterSurface.cs
index a19a9346..3c416c77 100644
--- a/applications/sceneviewer/Water/WaterSurface.cs
+++ b/applications/sceneviewer/Water/WaterSurface.cs
@@ -1,355 +1,355 @@
-using System;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-
-namespace sceneviewer
-{
- class WaterSurface
- {
- public const int REFLREFRDETAIL = 512;
- public const float SUNSHININESS = 84.0f;
- public const float SUNSTRENGTH = 12.0f;
- public const float REFLREFROFFSET = 0.1f;
-
- public bool Initialized;
- public Color WaterColor;
- public Matrix Range;
-
- GraphicsDevice Device;
- Plane Plane, UpperBound, LowerBound;
- Vector3 Normal, U, V;
- float Position;
- int GridSizeX, GridSizeY;
- NoiseMaker NoiseMaker;
- Texture2D Fresnel, XYNoise, Reflection, Refraction;
- Surface DepthStencil;
- Effect WaterEffect;
- VertexBuffer Vertices;
- IndexBuffer Indices;
- Camera Camera;
- bool PlaneWithinFrustum;
-
- public WaterSurface(GraphicsDevice device, Camera camera, Vector3 normal, float position, int sizeX, int sizeY)
- {
- Vector3 x;
-
- Device = device;
- Camera = camera;
- Normal = normal;
- Position = position;
- Plane = new Plane(normal, position);
- NoiseMaker = new NoiseMaker(Device, GridSizeX, GridSizeY);
- PlaneWithinFrustum = false;
-
- // Set the initial water color
- WaterColor = Color.Aquamarine;
-
- // Calculate the U and V vectors
- if (Math.Abs(Vector3.Dot(Vector3.UnitX, normal)) < Math.Abs(Vector3.Dot(Vector3.UnitY, normal)))
- {
- x = Vector3.UnitX;
- }
- else
- {
- x = Vector3.UnitY;
- }
-
- U = x - normal * Vector3.Dot(normal, x);
- U = Vector3.Normalize(U);
-
- // Get V (cross)
- V = Vector3.Cross(U, normal);
-
- GridSizeX = sizeX + 1;
- GridSizeY = sizeY + 1;
-
- SetDisplacementAmplitude(0);
-
- if (!InitializeBuffers())
- {
- return;
- }
-
- // Load the textures
- if ((Fresnel = Texture2D.FromFile(Device, "textures/fresnel_water_linear.bmp")) == null)
- {
- return;
- }
- if ((XYNoise = Texture2D.FromFile(Device, "textures/xynoise.png")) == null)
- {
- return;
- }
-
- // Initialize the reflection and refraction textures, and the depth stencil
- Reflection = new Texture2D(Device, REFLREFRDETAIL, REFLREFRDETAIL, 1, ResourceUsage.RenderTarget,
- SurfaceFormat.Color, ResourcePool.Default);
- Refraction = new Texture2D(Device, REFLREFRDETAIL, REFLREFRDETAIL, 1, ResourceUsage.RenderTarget,
- SurfaceFormat.Color, ResourcePool.Default);
- DepthStencil = Device.CreateDepthStencilSurface(REFLREFRDETAIL, REFLREFRDETAIL, DepthFormat.Depth24Stencil8,
- MultiSampleType.None, 0, true);
-
- // Load the effect
- CompiledEffect water = Effect.CompileEffectFromFile("shaders/watereffect.fx", null, null,
- CompilerOptions.Debug | CompilerOptions.SkipOptimization, TargetPlatform.Windows);
- if (!water.Success)
- {
- return;
- }
- else
- {
- WaterEffect = new Effect(Device, water.GetShaderCode(), CompilerOptions.None, null);
- }
-
- Initialized = true;
- }
-
- public bool Prepare()
- {
- if (!Initialized) return false;
-
- // Check if the water plane is within the viewing frustum
- //BoundingFrustum frustum = new BoundingFrustum(Camera.ViewProjectionMatrix);
-
- //if ((frustum.Intersects(UpperBound) == PlaneIntersectionType.Intersecting) ||
- // (frustum.Intersects(LowerBound) == PlaneIntersectionType.Intersecting))
- //{
- // PlaneWithinFrustum = true;
-
- // NoiseMaker.RenderGeometry(out Range);
- //}
-
- PlaneWithinFrustum = GetMinMax(out Range);
-
- if (PlaneWithinFrustum)
- {
- NoiseMaker.RenderGeometry(Range);
-
- Vertices.SetData(NoiseMaker.Vertices);
- }
-
- return true;
- }
-
- public void RenderCutter()
- {
- if (PlaneWithinFrustum)
- {
- Device.VertexDeclaration = new VertexDeclaration(Device, VertexPositionNormalTexture.VertexElements);
- Device.Vertices[0].SetSource(Vertices, 0, VertexPositionNormalTexture.SizeInBytes);
- Device.Indices = Indices;
- Device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, GridSizeX * GridSizeY,
- 0, 2 * (GridSizeX - 1) * (GridSizeY - 1));
- }
- }
-
- public void Render(Vector4 sunVector)
- {
- if (PlaneWithinFrustum)
- {
- Device.RenderState.CullMode = CullMode.None;
- Device.VertexDeclaration = new VertexDeclaration(Device, VertexPositionNormalTexture.VertexElements);
- Device.Vertices[0].SetSource(Vertices, 0, VertexPositionNormalTexture.SizeInBytes);
- Device.Indices = Indices;
-
- NoiseMaker.GenerateNormalMap();
-
- Device.RenderState.CullMode = CullMode.CullClockwiseFace;
- WaterEffect.Begin(EffectStateOptions.Default);
- WaterEffect.CurrentTechnique.Passes[0].Begin();
- // Beginning of the water rendering pass
-
- WaterEffect.Parameters["mViewProj"].SetValue(Camera.ViewProjectionMatrix);
- WaterEffect.Parameters["mView"].SetValue(Camera.ViewMatrix);
- WaterEffect.Parameters["sun_vec"].SetValue(sunVector);
- WaterEffect.Parameters["sun_shininess"].SetValue(SUNSHININESS);
- WaterEffect.Parameters["sun_strength"].SetValue(SUNSTRENGTH);
- WaterEffect.Parameters["reflrefr_offset"].SetValue(REFLREFROFFSET);
- WaterEffect.Parameters["diffuseSkyRef"].SetValue(true);
- WaterEffect.Parameters["watercolour"].SetValue(WaterColor.ToVector4());
- WaterEffect.Parameters["LODbias"].SetValue(0.0f);
- WaterEffect.Parameters["view_position"].SetValue(new Vector4(Camera.Position, 1));
- //WaterEffect.Parameters["EnvironmentMap", SkyboxCubemap);
- WaterEffect.Parameters["FresnelMap"].SetValue(Fresnel);
- WaterEffect.Parameters["Heightmap"].SetValue(NoiseMaker.HeightMap);
- WaterEffect.Parameters["Normalmap"].SetValue(NoiseMaker.NormalMap);
- WaterEffect.Parameters["Refractionmap"].SetValue(Refraction);
- WaterEffect.Parameters["Reflectionmap"].SetValue(Reflection);
-
- Device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, GridSizeX * GridSizeY, 0,
- 2 * (GridSizeX - 1) * (GridSizeY - 1));
-
- // End of the water rendering pass
- WaterEffect.CurrentTechnique.Passes[0].End();
- WaterEffect.End();
- }
- }
-
- public void SetDisplacementAmplitude(float amplitude)
- {
- UpperBound = new Plane(Normal, Position + amplitude);
- LowerBound = new Plane(Normal, Position - amplitude);
- }
-
- private bool InitializeBuffers()
- {
- if ((Vertices = new VertexBuffer(Device, GridSizeX * GridSizeY * VertexPositionNormalTexture.SizeInBytes,
- ResourceUsage.WriteOnly | ResourceUsage.Dynamic, ResourcePool.Default)) == null)
- {
- return false;
- }
-
- if ((Indices = new IndexBuffer(Device, sizeof(int) * 6 * (GridSizeX - 1) * (GridSizeY - 1),
- ResourceUsage.WriteOnly, ResourcePool.Default, IndexElementSize.ThirtyTwoBits)) == null)
- {
- return false;
- }
-
- // Fill the index buffer
- for (int v = 0; v < GridSizeY - 1; v++)
- {
- for (int u = 0; u < GridSizeX - 1; u++)
- {
- int[] indexes = new int[6];
-
- // Face 1 |/
- indexes[0] = v * GridSizeX + u;
- indexes[1] = v * GridSizeX + u + 1;
- indexes[2] = (v + 1) * GridSizeX + u;
-
- // Face 2 /|
- indexes[3] = (v + 1) * GridSizeX + u;
- indexes[4] = v * GridSizeX + u + 1;
- indexes[5] = (v + 1) * GridSizeX + u + 1;
-
- Indices.SetData(indexes);
- }
- }
-
- return true;
- }
-
- private bool GetMinMax(out Matrix range)
- {
- // FIXME:
- range = new Matrix();
- return false;
- }
-
- /*private bool GetMinMax(out Matrix range)
- {
- BoundingFrustum frustum = new BoundingFrustum(Camera.ViewMatrix);
- Vector3[] corners = frustum.GetCorners();
- range = Matrix.CreateOrthographic(frustum.
-
- float xmin, ymin, xmax, ymax;
- // Frustum to check the camera against
- //Vector3[] frustum = new Vector3[8];
- Vector3[] projPoints = new Vector3[24];
- int npoints = 0;
- // Which frustum points are connected together?
- //int[] cube = { 0,1, 0,2, 2,3, 1,3,
- // 0,4, 2,6, 3,7, 1,5,
- // 4,6, 4,5, 5,7, 6,7
- // };
-
- // Transform frustum points to worldspace
- //Matrix invView = Matrix.Invert(Camera.ViewMatrix);
- //frustum[0] = Vector3.Transform(new Vector3(-1, -1, -1), invView);
- //frustum[1] = Vector3.Transform(new Vector3(+1, -1, -1), invView);
- //frustum[2] = Vector3.Transform(new Vector3(-1, +1, -1), invView);
- //frustum[3] = Vector3.Transform(new Vector3(+1, +1, -1), invView);
- //frustum[4] = Vector3.Transform(new Vector3(-1, -1, +1), invView);
- //frustum[5] = Vector3.Transform(new Vector3(+1, -1, +1), invView);
- //frustum[6] = Vector3.Transform(new Vector3(-1, +1, +1), invView);
- //frustum[7] = Vector3.Transform(new Vector3(+1, +1, +1), invView);
-
- // Check intersections with UpperBound and LowerBound
- for (int i = 0; i < 12; i++)
- {
- int src = cube[i * 2];
- int dst = cube[i * 2 + 1];
-
- // FIXME: Since Z is up in our world we may need to fix some things here
- if ((UpperBound.A * frustum[src].X + UpperBound.B * frustum[src].Y + UpperBound.C * frustum[src].Z + UpperBound.D * 1) /
- (UpperBound.A * frustum[dst].X + UpperBound.B * frustum[dst].Y + UpperBound.C * frustum[dst].Z + UpperBound.D * 1) < 0)
- {
- BoundingFrustum f = new BoundingFrustum(
- //projPoints[npoints++] =
- Plane.Intersects(
- D3DXPlaneIntersectLine(&proj_points[n_points++], &upper_bound, &frustum[src], &frustum[dst]);
- }
- if ((LowerBound.A * frustum[src].X + LowerBound.B * frustum[src].Y + LowerBound.C * frustum[src].Z + LowerBound.D * 1) /
- (LowerBound.A * frustum[dst].X + LowerBound.B * frustum[dst].Y + LowerBound.C * frustum[dst].Z + LowerBound.D * 1) < 0)
- {
- D3DXPlaneIntersectLine(&proj_points[n_points++], &lower_bound, &frustum[src], &frustum[dst]);
- }
- }
-
- // Check if any of the frustums vertices lie between the upper_bound and lower_bound planes
- for (int i = 0; i < 8; i++)
- {
- if ((UpperBound.A * frustum[i].X + UpperBound.B * frustum[i].Y + UpperBound.C * frustum[i].Z + UpperBound.D * 1) /
- (LowerBound.A * frustum[i].X + LowerBound.B * frustum[i].Y + LowerBound.C * frustum[i].Z + LowerBound.D * 1) < 0)
- {
- projPoints[npoints++] = frustum[i];
- }
- }
-
- // TODO: Advanced camera stuff?
- //
-
- for (int i = 0; i < npoints; i++)
- {
- projPoints[i] = Vector3.Transform(projPoints[i], Camera.ViewMatrix);
- projPoints[i] = Vector3.Transform(projPoints[i], Camera.ProjectionMatrix);
- }
-
- // Get max/min x & y-values to determine how big the "projection window" must be
- if (npoints > 0)
- {
- xmin = projPoints[0].X;
- xmax = projPoints[0].X;
- ymin = projPoints[0].Y;
- ymax = projPoints[0].Y;
-
- for(int i = 1; i < npoints; i++)
- {
- if (projPoints[i].X > xmax) xmax = projPoints[i].X;
- if (projPoints[i].X < xmin) xmin = projPoints[i].X;
- if (projPoints[i].Y > ymax) ymax = projPoints[i].Y;
- if (projPoints[i].Y < ymin) ymin = projPoints[i].Y;
- }
-
- // Build the packing matrix that spreads the grid across the "projection window"
- Matrix pack = new Matrix(xmax-xmin, 0, 0, xmin,
- 0, ymax-ymin, 0, ymin,
- 0, 0, 1, 0,
- 0, 0, 0, 1);
-
- pack = Matrix.Transpose(pack);
- range = pack * invView;
-
- return true;
- }
- else
- {
- return false;
- }
- }*/
-
- private bool WithinFrustum(Vector3 position)
- {
- Vector3 test = Vector3.Transform(position, Camera.ViewProjectionMatrix);
-
- if ((Math.Abs(test.X) < 1.00001f) && (Math.Abs(test.Y) < 1.00001f) && (Math.Abs(test.Z) < 1.00001f))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-}
+using System;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace sceneviewer
+{
+ class WaterSurface
+ {
+ public const int REFLREFRDETAIL = 512;
+ public const float SUNSHININESS = 84.0f;
+ public const float SUNSTRENGTH = 12.0f;
+ public const float REFLREFROFFSET = 0.1f;
+
+ public bool Initialized;
+ public Color WaterColor;
+ public Matrix Range;
+
+ GraphicsDevice Device;
+ Plane Plane, UpperBound, LowerBound;
+ Vector3 Normal, U, V;
+ float Position;
+ int GridSizeX, GridSizeY;
+ NoiseMaker NoiseMaker;
+ Texture2D Fresnel, XYNoise, Reflection, Refraction;
+ Surface DepthStencil;
+ Effect WaterEffect;
+ VertexBuffer Vertices;
+ IndexBuffer Indices;
+ Camera Camera;
+ bool PlaneWithinFrustum;
+
+ public WaterSurface(GraphicsDevice device, Camera camera, Vector3 normal, float position, int sizeX, int sizeY)
+ {
+ Vector3 x;
+
+ Device = device;
+ Camera = camera;
+ Normal = normal;
+ Position = position;
+ Plane = new Plane(normal, position);
+ NoiseMaker = new NoiseMaker(Device, GridSizeX, GridSizeY);
+ PlaneWithinFrustum = false;
+
+ // Set the initial water color
+ WaterColor = Color.Aquamarine;
+
+ // Calculate the U and V vectors
+ if (Math.Abs(Vector3.Dot(Vector3.UnitX, normal)) < Math.Abs(Vector3.Dot(Vector3.UnitY, normal)))
+ {
+ x = Vector3.UnitX;
+ }
+ else
+ {
+ x = Vector3.UnitY;
+ }
+
+ U = x - normal * Vector3.Dot(normal, x);
+ U = Vector3.Normalize(U);
+
+ // Get V (cross)
+ V = Vector3.Cross(U, normal);
+
+ GridSizeX = sizeX + 1;
+ GridSizeY = sizeY + 1;
+
+ SetDisplacementAmplitude(0);
+
+ if (!InitializeBuffers())
+ {
+ return;
+ }
+
+ // Load the textures
+ if ((Fresnel = Texture2D.FromFile(Device, "textures/fresnel_water_linear.bmp")) == null)
+ {
+ return;
+ }
+ if ((XYNoise = Texture2D.FromFile(Device, "textures/xynoise.png")) == null)
+ {
+ return;
+ }
+
+ // Initialize the reflection and refraction textures, and the depth stencil
+ Reflection = new Texture2D(Device, REFLREFRDETAIL, REFLREFRDETAIL, 1, ResourceUsage.RenderTarget,
+ SurfaceFormat.Color, ResourcePool.Default);
+ Refraction = new Texture2D(Device, REFLREFRDETAIL, REFLREFRDETAIL, 1, ResourceUsage.RenderTarget,
+ SurfaceFormat.Color, ResourcePool.Default);
+ DepthStencil = Device.CreateDepthStencilSurface(REFLREFRDETAIL, REFLREFRDETAIL, DepthFormat.Depth24Stencil8,
+ MultiSampleType.None, 0, true);
+
+ // Load the effect
+ CompiledEffect water = Effect.CompileEffectFromFile("shaders/watereffect.fx", null, null,
+ CompilerOptions.Debug | CompilerOptions.SkipOptimization, TargetPlatform.Windows);
+ if (!water.Success)
+ {
+ return;
+ }
+ else
+ {
+ WaterEffect = new Effect(Device, water.GetShaderCode(), CompilerOptions.None, null);
+ }
+
+ Initialized = true;
+ }
+
+ public bool Prepare()
+ {
+ if (!Initialized) return false;
+
+ // Check if the water plane is within the viewing frustum
+ //BoundingFrustum frustum = new BoundingFrustum(Camera.ViewProjectionMatrix);
+
+ //if ((frustum.Intersects(UpperBound) == PlaneIntersectionType.Intersecting) ||
+ // (frustum.Intersects(LowerBound) == PlaneIntersectionType.Intersecting))
+ //{
+ // PlaneWithinFrustum = true;
+
+ // NoiseMaker.RenderGeometry(out Range);
+ //}
+
+ PlaneWithinFrustum = GetMinMax(out Range);
+
+ if (PlaneWithinFrustum)
+ {
+ NoiseMaker.RenderGeometry(Range);
+
+ Vertices.SetData(NoiseMaker.Vertices);
+ }
+
+ return true;
+ }
+
+ public void RenderCutter()
+ {
+ if (PlaneWithinFrustum)
+ {
+ Device.VertexDeclaration = new VertexDeclaration(Device, VertexPositionNormalTexture.VertexElements);
+ Device.Vertices[0].SetSource(Vertices, 0, VertexPositionNormalTexture.SizeInBytes);
+ Device.Indices = Indices;
+ Device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, GridSizeX * GridSizeY,
+ 0, 2 * (GridSizeX - 1) * (GridSizeY - 1));
+ }
+ }
+
+ public void Render(Vector4 sunVector)
+ {
+ if (PlaneWithinFrustum)
+ {
+ Device.RenderState.CullMode = CullMode.None;
+ Device.VertexDeclaration = new VertexDeclaration(Device, VertexPositionNormalTexture.VertexElements);
+ Device.Vertices[0].SetSource(Vertices, 0, VertexPositionNormalTexture.SizeInBytes);
+ Device.Indices = Indices;
+
+ NoiseMaker.GenerateNormalMap();
+
+ Device.RenderState.CullMode = CullMode.CullClockwiseFace;
+ WaterEffect.Begin(EffectStateOptions.Default);
+ WaterEffect.CurrentTechnique.Passes[0].Begin();
+ // Beginning of the water rendering pass
+
+ WaterEffect.Parameters["mViewProj"].SetValue(Camera.ViewProjectionMatrix);
+ WaterEffect.Parameters["mView"].SetValue(Camera.ViewMatrix);
+ WaterEffect.Parameters["sun_vec"].SetValue(sunVector);
+ WaterEffect.Parameters["sun_shininess"].SetValue(SUNSHININESS);
+ WaterEffect.Parameters["sun_strength"].SetValue(SUNSTRENGTH);
+ WaterEffect.Parameters["reflrefr_offset"].SetValue(REFLREFROFFSET);
+ WaterEffect.Parameters["diffuseSkyRef"].SetValue(true);
+ WaterEffect.Parameters["watercolour"].SetValue(WaterColor.ToVector4());
+ WaterEffect.Parameters["LODbias"].SetValue(0.0f);
+ WaterEffect.Parameters["view_position"].SetValue(new Vector4(Camera.Position, 1));
+ //WaterEffect.Parameters["EnvironmentMap", SkyboxCubemap);
+ WaterEffect.Parameters["FresnelMap"].SetValue(Fresnel);
+ WaterEffect.Parameters["Heightmap"].SetValue(NoiseMaker.HeightMap);
+ WaterEffect.Parameters["Normalmap"].SetValue(NoiseMaker.NormalMap);
+ WaterEffect.Parameters["Refractionmap"].SetValue(Refraction);
+ WaterEffect.Parameters["Reflectionmap"].SetValue(Reflection);
+
+ Device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, GridSizeX * GridSizeY, 0,
+ 2 * (GridSizeX - 1) * (GridSizeY - 1));
+
+ // End of the water rendering pass
+ WaterEffect.CurrentTechnique.Passes[0].End();
+ WaterEffect.End();
+ }
+ }
+
+ public void SetDisplacementAmplitude(float amplitude)
+ {
+ UpperBound = new Plane(Normal, Position + amplitude);
+ LowerBound = new Plane(Normal, Position - amplitude);
+ }
+
+ private bool InitializeBuffers()
+ {
+ if ((Vertices = new VertexBuffer(Device, GridSizeX * GridSizeY * VertexPositionNormalTexture.SizeInBytes,
+ ResourceUsage.WriteOnly | ResourceUsage.Dynamic, ResourcePool.Default)) == null)
+ {
+ return false;
+ }
+
+ if ((Indices = new IndexBuffer(Device, sizeof(int) * 6 * (GridSizeX - 1) * (GridSizeY - 1),
+ ResourceUsage.WriteOnly, ResourcePool.Default, IndexElementSize.ThirtyTwoBits)) == null)
+ {
+ return false;
+ }
+
+ // Fill the index buffer
+ for (int v = 0; v < GridSizeY - 1; v++)
+ {
+ for (int u = 0; u < GridSizeX - 1; u++)
+ {
+ int[] indexes = new int[6];
+
+ // Face 1 |/
+ indexes[0] = v * GridSizeX + u;
+ indexes[1] = v * GridSizeX + u + 1;
+ indexes[2] = (v + 1) * GridSizeX + u;
+
+ // Face 2 /|
+ indexes[3] = (v + 1) * GridSizeX + u;
+ indexes[4] = v * GridSizeX + u + 1;
+ indexes[5] = (v + 1) * GridSizeX + u + 1;
+
+ Indices.SetData(indexes);
+ }
+ }
+
+ return true;
+ }
+
+ private bool GetMinMax(out Matrix range)
+ {
+ // FIXME:
+ range = new Matrix();
+ return false;
+ }
+
+ /*private bool GetMinMax(out Matrix range)
+ {
+ BoundingFrustum frustum = new BoundingFrustum(Camera.ViewMatrix);
+ Vector3[] corners = frustum.GetCorners();
+ range = Matrix.CreateOrthographic(frustum.
+
+ float xmin, ymin, xmax, ymax;
+ // Frustum to check the camera against
+ //Vector3[] frustum = new Vector3[8];
+ Vector3[] projPoints = new Vector3[24];
+ int npoints = 0;
+ // Which frustum points are connected together?
+ //int[] cube = { 0,1, 0,2, 2,3, 1,3,
+ // 0,4, 2,6, 3,7, 1,5,
+ // 4,6, 4,5, 5,7, 6,7
+ // };
+
+ // Transform frustum points to worldspace
+ //Matrix invView = Matrix.Invert(Camera.ViewMatrix);
+ //frustum[0] = Vector3.Transform(new Vector3(-1, -1, -1), invView);
+ //frustum[1] = Vector3.Transform(new Vector3(+1, -1, -1), invView);
+ //frustum[2] = Vector3.Transform(new Vector3(-1, +1, -1), invView);
+ //frustum[3] = Vector3.Transform(new Vector3(+1, +1, -1), invView);
+ //frustum[4] = Vector3.Transform(new Vector3(-1, -1, +1), invView);
+ //frustum[5] = Vector3.Transform(new Vector3(+1, -1, +1), invView);
+ //frustum[6] = Vector3.Transform(new Vector3(-1, +1, +1), invView);
+ //frustum[7] = Vector3.Transform(new Vector3(+1, +1, +1), invView);
+
+ // Check intersections with UpperBound and LowerBound
+ for (int i = 0; i < 12; i++)
+ {
+ int src = cube[i * 2];
+ int dst = cube[i * 2 + 1];
+
+ // FIXME: Since Z is up in our world we may need to fix some things here
+ if ((UpperBound.A * frustum[src].X + UpperBound.B * frustum[src].Y + UpperBound.C * frustum[src].Z + UpperBound.D * 1) /
+ (UpperBound.A * frustum[dst].X + UpperBound.B * frustum[dst].Y + UpperBound.C * frustum[dst].Z + UpperBound.D * 1) < 0)
+ {
+ BoundingFrustum f = new BoundingFrustum(
+ //projPoints[npoints++] =
+ Plane.Intersects(
+ D3DXPlaneIntersectLine(&proj_points[n_points++], &upper_bound, &frustum[src], &frustum[dst]);
+ }
+ if ((LowerBound.A * frustum[src].X + LowerBound.B * frustum[src].Y + LowerBound.C * frustum[src].Z + LowerBound.D * 1) /
+ (LowerBound.A * frustum[dst].X + LowerBound.B * frustum[dst].Y + LowerBound.C * frustum[dst].Z + LowerBound.D * 1) < 0)
+ {
+ D3DXPlaneIntersectLine(&proj_points[n_points++], &lower_bound, &frustum[src], &frustum[dst]);
+ }
+ }
+
+ // Check if any of the frustums vertices lie between the upper_bound and lower_bound planes
+ for (int i = 0; i < 8; i++)
+ {
+ if ((UpperBound.A * frustum[i].X + UpperBound.B * frustum[i].Y + UpperBound.C * frustum[i].Z + UpperBound.D * 1) /
+ (LowerBound.A * frustum[i].X + LowerBound.B * frustum[i].Y + LowerBound.C * frustum[i].Z + LowerBound.D * 1) < 0)
+ {
+ projPoints[npoints++] = frustum[i];
+ }
+ }
+
+ // TODO: Advanced camera stuff?
+ //
+
+ for (int i = 0; i < npoints; i++)
+ {
+ projPoints[i] = Vector3.Transform(projPoints[i], Camera.ViewMatrix);
+ projPoints[i] = Vector3.Transform(projPoints[i], Camera.ProjectionMatrix);
+ }
+
+ // Get max/min x & y-values to determine how big the "projection window" must be
+ if (npoints > 0)
+ {
+ xmin = projPoints[0].X;
+ xmax = projPoints[0].X;
+ ymin = projPoints[0].Y;
+ ymax = projPoints[0].Y;
+
+ for(int i = 1; i < npoints; i++)
+ {
+ if (projPoints[i].X > xmax) xmax = projPoints[i].X;
+ if (projPoints[i].X < xmin) xmin = projPoints[i].X;
+ if (projPoints[i].Y > ymax) ymax = projPoints[i].Y;
+ if (projPoints[i].Y < ymin) ymin = projPoints[i].Y;
+ }
+
+ // Build the packing matrix that spreads the grid across the "projection window"
+ Matrix pack = new Matrix(xmax-xmin, 0, 0, xmin,
+ 0, ymax-ymin, 0, ymin,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1);
+
+ pack = Matrix.Transpose(pack);
+ range = pack * invView;
+
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }*/
+
+ private bool WithinFrustum(Vector3 position)
+ {
+ Vector3 test = Vector3.Transform(position, Camera.ViewProjectionMatrix);
+
+ if ((Math.Abs(test.X) < 1.00001f) && (Math.Abs(test.Y) < 1.00001f) && (Math.Abs(test.Z) < 1.00001f))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+}
diff --git a/applications/sceneviewer/sceneviewer.csproj b/applications/sceneviewer/sceneviewer.csproj
index a6dedeb5..757da4c9 100644
--- a/applications/sceneviewer/sceneviewer.csproj
+++ b/applications/sceneviewer/sceneviewer.csproj
@@ -1,88 +1,88 @@
-
-
- {21C7E365-F32E-4912-9E6A-50A5BD02AC29}
- {9F340DF3-2AED-4330-AC16-78AC2D9B4738};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- Debug
- AnyCPU
- WinExe
- Properties
- sceneviewer
- sceneviewer
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
- false
-
-
- pdbonly
- true
- ..\..\bin\
- TRACE
- prompt
- 4
- true
- false
-
-
-
- False
- ..\..\bin\libsecondlife.dll
-
-
- true
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Viewer.cs
-
-
-
-
- Component
-
-
-
-
-
-
-
-
-
-
-
+
+
+ {21C7E365-F32E-4912-9E6A-50A5BD02AC29}
+ {9F340DF3-2AED-4330-AC16-78AC2D9B4738};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ Debug
+ AnyCPU
+ WinExe
+ Properties
+ sceneviewer
+ sceneviewer
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ true
+ false
+
+
+ pdbonly
+ true
+ ..\..\bin\
+ TRACE
+ prompt
+ 4
+ true
+ false
+
+
+
+ False
+ ..\..\bin\libsecondlife.dll
+
+
+ true
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Viewer.cs
+
+
+
+
+ Component
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/applications/sceneviewer/sceneviewer.sln b/applications/sceneviewer/sceneviewer.sln
index fd8c1ac7..ee9ba6ed 100644
--- a/applications/sceneviewer/sceneviewer.sln
+++ b/applications/sceneviewer/sceneviewer.sln
@@ -1,20 +1,20 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual C# Express 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sceneviewer", "sceneviewer.csproj", "{21C7E365-F32E-4912-9E6A-50A5BD02AC29}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {21C7E365-F32E-4912-9E6A-50A5BD02AC29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {21C7E365-F32E-4912-9E6A-50A5BD02AC29}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {21C7E365-F32E-4912-9E6A-50A5BD02AC29}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {21C7E365-F32E-4912-9E6A-50A5BD02AC29}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C# Express 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sceneviewer", "sceneviewer.csproj", "{21C7E365-F32E-4912-9E6A-50A5BD02AC29}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {21C7E365-F32E-4912-9E6A-50A5BD02AC29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {21C7E365-F32E-4912-9E6A-50A5BD02AC29}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {21C7E365-F32E-4912-9E6A-50A5BD02AC29}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {21C7E365-F32E-4912-9E6A-50A5BD02AC29}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/applications/snowcrash/snowcrash.sln b/applications/snowcrash/snowcrash.sln
index 62a8ab97..c8a14483 100644
--- a/applications/snowcrash/snowcrash.sln
+++ b/applications/snowcrash/snowcrash.sln
@@ -1,30 +1,30 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "snowcrash", "snowcrash\snowcrash.vcproj", "{2105B930-471B-4E1B-A52E-C9DF97A4D8A0}"
- ProjectSection(ProjectDependencies) = postProject
- {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4} = {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "snowflake", "snowflake\snowflake.vcproj", "{99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {2105B930-471B-4E1B-A52E-C9DF97A4D8A0}.Debug.ActiveCfg = Debug|Win32
- {2105B930-471B-4E1B-A52E-C9DF97A4D8A0}.Debug.Build.0 = Debug|Win32
- {2105B930-471B-4E1B-A52E-C9DF97A4D8A0}.Release.ActiveCfg = Release|Win32
- {2105B930-471B-4E1B-A52E-C9DF97A4D8A0}.Release.Build.0 = Release|Win32
- {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}.Debug.ActiveCfg = Debug|Win32
- {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}.Debug.Build.0 = Debug|Win32
- {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}.Release.ActiveCfg = Release|Win32
- {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "snowcrash", "snowcrash\snowcrash.vcproj", "{2105B930-471B-4E1B-A52E-C9DF97A4D8A0}"
+ ProjectSection(ProjectDependencies) = postProject
+ {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4} = {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "snowflake", "snowflake\snowflake.vcproj", "{99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {2105B930-471B-4E1B-A52E-C9DF97A4D8A0}.Debug.ActiveCfg = Debug|Win32
+ {2105B930-471B-4E1B-A52E-C9DF97A4D8A0}.Debug.Build.0 = Debug|Win32
+ {2105B930-471B-4E1B-A52E-C9DF97A4D8A0}.Release.ActiveCfg = Release|Win32
+ {2105B930-471B-4E1B-A52E-C9DF97A4D8A0}.Release.Build.0 = Release|Win32
+ {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}.Debug.ActiveCfg = Debug|Win32
+ {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}.Debug.Build.0 = Debug|Win32
+ {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}.Release.ActiveCfg = Release|Win32
+ {99CC21CC-D63D-49D3-9CFF-FEC3FE7B60E4}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/applications/snowcrash/snowcrash/MainFrame.cpp b/applications/snowcrash/snowcrash/MainFrame.cpp
index e53ece2b..69b3054d 100644
--- a/applications/snowcrash/snowcrash/MainFrame.cpp
+++ b/applications/snowcrash/snowcrash/MainFrame.cpp
@@ -1,54 +1,54 @@
-// MainFrame.cpp : implmentation of the CMainFrame class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "resource.h"
-
-#include "MainFrame.h"
-
-BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
-{
- return CFrameWindowImpl::PreTranslateMessage(pMsg);
-}
-
-BOOL CMainFrame::OnIdle()
-{
- return FALSE;
-}
-
-LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
-{
- m_bEnabled = TRUE;
-
- // register object for message filtering and idle updates
- CMessageLoop* pLoop = _Module.GetMessageLoop();
- ATLASSERT(pLoop != NULL);
- pLoop->AddMessageFilter(this);
- pLoop->AddIdleHandler(this);
-
- // install tray icon
- InstallIcon("Snowcrash", ::LoadIcon(_Module.m_hInstResource, MAKEINTRESOURCE(IDI_SNOWCRASH)), IDC_TRAY);
-// SetDefaultItem(ID_APP_SHOW);
-
- InstallSystemHook();
-
- return 0;
-}
-
-LRESULT CMainFrame::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
-{
- dprintf("OnDestroy\n");
- RemoveSystemHook();
- PostQuitMessage(0);
-
- return 0;
-}
-
-LRESULT CMainFrame::OnAppExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
-{
- dprintf("OnAppExit\n");
- DestroyWindow();
-
- return 0;
-}
+// MainFrame.cpp : implmentation of the CMainFrame class
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "stdafx.h"
+#include "resource.h"
+
+#include "MainFrame.h"
+
+BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
+{
+ return CFrameWindowImpl::PreTranslateMessage(pMsg);
+}
+
+BOOL CMainFrame::OnIdle()
+{
+ return FALSE;
+}
+
+LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
+{
+ m_bEnabled = TRUE;
+
+ // register object for message filtering and idle updates
+ CMessageLoop* pLoop = _Module.GetMessageLoop();
+ ATLASSERT(pLoop != NULL);
+ pLoop->AddMessageFilter(this);
+ pLoop->AddIdleHandler(this);
+
+ // install tray icon
+ InstallIcon("Snowcrash", ::LoadIcon(_Module.m_hInstResource, MAKEINTRESOURCE(IDI_SNOWCRASH)), IDC_TRAY);
+// SetDefaultItem(ID_APP_SHOW);
+
+ InstallSystemHook();
+
+ return 0;
+}
+
+LRESULT CMainFrame::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
+{
+ dprintf("OnDestroy\n");
+ RemoveSystemHook();
+ PostQuitMessage(0);
+
+ return 0;
+}
+
+LRESULT CMainFrame::OnAppExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
+{
+ dprintf("OnAppExit\n");
+ DestroyWindow();
+
+ return 0;
+}
diff --git a/applications/snowcrash/snowcrash/MainFrame.h b/applications/snowcrash/snowcrash/MainFrame.h
index 0442b1ff..4d339fde 100644
--- a/applications/snowcrash/snowcrash/MainFrame.h
+++ b/applications/snowcrash/snowcrash/MainFrame.h
@@ -1,41 +1,41 @@
-// MainFrame.h : interface of the CMainFrame class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#pragma once
-
-#include "TrayIconImpl.h"
-
-class CMainFrame : public CFrameWindowImpl, public CUpdateUI,
- public CMessageFilter, public CIdleHandler, public CTrayIconImpl
-{
-public:
- DECLARE_FRAME_WND_CLASS(NULL, IDI_SNOWCRASH)
-
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- virtual BOOL OnIdle();
-
- BEGIN_UPDATE_UI_MAP(CMainFrame)
- END_UPDATE_UI_MAP()
-
- BEGIN_MSG_MAP(CMainFrame)
- COMMAND_ID_HANDLER(ID_APP_EXIT, OnAppExit)
- MESSAGE_HANDLER(WM_CREATE, OnCreate)
- MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
- CHAIN_MSG_MAP(CTrayIconImpl)
- CHAIN_MSG_MAP(CUpdateUI)
- CHAIN_MSG_MAP(CFrameWindowImpl)
- END_MSG_MAP()
-
-// Handler prototypes (uncomment arguments if needed):
-// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
-// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
-// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
-
- LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
- LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
- LRESULT OnAppExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
-
-private:
- BOOL m_bEnabled;
-};
+// MainFrame.h : interface of the CMainFrame class
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+#include "TrayIconImpl.h"
+
+class CMainFrame : public CFrameWindowImpl, public CUpdateUI,
+ public CMessageFilter, public CIdleHandler, public CTrayIconImpl
+{
+public:
+ DECLARE_FRAME_WND_CLASS(NULL, IDI_SNOWCRASH)
+
+ virtual BOOL PreTranslateMessage(MSG* pMsg);
+ virtual BOOL OnIdle();
+
+ BEGIN_UPDATE_UI_MAP(CMainFrame)
+ END_UPDATE_UI_MAP()
+
+ BEGIN_MSG_MAP(CMainFrame)
+ COMMAND_ID_HANDLER(ID_APP_EXIT, OnAppExit)
+ MESSAGE_HANDLER(WM_CREATE, OnCreate)
+ MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
+ CHAIN_MSG_MAP(CTrayIconImpl)
+ CHAIN_MSG_MAP(CUpdateUI)
+ CHAIN_MSG_MAP(CFrameWindowImpl)
+ END_MSG_MAP()
+
+// Handler prototypes (uncomment arguments if needed):
+// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
+// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
+// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
+
+ LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
+ LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
+ LRESULT OnAppExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
+
+private:
+ BOOL m_bEnabled;
+};
diff --git a/applications/snowcrash/snowcrash/TrayIconImpl.h b/applications/snowcrash/snowcrash/TrayIconImpl.h
index 9aaa998c..d5be5a06 100644
--- a/applications/snowcrash/snowcrash/TrayIconImpl.h
+++ b/applications/snowcrash/snowcrash/TrayIconImpl.h
@@ -1,112 +1,112 @@
-#ifndef TRAYICONIMPL_H
-#define TRAYICONIMPL_H
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-
-class CNotifyIconData : public NOTIFYICONDATA
-{
-public:
- CNotifyIconData()
- {
- ZeroMemory(this, sizeof(NOTIFYICONDATA));
- cbSize = sizeof(NOTIFYICONDATA);
- }
-};
-
-template
-class CTrayIconImpl
-{
-private:
- UINT WM_TRAYICON;
- CNotifyIconData m_NID;
- BOOL m_bInstalled;
- UINT m_nDefaultItem;
-public:
- CTrayIconImpl() : m_bInstalled(FALSE), m_nDefaultItem(0)
- {
- WM_TRAYICON = RegisterWindowMessage(_T("WM_TRAYICON"));
- }
-
- ~CTrayIconImpl()
- {
- RemoveIcon();
- }
-
- BOOL InstallIcon(TCHAR* strToolTip, HICON hIcon, UINT nID)
- {
- T* pT = static_cast(this);
- m_NID.hWnd = pT->m_hWnd;
- m_NID.uID = nID;
- m_NID.hIcon = hIcon;
- m_NID.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
- m_NID.uCallbackMessage = WM_TRAYICON;
- _tcscpy(m_NID.szTip, strToolTip);
- m_bInstalled = Shell_NotifyIcon(NIM_ADD, &m_NID);
-
- return m_bInstalled;
- }
-
- BOOL RemoveIcon()
- {
- if (!m_bInstalled) return FALSE;
-
- m_NID.uFlags = 0;
- return Shell_NotifyIcon(NIM_DELETE, &m_NID);
- }
-
- BOOL SetToolTipText(TCHAR* strToolTipText)
- {
- if (strToolTipText == NULL)
- return FALSE;
-
- m_NID.uFlags = NIF_TIP;
- _tcscpy(m_NID.szTip, strToolTipText);
-
- return Shell_NotifyIcon(NIM_MODIFY, &m_NID);
- }
-
- inline void SetDefaultItem(UINT nID) { m_nDefaultItem = nID; }
-
- BEGIN_MSG_MAP(CTrayIcon)
- MESSAGE_HANDLER(WM_TRAYICON, OnTrayIcon)
- END_MSG_MAP()
-
- LRESULT OnTrayIcon(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
- {
- if (wParam != m_NID.uID) return 0;
-
- T* pT = static_cast(this);
-
- if (LOWORD(lParam) == WM_RBUTTONUP)
- {
- CMenu menu;
-
- if (!menu.LoadMenu(m_NID.uID))
- return 0;
-
- CMenuHandle submenu(menu.GetSubMenu(0));
- CPoint pos;
- GetCursorPos(&pos);
-
- SetForegroundWindow(pT->m_hWnd);
-
- submenu.SetMenuDefaultItem(m_nDefaultItem);
- submenu.TrackPopupMenu(TPM_LEFTALIGN, pos.x, pos.y, pT->m_hWnd);
-
- pT->PostMessage(WM_NULL);
- menu.DestroyMenu();
- } else if (LOWORD(lParam) == WM_LBUTTONDBLCLK)
- {
- SetForegroundWindow(pT->m_hWnd);
-
- pT->PostMessage(WM_COMMAND, m_nDefaultItem, 0);
- }
-
- return 0;
- }
-};
-
-#endif /* TRAYICONIMPL_H */
-
+#ifndef TRAYICONIMPL_H
+#define TRAYICONIMPL_H
+
+#if _MSC_VER >= 1000
+#pragma once
+#endif // _MSC_VER >= 1000
+
+class CNotifyIconData : public NOTIFYICONDATA
+{
+public:
+ CNotifyIconData()
+ {
+ ZeroMemory(this, sizeof(NOTIFYICONDATA));
+ cbSize = sizeof(NOTIFYICONDATA);
+ }
+};
+
+template
+class CTrayIconImpl
+{
+private:
+ UINT WM_TRAYICON;
+ CNotifyIconData m_NID;
+ BOOL m_bInstalled;
+ UINT m_nDefaultItem;
+public:
+ CTrayIconImpl() : m_bInstalled(FALSE), m_nDefaultItem(0)
+ {
+ WM_TRAYICON = RegisterWindowMessage(_T("WM_TRAYICON"));
+ }
+
+ ~CTrayIconImpl()
+ {
+ RemoveIcon();
+ }
+
+ BOOL InstallIcon(TCHAR* strToolTip, HICON hIcon, UINT nID)
+ {
+ T* pT = static_cast(this);
+ m_NID.hWnd = pT->m_hWnd;
+ m_NID.uID = nID;
+ m_NID.hIcon = hIcon;
+ m_NID.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
+ m_NID.uCallbackMessage = WM_TRAYICON;
+ _tcscpy(m_NID.szTip, strToolTip);
+ m_bInstalled = Shell_NotifyIcon(NIM_ADD, &m_NID);
+
+ return m_bInstalled;
+ }
+
+ BOOL RemoveIcon()
+ {
+ if (!m_bInstalled) return FALSE;
+
+ m_NID.uFlags = 0;
+ return Shell_NotifyIcon(NIM_DELETE, &m_NID);
+ }
+
+ BOOL SetToolTipText(TCHAR* strToolTipText)
+ {
+ if (strToolTipText == NULL)
+ return FALSE;
+
+ m_NID.uFlags = NIF_TIP;
+ _tcscpy(m_NID.szTip, strToolTipText);
+
+ return Shell_NotifyIcon(NIM_MODIFY, &m_NID);
+ }
+
+ inline void SetDefaultItem(UINT nID) { m_nDefaultItem = nID; }
+
+ BEGIN_MSG_MAP(CTrayIcon)
+ MESSAGE_HANDLER(WM_TRAYICON, OnTrayIcon)
+ END_MSG_MAP()
+
+ LRESULT OnTrayIcon(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
+ {
+ if (wParam != m_NID.uID) return 0;
+
+ T* pT = static_cast(this);
+
+ if (LOWORD(lParam) == WM_RBUTTONUP)
+ {
+ CMenu menu;
+
+ if (!menu.LoadMenu(m_NID.uID))
+ return 0;
+
+ CMenuHandle submenu(menu.GetSubMenu(0));
+ CPoint pos;
+ GetCursorPos(&pos);
+
+ SetForegroundWindow(pT->m_hWnd);
+
+ submenu.SetMenuDefaultItem(m_nDefaultItem);
+ submenu.TrackPopupMenu(TPM_LEFTALIGN, pos.x, pos.y, pT->m_hWnd);
+
+ pT->PostMessage(WM_NULL);
+ menu.DestroyMenu();
+ } else if (LOWORD(lParam) == WM_LBUTTONDBLCLK)
+ {
+ SetForegroundWindow(pT->m_hWnd);
+
+ pT->PostMessage(WM_COMMAND, m_nDefaultItem, 0);
+ }
+
+ return 0;
+ }
+};
+
+#endif /* TRAYICONIMPL_H */
+
diff --git a/applications/snowcrash/snowcrash/resource.h b/applications/snowcrash/snowcrash/resource.h
index b8550136..4e49c0de 100644
--- a/applications/snowcrash/snowcrash/resource.h
+++ b/applications/snowcrash/snowcrash/resource.h
@@ -1,22 +1,22 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by snowcrash.rc
-//
-#define IDS_APP_TITLE 103
-#define IDM_ABOUT 104
-#define IDI_SNOWCRASH 107
-#define IDI_SMALL 108
-#define IDC_SNOWCRASH 109
-#define IDC_TRAY 109
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 129
-#define _APS_NEXT_COMMAND_VALUE 32772
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 110
-#endif
-#endif
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by snowcrash.rc
+//
+#define IDS_APP_TITLE 103
+#define IDM_ABOUT 104
+#define IDI_SNOWCRASH 107
+#define IDI_SMALL 108
+#define IDC_SNOWCRASH 109
+#define IDC_TRAY 109
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NO_MFC 1
+#define _APS_NEXT_RESOURCE_VALUE 129
+#define _APS_NEXT_COMMAND_VALUE 32772
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 110
+#endif
+#endif
diff --git a/applications/snowcrash/snowcrash/snowcrash.cpp b/applications/snowcrash/snowcrash/snowcrash.cpp
index a8ef7cb3..837aad90 100644
--- a/applications/snowcrash/snowcrash/snowcrash.cpp
+++ b/applications/snowcrash/snowcrash/snowcrash.cpp
@@ -1,62 +1,62 @@
-// snowcrash.cpp : main source file for snowcrash.exe
-//
-
-#include "stdafx.h"
-
-#include "resource.h"
-
-#include "MainFrame.h"
-
-CAppModule _Module;
-
-int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
-{
- CMessageLoop theLoop;
- _Module.AddMessageLoop(&theLoop);
-
- CMainFrame wndMain;
-
- if(wndMain.CreateEx() == NULL)
- {
- ATLTRACE(_T("Main window creation failed!\n"));
- return 0;
- }
-
- wndMain.ShowWindow(SW_HIDE);
-
- int nRet = theLoop.Run();
-
- _Module.RemoveMessageLoop();
- return nRet;
-}
-
-int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
-{
-#ifdef ECHO
- AllocConsole();
-#endif
-
- HRESULT hRes = ::CoInitialize(NULL);
-// If you are running on NT 4.0 or higher you can use the following call instead to
-// make the EXE free threaded. This means that calls come in on a random RPC thread.
-// HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
- ATLASSERT(SUCCEEDED(hRes));
-
- // this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
- ::DefWindowProc(NULL, 0, 0, 0L);
-
- AtlInitCommonControls(ICC_BAR_CLASSES); // add flags to support other controls
-
- hRes = _Module.Init(NULL, hInstance);
- ATLASSERT(SUCCEEDED(hRes));
-
- int nRet = Run(lpstrCmdLine, nCmdShow);
-
- _Module.Term();
- ::CoUninitialize();
-
-#ifdef ECHO
- FreeConsole();
-#endif
- return nRet;
-}
+// snowcrash.cpp : main source file for snowcrash.exe
+//
+
+#include "stdafx.h"
+
+#include "resource.h"
+
+#include "MainFrame.h"
+
+CAppModule _Module;
+
+int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
+{
+ CMessageLoop theLoop;
+ _Module.AddMessageLoop(&theLoop);
+
+ CMainFrame wndMain;
+
+ if(wndMain.CreateEx() == NULL)
+ {
+ ATLTRACE(_T("Main window creation failed!\n"));
+ return 0;
+ }
+
+ wndMain.ShowWindow(SW_HIDE);
+
+ int nRet = theLoop.Run();
+
+ _Module.RemoveMessageLoop();
+ return nRet;
+}
+
+int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
+{
+#ifdef ECHO
+ AllocConsole();
+#endif
+
+ HRESULT hRes = ::CoInitialize(NULL);
+// If you are running on NT 4.0 or higher you can use the following call instead to
+// make the EXE free threaded. This means that calls come in on a random RPC thread.
+// HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
+ ATLASSERT(SUCCEEDED(hRes));
+
+ // this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
+ ::DefWindowProc(NULL, 0, 0, 0L);
+
+ AtlInitCommonControls(ICC_BAR_CLASSES); // add flags to support other controls
+
+ hRes = _Module.Init(NULL, hInstance);
+ ATLASSERT(SUCCEEDED(hRes));
+
+ int nRet = Run(lpstrCmdLine, nCmdShow);
+
+ _Module.Term();
+ ::CoUninitialize();
+
+#ifdef ECHO
+ FreeConsole();
+#endif
+ return nRet;
+}
diff --git a/applications/snowcrash/snowcrash/snowcrash.h b/applications/snowcrash/snowcrash/snowcrash.h
index e60f2eb7..d00d47e7 100644
--- a/applications/snowcrash/snowcrash/snowcrash.h
+++ b/applications/snowcrash/snowcrash/snowcrash.h
@@ -1,3 +1,3 @@
-#pragma once
-
-#include "resource.h"
+#pragma once
+
+#include "resource.h"
diff --git a/applications/snowcrash/snowcrash/snowcrash.rc b/applications/snowcrash/snowcrash/snowcrash.rc
index 8da52f75..0a2f0b7f 100644
--- a/applications/snowcrash/snowcrash/snowcrash.rc
+++ b/applications/snowcrash/snowcrash/snowcrash.rc
@@ -1,115 +1,115 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#define APSTUDIO_HIDDEN_SYMBOLS
-#include "windows.h"
-#undef APSTUDIO_HIDDEN_SYMBOLS
-#include "atlres.h"
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_SNOWCRASH ICON "snowcrash.ico"
-IDI_SMALL ICON "small.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDC_TRAY MENU
-BEGIN
- POPUP "_POPUP_"
- BEGIN
- MENUITEM "E&xit", ID_APP_EXIT
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-IDC_SNOWCRASH ACCELERATORS
-BEGIN
- "?", IDM_ABOUT, ASCII, ALT
- "/", IDM_ABOUT, ASCII, ALT
-END
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
- "#include ""windows.h""\r\n"
- "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
- "#include ""atlres.h""\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
- IDS_APP_TITLE "snowcrash"
- IDC_SNOWCRASH "SNOWCRASH"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
+#include "atlres.h"
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_SNOWCRASH ICON "snowcrash.ico"
+IDI_SMALL ICON "small.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDC_TRAY MENU
+BEGIN
+ POPUP "_POPUP_"
+ BEGIN
+ MENUITEM "E&xit", ID_APP_EXIT
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDC_SNOWCRASH ACCELERATORS
+BEGIN
+ "?", IDM_ABOUT, ASCII, ALT
+ "/", IDM_ABOUT, ASCII, ALT
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""windows.h""\r\n"
+ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""atlres.h""\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+ IDS_APP_TITLE "snowcrash"
+ IDC_SNOWCRASH "SNOWCRASH"
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/applications/snowcrash/snowcrash/snowcrash.vcproj b/applications/snowcrash/snowcrash/snowcrash.vcproj
index 7cb1036d..c32523ae 100644
--- a/applications/snowcrash/snowcrash/snowcrash.vcproj
+++ b/applications/snowcrash/snowcrash/snowcrash.vcproj
@@ -1,181 +1,181 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/snowcrash/snowcrash/stdafx.cpp b/applications/snowcrash/snowcrash/stdafx.cpp
index 3d483850..b62bf170 100644
--- a/applications/snowcrash/snowcrash/stdafx.cpp
+++ b/applications/snowcrash/snowcrash/stdafx.cpp
@@ -1,32 +1,32 @@
-// stdafx.cpp : source file that includes just the standard includes
-// snowcrash.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-#if (_ATL_VER < 0x0700)
-#include
-#endif //(_ATL_VER < 0x0700)
-
-#ifdef ECHO
-void dprintf(char *format, ...)
-{
- LPSTR pBuffer = new TCHAR[8192];
-
- if (pBuffer != NULL)
- {
- va_list args;
- DWORD dwWrote;
-
- va_start(args, format);
- _vsnprintf(pBuffer, 8192, format, args);
- va_end(args);
-
- WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), pBuffer, (DWORD)strlen(pBuffer), &dwWrote, NULL);
-
- delete [] pBuffer;
- }
-}
-#else
-#define dprintf
+// stdafx.cpp : source file that includes just the standard includes
+// snowcrash.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+#if (_ATL_VER < 0x0700)
+#include
+#endif //(_ATL_VER < 0x0700)
+
+#ifdef ECHO
+void dprintf(char *format, ...)
+{
+ LPSTR pBuffer = new TCHAR[8192];
+
+ if (pBuffer != NULL)
+ {
+ va_list args;
+ DWORD dwWrote;
+
+ va_start(args, format);
+ _vsnprintf(pBuffer, 8192, format, args);
+ va_end(args);
+
+ WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), pBuffer, (DWORD)strlen(pBuffer), &dwWrote, NULL);
+
+ delete [] pBuffer;
+ }
+}
+#else
+#define dprintf
#endif
\ No newline at end of file
diff --git a/applications/snowcrash/snowcrash/stdafx.h b/applications/snowcrash/snowcrash/stdafx.h
index 4bb7563f..c562b18a 100644
--- a/applications/snowcrash/snowcrash/stdafx.h
+++ b/applications/snowcrash/snowcrash/stdafx.h
@@ -1,35 +1,35 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-// Change these values to use different versions
-#define WINVER 0x0400
-//#define _WIN32_WINNT 0x0400
-
-#include
-#include
-#include
-
-extern CAppModule _Module;
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include "../snowflake/snowflake.h"
-
-#ifdef _DEBUG
-#define ECHO
-#endif
-
-#ifdef ECHO
-void dprintf(char *format, ...);
-#else
-#define dprintf
-#endif
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+// Change these values to use different versions
+#define WINVER 0x0400
+//#define _WIN32_WINNT 0x0400
+
+#include
+#include
+#include
+
+extern CAppModule _Module;
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include "../snowflake/snowflake.h"
+
+#ifdef _DEBUG
+#define ECHO
+#endif
+
+#ifdef ECHO
+void dprintf(char *format, ...);
+#else
+#define dprintf
+#endif
diff --git a/applications/snowcrash/snowflake/Block.cpp b/applications/snowcrash/snowflake/Block.cpp
index 0c2dea87..9f82a21b 100644
--- a/applications/snowcrash/snowflake/Block.cpp
+++ b/applications/snowcrash/snowflake/Block.cpp
@@ -1,131 +1,131 @@
-#include "StdAfx.h"
-#include ".\Block.h"
-#include ".\keywords.h"
-
-CBlock::CBlock(void)
-{
- m_lpVars = NULL;
-
- m_lpPrev = NULL;
- m_lpNext = NULL;
-}
-
-CBlock::~CBlock(void)
-{
-}
-
-void CBlock::FreeVars(void)
-{
- CVar *var = m_lpVars;
-
- while (var)
- {
- if (var->m_lpNext)
- {
- var = var->m_lpNext;
-
- if (var->m_lpPrev)
- SAFE_DELETE(var->m_lpPrev);
- }
- else
- SAFE_DELETE(var);
- }
-
- m_lpVars = NULL;
-}
-
-bool CBlock::AddVar(CVar *lpVar)
-{
- CVar *var = NULL;
-
- if (m_lpVars)
- {
- var = m_lpVars;
-
- while (var->m_lpNext)
- var = var->m_lpNext;
-
- var->m_lpNext = lpVar;
-
- if (!var->m_lpNext) return false;
-
- var->m_lpNext->m_lpNext = NULL;
- var->m_lpNext->m_lpPrev = var;
-
- return true;
- }
- else
- {
- var = lpVar;
-
- if (!var) return false;
-
- m_lpVars = var;
- m_lpVars->m_lpNext = NULL;
- m_lpVars->m_lpPrev = NULL;
-
- return true;
- }
-
- return false;
-}
-
-CVar *CBlock::FindVar(char *lpszVar)
-{
- CVar *var= m_lpVars;
-
- while (var)
- {
- if (var->m_lpszVar && !stricmp(lpszVar, var->m_lpszVar))
- return var;
-
- var = var->m_lpNext;
- }
-
- return NULL;
-}
-
-int CBlock::CountVar(char *lpszVar)
-{
- CVar *var= m_lpVars;
- int nCount = 0;
-
- while (var)
- {
- if (var->m_lpszVar && !stricmp(lpszVar, var->m_lpszVar))
- nCount++;
-
- var = var->m_lpNext;
- }
-
- return nCount;
-}
-
-void CBlock::Dump(void)
-{
- CVar *var = m_lpVars;
-
- while (var)
- {
- var->Dump();
- var = var->m_lpNext;
- }
-}
-
-int CBlock::Pack(LPBYTE lpData)
-{
- int nTotalWrote = 0;
- int nWrote = 0;
- LPBYTE lpPtr = lpData;
- CVar *var = m_lpVars;
-
- while (var)
- {
- nWrote = var->Pack(lpPtr);
- lpPtr += nWrote;
- nTotalWrote += nWrote;
- var = var->m_lpNext;
- }
-
- return nTotalWrote;
+#include "StdAfx.h"
+#include ".\Block.h"
+#include ".\keywords.h"
+
+CBlock::CBlock(void)
+{
+ m_lpVars = NULL;
+
+ m_lpPrev = NULL;
+ m_lpNext = NULL;
+}
+
+CBlock::~CBlock(void)
+{
+}
+
+void CBlock::FreeVars(void)
+{
+ CVar *var = m_lpVars;
+
+ while (var)
+ {
+ if (var->m_lpNext)
+ {
+ var = var->m_lpNext;
+
+ if (var->m_lpPrev)
+ SAFE_DELETE(var->m_lpPrev);
+ }
+ else
+ SAFE_DELETE(var);
+ }
+
+ m_lpVars = NULL;
+}
+
+bool CBlock::AddVar(CVar *lpVar)
+{
+ CVar *var = NULL;
+
+ if (m_lpVars)
+ {
+ var = m_lpVars;
+
+ while (var->m_lpNext)
+ var = var->m_lpNext;
+
+ var->m_lpNext = lpVar;
+
+ if (!var->m_lpNext) return false;
+
+ var->m_lpNext->m_lpNext = NULL;
+ var->m_lpNext->m_lpPrev = var;
+
+ return true;
+ }
+ else
+ {
+ var = lpVar;
+
+ if (!var) return false;
+
+ m_lpVars = var;
+ m_lpVars->m_lpNext = NULL;
+ m_lpVars->m_lpPrev = NULL;
+
+ return true;
+ }
+
+ return false;
+}
+
+CVar *CBlock::FindVar(char *lpszVar)
+{
+ CVar *var= m_lpVars;
+
+ while (var)
+ {
+ if (var->m_lpszVar && !stricmp(lpszVar, var->m_lpszVar))
+ return var;
+
+ var = var->m_lpNext;
+ }
+
+ return NULL;
+}
+
+int CBlock::CountVar(char *lpszVar)
+{
+ CVar *var= m_lpVars;
+ int nCount = 0;
+
+ while (var)
+ {
+ if (var->m_lpszVar && !stricmp(lpszVar, var->m_lpszVar))
+ nCount++;
+
+ var = var->m_lpNext;
+ }
+
+ return nCount;
+}
+
+void CBlock::Dump(void)
+{
+ CVar *var = m_lpVars;
+
+ while (var)
+ {
+ var->Dump();
+ var = var->m_lpNext;
+ }
+}
+
+int CBlock::Pack(LPBYTE lpData)
+{
+ int nTotalWrote = 0;
+ int nWrote = 0;
+ LPBYTE lpPtr = lpData;
+ CVar *var = m_lpVars;
+
+ while (var)
+ {
+ nWrote = var->Pack(lpPtr);
+ lpPtr += nWrote;
+ nTotalWrote += nWrote;
+ var = var->m_lpNext;
+ }
+
+ return nTotalWrote;
}
\ No newline at end of file
diff --git a/applications/snowcrash/snowflake/Block.h b/applications/snowcrash/snowflake/Block.h
index c79fe029..1d1cd9c1 100644
--- a/applications/snowcrash/snowflake/Block.h
+++ b/applications/snowcrash/snowflake/Block.h
@@ -1,24 +1,24 @@
-#pragma once
-
-#include ".\Var.h"
-
-class CBlock
-{
-public:
- CBlock(void);
- ~CBlock(void);
-
- BYTE cItems;
-
- CVar *m_lpVars;
-
- CBlock *m_lpNext;
- CBlock *m_lpPrev;
-
- void FreeVars(void);
- bool AddVar(CVar *lpVar);
- CVar *FindVar(char *lpszVar);
- int CountVar(char *lpszVar);
- void Dump(void);
- int Pack(LPBYTE lpData);
-};
+#pragma once
+
+#include ".\Var.h"
+
+class CBlock
+{
+public:
+ CBlock(void);
+ ~CBlock(void);
+
+ BYTE cItems;
+
+ CVar *m_lpVars;
+
+ CBlock *m_lpNext;
+ CBlock *m_lpPrev;
+
+ void FreeVars(void);
+ bool AddVar(CVar *lpVar);
+ CVar *FindVar(char *lpszVar);
+ int CountVar(char *lpszVar);
+ void Dump(void);
+ int Pack(LPBYTE lpData);
+};
diff --git a/applications/snowcrash/snowflake/BlockList.cpp b/applications/snowcrash/snowflake/BlockList.cpp
index f69b618b..bf4fe2ee 100644
--- a/applications/snowcrash/snowflake/BlockList.cpp
+++ b/applications/snowcrash/snowflake/BlockList.cpp
@@ -1,175 +1,175 @@
-#include "StdAfx.h"
-#include ".\Blocklist.h"
-#include ".\keywords.h"
-
-CBlockList::CBlockList(void)
-{
- int m_nType = 0;
- m_lpBlocks = NULL;
- m_lpszBlock = NULL;
-
- m_lpPrev = NULL;
- m_lpNext = NULL;
-}
-
-CBlockList::~CBlockList(void)
-{
- SAFE_FREE(m_lpszBlock);
-}
-
-void CBlockList::FreeBlocks(void)
-{
- CBlock *block = m_lpBlocks;
-
- while (block)
- {
- if (block->m_lpNext)
- {
- block = block->m_lpNext;
-
- if (block->m_lpPrev)
- SAFE_DELETE(block->m_lpPrev);
- }
- else
- SAFE_DELETE(block);
- }
-
- m_lpBlocks = NULL;
-}
-
-bool CBlockList::AddBlock(CBlock *lpBlock)
-{
- CBlock *block = NULL;
-
- if (m_lpBlocks)
- {
- block = m_lpBlocks;
-
- while (block->m_lpNext)
- block = block->m_lpNext;
-
- block->m_lpNext = lpBlock;
-
- if (!block->m_lpNext) return false;
-
- block->m_lpNext->m_lpNext = NULL;
- block->m_lpNext->m_lpPrev = block;
-
- return true;
- }
- else
- {
- block = lpBlock;
-
- if (!block) return false;
-
- m_lpBlocks = block;
- m_lpBlocks->m_lpNext = NULL;
- m_lpBlocks->m_lpPrev = NULL;
-
- return true;
- }
-
- return false;
-}
-
-
-void CBlockList::SetBlock(char *lpszBlock)
-{
- if (lpszBlock)
- {
- size_t stLen = strlen(lpszBlock);
-
- if (stLen > 0)
- {
- SAFE_FREE(m_lpszBlock);
- m_lpszBlock = (char *)malloc(stLen + 1);
-
- if (m_lpszBlock)
- {
- strncpy(m_lpszBlock, lpszBlock, stLen);
- m_lpszBlock[stLen] = '\0';
- }
- }
- }
-}
-
-void CBlockList::SetType(int nType)
-{
- m_nType = nType;
-}
-
-CBlock *CBlockList::GetBlock(int nIndex)
-{
- CBlock *block = m_lpBlocks;
- int i = 0;
-
- while (block)
- {
- if (i == nIndex)
- return block;
-
- block = block->m_lpNext;
- i++;
- }
-
- return NULL;
-}
-
-int CBlockList::CountBlock(void)
-{
- CBlock *block = m_lpBlocks;
- int nCount = 0;
-
- while (block)
- {
- nCount++;
- block = block->m_lpNext;
- }
-
- return nCount;
-}
-
-void CBlockList::Dump(void)
-{
- if (m_lpszBlock)
- dprintf("%s\n", m_lpszBlock);
-
- CBlock *block = m_lpBlocks;
-
- while (block)
- {
- block->Dump();
- block = block->m_lpNext;
- }
-}
-
-
-int CBlockList::Pack(LPBYTE lpData)
-{
- int nTotalWrote = 0;
- int nWrote = 0;
- LPBYTE lpPtr = lpData;
- CBlock *block = m_lpBlocks;
-
- if (m_nType == LLTYPE_VARIABLE)
- {
- BYTE cItems;
-
- cItems = CountBlock();
-
- memcpy(lpPtr, &cItems, sizeof(cItems));
- nTotalWrote = sizeof(cItems);
- lpPtr += sizeof(cItems);
- }
-
- while (block)
- {
- nWrote = block->Pack(lpPtr);
- lpPtr += nWrote;
- nTotalWrote += nWrote;
- block = block->m_lpNext;
- }
-
- return nTotalWrote;
+#include "StdAfx.h"
+#include ".\Blocklist.h"
+#include ".\keywords.h"
+
+CBlockList::CBlockList(void)
+{
+ int m_nType = 0;
+ m_lpBlocks = NULL;
+ m_lpszBlock = NULL;
+
+ m_lpPrev = NULL;
+ m_lpNext = NULL;
+}
+
+CBlockList::~CBlockList(void)
+{
+ SAFE_FREE(m_lpszBlock);
+}
+
+void CBlockList::FreeBlocks(void)
+{
+ CBlock *block = m_lpBlocks;
+
+ while (block)
+ {
+ if (block->m_lpNext)
+ {
+ block = block->m_lpNext;
+
+ if (block->m_lpPrev)
+ SAFE_DELETE(block->m_lpPrev);
+ }
+ else
+ SAFE_DELETE(block);
+ }
+
+ m_lpBlocks = NULL;
+}
+
+bool CBlockList::AddBlock(CBlock *lpBlock)
+{
+ CBlock *block = NULL;
+
+ if (m_lpBlocks)
+ {
+ block = m_lpBlocks;
+
+ while (block->m_lpNext)
+ block = block->m_lpNext;
+
+ block->m_lpNext = lpBlock;
+
+ if (!block->m_lpNext) return false;
+
+ block->m_lpNext->m_lpNext = NULL;
+ block->m_lpNext->m_lpPrev = block;
+
+ return true;
+ }
+ else
+ {
+ block = lpBlock;
+
+ if (!block) return false;
+
+ m_lpBlocks = block;
+ m_lpBlocks->m_lpNext = NULL;
+ m_lpBlocks->m_lpPrev = NULL;
+
+ return true;
+ }
+
+ return false;
+}
+
+
+void CBlockList::SetBlock(char *lpszBlock)
+{
+ if (lpszBlock)
+ {
+ size_t stLen = strlen(lpszBlock);
+
+ if (stLen > 0)
+ {
+ SAFE_FREE(m_lpszBlock);
+ m_lpszBlock = (char *)malloc(stLen + 1);
+
+ if (m_lpszBlock)
+ {
+ strncpy(m_lpszBlock, lpszBlock, stLen);
+ m_lpszBlock[stLen] = '\0';
+ }
+ }
+ }
+}
+
+void CBlockList::SetType(int nType)
+{
+ m_nType = nType;
+}
+
+CBlock *CBlockList::GetBlock(int nIndex)
+{
+ CBlock *block = m_lpBlocks;
+ int i = 0;
+
+ while (block)
+ {
+ if (i == nIndex)
+ return block;
+
+ block = block->m_lpNext;
+ i++;
+ }
+
+ return NULL;
+}
+
+int CBlockList::CountBlock(void)
+{
+ CBlock *block = m_lpBlocks;
+ int nCount = 0;
+
+ while (block)
+ {
+ nCount++;
+ block = block->m_lpNext;
+ }
+
+ return nCount;
+}
+
+void CBlockList::Dump(void)
+{
+ if (m_lpszBlock)
+ dprintf("%s\n", m_lpszBlock);
+
+ CBlock *block = m_lpBlocks;
+
+ while (block)
+ {
+ block->Dump();
+ block = block->m_lpNext;
+ }
+}
+
+
+int CBlockList::Pack(LPBYTE lpData)
+{
+ int nTotalWrote = 0;
+ int nWrote = 0;
+ LPBYTE lpPtr = lpData;
+ CBlock *block = m_lpBlocks;
+
+ if (m_nType == LLTYPE_VARIABLE)
+ {
+ BYTE cItems;
+
+ cItems = CountBlock();
+
+ memcpy(lpPtr, &cItems, sizeof(cItems));
+ nTotalWrote = sizeof(cItems);
+ lpPtr += sizeof(cItems);
+ }
+
+ while (block)
+ {
+ nWrote = block->Pack(lpPtr);
+ lpPtr += nWrote;
+ nTotalWrote += nWrote;
+ block = block->m_lpNext;
+ }
+
+ return nTotalWrote;
}
\ No newline at end of file
diff --git a/applications/snowcrash/snowflake/BlockList.h b/applications/snowcrash/snowflake/BlockList.h
index 21414874..b6f6813d 100644
--- a/applications/snowcrash/snowflake/BlockList.h
+++ b/applications/snowcrash/snowflake/BlockList.h
@@ -1,28 +1,28 @@
-#pragma once
-
-#include ".\Block.h"
-
-class CBlockList
-{
-public:
- CBlockList(void);
- ~CBlockList(void);
-
- CBlock *m_lpBlocks;
- char *m_lpszBlock;
- int m_nType;
- BYTE cItems;
-
- CBlockList *m_lpNext;
- CBlockList *m_lpPrev;
-
- void FreeBlocks(void);
- bool AddBlock(CBlock *lpBlock);
- CBlock *GetBlock(int nIndex = 0);
- int CountBlock(void);
- void Dump(void);
- int Pack(LPBYTE lpData);
- void SetBlock(char *lpszBlock);
- void SetType(int nType);
-// bool GetString(char *lpszBlock, int nIndex, char *lpszVar, char &lpszStr);
-};
+#pragma once
+
+#include ".\Block.h"
+
+class CBlockList
+{
+public:
+ CBlockList(void);
+ ~CBlockList(void);
+
+ CBlock *m_lpBlocks;
+ char *m_lpszBlock;
+ int m_nType;
+ BYTE cItems;
+
+ CBlockList *m_lpNext;
+ CBlockList *m_lpPrev;
+
+ void FreeBlocks(void);
+ bool AddBlock(CBlock *lpBlock);
+ CBlock *GetBlock(int nIndex = 0);
+ int CountBlock(void);
+ void Dump(void);
+ int Pack(LPBYTE lpData);
+ void SetBlock(char *lpszBlock);
+ void SetType(int nType);
+// bool GetString(char *lpszBlock, int nIndex, char *lpszVar, char &lpszStr);
+};
diff --git a/applications/snowcrash/snowflake/Config.cpp b/applications/snowcrash/snowflake/Config.cpp
index 2be2e8f9..4a68eaad 100644
--- a/applications/snowcrash/snowflake/Config.cpp
+++ b/applications/snowcrash/snowflake/Config.cpp
@@ -1,73 +1,73 @@
-#include "StdAfx.h"
-#include ".\Config.h"
-
-CConfig::CConfig()
-{
- LoadConfig();
-}
-
-CConfig::~CConfig()
-{
-
-}
-
-void CConfig::LoadConfig()
-{
- TCHAR szItem[1024];
- TCHAR lpszPath[MAX_PATH] = {0};
-
- HKEY hKey;
- if (RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Linden Research, Inc.\\SecondLife", &hKey) == ERROR_SUCCESS)
- {
- DWORD dwType = REG_SZ, dwLength = sizeof(szItem);
- if (RegQueryValueEx(hKey, NULL, NULL, &dwType, (LPBYTE)&szItem, &dwLength) == ERROR_SUCCESS)
- {
- ::PathCombine(lpszPath, szItem, "app_settings\\comm.dat");
- m_pCommDatPath = lpszPath;
-
- ::PathCombine(lpszPath, szItem, "app_settings\\message_template.msg");
- m_pMessageTemplatePath = lpszPath;
-
- ::PathCombine(lpszPath, szItem, "snowcrash.txt");
- m_pSnowcrashTxtPath = lpszPath;
- }
- RegCloseKey(hKey);
- }
-}
-
-void CConfig::GetConfigString(LPSTR lpSection, LPSTR lpSubKey, LPSTR lpBuffer, UINT *len, LPSTR lpDefault)
-{
- HKEY hKey;
- char szPath[256];
-
- strncpy(lpBuffer, lpDefault, *len);
- wsprintf(szPath, "Software\\thirty4 interactive\\Snowcrash\\%s", lpSection);
- if (RegOpenKeyEx(HKEY_CURRENT_USER, szPath, 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
- {
- RegQueryValueEx(hKey, lpSubKey, NULL, NULL, (BYTE *)lpBuffer, (unsigned long *)len);
- RegCloseKey(hKey);
- }
-}
-
-BOOL CConfig::GetConfigBool(LPSTR lpSection, LPSTR lpSubKey, BOOL bDefault)
-{
- char szBuffer[256];
- UINT len;
- len = sizeof(szBuffer);
- ZeroMemory(&szBuffer, sizeof(szBuffer));
- GetConfigString(lpSection, lpSubKey, szBuffer, &len, bDefault==TRUE?"Yes":"No");
- return stricmp(szBuffer, "Yes")==0?TRUE:FALSE;
-}
-
-unsigned int CConfig::GetConfigInt(LPSTR lpSection, LPSTR lpSubKey, UINT iDefault)
-{
- char szBuffer[256], szDefault[20];
- UINT len;
- len = sizeof(szBuffer);
- ZeroMemory(&szBuffer, sizeof(szBuffer));
- ZeroMemory(&szDefault, sizeof(szDefault));
- wsprintf(szDefault, "%d", iDefault);
- GetConfigString(lpSection, lpSubKey, szBuffer, &len, szDefault);
-
- return atoi(szBuffer);
-}
+#include "StdAfx.h"
+#include ".\Config.h"
+
+CConfig::CConfig()
+{
+ LoadConfig();
+}
+
+CConfig::~CConfig()
+{
+
+}
+
+void CConfig::LoadConfig()
+{
+ TCHAR szItem[1024];
+ TCHAR lpszPath[MAX_PATH] = {0};
+
+ HKEY hKey;
+ if (RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Linden Research, Inc.\\SecondLife", &hKey) == ERROR_SUCCESS)
+ {
+ DWORD dwType = REG_SZ, dwLength = sizeof(szItem);
+ if (RegQueryValueEx(hKey, NULL, NULL, &dwType, (LPBYTE)&szItem, &dwLength) == ERROR_SUCCESS)
+ {
+ ::PathCombine(lpszPath, szItem, "app_settings\\comm.dat");
+ m_pCommDatPath = lpszPath;
+
+ ::PathCombine(lpszPath, szItem, "app_settings\\message_template.msg");
+ m_pMessageTemplatePath = lpszPath;
+
+ ::PathCombine(lpszPath, szItem, "snowcrash.txt");
+ m_pSnowcrashTxtPath = lpszPath;
+ }
+ RegCloseKey(hKey);
+ }
+}
+
+void CConfig::GetConfigString(LPSTR lpSection, LPSTR lpSubKey, LPSTR lpBuffer, UINT *len, LPSTR lpDefault)
+{
+ HKEY hKey;
+ char szPath[256];
+
+ strncpy(lpBuffer, lpDefault, *len);
+ wsprintf(szPath, "Software\\thirty4 interactive\\Snowcrash\\%s", lpSection);
+ if (RegOpenKeyEx(HKEY_CURRENT_USER, szPath, 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
+ {
+ RegQueryValueEx(hKey, lpSubKey, NULL, NULL, (BYTE *)lpBuffer, (unsigned long *)len);
+ RegCloseKey(hKey);
+ }
+}
+
+BOOL CConfig::GetConfigBool(LPSTR lpSection, LPSTR lpSubKey, BOOL bDefault)
+{
+ char szBuffer[256];
+ UINT len;
+ len = sizeof(szBuffer);
+ ZeroMemory(&szBuffer, sizeof(szBuffer));
+ GetConfigString(lpSection, lpSubKey, szBuffer, &len, bDefault==TRUE?"Yes":"No");
+ return stricmp(szBuffer, "Yes")==0?TRUE:FALSE;
+}
+
+unsigned int CConfig::GetConfigInt(LPSTR lpSection, LPSTR lpSubKey, UINT iDefault)
+{
+ char szBuffer[256], szDefault[20];
+ UINT len;
+ len = sizeof(szBuffer);
+ ZeroMemory(&szBuffer, sizeof(szBuffer));
+ ZeroMemory(&szDefault, sizeof(szDefault));
+ wsprintf(szDefault, "%d", iDefault);
+ GetConfigString(lpSection, lpSubKey, szBuffer, &len, szDefault);
+
+ return atoi(szBuffer);
+}
diff --git a/applications/snowcrash/snowflake/Config.h b/applications/snowcrash/snowflake/Config.h
index 4199bb72..1cc25722 100644
--- a/applications/snowcrash/snowflake/Config.h
+++ b/applications/snowcrash/snowflake/Config.h
@@ -1,17 +1,17 @@
-#pragma once
-
-class CConfig
-{
-public:
- CString m_pCommDatPath;
- CString m_pMessageTemplatePath;
- CString m_pSnowcrashTxtPath;
-
- unsigned int GetConfigInt(LPSTR lpSection, LPSTR lpSubKey, UINT iDefault);
- BOOL GetConfigBool(LPSTR lpSection, LPSTR lpSubKey, BOOL bDefault);
- void GetConfigString(LPSTR lpSection, LPSTR lpSubKey, LPSTR lpBuffer, UINT *len, LPSTR lpDefault);
- void LoadConfig();
- CConfig();
- virtual ~CConfig();
-
-};
+#pragma once
+
+class CConfig
+{
+public:
+ CString m_pCommDatPath;
+ CString m_pMessageTemplatePath;
+ CString m_pSnowcrashTxtPath;
+
+ unsigned int GetConfigInt(LPSTR lpSection, LPSTR lpSubKey, UINT iDefault);
+ BOOL GetConfigBool(LPSTR lpSection, LPSTR lpSubKey, BOOL bDefault);
+ void GetConfigString(LPSTR lpSection, LPSTR lpSubKey, LPSTR lpBuffer, UINT *len, LPSTR lpDefault);
+ void LoadConfig();
+ CConfig();
+ virtual ~CConfig();
+
+};
diff --git a/applications/snowcrash/snowflake/MainFrame.cpp b/applications/snowcrash/snowflake/MainFrame.cpp
index 0c4d942d..bf3ed14e 100644
--- a/applications/snowcrash/snowflake/MainFrame.cpp
+++ b/applications/snowcrash/snowflake/MainFrame.cpp
@@ -1,119 +1,119 @@
-#include "StdAfx.h"
-#include ".\MainFrame.h"
-
-CMainFrame::CMainFrame()
-{
-}
-
-CMainFrame::~CMainFrame()
-{
-}
-
-BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
-{
- if(CFrameWindowImpl::PreTranslateMessage(pMsg))
- return TRUE;
-
- return FALSE;
-}
-
-BOOL CMainFrame::OnIdle()
-{
- dprintf(_T("idle\n"));
- return FALSE;
-}
-
-LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
-{
- LRESULT lResult = baseClass::DefWindowProc();
-
- bHandled = TRUE;
-
- Initialize();
-
- return lResult;
-}
-
-BOOL CMainFrame::SubclassWindow(HWND hwnd)
-{
- dprintf(_T("Subclassing %08x\n"), hwnd);
-
- if (baseClass::SubclassWindow(hwnd))
- {
- Initialize();
- return TRUE;
- }
-
- return FALSE;
-}
-
-HWND CMainFrame::UnsubclassWindow(BOOL bForce)
-{
- HWND hwnd = baseClass::UnsubclassWindow(bForce);
- dprintf(_T("Unsubclassing %08x\n"), hwnd);
- UnpatchWnds();
-
- return hwnd;
-}
-
-BOOL CMainFrame::Initialize()
-{
- if (!PatchWnds())
- return FALSE;
-
- return TRUE;
-}
-
-LRESULT CMainFrame::OnParentNotify(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-{
- switch(LOWORD(wParam))
- {
- case WM_CREATE:
- {
- PatchWnds();
- }
- break;
- }
-
- return 0;
-}
-
-LRESULT CMainFrame::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
-{
- PostQuitMessage(0);
-
- return 0;
-}
-
-BOOL CMainFrame::PatchWnds()
-{
- return TRUE;
-}
-
-void CMainFrame::UnpatchWnds()
-{
-}
-
-LRESULT CMainFrame::OnWindowPosChanging(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-{
- LRESULT lResult = baseClass::DefWindowProc();
- return lResult;
-}
-
-LRESULT CMainFrame::OnWindowPosChanged(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-{
- LRESULT lResult = baseClass::DefWindowProc();
- return lResult;
-}
-
-LRESULT CMainFrame::OnSizing(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-{
- LRESULT lResult = baseClass::DefWindowProc();
- return lResult;
-}
-
-LRESULT CMainFrame::OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
-{
- LRESULT lResult = baseClass::DefWindowProc();
- return lResult;
+#include "StdAfx.h"
+#include ".\MainFrame.h"
+
+CMainFrame::CMainFrame()
+{
+}
+
+CMainFrame::~CMainFrame()
+{
+}
+
+BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
+{
+ if(CFrameWindowImpl::PreTranslateMessage(pMsg))
+ return TRUE;
+
+ return FALSE;
+}
+
+BOOL CMainFrame::OnIdle()
+{
+ dprintf(_T("idle\n"));
+ return FALSE;
+}
+
+LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
+{
+ LRESULT lResult = baseClass::DefWindowProc();
+
+ bHandled = TRUE;
+
+ Initialize();
+
+ return lResult;
+}
+
+BOOL CMainFrame::SubclassWindow(HWND hwnd)
+{
+ dprintf(_T("Subclassing %08x\n"), hwnd);
+
+ if (baseClass::SubclassWindow(hwnd))
+ {
+ Initialize();
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+HWND CMainFrame::UnsubclassWindow(BOOL bForce)
+{
+ HWND hwnd = baseClass::UnsubclassWindow(bForce);
+ dprintf(_T("Unsubclassing %08x\n"), hwnd);
+ UnpatchWnds();
+
+ return hwnd;
+}
+
+BOOL CMainFrame::Initialize()
+{
+ if (!PatchWnds())
+ return FALSE;
+
+ return TRUE;
+}
+
+LRESULT CMainFrame::OnParentNotify(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+ switch(LOWORD(wParam))
+ {
+ case WM_CREATE:
+ {
+ PatchWnds();
+ }
+ break;
+ }
+
+ return 0;
+}
+
+LRESULT CMainFrame::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
+{
+ PostQuitMessage(0);
+
+ return 0;
+}
+
+BOOL CMainFrame::PatchWnds()
+{
+ return TRUE;
+}
+
+void CMainFrame::UnpatchWnds()
+{
+}
+
+LRESULT CMainFrame::OnWindowPosChanging(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+ LRESULT lResult = baseClass::DefWindowProc();
+ return lResult;
+}
+
+LRESULT CMainFrame::OnWindowPosChanged(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+ LRESULT lResult = baseClass::DefWindowProc();
+ return lResult;
+}
+
+LRESULT CMainFrame::OnSizing(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+ LRESULT lResult = baseClass::DefWindowProc();
+ return lResult;
+}
+
+LRESULT CMainFrame::OnSize(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+ LRESULT lResult = baseClass::DefWindowProc();
+ return lResult;
}
\ No newline at end of file
diff --git a/applications/snowcrash/snowflake/MainFrame.h b/applications/snowcrash/snowflake/MainFrame.h
index 1157bd78..8e71481b 100644
--- a/applications/snowcrash/snowflake/MainFrame.h
+++ b/applications/snowcrash/snowflake/MainFrame.h
@@ -1,47 +1,47 @@
-#pragma once
-
-class CMainFrame : public CFrameWindowImpl,
- public CMessageFilter, public CIdleHandler
-{
- typedef CMainFrame thisClass;
- typedef CFrameWindowImpl baseClass;
-public:
- CMainFrame();
- ~CMainFrame();
-
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- virtual BOOL OnIdle();
-
- BEGIN_MSG_MAP(thisClass)
-// MESSAGE_HANDLER(WM_CREATE, OnCreate)
-// MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
-// MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify)
-// MESSAGE_HANDLER(WM_WINDOWPOSCHANGING, OnWindowPosChanging)
-// MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged)
-// MESSAGE_HANDLER(WM_SIZING, OnSizing)
-// MESSAGE_HANDLER(WM_SIZE, OnSize)
-
- CHAIN_MSG_MAP(CFrameWindowImpl)
- END_MSG_MAP()
-
- // Handler prototypes (uncomment arguments if needed):
-// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
-// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
-// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
-
- LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
- LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
- LRESULT OnParentNotify(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
- LRESULT OnWindowPosChanging(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
- LRESULT OnWindowPosChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
- LRESULT OnSizing(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
- LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
-
- BOOL SubclassWindow(HWND hwnd);
- HWND UnsubclassWindow(BOOL bForce);
-
-protected:
- BOOL Initialize();
- BOOL PatchWnds();
- void UnpatchWnds();
-};
+#pragma once
+
+class CMainFrame : public CFrameWindowImpl,
+ public CMessageFilter, public CIdleHandler
+{
+ typedef CMainFrame thisClass;
+ typedef CFrameWindowImpl baseClass;
+public:
+ CMainFrame();
+ ~CMainFrame();
+
+ virtual BOOL PreTranslateMessage(MSG* pMsg);
+ virtual BOOL OnIdle();
+
+ BEGIN_MSG_MAP(thisClass)
+// MESSAGE_HANDLER(WM_CREATE, OnCreate)
+// MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
+// MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify)
+// MESSAGE_HANDLER(WM_WINDOWPOSCHANGING, OnWindowPosChanging)
+// MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged)
+// MESSAGE_HANDLER(WM_SIZING, OnSizing)
+// MESSAGE_HANDLER(WM_SIZE, OnSize)
+
+ CHAIN_MSG_MAP(CFrameWindowImpl)
+ END_MSG_MAP()
+
+ // Handler prototypes (uncomment arguments if needed):
+// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
+// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
+// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
+
+ LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
+ LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
+ LRESULT OnParentNotify(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
+ LRESULT OnWindowPosChanging(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
+ LRESULT OnWindowPosChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
+ LRESULT OnSizing(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
+ LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
+
+ BOOL SubclassWindow(HWND hwnd);
+ HWND UnsubclassWindow(BOOL bForce);
+
+protected:
+ BOOL Initialize();
+ BOOL PatchWnds();
+ void UnpatchWnds();
+};
diff --git a/applications/snowcrash/snowflake/Message.cpp b/applications/snowcrash/snowflake/Message.cpp
index 3de532a8..d228560e 100644
--- a/applications/snowcrash/snowflake/Message.cpp
+++ b/applications/snowcrash/snowflake/Message.cpp
@@ -1,218 +1,218 @@
-#include "StdAfx.h"
-#include ".\Message.h"
-
-CMessage::CMessage(void)
-{
- m_lpBlocks = NULL;
- m_lpszCommand = NULL;
-}
-
-CMessage::~CMessage(void)
-{
- FreeBlocks();
- SAFE_FREE(m_lpszCommand);
-}
-
-void CMessage::FreeBlocks(void)
-{
- CBlockList *blocks = m_lpBlocks;
-
- while (blocks)
- {
- if (blocks->m_lpNext)
- {
- blocks = blocks->m_lpNext;
-
- if (blocks->m_lpPrev)
- SAFE_DELETE(blocks->m_lpPrev);
- }
- else
- SAFE_DELETE(blocks);
- }
-
- m_lpBlocks = NULL;
-}
-
-bool CMessage::AddBlock(char *lpszBlock, int nType, CBlock *lpBlock)
-{
- CBlockList *blocks = FindBlock(lpszBlock);
-
- if (blocks)
- {
- return blocks->AddBlock(lpBlock);
- }
- else
- {
- if (m_lpBlocks)
- {
- blocks = m_lpBlocks;
-
- while (blocks->m_lpNext)
- blocks = blocks->m_lpNext;
-
- blocks->m_lpNext = new CBlockList;
-
- if (!blocks->m_lpNext) return false;
-
- blocks->m_lpNext->m_lpNext = NULL;
- blocks->m_lpNext->m_lpPrev = blocks;
- blocks->m_lpNext->SetBlock(lpszBlock);
- blocks->m_lpNext->SetType(nType);
- blocks->m_lpNext->AddBlock(lpBlock);
-
- return true;
- }
- else
- {
- blocks = new CBlockList;
-
- if (!blocks) return false;
-
- m_lpBlocks = blocks;
- m_lpBlocks->m_lpNext = NULL;
- m_lpBlocks->m_lpPrev = NULL;
- m_lpBlocks->SetBlock(lpszBlock);
- m_lpBlocks->SetType(nType);
- m_lpBlocks->AddBlock(lpBlock);
-
- return true;
- }
-
- return false;
- }
-}
-
-CBlock *CMessage::GetBlock(char *lpszBlock, int nIndex)
-{
- CBlockList *blocks = m_lpBlocks;
-
- while (blocks)
- {
- if (blocks->m_lpszBlock && !stricmp(lpszBlock, blocks->m_lpszBlock))
- {
- CBlock *block = blocks->GetBlock(nIndex);
- return block;
- }
-
- blocks = blocks->m_lpNext;
- }
-
- return NULL;
-}
-
-CBlockList *CMessage::FindBlock(char *lpszBlock)
-{
- CBlockList *blocks = m_lpBlocks;
-
- while (blocks)
- {
- if (blocks->m_lpszBlock && !stricmp(lpszBlock, blocks->m_lpszBlock))
- return blocks;
-
- blocks = blocks->m_lpNext;
- }
-
- return NULL;
-}
-
-int CMessage::CountBlock(char *lpszBlock)
-{
- CBlockList *blocks = FindBlock(lpszBlock);
-
- if (blocks)
- {
- return blocks->CountBlock();
- }
-
- return 0;
-}
-
-bool CMessage::GetString(char *lpszBlock, int nIndex, char *lpszVar, char &lpszStr)
-{
- CBlock *block = GetBlock(lpszBlock, nIndex);
-
- if (block)
- {
- CVar *var = block->FindVar(lpszVar);
-
- if (var)
- {
- var->GetString(lpszStr);
-
- return true;
- }
- }
-
- return false;
-}
-
-bool CMessage::GetBool(char *lpszBlock, int nIndex, char *lpszVar, bool &lpbBool)
-{
- CBlock *block = GetBlock(lpszBlock, nIndex);
-
- if (block)
- {
- CVar *var = block->FindVar(lpszVar);
-
- if (var)
- {
- var->GetBool(lpbBool);
-
- return true;
- }
- }
-
- return false;
-}
-
-void CMessage::SetCommand(char *lpszCommand)
-{
- if (lpszCommand)
- {
- size_t stLen = strlen(lpszCommand);
-
- if (stLen > 0)
- {
- SAFE_FREE(m_lpszCommand);
- m_lpszCommand = (char *)malloc(stLen + 1);
-
- if (m_lpszCommand)
- {
- strncpy(m_lpszCommand, lpszCommand, stLen);
- m_lpszCommand[stLen] = '\0';
- }
- }
- }
-}
-
-void CMessage::Dump(void)
-{
- if (m_lpszCommand)
- dprintf("----- %s -----\n", m_lpszCommand);
-
- CBlockList *blocks = m_lpBlocks;
-
- while (blocks)
- {
- blocks->Dump();
- blocks = blocks->m_lpNext;
- }
-}
-
-int CMessage::Pack(LPBYTE lpData)
-{
- int nTotalWrote = 0;
- int nWrote = 0;
- LPBYTE lpPtr = lpData;
- CBlockList *blocks = m_lpBlocks;
-
- while (blocks)
- {
- nWrote = blocks->Pack(lpPtr);
- lpPtr += nWrote;
- nTotalWrote += nWrote;
- blocks = blocks->m_lpNext;
- }
-
- return nTotalWrote;
+#include "StdAfx.h"
+#include ".\Message.h"
+
+CMessage::CMessage(void)
+{
+ m_lpBlocks = NULL;
+ m_lpszCommand = NULL;
+}
+
+CMessage::~CMessage(void)
+{
+ FreeBlocks();
+ SAFE_FREE(m_lpszCommand);
+}
+
+void CMessage::FreeBlocks(void)
+{
+ CBlockList *blocks = m_lpBlocks;
+
+ while (blocks)
+ {
+ if (blocks->m_lpNext)
+ {
+ blocks = blocks->m_lpNext;
+
+ if (blocks->m_lpPrev)
+ SAFE_DELETE(blocks->m_lpPrev);
+ }
+ else
+ SAFE_DELETE(blocks);
+ }
+
+ m_lpBlocks = NULL;
+}
+
+bool CMessage::AddBlock(char *lpszBlock, int nType, CBlock *lpBlock)
+{
+ CBlockList *blocks = FindBlock(lpszBlock);
+
+ if (blocks)
+ {
+ return blocks->AddBlock(lpBlock);
+ }
+ else
+ {
+ if (m_lpBlocks)
+ {
+ blocks = m_lpBlocks;
+
+ while (blocks->m_lpNext)
+ blocks = blocks->m_lpNext;
+
+ blocks->m_lpNext = new CBlockList;
+
+ if (!blocks->m_lpNext) return false;
+
+ blocks->m_lpNext->m_lpNext = NULL;
+ blocks->m_lpNext->m_lpPrev = blocks;
+ blocks->m_lpNext->SetBlock(lpszBlock);
+ blocks->m_lpNext->SetType(nType);
+ blocks->m_lpNext->AddBlock(lpBlock);
+
+ return true;
+ }
+ else
+ {
+ blocks = new CBlockList;
+
+ if (!blocks) return false;
+
+ m_lpBlocks = blocks;
+ m_lpBlocks->m_lpNext = NULL;
+ m_lpBlocks->m_lpPrev = NULL;
+ m_lpBlocks->SetBlock(lpszBlock);
+ m_lpBlocks->SetType(nType);
+ m_lpBlocks->AddBlock(lpBlock);
+
+ return true;
+ }
+
+ return false;
+ }
+}
+
+CBlock *CMessage::GetBlock(char *lpszBlock, int nIndex)
+{
+ CBlockList *blocks = m_lpBlocks;
+
+ while (blocks)
+ {
+ if (blocks->m_lpszBlock && !stricmp(lpszBlock, blocks->m_lpszBlock))
+ {
+ CBlock *block = blocks->GetBlock(nIndex);
+ return block;
+ }
+
+ blocks = blocks->m_lpNext;
+ }
+
+ return NULL;
+}
+
+CBlockList *CMessage::FindBlock(char *lpszBlock)
+{
+ CBlockList *blocks = m_lpBlocks;
+
+ while (blocks)
+ {
+ if (blocks->m_lpszBlock && !stricmp(lpszBlock, blocks->m_lpszBlock))
+ return blocks;
+
+ blocks = blocks->m_lpNext;
+ }
+
+ return NULL;
+}
+
+int CMessage::CountBlock(char *lpszBlock)
+{
+ CBlockList *blocks = FindBlock(lpszBlock);
+
+ if (blocks)
+ {
+ return blocks->CountBlock();
+ }
+
+ return 0;
+}
+
+bool CMessage::GetString(char *lpszBlock, int nIndex, char *lpszVar, char &lpszStr)
+{
+ CBlock *block = GetBlock(lpszBlock, nIndex);
+
+ if (block)
+ {
+ CVar *var = block->FindVar(lpszVar);
+
+ if (var)
+ {
+ var->GetString(lpszStr);
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool CMessage::GetBool(char *lpszBlock, int nIndex, char *lpszVar, bool &lpbBool)
+{
+ CBlock *block = GetBlock(lpszBlock, nIndex);
+
+ if (block)
+ {
+ CVar *var = block->FindVar(lpszVar);
+
+ if (var)
+ {
+ var->GetBool(lpbBool);
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void CMessage::SetCommand(char *lpszCommand)
+{
+ if (lpszCommand)
+ {
+ size_t stLen = strlen(lpszCommand);
+
+ if (stLen > 0)
+ {
+ SAFE_FREE(m_lpszCommand);
+ m_lpszCommand = (char *)malloc(stLen + 1);
+
+ if (m_lpszCommand)
+ {
+ strncpy(m_lpszCommand, lpszCommand, stLen);
+ m_lpszCommand[stLen] = '\0';
+ }
+ }
+ }
+}
+
+void CMessage::Dump(void)
+{
+ if (m_lpszCommand)
+ dprintf("----- %s -----\n", m_lpszCommand);
+
+ CBlockList *blocks = m_lpBlocks;
+
+ while (blocks)
+ {
+ blocks->Dump();
+ blocks = blocks->m_lpNext;
+ }
+}
+
+int CMessage::Pack(LPBYTE lpData)
+{
+ int nTotalWrote = 0;
+ int nWrote = 0;
+ LPBYTE lpPtr = lpData;
+ CBlockList *blocks = m_lpBlocks;
+
+ while (blocks)
+ {
+ nWrote = blocks->Pack(lpPtr);
+ lpPtr += nWrote;
+ nTotalWrote += nWrote;
+ blocks = blocks->m_lpNext;
+ }
+
+ return nTotalWrote;
}
\ No newline at end of file
diff --git a/applications/snowcrash/snowflake/Message.h b/applications/snowcrash/snowflake/Message.h
index 995a05ef..9fdf825a 100644
--- a/applications/snowcrash/snowflake/Message.h
+++ b/applications/snowcrash/snowflake/Message.h
@@ -1,25 +1,25 @@
-#pragma once
-
-#include ".\BlockList.h"
-
-class CMessage
-{
-public:
- CMessage(void);
- ~CMessage(void);
-
- CBlockList *m_lpBlocks;
- char *m_lpszCommand;
-
- void FreeBlocks(void);
- bool AddBlock(char *lpszBlock, int nType, CBlock *lpBlock);
- CBlockList *FindBlock(char *lpszBlock);
- CBlock *GetBlock(char *lpszBlock, int nIndex);
- int CountBlock(char *lpszBlock);
- void SetCommand(char *lpszCommand);
- void Dump(void);
- int Pack(LPBYTE lpData);
- bool GetString(char *lpszBlock, int nIndex, char *lpszVar, char &lpszStr);
- bool GetBool(char *lpszBlock, int nIndex, char *lpszVar, bool &lpbBool);
-};
-
+#pragma once
+
+#include ".\BlockList.h"
+
+class CMessage
+{
+public:
+ CMessage(void);
+ ~CMessage(void);
+
+ CBlockList *m_lpBlocks;
+ char *m_lpszCommand;
+
+ void FreeBlocks(void);
+ bool AddBlock(char *lpszBlock, int nType, CBlock *lpBlock);
+ CBlockList *FindBlock(char *lpszBlock);
+ CBlock *GetBlock(char *lpszBlock, int nIndex);
+ int CountBlock(char *lpszBlock);
+ void SetCommand(char *lpszCommand);
+ void Dump(void);
+ int Pack(LPBYTE lpData);
+ bool GetString(char *lpszBlock, int nIndex, char *lpszVar, char &lpszStr);
+ bool GetBool(char *lpszBlock, int nIndex, char *lpszVar, bool &lpbBool);
+};
+
diff --git a/applications/snowcrash/snowflake/Sequence.cpp b/applications/snowcrash/snowflake/Sequence.cpp
index 71f61aa2..299d1419 100644
--- a/applications/snowcrash/snowflake/Sequence.cpp
+++ b/applications/snowcrash/snowflake/Sequence.cpp
@@ -1,16 +1,16 @@
-#include "StdAfx.h"
-#include ".\Sequence.h"
-
-CSequence::CSequence(void)
-{
- m_wKey = 0;
- m_wValue = 0;
- m_wState = SEQ_STATE_UNACKED;
-
- m_lpPrev = NULL;
- m_lpNext = NULL;
-}
-
-CSequence::~CSequence(void)
-{
-}
+#include "StdAfx.h"
+#include ".\Sequence.h"
+
+CSequence::CSequence(void)
+{
+ m_wKey = 0;
+ m_wValue = 0;
+ m_wState = SEQ_STATE_UNACKED;
+
+ m_lpPrev = NULL;
+ m_lpNext = NULL;
+}
+
+CSequence::~CSequence(void)
+{
+}
diff --git a/applications/snowcrash/snowflake/Sequence.h b/applications/snowcrash/snowflake/Sequence.h
index 35784e7b..3cb62d7b 100644
--- a/applications/snowcrash/snowflake/Sequence.h
+++ b/applications/snowcrash/snowflake/Sequence.h
@@ -1,19 +1,19 @@
-#pragma once
-
-#define SEQ_STATE_UNACKED 0
-#define SEQ_STATE_ACKED 1
-#define SEQ_STATE_RESENT 2
-
-class CSequence
-{
-public:
- CSequence(void);
- ~CSequence(void);
-
- WORD m_wKey;
- WORD m_wValue;
- WORD m_wState;
-
- CSequence *m_lpPrev;
- CSequence *m_lpNext;
-};
+#pragma once
+
+#define SEQ_STATE_UNACKED 0
+#define SEQ_STATE_ACKED 1
+#define SEQ_STATE_RESENT 2
+
+class CSequence
+{
+public:
+ CSequence(void);
+ ~CSequence(void);
+
+ WORD m_wKey;
+ WORD m_wValue;
+ WORD m_wState;
+
+ CSequence *m_lpPrev;
+ CSequence *m_lpNext;
+};
diff --git a/applications/snowcrash/snowflake/SequenceList.cpp b/applications/snowcrash/snowflake/SequenceList.cpp
index 4703db25..ecd95552 100644
--- a/applications/snowcrash/snowflake/SequenceList.cpp
+++ b/applications/snowcrash/snowflake/SequenceList.cpp
@@ -1,161 +1,161 @@
-#include "StdAfx.h"
-#include ".\SequenceList.h"
-
-CSequenceList::CSequenceList(void)
-{
- m_lpSequences = NULL;
-}
-
-CSequenceList::~CSequenceList(void)
-{
- FreeSequences();
-}
-
-void CSequenceList::FreeSequences(void)
-{
- CSequence *sequence = m_lpSequences;
-
- while (sequence)
- {
- if (sequence->m_lpNext)
- {
- sequence = sequence->m_lpNext;
-
- if (sequence->m_lpPrev)
- SAFE_DELETE(sequence->m_lpPrev);
- }
- else
- SAFE_DELETE(sequence);
- }
-
- m_lpSequences = NULL;
-}
-
-bool CSequenceList::AddSequence(CSequence *lpSequence)
-{
- CSequence *sequence = NULL;
-
- if (m_lpSequences)
- {
- sequence = m_lpSequences;
-
- while (sequence->m_lpNext)
- sequence = sequence->m_lpNext;
-
- sequence->m_lpNext = lpSequence;
-
- if (!sequence->m_lpNext) return false;
-
- sequence->m_lpNext->m_lpNext = NULL;
- sequence->m_lpNext->m_lpPrev = sequence;
-
- return true;
- }
- else
- {
- sequence = lpSequence;
-
- if (!sequence) return false;
-
- m_lpSequences = sequence;
- m_lpSequences->m_lpNext = NULL;
- m_lpSequences->m_lpPrev = NULL;
-
- return true;
- }
-
- return false;
-}
-
-void CSequenceList::RemoveSequence(CSequence *lpSequence)
-{
- if (lpSequence->m_lpNext)
- {
- if (lpSequence->m_lpPrev)
- {
- lpSequence->m_lpPrev->m_lpNext = lpSequence->m_lpNext;
- lpSequence->m_lpNext->m_lpPrev = lpSequence->m_lpPrev;
- }
- else
- {
- lpSequence->m_lpNext->m_lpPrev = NULL;
- m_lpSequences = lpSequence->m_lpNext;
- }
- }
- else
- {
- if (lpSequence->m_lpPrev)
- {
- lpSequence->m_lpPrev->m_lpNext = NULL;
- }
- else
- {
- m_lpSequences = NULL;
- }
- }
-
- SAFE_DELETE(lpSequence);
-}
-
-CSequence *CSequenceList::FindSequenceByKey(WORD wKey)
-{
- CSequence *sequence = m_lpSequences;
-
- while (sequence)
- {
- if (sequence->m_wKey == wKey)
- return sequence;
- sequence = sequence->m_lpNext;
- }
-
- return NULL;
-}
-
-CSequence *CSequenceList::FindSequenceByValue(WORD wValue)
-{
- CSequence *sequence = m_lpSequences;
-
- while (sequence)
- {
- if (sequence->m_wValue == wValue)
- return sequence;
- sequence = sequence->m_lpNext;
- }
-
- return NULL;
-}
-
-void CSequenceList::WalkSequences(void)
-{
- CSequence *sequence = m_lpSequences;
-
- while (sequence)
- {
- dprintf("SEQ WALK: %hu ==> %hu\n", sequence->m_wKey, sequence->m_wValue);
- sequence = sequence->m_lpNext;
- }
-}
-
-BYTE CSequenceList::WriteAckedSequences(char *buf)
-{
- CSequence *sequence = m_lpSequences;
- BYTE cAcked = 0;
-
- while (sequence)
- {
- if (sequence->m_wState == SEQ_STATE_ACKED)
- {
- DWORD dwID = (DWORD)sequence->m_wKey;
- dprintf("WROTE ACKED SEQ: %lu\n", dwID);
- memcpy(&buf[cAcked * sizeof(dwID)], &dwID, sizeof(dwID));
- cAcked++;
- CSequence *remove = sequence;
- sequence = sequence->m_lpNext;
- RemoveSequence(remove);
- }
- else
- sequence = sequence->m_lpNext;
- }
-
- return cAcked;
+#include "StdAfx.h"
+#include ".\SequenceList.h"
+
+CSequenceList::CSequenceList(void)
+{
+ m_lpSequences = NULL;
+}
+
+CSequenceList::~CSequenceList(void)
+{
+ FreeSequences();
+}
+
+void CSequenceList::FreeSequences(void)
+{
+ CSequence *sequence = m_lpSequences;
+
+ while (sequence)
+ {
+ if (sequence->m_lpNext)
+ {
+ sequence = sequence->m_lpNext;
+
+ if (sequence->m_lpPrev)
+ SAFE_DELETE(sequence->m_lpPrev);
+ }
+ else
+ SAFE_DELETE(sequence);
+ }
+
+ m_lpSequences = NULL;
+}
+
+bool CSequenceList::AddSequence(CSequence *lpSequence)
+{
+ CSequence *sequence = NULL;
+
+ if (m_lpSequences)
+ {
+ sequence = m_lpSequences;
+
+ while (sequence->m_lpNext)
+ sequence = sequence->m_lpNext;
+
+ sequence->m_lpNext = lpSequence;
+
+ if (!sequence->m_lpNext) return false;
+
+ sequence->m_lpNext->m_lpNext = NULL;
+ sequence->m_lpNext->m_lpPrev = sequence;
+
+ return true;
+ }
+ else
+ {
+ sequence = lpSequence;
+
+ if (!sequence) return false;
+
+ m_lpSequences = sequence;
+ m_lpSequences->m_lpNext = NULL;
+ m_lpSequences->m_lpPrev = NULL;
+
+ return true;
+ }
+
+ return false;
+}
+
+void CSequenceList::RemoveSequence(CSequence *lpSequence)
+{
+ if (lpSequence->m_lpNext)
+ {
+ if (lpSequence->m_lpPrev)
+ {
+ lpSequence->m_lpPrev->m_lpNext = lpSequence->m_lpNext;
+ lpSequence->m_lpNext->m_lpPrev = lpSequence->m_lpPrev;
+ }
+ else
+ {
+ lpSequence->m_lpNext->m_lpPrev = NULL;
+ m_lpSequences = lpSequence->m_lpNext;
+ }
+ }
+ else
+ {
+ if (lpSequence->m_lpPrev)
+ {
+ lpSequence->m_lpPrev->m_lpNext = NULL;
+ }
+ else
+ {
+ m_lpSequences = NULL;
+ }
+ }
+
+ SAFE_DELETE(lpSequence);
+}
+
+CSequence *CSequenceList::FindSequenceByKey(WORD wKey)
+{
+ CSequence *sequence = m_lpSequences;
+
+ while (sequence)
+ {
+ if (sequence->m_wKey == wKey)
+ return sequence;
+ sequence = sequence->m_lpNext;
+ }
+
+ return NULL;
+}
+
+CSequence *CSequenceList::FindSequenceByValue(WORD wValue)
+{
+ CSequence *sequence = m_lpSequences;
+
+ while (sequence)
+ {
+ if (sequence->m_wValue == wValue)
+ return sequence;
+ sequence = sequence->m_lpNext;
+ }
+
+ return NULL;
+}
+
+void CSequenceList::WalkSequences(void)
+{
+ CSequence *sequence = m_lpSequences;
+
+ while (sequence)
+ {
+ dprintf("SEQ WALK: %hu ==> %hu\n", sequence->m_wKey, sequence->m_wValue);
+ sequence = sequence->m_lpNext;
+ }
+}
+
+BYTE CSequenceList::WriteAckedSequences(char *buf)
+{
+ CSequence *sequence = m_lpSequences;
+ BYTE cAcked = 0;
+
+ while (sequence)
+ {
+ if (sequence->m_wState == SEQ_STATE_ACKED)
+ {
+ DWORD dwID = (DWORD)sequence->m_wKey;
+ dprintf("WROTE ACKED SEQ: %lu\n", dwID);
+ memcpy(&buf[cAcked * sizeof(dwID)], &dwID, sizeof(dwID));
+ cAcked++;
+ CSequence *remove = sequence;
+ sequence = sequence->m_lpNext;
+ RemoveSequence(remove);
+ }
+ else
+ sequence = sequence->m_lpNext;
+ }
+
+ return cAcked;
}
\ No newline at end of file
diff --git a/applications/snowcrash/snowflake/SequenceList.h b/applications/snowcrash/snowflake/SequenceList.h
index e4302abe..b47d6c44 100644
--- a/applications/snowcrash/snowflake/SequenceList.h
+++ b/applications/snowcrash/snowflake/SequenceList.h
@@ -1,19 +1,19 @@
-#pragma once
-
-#include ".\Sequence.h"
-
-class CSequenceList
-{
-public:
- CSequenceList(void);
- ~CSequenceList(void);
-
- CSequence *m_lpSequences;
- void FreeSequences(void);
- bool AddSequence(CSequence *lpSequence);
- void RemoveSequence(CSequence *lpSequence);
- CSequence *FindSequenceByKey(WORD wKey);
- CSequence *FindSequenceByValue(WORD wValue);
- void WalkSequences(void);
- BYTE WriteAckedSequences(char *buf);
-};
+#pragma once
+
+#include ".\Sequence.h"
+
+class CSequenceList
+{
+public:
+ CSequenceList(void);
+ ~CSequenceList(void);
+
+ CSequence *m_lpSequences;
+ void FreeSequences(void);
+ bool AddSequence(CSequence *lpSequence);
+ void RemoveSequence(CSequence *lpSequence);
+ CSequence *FindSequenceByKey(WORD wKey);
+ CSequence *FindSequenceByValue(WORD wValue);
+ void WalkSequences(void);
+ BYTE WriteAckedSequences(char *buf);
+};
diff --git a/applications/snowcrash/snowflake/Server.cpp b/applications/snowcrash/snowflake/Server.cpp
index 5ab92469..53f769f6 100644
--- a/applications/snowcrash/snowflake/Server.cpp
+++ b/applications/snowcrash/snowflake/Server.cpp
@@ -1,54 +1,54 @@
-#include "StdAfx.h"
-#include ".\Server.h"
-
-CServer::CServer(void)
-{
- ZeroMemory(&m_address, sizeof(m_address));
- m_lpszSimName = NULL;
- m_nType = SERVER_TYPE_UNKNOWN;
- m_ulX = 0;
- m_ulY = 0;
- m_ullHandle = 0;
-
- m_wSequenceSentIndex = 1;
- m_wSequenceRecvIndex = 1;
-
- m_lpPrev = NULL;
- m_lpNext = NULL;
-}
-
-CServer::CServer(struct sockaddr_in *address)
-{
- memcpy(&m_address, address, sizeof(m_address));
- m_lpszSimName = NULL;
- m_nType = SERVER_TYPE_UNKNOWN;
- m_ulX = 0;
- m_ulY = 0;
- m_ullHandle = 0;
-
- m_wSequenceSentIndex = 1;
- m_wSequenceRecvIndex = 1;
-
- m_lpPrev = NULL;
- m_lpNext = NULL;
-}
-
-CServer::~CServer(void)
-{
- SAFE_FREE(m_lpszSimName);
-}
-
-void CServer::SetSimName(char *lpszSimName)
-{
- SAFE_FREE(m_lpszSimName);
-
- size_t stLen = strlen(lpszSimName);
-
- if (stLen > 0)
- {
- m_lpszSimName = (char *)malloc(stLen + 1);
-
- if (m_lpszSimName)
- memcpy(m_lpszSimName, lpszSimName, stLen + 1);
- }
+#include "StdAfx.h"
+#include ".\Server.h"
+
+CServer::CServer(void)
+{
+ ZeroMemory(&m_address, sizeof(m_address));
+ m_lpszSimName = NULL;
+ m_nType = SERVER_TYPE_UNKNOWN;
+ m_ulX = 0;
+ m_ulY = 0;
+ m_ullHandle = 0;
+
+ m_wSequenceSentIndex = 1;
+ m_wSequenceRecvIndex = 1;
+
+ m_lpPrev = NULL;
+ m_lpNext = NULL;
+}
+
+CServer::CServer(struct sockaddr_in *address)
+{
+ memcpy(&m_address, address, sizeof(m_address));
+ m_lpszSimName = NULL;
+ m_nType = SERVER_TYPE_UNKNOWN;
+ m_ulX = 0;
+ m_ulY = 0;
+ m_ullHandle = 0;
+
+ m_wSequenceSentIndex = 1;
+ m_wSequenceRecvIndex = 1;
+
+ m_lpPrev = NULL;
+ m_lpNext = NULL;
+}
+
+CServer::~CServer(void)
+{
+ SAFE_FREE(m_lpszSimName);
+}
+
+void CServer::SetSimName(char *lpszSimName)
+{
+ SAFE_FREE(m_lpszSimName);
+
+ size_t stLen = strlen(lpszSimName);
+
+ if (stLen > 0)
+ {
+ m_lpszSimName = (char *)malloc(stLen + 1);
+
+ if (m_lpszSimName)
+ memcpy(m_lpszSimName, lpszSimName, stLen + 1);
+ }
}
\ No newline at end of file
diff --git a/applications/snowcrash/snowflake/Server.h b/applications/snowcrash/snowflake/Server.h
index 4b491054..78ea36bc 100644
--- a/applications/snowcrash/snowflake/Server.h
+++ b/applications/snowcrash/snowflake/Server.h
@@ -1,33 +1,33 @@
-#pragma once
-
-#include ".\SequenceList.h"
-
-#define SERVER_TYPE_UNKNOWN 0
-#define SERVER_TYPE_USER 1
-#define SERVER_TYPE_DATA 2
-#define SERVER_TYPE_SIMULATOR 3
-
-class CServer
-{
-public:
- CServer(void);
- CServer(struct sockaddr_in *address);
- ~CServer(void);
- void SetSimName(char *lpszSimName);
-
- struct sockaddr_in m_address;
- char *m_lpszSimName;
- int m_nType;
- ULONG m_ulX;
- ULONG m_ulY;
- ULONG m_ullHandle;
-
- CSequenceList m_sequencesSent;
- WORD m_wSequenceSentIndex;
-
- CSequenceList m_sequencesRecv;
- WORD m_wSequenceRecvIndex;
-
- CServer *m_lpNext;
- CServer *m_lpPrev;
-};
+#pragma once
+
+#include ".\SequenceList.h"
+
+#define SERVER_TYPE_UNKNOWN 0
+#define SERVER_TYPE_USER 1
+#define SERVER_TYPE_DATA 2
+#define SERVER_TYPE_SIMULATOR 3
+
+class CServer
+{
+public:
+ CServer(void);
+ CServer(struct sockaddr_in *address);
+ ~CServer(void);
+ void SetSimName(char *lpszSimName);
+
+ struct sockaddr_in m_address;
+ char *m_lpszSimName;
+ int m_nType;
+ ULONG m_ulX;
+ ULONG m_ulY;
+ ULONG m_ullHandle;
+
+ CSequenceList m_sequencesSent;
+ WORD m_wSequenceSentIndex;
+
+ CSequenceList m_sequencesRecv;
+ WORD m_wSequenceRecvIndex;
+
+ CServer *m_lpNext;
+ CServer *m_lpPrev;
+};
diff --git a/applications/snowcrash/snowflake/ServerList.cpp b/applications/snowcrash/snowflake/ServerList.cpp
index eda21739..51fa8e16 100644
--- a/applications/snowcrash/snowflake/ServerList.cpp
+++ b/applications/snowcrash/snowflake/ServerList.cpp
@@ -1,111 +1,111 @@
-#include "StdAfx.h"
-#include ".\ServerList.h"
-
-CServerList::CServerList(void)
-{
- m_lpServers = NULL;
- m_bAddedUserServer = false;
-}
-
-CServerList::~CServerList(void)
-{
- FreeServers();
-}
-
-void CServerList::FreeServers(void)
-{
- CServer *server = m_lpServers;
-
- while (server)
- {
- if (server->m_lpNext)
- {
- server = server->m_lpNext;
-
- if (server->m_lpPrev)
- SAFE_DELETE(server->m_lpPrev);
- }
- else
- SAFE_DELETE(server);
- }
-
- m_lpServers = NULL;
-}
-
-bool CServerList::AddServer(CServer *lpServer)
-{
- CServer *server = NULL;
-
- if (m_lpServers)
- {
- server = m_lpServers;
-
- while (server->m_lpNext)
- server = server->m_lpNext;
-
- server->m_lpNext = lpServer;
-
- if (!server->m_lpNext) return false;
-
- server->m_lpNext->m_lpNext = NULL;
- server->m_lpNext->m_lpPrev = server;
-
- if (!m_bAddedUserServer)
- {
- m_bAddedUserServer = true;
- lpServer->m_nType = SERVER_TYPE_USER;
- lpServer->SetSimName("User Server");
- }
-
- return true;
- }
- else
- {
- server = lpServer;
-
- if (!server) return false;
-
- m_lpServers = server;
- m_lpServers->m_lpNext = NULL;
- m_lpServers->m_lpPrev = NULL;
-
- if (!m_bAddedUserServer)
- {
- m_bAddedUserServer = true;
- lpServer->m_nType = SERVER_TYPE_USER;
- lpServer->SetSimName("User Server");
- }
-
- return true;
- }
-
- return false;
-}
-
-CServer *CServerList::FindServer(struct sockaddr_in *address)
-{
- CServer *server = m_lpServers;
-
- while (server)
- {
- if (!memcmp(&server->m_address, address, sizeof(server->m_address)))
- return server;
- server = server->m_lpNext;
- }
-
- return NULL;
-}
-
-CServer *CServerList::FindServer(int nType)
-{
- CServer *server = m_lpServers;
-
- while (server)
- {
- if (server->m_nType == nType)
- return server;
- server = server->m_lpNext;
- }
-
- return NULL;
+#include "StdAfx.h"
+#include ".\ServerList.h"
+
+CServerList::CServerList(void)
+{
+ m_lpServers = NULL;
+ m_bAddedUserServer = false;
+}
+
+CServerList::~CServerList(void)
+{
+ FreeServers();
+}
+
+void CServerList::FreeServers(void)
+{
+ CServer *server = m_lpServers;
+
+ while (server)
+ {
+ if (server->m_lpNext)
+ {
+ server = server->m_lpNext;
+
+ if (server->m_lpPrev)
+ SAFE_DELETE(server->m_lpPrev);
+ }
+ else
+ SAFE_DELETE(server);
+ }
+
+ m_lpServers = NULL;
+}
+
+bool CServerList::AddServer(CServer *lpServer)
+{
+ CServer *server = NULL;
+
+ if (m_lpServers)
+ {
+ server = m_lpServers;
+
+ while (server->m_lpNext)
+ server = server->m_lpNext;
+
+ server->m_lpNext = lpServer;
+
+ if (!server->m_lpNext) return false;
+
+ server->m_lpNext->m_lpNext = NULL;
+ server->m_lpNext->m_lpPrev = server;
+
+ if (!m_bAddedUserServer)
+ {
+ m_bAddedUserServer = true;
+ lpServer->m_nType = SERVER_TYPE_USER;
+ lpServer->SetSimName("User Server");
+ }
+
+ return true;
+ }
+ else
+ {
+ server = lpServer;
+
+ if (!server) return false;
+
+ m_lpServers = server;
+ m_lpServers->m_lpNext = NULL;
+ m_lpServers->m_lpPrev = NULL;
+
+ if (!m_bAddedUserServer)
+ {
+ m_bAddedUserServer = true;
+ lpServer->m_nType = SERVER_TYPE_USER;
+ lpServer->SetSimName("User Server");
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
+CServer *CServerList::FindServer(struct sockaddr_in *address)
+{
+ CServer *server = m_lpServers;
+
+ while (server)
+ {
+ if (!memcmp(&server->m_address, address, sizeof(server->m_address)))
+ return server;
+ server = server->m_lpNext;
+ }
+
+ return NULL;
+}
+
+CServer *CServerList::FindServer(int nType)
+{
+ CServer *server = m_lpServers;
+
+ while (server)
+ {
+ if (server->m_nType == nType)
+ return server;
+ server = server->m_lpNext;
+ }
+
+ return NULL;
}
\ No newline at end of file
diff --git a/applications/snowcrash/snowflake/ServerList.h b/applications/snowcrash/snowflake/ServerList.h
index 318c9480..3515e7e5 100644
--- a/applications/snowcrash/snowflake/ServerList.h
+++ b/applications/snowcrash/snowflake/ServerList.h
@@ -1,17 +1,17 @@
-#pragma once
-
-#include ".\Server.h"
-
-class CServerList
-{
-public:
- CServerList(void);
- ~CServerList(void);
-
- CServer *m_lpServers;
- void FreeServers(void);
- bool AddServer(CServer *lpServer);
- CServer *FindServer(struct sockaddr_in *address);
- CServer *FindServer(int nType);
- bool m_bAddedUserServer;
-};
+#pragma once
+
+#include ".\Server.h"
+
+class CServerList
+{
+public:
+ CServerList(void);
+ ~CServerList(void);
+
+ CServer *m_lpServers;
+ void FreeServers(void);
+ bool AddServer(CServer *lpServer);
+ CServer *FindServer(struct sockaddr_in *address);
+ CServer *FindServer(int nType);
+ bool m_bAddedUserServer;
+};
diff --git a/applications/snowcrash/snowflake/Var.cpp b/applications/snowcrash/snowflake/Var.cpp
index 93c8feda..e7ed971d 100644
--- a/applications/snowcrash/snowflake/Var.cpp
+++ b/applications/snowcrash/snowflake/Var.cpp
@@ -1,924 +1,924 @@
-#include "StdAfx.h"
-#include ".\Var.h"
-#include ".\keywords.h"
-
-CVar::CVar(void)
-{
- m_lpszVar = NULL;
- m_nType = 0;
- m_nTypeLen = 0;
- m_nLen = 0;
- m_lpData = NULL;
-
- m_lpPrev = NULL;
- m_lpNext = NULL;
-}
-
-CVar::~CVar(void)
-{
- SAFE_FREE(m_lpszVar);
- SAFE_FREE(m_lpData);
-}
-
-void CVar::SetVar(char *lpszVar)
-{
- if (lpszVar)
- {
- int nLen = (int)strlen(lpszVar);
-
- if (nLen > 0)
- {
- SAFE_FREE(m_lpszVar);
- m_lpszVar = (char *)malloc(nLen + 1);
-
- if (m_lpszVar)
- {
- strncpy(m_lpszVar, lpszVar, nLen);
- m_lpszVar[nLen] = '\0';
- }
- }
- }
-}
-
-void CVar::SetType(int nType, int nTypeLen)
-{
- m_nType = nType;
- m_nTypeLen = nTypeLen;
-}
-
-void CVar::GetString(char &lpszStr)
-{
- switch (m_nType)
- {
- case LLTYPE_U8:
- {
- unsigned char ubData;
- memcpy(&ubData, m_lpData, sizeof(ubData));
- sprintf(&lpszStr, "%hu", ubData);
- }
- break;
-
- case LLTYPE_U16:
- {
- WORD wData;
- memcpy(&wData, m_lpData, sizeof(wData));
- sprintf(&lpszStr, "%u", wData);
- }
- break;
-
- case LLTYPE_U32:
- {
- DWORD dwData;
- memcpy(&dwData, m_lpData, sizeof(dwData));
- sprintf(&lpszStr, "%lu", dwData);
- }
- break;
-
- case LLTYPE_U64:
- {
- ULONGLONG ullData;
- memcpy(&ullData, m_lpData, sizeof(ullData));
- sprintf(&lpszStr, "%I64u", ullData);
- }
- break;
-
- case LLTYPE_S8:
- {
- BYTE bData;
- memcpy(&bData, m_lpData, sizeof(bData));
- sprintf(&lpszStr, "%hd", bData);
- }
- break;
-
- case LLTYPE_S16:
- {
- SHORT sData;
- memcpy(&sData, m_lpData, sizeof(sData));
- sprintf(&lpszStr, "%d", sData);
- }
- break;
-
- case LLTYPE_S32:
- {
- LONG nData;
- memcpy(&nData, m_lpData, sizeof(nData));
- sprintf(&lpszStr, "%ld", nData);
- }
- break;
-
- case LLTYPE_S64:
- break;
-
- case LLTYPE_F8:
- break;
-
- case LLTYPE_F16:
- break;
-
- case LLTYPE_F32:
- {
- FLOAT fData;
- memcpy(&fData, m_lpData, sizeof(fData));
- sprintf(&lpszStr, "%f", fData);
- }
- break;
-
- case LLTYPE_F64:
- {
- double dData;
- memcpy(&dData, m_lpData, sizeof(dData));
- sprintf(&lpszStr, "%f", dData);
- }
- break;
-
- case LLTYPE_LLUUID:
- {
- char szHex[8];
- sprintf(&lpszStr, "");
-
- for (int u = 0; u < m_nLen; u++)
- {
- sprintf(szHex, "%02x", m_lpData[u]);
- strcat(&lpszStr, szHex);
-
- if (u == 3 || u == 5 || u == 7 || u == 9)
- strcat(&lpszStr, "-");
- }
- }
- break;
-
- case LLTYPE_BOOL:
- {
- BYTE bData;
- memcpy(&bData, m_lpData, sizeof(bData));
- sprintf(&lpszStr, "%s", (bData) ? "True" : "False");
- }
- break;
-
- case LLTYPE_LLVECTOR3:
- {
- FLOAT fData[3];
- memcpy(&fData, m_lpData, sizeof(fData));
- sprintf(&lpszStr, "%f, %f, %f", fData[0], fData[1], fData[2]);
- }
- break;
-
- case LLTYPE_LLVECTOR3D:
- {
- double dData[3];
- memcpy(&dData, m_lpData, sizeof(dData));
- sprintf(&lpszStr, "%f, %f, %f", dData[0], dData[1], dData[2]);
- }
- break;
-
- case LLTYPE_QUATERNION:
- {
- FLOAT fData[4];
- memcpy(&fData, m_lpData, sizeof(fData));
- sprintf(&lpszStr, "%f, %f, %f, %f", fData[0], fData[1], fData[2], fData[3]);
- }
- break;
-
- case LLTYPE_IPADDR:
- {
- BYTE ipData[4];
- memcpy(&ipData, m_lpData, sizeof(ipData));
- sprintf(&lpszStr, "%hu.%hu.%hu.%hu", ipData[0], ipData[1], ipData[2], ipData[3]);
- }
- break;
-
- case LLTYPE_IPPORT:
- {
- WORD wData;
- memcpy(&wData, m_lpData, sizeof(wData));
- sprintf(&lpszStr, "%hu", htons(wData));
- }
- break;
-
- case LLTYPE_FIXED:
- case LLTYPE_VARIABLE:
- {
- sprintf(&lpszStr, "");
-
- if (m_lpData)
- {
- bool bPrintable = true;
-
- for (int j = 0; j < m_nLen - 1; j++)
- {
- if (((unsigned char)m_lpData[j] < 0x20 || (unsigned char)m_lpData[j] > 0x7E) && (unsigned char)m_lpData[j] != 0x09 && (unsigned char)m_lpData[j] != 0x0D)
- bPrintable = false;
- }
-
- if (bPrintable && m_lpData[m_nLen - 1] == '\0')
- {
- sprintf(&lpszStr, "%s", m_lpData);
- }
- else
- {
- for (int j = 0; j < m_nLen; j++)
- {
- char szHex[8];
- sprintf(szHex, "%02x", (unsigned char)m_lpData[j]);
- strcat(&lpszStr, szHex);
- }
- }
- }
- }
- break;
-
- case LLTYPE_SINGLE:
- case LLTYPE_MULTIPLE:
- case LLTYPE_NULL:
- default:
- {
- sprintf(&lpszStr, "");
- }
- break;
- }
-}
-
-void CVar::GetBool(bool &lpbBool)
-{
- switch (m_nType)
- {
- case LLTYPE_BOOL:
- {
- BYTE bData;
- memcpy(&bData, m_lpData, sizeof(bData));
- lpbBool = (bData) ? true : false;
- }
- break;
-
- case LLTYPE_U8:
- case LLTYPE_U16:
- case LLTYPE_U32:
- case LLTYPE_U64:
- case LLTYPE_S8:
- case LLTYPE_S16:
- case LLTYPE_S32:
- case LLTYPE_S64:
- case LLTYPE_F8:
- case LLTYPE_F16:
- case LLTYPE_F32:
- case LLTYPE_F64:
- case LLTYPE_LLUUID:
- case LLTYPE_LLVECTOR3:
- case LLTYPE_LLVECTOR3D:
- case LLTYPE_QUATERNION:
- case LLTYPE_IPADDR:
- case LLTYPE_IPPORT:
- case LLTYPE_FIXED:
- case LLTYPE_VARIABLE:
- case LLTYPE_SINGLE:
- case LLTYPE_MULTIPLE:
- case LLTYPE_NULL:
- default:
- {
- lpbBool = false;
- }
- break;
- }
-}
-
-int CVar::SetData(LPBYTE lpData)
-{
- SAFE_FREE(m_lpData);
- m_nLen = 0;
-
- int nRead = 0;
-
- switch (m_nType)
- {
- case LLTYPE_U8:
- {
- m_nLen = sizeof(unsigned char);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_U16:
- {
- m_nLen = sizeof(WORD);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_U32:
- {
- m_nLen = sizeof(DWORD);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_U64:
- {
- m_nLen = sizeof(ULONGLONG);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_S8:
- {
- m_nLen = sizeof(BYTE);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_S16:
- {
- m_nLen = sizeof(SHORT);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_S32:
- {
- m_nLen = sizeof(LONG);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_S64:
- break;
-
- case LLTYPE_F8:
- break;
-
- case LLTYPE_F16:
- break;
-
- case LLTYPE_F32:
- {
- m_nLen = sizeof(FLOAT);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_F64:
- {
- m_nLen = sizeof(double);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_LLUUID:
- {
- m_nLen = sizeof(BYTE) * 16;
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_BOOL:
- {
- m_nLen = sizeof(BYTE);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_LLVECTOR3:
- {
- m_nLen = sizeof(FLOAT) * 3;
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_LLVECTOR3D:
- {
- m_nLen = sizeof(double) * 3;
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_QUATERNION:
- {
- m_nLen = sizeof(FLOAT) * 4;
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_IPADDR:
- {
- m_nLen = sizeof(BYTE) * 4;
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_IPPORT:
- {
- m_nLen = sizeof(WORD);
-
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_VARIABLE:
- {
- if (m_nTypeLen == 1)
- {
- BYTE cDataLen;
-
- memcpy(&cDataLen, lpData, sizeof(cDataLen));
- nRead += sizeof(cDataLen);
- lpData += sizeof(cDataLen);
-
- m_nLen = cDataLen;
-
- if (m_nLen > 0)
- {
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- else
- m_nLen = 0;
- }
- else if (m_nTypeLen == 2)
- {
- WORD cDataLen;
-
- memcpy(&cDataLen, lpData, sizeof(cDataLen));
- nRead += sizeof(cDataLen);
- lpData += sizeof(cDataLen);
-
- m_nLen = cDataLen;
-
- if (m_nLen > 0)
- {
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- else
- m_nLen = 0;
- }
- }
- break;
-
- case LLTYPE_FIXED:
- {
- m_nLen = m_nTypeLen;
-
- if (m_nLen > 0)
- {
- m_lpData = (LPBYTE)malloc(m_nLen);
-
- if (m_lpData)
- {
- memcpy(m_lpData, lpData, m_nLen);
- nRead += m_nLen;
- }
- else
- m_nLen = 0;
- }
- else
- m_nLen = 0;
- }
- break;
-
- case LLTYPE_SINGLE:
- case LLTYPE_MULTIPLE:
- case LLTYPE_NULL:
- default:
- {
- m_nLen = 0;
- }
- break;
- }
-
- return nRead;
-}
-
-void CVar::Dump(void)
-{
- switch (m_nType)
- {
- case LLTYPE_U8:
- {
- unsigned char ubData;
- memcpy(&ubData, m_lpData, sizeof(ubData));
- dprintf("%s: %hu\n", m_lpszVar, ubData);
- }
- break;
-
- case LLTYPE_U16:
- {
- WORD wData;
- memcpy(&wData, m_lpData, sizeof(wData));
- dprintf("%s: %u\n", m_lpszVar, wData);
- }
- break;
-
- case LLTYPE_U32:
- {
- DWORD dwData;
- memcpy(&dwData, m_lpData, sizeof(dwData));
- dprintf("%s: %lu\n", m_lpszVar, dwData);
- }
- break;
-
- case LLTYPE_U64:
- {
- ULONGLONG ullData;
- memcpy(&ullData, m_lpData, sizeof(ullData));
- dprintf("%s: %I64u\n", m_lpszVar, ullData);
- }
- break;
-
- case LLTYPE_S8:
- {
- BYTE bData;
- memcpy(&bData, m_lpData, sizeof(bData));
- dprintf("%s: %hd\n", m_lpszVar, bData);
- }
- break;
-
- case LLTYPE_S16:
- {
- SHORT sData;
- memcpy(&sData, m_lpData, sizeof(sData));
- dprintf("%s: %d\n", m_lpszVar, sData);
- }
- break;
-
- case LLTYPE_S32:
- {
- LONG nData;
- memcpy(&nData, m_lpData, sizeof(nData));
- dprintf("%s: %ld\n", m_lpszVar, nData);
- }
- break;
-
- case LLTYPE_S64:
- break;
-
- case LLTYPE_F8:
- break;
-
- case LLTYPE_F16:
- break;
-
- case LLTYPE_F32:
- {
- FLOAT fData;
- memcpy(&fData, m_lpData, sizeof(fData));
- dprintf("%s: %f\n", m_lpszVar, fData);
- }
- break;
-
- case LLTYPE_F64:
- {
- double dData;
- memcpy(&dData, m_lpData, sizeof(dData));
- dprintf("%s: %f\n", m_lpszVar, dData);
- }
- break;
-
- case LLTYPE_LLUUID:
- {
- dprintf("%s: ", m_lpszVar);
- for (int u = 0; u < m_nLen; u++)
- dprintf("%02x", m_lpData[u]);
- dprintf("\n");
- }
- break;
-
- case LLTYPE_BOOL:
- {
- BYTE bData;
- memcpy(&bData, m_lpData, sizeof(bData));
- dprintf("%s: %s\n", m_lpszVar, (bData) ? "True" : "False");
- }
- break;
-
- case LLTYPE_LLVECTOR3:
- {
- FLOAT fData[3];
- memcpy(&fData, m_lpData, sizeof(fData));
- dprintf("%s: %f, %f, %f\n", m_lpszVar, fData[0], fData[1], fData[2]);
- }
- break;
-
- case LLTYPE_LLVECTOR3D:
- {
- double dData[3];
- memcpy(&dData, m_lpData, sizeof(dData));
- dprintf("%s: %f, %f, %f\n", m_lpszVar, dData[0], dData[1], dData[2]);
- }
- break;
-
- case LLTYPE_QUATERNION:
- {
- FLOAT fData[4];
- memcpy(&fData, m_lpData, sizeof(fData));
- dprintf("%s: %f, %f, %f, %f\n", m_lpszVar, fData[0], fData[1], fData[2], fData[3]);
- }
- break;
-
- case LLTYPE_IPADDR:
- {
- BYTE ipData[4];
- memcpy(&ipData, m_lpData, sizeof(ipData));
- dprintf("%s: %hu.%hu.%hu.%hu\n", m_lpszVar, ipData[0], ipData[1], ipData[2], ipData[3]);
- }
- break;
-
- case LLTYPE_IPPORT:
- {
- WORD wData;
- memcpy(&wData, m_lpData, sizeof(wData));
- dprintf("%s: %hu\n", m_lpszVar, htons(wData));
- }
- break;
-
- case LLTYPE_VARIABLE:
- case LLTYPE_FIXED:
- {
- if (m_lpData)
- {
- bool bPrintable = true;
-
- for (int j = 0; j < m_nLen - 1; j++)
- {
- if (((unsigned char)m_lpData[j] < 0x20 || (unsigned char)m_lpData[j] > 0x7E) && (unsigned char)m_lpData[j] != 0x09 && (unsigned char)m_lpData[j] != 0x0D)
- bPrintable = false;
- }
-
- if (bPrintable && m_lpData[m_nLen - 1] == '\0')
- {
- dprintf("%s: %s\n", m_lpszVar, m_lpData);
- }
- else
- {
- for (int j = 0; j < m_nLen; j += 16)
- {
- dprintf("%s: ", m_lpszVar);
-
- for (int k = 0; k < 16; k++)
- {
- if ((j + k) < m_nLen)
- {
- dprintf("%02x ", (unsigned char)m_lpData[j+k]);
- }
- else
- {
- dprintf(" ");
- }
- }
-
- for (int k = 0; k < 16 && (j + k) < m_nLen; k++)
- {
- dprintf("%c", ((unsigned char)m_lpData[j+k] >= 0x20 && (unsigned char)m_lpData[j+k] <= 0x7E) ? (unsigned char)m_lpData[j+k] : '.');
- }
-
- dprintf("\n");
- }
- }
- }
- }
- break;
-
- case LLTYPE_SINGLE:
- case LLTYPE_MULTIPLE:
- case LLTYPE_NULL:
- default:
- {
- dprintf("%s (%s / %d / %d)\n", m_lpszVar, LLTYPES[m_nType], m_nLen, m_nTypeLen);
- }
- break;
- }
-}
-
-int CVar::Pack(LPBYTE lpData)
-{
- LPBYTE lpPtr = lpData;
- int nTotalWrote = 0;
-
- switch (m_nType)
- {
- case LLTYPE_U8:
- case LLTYPE_U16:
- case LLTYPE_U32:
- case LLTYPE_U64:
- case LLTYPE_S8:
- case LLTYPE_S16:
- case LLTYPE_S32:
- case LLTYPE_S64:
- case LLTYPE_F8:
- case LLTYPE_F16:
- case LLTYPE_F32:
- case LLTYPE_F64:
- case LLTYPE_LLUUID:
- case LLTYPE_BOOL:
- case LLTYPE_LLVECTOR3:
- case LLTYPE_LLVECTOR3D:
- case LLTYPE_QUATERNION:
- case LLTYPE_IPADDR:
- case LLTYPE_IPPORT:
- case LLTYPE_FIXED:
- {
- memcpy(lpPtr, m_lpData, m_nLen);
- nTotalWrote = m_nLen;
- }
- break;
-
- case LLTYPE_VARIABLE:
- {
- if (m_nTypeLen == 1)
- {
- BYTE cDataLen;
-
- cDataLen = m_nLen;
-
- memcpy(lpPtr, &cDataLen, sizeof(cDataLen));
- nTotalWrote = sizeof(cDataLen);
-
- lpPtr += sizeof(cDataLen);
-
- memcpy(lpPtr, m_lpData, m_nLen);
- nTotalWrote += m_nLen;
- }
- else if (m_nTypeLen == 2)
- {
- WORD cDataLen;
-
- cDataLen = m_nLen;
-
- memcpy(lpPtr, &cDataLen, sizeof(cDataLen));
- nTotalWrote = sizeof(cDataLen);
-
- lpPtr += sizeof(cDataLen);
-
- memcpy(lpPtr, m_lpData, m_nLen);
- nTotalWrote += m_nLen;
- }
- }
- break;
-
- case LLTYPE_SINGLE:
- case LLTYPE_MULTIPLE:
- case LLTYPE_NULL:
- default:
- {
- nTotalWrote = 0;
- }
- break;
- }
-
- return nTotalWrote;
+#include "StdAfx.h"
+#include ".\Var.h"
+#include ".\keywords.h"
+
+CVar::CVar(void)
+{
+ m_lpszVar = NULL;
+ m_nType = 0;
+ m_nTypeLen = 0;
+ m_nLen = 0;
+ m_lpData = NULL;
+
+ m_lpPrev = NULL;
+ m_lpNext = NULL;
+}
+
+CVar::~CVar(void)
+{
+ SAFE_FREE(m_lpszVar);
+ SAFE_FREE(m_lpData);
+}
+
+void CVar::SetVar(char *lpszVar)
+{
+ if (lpszVar)
+ {
+ int nLen = (int)strlen(lpszVar);
+
+ if (nLen > 0)
+ {
+ SAFE_FREE(m_lpszVar);
+ m_lpszVar = (char *)malloc(nLen + 1);
+
+ if (m_lpszVar)
+ {
+ strncpy(m_lpszVar, lpszVar, nLen);
+ m_lpszVar[nLen] = '\0';
+ }
+ }
+ }
+}
+
+void CVar::SetType(int nType, int nTypeLen)
+{
+ m_nType = nType;
+ m_nTypeLen = nTypeLen;
+}
+
+void CVar::GetString(char &lpszStr)
+{
+ switch (m_nType)
+ {
+ case LLTYPE_U8:
+ {
+ unsigned char ubData;
+ memcpy(&ubData, m_lpData, sizeof(ubData));
+ sprintf(&lpszStr, "%hu", ubData);
+ }
+ break;
+
+ case LLTYPE_U16:
+ {
+ WORD wData;
+ memcpy(&wData, m_lpData, sizeof(wData));
+ sprintf(&lpszStr, "%u", wData);
+ }
+ break;
+
+ case LLTYPE_U32:
+ {
+ DWORD dwData;
+ memcpy(&dwData, m_lpData, sizeof(dwData));
+ sprintf(&lpszStr, "%lu", dwData);
+ }
+ break;
+
+ case LLTYPE_U64:
+ {
+ ULONGLONG ullData;
+ memcpy(&ullData, m_lpData, sizeof(ullData));
+ sprintf(&lpszStr, "%I64u", ullData);
+ }
+ break;
+
+ case LLTYPE_S8:
+ {
+ BYTE bData;
+ memcpy(&bData, m_lpData, sizeof(bData));
+ sprintf(&lpszStr, "%hd", bData);
+ }
+ break;
+
+ case LLTYPE_S16:
+ {
+ SHORT sData;
+ memcpy(&sData, m_lpData, sizeof(sData));
+ sprintf(&lpszStr, "%d", sData);
+ }
+ break;
+
+ case LLTYPE_S32:
+ {
+ LONG nData;
+ memcpy(&nData, m_lpData, sizeof(nData));
+ sprintf(&lpszStr, "%ld", nData);
+ }
+ break;
+
+ case LLTYPE_S64:
+ break;
+
+ case LLTYPE_F8:
+ break;
+
+ case LLTYPE_F16:
+ break;
+
+ case LLTYPE_F32:
+ {
+ FLOAT fData;
+ memcpy(&fData, m_lpData, sizeof(fData));
+ sprintf(&lpszStr, "%f", fData);
+ }
+ break;
+
+ case LLTYPE_F64:
+ {
+ double dData;
+ memcpy(&dData, m_lpData, sizeof(dData));
+ sprintf(&lpszStr, "%f", dData);
+ }
+ break;
+
+ case LLTYPE_LLUUID:
+ {
+ char szHex[8];
+ sprintf(&lpszStr, "");
+
+ for (int u = 0; u < m_nLen; u++)
+ {
+ sprintf(szHex, "%02x", m_lpData[u]);
+ strcat(&lpszStr, szHex);
+
+ if (u == 3 || u == 5 || u == 7 || u == 9)
+ strcat(&lpszStr, "-");
+ }
+ }
+ break;
+
+ case LLTYPE_BOOL:
+ {
+ BYTE bData;
+ memcpy(&bData, m_lpData, sizeof(bData));
+ sprintf(&lpszStr, "%s", (bData) ? "True" : "False");
+ }
+ break;
+
+ case LLTYPE_LLVECTOR3:
+ {
+ FLOAT fData[3];
+ memcpy(&fData, m_lpData, sizeof(fData));
+ sprintf(&lpszStr, "%f, %f, %f", fData[0], fData[1], fData[2]);
+ }
+ break;
+
+ case LLTYPE_LLVECTOR3D:
+ {
+ double dData[3];
+ memcpy(&dData, m_lpData, sizeof(dData));
+ sprintf(&lpszStr, "%f, %f, %f", dData[0], dData[1], dData[2]);
+ }
+ break;
+
+ case LLTYPE_QUATERNION:
+ {
+ FLOAT fData[4];
+ memcpy(&fData, m_lpData, sizeof(fData));
+ sprintf(&lpszStr, "%f, %f, %f, %f", fData[0], fData[1], fData[2], fData[3]);
+ }
+ break;
+
+ case LLTYPE_IPADDR:
+ {
+ BYTE ipData[4];
+ memcpy(&ipData, m_lpData, sizeof(ipData));
+ sprintf(&lpszStr, "%hu.%hu.%hu.%hu", ipData[0], ipData[1], ipData[2], ipData[3]);
+ }
+ break;
+
+ case LLTYPE_IPPORT:
+ {
+ WORD wData;
+ memcpy(&wData, m_lpData, sizeof(wData));
+ sprintf(&lpszStr, "%hu", htons(wData));
+ }
+ break;
+
+ case LLTYPE_FIXED:
+ case LLTYPE_VARIABLE:
+ {
+ sprintf(&lpszStr, "");
+
+ if (m_lpData)
+ {
+ bool bPrintable = true;
+
+ for (int j = 0; j < m_nLen - 1; j++)
+ {
+ if (((unsigned char)m_lpData[j] < 0x20 || (unsigned char)m_lpData[j] > 0x7E) && (unsigned char)m_lpData[j] != 0x09 && (unsigned char)m_lpData[j] != 0x0D)
+ bPrintable = false;
+ }
+
+ if (bPrintable && m_lpData[m_nLen - 1] == '\0')
+ {
+ sprintf(&lpszStr, "%s", m_lpData);
+ }
+ else
+ {
+ for (int j = 0; j < m_nLen; j++)
+ {
+ char szHex[8];
+ sprintf(szHex, "%02x", (unsigned char)m_lpData[j]);
+ strcat(&lpszStr, szHex);
+ }
+ }
+ }
+ }
+ break;
+
+ case LLTYPE_SINGLE:
+ case LLTYPE_MULTIPLE:
+ case LLTYPE_NULL:
+ default:
+ {
+ sprintf(&lpszStr, "");
+ }
+ break;
+ }
+}
+
+void CVar::GetBool(bool &lpbBool)
+{
+ switch (m_nType)
+ {
+ case LLTYPE_BOOL:
+ {
+ BYTE bData;
+ memcpy(&bData, m_lpData, sizeof(bData));
+ lpbBool = (bData) ? true : false;
+ }
+ break;
+
+ case LLTYPE_U8:
+ case LLTYPE_U16:
+ case LLTYPE_U32:
+ case LLTYPE_U64:
+ case LLTYPE_S8:
+ case LLTYPE_S16:
+ case LLTYPE_S32:
+ case LLTYPE_S64:
+ case LLTYPE_F8:
+ case LLTYPE_F16:
+ case LLTYPE_F32:
+ case LLTYPE_F64:
+ case LLTYPE_LLUUID:
+ case LLTYPE_LLVECTOR3:
+ case LLTYPE_LLVECTOR3D:
+ case LLTYPE_QUATERNION:
+ case LLTYPE_IPADDR:
+ case LLTYPE_IPPORT:
+ case LLTYPE_FIXED:
+ case LLTYPE_VARIABLE:
+ case LLTYPE_SINGLE:
+ case LLTYPE_MULTIPLE:
+ case LLTYPE_NULL:
+ default:
+ {
+ lpbBool = false;
+ }
+ break;
+ }
+}
+
+int CVar::SetData(LPBYTE lpData)
+{
+ SAFE_FREE(m_lpData);
+ m_nLen = 0;
+
+ int nRead = 0;
+
+ switch (m_nType)
+ {
+ case LLTYPE_U8:
+ {
+ m_nLen = sizeof(unsigned char);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_U16:
+ {
+ m_nLen = sizeof(WORD);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_U32:
+ {
+ m_nLen = sizeof(DWORD);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_U64:
+ {
+ m_nLen = sizeof(ULONGLONG);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_S8:
+ {
+ m_nLen = sizeof(BYTE);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_S16:
+ {
+ m_nLen = sizeof(SHORT);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_S32:
+ {
+ m_nLen = sizeof(LONG);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_S64:
+ break;
+
+ case LLTYPE_F8:
+ break;
+
+ case LLTYPE_F16:
+ break;
+
+ case LLTYPE_F32:
+ {
+ m_nLen = sizeof(FLOAT);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_F64:
+ {
+ m_nLen = sizeof(double);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_LLUUID:
+ {
+ m_nLen = sizeof(BYTE) * 16;
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_BOOL:
+ {
+ m_nLen = sizeof(BYTE);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_LLVECTOR3:
+ {
+ m_nLen = sizeof(FLOAT) * 3;
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_LLVECTOR3D:
+ {
+ m_nLen = sizeof(double) * 3;
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_QUATERNION:
+ {
+ m_nLen = sizeof(FLOAT) * 4;
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_IPADDR:
+ {
+ m_nLen = sizeof(BYTE) * 4;
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_IPPORT:
+ {
+ m_nLen = sizeof(WORD);
+
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_VARIABLE:
+ {
+ if (m_nTypeLen == 1)
+ {
+ BYTE cDataLen;
+
+ memcpy(&cDataLen, lpData, sizeof(cDataLen));
+ nRead += sizeof(cDataLen);
+ lpData += sizeof(cDataLen);
+
+ m_nLen = cDataLen;
+
+ if (m_nLen > 0)
+ {
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ else
+ m_nLen = 0;
+ }
+ else if (m_nTypeLen == 2)
+ {
+ WORD cDataLen;
+
+ memcpy(&cDataLen, lpData, sizeof(cDataLen));
+ nRead += sizeof(cDataLen);
+ lpData += sizeof(cDataLen);
+
+ m_nLen = cDataLen;
+
+ if (m_nLen > 0)
+ {
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ else
+ m_nLen = 0;
+ }
+ }
+ break;
+
+ case LLTYPE_FIXED:
+ {
+ m_nLen = m_nTypeLen;
+
+ if (m_nLen > 0)
+ {
+ m_lpData = (LPBYTE)malloc(m_nLen);
+
+ if (m_lpData)
+ {
+ memcpy(m_lpData, lpData, m_nLen);
+ nRead += m_nLen;
+ }
+ else
+ m_nLen = 0;
+ }
+ else
+ m_nLen = 0;
+ }
+ break;
+
+ case LLTYPE_SINGLE:
+ case LLTYPE_MULTIPLE:
+ case LLTYPE_NULL:
+ default:
+ {
+ m_nLen = 0;
+ }
+ break;
+ }
+
+ return nRead;
+}
+
+void CVar::Dump(void)
+{
+ switch (m_nType)
+ {
+ case LLTYPE_U8:
+ {
+ unsigned char ubData;
+ memcpy(&ubData, m_lpData, sizeof(ubData));
+ dprintf("%s: %hu\n", m_lpszVar, ubData);
+ }
+ break;
+
+ case LLTYPE_U16:
+ {
+ WORD wData;
+ memcpy(&wData, m_lpData, sizeof(wData));
+ dprintf("%s: %u\n", m_lpszVar, wData);
+ }
+ break;
+
+ case LLTYPE_U32:
+ {
+ DWORD dwData;
+ memcpy(&dwData, m_lpData, sizeof(dwData));
+ dprintf("%s: %lu\n", m_lpszVar, dwData);
+ }
+ break;
+
+ case LLTYPE_U64:
+ {
+ ULONGLONG ullData;
+ memcpy(&ullData, m_lpData, sizeof(ullData));
+ dprintf("%s: %I64u\n", m_lpszVar, ullData);
+ }
+ break;
+
+ case LLTYPE_S8:
+ {
+ BYTE bData;
+ memcpy(&bData, m_lpData, sizeof(bData));
+ dprintf("%s: %hd\n", m_lpszVar, bData);
+ }
+ break;
+
+ case LLTYPE_S16:
+ {
+ SHORT sData;
+ memcpy(&sData, m_lpData, sizeof(sData));
+ dprintf("%s: %d\n", m_lpszVar, sData);
+ }
+ break;
+
+ case LLTYPE_S32:
+ {
+ LONG nData;
+ memcpy(&nData, m_lpData, sizeof(nData));
+ dprintf("%s: %ld\n", m_lpszVar, nData);
+ }
+ break;
+
+ case LLTYPE_S64:
+ break;
+
+ case LLTYPE_F8:
+ break;
+
+ case LLTYPE_F16:
+ break;
+
+ case LLTYPE_F32:
+ {
+ FLOAT fData;
+ memcpy(&fData, m_lpData, sizeof(fData));
+ dprintf("%s: %f\n", m_lpszVar, fData);
+ }
+ break;
+
+ case LLTYPE_F64:
+ {
+ double dData;
+ memcpy(&dData, m_lpData, sizeof(dData));
+ dprintf("%s: %f\n", m_lpszVar, dData);
+ }
+ break;
+
+ case LLTYPE_LLUUID:
+ {
+ dprintf("%s: ", m_lpszVar);
+ for (int u = 0; u < m_nLen; u++)
+ dprintf("%02x", m_lpData[u]);
+ dprintf("\n");
+ }
+ break;
+
+ case LLTYPE_BOOL:
+ {
+ BYTE bData;
+ memcpy(&bData, m_lpData, sizeof(bData));
+ dprintf("%s: %s\n", m_lpszVar, (bData) ? "True" : "False");
+ }
+ break;
+
+ case LLTYPE_LLVECTOR3:
+ {
+ FLOAT fData[3];
+ memcpy(&fData, m_lpData, sizeof(fData));
+ dprintf("%s: %f, %f, %f\n", m_lpszVar, fData[0], fData[1], fData[2]);
+ }
+ break;
+
+ case LLTYPE_LLVECTOR3D:
+ {
+ double dData[3];
+ memcpy(&dData, m_lpData, sizeof(dData));
+ dprintf("%s: %f, %f, %f\n", m_lpszVar, dData[0], dData[1], dData[2]);
+ }
+ break;
+
+ case LLTYPE_QUATERNION:
+ {
+ FLOAT fData[4];
+ memcpy(&fData, m_lpData, sizeof(fData));
+ dprintf("%s: %f, %f, %f, %f\n", m_lpszVar, fData[0], fData[1], fData[2], fData[3]);
+ }
+ break;
+
+ case LLTYPE_IPADDR:
+ {
+ BYTE ipData[4];
+ memcpy(&ipData, m_lpData, sizeof(ipData));
+ dprintf("%s: %hu.%hu.%hu.%hu\n", m_lpszVar, ipData[0], ipData[1], ipData[2], ipData[3]);
+ }
+ break;
+
+ case LLTYPE_IPPORT:
+ {
+ WORD wData;
+ memcpy(&wData, m_lpData, sizeof(wData));
+ dprintf("%s: %hu\n", m_lpszVar, htons(wData));
+ }
+ break;
+
+ case LLTYPE_VARIABLE:
+ case LLTYPE_FIXED:
+ {
+ if (m_lpData)
+ {
+ bool bPrintable = true;
+
+ for (int j = 0; j < m_nLen - 1; j++)
+ {
+ if (((unsigned char)m_lpData[j] < 0x20 || (unsigned char)m_lpData[j] > 0x7E) && (unsigned char)m_lpData[j] != 0x09 && (unsigned char)m_lpData[j] != 0x0D)
+ bPrintable = false;
+ }
+
+ if (bPrintable && m_lpData[m_nLen - 1] == '\0')
+ {
+ dprintf("%s: %s\n", m_lpszVar, m_lpData);
+ }
+ else
+ {
+ for (int j = 0; j < m_nLen; j += 16)
+ {
+ dprintf("%s: ", m_lpszVar);
+
+ for (int k = 0; k < 16; k++)
+ {
+ if ((j + k) < m_nLen)
+ {
+ dprintf("%02x ", (unsigned char)m_lpData[j+k]);
+ }
+ else
+ {
+ dprintf(" ");
+ }
+ }
+
+ for (int k = 0; k < 16 && (j + k) < m_nLen; k++)
+ {
+ dprintf("%c", ((unsigned char)m_lpData[j+k] >= 0x20 && (unsigned char)m_lpData[j+k] <= 0x7E) ? (unsigned char)m_lpData[j+k] : '.');
+ }
+
+ dprintf("\n");
+ }
+ }
+ }
+ }
+ break;
+
+ case LLTYPE_SINGLE:
+ case LLTYPE_MULTIPLE:
+ case LLTYPE_NULL:
+ default:
+ {
+ dprintf("%s (%s / %d / %d)\n", m_lpszVar, LLTYPES[m_nType], m_nLen, m_nTypeLen);
+ }
+ break;
+ }
+}
+
+int CVar::Pack(LPBYTE lpData)
+{
+ LPBYTE lpPtr = lpData;
+ int nTotalWrote = 0;
+
+ switch (m_nType)
+ {
+ case LLTYPE_U8:
+ case LLTYPE_U16:
+ case LLTYPE_U32:
+ case LLTYPE_U64:
+ case LLTYPE_S8:
+ case LLTYPE_S16:
+ case LLTYPE_S32:
+ case LLTYPE_S64:
+ case LLTYPE_F8:
+ case LLTYPE_F16:
+ case LLTYPE_F32:
+ case LLTYPE_F64:
+ case LLTYPE_LLUUID:
+ case LLTYPE_BOOL:
+ case LLTYPE_LLVECTOR3:
+ case LLTYPE_LLVECTOR3D:
+ case LLTYPE_QUATERNION:
+ case LLTYPE_IPADDR:
+ case LLTYPE_IPPORT:
+ case LLTYPE_FIXED:
+ {
+ memcpy(lpPtr, m_lpData, m_nLen);
+ nTotalWrote = m_nLen;
+ }
+ break;
+
+ case LLTYPE_VARIABLE:
+ {
+ if (m_nTypeLen == 1)
+ {
+ BYTE cDataLen;
+
+ cDataLen = m_nLen;
+
+ memcpy(lpPtr, &cDataLen, sizeof(cDataLen));
+ nTotalWrote = sizeof(cDataLen);
+
+ lpPtr += sizeof(cDataLen);
+
+ memcpy(lpPtr, m_lpData, m_nLen);
+ nTotalWrote += m_nLen;
+ }
+ else if (m_nTypeLen == 2)
+ {
+ WORD cDataLen;
+
+ cDataLen = m_nLen;
+
+ memcpy(lpPtr, &cDataLen, sizeof(cDataLen));
+ nTotalWrote = sizeof(cDataLen);
+
+ lpPtr += sizeof(cDataLen);
+
+ memcpy(lpPtr, m_lpData, m_nLen);
+ nTotalWrote += m_nLen;
+ }
+ }
+ break;
+
+ case LLTYPE_SINGLE:
+ case LLTYPE_MULTIPLE:
+ case LLTYPE_NULL:
+ default:
+ {
+ nTotalWrote = 0;
+ }
+ break;
+ }
+
+ return nTotalWrote;
}
\ No newline at end of file
diff --git a/applications/snowcrash/snowflake/Var.h b/applications/snowcrash/snowflake/Var.h
index b24d73aa..2a609338 100644
--- a/applications/snowcrash/snowflake/Var.h
+++ b/applications/snowcrash/snowflake/Var.h
@@ -1,24 +1,24 @@
-#pragma once
-
-class CVar
-{
-public:
- CVar(void);
- ~CVar(void);
-
- char *m_lpszVar;
- int m_nType;
- int m_nTypeLen;
- int m_nLen;
- LPBYTE m_lpData;
-
- CVar *m_lpNext;
- CVar *m_lpPrev;
- void SetVar(char *lpszVar);
- void SetType(int nType, int nTypeLen = 0);
- int SetData(LPBYTE lpData);
- void GetString(char &lpszStr);
- void GetBool(bool &lpbBool);
- void Dump(void);
- int Pack(LPBYTE lpData);
-};
+#pragma once
+
+class CVar
+{
+public:
+ CVar(void);
+ ~CVar(void);
+
+ char *m_lpszVar;
+ int m_nType;
+ int m_nTypeLen;
+ int m_nLen;
+ LPBYTE m_lpData;
+
+ CVar *m_lpNext;
+ CVar *m_lpPrev;
+ void SetVar(char *lpszVar);
+ void SetType(int nType, int nTypeLen = 0);
+ int SetData(LPBYTE lpData);
+ void GetString(char &lpszStr);
+ void GetBool(bool &lpbBool);
+ void Dump(void);
+ int Pack(LPBYTE lpData);
+};
diff --git a/applications/snowcrash/snowflake/keywords.cpp b/applications/snowcrash/snowflake/keywords.cpp
index 7baecca0..92440bc2 100644
--- a/applications/snowcrash/snowflake/keywords.cpp
+++ b/applications/snowcrash/snowflake/keywords.cpp
@@ -1,1545 +1,1545 @@
-#include "StdAfx.h"
-#include ".\keywords.h"
-
-TCHAR *LLTYPES[] = {
- _T("U8"),
- _T("U16"),
- _T("U32"),
- _T("U64"),
- _T("S8"),
- _T("S16"),
- _T("S32"),
- _T("S64"),
- _T("F8"),
- _T("F16"),
- _T("F32"),
- _T("F64"),
- _T("LLUUID"),
- _T("BOOL"),
- _T("LLVector3"),
- _T("LLVector3d"),
- _T("LLQuaternion"),
- _T("IPADDR"),
- _T("IPPORT"),
- _T("Variable"),
- _T("Fixed"),
- _T("Single"),
- _T("Multiple"),
- NULL
-};
-
-TCHAR *LLKEYWORDS[] = {
- _T("SeedCapability"),
- _T("X"),
- _T("Y"),
- _T("Z"),
- _T("VotedForCandidate"),
- _T("AddFlags"),
- _T("Everyone"),
- _T("ReservedNewbie"),
- _T("MapData"),
- _T("AddItem"),
- _T("MeanCollision"),
- _T("RezScript"),
- _T("AvatarSitResponse"),
- _T("InventoryAssetResponse"),
- _T("KillObject"),
- _T("ProposalID"),
- _T("SerialNum"),
- _T("Duration"),
- _T("ScriptQuestion"),
- _T("AddCircuitCode"),
- _T("UseCircuitCode"),
- _T("ViewerCircuitCode"),
- _T("ScriptAnswerYes"),
- _T("PartnerID"),
- _T("DirLandQuery"),
- _T("TeleportStart"),
- _T("EmpoweredBlock"),
- _T("LogMessages"),
- _T("DropGroupIM"),
- _T("AboutText"),
- _T("VisualParam"),
- _T("GroupPrims"),
- _T("SelectedPrims"),
- _T("ID"),
- _T("UUIDNameRequest"),
- _T("UUIDGroupNameRequest"),
- _T("MoneyTransactionsRequest"),
- _T("GroupAccountTransactionsRequest"),
- _T("MapNameRequest"),
- _T("MailTaskSimRequest"),
- _T("LandScriptsRequest"),
- _T("UpdateSimulator"),
- _T("BillableFactor"),
- _T("ObjectBonusFactor"),
- _T("EnableSimulator"),
- _T("DisableSimulator"),
- _T("ConfirmEnableSimulator"),
- _T("LayerType"),
- _T("ParcelOverlay"),
- _T("AdjustBalance"),
- _T("GroupOwned"),
- _T("IP"),
- _T("ChatFromViewer"),
- _T("FirstLogin"),
- _T("GroupTitle"),
- _T("MapLayerReply"),
- _T("CompoundMsgID"),
- _T("CameraConstraint"),
- _T("DownloadTotals"),
- _T("ErrorValue"),
- _T("GenCounter"),
- _T("FrozenData"),
- _T("URLBlock"),
- _T("ChildAgentDying"),
- _T("To"),
- _T("ParcelDirFeeCurrent"),
- _T("ObjectDuplicate"),
- _T("InventoryData"),
- _T("ReplyData"),
- _T("ResetList"),
- _T("SimulatorPauseState"),
- _T("MediaID"),
- _T("RedirectGridX"),
- _T("RedirectGridY"),
- _T("TransferID"),
- _T("Transacted"),
- _T("TexturesChanged"),
- _T("UserLookAt"),
- _T("TestBlock1"),
- _T("SensedData"),
- _T("UpdateBlock"),
- _T("EmpoweredID"),
- _T("ClassifiedGodDelete"),
- _T("LocationPos"),
- _T("ObjectGrabUpdate"),
- _T("TaxDate"),
- _T("StartDateTime"),
- _T("ObjectUpdateCached"),
- _T("Packets"),
- _T("FailureType"),
- _T("UpdateGroupInfo"),
- _T("InventoryFile"),
- _T("ObjectPermissions"),
- _T("RevokePermissions"),
- _T("UpdateFlags"),
- _T("ObjectExportSelected"),
- _T("RezSelected"),
- _T("AutoPilot"),
- _T("UpdateMuteListEntry"),
- _T("RemoveMuteListEntry"),
- _T("SetSimStatusInDatabase"),
- _T("SetSimPresenceInDatabase"),
- _T("CameraProperty"),
- _T("GroupRecallBallot"),
- _T("BrushSize"),
- _T("StartExpungeProcess"),
- _T("SimulatorSetMap"),
- _T("RegionPresenceRequestByRegionID"),
- _T("TransferEnergy"),
- _T("ParcelObjectOwnersReply"),
- _T("GroupMembersReply"),
- _T("GroupOfficersAndMembersReply"),
- _T("RequestRegionInfo"),
- _T("AABBMax"),
- _T("RequestPayPrice"),
- _T("SimulatorPresentAtLocation"),
- _T("AgentRequestSit"),
- _T("AABBMin"),
- _T("ClassifiedFlags"),
- _T("ControlFlags"),
- _T("TeleportRequest"),
- _T("SpaceLocationTeleportRequest"),
- _T("LeaderBoardRequest"),
- _T("ScriptTeleportRequest"),
- _T("DateUTC"),
- _T("TaskIDs"),
- _T("RequestResult"),
- _T("ReputationAgentAssign"),
- _T("CanAcceptAgents"),
- _T("ObjectSaleInfo"),
- _T("KillChildAgents"),
- _T("Balance"),
- _T("DerezContainer"),
- _T("ObjectData"),
- _T("CameraAtAxis"),
- _T("InfoBlock"),
- _T("OwnershipCost"),
- _T("AvatarNotesUpdate"),
- _T("PID"),
- _T("TimeString"),
- _T("DirPopularReply"),
- _T("TerrainHeightRange00"),
- _T("SimData"),
- _T("TerrainHeightRange01"),
- _T("TerrainHeightRange10"),
- _T("TerrainHeightRange11"),
- _T("UpdateInventoryItem"),
- _T("MoveInventoryItem"),
- _T("CopyInventoryItem"),
- _T("RemoveInventoryItem"),
- _T("CreateInventoryItem"),
- _T("PathTwistBegin"),
- _T("CRC"),
- _T("AttachmentPoint"),
- _T("TelehubBlock"),
- _T("FOVBlock"),
- _T("StartLocationData"),
- _T("PositionData"),
- _T("TimeSinceLast"),
- _T("MapImage"),
- _T("Objects"),
- _T("URL"),
- _T("CreationDate"),
- _T("JointPivot"),
- _T("RateeID"),
- _T("FPS"),
- _T("HasTelehub"),
- _T("PathEnd"),
- _T("ScriptDataReply"),
- _T("MapBlockReply"),
- _T("PropertiesData"),
- _T("ViewerEffect"),
- _T("FreezeUser"),
- _T("OwnerPrims"),
- _T("ScriptTime"),
- _T("ObjectGrab"),
- _T("ToAgentID"),
- _T("ProxyBlock"),
- _T("SimulatorMapUpdate"),
- _T("TransferPacket"),
- _T("ObjectName"),
- _T("OriginalName"),
- _T("CompletePingCheck"),
- _T("OnlineStatus"),
- _T("TrackOnlineStatus"),
- _T("IgnoreOnlineStatus"),
- _T("ObjectDrop"),
- _T("UseBigPackets"),
- _T("ParcelAccessListReply"),
- _T("RpcChannelReply"),
- _T("RegionPresenceResponse"),
- _T("AgentPresenceResponse"),
- _T("CharterMember"),
- _T("EdgeData"),
- _T("NameData"),
- _T("RegionPushOverride"),
- _T("SimName"),
- _T("UserReport"),
- _T("DownloadPriority"),
- _T("ToAgentId"),
- _T("Mag"),
- _T("DirPopularQuery"),
- _T("ParcelPropertiesRequestByID"),
- _T("ObjectLink"),
- _T("RpcScriptReplyInbound"),
- _T("BoardData"),
- _T("RezData"),
- _T("RemoveInventoryObjects"),
- _T("Officer"),
- _T("GroupProposalBallot"),
- _T("RPCServerIP"),
- _T("Far"),
- _T("GodSessionID"),
- _T("ViewerDigest"),
- _T("FLAboutText"),
- _T("RegionHandshakeReply"),
- _T("GroupActiveProposalItemReply"),
- _T("MapItemReply"),
- _T("Seconds"),
- _T("UpdateUserInfo"),
- _T("AggregatePermTexturesOwner"),
- _T("Set"),
- _T("Key"),
- _T("NewName"),
- _T("AgentID"),
- _T("OnlineStatusRequest"),
- _T("DataAgentAccessRequest"),
- _T("EventNotificationRemoveRequest"),
- _T("Arc"),
- _T("NewFolderID"),
- _T("RegionX"),
- _T("RegionY"),
- _T("RequestData"),
- _T("Msg"),
- _T("Top"),
- _T("MiscStats"),
- _T("Pos"),
- _T("ImageID"),
- _T("DataPacket"),
- _T("ObjectDehinge"),
- _T("You"),
- _T("ScriptControlChange"),
- _T("LoadURL"),
- _T("SetCPURatio"),
- _T("NameValueData"),
- _T("AtomicPassObject"),
- _T("ViewerFrozenMessage"),
- _T("HealthMessage"),
- _T("LogTextMessage"),
- _T("TimeDilation"),
- _T("Contribution"),
- _T("SetGroupContribution"),
- _T("Offline"),
- _T("SecPerDay"),
- _T("Members"),
- _T("FailedResends"),
- _T("CameraCenter"),
- _T("CameraLeftAxis"),
- _T("ExBlock"),
- _T("Channel"),
- _T("NetTest"),
- _T("DiscardLevel"),
- _T("LayerID"),
- _T("RatorID"),
- _T("GrabOffset"),
- _T("SimPort"),
- _T("PricePerMeter"),
- _T("RegionFlags"),
- _T("VoteResult"),
- _T("ParcelDirFeeEstimate"),
- _T("ModifyBlock"),
- _T("InventoryBlock"),
- _T("ReplyBlock"),
- _T("RequireMask"),
- _T("ValidUntil"),
- _T("VelocityInterpolateOn"),
- _T("ClassifiedDelete"),
- _T("FLImageID"),
- _T("AllowPublish"),
- _T("SitName"),
- _T("OfficerTitle"),
- _T("RegionsVisited"),
- _T("RecallID"),
- _T("DirClassifiedReply"),
- _T("AvatarClassifiedReply"),
- _T("ReputationIndividualReply"),
- _T("MediaURL"),
- _T("CompleteAgentMovement"),
- _T("SpaceIP"),
- _T("ClassifiedID"),
- _T("LocalID"),
- _T("RemoveItem"),
- _T("LogFailedMoneyTransaction"),
- _T("ViewerStartAuction"),
- _T("StartAuction"),
- _T("NameValueName"),
- _T("AngVelX"),
- _T("DuplicateFlags"),
- _T("AngVelY"),
- _T("AngVelZ"),
- _T("TextColor"),
- _T("SlaveID"),
- _T("Charter"),
- _T("TargetBlock"),
- _T("AlertData"),
- _T("CheckParcelAuctions"),
- _T("ParcelAuctions"),
- _T("NameValuePair"),
- _T("RemoveNameValuePair"),
- _T("GetNameValuePair"),
- _T("BulkUpdateInventory"),
- _T("UpdateTaskInventory"),
- _T("RemoveTaskInventory"),
- _T("MoveTaskInventory"),
- _T("RequestTaskInventory"),
- _T("ReplyTaskInventory"),
- _T("DeclineInventory"),
- _T("AggregatePermInventory"),
- _T("SimulatorInfo"),
- _T("MoneyTransactionsReply"),
- _T("GroupAccountTransactionsReply"),
- _T("MailTaskSimReply"),
- _T("WearableData"),
- _T("StatisticsData"),
- _T("AccessOK"),
- _T("Enabled"),
- _T("Savings"),
- _T("SimulatorLoad"),
- _T("InternalRegionIP"),
- _T("ExternalRegionIP"),
- _T("CreateGroupRequest"),
- _T("JoinGroupRequest"),
- _T("LeaveGroupRequest"),
- _T("InviteGroupRequest"),
- _T("LiveHelpGroupRequest"),
- _T("ServerVersion"),
- _T("PriceParcelClaimFactor"),
- _T("BillableArea"),
- _T("ScriptCount"),
- _T("ObjectID"),
- _T("ObjectFlagUpdate"),
- _T("ActiveOnly"),
- _T("RequestInventoryAsset"),
- _T("RedoLand"),
- _T("TravelAccess"),
- _T("ChangedGrid"),
- _T("Details"),
- _T("LocationX"),
- _T("SaleType"),
- _T("ObjectExportReply"),
- _T("LocationY"),
- _T("LocationZ"),
- _T("EconomyData"),
- _T("HeadRotation"),
- _T("DeleteOnCompletion"),
- _T("PublicPort"),
- _T("CurrentTaxes"),
- _T("DirClassifiedQuery"),
- _T("RequestParcelTransfer"),
- _T("ObjectCapacity"),
- _T("RequestID"),
- _T("GranterName"),
- _T("RequestXfer"),
- _T("ObjectTaxCurrent"),
- _T("LightTaxCurrent"),
- _T("LandTaxCurrent"),
- _T("GroupTaxCurrent"),
- _T("FetchInventoryDescendents"),
- _T("InventoryDescendents"),
- _T("Descendents"),
- _T("PurgeInventoryDescendents"),
- _T("ShowDir"),
- _T("Timestamp"),
- _T("GlobalPos"),
- _T("LimitedToEstate"),
- _T("GrabOffsetInitial"),
- _T("IsTrial"),
- _T("FinalizeLogout"),
- _T("ObjectDuplicateOnRay"),
- _T("GroupMembershipCount"),
- _T("MethodData"),
- _T("ActivateGestures"),
- _T("DeactivateGestures"),
- _T("ProposalData"),
- _T("PosGlobal"),
- _T("SearchID"),
- _T("RezMultipleAttachmentsFromInv"),
- _T("SearchName"),
- _T("VersionString"),
- _T("CreateGroupReply"),
- _T("ActualArea"),
- _T("RevokedID"),
- _T("Message"),
- _T("ClickAction"),
- _T("AssetUploadComplete"),
- _T("EstimatedTaxes"),
- _T("RequestType"),
- _T("UUID"),
- _T("BaseMask"),
- _T("NetBlock"),
- _T("GlobalX"),
- _T("GlobalY"),
- _T("CopyRotates"),
- _T("KickUserAck"),
- _T("TopPick"),
- _T("SessionID"),
- _T("GlobalZ"),
- _T("CallVote"),
- _T("DeclineFriendship"),
- _T("FormFriendship"),
- _T("TerminateFriendship"),
- _T("TaskData"),
- _T("SimWideMaxPrims"),
- _T("TotalPrims"),
- _T("SourceFilename"),
- _T("ProfileBegin"),
- _T("MoneyDetailsRequest"),
- _T("Request"),
- _T("GroupAccountDetailsRequest"),
- _T("GroupActiveProposalsRequest"),
- _T("VoteQuorum"),
- _T("StringValue"),
- _T("ClosestSimulator"),
- _T("Version"),
- _T("OtherCount"),
- _T("ChatData"),
- _T("IsGroupOwned"),
- _T("EnergyEfficiency"),
- _T("MaxPlace"),
- _T("PickInfoUpdate"),
- _T("PickDelete"),
- _T("ScriptReset"),
- _T("Requester"),
- _T("RevokerID"),
- _T("ElectionID"),
- _T("ForSale"),
- _T("NearestLandingRegionReply"),
- _T("RecordAgentPresence"),
- _T("EraseAgentPresence"),
- _T("ParcelID"),
- _T("Godlike"),
- _T("TotalDebits"),
- _T("Direction"),
- _T("Appearance"),
- _T("HealthData"),
- _T("LeftAxis"),
- _T("PositionBlock"),
- _T("LocationBlock"),
- _T("ObjectImage"),
- _T("TerrainStartHeight00"),
- _T("TerrainStartHeight01"),
- _T("TerrainStartHeight10"),
- _T("ObjectHinge"),
- _T("TerrainStartHeight11"),
- _T("MetersPerGrid"),
- _T("WaterHeight"),
- _T("FetchInventoryReply"),
- _T("MoneySummaryReply"),
- _T("GroupAccountSummaryReply"),
- _T("AttachedSound"),
- _T("ParamInUse"),
- _T("GodKickUser"),
- _T("PickName"),
- _T("TaskName"),
- _T("SkillFlags"),
- _T("ParcelGodReserveForNewbie"),
- _T("SubType"),
- _T("ObjectCount"),
- _T("RegionPresenceRequestByHandle"),
- _T("RezSingleAttachmentFromInv"),
- _T("ChildAgentUpdate"),
- _T("ToID"),
- _T("ViewerPort"),
- _T("IsOwnerGroup"),
- _T("AgentHeightWidth"),
- _T("VerticalAngle"),
- _T("WearableType"),
- _T("AggregatePermNextOwner"),
- _T("ShowInList"),
- _T("PositionSuggestion"),
- _T("UpdateParcel"),
- _T("ClearAgentSessions"),
- _T("SetAlwaysRun"),
- _T("NVPair"),
- _T("ObjectSpinStart"),
- _T("UseEstateSun"),
- _T("LogoutBlock"),
- _T("RelayLogControl"),
- _T("RegionID"),
- _T("Creator"),
- _T("ViewerRegion"),
- _T("ProposalText"),
- _T("DirEventsReply"),
- _T("EventInfoReply"),
- _T("GroupElectionInfoReply"),
- _T("UserInfoReply"),
- _T("PathRadiusOffset"),
- _T("SessionInfo"),
- _T("TextureData"),
- _T("ChatPass"),
- _T("TargetID"),
- _T("DefaultPayPrice"),
- _T("UserLocation"),
- _T("MaxPrims"),
- _T("RegionIP"),
- _T("LandmarkID"),
- _T("InitiateDownload"),
- _T("Name"),
- _T("OtherCleanTime"),
- _T("TeleportPriceExponent"),
- _T("Gain"),
- _T("VelX"),
- _T("PacketAck"),
- _T("PathSkew"),
- _T("Negative"),
- _T("VelY"),
- _T("SimulatorShutdownRequest"),
- _T("NearestLandingRegionRequest"),
- _T("VelZ"),
- _T("OtherID"),
- _T("MapLayerRequest"),
- _T("PatchVersion"),
- _T("ObjectScale"),
- _T("TargetIP"),
- _T("Redo"),
- _T("MoneyBalance"),
- _T("TrackAgent"),
- _T("MaxX"),
- _T("Data"),
- _T("MaxY"),
- _T("TextureAnim"),
- _T("ReturnIDs"),
- _T("Date"),
- _T("GestureUpdate"),
- _T("AgentWearablesUpdate"),
- _T("AgentDataUpdate"),
- _T("Hash"),
- _T("Left"),
- _T("Mask"),
- _T("ForceMouselook"),
- _T("RequestLocationGetAccess"),
- _T("Success"),
- _T("ObjectGroup"),
- _T("SunHour"),
- _T("MinX"),
- _T("ScriptSensorReply"),
- _T("MinY"),
- _T("Command"),
- _T("Desc"),
- _T("AttachmentNeedsSave"),
- _T("HistoryItemData"),
- _T("AgentCachedTexture"),
- _T("East"),
- _T("Subject"),
- _T("GodExpungeUser"),
- _T("QueryReplies"),
- _T("ObjectCategory"),
- _T("Time"),
- _T("CreateLandmarkForEvent"),
- _T("ParentID"),
- _T("Ping"),
- _T("Perp"),
- _T("Code"),
- _T("InvType"),
- _T("AgentFOV"),
- _T("BulkMoneyTransfer"),
- _T("Audible"),
- _T("AuctionData"),
- _T("IDBlock"),
- _T("ReputationData"),
- _T("West"),
- _T("ElectionData"),
- _T("Undo"),
- _T("Info"),
- _T("Area"),
- _T("Behavior"),
- _T("SimCrashed"),
- _T("Text"),
- _T("AgentToNewRegion"),
- _T("PriceGroupCreate"),
- _T("ObjectShape"),
- _T("PosX"),
- _T("PosY"),
- _T("MuteCRC"),
- _T("PosZ"),
- _T("Size"),
- _T("FromAddress"),
- _T("Body"),
- _T("FileData"),
- _T("List"),
- _T("KickUser"),
- _T("OtherPrims"),
- _T("RunTime"),
- _T("RpcScriptRequestInboundForward"),
- _T("More"),
- _T("Majority"),
- _T("SenderID"),
- _T("MetersTraveled"),
- _T("Stat"),
- _T("FromAgentID"),
- _T("Item"),
- _T("SoundID"),
- _T("User"),
- _T("RemoteInfos"),
- _T("Vote"),
- _T("Prey"),
- _T("UsecSinceStart"),
- _T("RayStart"),
- _T("ParcelData"),
- _T("CameraUpAxis"),
- _T("ScriptDialog"),
- _T("MasterParcelData"),
- _T("Invalid"),
- _T("MinPlace"),
- _T("ProfileCurve"),
- _T("ParcelAccessListUpdate"),
- _T("MuteListUpdate"),
- _T("SendPacket"),
- _T("SendXferPacket"),
- _T("LastName"),
- _T("From"),
- _T("Port"),
- _T("MemberTitle"),
- _T("LogParcelChanges"),
- _T("DeRezObject"),
- _T("IsTemporary"),
- _T("IsComplete"),
- _T("InsigniaID"),
- _T("CheckFlags"),
- _T("TransferPriority"),
- _T("EventID"),
- _T("FromAgentId"),
- _T("Type"),
- _T("ChatType"),
- _T("ReportData"),
- _T("LeaderBoardData"),
- _T("RequestBlock"),
- _T("GrantData"),
- _T("DetachAttachmentIntoInv"),
- _T("ParcelDisableObjects"),
- _T("Sections"),
- _T("GodLevel"),
- _T("StartGroupIM"),
- _T("PayPriceReply"),
- _T("QueryID"),
- _T("CameraEyeOffset"),
- _T("AgentPosition"),
- _T("GrabPosition"),
- _T("GrantModification"),
- _T("RevokeModification"),
- _T("OnlineNotification"),
- _T("OfflineNotification"),
- _T("SendPostcard"),
- _T("RequestFlags"),
- _T("MoneyHistoryRequest"),
- _T("MoneySummaryRequest"),
- _T("GroupMoneyHistoryRequest"),
- _T("GroupAccountSummaryRequest"),
- _T("ParamValue"),
- _T("GroupVoteHistoryRequest"),
- _T("Checksum"),
- _T("MaxAgents"),
- _T("CreateNewOutfitAttachments"),
- _T("RegionHandle"),
- _T("TeleportProgress"),
- _T("AgentQuitCopy"),
- _T("LocationValid"),
- _T("ToViewer"),
- _T("ParcelName"),
- _T("InviteOfficers"),
- _T("PriceObjectRent"),
- _T("ConnectAgentToUserserver"),
- _T("ConnectToUserserver"),
- _T("OfferCallingCard"),
- _T("AgentAccess"),
- _T("AcceptCallingCard"),
- _T("DeclineCallingCard"),
- _T("DataHomeLocationReply"),
- _T("EventLocationReply"),
- _T("UserLoginLocationReply"),
- _T("UserSimLocationReply"),
- _T("SpaceLoginLocationReply"),
- _T("TerseDateID"),
- _T("ObjectOwner"),
- _T("AssetID"),
- _T("AlertMessage"),
- _T("AgentAlertMessage"),
- _T("EstateOwnerMessage"),
- _T("ParcelMediaCommandMessage"),
- _T("Auction"),
- _T("Category"),
- _T("FilePath"),
- _T("ItemFlags"),
- _T("Invoice"),
- _T("IntervalDays"),
- _T("PathScaleX"),
- _T("FromTaskID"),
- _T("TimeInfo"),
- _T("PathScaleY"),
- _T("PublicCount"),
- _T("ParcelJoin"),
- _T("SimulatorBlock"),
- _T("UserBlock"),
- _T("GroupID"),
- _T("AgentVel"),
- _T("RequestImage"),
- _T("NetStats"),
- _T("AgentPos"),
- _T("AgentSit"),
- _T("Material"),
- _T("ObjectDeGrab"),
- _T("VelocityInterpolateOff"),
- _T("AuthorizedBuyerID"),
- _T("RemoveMemberFromGroup"),
- _T("GroupIM"),
- _T("AvatarPropertiesReply"),
- _T("GroupPropertiesReply"),
- _T("GroupProfileReply"),
- _T("Participants"),
- _T("SimOwner"),
- _T("SalePrice"),
- _T("Animation"),
- _T("CurrentDividend"),
- _T("OwnerID"),
- _T("NearestLandingRegionUpdated"),
- _T("PassToAgent"),
- _T("PreyAgent"),
- _T("SimStats"),
- _T("Options"),
- _T("LogoutReply"),
- _T("ObjectLocalID"),
- _T("Dropped"),
- _T("Destination"),
- _T("MasterID"),
- _T("TransferData"),
- _T("WantToMask"),
- _T("AvatarData"),
- _T("ParcelSelectObjects"),
- _T("ExtraParams"),
- _T("LogLogin"),
- _T("CreatorID"),
- _T("Summary"),
- _T("BuyObjectInventory"),
- _T("FetchInventory"),
- _T("InventoryID"),
- _T("PacketNumber"),
- _T("SetFollowCamProperties"),
- _T("ClearFollowCamProperties"),
- _T("SimulatorThrottleSettings"),
- _T("SequenceID"),
- _T("DataServerLogout"),
- _T("NameValue"),
- _T("PathShearX"),
- _T("PathShearY"),
- _T("ElectionType"),
- _T("Velocity"),
- _T("SecPerYear"),
- _T("FirstName"),
- _T("AttachedSoundGainChange"),
- _T("LocationID"),
- _T("Running"),
- _T("ObjectImportReply"),
- _T("AgentThrottle"),
- _T("NeighborList"),
- _T("PathTaperX"),
- _T("PathTaperY"),
- _T("GranterBlock"),
- _T("UseCachedMuteList"),
- _T("FailStats"),
- _T("StartGroupRecall"),
- _T("Tempfile"),
- _T("FounderName"),
- _T("BuyerID"),
- _T("DirPeopleReply"),
- _T("TransferInfo"),
- _T("AvatarPickerRequestBackend"),
- _T("AvatarPropertiesRequestBackend"),
- _T("UpdateData"),
- _T("ReporterID"),
- _T("GranterID"),
- _T("ButtonLabel"),
- _T("WantToText"),
- _T("ReportType"),
- _T("DataBlock"),
- _T("SimulatorReady"),
- _T("AnimationSourceList"),
- _T("RefreshViewer"),
- _T("SubscribeLoad"),
- _T("UnsubscribeLoad"),
- _T("Packet"),
- _T("UndoLand"),
- _T("SimAccess"),
- _T("MembershipFee"),
- _T("CreateInventoryFolder"),
- _T("UpdateInventoryFolder"),
- _T("MoveInventoryFolder"),
- _T("RemoveInventoryFolder"),
- _T("MoneyData"),
- _T("ObjectDeselect"),
- _T("NewAssetID"),
- _T("ObjectAdd"),
- _T("RayEndIsIntersection"),
- _T("CompleteAuction"),
- _T("CircuitCode"),
- _T("AgentMovementComplete"),
- _T("ViewerIP"),
- _T("Header"),
- _T("GestureFlags"),
- _T("XferID"),
- _T("StatValue"),
- _T("PickID"),
- _T("TaskID"),
- _T("GridsPerEdge"),
- _T("RayEnd"),
- _T("Throttles"),
- _T("UpAxis"),
- _T("AgentTextures"),
- _T("Radius"),
- _T("OffCircuit"),
- _T("Access"),
- _T("SquareMetersCredit"),
- _T("Filename"),
- _T("SecuredTemplateChecksumRequest"),
- _T("TemplateChecksumRequest"),
- _T("AgentPresenceRequest"),
- _T("ClassifiedInfoRequest"),
- _T("ParcelInfoRequest"),
- _T("ParcelObjectOwnersRequest"),
- _T("TeleportLandmarkRequest"),
- _T("EventInfoRequest"),
- _T("MovedIntoSimulator"),
- _T("ChatFromSimulator"),
- _T("PickInfoRequest"),
- _T("MoneyBalanceRequest"),
- _T("DirPeopleQuery"),
- _T("GroupElectionInfoRequest"),
- _T("GroupMembersRequest"),
- _T("GroupOfficersAndMembersRequest"),
- _T("TextureID"),
- _T("OldFolderID"),
- _T("UserInfoRequest"),
- _T("LandCollidersRequest"),
- _T("Handle"),
- _T("StartParcelRenameAck"),
- _T("StateLoad"),
- _T("ButtonIndex"),
- _T("CurrentElectionID"),
- _T("GetScriptRunning"),
- _T("SetScriptRunning"),
- _T("Health"),
- _T("FileID"),
- _T("CircuitInfo"),
- _T("ObjectBuy"),
- _T("ProfileEnd"),
- _T("Effect"),
- _T("TestMessage"),
- _T("ScriptMailRegistration"),
- _T("AgentSetAppearance"),
- _T("AvatarAppearance"),
- _T("RegionData"),
- _T("RequestingRegionData"),
- _T("LandingRegionData"),
- _T("SitTransform"),
- _T("TerrainBase0"),
- _T("SkillsMask"),
- _T("AtAxis"),
- _T("TerrainBase1"),
- _T("Reason"),
- _T("TerrainBase2"),
- _T("TerrainBase3"),
- _T("Params"),
- _T("PingID"),
- _T("Height"),
- _T("Region"),
- _T("MoneyHistoryReply"),
- _T("GroupMoneyHistoryReply"),
- _T("TelehubInfo"),
- _T("StateSave"),
- _T("AgentAnimation"),
- _T("AvatarAnimation"),
- _T("LogDwellTime"),
- _T("ParcelGodMarkAsContent"),
- _T("UsePhysics"),
- _T("JointType"),
- _T("TaxEstimate"),
- _T("ObjectTaxEstimate"),
- _T("LightTaxEstimate"),
- _T("TeleportLandingStatusChanged"),
- _T("LandTaxEstimate"),
- _T("GroupTaxEstimate"),
- _T("Buttons"),
- _T("Sender"),
- _T("Dialog"),
- _T("DestID"),
- _T("PricePublicObjectDelete"),
- _T("ObjectDelete"),
- _T("Delete"),
- _T("EventGodDelete"),
- _T("LastTaxDate"),
- _T("MapImageID"),
- _T("EndDateTime"),
- _T("TerrainDetail0"),
- _T("TerrainDetail1"),
- _T("TerrainDetail2"),
- _T("TerrainDetail3"),
- _T("Offset"),
- _T("ObjectDelink"),
- _T("TargetObject"),
- _T("IsEstateManager"),
- _T("CancelAuction"),
- _T("ObjectDetach"),
- _T("Compressed"),
- _T("PathBegin"),
- _T("BypassRaycast"),
- _T("WinnerID"),
- _T("ChannelType"),
- _T("NumberNonExemptMembers"),
- _T("NonExemptMembers"),
- _T("Agents"),
- _T("SimulatorStart"),
- _T("Enable"),
- _T("RevokedBlock"),
- _T("MemberData"),
- _T("ImageNotInDatabase"),
- _T("StartDate"),
- _T("AnimID"),
- _T("Serial"),
- _T("GroupElectionBallot"),
- _T("ControlPort"),
- _T("ModifyLand"),
- _T("Digest"),
- _T("Victim"),
- _T("Script"),
- _T("TemplateChecksumReply"),
- _T("PickInfoReply"),
- _T("MoneyBalanceReply"),
- _T("RoutedMoneyBalanceReply"),
- _T("RegionInfo"),
- _T("Sequence"),
- _T("GodUpdateRegionInfo"),
- _T("LocalX"),
- _T("LocalY"),
- _T("StartAnim"),
- _T("Location"),
- _T("Action"),
- _T("SearchDir"),
- _T("Active"),
- _T("TransferRequest"),
- _T("ScriptSensorRequest"),
- _T("MoneyTransferRequest"),
- _T("EjectGroupMemberRequest"),
- _T("SkillsText"),
- _T("Resent"),
- _T("Center"),
- _T("SharedData"),
- _T("PSBlock"),
- _T("UUIDNameBlock"),
- _T("Viewer"),
- _T("Method"),
- _T("TouchName"),
- _T("CandidateID"),
- _T("ParamData"),
- _T("GodlikeMessage"),
- _T("SystemMessage"),
- _T("BodyRotation"),
- _T("StartGroupElection"),
- _T("SearchRegions"),
- _T("Ignore"),
- _T("AnimationData"),
- _T("StatID"),
- _T("ItemID"),
- _T("AvatarStatisticsReply"),
- _T("ScriptDialogReply"),
- _T("RegionIDAndHandleReply"),
- _T("CameraAtOffset"),
- _T("VoteID"),
- _T("ParcelGodForceOwner"),
- _T("InviteData"),
- _T("CandidateData"),
- _T("PCode"),
- _T("SearchPos"),
- _T("PreyID"),
- _T("TerrainLowerLimit"),
- _T("EventFlags"),
- _T("TallyVotes"),
- _T("GroupInfoUpdated"),
- _T("Result"),
- _T("LookAt"),
- _T("PayButton"),
- _T("SelfCount"),
- _T("PacketCount"),
- _T("ParcelBuyPass"),
- _T("SimHandle"),
- _T("Identified"),
- _T("OldItemID"),
- _T("RegionPort"),
- _T("PriceEnergyUnit"),
- _T("Bitmap"),
- _T("TrackAgentSession"),
- _T("CacheMissType"),
- _T("VFileID"),
- _T("Response"),
- _T("GroupInsigniaID"),
- _T("FromID"),
- _T("Online"),
- _T("KickFlags"),
- _T("SysCPU"),
- _T("EMail"),
- _T("InviteMembers"),
- _T("IncludeMembers"),
- _T("AggregatePermTextures"),
- _T("ChatChannel"),
- _T("ReturnID"),
- _T("ObjectAttach"),
- _T("TargetPort"),
- _T("ObjectSpinStop"),
- _T("FullID"),
- _T("ActivateGroup"),
- _T("SysGPU"),
- _T("StartLure"),
- _T("SysRAM"),
- _T("ObjectPosition"),
- _T("SitPosition"),
- _T("StartTime"),
- _T("BornOn"),
- _T("CameraCollidePlane"),
- _T("EconomyDataRequest"),
- _T("TeleportLureRequest"),
- _T("FolderID"),
- _T("RegionHandleRequest"),
- _T("GestureRequest"),
- _T("ScriptDataRequest"),
- _T("AgentWearablesRequest"),
- _T("MapBlockRequest"),
- _T("LureID"),
- _T("CopyCenters"),
- _T("RegisterNewAgent"),
- _T("TotalColliderCount"),
- _T("ParamList"),
- _T("InventorySerial"),
- _T("EdgeDataPacket"),
- _T("AvatarPickerReply"),
- _T("ParcelDwellReply"),
- _T("IsForSale"),
- _T("MuteID"),
- _T("MeanCollisionAlert"),
- _T("CanAcceptTasks"),
- _T("ItemData"),
- _T("AnimationList"),
- _T("PassObject"),
- _T("Reputation"),
- _T("IntValue"),
- _T("TargetType"),
- _T("Amount"),
- _T("UpdateAttachment"),
- _T("RemoveAttachment"),
- _T("HeightWidthBlock"),
- _T("RequestObjectPropertiesFamily"),
- _T("ObjectPropertiesFamily"),
- _T("UserData"),
- _T("SessionBlock"),
- _T("IsReadable"),
- _T("ReputationMax"),
- _T("PathCurve"),
- _T("ReputationMin"),
- _T("Status"),
- _T("AlreadyVoted"),
- _T("ElectionInitiator"),
- _T("PlacesReply"),
- _T("DirPlacesReply"),
- _T("ParcelBuy"),
- _T("DirFindQueryBackend"),
- _T("DirPlacesQueryBackend"),
- _T("DirPeopleQueryBackend"),
- _T("DirGroupsQueryBackend"),
- _T("DirClassifiedQueryBackend"),
- _T("DirPicksQueryBackend"),
- _T("DirLandQueryBackend"),
- _T("DirPopularQueryBackend"),
- _T("SnapshotID"),
- _T("Aspect"),
- _T("LogoutDemand"),
- _T("HistoryData"),
- _T("VoteData"),
- _T("EstimatedDividend"),
- _T("ParamSize"),
- _T("VoteCast"),
- _T("EveryoneMask"),
- _T("CastsShadows"),
- _T("SetSunPhase"),
- _T("ObjectSpinUpdate"),
- _T("MaturePublish"),
- _T("UseExistingAsset"),
- _T("ParcelLocalID"),
- _T("TeleportCancel"),
- _T("UnixTime"),
- _T("QueryFlags"),
- _T("LastExecFroze"),
- _T("AlwaysRun"),
- _T("Bottom"),
- _T("ButtonData"),
- _T("SoundData"),
- _T("ViewerStats"),
- _T("RegionHandshake"),
- _T("Description"),
- _T("ObjectDescription"),
- _T("ParamType"),
- _T("UUIDNameReply"),
- _T("UUIDGroupNameReply"),
- _T("SaveAssetIntoInventory"),
- _T("UserInfo"),
- _T("AnimSequenceID"),
- _T("NVPairs"),
- _T("ParcelAccessListRequest"),
- _T("UserListRequest"),
- _T("MuteListRequest"),
- _T("StartPeriod"),
- _T("RpcChannelRequest"),
- _T("PlacesQuery"),
- _T("DirPlacesQuery"),
- _T("Distance"),
- _T("SortOrder"),
- _T("Hunter"),
- _T("TotalScriptCount"),
- _T("SunAngVelocity"),
- _T("InventoryUpdate"),
- _T("ImagePacket"),
- _T("BinaryBucket"),
- _T("StartGroupProposal"),
- _T("EnergyLevel"),
- _T("PriceForListing"),
- _T("Scale"),
- _T("ParentEstateID"),
- _T("Extra2"),
- _T("Throttle"),
- _T("SimIP"),
- _T("GodID"),
- _T("TeleportMinPrice"),
- _T("VoteItem"),
- _T("ObjectRotation"),
- _T("SitRotation"),
- _T("SnapSelection"),
- _T("SoundTrigger"),
- _T("TerrainRaiseLimit"),
- _T("Quorum"),
- _T("TokenBlock"),
- _T("AgentBlock"),
- _T("CommandBlock"),
- _T("PricePublicObjectDecay"),
- _T("SpawnPointPos"),
- _T("AttachedSoundCutoffRadius"),
- _T("VolumeDetail"),
- _T("TasksPaused"),
- _T("Range"),
- _T("FromAgentName"),
- _T("AddModifyAbility"),
- _T("RemoveModifyAbility"),
- _T("PublicIP"),
- _T("TeleportFailed"),
- _T("OnlineStatusReply"),
- _T("DataAgentAccessReply"),
- _T("RequestLocationGetAccessReply"),
- _T("RequestAvatarInfo"),
- _T("PreloadSound"),
- _T("ScreenshotID"),
- _T("OldestUnacked"),
- _T("SimulatorIP"),
- _T("ObjectImport"),
- _T("MoneyMax"),
- _T("Value"),
- _T("JointAxisOrAnchor"),
- _T("Test0"),
- _T("MoneyMin"),
- _T("Test1"),
- _T("Test2"),
- _T("SunPhase"),
- _T("Place"),
- _T("Phase"),
- _T("ParcelDivide"),
- _T("PriceObjectClaim"),
- _T("VoteTime"),
- _T("Field"),
- _T("Ratio"),
- _T("JoinGroupReply"),
- _T("LiveHelpGroupReply"),
- _T("Agent"),
- _T("Score"),
- _T("ExpungeData"),
- _T("Image"),
- _T("ObjectClickAction"),
- _T("Delta"),
- _T("InitiateUpload"),
- _T("Parameter"),
- _T("Flags"),
- _T("Plane"),
- _T("Width"),
- _T("VoteText"),
- _T("Right"),
- _T("DirFindQuery"),
- _T("Textures"),
- _T("EventData"),
- _T("Final"),
- _T("TelehubPos"),
- _T("ReportAutosaveCrash"),
- _T("Reset"),
- _T("CreateTrustedCircuit"),
- _T("DenyTrustedCircuit"),
- _T("Codec"),
- _T("Level"),
- _T("Modal"),
- _T("ChildAgentUnknown"),
- _T("LandingType"),
- _T("ScriptRunningReply"),
- _T("MoneyDetailsReply"),
- _T("Reply"),
- _T("TelehubRot"),
- _T("RequestFriendship"),
- _T("AcceptFriendship"),
- _T("GroupAccountDetailsReply"),
- _T("DwellInfo"),
- _T("AgentResume"),
- _T("ItemType"),
- _T("MailFilter"),
- _T("Disconnect"),
- _T("SimPosition"),
- _T("SimWideTotalPrims"),
- _T("Index"),
- _T("BaseFilename"),
- _T("SimFilename"),
- _T("LastOwnerID"),
- _T("EmailMessageRequest"),
- _T("MapItemRequest"),
- _T("AgentCount"),
- _T("InitializeLure"),
- _T("HelloBlock"),
- _T("FuseBlock"),
- _T("MessageBlock"),
- _T("ClassifiedInfoUpdate"),
- _T("RegionPos"),
- _T("ParcelMediaUpdate"),
- _T("GridX"),
- _T("GridY"),
- _T("AuctionID"),
- _T("VoteType"),
- _T("CategoryID"),
- _T("Token"),
- _T("AggregatePerms"),
- _T("StartParcelRemoveAck"),
- _T("ObjectSelect"),
- _T("ForceObjectSelect"),
- _T("Price"),
- _T("SunDirection"),
- _T("FromName"),
- _T("ChangeInventoryItemFlags"),
- _T("Force"),
- _T("TransactionBlock"),
- _T("PowersMask"),
- _T("Stamp"),
- _T("RelatedID"),
- _T("TotalCredits"),
- _T("State"),
- _T("TextureIndex"),
- _T("SimPaused"),
- _T("InviteeID"),
- _T("ParcelReclaim"),
- _T("Money"),
- _T("PathTwist"),
- _T("AuthBuyerID"),
- _T("Color"),
- _T("SourceType"),
- _T("World"),
- _T("QueryData"),
- _T("Users"),
- _T("SysOS"),
- _T("Notes"),
- _T("AvatarID"),
- _T("FounderID"),
- _T("EndPointID"),
- _T("StipendEstimate"),
- _T("LocationLookAt"),
- _T("Sound"),
- _T("Cover"),
- _T("TextureEntry"),
- _T("SquareMetersCommitted"),
- _T("ChannelID"),
- _T("Dwell"),
- _T("North"),
- _T("AgentUpdate"),
- _T("PickGodDelete"),
- _T("UpdateInventoryItemAsset"),
- _T("HostName"),
- _T("PriceParcelClaim"),
- _T("ParcelClaim"),
- _T("ProfileHollow"),
- _T("Count"),
- _T("South"),
- _T("Entry"),
- _T("ObjectUpdateCompressed"),
- _T("MuteFlags"),
- _T("Group"),
- _T("AgentPause"),
- _T("InternalScriptMail"),
- _T("FindAgent"),
- _T("AgentData"),
- _T("FolderData"),
- _T("AssetBlock"),
- _T("CloseCircuit"),
- _T("LogControl"),
- _T("TeleportFinish"),
- _T("PathRevolutions"),
- _T("ClassifiedInfoReply"),
- _T("ParcelInfoReply"),
- _T("LandCollidersReply"),
- _T("AutosaveData"),
- _T("SetStartLocation"),
- _T("PassHours"),
- _T("AttachmentPt"),
- _T("ParcelFlags"),
- _T("NumVotes"),
- _T("AvatarPickerRequest"),
- _T("TeleportLocationRequest"),
- _T("DataHomeLocationRequest"),
- _T("EventNotificationAddRequest"),
- _T("ParcelDwellRequest"),
- _T("ViewerLoginLocationRequest"),
- _T("ViewerSimLocationRequest"),
- _T("EventLocationRequest"),
- _T("EndPeriod"),
- _T("SetStartLocationRequest"),
- _T("UserLoginLocationRequest"),
- _T("QueryStart"),
- _T("AvatarTextureUpdate"),
- _T("RequestGrantedProxies"),
- _T("GrantedProxies"),
- _T("RPCServerPort"),
- _T("Bytes"),
- _T("Extra"),
- _T("ForceScriptControlRelease"),
- _T("ParcelRelease"),
- _T("VFileType"),
- _T("ImageData"),
- _T("SpaceServerSimulatorTimeMessage"),
- _T("SimulatorViewerTimeMessage"),
- _T("Rotation"),
- _T("Selection"),
- _T("TransactionData"),
- _T("OperationData"),
- _T("ExpirationDate"),
- _T("AgentName"),
- _T("ParcelDeedToGroup"),
- _T("DirPicksReply"),
- _T("AvatarPicksReply"),
- _T("AgentInfo"),
- _T("MoneyTransferBackend"),
- _T("NextOwnerMask"),
- _T("MuteData"),
- _T("PassPrice"),
- _T("SourceID"),
- _T("TotalScriptTime"),
- _T("ShowMembersInGroupDir"),
- _T("TeleportFlags"),
- _T("AssetData"),
- _T("SlaveParcelData"),
- _T("MultipleObjectUpdate"),
- _T("ObjectUpdate"),
- _T("ImprovedTerseObjectUpdate"),
- _T("ConfirmXferPacket"),
- _T("StartPingCheck"),
- _T("SimWideDeletes"),
- _T("UserListReply"),
- _T("IsPhantom"),
- _T("AgentList"),
- _T("RezObject"),
- _T("TaskLocalID"),
- _T("ClaimDate"),
- _T("MergeParcel"),
- _T("Priority"),
- _T("Building"),
- _T("QueryText"),
- _T("ReturnType"),
- _T("FetchFolders"),
- _T("SimulatorPublicHostBlock"),
- _T("HeaderData"),
- _T("GroupBlock"),
- _T("RequestMultipleObjects"),
- _T("RetrieveInstantMessages"),
- _T("DequeueInstantMessages"),
- _T("OpenCircuit"),
- _T("SecureSessionID"),
- _T("CrossedRegion"),
- _T("DirGroupsReply"),
- _T("AvatarGroupsReply"),
- _T("EmailMessageReply"),
- _T("GroupVoteHistoryItemReply"),
- _T("ViewerPosition"),
- _T("Position"),
- _T("ParentEstate"),
- _T("MuteName"),
- _T("StartParcelRename"),
- _T("BulkParcelRename"),
- _T("ParcelRename"),
- _T("ViewerFilename"),
- _T("Positive"),
- _T("UserReportInternal"),
- _T("AvatarPropertiesRequest"),
- _T("ParcelPropertiesRequest"),
- _T("GroupPropertiesRequest"),
- _T("GroupProfileRequest"),
- _T("AgentDataUpdateRequest"),
- _T("PriceObjectScaleFactor"),
- _T("DirPicksQuery"),
- _T("OpenEnrollment"),
- _T("GroupData"),
- _T("PauseBlock"),
- _T("RequestGodlikePowers"),
- _T("GrantGodlikePowers"),
- _T("TransactionID"),
- _T("DestinationID"),
- _T("Controls"),
- _T("FirstDetachAll"),
- _T("EstateID"),
- _T("ImprovedInstantMessage"),
- _T("AgentQuit"),
- _T("WantToFlags"),
- _T("CheckParcelSales"),
- _T("ParcelSales"),
- _T("CurrentInterval"),
- _T("PriceRentLight"),
- _T("MediaAutoScale"),
- _T("NeighborBlock"),
- _T("LayerData"),
- _T("NVPairData"),
- _T("TeleportLocal"),
- _T("LayersPaused"),
- _T("VoteInitiator"),
- _T("MailPingBounce"),
- _T("TypeData"),
- _T("OwnerIDs"),
- _T("SystemKickUser"),
- _T("ErrorCode"),
- _T("SLXML_ID"),
- _T("TransactionTime"),
- _T("TimeToLive"),
- _T("StartParcelRemove"),
- _T("BulkParcelRemove"),
- _T("DirGroupsQuery"),
- _T("BonusEstimate"),
- _T("MusicURL"),
- _T("CompleteLure"),
- _T("ParcelPrimBonus"),
- _T("EjectUser"),
- _T("CoarseLocationUpdate"),
- _T("ChildAgentPositionUpdate"),
- _T("GroupIndex"),
- _T("GroupName"),
- _T("PriceParcelRent"),
- _T("SimStatus"),
- _T("TransactionSuccess"),
- _T("LureType"),
- _T("GroupMask"),
- _T("SitObject"),
- _T("AssetNum"),
- _T("Override"),
- _T("LocomotionState"),
- _T("PriceUpload"),
- _T("RemoveParcel"),
- _T("ConfirmAuctionStart"),
- _T("RpcScriptRequestInbound"),
- _T("ParcelReturnObjects"),
- _T("TotalObjects"),
- _T("ObjectExtraParams"),
- _T("Questions"),
- _T("TransferAbort"),
- _T("TransferInventory"),
- _T("LandScriptsReply"),
- _T("Collada_ID"),
- _T("RayTargetID"),
- _T("ClaimPrice"),
- _T("ObjectProperties"),
- _T("ParcelProperties"),
- _T("LogoutRequest"),
- _T("AssetUploadRequest"),
- _T("ReputationIndividualRequest"),
- _T("MajorVersion"),
- _T("MinorVersion"),
- _T("SimulatorAssign"),
- _T("TransactionType"),
- _T("AvatarPropertiesUpdate"),
- _T("ParcelPropertiesUpdate"),
- _T("FetchItems"),
- _T("AbortXfer"),
- _T("DeRezAck"),
- _T("TakeControls"),
- _T("DirLandReply"),
- _T("SpaceLocationTeleportReply"),
- _T("MuteType"),
- _T("IMViaEMail"),
- _T("StartExpungeProcessAck"),
- _T("RentPrice"),
- _T("GenericMessage"),
- _T("ChildAgentAlive"),
- _T("SpawnPointBlock"),
- _T("AttachmentBlock"),
- _T("RecallData"),
- _T("OfficerData"),
- _T("GroupOfficer"),
- _T("ObjectMaterial"),
- _T("OwnerName"),
- _T("AvatarNotesReply"),
- _T("CacheID"),
- _T("OwnerMask"),
- _T("TransferInventoryAck"),
- NULL
-};
+#include "StdAfx.h"
+#include ".\keywords.h"
+
+TCHAR *LLTYPES[] = {
+ _T("U8"),
+ _T("U16"),
+ _T("U32"),
+ _T("U64"),
+ _T("S8"),
+ _T("S16"),
+ _T("S32"),
+ _T("S64"),
+ _T("F8"),
+ _T("F16"),
+ _T("F32"),
+ _T("F64"),
+ _T("LLUUID"),
+ _T("BOOL"),
+ _T("LLVector3"),
+ _T("LLVector3d"),
+ _T("LLQuaternion"),
+ _T("IPADDR"),
+ _T("IPPORT"),
+ _T("Variable"),
+ _T("Fixed"),
+ _T("Single"),
+ _T("Multiple"),
+ NULL
+};
+
+TCHAR *LLKEYWORDS[] = {
+ _T("SeedCapability"),
+ _T("X"),
+ _T("Y"),
+ _T("Z"),
+ _T("VotedForCandidate"),
+ _T("AddFlags"),
+ _T("Everyone"),
+ _T("ReservedNewbie"),
+ _T("MapData"),
+ _T("AddItem"),
+ _T("MeanCollision"),
+ _T("RezScript"),
+ _T("AvatarSitResponse"),
+ _T("InventoryAssetResponse"),
+ _T("KillObject"),
+ _T("ProposalID"),
+ _T("SerialNum"),
+ _T("Duration"),
+ _T("ScriptQuestion"),
+ _T("AddCircuitCode"),
+ _T("UseCircuitCode"),
+ _T("ViewerCircuitCode"),
+ _T("ScriptAnswerYes"),
+ _T("PartnerID"),
+ _T("DirLandQuery"),
+ _T("TeleportStart"),
+ _T("EmpoweredBlock"),
+ _T("LogMessages"),
+ _T("DropGroupIM"),
+ _T("AboutText"),
+ _T("VisualParam"),
+ _T("GroupPrims"),
+ _T("SelectedPrims"),
+ _T("ID"),
+ _T("UUIDNameRequest"),
+ _T("UUIDGroupNameRequest"),
+ _T("MoneyTransactionsRequest"),
+ _T("GroupAccountTransactionsRequest"),
+ _T("MapNameRequest"),
+ _T("MailTaskSimRequest"),
+ _T("LandScriptsRequest"),
+ _T("UpdateSimulator"),
+ _T("BillableFactor"),
+ _T("ObjectBonusFactor"),
+ _T("EnableSimulator"),
+ _T("DisableSimulator"),
+ _T("ConfirmEnableSimulator"),
+ _T("LayerType"),
+ _T("ParcelOverlay"),
+ _T("AdjustBalance"),
+ _T("GroupOwned"),
+ _T("IP"),
+ _T("ChatFromViewer"),
+ _T("FirstLogin"),
+ _T("GroupTitle"),
+ _T("MapLayerReply"),
+ _T("CompoundMsgID"),
+ _T("CameraConstraint"),
+ _T("DownloadTotals"),
+ _T("ErrorValue"),
+ _T("GenCounter"),
+ _T("FrozenData"),
+ _T("URLBlock"),
+ _T("ChildAgentDying"),
+ _T("To"),
+ _T("ParcelDirFeeCurrent"),
+ _T("ObjectDuplicate"),
+ _T("InventoryData"),
+ _T("ReplyData"),
+ _T("ResetList"),
+ _T("SimulatorPauseState"),
+ _T("MediaID"),
+ _T("RedirectGridX"),
+ _T("RedirectGridY"),
+ _T("TransferID"),
+ _T("Transacted"),
+ _T("TexturesChanged"),
+ _T("UserLookAt"),
+ _T("TestBlock1"),
+ _T("SensedData"),
+ _T("UpdateBlock"),
+ _T("EmpoweredID"),
+ _T("ClassifiedGodDelete"),
+ _T("LocationPos"),
+ _T("ObjectGrabUpdate"),
+ _T("TaxDate"),
+ _T("StartDateTime"),
+ _T("ObjectUpdateCached"),
+ _T("Packets"),
+ _T("FailureType"),
+ _T("UpdateGroupInfo"),
+ _T("InventoryFile"),
+ _T("ObjectPermissions"),
+ _T("RevokePermissions"),
+ _T("UpdateFlags"),
+ _T("ObjectExportSelected"),
+ _T("RezSelected"),
+ _T("AutoPilot"),
+ _T("UpdateMuteListEntry"),
+ _T("RemoveMuteListEntry"),
+ _T("SetSimStatusInDatabase"),
+ _T("SetSimPresenceInDatabase"),
+ _T("CameraProperty"),
+ _T("GroupRecallBallot"),
+ _T("BrushSize"),
+ _T("StartExpungeProcess"),
+ _T("SimulatorSetMap"),
+ _T("RegionPresenceRequestByRegionID"),
+ _T("TransferEnergy"),
+ _T("ParcelObjectOwnersReply"),
+ _T("GroupMembersReply"),
+ _T("GroupOfficersAndMembersReply"),
+ _T("RequestRegionInfo"),
+ _T("AABBMax"),
+ _T("RequestPayPrice"),
+ _T("SimulatorPresentAtLocation"),
+ _T("AgentRequestSit"),
+ _T("AABBMin"),
+ _T("ClassifiedFlags"),
+ _T("ControlFlags"),
+ _T("TeleportRequest"),
+ _T("SpaceLocationTeleportRequest"),
+ _T("LeaderBoardRequest"),
+ _T("ScriptTeleportRequest"),
+ _T("DateUTC"),
+ _T("TaskIDs"),
+ _T("RequestResult"),
+ _T("ReputationAgentAssign"),
+ _T("CanAcceptAgents"),
+ _T("ObjectSaleInfo"),
+ _T("KillChildAgents"),
+ _T("Balance"),
+ _T("DerezContainer"),
+ _T("ObjectData"),
+ _T("CameraAtAxis"),
+ _T("InfoBlock"),
+ _T("OwnershipCost"),
+ _T("AvatarNotesUpdate"),
+ _T("PID"),
+ _T("TimeString"),
+ _T("DirPopularReply"),
+ _T("TerrainHeightRange00"),
+ _T("SimData"),
+ _T("TerrainHeightRange01"),
+ _T("TerrainHeightRange10"),
+ _T("TerrainHeightRange11"),
+ _T("UpdateInventoryItem"),
+ _T("MoveInventoryItem"),
+ _T("CopyInventoryItem"),
+ _T("RemoveInventoryItem"),
+ _T("CreateInventoryItem"),
+ _T("PathTwistBegin"),
+ _T("CRC"),
+ _T("AttachmentPoint"),
+ _T("TelehubBlock"),
+ _T("FOVBlock"),
+ _T("StartLocationData"),
+ _T("PositionData"),
+ _T("TimeSinceLast"),
+ _T("MapImage"),
+ _T("Objects"),
+ _T("URL"),
+ _T("CreationDate"),
+ _T("JointPivot"),
+ _T("RateeID"),
+ _T("FPS"),
+ _T("HasTelehub"),
+ _T("PathEnd"),
+ _T("ScriptDataReply"),
+ _T("MapBlockReply"),
+ _T("PropertiesData"),
+ _T("ViewerEffect"),
+ _T("FreezeUser"),
+ _T("OwnerPrims"),
+ _T("ScriptTime"),
+ _T("ObjectGrab"),
+ _T("ToAgentID"),
+ _T("ProxyBlock"),
+ _T("SimulatorMapUpdate"),
+ _T("TransferPacket"),
+ _T("ObjectName"),
+ _T("OriginalName"),
+ _T("CompletePingCheck"),
+ _T("OnlineStatus"),
+ _T("TrackOnlineStatus"),
+ _T("IgnoreOnlineStatus"),
+ _T("ObjectDrop"),
+ _T("UseBigPackets"),
+ _T("ParcelAccessListReply"),
+ _T("RpcChannelReply"),
+ _T("RegionPresenceResponse"),
+ _T("AgentPresenceResponse"),
+ _T("CharterMember"),
+ _T("EdgeData"),
+ _T("NameData"),
+ _T("RegionPushOverride"),
+ _T("SimName"),
+ _T("UserReport"),
+ _T("DownloadPriority"),
+ _T("ToAgentId"),
+ _T("Mag"),
+ _T("DirPopularQuery"),
+ _T("ParcelPropertiesRequestByID"),
+ _T("ObjectLink"),
+ _T("RpcScriptReplyInbound"),
+ _T("BoardData"),
+ _T("RezData"),
+ _T("RemoveInventoryObjects"),
+ _T("Officer"),
+ _T("GroupProposalBallot"),
+ _T("RPCServerIP"),
+ _T("Far"),
+ _T("GodSessionID"),
+ _T("ViewerDigest"),
+ _T("FLAboutText"),
+ _T("RegionHandshakeReply"),
+ _T("GroupActiveProposalItemReply"),
+ _T("MapItemReply"),
+ _T("Seconds"),
+ _T("UpdateUserInfo"),
+ _T("AggregatePermTexturesOwner"),
+ _T("Set"),
+ _T("Key"),
+ _T("NewName"),
+ _T("AgentID"),
+ _T("OnlineStatusRequest"),
+ _T("DataAgentAccessRequest"),
+ _T("EventNotificationRemoveRequest"),
+ _T("Arc"),
+ _T("NewFolderID"),
+ _T("RegionX"),
+ _T("RegionY"),
+ _T("RequestData"),
+ _T("Msg"),
+ _T("Top"),
+ _T("MiscStats"),
+ _T("Pos"),
+ _T("ImageID"),
+ _T("DataPacket"),
+ _T("ObjectDehinge"),
+ _T("You"),
+ _T("ScriptControlChange"),
+ _T("LoadURL"),
+ _T("SetCPURatio"),
+ _T("NameValueData"),
+ _T("AtomicPassObject"),
+ _T("ViewerFrozenMessage"),
+ _T("HealthMessage"),
+ _T("LogTextMessage"),
+ _T("TimeDilation"),
+ _T("Contribution"),
+ _T("SetGroupContribution"),
+ _T("Offline"),
+ _T("SecPerDay"),
+ _T("Members"),
+ _T("FailedResends"),
+ _T("CameraCenter"),
+ _T("CameraLeftAxis"),
+ _T("ExBlock"),
+ _T("Channel"),
+ _T("NetTest"),
+ _T("DiscardLevel"),
+ _T("LayerID"),
+ _T("RatorID"),
+ _T("GrabOffset"),
+ _T("SimPort"),
+ _T("PricePerMeter"),
+ _T("RegionFlags"),
+ _T("VoteResult"),
+ _T("ParcelDirFeeEstimate"),
+ _T("ModifyBlock"),
+ _T("InventoryBlock"),
+ _T("ReplyBlock"),
+ _T("RequireMask"),
+ _T("ValidUntil"),
+ _T("VelocityInterpolateOn"),
+ _T("ClassifiedDelete"),
+ _T("FLImageID"),
+ _T("AllowPublish"),
+ _T("SitName"),
+ _T("OfficerTitle"),
+ _T("RegionsVisited"),
+ _T("RecallID"),
+ _T("DirClassifiedReply"),
+ _T("AvatarClassifiedReply"),
+ _T("ReputationIndividualReply"),
+ _T("MediaURL"),
+ _T("CompleteAgentMovement"),
+ _T("SpaceIP"),
+ _T("ClassifiedID"),
+ _T("LocalID"),
+ _T("RemoveItem"),
+ _T("LogFailedMoneyTransaction"),
+ _T("ViewerStartAuction"),
+ _T("StartAuction"),
+ _T("NameValueName"),
+ _T("AngVelX"),
+ _T("DuplicateFlags"),
+ _T("AngVelY"),
+ _T("AngVelZ"),
+ _T("TextColor"),
+ _T("SlaveID"),
+ _T("Charter"),
+ _T("TargetBlock"),
+ _T("AlertData"),
+ _T("CheckParcelAuctions"),
+ _T("ParcelAuctions"),
+ _T("NameValuePair"),
+ _T("RemoveNameValuePair"),
+ _T("GetNameValuePair"),
+ _T("BulkUpdateInventory"),
+ _T("UpdateTaskInventory"),
+ _T("RemoveTaskInventory"),
+ _T("MoveTaskInventory"),
+ _T("RequestTaskInventory"),
+ _T("ReplyTaskInventory"),
+ _T("DeclineInventory"),
+ _T("AggregatePermInventory"),
+ _T("SimulatorInfo"),
+ _T("MoneyTransactionsReply"),
+ _T("GroupAccountTransactionsReply"),
+ _T("MailTaskSimReply"),
+ _T("WearableData"),
+ _T("StatisticsData"),
+ _T("AccessOK"),
+ _T("Enabled"),
+ _T("Savings"),
+ _T("SimulatorLoad"),
+ _T("InternalRegionIP"),
+ _T("ExternalRegionIP"),
+ _T("CreateGroupRequest"),
+ _T("JoinGroupRequest"),
+ _T("LeaveGroupRequest"),
+ _T("InviteGroupRequest"),
+ _T("LiveHelpGroupRequest"),
+ _T("ServerVersion"),
+ _T("PriceParcelClaimFactor"),
+ _T("BillableArea"),
+ _T("ScriptCount"),
+ _T("ObjectID"),
+ _T("ObjectFlagUpdate"),
+ _T("ActiveOnly"),
+ _T("RequestInventoryAsset"),
+ _T("RedoLand"),
+ _T("TravelAccess"),
+ _T("ChangedGrid"),
+ _T("Details"),
+ _T("LocationX"),
+ _T("SaleType"),
+ _T("ObjectExportReply"),
+ _T("LocationY"),
+ _T("LocationZ"),
+ _T("EconomyData"),
+ _T("HeadRotation"),
+ _T("DeleteOnCompletion"),
+ _T("PublicPort"),
+ _T("CurrentTaxes"),
+ _T("DirClassifiedQuery"),
+ _T("RequestParcelTransfer"),
+ _T("ObjectCapacity"),
+ _T("RequestID"),
+ _T("GranterName"),
+ _T("RequestXfer"),
+ _T("ObjectTaxCurrent"),
+ _T("LightTaxCurrent"),
+ _T("LandTaxCurrent"),
+ _T("GroupTaxCurrent"),
+ _T("FetchInventoryDescendents"),
+ _T("InventoryDescendents"),
+ _T("Descendents"),
+ _T("PurgeInventoryDescendents"),
+ _T("ShowDir"),
+ _T("Timestamp"),
+ _T("GlobalPos"),
+ _T("LimitedToEstate"),
+ _T("GrabOffsetInitial"),
+ _T("IsTrial"),
+ _T("FinalizeLogout"),
+ _T("ObjectDuplicateOnRay"),
+ _T("GroupMembershipCount"),
+ _T("MethodData"),
+ _T("ActivateGestures"),
+ _T("DeactivateGestures"),
+ _T("ProposalData"),
+ _T("PosGlobal"),
+ _T("SearchID"),
+ _T("RezMultipleAttachmentsFromInv"),
+ _T("SearchName"),
+ _T("VersionString"),
+ _T("CreateGroupReply"),
+ _T("ActualArea"),
+ _T("RevokedID"),
+ _T("Message"),
+ _T("ClickAction"),
+ _T("AssetUploadComplete"),
+ _T("EstimatedTaxes"),
+ _T("RequestType"),
+ _T("UUID"),
+ _T("BaseMask"),
+ _T("NetBlock"),
+ _T("GlobalX"),
+ _T("GlobalY"),
+ _T("CopyRotates"),
+ _T("KickUserAck"),
+ _T("TopPick"),
+ _T("SessionID"),
+ _T("GlobalZ"),
+ _T("CallVote"),
+ _T("DeclineFriendship"),
+ _T("FormFriendship"),
+ _T("TerminateFriendship"),
+ _T("TaskData"),
+ _T("SimWideMaxPrims"),
+ _T("TotalPrims"),
+ _T("SourceFilename"),
+ _T("ProfileBegin"),
+ _T("MoneyDetailsRequest"),
+ _T("Request"),
+ _T("GroupAccountDetailsRequest"),
+ _T("GroupActiveProposalsRequest"),
+ _T("VoteQuorum"),
+ _T("StringValue"),
+ _T("ClosestSimulator"),
+ _T("Version"),
+ _T("OtherCount"),
+ _T("ChatData"),
+ _T("IsGroupOwned"),
+ _T("EnergyEfficiency"),
+ _T("MaxPlace"),
+ _T("PickInfoUpdate"),
+ _T("PickDelete"),
+ _T("ScriptReset"),
+ _T("Requester"),
+ _T("RevokerID"),
+ _T("ElectionID"),
+ _T("ForSale"),
+ _T("NearestLandingRegionReply"),
+ _T("RecordAgentPresence"),
+ _T("EraseAgentPresence"),
+ _T("ParcelID"),
+ _T("Godlike"),
+ _T("TotalDebits"),
+ _T("Direction"),
+ _T("Appearance"),
+ _T("HealthData"),
+ _T("LeftAxis"),
+ _T("PositionBlock"),
+ _T("LocationBlock"),
+ _T("ObjectImage"),
+ _T("TerrainStartHeight00"),
+ _T("TerrainStartHeight01"),
+ _T("TerrainStartHeight10"),
+ _T("ObjectHinge"),
+ _T("TerrainStartHeight11"),
+ _T("MetersPerGrid"),
+ _T("WaterHeight"),
+ _T("FetchInventoryReply"),
+ _T("MoneySummaryReply"),
+ _T("GroupAccountSummaryReply"),
+ _T("AttachedSound"),
+ _T("ParamInUse"),
+ _T("GodKickUser"),
+ _T("PickName"),
+ _T("TaskName"),
+ _T("SkillFlags"),
+ _T("ParcelGodReserveForNewbie"),
+ _T("SubType"),
+ _T("ObjectCount"),
+ _T("RegionPresenceRequestByHandle"),
+ _T("RezSingleAttachmentFromInv"),
+ _T("ChildAgentUpdate"),
+ _T("ToID"),
+ _T("ViewerPort"),
+ _T("IsOwnerGroup"),
+ _T("AgentHeightWidth"),
+ _T("VerticalAngle"),
+ _T("WearableType"),
+ _T("AggregatePermNextOwner"),
+ _T("ShowInList"),
+ _T("PositionSuggestion"),
+ _T("UpdateParcel"),
+ _T("ClearAgentSessions"),
+ _T("SetAlwaysRun"),
+ _T("NVPair"),
+ _T("ObjectSpinStart"),
+ _T("UseEstateSun"),
+ _T("LogoutBlock"),
+ _T("RelayLogControl"),
+ _T("RegionID"),
+ _T("Creator"),
+ _T("ViewerRegion"),
+ _T("ProposalText"),
+ _T("DirEventsReply"),
+ _T("EventInfoReply"),
+ _T("GroupElectionInfoReply"),
+ _T("UserInfoReply"),
+ _T("PathRadiusOffset"),
+ _T("SessionInfo"),
+ _T("TextureData"),
+ _T("ChatPass"),
+ _T("TargetID"),
+ _T("DefaultPayPrice"),
+ _T("UserLocation"),
+ _T("MaxPrims"),
+ _T("RegionIP"),
+ _T("LandmarkID"),
+ _T("InitiateDownload"),
+ _T("Name"),
+ _T("OtherCleanTime"),
+ _T("TeleportPriceExponent"),
+ _T("Gain"),
+ _T("VelX"),
+ _T("PacketAck"),
+ _T("PathSkew"),
+ _T("Negative"),
+ _T("VelY"),
+ _T("SimulatorShutdownRequest"),
+ _T("NearestLandingRegionRequest"),
+ _T("VelZ"),
+ _T("OtherID"),
+ _T("MapLayerRequest"),
+ _T("PatchVersion"),
+ _T("ObjectScale"),
+ _T("TargetIP"),
+ _T("Redo"),
+ _T("MoneyBalance"),
+ _T("TrackAgent"),
+ _T("MaxX"),
+ _T("Data"),
+ _T("MaxY"),
+ _T("TextureAnim"),
+ _T("ReturnIDs"),
+ _T("Date"),
+ _T("GestureUpdate"),
+ _T("AgentWearablesUpdate"),
+ _T("AgentDataUpdate"),
+ _T("Hash"),
+ _T("Left"),
+ _T("Mask"),
+ _T("ForceMouselook"),
+ _T("RequestLocationGetAccess"),
+ _T("Success"),
+ _T("ObjectGroup"),
+ _T("SunHour"),
+ _T("MinX"),
+ _T("ScriptSensorReply"),
+ _T("MinY"),
+ _T("Command"),
+ _T("Desc"),
+ _T("AttachmentNeedsSave"),
+ _T("HistoryItemData"),
+ _T("AgentCachedTexture"),
+ _T("East"),
+ _T("Subject"),
+ _T("GodExpungeUser"),
+ _T("QueryReplies"),
+ _T("ObjectCategory"),
+ _T("Time"),
+ _T("CreateLandmarkForEvent"),
+ _T("ParentID"),
+ _T("Ping"),
+ _T("Perp"),
+ _T("Code"),
+ _T("InvType"),
+ _T("AgentFOV"),
+ _T("BulkMoneyTransfer"),
+ _T("Audible"),
+ _T("AuctionData"),
+ _T("IDBlock"),
+ _T("ReputationData"),
+ _T("West"),
+ _T("ElectionData"),
+ _T("Undo"),
+ _T("Info"),
+ _T("Area"),
+ _T("Behavior"),
+ _T("SimCrashed"),
+ _T("Text"),
+ _T("AgentToNewRegion"),
+ _T("PriceGroupCreate"),
+ _T("ObjectShape"),
+ _T("PosX"),
+ _T("PosY"),
+ _T("MuteCRC"),
+ _T("PosZ"),
+ _T("Size"),
+ _T("FromAddress"),
+ _T("Body"),
+ _T("FileData"),
+ _T("List"),
+ _T("KickUser"),
+ _T("OtherPrims"),
+ _T("RunTime"),
+ _T("RpcScriptRequestInboundForward"),
+ _T("More"),
+ _T("Majority"),
+ _T("SenderID"),
+ _T("MetersTraveled"),
+ _T("Stat"),
+ _T("FromAgentID"),
+ _T("Item"),
+ _T("SoundID"),
+ _T("User"),
+ _T("RemoteInfos"),
+ _T("Vote"),
+ _T("Prey"),
+ _T("UsecSinceStart"),
+ _T("RayStart"),
+ _T("ParcelData"),
+ _T("CameraUpAxis"),
+ _T("ScriptDialog"),
+ _T("MasterParcelData"),
+ _T("Invalid"),
+ _T("MinPlace"),
+ _T("ProfileCurve"),
+ _T("ParcelAccessListUpdate"),
+ _T("MuteListUpdate"),
+ _T("SendPacket"),
+ _T("SendXferPacket"),
+ _T("LastName"),
+ _T("From"),
+ _T("Port"),
+ _T("MemberTitle"),
+ _T("LogParcelChanges"),
+ _T("DeRezObject"),
+ _T("IsTemporary"),
+ _T("IsComplete"),
+ _T("InsigniaID"),
+ _T("CheckFlags"),
+ _T("TransferPriority"),
+ _T("EventID"),
+ _T("FromAgentId"),
+ _T("Type"),
+ _T("ChatType"),
+ _T("ReportData"),
+ _T("LeaderBoardData"),
+ _T("RequestBlock"),
+ _T("GrantData"),
+ _T("DetachAttachmentIntoInv"),
+ _T("ParcelDisableObjects"),
+ _T("Sections"),
+ _T("GodLevel"),
+ _T("StartGroupIM"),
+ _T("PayPriceReply"),
+ _T("QueryID"),
+ _T("CameraEyeOffset"),
+ _T("AgentPosition"),
+ _T("GrabPosition"),
+ _T("GrantModification"),
+ _T("RevokeModification"),
+ _T("OnlineNotification"),
+ _T("OfflineNotification"),
+ _T("SendPostcard"),
+ _T("RequestFlags"),
+ _T("MoneyHistoryRequest"),
+ _T("MoneySummaryRequest"),
+ _T("GroupMoneyHistoryRequest"),
+ _T("GroupAccountSummaryRequest"),
+ _T("ParamValue"),
+ _T("GroupVoteHistoryRequest"),
+ _T("Checksum"),
+ _T("MaxAgents"),
+ _T("CreateNewOutfitAttachments"),
+ _T("RegionHandle"),
+ _T("TeleportProgress"),
+ _T("AgentQuitCopy"),
+ _T("LocationValid"),
+ _T("ToViewer"),
+ _T("ParcelName"),
+ _T("InviteOfficers"),
+ _T("PriceObjectRent"),
+ _T("ConnectAgentToUserserver"),
+ _T("ConnectToUserserver"),
+ _T("OfferCallingCard"),
+ _T("AgentAccess"),
+ _T("AcceptCallingCard"),
+ _T("DeclineCallingCard"),
+ _T("DataHomeLocationReply"),
+ _T("EventLocationReply"),
+ _T("UserLoginLocationReply"),
+ _T("UserSimLocationReply"),
+ _T("SpaceLoginLocationReply"),
+ _T("TerseDateID"),
+ _T("ObjectOwner"),
+ _T("AssetID"),
+ _T("AlertMessage"),
+ _T("AgentAlertMessage"),
+ _T("EstateOwnerMessage"),
+ _T("ParcelMediaCommandMessage"),
+ _T("Auction"),
+ _T("Category"),
+ _T("FilePath"),
+ _T("ItemFlags"),
+ _T("Invoice"),
+ _T("IntervalDays"),
+ _T("PathScaleX"),
+ _T("FromTaskID"),
+ _T("TimeInfo"),
+ _T("PathScaleY"),
+ _T("PublicCount"),
+ _T("ParcelJoin"),
+ _T("SimulatorBlock"),
+ _T("UserBlock"),
+ _T("GroupID"),
+ _T("AgentVel"),
+ _T("RequestImage"),
+ _T("NetStats"),
+ _T("AgentPos"),
+ _T("AgentSit"),
+ _T("Material"),
+ _T("ObjectDeGrab"),
+ _T("VelocityInterpolateOff"),
+ _T("AuthorizedBuyerID"),
+ _T("RemoveMemberFromGroup"),
+ _T("GroupIM"),
+ _T("AvatarPropertiesReply"),
+ _T("GroupPropertiesReply"),
+ _T("GroupProfileReply"),
+ _T("Participants"),
+ _T("SimOwner"),
+ _T("SalePrice"),
+ _T("Animation"),
+ _T("CurrentDividend"),
+ _T("OwnerID"),
+ _T("NearestLandingRegionUpdated"),
+ _T("PassToAgent"),
+ _T("PreyAgent"),
+ _T("SimStats"),
+ _T("Options"),
+ _T("LogoutReply"),
+ _T("ObjectLocalID"),
+ _T("Dropped"),
+ _T("Destination"),
+ _T("MasterID"),
+ _T("TransferData"),
+ _T("WantToMask"),
+ _T("AvatarData"),
+ _T("ParcelSelectObjects"),
+ _T("ExtraParams"),
+ _T("LogLogin"),
+ _T("CreatorID"),
+ _T("Summary"),
+ _T("BuyObjectInventory"),
+ _T("FetchInventory"),
+ _T("InventoryID"),
+ _T("PacketNumber"),
+ _T("SetFollowCamProperties"),
+ _T("ClearFollowCamProperties"),
+ _T("SimulatorThrottleSettings"),
+ _T("SequenceID"),
+ _T("DataServerLogout"),
+ _T("NameValue"),
+ _T("PathShearX"),
+ _T("PathShearY"),
+ _T("ElectionType"),
+ _T("Velocity"),
+ _T("SecPerYear"),
+ _T("FirstName"),
+ _T("AttachedSoundGainChange"),
+ _T("LocationID"),
+ _T("Running"),
+ _T("ObjectImportReply"),
+ _T("AgentThrottle"),
+ _T("NeighborList"),
+ _T("PathTaperX"),
+ _T("PathTaperY"),
+ _T("GranterBlock"),
+ _T("UseCachedMuteList"),
+ _T("FailStats"),
+ _T("StartGroupRecall"),
+ _T("Tempfile"),
+ _T("FounderName"),
+ _T("BuyerID"),
+ _T("DirPeopleReply"),
+ _T("TransferInfo"),
+ _T("AvatarPickerRequestBackend"),
+ _T("AvatarPropertiesRequestBackend"),
+ _T("UpdateData"),
+ _T("ReporterID"),
+ _T("GranterID"),
+ _T("ButtonLabel"),
+ _T("WantToText"),
+ _T("ReportType"),
+ _T("DataBlock"),
+ _T("SimulatorReady"),
+ _T("AnimationSourceList"),
+ _T("RefreshViewer"),
+ _T("SubscribeLoad"),
+ _T("UnsubscribeLoad"),
+ _T("Packet"),
+ _T("UndoLand"),
+ _T("SimAccess"),
+ _T("MembershipFee"),
+ _T("CreateInventoryFolder"),
+ _T("UpdateInventoryFolder"),
+ _T("MoveInventoryFolder"),
+ _T("RemoveInventoryFolder"),
+ _T("MoneyData"),
+ _T("ObjectDeselect"),
+ _T("NewAssetID"),
+ _T("ObjectAdd"),
+ _T("RayEndIsIntersection"),
+ _T("CompleteAuction"),
+ _T("CircuitCode"),
+ _T("AgentMovementComplete"),
+ _T("ViewerIP"),
+ _T("Header"),
+ _T("GestureFlags"),
+ _T("XferID"),
+ _T("StatValue"),
+ _T("PickID"),
+ _T("TaskID"),
+ _T("GridsPerEdge"),
+ _T("RayEnd"),
+ _T("Throttles"),
+ _T("UpAxis"),
+ _T("AgentTextures"),
+ _T("Radius"),
+ _T("OffCircuit"),
+ _T("Access"),
+ _T("SquareMetersCredit"),
+ _T("Filename"),
+ _T("SecuredTemplateChecksumRequest"),
+ _T("TemplateChecksumRequest"),
+ _T("AgentPresenceRequest"),
+ _T("ClassifiedInfoRequest"),
+ _T("ParcelInfoRequest"),
+ _T("ParcelObjectOwnersRequest"),
+ _T("TeleportLandmarkRequest"),
+ _T("EventInfoRequest"),
+ _T("MovedIntoSimulator"),
+ _T("ChatFromSimulator"),
+ _T("PickInfoRequest"),
+ _T("MoneyBalanceRequest"),
+ _T("DirPeopleQuery"),
+ _T("GroupElectionInfoRequest"),
+ _T("GroupMembersRequest"),
+ _T("GroupOfficersAndMembersRequest"),
+ _T("TextureID"),
+ _T("OldFolderID"),
+ _T("UserInfoRequest"),
+ _T("LandCollidersRequest"),
+ _T("Handle"),
+ _T("StartParcelRenameAck"),
+ _T("StateLoad"),
+ _T("ButtonIndex"),
+ _T("CurrentElectionID"),
+ _T("GetScriptRunning"),
+ _T("SetScriptRunning"),
+ _T("Health"),
+ _T("FileID"),
+ _T("CircuitInfo"),
+ _T("ObjectBuy"),
+ _T("ProfileEnd"),
+ _T("Effect"),
+ _T("TestMessage"),
+ _T("ScriptMailRegistration"),
+ _T("AgentSetAppearance"),
+ _T("AvatarAppearance"),
+ _T("RegionData"),
+ _T("RequestingRegionData"),
+ _T("LandingRegionData"),
+ _T("SitTransform"),
+ _T("TerrainBase0"),
+ _T("SkillsMask"),
+ _T("AtAxis"),
+ _T("TerrainBase1"),
+ _T("Reason"),
+ _T("TerrainBase2"),
+ _T("TerrainBase3"),
+ _T("Params"),
+ _T("PingID"),
+ _T("Height"),
+ _T("Region"),
+ _T("MoneyHistoryReply"),
+ _T("GroupMoneyHistoryReply"),
+ _T("TelehubInfo"),
+ _T("StateSave"),
+ _T("AgentAnimation"),
+ _T("AvatarAnimation"),
+ _T("LogDwellTime"),
+ _T("ParcelGodMarkAsContent"),
+ _T("UsePhysics"),
+ _T("JointType"),
+ _T("TaxEstimate"),
+ _T("ObjectTaxEstimate"),
+ _T("LightTaxEstimate"),
+ _T("TeleportLandingStatusChanged"),
+ _T("LandTaxEstimate"),
+ _T("GroupTaxEstimate"),
+ _T("Buttons"),
+ _T("Sender"),
+ _T("Dialog"),
+ _T("DestID"),
+ _T("PricePublicObjectDelete"),
+ _T("ObjectDelete"),
+ _T("Delete"),
+ _T("EventGodDelete"),
+ _T("LastTaxDate"),
+ _T("MapImageID"),
+ _T("EndDateTime"),
+ _T("TerrainDetail0"),
+ _T("TerrainDetail1"),
+ _T("TerrainDetail2"),
+ _T("TerrainDetail3"),
+ _T("Offset"),
+ _T("ObjectDelink"),
+ _T("TargetObject"),
+ _T("IsEstateManager"),
+ _T("CancelAuction"),
+ _T("ObjectDetach"),
+ _T("Compressed"),
+ _T("PathBegin"),
+ _T("BypassRaycast"),
+ _T("WinnerID"),
+ _T("ChannelType"),
+ _T("NumberNonExemptMembers"),
+ _T("NonExemptMembers"),
+ _T("Agents"),
+ _T("SimulatorStart"),
+ _T("Enable"),
+ _T("RevokedBlock"),
+ _T("MemberData"),
+ _T("ImageNotInDatabase"),
+ _T("StartDate"),
+ _T("AnimID"),
+ _T("Serial"),
+ _T("GroupElectionBallot"),
+ _T("ControlPort"),
+ _T("ModifyLand"),
+ _T("Digest"),
+ _T("Victim"),
+ _T("Script"),
+ _T("TemplateChecksumReply"),
+ _T("PickInfoReply"),
+ _T("MoneyBalanceReply"),
+ _T("RoutedMoneyBalanceReply"),
+ _T("RegionInfo"),
+ _T("Sequence"),
+ _T("GodUpdateRegionInfo"),
+ _T("LocalX"),
+ _T("LocalY"),
+ _T("StartAnim"),
+ _T("Location"),
+ _T("Action"),
+ _T("SearchDir"),
+ _T("Active"),
+ _T("TransferRequest"),
+ _T("ScriptSensorRequest"),
+ _T("MoneyTransferRequest"),
+ _T("EjectGroupMemberRequest"),
+ _T("SkillsText"),
+ _T("Resent"),
+ _T("Center"),
+ _T("SharedData"),
+ _T("PSBlock"),
+ _T("UUIDNameBlock"),
+ _T("Viewer"),
+ _T("Method"),
+ _T("TouchName"),
+ _T("CandidateID"),
+ _T("ParamData"),
+ _T("GodlikeMessage"),
+ _T("SystemMessage"),
+ _T("BodyRotation"),
+ _T("StartGroupElection"),
+ _T("SearchRegions"),
+ _T("Ignore"),
+ _T("AnimationData"),
+ _T("StatID"),
+ _T("ItemID"),
+ _T("AvatarStatisticsReply"),
+ _T("ScriptDialogReply"),
+ _T("RegionIDAndHandleReply"),
+ _T("CameraAtOffset"),
+ _T("VoteID"),
+ _T("ParcelGodForceOwner"),
+ _T("InviteData"),
+ _T("CandidateData"),
+ _T("PCode"),
+ _T("SearchPos"),
+ _T("PreyID"),
+ _T("TerrainLowerLimit"),
+ _T("EventFlags"),
+ _T("TallyVotes"),
+ _T("GroupInfoUpdated"),
+ _T("Result"),
+ _T("LookAt"),
+ _T("PayButton"),
+ _T("SelfCount"),
+ _T("PacketCount"),
+ _T("ParcelBuyPass"),
+ _T("SimHandle"),
+ _T("Identified"),
+ _T("OldItemID"),
+ _T("RegionPort"),
+ _T("PriceEnergyUnit"),
+ _T("Bitmap"),
+ _T("TrackAgentSession"),
+ _T("CacheMissType"),
+ _T("VFileID"),
+ _T("Response"),
+ _T("GroupInsigniaID"),
+ _T("FromID"),
+ _T("Online"),
+ _T("KickFlags"),
+ _T("SysCPU"),
+ _T("EMail"),
+ _T("InviteMembers"),
+ _T("IncludeMembers"),
+ _T("AggregatePermTextures"),
+ _T("ChatChannel"),
+ _T("ReturnID"),
+ _T("ObjectAttach"),
+ _T("TargetPort"),
+ _T("ObjectSpinStop"),
+ _T("FullID"),
+ _T("ActivateGroup"),
+ _T("SysGPU"),
+ _T("StartLure"),
+ _T("SysRAM"),
+ _T("ObjectPosition"),
+ _T("SitPosition"),
+ _T("StartTime"),
+ _T("BornOn"),
+ _T("CameraCollidePlane"),
+ _T("EconomyDataRequest"),
+ _T("TeleportLureRequest"),
+ _T("FolderID"),
+ _T("RegionHandleRequest"),
+ _T("GestureRequest"),
+ _T("ScriptDataRequest"),
+ _T("AgentWearablesRequest"),
+ _T("MapBlockRequest"),
+ _T("LureID"),
+ _T("CopyCenters"),
+ _T("RegisterNewAgent"),
+ _T("TotalColliderCount"),
+ _T("ParamList"),
+ _T("InventorySerial"),
+ _T("EdgeDataPacket"),
+ _T("AvatarPickerReply"),
+ _T("ParcelDwellReply"),
+ _T("IsForSale"),
+ _T("MuteID"),
+ _T("MeanCollisionAlert"),
+ _T("CanAcceptTasks"),
+ _T("ItemData"),
+ _T("AnimationList"),
+ _T("PassObject"),
+ _T("Reputation"),
+ _T("IntValue"),
+ _T("TargetType"),
+ _T("Amount"),
+ _T("UpdateAttachment"),
+ _T("RemoveAttachment"),
+ _T("HeightWidthBlock"),
+ _T("RequestObjectPropertiesFamily"),
+ _T("ObjectPropertiesFamily"),
+ _T("UserData"),
+ _T("SessionBlock"),
+ _T("IsReadable"),
+ _T("ReputationMax"),
+ _T("PathCurve"),
+ _T("ReputationMin"),
+ _T("Status"),
+ _T("AlreadyVoted"),
+ _T("ElectionInitiator"),
+ _T("PlacesReply"),
+ _T("DirPlacesReply"),
+ _T("ParcelBuy"),
+ _T("DirFindQueryBackend"),
+ _T("DirPlacesQueryBackend"),
+ _T("DirPeopleQueryBackend"),
+ _T("DirGroupsQueryBackend"),
+ _T("DirClassifiedQueryBackend"),
+ _T("DirPicksQueryBackend"),
+ _T("DirLandQueryBackend"),
+ _T("DirPopularQueryBackend"),
+ _T("SnapshotID"),
+ _T("Aspect"),
+ _T("LogoutDemand"),
+ _T("HistoryData"),
+ _T("VoteData"),
+ _T("EstimatedDividend"),
+ _T("ParamSize"),
+ _T("VoteCast"),
+ _T("EveryoneMask"),
+ _T("CastsShadows"),
+ _T("SetSunPhase"),
+ _T("ObjectSpinUpdate"),
+ _T("MaturePublish"),
+ _T("UseExistingAsset"),
+ _T("ParcelLocalID"),
+ _T("TeleportCancel"),
+ _T("UnixTime"),
+ _T("QueryFlags"),
+ _T("LastExecFroze"),
+ _T("AlwaysRun"),
+ _T("Bottom"),
+ _T("ButtonData"),
+ _T("SoundData"),
+ _T("ViewerStats"),
+ _T("RegionHandshake"),
+ _T("Description"),
+ _T("ObjectDescription"),
+ _T("ParamType"),
+ _T("UUIDNameReply"),
+ _T("UUIDGroupNameReply"),
+ _T("SaveAssetIntoInventory"),
+ _T("UserInfo"),
+ _T("AnimSequenceID"),
+ _T("NVPairs"),
+ _T("ParcelAccessListRequest"),
+ _T("UserListRequest"),
+ _T("MuteListRequest"),
+ _T("StartPeriod"),
+ _T("RpcChannelRequest"),
+ _T("PlacesQuery"),
+ _T("DirPlacesQuery"),
+ _T("Distance"),
+ _T("SortOrder"),
+ _T("Hunter"),
+ _T("TotalScriptCount"),
+ _T("SunAngVelocity"),
+ _T("InventoryUpdate"),
+ _T("ImagePacket"),
+ _T("BinaryBucket"),
+ _T("StartGroupProposal"),
+ _T("EnergyLevel"),
+ _T("PriceForListing"),
+ _T("Scale"),
+ _T("ParentEstateID"),
+ _T("Extra2"),
+ _T("Throttle"),
+ _T("SimIP"),
+ _T("GodID"),
+ _T("TeleportMinPrice"),
+ _T("VoteItem"),
+ _T("ObjectRotation"),
+ _T("SitRotation"),
+ _T("SnapSelection"),
+ _T("SoundTrigger"),
+ _T("TerrainRaiseLimit"),
+ _T("Quorum"),
+ _T("TokenBlock"),
+ _T("AgentBlock"),
+ _T("CommandBlock"),
+ _T("PricePublicObjectDecay"),
+ _T("SpawnPointPos"),
+ _T("AttachedSoundCutoffRadius"),
+ _T("VolumeDetail"),
+ _T("TasksPaused"),
+ _T("Range"),
+ _T("FromAgentName"),
+ _T("AddModifyAbility"),
+ _T("RemoveModifyAbility"),
+ _T("PublicIP"),
+ _T("TeleportFailed"),
+ _T("OnlineStatusReply"),
+ _T("DataAgentAccessReply"),
+ _T("RequestLocationGetAccessReply"),
+ _T("RequestAvatarInfo"),
+ _T("PreloadSound"),
+ _T("ScreenshotID"),
+ _T("OldestUnacked"),
+ _T("SimulatorIP"),
+ _T("ObjectImport"),
+ _T("MoneyMax"),
+ _T("Value"),
+ _T("JointAxisOrAnchor"),
+ _T("Test0"),
+ _T("MoneyMin"),
+ _T("Test1"),
+ _T("Test2"),
+ _T("SunPhase"),
+ _T("Place"),
+ _T("Phase"),
+ _T("ParcelDivide"),
+ _T("PriceObjectClaim"),
+ _T("VoteTime"),
+ _T("Field"),
+ _T("Ratio"),
+ _T("JoinGroupReply"),
+ _T("LiveHelpGroupReply"),
+ _T("Agent"),
+ _T("Score"),
+ _T("ExpungeData"),
+ _T("Image"),
+ _T("ObjectClickAction"),
+ _T("Delta"),
+ _T("InitiateUpload"),
+ _T("Parameter"),
+ _T("Flags"),
+ _T("Plane"),
+ _T("Width"),
+ _T("VoteText"),
+ _T("Right"),
+ _T("DirFindQuery"),
+ _T("Textures"),
+ _T("EventData"),
+ _T("Final"),
+ _T("TelehubPos"),
+ _T("ReportAutosaveCrash"),
+ _T("Reset"),
+ _T("CreateTrustedCircuit"),
+ _T("DenyTrustedCircuit"),
+ _T("Codec"),
+ _T("Level"),
+ _T("Modal"),
+ _T("ChildAgentUnknown"),
+ _T("LandingType"),
+ _T("ScriptRunningReply"),
+ _T("MoneyDetailsReply"),
+ _T("Reply"),
+ _T("TelehubRot"),
+ _T("RequestFriendship"),
+ _T("AcceptFriendship"),
+ _T("GroupAccountDetailsReply"),
+ _T("DwellInfo"),
+ _T("AgentResume"),
+ _T("ItemType"),
+ _T("MailFilter"),
+ _T("Disconnect"),
+ _T("SimPosition"),
+ _T("SimWideTotalPrims"),
+ _T("Index"),
+ _T("BaseFilename"),
+ _T("SimFilename"),
+ _T("LastOwnerID"),
+ _T("EmailMessageRequest"),
+ _T("MapItemRequest"),
+ _T("AgentCount"),
+ _T("InitializeLure"),
+ _T("HelloBlock"),
+ _T("FuseBlock"),
+ _T("MessageBlock"),
+ _T("ClassifiedInfoUpdate"),
+ _T("RegionPos"),
+ _T("ParcelMediaUpdate"),
+ _T("GridX"),
+ _T("GridY"),
+ _T("AuctionID"),
+ _T("VoteType"),
+ _T("CategoryID"),
+ _T("Token"),
+ _T("AggregatePerms"),
+ _T("StartParcelRemoveAck"),
+ _T("ObjectSelect"),
+ _T("ForceObjectSelect"),
+ _T("Price"),
+ _T("SunDirection"),
+ _T("FromName"),
+ _T("ChangeInventoryItemFlags"),
+ _T("Force"),
+ _T("TransactionBlock"),
+ _T("PowersMask"),
+ _T("Stamp"),
+ _T("RelatedID"),
+ _T("TotalCredits"),
+ _T("State"),
+ _T("TextureIndex"),
+ _T("SimPaused"),
+ _T("InviteeID"),
+ _T("ParcelReclaim"),
+ _T("Money"),
+ _T("PathTwist"),
+ _T("AuthBuyerID"),
+ _T("Color"),
+ _T("SourceType"),
+ _T("World"),
+ _T("QueryData"),
+ _T("Users"),
+ _T("SysOS"),
+ _T("Notes"),
+ _T("AvatarID"),
+ _T("FounderID"),
+ _T("EndPointID"),
+ _T("StipendEstimate"),
+ _T("LocationLookAt"),
+ _T("Sound"),
+ _T("Cover"),
+ _T("TextureEntry"),
+ _T("SquareMetersCommitted"),
+ _T("ChannelID"),
+ _T("Dwell"),
+ _T("North"),
+ _T("AgentUpdate"),
+ _T("PickGodDelete"),
+ _T("UpdateInventoryItemAsset"),
+ _T("HostName"),
+ _T("PriceParcelClaim"),
+ _T("ParcelClaim"),
+ _T("ProfileHollow"),
+ _T("Count"),
+ _T("South"),
+ _T("Entry"),
+ _T("ObjectUpdateCompressed"),
+ _T("MuteFlags"),
+ _T("Group"),
+ _T("AgentPause"),
+ _T("InternalScriptMail"),
+ _T("FindAgent"),
+ _T("AgentData"),
+ _T("FolderData"),
+ _T("AssetBlock"),
+ _T("CloseCircuit"),
+ _T("LogControl"),
+ _T("TeleportFinish"),
+ _T("PathRevolutions"),
+ _T("ClassifiedInfoReply"),
+ _T("ParcelInfoReply"),
+ _T("LandCollidersReply"),
+ _T("AutosaveData"),
+ _T("SetStartLocation"),
+ _T("PassHours"),
+ _T("AttachmentPt"),
+ _T("ParcelFlags"),
+ _T("NumVotes"),
+ _T("AvatarPickerRequest"),
+ _T("TeleportLocationRequest"),
+ _T("DataHomeLocationRequest"),
+ _T("EventNotificationAddRequest"),
+ _T("ParcelDwellRequest"),
+ _T("ViewerLoginLocationRequest"),
+ _T("ViewerSimLocationRequest"),
+ _T("EventLocationRequest"),
+ _T("EndPeriod"),
+ _T("SetStartLocationRequest"),
+ _T("UserLoginLocationRequest"),
+ _T("QueryStart"),
+ _T("AvatarTextureUpdate"),
+ _T("RequestGrantedProxies"),
+ _T("GrantedProxies"),
+ _T("RPCServerPort"),
+ _T("Bytes"),
+ _T("Extra"),
+ _T("ForceScriptControlRelease"),
+ _T("ParcelRelease"),
+ _T("VFileType"),
+ _T("ImageData"),
+ _T("SpaceServerSimulatorTimeMessage"),
+ _T("SimulatorViewerTimeMessage"),
+ _T("Rotation"),
+ _T("Selection"),
+ _T("TransactionData"),
+ _T("OperationData"),
+ _T("ExpirationDate"),
+ _T("AgentName"),
+ _T("ParcelDeedToGroup"),
+ _T("DirPicksReply"),
+ _T("AvatarPicksReply"),
+ _T("AgentInfo"),
+ _T("MoneyTransferBackend"),
+ _T("NextOwnerMask"),
+ _T("MuteData"),
+ _T("PassPrice"),
+ _T("SourceID"),
+ _T("TotalScriptTime"),
+ _T("ShowMembersInGroupDir"),
+ _T("TeleportFlags"),
+ _T("AssetData"),
+ _T("SlaveParcelData"),
+ _T("MultipleObjectUpdate"),
+ _T("ObjectUpdate"),
+ _T("ImprovedTerseObjectUpdate"),
+ _T("ConfirmXferPacket"),
+ _T("StartPingCheck"),
+ _T("SimWideDeletes"),
+ _T("UserListReply"),
+ _T("IsPhantom"),
+ _T("AgentList"),
+ _T("RezObject"),
+ _T("TaskLocalID"),
+ _T("ClaimDate"),
+ _T("MergeParcel"),
+ _T("Priority"),
+ _T("Building"),
+ _T("QueryText"),
+ _T("ReturnType"),
+ _T("FetchFolders"),
+ _T("SimulatorPublicHostBlock"),
+ _T("HeaderData"),
+ _T("GroupBlock"),
+ _T("RequestMultipleObjects"),
+ _T("RetrieveInstantMessages"),
+ _T("DequeueInstantMessages"),
+ _T("OpenCircuit"),
+ _T("SecureSessionID"),
+ _T("CrossedRegion"),
+ _T("DirGroupsReply"),
+ _T("AvatarGroupsReply"),
+ _T("EmailMessageReply"),
+ _T("GroupVoteHistoryItemReply"),
+ _T("ViewerPosition"),
+ _T("Position"),
+ _T("ParentEstate"),
+ _T("MuteName"),
+ _T("StartParcelRename"),
+ _T("BulkParcelRename"),
+ _T("ParcelRename"),
+ _T("ViewerFilename"),
+ _T("Positive"),
+ _T("UserReportInternal"),
+ _T("AvatarPropertiesRequest"),
+ _T("ParcelPropertiesRequest"),
+ _T("GroupPropertiesRequest"),
+ _T("GroupProfileRequest"),
+ _T("AgentDataUpdateRequest"),
+ _T("PriceObjectScaleFactor"),
+ _T("DirPicksQuery"),
+ _T("OpenEnrollment"),
+ _T("GroupData"),
+ _T("PauseBlock"),
+ _T("RequestGodlikePowers"),
+ _T("GrantGodlikePowers"),
+ _T("TransactionID"),
+ _T("DestinationID"),
+ _T("Controls"),
+ _T("FirstDetachAll"),
+ _T("EstateID"),
+ _T("ImprovedInstantMessage"),
+ _T("AgentQuit"),
+ _T("WantToFlags"),
+ _T("CheckParcelSales"),
+ _T("ParcelSales"),
+ _T("CurrentInterval"),
+ _T("PriceRentLight"),
+ _T("MediaAutoScale"),
+ _T("NeighborBlock"),
+ _T("LayerData"),
+ _T("NVPairData"),
+ _T("TeleportLocal"),
+ _T("LayersPaused"),
+ _T("VoteInitiator"),
+ _T("MailPingBounce"),
+ _T("TypeData"),
+ _T("OwnerIDs"),
+ _T("SystemKickUser"),
+ _T("ErrorCode"),
+ _T("SLXML_ID"),
+ _T("TransactionTime"),
+ _T("TimeToLive"),
+ _T("StartParcelRemove"),
+ _T("BulkParcelRemove"),
+ _T("DirGroupsQuery"),
+ _T("BonusEstimate"),
+ _T("MusicURL"),
+ _T("CompleteLure"),
+ _T("ParcelPrimBonus"),
+ _T("EjectUser"),
+ _T("CoarseLocationUpdate"),
+ _T("ChildAgentPositionUpdate"),
+ _T("GroupIndex"),
+ _T("GroupName"),
+ _T("PriceParcelRent"),
+ _T("SimStatus"),
+ _T("TransactionSuccess"),
+ _T("LureType"),
+ _T("GroupMask"),
+ _T("SitObject"),
+ _T("AssetNum"),
+ _T("Override"),
+ _T("LocomotionState"),
+ _T("PriceUpload"),
+ _T("RemoveParcel"),
+ _T("ConfirmAuctionStart"),
+ _T("RpcScriptRequestInbound"),
+ _T("ParcelReturnObjects"),
+ _T("TotalObjects"),
+ _T("ObjectExtraParams"),
+ _T("Questions"),
+ _T("TransferAbort"),
+ _T("TransferInventory"),
+ _T("LandScriptsReply"),
+ _T("Collada_ID"),
+ _T("RayTargetID"),
+ _T("ClaimPrice"),
+ _T("ObjectProperties"),
+ _T("ParcelProperties"),
+ _T("LogoutRequest"),
+ _T("AssetUploadRequest"),
+ _T("ReputationIndividualRequest"),
+ _T("MajorVersion"),
+ _T("MinorVersion"),
+ _T("SimulatorAssign"),
+ _T("TransactionType"),
+ _T("AvatarPropertiesUpdate"),
+ _T("ParcelPropertiesUpdate"),
+ _T("FetchItems"),
+ _T("AbortXfer"),
+ _T("DeRezAck"),
+ _T("TakeControls"),
+ _T("DirLandReply"),
+ _T("SpaceLocationTeleportReply"),
+ _T("MuteType"),
+ _T("IMViaEMail"),
+ _T("StartExpungeProcessAck"),
+ _T("RentPrice"),
+ _T("GenericMessage"),
+ _T("ChildAgentAlive"),
+ _T("SpawnPointBlock"),
+ _T("AttachmentBlock"),
+ _T("RecallData"),
+ _T("OfficerData"),
+ _T("GroupOfficer"),
+ _T("ObjectMaterial"),
+ _T("OwnerName"),
+ _T("AvatarNotesReply"),
+ _T("CacheID"),
+ _T("OwnerMask"),
+ _T("TransferInventoryAck"),
+ NULL
+};
diff --git a/applications/snowcrash/snowflake/keywords.h b/applications/snowcrash/snowflake/keywords.h
index 9e877ee6..78365a45 100644
--- a/applications/snowcrash/snowflake/keywords.h
+++ b/applications/snowcrash/snowflake/keywords.h
@@ -1,32 +1,32 @@
-#pragma once
-
-enum LLTYPES
-{
- LLTYPE_U8,
- LLTYPE_U16,
- LLTYPE_U32,
- LLTYPE_U64,
- LLTYPE_S8,
- LLTYPE_S16,
- LLTYPE_S32,
- LLTYPE_S64,
- LLTYPE_F8,
- LLTYPE_F16,
- LLTYPE_F32,
- LLTYPE_F64,
- LLTYPE_LLUUID,
- LLTYPE_BOOL,
- LLTYPE_LLVECTOR3,
- LLTYPE_LLVECTOR3D,
- LLTYPE_QUATERNION,
- LLTYPE_IPADDR,
- LLTYPE_IPPORT,
- LLTYPE_VARIABLE,
- LLTYPE_FIXED,
- LLTYPE_SINGLE,
- LLTYPE_MULTIPLE,
- LLTYPE_NULL
-};
-
-extern TCHAR *LLTYPES[];
-extern TCHAR *LLKEYWORDS[];
+#pragma once
+
+enum LLTYPES
+{
+ LLTYPE_U8,
+ LLTYPE_U16,
+ LLTYPE_U32,
+ LLTYPE_U64,
+ LLTYPE_S8,
+ LLTYPE_S16,
+ LLTYPE_S32,
+ LLTYPE_S64,
+ LLTYPE_F8,
+ LLTYPE_F16,
+ LLTYPE_F32,
+ LLTYPE_F64,
+ LLTYPE_LLUUID,
+ LLTYPE_BOOL,
+ LLTYPE_LLVECTOR3,
+ LLTYPE_LLVECTOR3D,
+ LLTYPE_QUATERNION,
+ LLTYPE_IPADDR,
+ LLTYPE_IPPORT,
+ LLTYPE_VARIABLE,
+ LLTYPE_FIXED,
+ LLTYPE_SINGLE,
+ LLTYPE_MULTIPLE,
+ LLTYPE_NULL
+};
+
+extern TCHAR *LLTYPES[];
+extern TCHAR *LLKEYWORDS[];
diff --git a/applications/snowcrash/snowflake/snowflake.cpp b/applications/snowcrash/snowflake/snowflake.cpp
index e65870c2..34f3d930 100644
--- a/applications/snowcrash/snowflake/snowflake.cpp
+++ b/applications/snowcrash/snowflake/snowflake.cpp
@@ -1,2964 +1,2964 @@
-// snowflake.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include ".\snowflake.h"
-#include ".\MainFrame.h"
-#include ".\Server.h"
-#include ".\ServerList.h"
-#include ".\Message.h"
-#include ".\Block.h"
-#include ".\Var.h"
-#include ".\Config.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include ".\keywords.h"
-
-#pragma pack(1)
-
-struct COMMANDVAR
-{
- char *lpszVar;
- int nKeywordPos;
- int nType;
- int nTypeLen;
- struct COMMANDVAR *lpNext;
- struct COMMANDVAR *lpPrev;
-} typedef COMMANDVARS;
-
-typedef COMMANDVAR * LPCOMMANDVAR;
-typedef COMMANDVARS * LPCOMMANDVARS;
-
-struct COMMANDSTRUCT
-{
- char *lpszStruct;
- int nKeywordPos;
- int nType;
- BYTE cItems;
- LPCOMMANDVARS vars;
- struct COMMANDSTRUCT *lpNext;
- struct COMMANDSTRUCT *lpPrev;
-} typedef COMMANDSTRUCTS;
-
-typedef COMMANDSTRUCT * LPCOMMANDSTRUCT;
-typedef COMMANDSTRUCTS * LPCOMMANDSTRUCTS;
-
-typedef struct
-{
- char *lpszCmd;
- bool bZerocoded;
- bool bTrusted;
- LPCOMMANDSTRUCTS structs;
-} COMMAND;
-
-typedef COMMAND * LPCOMMAND;
-
-#define MAX_COMMANDS_LOW 65536
-#define MAX_COMMANDS_MEDIUM 256
-#define MAX_COMMANDS_HIGH 256
-
-COMMAND cmds_low[MAX_COMMANDS_LOW];
-COMMAND cmds_med[MAX_COMMANDS_MEDIUM];
-COMMAND cmds_high[MAX_COMMANDS_HIGH];
-
-typedef struct
-{
- LPCTSTR szCommand;
- PROC pProc;
-} CMDHOOK, *LPCMDHOOK;
-
-CMDHOOK pCMDHooks[];
-
-#pragma data_seg(".shared")
-HHOOK h_hCBTHook = NULL;
-#pragma data_seg()
-#pragma comment(linker, "/SECTION:.shared,RWS")
-
-HINSTANCE g_hinstDLL = NULL;
-HMODULE g_hOpenGL = NULL;
-CMainFrame* g_pMainFrm = NULL;
-CAppModule _Module;
-CMessageLoop g_msgLoop;
-CConfig* g_pConfig = NULL;
-BOOL g_bAllowSub = TRUE;
-
-CServerList servers;
-
-typedef struct
-{
- LPCTSTR szPatch;
- LPCTSTR szModule;
- LPCSTR szImport;
- BOOL bOrdinal;
- PROC pOldProc;
- PROC pNewProc;
-} APIHOOK, *LPAPIHOOK;
-
-APIHOOK pAPIHooks[];
-
-#define MAKEPTR(cast, ptr, add) (cast)((DWORD)(ptr)+(DWORD)(add))
-
-enum APIHOOKS
-{
- APIHOOK_GETPROCADDRESS,
- APIHOOK_LOADLIBRARYA,
- APIHOOK_LOADLIBRARYW,
- APIHOOK_LOADLIBRARYEXA,
- APIHOOK_LOADLIBRARYEXW,
- APIHOOK_FREELIBRARYA,
- APIHOOK_DELETEFILEA,
- APIHOOK_WRITEFILEA,
- APIHOOK_LSTRCMPIA,
- APIHOOK_CONNECT,
- APIHOOK_RECV,
- APIHOOK_RECVFROM,
- APIHOOK_SEND,
- APIHOOK_SENDTO,
- APIHOOK_GETHOSTBYNAME,
-// APIHOOK_SETWINDOWLONGA,
-// APIHOOK_SETWINDOWLONGW,
- APIHOOK_INTERNETREADFILE,
- APIHOOK_INTERNETOPENURLA,
- APIHOOK_CPENCRYPT,
- APIHOOK_PEEKMESSAGEA,
- APIHOOK_GLGETERROR,
- APIHOOK_GLBEGIN,
- APIHOOK_GLENABLE,
- APIHOOK_GLISENABLED,
- APIHOOK_GLTRANSLATED,
- APIHOOK_GLTRANSLATEF,
- APIHOOK_GLTEXCOORD2F,
- APIHOOK_GLTEXCOORD2FV,
- APIHOOK_GLVERTEX2F,
- APIHOOK_GLVERTEX3F,
- APIHOOK_GLVERTEX3FV,
- APIHOOK_GLVERTEX4F,
- APIHOOK_GLVERTEX4FV,
- APIHOOK_GLVERTEXPOINTER,
- APIHOOK_GLTEXCOORDPOINTER,
- APIHOOK_GLNORMALPOINTER,
- APIHOOK_GLDRAWELEMENTS,
- APIHOOK_GLDRAWARRAYS,
- APIHOOK_GLDRAWPIXELS,
- APIHOOK_GLTEXIMAGE2D,
- APIHOOK_GLCOLOR3F,
- APIHOOK_GLCOLOR3FV,
- APIHOOK_GLCOLOR4F,
- APIHOOK_GLCOLOR4FV,
- APIHOOK_GLCOLOR4UBV,
- APIHOOK_GLCOLORPOINTER,
- APIHOOK_GLVIEWPORT,
- APIHOOK_GLFLUSH,
- APIHOOK_GLUPERSPECTIVE,
- APIHOOK_GLUQUADRICDRAWSTYLE,
- APIHOOK_GLUTESSVERTEX,
- APIHOOK_NULL
-};
-
-bool InstallSLHooks(HWND hwnd);
-bool RemoveSLHooks();
-void InstallImportHooks();
-void RemoveImportHooks();
-void SaveImportHooks();
-
-int ZeroDecode(char *src, int srclen, char *dest, int destlen)
-{
- int zerolen = 0;
-
- if (src[0] & MSG_ZEROCODED)
- {
- memcpy(dest, src, 4);
- zerolen += 4;
-
- for (int i = zerolen; i < srclen; i++)
- {
- if ((unsigned char)src[i] == 0x00)
- {
- for (unsigned char j = 0; j < (unsigned char)src[i+1]; j++)
- dest[zerolen++] = 0x00;
-
- i++;
- }
- else
- dest[zerolen++] = src[i];
- }
- }
- else
- {
- memcpy(dest, src, srclen);
- zerolen = srclen;
- }
-
- return zerolen;
-}
-
-int ZeroEncode(char *src, int srclen, char *dest, int destlen)
-{
- int zerolen = 0;
- unsigned char zerocount = 0;
-
- if (src[0] & MSG_ZEROCODED)
- {
- memcpy(dest, src, 4);
- zerolen += 4;
-
- for (int i = zerolen; i < srclen; i++)
- {
- if ((unsigned char)src[i] == 0x00)
- {
- zerocount++;
-
- if (zerocount == 0)
- {
- dest[zerolen++] = 0x00;
- dest[zerolen++] = 0xff;
- zerocount++;
- }
- }
- else
- {
- if (zerocount)
- {
- dest[zerolen++] = 0x00;
- dest[zerolen++] = zerocount;
- zerocount = 0;
- }
-
- dest[zerolen++] = src[i];
- }
- }
-
- if (zerocount)
- {
- dest[zerolen++] = 0x00;
- dest[zerolen++] = zerocount;
- }
- }
- else
- {
- memcpy(dest, src, srclen);
- zerolen = srclen;
- }
-
- return zerolen;
-}
-
-// Convert a "hex string" to an integer by Anders Molin
-int httoi(const TCHAR *value)
-{
- struct HEXMAP
- {
- TCHAR c;
- int value;
- };
-
- const int nHexMap = 16;
-
- HEXMAP hmLookup[nHexMap] =
- {
- {'0', 0}, {'1', 1},
- {'2', 2}, {'3', 3},
- {'4', 4}, {'5', 5},
- {'6', 6}, {'7', 7},
- {'8', 8}, {'9', 9},
- {'A', 10}, {'B', 11},
- {'C', 12}, {'D', 13},
- {'E', 14}, {'F', 15}
- };
-
- TCHAR *mstr = _tcsupr(_tcsdup(value));
- TCHAR *s = mstr;
- int result = 0;
-
- if (*s == '0' && *(s + 1) == 'X')
- s += 2;
-
- bool firsttime = true;
-
- while (*s != '\0')
- {
- bool found = false;
-
- for (int i = 0; i < nHexMap; i++)
- {
- if (*s == hmLookup[i].c)
- {
- if (!firsttime)
- result <<= 4;
-
- result |= hmLookup[i].value;
- found = true;
- break;
- }
- }
-
- if (!found)
- break;
-
- s++;
- firsttime = false;
- }
-
- free(mstr);
-
- return result;
-}
-
-// Trim beginning, ending, and excess embedded whitespace from a string
-char *trim(char *szStr)
-{
- char *iBuf, *oBuf;
-
- if (szStr)
- {
- for (iBuf = oBuf = szStr; *iBuf;)
- {
- while (*iBuf && (isspace(*iBuf)))
- iBuf++;
-
- if (*iBuf && (oBuf != szStr))
- *(oBuf++) = ' ';
-
- while (*iBuf && (!isspace(*iBuf)))
- *(oBuf++) = *(iBuf++);
- }
-
- *oBuf = NULL;
- }
-
- return(szStr);
-}
-
-int get_var_type(TCHAR *lptszType)
-{
- int i = 0;
-
- while (LLTYPES[i])
- {
- if (!_tcscmp(lptszType, LLTYPES[i]))
- {
- //printf("Type: %s\n", LLTYPES[i]);
- return i;
- }
-
- i++;
- }
-
- return -1;
-}
-
-int get_keyword_pos(TCHAR *lptszKeyword)
-{
- int i = 0;
-
- while (LLKEYWORDS[i])
- {
- if (!_tcscmp(lptszKeyword, LLKEYWORDS[i]))
- {
- //printf("Keyword: %s\n", LLKEYWORDS[i]);
- return i;
- }
-
- i++;
- }
-
- dprintf("Unhandled keyword: %s\n", lptszKeyword);
- return -1;
-}
-
-// Get message template block deliminator positions
-bool get_block_markers(LPBYTE lpBuffer, DWORD &dwStart, DWORD &dwEnd, DWORD &dwChildren)
-{
- DWORD dwStartBlock = 0;
- DWORD dwEndBlock = 0;
- DWORD dwDepth = 0;
-
- dwChildren = 0;
-
- for (DWORD dwPos = dwStart; dwPos <= dwEnd; dwPos++)
- {
- if (lpBuffer[dwPos] == '{')
- {
- dwDepth++;
-
- if (dwDepth == 1)
- dwStartBlock = dwPos;
- else if (dwDepth == 2 && !dwChildren)
- dwChildren = dwPos;
- }
-
- else if (lpBuffer[dwPos] == '}')
- {
- dwDepth--;
-
- if (dwDepth == 0 && dwStartBlock)
- {
- dwEndBlock = dwPos;
- dwStart = dwStartBlock;
- dwEnd = dwEndBlock;
- return true;
- }
- }
- }
-
- return false;
-}
-
-// Parse the variables message template block of a struct
-bool get_var_blocks(LPCOMMANDSTRUCT lpStruct, LPBYTE lpBuffer, DWORD dwStart, DWORD dwEnd)
-{
- DWORD dwVarStart = dwStart;
- DWORD dwVarEnd = dwEnd;
- DWORD dwVarChildren = 0;
-
- while (get_block_markers(lpBuffer, dwVarStart, dwVarEnd, dwVarChildren))
- {
- char szVarLine[256];
- DWORD dwVarLen = (dwVarChildren ? dwVarChildren - 1 : dwVarEnd - 1) - dwVarStart;
-
- memcpy(&szVarLine, &lpBuffer[dwVarStart+1], dwVarLen);
- szVarLine[dwVarLen] = '\0';
- trim(szVarLine);
-
- //printf("\t\t%s\n", szVarLine);
-
- char *lpszVar = strtok(szVarLine, " ");
- char *lpszType = strtok(NULL, " ");
- char *lpszTypeLen = NULL;
- int nKeywordPos = get_keyword_pos(lpszVar);
- int nVarType = get_var_type(lpszType);
-
- LPCOMMANDVAR lpVar = lpStruct->vars;
-
- if (lpVar)
- {
- // Insert after an item
- if (nKeywordPos > lpVar->nKeywordPos)
- {
- while (lpVar->lpNext && nKeywordPos > lpVar->lpNext->nKeywordPos)
- lpVar = lpVar->lpNext;
-
- LPCOMMANDVAR lpBelow = lpVar->lpNext;
-
- lpVar->lpNext = (LPCOMMANDVAR)malloc(sizeof(COMMANDVAR));
-
- if (!lpVar->lpNext)
- return false;
-
- ZeroMemory(lpVar->lpNext, sizeof(COMMANDVAR));
- lpVar->lpNext->lpPrev = lpVar;
- lpVar->lpNext->lpNext = lpBelow;
- lpVar = lpVar->lpNext;
- }
- // Insert before all items
- else
- {
- lpVar->lpPrev = (LPCOMMANDVAR)malloc(sizeof(COMMANDVAR));
-
- if (!lpVar->lpPrev)
- return false;
-
- ZeroMemory(lpVar->lpPrev, sizeof(COMMANDVAR));
-
- lpVar->lpPrev->lpNext = lpVar;
- lpVar->lpPrev->lpPrev = NULL;
- lpVar = lpVar->lpPrev;
- lpStruct->vars = lpVar;
- }
- }
- // No existing list, create a new list with our entry
- else
- {
- lpVar = (LPCOMMANDVAR)malloc(sizeof(COMMANDVAR));
-
- if (!lpVar)
- return false;
-
- ZeroMemory(lpVar, sizeof(COMMANDVAR));
- lpStruct->vars = lpVar;
- }
-
- lpVar->lpszVar = strdup(lpszVar);
- lpVar->nType = nVarType;
- lpVar->nKeywordPos = nKeywordPos;
-
- if (nVarType == LLTYPE_VARIABLE || nVarType == LLTYPE_FIXED)
- {
- lpszTypeLen = strtok(NULL, " ");
- lpVar->nTypeLen = atoi(lpszTypeLen);
- }
-
- dwVarStart = dwVarEnd + 1;
- dwVarEnd = dwEnd;
- }
-
- return true;
-}
-
-// Parse the struct message template block of a command
-bool get_struct_blocks(LPCOMMAND lpCmd, LPBYTE lpBuffer, DWORD dwStart, DWORD dwEnd)
-{
- DWORD dwStructStart = dwStart;
- DWORD dwStructEnd = dwEnd;
- DWORD dwStructChildren = 0;
-
- while (get_block_markers(lpBuffer, dwStructStart, dwStructEnd, dwStructChildren))
- {
- char szStructLine[256];
- DWORD dwStructLen = (dwStructChildren ? dwStructChildren - 1 : dwStructEnd - 1) - dwStructStart;
-
- memcpy(&szStructLine, &lpBuffer[dwStructStart+1], dwStructLen);
- szStructLine[dwStructLen] = '\0';
- trim(szStructLine);
-
- //printf("\t%s\n", szStructLine);
-
- char *lpszStruct = strtok(szStructLine, " ");
- char *lpszType = strtok(NULL, " ");
- int nKeywordPos = get_keyword_pos(lpszStruct);
- int nVarType = get_var_type(lpszType);
-
- LPCOMMANDSTRUCT lpStruct = lpCmd->structs;
-
- if (lpStruct)
- {
- // Insert after an item
- if (nKeywordPos > lpStruct->nKeywordPos)
- {
- while (lpStruct->lpNext && nKeywordPos > lpStruct->lpNext->nKeywordPos)
- lpStruct = lpStruct->lpNext;
-
- LPCOMMANDSTRUCT lpBelow = lpStruct->lpNext;
-
- lpStruct->lpNext = (LPCOMMANDSTRUCT)malloc(sizeof(COMMANDSTRUCT));
-
- if (!lpStruct->lpNext)
- return false;
-
- ZeroMemory(lpStruct->lpNext, sizeof(COMMANDSTRUCT));
- lpStruct->lpNext->lpPrev = lpStruct;
- lpStruct->lpNext->lpNext = lpBelow;
- lpStruct = lpStruct->lpNext;
- }
- // Insert before all items
- else
- {
- lpStruct->lpPrev = (LPCOMMANDSTRUCT)malloc(sizeof(COMMANDSTRUCT));
-
- if (!lpStruct->lpPrev)
- return false;
-
- ZeroMemory(lpStruct->lpPrev, sizeof(COMMANDSTRUCT));
-
- lpStruct->lpPrev->lpNext = lpStruct;
- lpStruct->lpPrev->lpPrev = NULL;
- lpStruct = lpStruct->lpPrev;
- lpCmd->structs = lpStruct;
- }
- }
- // No existing list, create a new list with our entry
- else
- {
- lpCmd->structs = (LPCOMMANDSTRUCT)malloc(sizeof(COMMANDSTRUCT));
-
- if (!lpCmd->structs)
- return false;
-
- ZeroMemory(lpCmd->structs, sizeof(COMMANDSTRUCT));
- lpStruct = lpCmd->structs;
- }
-
- lpStruct->lpszStruct = strdup(lpszStruct);
- lpStruct->nKeywordPos = nKeywordPos;
- lpStruct->nType = nVarType;
-
- if (nVarType == LLTYPE_VARIABLE)
- {
- lpStruct->cItems = 1;
- }
- else if (nVarType == LLTYPE_MULTIPLE)
- {
- char *lpszTypeLen = strtok(NULL, " ");
- lpStruct->cItems = atoi(lpszTypeLen);
- }
-
- get_var_blocks(lpStruct, lpBuffer, dwStructStart + 1, dwStructEnd - 1);
-
- dwStructStart = dwStructEnd + 1;
- dwStructEnd = dwEnd;
- }
-
- return true;
-}
-
-// Parse the command message template blocks
-bool get_command_blocks(LPBYTE lpBuffer, DWORD dwStart, DWORD dwEnd)
-{
- DWORD dwCmdStart = dwStart;
- DWORD dwCmdEnd = dwEnd;
- DWORD dwCmdChildren = 0;
-
- while (get_block_markers(lpBuffer, dwCmdStart, dwCmdEnd, dwCmdChildren))
- {
- char szCmdLine[256];
- DWORD dwCmdLen = (dwCmdChildren ? dwCmdChildren - 1 : dwCmdEnd - 1) - dwCmdStart;
-
- memcpy(&szCmdLine, &lpBuffer[dwCmdStart+1], dwCmdLen);
- szCmdLine[dwCmdLen] = '\0';
- trim(szCmdLine);
-
- //printf("%s\n", szCmdLine);
-
- char *lpszCmd = strtok(szCmdLine, " ");
- char *lpszFreq = strtok(NULL, " ");
- char *lpszFixed = NULL;
- char *lpszTrust = NULL;
- char *lpszCoding = NULL;
- static DWORD dwLow = 1;
- static DWORD dwMed = 1;
- static DWORD dwHigh = 1;
- COMMAND *lpCmd = NULL;
-
- // Get the commands frequency
- if (!strnicmp(lpszFreq, "Fixed", 6))
- {
- lpszFixed = strtok(NULL, " ");
- DWORD dwFixed = (DWORD)httoi(lpszFixed) ^ 0xffff0000;
- lpCmd = &cmds_low[dwFixed];
- }
- else if (!strnicmp(lpszFreq, "Low", 4))
- {
- lpCmd = &cmds_low[dwLow++];
- }
- else if (!strnicmp(lpszFreq, "Medium", 7))
- {
- lpCmd = &cmds_med[dwMed++];
- }
- else if (!strnicmp(lpszFreq, "High", 5))
- {
- lpCmd = &cmds_high[dwHigh++];
- }
-
- lpszTrust = strtok(NULL, " ");
- lpszCoding = strtok(NULL, " ");
-
- lpCmd->lpszCmd = strdup(lpszCmd);
-
- // Is the command zero encoded?
- if (!strnicmp(lpszCoding, "Zerocoded", 10))
- {
- lpCmd->bZerocoded = true;
- }
-
- // Is the command trusted?
- if (!strnicmp(lpszTrust, "Trusted", 8))
- {
- lpCmd->bTrusted = true;
- }
-
- get_struct_blocks(lpCmd, lpBuffer, dwCmdStart + 1, dwCmdEnd - 1);
-
- //printf("----------------------\n");
-
- dwCmdStart = dwCmdEnd + 1;
- dwCmdEnd = dwEnd;
- }
-
- return true;
-}
-
-void dump_structs(LPCOMMANDSTRUCT lpStruct)
-{
- while (lpStruct)
- {
- //dprintf("\t%04d %s (%s / %hu)\n", lpStruct->nKeywordPos, lpStruct->lpszStruct, LLTYPES[lpStruct->nType], lpStruct->cItems);
-
- LPCOMMANDVAR lpVar = lpStruct->vars;
-
- while (lpVar)
- {
- //dprintf("\t\t%04d %s (%s / %d)\n", lpVar->nKeywordPos, lpVar->lpszVar, LLTYPES[lpVar->nType], lpVar->nTypeLen);
- lpVar = lpVar->lpNext;
- }
-
-// if (lpStruct->lpNext)
-// {
- lpStruct = lpStruct->lpNext;
-// SAFE_FREE(lpStruct->lpPrev->lpszStruct);
-// SAFE_FREE(lpStruct->lpPrev);
-// }
-// else
-// {
-// SAFE_FREE(lpStruct->lpszStruct);
-// SAFE_FREE(lpStruct);
-// }
- }
-}
-
-void WINAPI parse_command(LPCOMMAND lpCommand, CServer *server, char *zerobuf, int *len, int pos)
-{
- //dprintf("--- %s ---\n", lpCommand->lpszCmd);
-
- LPCOMMANDSTRUCT lpStruct = lpCommand->structs;
-
- while (lpStruct)
- {
- //dprintf("\t%04d %s (%s / %hu)\n", lpStruct->nKeywordPos, lpStruct->lpszStruct, LLTYPES[lpStruct->nType], lpStruct->cItems);
- BYTE cItems = 1;
-
- if (lpStruct->nType == LLTYPE_VARIABLE)
- {
- memcpy(&cItems, &zerobuf[pos], sizeof(cItems));
- pos += sizeof(cItems);
- }
- else if (lpStruct->nType == LLTYPE_MULTIPLE)
- {
- cItems = lpStruct->cItems;
- }
-
- for (BYTE c = 0; c < cItems; c++)
- {
- //dprintf("--- %s ----\n", lpStruct->lpszStruct);
-
- LPCOMMANDVAR lpVar = lpStruct->vars;
-
- while (lpVar)
- {
- //dprintf("\t\t%04d %s (%s / %d)\n", lpVar->nKeywordPos, lpVar->lpszVar, LLTYPES[lpVar->nType], lpVar->nTypeLen);
-
- switch (lpVar->nType)
- {
- case LLTYPE_U8:
- {
- unsigned char ubData;
- memcpy(&ubData, &zerobuf[pos], sizeof(ubData));
- pos += sizeof(ubData);
- //dprintf("%s: %hu\n", lpVar->lpszVar, ubData);
- }
- break;
-
- case LLTYPE_U16:
- {
- WORD wData;
- memcpy(&wData, &zerobuf[pos], sizeof(wData));
- pos += sizeof(wData);
- //dprintf("%s: %u\n", lpVar->lpszVar, wData);
- }
- break;
-
- case LLTYPE_U32:
- {
- DWORD dwData;
- memcpy(&dwData, &zerobuf[pos], sizeof(dwData));
- pos += sizeof(dwData);
- //dprintf("%s: %lu\n", lpVar->lpszVar, dwData);
- }
- break;
-
- case LLTYPE_U64:
- {
- ULONGLONG ullData;
- memcpy(&ullData, &zerobuf[pos], sizeof(ullData));
- pos += sizeof(ullData);
- //dprintf("%s: %I64u\n", lpVar->lpszVar, ullData);
- }
- break;
-
- case LLTYPE_S8:
- {
- BYTE bData;
- memcpy(&bData, &zerobuf[pos], sizeof(bData));
- pos += sizeof(bData);
- //dprintf("%s: %hd\n", lpVar->lpszVar, bData);
- }
- break;
-
- case LLTYPE_S16:
- {
- SHORT sData;
- memcpy(&sData, &zerobuf[pos], sizeof(sData));
- pos += sizeof(sData);
- //dprintf("%s: %d\n", lpVar->lpszVar, sData);
- }
- break;
-
- case LLTYPE_S32:
- {
- LONG nData;
- memcpy(&nData, &zerobuf[pos], sizeof(nData));
- pos += sizeof(nData);
- //dprintf("%s: %ld\n", lpVar->lpszVar, nData);
- }
- break;
-
- case LLTYPE_S64:
- break;
-
- case LLTYPE_F8:
- break;
-
- case LLTYPE_F16:
- break;
-
- case LLTYPE_F32:
- {
- FLOAT fData;
- memcpy(&fData, &zerobuf[pos], sizeof(fData));
- pos += sizeof(fData);
- //dprintf("%s: %f\n", lpVar->lpszVar, fData);
- }
- break;
-
- case LLTYPE_F64:
- {
- double dData;
- memcpy(&dData, &zerobuf[pos], sizeof(dData));
- pos += sizeof(dData);
- //dprintf("%s: %f\n", lpVar->lpszVar, dData);
- }
- break;
-
- case LLTYPE_LLUUID:
- {
- BYTE bData[16];
- memcpy(&bData, &zerobuf[pos], sizeof(bData));
- pos += sizeof(bData);
- //dprintf("%s: ", lpVar->lpszVar);
- //for (int u = 0; u < sizeof(bData); u++)
- //dprintf("%02x", bData[u]);
- //dprintf("\n");
- }
- break;
-
- case LLTYPE_BOOL:
- {
- BYTE bData;
- memcpy(&bData, &zerobuf[pos], sizeof(bData));
- pos += sizeof(bData);
- //dprintf("%s: %s\n", lpVar->lpszVar, (bData) ? "True" : "False");
- }
- break;
-
- case LLTYPE_LLVECTOR3:
- {
- FLOAT fData[3];
- memcpy(&fData, &zerobuf[pos], sizeof(fData));
- pos += sizeof(fData);
- //dprintf("%s: %f, %f, %f\n", lpVar->lpszVar, fData[0], fData[1], fData[2]);
- }
- break;
-
- case LLTYPE_LLVECTOR3D:
- {
- double dData[3];
- memcpy(&dData, &zerobuf[pos], sizeof(dData));
- pos += sizeof(dData);
- //dprintf("%s: %f, %f, %f\n", lpVar->lpszVar, dData[0], dData[1], dData[2]);
- }
- break;
-
- /*case LLTYPE_VECTOR4:
- {
- FLOAT fData[4];
- memcpy(&fData, &zerobuf[pos], sizeof(fData));
- pos += sizeof(fData);
- dprintf("%s: %f, %f, %f, %f\n", lpVar->lpszVar, fData[0], fData[1], fData[2], fData[3]);
- }
- break;*/
-
- case LLTYPE_QUATERNION:
- {
- FLOAT fData[4];
- memcpy(&fData, &zerobuf[pos], sizeof(fData));
- pos += sizeof(fData);
- //dprintf("%s: %f, %f, %f, %f\n", lpVar->lpszVar, fData[0], fData[1], fData[2], fData[3]);
- }
- break;
-
- case LLTYPE_IPADDR:
- {
- BYTE ipData[4];
- memcpy(&ipData, &zerobuf[pos], sizeof(ipData));
- pos += sizeof(ipData);
- //dprintf("%s: %hu.%hu.%hu.%hu\n", lpVar->lpszVar, ipData[0], ipData[1], ipData[2], ipData[3]);
- }
- break;
-
- case LLTYPE_IPPORT:
- {
- WORD wData;
- memcpy(&wData, &zerobuf[pos], sizeof(wData));
- pos += sizeof(wData);
- //dprintf("%s: %hu\n", lpVar->lpszVar, htons(wData));
- }
- break;
-
- case LLTYPE_VARIABLE:
- {
- if (lpVar->nTypeLen == 1)
- {
- BYTE cDataLen;
- LPBYTE lpData = NULL;
-
- memcpy(&cDataLen, &zerobuf[pos], sizeof(cDataLen));
- pos += sizeof(cDataLen);
-
- if (cDataLen > 0)
- lpData = (LPBYTE)malloc(cDataLen);
-
- if (lpData)
- memcpy(lpData, &zerobuf[pos], cDataLen);
-
- pos += cDataLen;
-
- if (lpData)
- {
- bool bPrintable = true;
-
- for (int j = 0; j < cDataLen - 1; j++)
- {
- if (((unsigned char)lpData[j] < 0x20 || (unsigned char)lpData[j] > 0x7E) && (unsigned char)lpData[j] != 0x09 && (unsigned char)lpData[j] != 0x0D)
- bPrintable = false;
- }
-
- if (bPrintable && lpData[cDataLen - 1] == '\0')
- {
- //dprintf("%s: %s\n", lpVar->lpszVar, lpData);
- }
- else
- {
- for (int j = 0; j < cDataLen; j += 16)
- {
- //dprintf("%s: ", lpVar->lpszVar);
-
- for (int k = 0; k < 16; k++)
- {
- if ((j + k) < cDataLen)
- {
- //dprintf("%02x ", (unsigned char)lpData[j+k]);
- }
- else
- {
- //dprintf(" ");
- }
- }
-
- for (int k = 0; k < 16 && (j + k) < cDataLen; k++)
- {
- //dprintf("%c", ((unsigned char)lpData[j+k] >= 0x20 && (unsigned char)lpData[j+k] <= 0x7E) ? (unsigned char)lpData[j+k] : '.');
- }
-
- //dprintf("\n");
- }
- }
- }
-
- SAFE_FREE(lpData);
- }
- else if (lpVar->nTypeLen == 2)
- {
- WORD cDataLen;
- LPBYTE lpData = NULL;
-
- memcpy(&cDataLen, &zerobuf[pos], sizeof(cDataLen));
- pos += sizeof(cDataLen);
-
- if (cDataLen > 0)
- lpData = (LPBYTE)malloc(cDataLen);
-
- if (lpData)
- memcpy(lpData, &zerobuf[pos], cDataLen);
-
- pos += cDataLen;
-
- if (lpData)
- {
- bool bPrintable = true;
-
- for (int j = 0; j < cDataLen - 1; j++)
- {
- if (((unsigned char)lpData[j] < 0x20 || (unsigned char)lpData[j] > 0x7E) && (unsigned char)lpData[j] != 0x09 && (unsigned char)lpData[j] != 0x0D)
- bPrintable = false;
- }
-
- if (bPrintable && lpData[cDataLen - 1] == '\0')
- {
- //dprintf("%s: %s\n", lpVar->lpszVar, lpData);
- }
- else
- {
- for (int j = 0; j < cDataLen; j += 16)
- {
- //dprintf("%s: ", lpVar->lpszVar);
-
- for (int k = 0; k < 16; k++)
- {
- if ((j + k) < cDataLen)
- {
- //dprintf("%02x ", (unsigned char)lpData[j+k]);
- }
- else
- {
- //dprintf(" ");
- }
- }
-
- for (int k = 0; k < 16 && (j + k) < cDataLen; k++)
- {
- //dprintf("%c", ((unsigned char)lpData[j+k] >= 0x20 && (unsigned char)lpData[j+k] <= 0x7E) ? (unsigned char)lpData[j+k] : '.');
- }
-
- //dprintf("\n");
- }
- }
- }
-
- SAFE_FREE(lpData);
- }
- }
- break;
-
- case LLTYPE_FIXED:
- {
- LPBYTE lpData = NULL;
-
- if (lpVar->nTypeLen > 0)
- lpData = (LPBYTE)malloc(lpVar->nTypeLen);
-
- if (lpData)
- memcpy(lpData, &zerobuf[pos], lpVar->nTypeLen);
-
- pos += lpVar->nTypeLen;
-
- if (lpData)
- {
- bool bPrintable = true;
-
- for (int j = 0; j < lpVar->nTypeLen - 1; j++)
- {
- if (((unsigned char)lpData[j] < 0x20 || (unsigned char)lpData[j] > 0x7E) && (unsigned char)lpData[j] != 0x09 && (unsigned char)lpData[j] != 0x0D)
- bPrintable = false;
- }
-
- if (bPrintable && lpData[lpVar->nTypeLen - 1] == '\0')
- {
- //dprintf("%s: %s\n", lpVar->lpszVar, lpData);
- }
- else
- {
- for (int j = 0; j < lpVar->nTypeLen; j += 16)
- {
- //dprintf("%s: ", lpVar->lpszVar);
-
- for (int k = 0; k < 16; k++)
- {
- if ((j + k) < lpVar->nTypeLen)
- {
- //dprintf("%02x ", (unsigned char)lpData[j+k]);
- }
- else
- {
- //dprintf(" ");
- }
- }
-
- for (int k = 0; k < 16 && (j + k) < lpVar->nTypeLen; k++)
- {
- //dprintf("%c", ((unsigned char)lpData[j+k] >= 0x20 && (unsigned char)lpData[j+k] <= 0x7E) ? (unsigned char)lpData[j+k] : '.');
- }
-
- //dprintf("\n");
- }
- }
- }
-
- SAFE_FREE(lpData);
- }
- break;
-
- case LLTYPE_SINGLE:
- case LLTYPE_MULTIPLE:
- case LLTYPE_NULL:
- default:
- break;
- }
-
- lpVar = lpVar->lpNext;
- }
- }
-
- lpStruct = lpStruct->lpNext;
- }
-}
-
-CMessage * WINAPI map_command(LPCOMMAND lpCommand, CServer *server, char *zerobuf, int *len, int pos)
-{
-// dprintf("--- %s ---\n", lpCommand->lpszCmd);
-
- int oldPos = pos;
-
- CMessage *msg = new CMessage;
-
- if (!msg)
- return NULL;
-
- msg->SetCommand(lpCommand->lpszCmd);
-
- LPCOMMANDSTRUCT lpStruct = lpCommand->structs;
-
- while (lpStruct)
- {
- //dprintf("\t%04d %s (%s / %hu)\n", lpStruct->nKeywordPos, lpStruct->lpszStruct, LLTYPES[lpStruct->nType], lpStruct->cItems);
- BYTE cItems = 1;
-
- if (lpStruct->nType == LLTYPE_VARIABLE)
- {
- memcpy(&cItems, &zerobuf[pos], sizeof(cItems));
- pos += sizeof(cItems);
- }
- else if (lpStruct->nType == LLTYPE_MULTIPLE)
- {
- cItems = lpStruct->cItems;
- }
-
- for (BYTE c = 0; c < cItems; c++)
- {
- //dprintf("--- %s ----\n", lpStruct->lpszStruct);
- CBlock *block = new CBlock;
- msg->AddBlock(lpStruct->lpszStruct, lpStruct->nType, block);
-
- LPCOMMANDVAR lpVar = lpStruct->vars;
-
- while (lpVar)
- {
- //dprintf("\t\t%04d %s (%s / %d)\n", lpVar->nKeywordPos, lpVar->lpszVar, LLTYPES[lpVar->nType], lpVar->nTypeLen);
- CVar *var = new CVar;
- var->SetVar(lpVar->lpszVar);
- var->SetType(lpVar->nType, lpVar->nTypeLen);
- pos += var->SetData((LPBYTE)&zerobuf[pos]);
- block->AddVar(var);
- lpVar = lpVar->lpNext;
- }
- }
-
- lpStruct = lpStruct->lpNext;
- }
-
- BYTE bPack[4096];
- int nPackedSize = msg->Pack(bPack);
- int diff = memcmp(bPack, &zerobuf[oldPos], nPackedSize);
-
- if (diff)
- {
- msg->Dump();
- dprintf("PACKED: %d / %d (%d) ===> %d\n", nPackedSize, *len, oldPos, diff);
- }
-
- return msg;
-}
-
-void WINAPI cmd_Silent(LPCOMMAND lpCommand, CServer *server, char *zerobuf, int *len, int pos)
-{
-}
-
-void WINAPI cmd_Default(LPCOMMAND lpCommand, CServer *server, char *zerobuf, int *len, int pos)
-{
- //dprintf("Flags: %u\n", zerobuf[0]);
- CMessage *msg = map_command(lpCommand, server, zerobuf, len, pos);
- msg->Dump();
- SAFE_DELETE(msg);
-}
-
-void WINAPI cmd_LoginReply(LPCOMMAND lpCommand, CServer *server, char *zerobuf, int *len, int pos)
-{
- parse_command(lpCommand, server, zerobuf, len, pos);
-}
-
-CMDHOOK pCMDHooks[] = {
- { _T("Default"), (PROC)cmd_Default },
- { _T("DirLandReply"), (PROC)cmd_Silent }, // Silence the most common
- { _T("AvatarAnimation"), (PROC)cmd_Silent }, // packets
- { _T("CoarseLocationUpdate"), (PROC)cmd_Silent },
- { _T("CompletePingCheck"), (PROC)cmd_Silent },
- { _T("LayerData"), (PROC)cmd_Silent },
- { _T("PacketAck"), (PROC)cmd_Silent },
- { _T("StartPingCheck"), (PROC)cmd_Silent },
- { _T("SimulatorViewerTimeMessage"), (PROC)cmd_Silent },
- { _T("ImagePacket"), (PROC)cmd_Silent },
- { _T("TransferPacket"), (PROC)cmd_Silent },
- { _T("ObjectUpdate"), (PROC)cmd_Silent },
- { _T("ObjectUpdateCompressed"), (PROC)cmd_Silent },
- { _T("AgentThrottle"), (PROC)cmd_Silent },
- { _T("CoarseLocationUpdate"), (PROC)cmd_Silent },
- { _T("UUIDNameReply"), (PROC)cmd_Silent },
- { _T("RequestImage"), (PROC)cmd_Silent },
- { _T("ImageData"), (PROC)cmd_Silent },
- { _T("SimStats"), (PROC)cmd_Silent },
- { _T("ViewerEffect"), (PROC)cmd_Silent },
- { _T("TransferRequest"), (PROC)cmd_Silent },
- { _T("DirClassifiedReply"), (PROC)cmd_Silent },
- { _T("DirEventsReply"), (PROC)cmd_Silent },
- { _T("DirPopularReply"), (PROC)cmd_Silent },
- { _T("DirLandReply"), (PROC)cmd_Silent },
- { _T("AgentUpdate"), (PROC)cmd_Silent },
- { _T("ObjectUpdateCached"), (PROC)cmd_Silent },
- { _T("ImprovedTerseObjectUpdate"), (PROC)cmd_Silent },
- { _T("RequestMultipleObjects"), (PROC)cmd_Silent },
- { _T("AttachedSound"), (PROC)cmd_Silent },
- { _T("ViewerStats"), (PROC)cmd_Silent },
- { _T("TransferInfo"), (PROC)cmd_Silent },
- { _T("ParcelOverlay"), (PROC)cmd_Silent },
- { _T("SendXferPacket"), (PROC)cmd_Silent },
- { _T("DirPlacesReply"), (PROC)cmd_Silent },
- { NULL, NULL }
-};
-
-int decomm()
-{
- FILE *fpComm;
- FILE *fpMsg;
-
- fpComm = fopen(g_pConfig->m_pCommDatPath, "rb");
-
- if (!fpComm)
- {
- printf("Couldn't open %s for reading, aborting...\n", g_pConfig->m_pCommDatPath);
- return -1;
- }
-
- fpMsg = fopen(g_pConfig->m_pMessageTemplatePath, "wb");
-
- if (!fpMsg)
- {
- printf("Couldn't open %s for writing, aborting...\n", g_pConfig->m_pMessageTemplatePath);
- return -1;
- }
-
- printf("Decrypting %s to %s\n", g_pConfig->m_pCommDatPath, g_pConfig->m_pMessageTemplatePath);
- static unsigned char ucMagicKey = 0;
- long lTemplateSize = 0;
-
- fseek(fpComm, 0, SEEK_END);
- lTemplateSize = ftell(fpComm);
- fseek(fpComm, 0, SEEK_SET);
-
- BYTE buffer[2048];
- BYTE stripped[2048];
- LPBYTE lpTemplate = (LPBYTE)malloc(lTemplateSize);
- DWORD dwTemplateWrote = 0;
-
- if (!lpTemplate)
- return -1;
-
- bool bComment = false;
-
- while (!feof(fpComm))
- {
- size_t stRead = fread(&buffer, 1, sizeof(buffer), fpComm);
- size_t stStripped = 0;
-
- for (size_t stCount = 0; stCount < stRead; stCount++)
- {
- buffer[stCount] ^= ucMagicKey;
-
- if (!bComment && buffer[stCount] != '/')
- stripped[stStripped++] = buffer[stCount];
-
- if (bComment && buffer[stCount] == '\n')
- bComment = false;
-
- if (!bComment && buffer[stCount] == '/')
- bComment = true;
-
- ucMagicKey += 43;
- }
-
- memcpy(lpTemplate + dwTemplateWrote, &stripped, stStripped);
- dwTemplateWrote += (DWORD)stStripped;
-
- size_t stWrote = fwrite(&stripped, 1, stStripped, fpMsg);
-
- printf(".");
- fflush(stdout);
- }
-
- printf("\nDone.\n");
-
- printf("template size: %ld\n", lTemplateSize);
-
- ZeroMemory(&cmds_low, sizeof(cmds_low));
- ZeroMemory(&cmds_med, sizeof(cmds_med));
- ZeroMemory(&cmds_high, sizeof(cmds_high));
-
- get_command_blocks(lpTemplate, 0, lTemplateSize);
-
- fclose(fpComm);
- fclose(fpMsg);
-
- for (int i = 1; i < MAX_COMMANDS_LOW; i++)
- {
- if (cmds_low[i].lpszCmd)
- {
- //dprintf("LOW %05d - %s - %s - %s\n", i, cmds_low[i].lpszCmd, cmds_low[i].bTrusted ? "Trusted" : "Untrusted", cmds_low[i].bZerocoded ? "Zerocoded" : "Unencoded");
- dump_structs(cmds_low[i].structs);
- //SAFE_FREE(cmds_low[i].lpszCmd);
- }
- }
-
- for (int i = 1; i < MAX_COMMANDS_MEDIUM; i++)
- {
- if (cmds_med[i].lpszCmd)
- {
- //dprintf("Medium %05d - %s\n", i, cmds_med[i].lpszCmd);
- dump_structs(cmds_med[i].structs);
- //SAFE_FREE(cmds_med[i].lpszCmd);
- }
- }
-
- for (int i = 1; i < MAX_COMMANDS_HIGH; i++)
- {
- if (cmds_high[i].lpszCmd)
- {
- //dprintf("High %05d - %s\n", i, cmds_high[i].lpszCmd);
- dump_structs(cmds_high[i].structs);
- //SAFE_FREE(cmds_high[i].lpszCmd);
- }
- }
-
- return 0;
-}
-
-HMODULE WINAPI new_LoadLibraryA(
- LPCSTR lpLibFileName
- )
-{
- if (g_hOpenGL != NULL && !_tcsicmp(lpLibFileName, "OPENGL32"))
- return g_hOpenGL;
-
-// dprintf("[LoadLibraryA] Filename(%s)\n", lpLibFileName);
-
- HMODULE hModule = NULL;
- PROC pOldProc = pAPIHooks[APIHOOK_LOADLIBRARYA].pOldProc;
-
- if (pOldProc != NULL && !IsBadCodePtr((PROC)pOldProc))
- {
- hModule = ((HMODULE (WINAPI *)(LPCSTR))pOldProc)(lpLibFileName);
- if (hModule != NULL)
- {
- SaveImportHooks();
- InstallImportHooks();
- }
- }
-
- if (!_tcsicmp(lpLibFileName, "OPENGL32"))
- g_hOpenGL = hModule;
-
- return hModule;
-}
-
-BOOL WINAPI new_FreeLibraryA(
- HMODULE hLibModule
- )
-{
- if (hLibModule == g_hOpenGL)
- {
- return TRUE;
- }
-
- return ((BOOL (WINAPI *)(HMODULE))pAPIHooks[APIHOOK_FREELIBRARYA].pOldProc)(hLibModule);
-}
-
-HMODULE WINAPI new_LoadLibraryW(
- LPCWSTR lpLibFileName
- )
-{
-// dprintf("[LoadLibraryW] Filename(%S)\n", lpLibFileName);
-
- HMODULE hModule = NULL;
- PROC pOldProc = pAPIHooks[APIHOOK_LOADLIBRARYW].pOldProc;
-
- if (pOldProc != NULL && !IsBadCodePtr((PROC)pOldProc))
- {
- hModule = ((HMODULE (WINAPI *)(LPCWSTR))pOldProc)(lpLibFileName);
- if (hModule != NULL)
- {
- SaveImportHooks();
- InstallImportHooks();
- }
- }
-
- return hModule;
-}
-
-HMODULE WINAPI new_LoadLibraryExA(
- LPCSTR lpLibFileName,
- HANDLE hFile,
- DWORD dwFlags
- )
-{
-// dprintf("[LoadLibraryExA] Filename(%s)\n", lpLibFileName);
-
- HMODULE hModule = NULL;
- PROC pOldProc = pAPIHooks[APIHOOK_LOADLIBRARYEXA].pOldProc;
-
- if (pOldProc != NULL && !IsBadCodePtr((PROC)pOldProc))
- {
- hModule = ((HMODULE (WINAPI *)(LPCSTR, HANDLE, DWORD))pOldProc)(lpLibFileName, hFile, dwFlags);
- if (hModule != NULL)
- {
- SaveImportHooks();
- InstallImportHooks();
- }
- }
-
- return hModule;
-}
-
-HMODULE WINAPI new_LoadLibraryExW(
- LPCWSTR lpLibFileName,
- HANDLE hFile,
- DWORD dwFlags)
-{
-// dprintf("[LoadLibraryExW] Filename(%S)\n", lpLibFileName);
-
- HMODULE hModule = NULL;
- PROC pOldProc = pAPIHooks[APIHOOK_LOADLIBRARYEXW].pOldProc;
-
- if (pOldProc != NULL && !IsBadCodePtr((PROC)pOldProc))
- {
- hModule = ((HMODULE (WINAPI *)(LPCWSTR, HANDLE, DWORD))pOldProc)(lpLibFileName, hFile, dwFlags);
- if (hModule != NULL)
- {
- SaveImportHooks();
- InstallImportHooks();
- }
- }
-
- return hModule;
-}
-
-FARPROC WINAPI new_GetProcAddress(HMODULE hModule, LPCSTR lpProcName)
-{
- TCHAR szMod[MAX_PATH];
-
- GetModuleFileName(hModule, szMod, sizeof(szMod));
-
- if (HIWORD((DWORD)lpProcName) == 0)
- {
- WORD wOrdinal = LOWORD((DWORD)lpProcName);
-// dprintf(_T("[GetProcAddress] [%s][@%d]\n"), szMod, wOrdinal);
- }
- else
- {
- if (lpProcName != NULL && !IsBadCodePtr((PROC)lpProcName))
- {
- if (!stricmp(lpProcName, "wglSwapBuffers"))
- {
-
- }
- else if (!stricmp(lpProcName, "InternetReadFile"))
- {
- dprintf(_T("[***GetProcAddress] [%s][%s]\n"), szMod, lpProcName);
- return pAPIHooks[(int)APIHOOK_INTERNETREADFILE].pNewProc;
- }
- else if (!stricmp(lpProcName, "InternetOpenUrlA"))
- {
- dprintf(_T("[***GetProcAddress] [%s][%s]\n"), szMod, lpProcName);
- return pAPIHooks[(int)APIHOOK_INTERNETOPENURLA].pNewProc;
- }
- else if (!stricmp(lpProcName, "CPEncrypt"))
- {
- dprintf(_T("[***CPEncrypt] [%s][%s]\n"), szMod, lpProcName);
- return pAPIHooks[(int)APIHOOK_CPENCRYPT].pNewProc;
- }
- //else
- //dprintf(_T("[GetProcAddress] [%s][%s]\n"), szMod, lpProcName);
- }
- //else
- //dprintf(_T("[GetProcAddress] [%s][]\n"), szMod);
- }
-
- return ((FARPROC (WINAPI *)(HMODULE, LPCSTR))pAPIHooks[(int)APIHOOK_GETPROCADDRESS].pOldProc)(hModule, lpProcName);
-}
-
-struct hostent FAR * WINAPI new_gethostbyname(
- const char FAR *name
- )
-{
- dprintf("[new_gethostbyname] name(%s)\n", name);
-
- struct hostent FAR * hp = ((struct hostent FAR * (WINAPI *)(const char FAR *))pAPIHooks[(int)APIHOOK_GETHOSTBYNAME].pOldProc)(name);
-
- return hp;
-}
-
-int WINAPI new_connect(
- SOCKET s,
- const struct sockaddr FAR *name,
- int namelen
- )
-{
- dprintf("[connect] socket(0x%08X) host(%s) port(%d)\n", s, inet_ntoa(((struct sockaddr_in *)name)->sin_addr), ntohs(((struct sockaddr_in *)name)->sin_port));
-
- return ((int (WINAPI *)(SOCKET, const struct sockaddr FAR *, int))pAPIHooks[(int)APIHOOK_CONNECT].pOldProc)(s, name, namelen);
-}
-
-int WINAPI new_recv(
- SOCKET s,
- char *buf,
- int len,
- int flags
- )
-{
- //dprintf("[recv] socket(0x%08X)\n", s);
-
- int nRes = 0;
- {
- nRes = ((int (WINAPI *)(SOCKET, char *, int, int))pAPIHooks[APIHOOK_RECV].pOldProc)(s, buf, len, flags);
- }
-/*
- for (int j = 0; j < nRes; j += 16)
- {
- for (int k = 0; k < 16; k++)
- {
- if ((j + k) < nRes)
- {
- dprintf("%02x ", (unsigned char)buf[j+k]);
- }
- else
- {
- dprintf(" ");
- }
- }
-
- for (int k = 0; k < 16 && (j + k) < nRes; k++)
- {
- dprintf("%c", ((unsigned char)buf[j+k] >= 0x20 && (unsigned char)buf[j+k] <= 0x7E) ? (unsigned char)buf[j+k] : '.');
- }
-
- dprintf("\n");
- }
-*/
- return nRes;
-}
-
-int WINAPI new_recvfrom(
- SOCKET s,
- char *buf,
- int len,
- int flags,
- struct sockaddr *from,
- int *fromlen
- )
-{
- int nRes = 0;
- WORD wSeq = 0;
- int zerolen = 0;
- static char zerobuf[8192];
- bool bZerocoded = false;
- CServer *server = NULL;
- CSequence *sequence = NULL;
-
- nRes = ((int (WINAPI *)(SOCKET, char *, int, int, struct sockaddr *, int *))pAPIHooks[APIHOOK_RECVFROM].pOldProc)(s, buf, len, flags, from, fromlen);
-
- // !!!
- //return nRes;
-
- if (nRes > 0)
- {
- //dprintf("Receiving %u bytes\n", nRes);
-
- // Get packet sequence number
- memcpy(&wSeq, &buf[2], sizeof(wSeq));
- wSeq = htons(wSeq);
-
- // Get current server
- server = servers.FindServer((struct sockaddr_in *)from);
-
- // If server isn't in our list add it as new
- if (!server)
- {
- server = new CServer((struct sockaddr_in *)from);
- servers.AddServer(server);
- }
-
- // Handle packet acks
- BYTE bAppended[4096];
- int nAppendedLen = 0;
-
- if (buf[0] & MSG_APPENDED_ACKS)
- {
- //dprintf("APPENDED ACKS\n");
-
- BYTE cPacketsItems = buf[nRes - 1];
-
- int nOldRes = nRes;
-
- nRes = nOldRes - 1 - (cPacketsItems * sizeof(DWORD));
- //dprintf("NEW AND OLD: %d / %d\n", nRes, nOldRes);
- nAppendedLen = nOldRes - nRes;
- memcpy(bAppended, &buf[nRes], nAppendedLen);
- }
- zerolen = ZeroDecode(buf, nRes, zerobuf, sizeof(zerobuf));
-
- if ((unsigned char)buf[4] != 0xff)
- {
- // High
- //dprintf("parse high: %hu\n", zerobuf[4]);
-
- bool bCmdFound = false;
-
- for (int j = 0; pCMDHooks[j].szCommand; j++)
- {
- if (_tcsicmp(cmds_high[zerobuf[4]].lpszCmd, pCMDHooks[j].szCommand) == 0 && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
- {
- bCmdFound = true;
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_high[zerobuf[4]], server, zerobuf, &zerolen, 5);
- break;
- }
- }
-
- if (!bCmdFound)
- {
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_high[zerobuf[4]], server, zerobuf, &zerolen, 5);
- }
- }
-
- else if ((unsigned char)buf[5] != 0xff)
- {
- // Medium
- //dprintf("parse med: %hu\n", zerobuf[5]);
-
- bool bCmdFound = false;
-
- for (int j = 0; pCMDHooks[j].szCommand; j++)
- {
- if (!_tcsicmp(cmds_med[zerobuf[5]].lpszCmd, pCMDHooks[j].szCommand) && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
- {
- bCmdFound = true;
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_med[zerobuf[5]], server, zerobuf, &zerolen, 6);
- break;
- }
- }
-
- if (!bCmdFound)
- {
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_med[zerobuf[5]], server, zerobuf, &zerolen, 6);
- }
- }
-
- else if ((unsigned char)buf[4] == 0xff && (unsigned char)buf[5] == 0xff)
- {
- // Fixed
- // Low
-
- //dprintf("parse low: %hu\n", htons(wFreq));
-
- bool bCmdFound = false;
- WORD wFreq;
- memcpy(&wFreq, &zerobuf[6], sizeof(wFreq));
-
- for (int j = 0; pCMDHooks[j].szCommand; j++)
- {
- if (!_tcsicmp(cmds_low[htons(wFreq)].lpszCmd, pCMDHooks[j].szCommand) && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
- {
- bCmdFound = true;
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_low[htons(wFreq)], server, zerobuf, &zerolen, 8);
- break;
- }
- }
-
- if (!bCmdFound)
- {
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_low[htons(wFreq)], server, zerobuf, &zerolen, 8);
- }
- }
-
- nRes = ZeroEncode(zerobuf, zerolen, buf, len);
-
- if (nAppendedLen > 0)
- {
- memcpy(&buf[nRes], bAppended, nAppendedLen);
- nRes += nAppendedLen;
- }
- }
- else
- {
- // We can use this area to synthesize incoming packets
- }
-
- return nRes;
-}
-
-int WINAPI new_send(
- SOCKET s,
- const char *buf,
- int len,
- int flags
- )
-{
-// dprintf("[send] socket(0x%08X)\n", s);
-
- int nRes = 0;
- {
- nRes = ((int (WINAPI *)(SOCKET, const char *, int, int))pAPIHooks[APIHOOK_SEND].pOldProc)(s, buf, len, flags);
- }
-
- return nRes;
-}
-
-int WINAPI new_sendto(
- SOCKET s,
- char *buf,
- int len,
- int flags,
- struct sockaddr *to,
- int tolen
- )
-{
- int nRes = 0;
- WORD wSeq = 0;
- int zerolen = 0;
- char *zerobuf = NULL;
- bool bZerocoded = false;
- CServer *server = NULL;
- CSequence *sequence = NULL;
-
- // Get packet sequence number
- memcpy(&wSeq, &buf[2], sizeof(wSeq));
- wSeq = htons(wSeq);
-
- // Get current server
- server = servers.FindServer((struct sockaddr_in *)to);
-
- // If server isn't in our list add it as new
- if (!server)
- {
- server = new CServer((struct sockaddr_in *)to);
- servers.AddServer(server);
- }
-
- static int nDropPacket = 0;
-
- if (buf[0] & MSG_ZEROCODED)
- {
- bZerocoded = true;
- zerolen = 4;
-
- for (int i = 4; i < len; i++)
- {
- if ((unsigned char)buf[i] == 0x00)
- zerolen += (unsigned char)buf[++i];
- else
- zerolen++;
- }
-
- zerobuf = (char *)malloc(zerolen);
-
- if (!zerobuf)
- {
- dprintf("Couldn't allocate memory for zerocoded buffer\n");
- return -1;
- }
-
- int j = 4;
- memcpy(zerobuf, buf, 4);
-
- for (int i = 4; i < len; i++)
- {
- if ((unsigned char)buf[i] == 0x00)
- {
- for (int z = 0; z < (unsigned char)buf[i+1]; z++)
- zerobuf[j++] = 0x00;
-
- i++;
- }
- else
- zerobuf[j++] = buf[i];
- }
- }
- else
- {
- zerolen = len;
- zerobuf = buf;
- }
-
- nRes = ((int (WINAPI *)(SOCKET, char *, int, int, struct sockaddr *, int))pAPIHooks[APIHOOK_SENDTO].pOldProc)(s, buf, len, flags, to, tolen);
-
- // !!!
- //return nRes;
-
- //dprintf("Sending %u bytes\n", nRes);
-
- if ((unsigned char)buf[4] != 0xff)
- {
- // High
- //dprintf("parse high: %hu\n", zerobuf[4]);
-
- bool bCmdFound = false;
-
- for (int j = 0; pCMDHooks[j].szCommand; j++)
- {
- if (_tcsicmp(cmds_high[zerobuf[4]].lpszCmd, pCMDHooks[j].szCommand) == 0 && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
- {
- bCmdFound = true;
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_high[zerobuf[4]], server, zerobuf, &zerolen, 5);
- break;
- }
- }
-
- if (!bCmdFound)
- {
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_high[zerobuf[4]], server, zerobuf, &zerolen, 5);
- }
- }
-
- else if ((unsigned char)buf[5] != 0xff)
- {
- // Medium
- //dprintf("parse med: %hu\n", zerobuf[5]);
-
- bool bCmdFound = false;
-
- for (int j = 0; pCMDHooks[j].szCommand; j++)
- {
- if (!_tcsicmp(cmds_med[zerobuf[5]].lpszCmd, pCMDHooks[j].szCommand) && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
- {
- bCmdFound = true;
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_med[zerobuf[5]], server, zerobuf, &zerolen, 6);
- break;
- }
- }
-
- if (!bCmdFound)
- {
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_med[zerobuf[5]], server, zerobuf, &zerolen, 6);
- }
- }
-
- else if ((unsigned char)buf[4] == 0xff && (unsigned char)buf[5] == 0xff)
- {
- // Fixed
- // Low
-
- //dprintf("parse low: %hu\n", htons(wFreq));
-
- bool bCmdFound = false;
- WORD wFreq;
- memcpy(&wFreq, &zerobuf[6], sizeof(wFreq));
-
- for (int j = 0; pCMDHooks[j].szCommand; j++)
- {
- if (!_tcsicmp(cmds_low[htons(wFreq)].lpszCmd, pCMDHooks[j].szCommand) && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
- {
- bCmdFound = true;
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_low[htons(wFreq)], server, zerobuf, &zerolen, 8);
- break;
- }
- }
-
- if (!bCmdFound)
- {
- ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_low[htons(wFreq)], server, zerobuf, &zerolen, 8);
- }
- }
- else
- {
- dprintf("[sendto] *** UNKNOWN FREQUENCY TYPE ***\n", s);
- int i, j;
-
- for (i = 0; i < len + 16; i += 16)
- {
- for (j = 0; j < 16; j++)
- {
- if ((i + j) < len)
- {
- dprintf("%02x ", (unsigned char)buf[i+j]);
- }
- else
- {
- dprintf(" ");
- }
- }
-
- for (j = 0; j < 16 && (i + j) < len; j++)
- {
- dprintf("%c", isprint(buf[i+j]) ? (unsigned char)buf[i+j] : '.');
- }
-
- dprintf("\n");
- }
-
- dprintf("\n");
- }
-
- if (bZerocoded && zerobuf)
- free(zerobuf);
-
- return nRes;
-}
-
-/*
-LONG WINAPI new_SetWindowLongA(
- HWND hWnd,
- int nIndex,
- LONG dwNewLong
-)
-{
- LONG nRes = 0;
-
- if (nIndex == GWL_WNDPROC && g_pMainFrm && hWnd == g_pMainFrm->m_hWnd)
- {
- dprintf(_T("[SetWindowLongA] %08x [%x] = "), hWnd, dwNewLong);
-
- nRes = ((LONG (WINAPI *)(HWND, int, LONG))pAPIHooks[APIHOOK_SETWINDOWLONGA].pOldProc)(hWnd, nIndex, dwNewLong);
-
- dprintf(_T("[%x]\n"), nRes);
- }
- else
- {
- if (nIndex == GWL_WNDPROC)
- dprintf(_T("[SetWindowLongA] %08x [%x]\n"), hWnd, dwNewLong);
-
- nRes = ((LONG (WINAPI *)(HWND, int, LONG))pAPIHooks[APIHOOK_SETWINDOWLONGA].pOldProc)(hWnd, nIndex, dwNewLong);
- }
-
- return nRes;
-}
-
-LONG WINAPI new_SetWindowLongW(
- HWND hWnd,
- int nIndex,
- LONG dwNewLong
-)
-{
- LONG nRes = 0;
-
- if (nIndex == GWL_WNDPROC)
- {
- dprintf(_T("[SetWindowLongW] %08x\n"), hWnd);
-
- nRes = ((LONG (WINAPI *)(HWND, int, LONG))pAPIHooks[APIHOOK_SETWINDOWLONGW].pOldProc)(hWnd, nIndex, dwNewLong);
- }
- else
- {
- nRes = ((LONG (WINAPI *)(HWND, int, LONG))pAPIHooks[APIHOOK_SETWINDOWLONGW].pOldProc)(hWnd, nIndex, dwNewLong);
- }
-
- return nRes;
-}
-*/
-BOOL WINAPI new_InternetReadFile(
- IN HINTERNET hFile,
- IN LPVOID lpBuffer,
- IN DWORD dwNumberOfBytesToRead,
- OUT LPDWORD lpNumberOfBytesRead
-)
-{
- BOOL bRes = FALSE;
-
- bRes = ((BOOL (WINAPI *)(HINTERNET, LPVOID, DWORD, LPDWORD))pAPIHooks[APIHOOK_INTERNETREADFILE].pOldProc)(hFile, lpBuffer, dwNumberOfBytesToRead, lpNumberOfBytesRead);
-
- dprintf(_T("[InternetReadFile] [%s] %d\n"), lpBuffer, *lpNumberOfBytesRead);
-
- return bRes;
-}
-
-HINTERNET WINAPI new_InternetOpenUrlA(
- HINTERNET hInternet,
- LPCTSTR lpszUrl,
- LPCTSTR lpszHeaders,
- DWORD dwHeadersLength,
- DWORD dwFlags,
- DWORD_PTR dwContext
-)
-{
- HINTERNET hNet = 0;
-
- dprintf(_T("[InternetOpenUrlA] [%s][%s]\n"), lpszUrl, lpszHeaders);
-
- hNet = ((HINTERNET (WINAPI *)(HINTERNET, LPCTSTR, LPCTSTR, DWORD, DWORD, DWORD_PTR))pAPIHooks[APIHOOK_INTERNETOPENURLA].pOldProc)(hInternet, lpszUrl, lpszHeaders, dwHeadersLength, dwFlags, dwContext);
-
- return hNet;
-}
-
-BOOL WINAPI new_CPEncrypt(
- HCRYPTPROV hProv,
- HCRYPTKEY hKey,
- HCRYPTHASH hHash,
- BOOL Final,
- DWORD dwFlags,
- BYTE* pbData,
- DWORD* pdwDataLen,
- DWORD dwBufLen
-)
-{
- BOOL bRes = FALSE;
-
- bRes = ((BOOL (WINAPI *)(HCRYPTPROV, HCRYPTKEY, HCRYPTHASH, BOOL, DWORD, BYTE *, DWORD *, DWORD))pAPIHooks[APIHOOK_CPENCRYPT].pOldProc)(hProv, hKey, hHash, Final, dwFlags, pbData, pdwDataLen, dwBufLen);
-
- TCHAR szStr[2048];
- ZeroMemory(szStr, sizeof(szStr));
- memcpy(szStr, pbData, sizeof(szStr));
-
- dprintf(_T("[CPEncrypt] [%s] %d\n"), szStr, 0);
-
- return bRes;
-}
-
-BOOL WINAPI new_PeekMessageA(
- LPMSG lpMsg, // pointer to structure for message
- HWND hWnd, // handle to window
- UINT wMsgFilterMin, // first message
- UINT wMsgFilterMax, // last message
- UINT wRemoveMsg // removal flags
-)
-{
- //dprintf(_T("[PeekMessageA] [%x]\n"), hWnd);
-
- BOOL bRes = FALSE;
- static UINT uiAntiIdle = 0;
-
- bRes = ((BOOL (WINAPI *)(LPMSG, HWND, UINT, UINT, UINT))pAPIHooks[APIHOOK_PEEKMESSAGEA].pOldProc)(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
-
- if (!bRes && GetFocus() == NULL)
- {
- // Wait for any message sent or posted to this queue
- DWORD dwResult = MsgWaitForMultipleObjects(0, NULL, FALSE, 1000, QS_ALLINPUT);
-
- uiAntiIdle++;
-
- if (uiAntiIdle > 4)
- {
- //dprintf(_T("idle.. %d\n"), uiAntiIdle);
- if (g_pMainFrm)
- {
- //dprintf(_T("sending anti.. idle...\n"));
- PostMessage(g_pMainFrm->m_hWnd, WM_MOUSEMOVE, 0, MAKEWORD(10, 10));
- }
-
- uiAntiIdle = 0;
- }
- }
-
- static UINT uiAutoPilot = 0;
-
- if (g_pMainFrm)
- {
- //uiAutoPilot++;
-
- if (uiAutoPilot > 200)
- {
- WORD wRepeatCount = 1;
- LPARAM lParam = MAKELPARAM(wRepeatCount, 0);
-
- lParam |= 1 << 24;
- lParam |= 0 << 29;
- lParam |= 1 << 30;
- lParam |= 0 << 31;
-
- //PostMessage(g_pMainFrm->m_hWnd, WM_KEYDOWN, VK_UP, lParam);
-
- lParam |= 0 << 24;
- //PostMessage(g_pMainFrm->m_hWnd, WM_KEYDOWN, 'E', 0);
-
- char sc = 0;
- sc = MapVirtualKey('E', 0);
-
- for (int k = 0; k < 90; k++)
- PostMessage(g_pMainFrm->m_hWnd, WM_KEYDOWN, 'E', 1 | (1 << 30) | (sc << 16));
-
- //PostMessage(g_pMainFrm->m_hWnd, WM_KEYUP, 'E', 1 | (3 << 30) | (sc << 16));
-
- uiAutoPilot = 0;
- }
- }
-
- return bRes;
-}
-
-VOID WINAPI new_glEnable(
- GLenum cap
-)
-{
- dprintf(_T("[glEnable] [0x%08x]\n"), cap);
-
-// if (cap != GL_TEXTURE_2D)
- ((VOID (WINAPI *)(GLenum))pAPIHooks[APIHOOK_GLENABLE].pOldProc)(cap);
-// else
-// glDisable(GL_TEXTURE_2D);
-}
-
-GLboolean WINAPI new_glIsEnabled(
- GLenum cap
-)
-{
-// if (cap == GL_TEXTURE_2D)
-// return GL_TRUE;
-
- return ((GLboolean (WINAPI *)(GLenum))pAPIHooks[APIHOOK_GLISENABLED].pOldProc)(cap);
-}
-
-VOID WINAPI new_glTranslatef(
- GLfloat x,
- GLfloat y,
- GLfloat z
-)
-{
- dprintf(_T("[glTranslatef]\n"));
- ((VOID (WINAPI *)(GLfloat, GLfloat, GLfloat))pAPIHooks[APIHOOK_GLTRANSLATEF].pOldProc)(x, y, z);
-}
-
-VOID WINAPI new_glTranslated(
- GLdouble x,
- GLdouble y,
- GLdouble z
-)
-{
- dprintf(_T("[glTranslated]\n"));
- ((VOID (WINAPI *)(GLdouble, GLdouble, GLdouble))pAPIHooks[APIHOOK_GLTRANSLATED].pOldProc)(x, y, z);
-}
-
-VOID WINAPI new_glTexCoord2f(
- GLfloat s,
- GLfloat t
-)
-{
- ((VOID (WINAPI *)(GLfloat, GLfloat))pAPIHooks[APIHOOK_GLTEXCOORD2F].pOldProc)(s, t);
-}
-
-VOID WINAPI new_glVertex2f(
- GLfloat x,
- GLfloat y
-)
-{
- dprintf("[glVertex2f]\n");
- ((VOID (WINAPI *)(GLfloat, GLfloat))pAPIHooks[APIHOOK_GLVERTEX2F].pOldProc)(x, y);
-}
-
-VOID WINAPI new_glVertex3f(
- GLfloat x,
- GLfloat y,
- GLfloat z
-)
-{
- dprintf("[glVertex3f]\n");
- ((VOID (WINAPI *)(GLfloat, GLfloat, GLfloat))pAPIHooks[APIHOOK_GLVERTEX3F].pOldProc)(x, y, z);
-}
-
-// Moves floating name tags
-VOID WINAPI new_glVertex3fv(
- GLfloat *v
-)
-{
- dprintf("[glVertex3fv]\n");
- ((VOID (WINAPI *)(const GLfloat *v))pAPIHooks[APIHOOK_GLVERTEX3FV].pOldProc)(v);
-}
-
-VOID WINAPI new_glVertex4f(
- GLfloat x,
- GLfloat y,
- GLfloat z,
- GLfloat w
-)
-{
- dprintf("[glVertex4f]\n");
- ((VOID (WINAPI *)(GLfloat, GLfloat, GLfloat, GLfloat))pAPIHooks[APIHOOK_GLVERTEX4F].pOldProc)(x, y, z, w);
-}
-
-VOID WINAPI new_glVertex4fv(
- GLfloat *v
-)
-{
- dprintf("[glVertex4v]\n");
- ((VOID (WINAPI *)(const GLfloat *v))pAPIHooks[APIHOOK_GLVERTEX4FV].pOldProc)(v);
-}
-
-VOID WINAPI new_glTexCoord2fv(
- GLfloat *v
-)
-{
- ((VOID (WINAPI *)(GLfloat *))pAPIHooks[APIHOOK_GLTEXCOORD2FV].pOldProc)(v);
-}
-
-VOID WINAPI new_glColor4f(
- GLfloat red,
- GLfloat green,
- GLfloat blue,
- GLfloat alpha
-)
-{
- ((VOID (WINAPI *)(GLfloat, GLfloat, GLfloat, GLfloat))pAPIHooks[APIHOOK_GLCOLOR4F].pOldProc)(red, green, blue, alpha);
-}
-
-VOID WINAPI new_glColor3f(
- GLfloat red,
- GLfloat green,
- GLfloat blue
-)
-{
- GLfloat alpha;
- alpha = 1.0f;
-
- ((VOID (WINAPI *)(GLfloat, GLfloat, GLfloat, GLfloat))pAPIHooks[APIHOOK_GLCOLOR4F].pOldProc)(red, green, blue, alpha);
-}
-
-VOID WINAPI new_glColor4fv(
- GLfloat *v
-)
-{
- ((VOID (WINAPI *)(const GLfloat *))pAPIHooks[APIHOOK_GLCOLOR4FV].pOldProc)(v);
-}
-
-VOID WINAPI new_glColor4ubv(
- GLubyte *v
-)
-{
- ((VOID (WINAPI *)(const GLubyte *))pAPIHooks[APIHOOK_GLCOLOR4UBV].pOldProc)(v);
-}
-
-VOID WINAPI new_glColor3fv(
- GLfloat *v
-)
-{
- GLfloat n[4];
- n[0] = v[0];
- n[1] = v[1];
- n[2] = v[2];
- n[3] = 1.0;
-
- ((VOID (WINAPI *)(const GLfloat *))pAPIHooks[APIHOOK_GLCOLOR4FV].pOldProc)(n);
-}
-
-GLenum WINAPI new_glGetError(
- void
-)
-{
- dprintf("[glGetError] ");
- GLenum error = ((GLenum (WINAPI *)(void))pAPIHooks[APIHOOK_GLGETERROR].pOldProc)();
-
- dprintf("0x%x\n", error);
- if (error == GL_INVALID_OPERATION)
- return GL_NO_ERROR;
- else return error;
-}
-
-VOID WINAPI new_glColorPointer(
- GLint size,
- GLenum type,
- GLsizei stride,
- const GLvoid *pointer
-)
-{
- dprintf("[glColorPointer]\n");
- ((VOID (WINAPI *)(GLint, GLenum, GLsizei, const GLvoid *))pAPIHooks[APIHOOK_GLCOLORPOINTER].pOldProc)(size, type, stride, pointer);
-}
-
-// Used to render avatars and trees
-VOID WINAPI new_glDrawElements(
- GLenum mode,
- GLsizei count,
- GLenum type,
- const GLvoid *indices
-)
-{
- //glColor4f(1.0, 1.0, 1.0, 0.2);
- /*glBegin(GL_QUADS);
- for (int i = 0; i < 10; i++)
- {
- GLfloat fPosX;
- GLfloat fPosY;
- GLfloat fPosZ;
-
- fPosX = (float)(rand() % 300) - 150.0f;
- fPosY = -10;//(float)(rand() % 200) - 10.0f;
- fPosZ = (float)(rand() % 300) - 150.0f;
-
- glTexCoord2f(0.0, 1.0);
- glVertex3f(fPosX - 4.0f, fPosY + 1.0f, fPosZ - 4.0f);
-
- glTexCoord2f(0.0, 0.0);
- glVertex3f(fPosX - 4.0f, fPosY + 1.0f, fPosZ + 4.0f);
-
- glTexCoord2f(1.0, 0.0);
- glVertex3f(fPosX + 4.0f, fPosY + 1.0f, fPosZ + 4.0f);
-
- glTexCoord2f(1.0, 1.0);
- glVertex3f(fPosX + 4.0f, fPosY + 1.0f, fPosZ - 4.0f);
-
- }
- glEnd();*/
-
- dprintf("[glDrawElements] %d\n", count);
- ((VOID (WINAPI *)(GLenum, GLsizei, GLenum, const GLvoid *))pAPIHooks[APIHOOK_GLDRAWELEMENTS].pOldProc)(mode, count, type, indices);
-}
-
-VOID WINAPI new_glDrawArrays(
- GLenum mode,
- GLint first,
- GLsizei count
-)
-{
- dprintf("[glDrawArrays] %d\n", count);
- ((VOID (WINAPI *)(GLenum, GLint, GLsizei))pAPIHooks[APIHOOK_GLDRAWARRAYS].pOldProc)(mode, first, count);
-}
-
-VOID WINAPI new_glDrawPixels(
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- const GLvoid *pixels
-)
-{
- dprintf("[glDrawPixels]\n");
- ((VOID (WINAPI *)(GLsizei, GLsizei, GLenum, GLenum, const GLvoid))pAPIHooks[APIHOOK_GLDRAWPIXELS].pOldProc)(width, height, format, type, pixels);
-}
-
-VOID WINAPI new_glVertexPointer(
- GLint size,
- GLenum type,
- GLsizei stride,
- const GLvoid *pointer
-)
-{
- ((VOID (WINAPI *)(GLint, GLenum, GLsizei, const GLvoid *))pAPIHooks[APIHOOK_GLVERTEXPOINTER].pOldProc)(size, type, stride, pointer);
-}
-
-VOID WINAPI new_glNormalPointer(
- GLenum type,
- GLsizei stride,
- const GLvoid *pointer
-)
-{
- dprintf("[glNormalPointer]\n");
- ((VOID (WINAPI *)(GLenum, GLsizei, const GLvoid *))pAPIHooks[APIHOOK_GLNORMALPOINTER].pOldProc)(type, stride, pointer);
-}
-
-VOID WINAPI new_glTexCoordPointer(
- GLint size,
- GLenum type,
- GLsizei stride,
- const GLvoid *pointer
-)
-{
- ((VOID (WINAPI *)(GLint, GLenum, GLsizei, const GLvoid *))pAPIHooks[APIHOOK_GLTEXCOORDPOINTER].pOldProc)(size, type, stride, pointer);
-}
-
-VOID WINAPI new_glViewport(
- GLint x,
- GLint y,
- GLsizei width,
- GLsizei height
-)
-{
- ((VOID (WINAPI *)(GLint, GLint, GLsizei, GLsizei))pAPIHooks[APIHOOK_GLVIEWPORT].pOldProc)(x, y, width, height);
-}
-
-VOID WINAPI new_glTexImage2D(
- GLenum target,
- GLint level,
- GLint components,
- GLsizei width,
- GLsizei height,
- GLint border,
- GLenum format,
- GLenum type,
- const GLvoid *pixels
-)
-{
- ((VOID (WINAPI *)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *))pAPIHooks[APIHOOK_GLTEXIMAGE2D].pOldProc)(target, level, components, width, height, border, format, type, pixels);
-}
-
-VOID WINAPI new_gluPerspective(
- GLdouble fovy,
- GLdouble aspect,
- GLdouble zNear,
- GLdouble zFar
-)
-{
- ((VOID (WINAPI *)(GLdouble, GLdouble, GLdouble, GLdouble))pAPIHooks[APIHOOK_GLUPERSPECTIVE].pOldProc)(fovy, aspect, zNear, zFar);
-}
-
-VOID WINAPI new_glBegin(
- GLenum mode
-)
-{
- ((VOID (WINAPI *)(GLenum))pAPIHooks[APIHOOK_GLBEGIN].pOldProc)(mode);
-}
-
-VOID WINAPI new_glFlush(
- void
-)
-{
- ((VOID (WINAPI *)(void))pAPIHooks[APIHOOK_GLFLUSH].pOldProc)();
-}
-
-VOID WINAPI new_gluQuadricDrawStyle(
- GLUquadricObj * qobj,
- GLenum drawStyle
- )
-{
- ((VOID (WINAPI *)(GLUquadricObj *, GLenum))pAPIHooks[APIHOOK_GLUQUADRICDRAWSTYLE].pOldProc)(qobj, drawStyle);
-}
-
-VOID WINAPI new_gluTessVertex(
- GLUtesselator * tess,
- GLdouble coords[3],
- void * data
-)
-{
- dprintf("[gluTessVertex]\n");
- ((VOID (WINAPI *)(GLUtesselator *, GLdouble[3], void *))pAPIHooks[APIHOOK_GLUTESSVERTEX].pOldProc)(tess, coords, data);
-}
-
-BOOL WINAPI new_WriteFileA(
- HANDLE hFile, // handle to file to write to
- LPCVOID lpBuffer, // pointer to data to write to file
- DWORD nNumberOfBytesToWrite, // number of bytes to write
- LPDWORD lpNumberOfBytesWritten, // pointer to number of bytes written
- LPOVERLAPPED lpOverlapped // pointer to structure for overlapped I/O
-)
-{
- return ((BOOL (WINAPI *)(HANDLE, LPCVOID, DWORD, LPDWORD, LPOVERLAPPED))pAPIHooks[APIHOOK_WRITEFILEA].pOldProc)(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped);
-}
-
-BOOL WINAPI new_DeleteFileA(
- LPCTSTR lpFileName // pointer to name of file to delete
-)
-{
- dprintf("[DeleteFileA] %s\n", lpFileName);
-
- //return TRUE;
- return ((BOOL (WINAPI *)(LPCTSTR))pAPIHooks[APIHOOK_DELETEFILEA].pOldProc)(lpFileName);
-}
-
-int WINAPI new_lstrcmpiA(
- LPCTSTR lpString1, // pointer to first string
- LPCTSTR lpString2 // pointer to second string
-)
-{
- //dprintf("[lstrcmpiA] %s <> %s\n", lpString1, lpString2);
- return ((int (WINAPI *)(LPCTSTR, LPCTSTR))pAPIHooks[APIHOOK_LSTRCMPIA].pOldProc)(lpString1, lpString2);
-}
-
-APIHOOK pAPIHooks[] = {
- { NULL, _T("KERNEL32.DLL"), "GetProcAddress", FALSE, NULL, (PROC)new_GetProcAddress },
- { NULL, _T("KERNEL32.DLL"), "LoadLibraryA", FALSE, NULL, (PROC)new_LoadLibraryA },
- { NULL, _T("KERNEL32.DLL"), "LoadLibraryW", FALSE, NULL, (PROC)new_LoadLibraryW },
- { NULL, _T("KERNEL32.DLL"), "LoadLibraryExA", FALSE, NULL, (PROC)new_LoadLibraryExA },
- { NULL, _T("KERNEL32.DLL"), "LoadLibraryExW", FALSE, NULL, (PROC)new_LoadLibraryExW },
- { NULL, _T("KERNEL32.DLL"), "FreeLibraryA", FALSE, NULL, (PROC)new_FreeLibraryA },
- { NULL, _T("KERNEL32.DLL"), "DeleteFileA", FALSE, NULL, (PROC)new_DeleteFileA },
- { NULL, _T("XKERNEL32.DLL"), "WriteFileA", FALSE, NULL, (PROC)new_WriteFileA },
- { NULL, _T("XKERNEL32.DLL"), "lstrcmpiA", FALSE, NULL, (PROC)new_lstrcmpiA },
- { NULL, _T("WS2_32.DLL"), (LPCSTR)4, TRUE, NULL, (PROC)new_connect },
- { NULL, _T("WS2_32.DLL"), (LPCSTR)16, TRUE, NULL, (PROC)new_recv },
- { NULL, _T("WS2_32.DLL"), (LPCSTR)17, TRUE, NULL, (PROC)new_recvfrom },
- { NULL, _T("WS2_32.DLL"), (LPCSTR)19, TRUE, NULL, (PROC)new_send },
- { NULL, _T("WS2_32.DLL"), (LPCSTR)20, TRUE, NULL, (PROC)new_sendto },
- { NULL, _T("WS2_32.DLL"), (LPCSTR)52, TRUE, NULL, (PROC)new_gethostbyname },
-// { NULL, _T("USER32.DLL"), "SetWindowLongA", FALSE, NULL, (PROC)new_SetWindowLongA },
-// { NULL, _T("USER32.DLL"), "SetWindowLongW", FALSE, NULL, (PROC)new_SetWindowLongW },
- { NULL, _T("WININET.DLL"), "InternetReadFile", FALSE, NULL, (PROC)new_InternetReadFile },
- { NULL, _T("WININET.DLL"), "InternetOpenUrlA", FALSE, NULL, (PROC)new_InternetOpenUrlA },
- { NULL, _T("RSAENH.DLL"), "CPEncrypt", FALSE, NULL, (PROC)new_CPEncrypt },
- { NULL, _T("USER32.DLL"), "PeekMessageA", FALSE, NULL, (PROC)new_PeekMessageA },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glGetError", FALSE, NULL, (PROC)new_glGetError },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glBegin", FALSE, NULL, (PROC)new_glBegin },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glEnable", FALSE, NULL, (PROC)new_glEnable },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glIsEnabled", FALSE, NULL, (PROC)new_glIsEnabled },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTranslated", FALSE, NULL, (PROC)new_glTranslated },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTranslatef", FALSE, NULL, (PROC)new_glTranslatef },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTexCoord2f", FALSE, NULL, (PROC)new_glTexCoord2f },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTexCoord2fv", FALSE, NULL, (PROC)new_glTexCoord2fv },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertex2f", FALSE, NULL, (PROC)new_glVertex2f },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertex3f", FALSE, NULL, (PROC)new_glVertex3f },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertex3fv", FALSE, NULL, (PROC)new_glVertex3fv },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertex4f", FALSE, NULL, (PROC)new_glVertex4f },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertex4fv", FALSE, NULL, (PROC)new_glVertex4fv },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertexPointer", FALSE, NULL, (PROC)new_glVertexPointer },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTexCoordPointer", FALSE, NULL, (PROC)new_glTexCoordPointer },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glNormalPointer", FALSE, NULL, (PROC)new_glNormalPointer },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glDrawElements", FALSE, NULL, (PROC)new_glDrawElements },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glDrawArrays", FALSE, NULL, (PROC)new_glDrawArrays },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glDrawPixels", FALSE, NULL, (PROC)new_glDrawPixels },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTexImage2D", FALSE, NULL, (PROC)new_glTexImage2D },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColor3f", FALSE, NULL, (PROC)new_glColor3f },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColor3fv", FALSE, NULL, (PROC)new_glColor3fv },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColor4f", FALSE, NULL, (PROC)new_glColor4f },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColor4fv", FALSE, NULL, (PROC)new_glColor4fv },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColor4ubv", FALSE, NULL, (PROC)new_glColor4ubv },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColorPointer", FALSE, NULL, (PROC)new_glColorPointer },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glViewport", FALSE, NULL, (PROC)new_glViewport },
-// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glFlush", FALSE, NULL, (PROC)new_glFlush },
-// { NULL, _T("UNCOMMENT"/*"GLU32.DLL"*/), "gluPerspective", FALSE, NULL, (PROC)new_gluPerspective },
-// { NULL, _T("UNCOMMENT"/*"GLU32.DLL"*/), "gluQuadricDrawStyle", FALSE, NULL, (PROC)new_gluQuadricDrawStyle },
-// { NULL, _T("UNCOMMENT"/*"GLU32.DLL"*/), "gluTessVertex", FALSE, NULL, (PROC)new_gluTessVertex },
- { NULL, NULL, NULL, FALSE, NULL, NULL }
-};
-
-PROC HookModuleImport(HMODULE hModule, LPCTSTR szModule, LPCSTR szImport, PROC pNewProc, BOOL bOrdinal)
-{
- PIMAGE_DOS_HEADER pDOSHeader = (PIMAGE_DOS_HEADER)hModule;
-
- if (IsBadReadPtr(pDOSHeader, sizeof(IMAGE_DOS_HEADER)) || pDOSHeader->e_magic != IMAGE_DOS_SIGNATURE)
- {
- SetLastErrorEx(ERROR_INVALID_PARAMETER, SLE_ERROR);
- return NULL;
- }
-
- PIMAGE_NT_HEADERS pNTHeader = MAKEPTR (PIMAGE_NT_HEADERS, pDOSHeader, pDOSHeader->e_lfanew);
- if (IsBadReadPtr(pNTHeader, sizeof(IMAGE_NT_HEADERS)) || pNTHeader->Signature != IMAGE_NT_SIGNATURE)
- {
- SetLastErrorEx(ERROR_INVALID_PARAMETER, SLE_ERROR);
- return NULL;
- }
-
- if (pNTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size != 0)
- {
- PIMAGE_IMPORT_DESCRIPTOR pImportDesc = MAKEPTR(PIMAGE_IMPORT_DESCRIPTOR, pDOSHeader, pNTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
- while (pImportDesc && pImportDesc->Name != NULL)
- {
- PTSTR szImportModule = MAKEPTR(PTSTR, pDOSHeader, pImportDesc->Name);
- if (szImportModule != NULL && _tcsicmp(szImportModule, szModule) == 0)
- {
- PIMAGE_THUNK_DATA pOrigThunk = MAKEPTR(PIMAGE_THUNK_DATA, hModule, pImportDesc->OriginalFirstThunk);
- PIMAGE_THUNK_DATA pRealThunk = MAKEPTR(PIMAGE_THUNK_DATA, hModule, pImportDesc->FirstThunk);
- while (pOrigThunk != NULL && pRealThunk != NULL && pOrigThunk->u1.Function != NULL && pRealThunk->u1.Function)
- {
- PIMAGE_IMPORT_BY_NAME pByName = MAKEPTR(PIMAGE_IMPORT_BY_NAME, hModule, pOrigThunk->u1.AddressOfData);
-
- if ((!bOrdinal && IMAGE_ORDINAL_FLAG != (pOrigThunk->u1.Ordinal & IMAGE_ORDINAL_FLAG) && pByName->Name[0] != 0 && stricmp((char*)pByName->Name, szImport) == 0) || (bOrdinal && IMAGE_ORDINAL(pOrigThunk->u1.Ordinal) == (DWORD)szImport))
- {
- PROC pOldProc;
-
- /*
- Retrieve memory information
- */
- MEMORY_BASIC_INFORMATION mbi;
- if (VirtualQuery(pRealThunk, &mbi, sizeof(MEMORY_BASIC_INFORMATION)))
- {
- /*
- Give ourselves write access
- */
- if (VirtualProtect(mbi.BaseAddress, mbi.RegionSize, PAGE_READWRITE, &mbi.Protect))
- {
- /*
- Store old function pointer for return value
- */
- pOldProc = (PROC)pRealThunk->u1.Function;
- /*
- Only patch import table if the new function is different than the old one
- */
- if (pNewProc != NULL && pOldProc != pNewProc) pRealThunk->u1.Function = (DWORD)pNewProc;
-
- /*
- Restore old protection value
- */
- DWORD dwOldProtect;
- VirtualProtect(mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &dwOldProtect);
- }
-
-// TCHAR szModuleFileName[MAX_PATH];
-// GetModuleFileName(hModule, szModuleFileName, sizeof(szModuleFileName));
-// dprintf(_T("HOOKED [%s => %s]\n"), szImport, szModuleFileName);
-// return pOldProc;
- }
- }
- pOrigThunk++;
- pRealThunk++;
- }
- }
- pImportDesc++;
- }
- }
-
- return NULL;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-//
-// Retrieve the loaded modules for the specified process
-//
-// dwProccessID Process ID of the process whose loaded module list you wish to retrive.
-// Specify 0 for the current process.
-//
-// pModules Pointer to an array of MODULEINFO structures to store the module list.
-// Can be NULL.
-//
-// puiCount Specify 0 to retrieve the module count otherwise the maximum number of
-// entries in the pModule array to return.
-//
-// Return Value
-//
-// Returns FALSE if failed
-//
-///////////////////////////////////////////////////////////////////////////////////////////
-BOOL GetModuleList(DWORD dwProcessID, PMODULEENTRY32 pModules, LPUINT puiCount)
-{
-// dprintf(_T("[GetModuleList]\n"));
-
- HANDLE hSnapshot;
- MODULEENTRY32 cME32;
- UINT uiCount = 0;
-
- if (puiCount == NULL)
- {
- SetLastErrorEx(ERROR_INVALID_PARAMETER, SLE_ERROR);
- return FALSE;
- }
-
- hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessID);
- if (hSnapshot == INVALID_HANDLE_VALUE)
- {
- return FALSE;
- }
-
- ZeroMemory(&cME32, sizeof(cME32));
- cME32.dwSize = sizeof(MODULEENTRY32);
- if (Module32First(hSnapshot, &cME32) == TRUE)
- {
- do
- {
- if (pModules != NULL && *puiCount)
- {
- _tcsncpy(pModules[uiCount].szModule, cME32.szModule, MAX_PATH);
- pModules[uiCount].hModule = cME32.hModule;
- }
- uiCount++;
- } while (Module32Next(hSnapshot, &cME32) == TRUE && (*puiCount == 0 || uiCount < *puiCount));
- }
-
- CloseHandle(hSnapshot);
-
- *puiCount = uiCount;
-
- return TRUE;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-//
-// Save pointers to old functions
-//
-///////////////////////////////////////////////////////////////////////////////////////////
-void SaveImportHooks()
-{
-// dprintf(_T("[SaveImportHooks]\n"));
-
- INT i;
-
- for (i = 0; pAPIHooks[i].szModule; i++)
- {
- /*
- Only store pointers for any functions we haven't taken care of yet so this may be called multiple times
- */
- if (pAPIHooks[i].pOldProc == NULL)
- {
- pAPIHooks[i].pOldProc = GetProcAddress(GetModuleHandle(pAPIHooks[i].szModule), (LPCSTR)pAPIHooks[i].szImport);
-// dprintf(_T("Saved import for %s(%s) at 0x%08X\n"), pAPIHooks[i].szModule, pAPIHooks[i].szImport, pAPIHooks[i].pOldProc);
- }
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-//
-// Patch import table of all loaded modules
-//
-///////////////////////////////////////////////////////////////////////////////////////////
-void InstallImportHooks()
-{
-// dprintf(_T("[InstallImportHooks]\n"));
-
- /*
- Retrieve number of loaded modules
- */
- UINT uiCount = 0;
- INT i, j;
- if (GetModuleList(0, NULL, &uiCount))
- {
- /*
- Allocate temporary table of loaded modules
- */
- PMODULEENTRY32 pModules = (PMODULEENTRY32)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, uiCount*sizeof(MODULEENTRY32));
- if (pModules != NULL)
- {
- /*
- Retrieve table of loaded modules
- */
- if (GetModuleList(0, pModules, &uiCount))
- {
- /*
- Loop through each module and patch its import table
- */
- for (i = 0; i < (INT)uiCount; i++)
- {
- /*
- Loop through each API hook and patch import table for this module
- HookModuleImport() takes care of dupe checking
- */
- for (j = 0; pAPIHooks[j].szModule; j++)
- {
- if (_tcsicmp(pModules[i].szModule, _T("SNOWFLAKE.DLL")) && _tcsicmp(pModules[i].szModule, _T("FMOD.DLL")) && /*_tcsicmp(pModules[i].szModule, _T("NEWVIEW.EXE")) &&*/ _tcsicmp(pModules[i].szModule, pAPIHooks[j].szModule) && pAPIHooks[j].pNewProc != NULL && !IsBadCodePtr(pAPIHooks[j].pNewProc))
- {
- HookModuleImport(pModules[i].hModule, pAPIHooks[j].szModule, pAPIHooks[j].szImport, pAPIHooks[j].pNewProc, pAPIHooks[j].bOrdinal);
- }
- }
- }
- }
- GlobalFree(pModules);
- }
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-//
-// Removes the import table for all loaded modules back to the original saved functions
-//
-///////////////////////////////////////////////////////////////////////////////////////////
-void RemoveImportHooks()
-{
- dprintf(_T("[RemoveImportHooks]\n"));
-
- /*
- Retrieve number of loaded modules
- */
- UINT uiCount = 0;
- INT i, j;
- if (GetModuleList(0, NULL, &uiCount))
- {
- /*
- Allocate temporary table of loaded modules
- */
- PMODULEENTRY32 pModules = (PMODULEENTRY32)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, uiCount*sizeof(MODULEENTRY32));
- if (pModules != NULL)
- {
- /*
- Retrieve table of loaded modules
- */
- if (GetModuleList(0, pModules, &uiCount))
- {
- /*
- Loop through each module and patch its import table
- */
- for (i = 0; i < (INT)uiCount; i++)
- {
- /*
- Loop through each API hook and restore import table for this module
- */
-// dprintf("RESTORE [%s]\n", pModules[i].szModule);
- for (j = 0; pAPIHooks[j].szModule; j++)
- {
- if (_tcsicmp(pModules[i].szModule, _T("SNOWFLAKE.DLL")) && /*_tcsicmp(pModules[i].szModule, _T("NEWVIEW.EXE")) &&*/ _tcsicmp(pModules[i].szModule, pAPIHooks[j].szModule) && pAPIHooks[j].pOldProc != NULL && !IsBadCodePtr(pAPIHooks[j].pOldProc))
- {
-// dprintf(_T("REMOVE [%s => %s]\n"), pAPIHooks[j].szImport, pModules[i].szModule);
- HookModuleImport(pModules[i].hModule, pAPIHooks[j].szModule, pAPIHooks[j].szImport, pAPIHooks[j].pOldProc, pAPIHooks[j].bOrdinal);
- }
- }
- }
-
- for (j = 0; pAPIHooks[j].szModule; j++)
- {
- pAPIHooks[j].pOldProc = NULL;
- }
- }
- GlobalFree(pModules);
- }
- }
-}
-
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- if (ul_reason_for_call == DLL_PROCESS_ATTACH)
- {
- TCHAR szPath[MAX_PATH];
-
- g_hinstDLL = (HINSTANCE)hModule;
- _Module.Init(NULL, g_hinstDLL);
- DisableThreadLibraryCalls(g_hinstDLL);
-
- if (GetModuleFileName(GetModuleHandle(0), szPath, MAX_PATH))
- {
- _tcsupr(szPath);
-
- if (_tcsstr(szPath, _T("\\SECONDLIFE.EXE")))
- {
- if (!g_pConfig)
- g_pConfig = new CConfig();
-
-#ifdef ECHO
- AllocConsole();
-
- if (!fpLog)
- fpLog = fopen(g_pConfig->m_pSnowcrashTxtPath, "w");
-#endif
- dprintf(_T("[snowflake] %s\n"), szPath);
-
- decomm();
-
- SaveImportHooks();
- InstallImportHooks();
- }
- }
- } else if (ul_reason_for_call == DLL_PROCESS_DETACH)
- {
- RemoveSLHooks();
- RemoveImportHooks();
-#ifdef ECHO
- FreeConsole();
-
- if (fpLog)
- {
- fclose(fpLog);
- fpLog = NULL;
- }
-#endif
- _Module.Term();
- }
-
- return TRUE;
-}
-
-LRESULT CALLBACK CBTHookProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
- switch(nCode)
- {
- case HCBT_ACTIVATE:
- {
- if (!g_pMainFrm)
- {
- TCHAR szClass[128];
- HWND hwnd = (HWND)wParam;
-
- if (GetClassName(hwnd, szClass, sizeof(szClass)))
- {
- if (_tcsicmp(szClass, _T("Second Life")) == 0)
- {
- TCHAR szTitle[256];
- GetWindowText(hwnd, szTitle, sizeof(szTitle));
-
- if (_tcsstr(szTitle, "Second Life"))
- {
- dprintf(_T(">>> [%s][%s]\n"), szClass, szTitle);
- InstallSLHooks(hwnd);
- }
- }
- else
- dprintf(_T(">>> [%s]\n"), szClass);
- }
- }
- }
- break;
-
- case HCBT_CREATEWND:
- {
- TCHAR szClass[128];
- HWND hwnd = (HWND)wParam;
- LPCBT_CREATEWND lpcbt = (LPCBT_CREATEWND)lParam;
-
- if (GetClassName(hwnd, szClass, sizeof(szClass)))
- {
- //dprintf(_T(">>> [%s]\n"), szClass);
- //if (_tcsicmp(szClass, _T("OpenGL")) == 0)
- //{
- //dprintf(_T("[snowflake] SL window created\n"));
- //InstallSLHooks(hwnd);
- //}
- }
- }
- break;
-
- case HCBT_DESTROYWND:
- {
- TCHAR szClass[128];
- HWND hwnd = (HWND)wParam;
-
- if (GetClassName(hwnd, szClass, sizeof(szClass)))
- {
- if (g_pMainFrm && g_pMainFrm->m_hWnd == hwnd)
- {
- dprintf(_T("[snowflake] SL window destroyed\n"));
- RemoveSLHooks();
- }
- }
- }
- break;
- }
- return ::CallNextHookEx(h_hCBTHook, nCode, wParam, lParam);
-}
-
-SNOWFLAKE_API bool InstallSystemHook(void)
-{
-// dprintf(_T("[InstallSystemHook]\n"));
-
- if (h_hCBTHook == NULL)
- {
- h_hCBTHook = ::SetWindowsHookEx(WH_CBT, CBTHookProc, g_hinstDLL, 0);
- }
-
- return (h_hCBTHook != NULL);
-}
-
-SNOWFLAKE_API BOOL RemoveSystemHook()
-{
- dprintf(_T("[RemoveSystemHook]\n"));
-
- if (h_hCBTHook != NULL)
- {
- if (UnhookWindowsHookEx(h_hCBTHook))
- {
- h_hCBTHook = NULL;
-
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-bool InstallSLHooks(HWND hwnd)
-{
- _Module.AddMessageLoop(&g_msgLoop);
-
- if (g_pMainFrm == NULL)
- {
- g_pMainFrm = new CMainFrame();
-
- if (g_pMainFrm->SubclassWindow(hwnd))
- {
- return true;
- }
- }
-
- return false;
-}
-
-bool RemoveSLHooks()
-{
- if (g_pMainFrm != NULL)
- {
- dprintf(_T("RemoveSLHooks MainFrm\n"));
- if (g_pMainFrm->m_hWnd != NULL && ::IsWindow(*g_pMainFrm))
- {
- dprintf(_T("RemoveSLHooks MainFrm Unsub\n"));
- g_pMainFrm->UnsubclassWindow(TRUE);
- g_pMainFrm->m_hWnd = NULL;
- } else
- g_pMainFrm->m_hWnd = NULL;
- delete(g_pMainFrm);
- g_pMainFrm = NULL;
-
- return true;
- }
-
- return false;
-}
+// snowflake.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include ".\snowflake.h"
+#include ".\MainFrame.h"
+#include ".\Server.h"
+#include ".\ServerList.h"
+#include ".\Message.h"
+#include ".\Block.h"
+#include ".\Var.h"
+#include ".\Config.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include ".\keywords.h"
+
+#pragma pack(1)
+
+struct COMMANDVAR
+{
+ char *lpszVar;
+ int nKeywordPos;
+ int nType;
+ int nTypeLen;
+ struct COMMANDVAR *lpNext;
+ struct COMMANDVAR *lpPrev;
+} typedef COMMANDVARS;
+
+typedef COMMANDVAR * LPCOMMANDVAR;
+typedef COMMANDVARS * LPCOMMANDVARS;
+
+struct COMMANDSTRUCT
+{
+ char *lpszStruct;
+ int nKeywordPos;
+ int nType;
+ BYTE cItems;
+ LPCOMMANDVARS vars;
+ struct COMMANDSTRUCT *lpNext;
+ struct COMMANDSTRUCT *lpPrev;
+} typedef COMMANDSTRUCTS;
+
+typedef COMMANDSTRUCT * LPCOMMANDSTRUCT;
+typedef COMMANDSTRUCTS * LPCOMMANDSTRUCTS;
+
+typedef struct
+{
+ char *lpszCmd;
+ bool bZerocoded;
+ bool bTrusted;
+ LPCOMMANDSTRUCTS structs;
+} COMMAND;
+
+typedef COMMAND * LPCOMMAND;
+
+#define MAX_COMMANDS_LOW 65536
+#define MAX_COMMANDS_MEDIUM 256
+#define MAX_COMMANDS_HIGH 256
+
+COMMAND cmds_low[MAX_COMMANDS_LOW];
+COMMAND cmds_med[MAX_COMMANDS_MEDIUM];
+COMMAND cmds_high[MAX_COMMANDS_HIGH];
+
+typedef struct
+{
+ LPCTSTR szCommand;
+ PROC pProc;
+} CMDHOOK, *LPCMDHOOK;
+
+CMDHOOK pCMDHooks[];
+
+#pragma data_seg(".shared")
+HHOOK h_hCBTHook = NULL;
+#pragma data_seg()
+#pragma comment(linker, "/SECTION:.shared,RWS")
+
+HINSTANCE g_hinstDLL = NULL;
+HMODULE g_hOpenGL = NULL;
+CMainFrame* g_pMainFrm = NULL;
+CAppModule _Module;
+CMessageLoop g_msgLoop;
+CConfig* g_pConfig = NULL;
+BOOL g_bAllowSub = TRUE;
+
+CServerList servers;
+
+typedef struct
+{
+ LPCTSTR szPatch;
+ LPCTSTR szModule;
+ LPCSTR szImport;
+ BOOL bOrdinal;
+ PROC pOldProc;
+ PROC pNewProc;
+} APIHOOK, *LPAPIHOOK;
+
+APIHOOK pAPIHooks[];
+
+#define MAKEPTR(cast, ptr, add) (cast)((DWORD)(ptr)+(DWORD)(add))
+
+enum APIHOOKS
+{
+ APIHOOK_GETPROCADDRESS,
+ APIHOOK_LOADLIBRARYA,
+ APIHOOK_LOADLIBRARYW,
+ APIHOOK_LOADLIBRARYEXA,
+ APIHOOK_LOADLIBRARYEXW,
+ APIHOOK_FREELIBRARYA,
+ APIHOOK_DELETEFILEA,
+ APIHOOK_WRITEFILEA,
+ APIHOOK_LSTRCMPIA,
+ APIHOOK_CONNECT,
+ APIHOOK_RECV,
+ APIHOOK_RECVFROM,
+ APIHOOK_SEND,
+ APIHOOK_SENDTO,
+ APIHOOK_GETHOSTBYNAME,
+// APIHOOK_SETWINDOWLONGA,
+// APIHOOK_SETWINDOWLONGW,
+ APIHOOK_INTERNETREADFILE,
+ APIHOOK_INTERNETOPENURLA,
+ APIHOOK_CPENCRYPT,
+ APIHOOK_PEEKMESSAGEA,
+ APIHOOK_GLGETERROR,
+ APIHOOK_GLBEGIN,
+ APIHOOK_GLENABLE,
+ APIHOOK_GLISENABLED,
+ APIHOOK_GLTRANSLATED,
+ APIHOOK_GLTRANSLATEF,
+ APIHOOK_GLTEXCOORD2F,
+ APIHOOK_GLTEXCOORD2FV,
+ APIHOOK_GLVERTEX2F,
+ APIHOOK_GLVERTEX3F,
+ APIHOOK_GLVERTEX3FV,
+ APIHOOK_GLVERTEX4F,
+ APIHOOK_GLVERTEX4FV,
+ APIHOOK_GLVERTEXPOINTER,
+ APIHOOK_GLTEXCOORDPOINTER,
+ APIHOOK_GLNORMALPOINTER,
+ APIHOOK_GLDRAWELEMENTS,
+ APIHOOK_GLDRAWARRAYS,
+ APIHOOK_GLDRAWPIXELS,
+ APIHOOK_GLTEXIMAGE2D,
+ APIHOOK_GLCOLOR3F,
+ APIHOOK_GLCOLOR3FV,
+ APIHOOK_GLCOLOR4F,
+ APIHOOK_GLCOLOR4FV,
+ APIHOOK_GLCOLOR4UBV,
+ APIHOOK_GLCOLORPOINTER,
+ APIHOOK_GLVIEWPORT,
+ APIHOOK_GLFLUSH,
+ APIHOOK_GLUPERSPECTIVE,
+ APIHOOK_GLUQUADRICDRAWSTYLE,
+ APIHOOK_GLUTESSVERTEX,
+ APIHOOK_NULL
+};
+
+bool InstallSLHooks(HWND hwnd);
+bool RemoveSLHooks();
+void InstallImportHooks();
+void RemoveImportHooks();
+void SaveImportHooks();
+
+int ZeroDecode(char *src, int srclen, char *dest, int destlen)
+{
+ int zerolen = 0;
+
+ if (src[0] & MSG_ZEROCODED)
+ {
+ memcpy(dest, src, 4);
+ zerolen += 4;
+
+ for (int i = zerolen; i < srclen; i++)
+ {
+ if ((unsigned char)src[i] == 0x00)
+ {
+ for (unsigned char j = 0; j < (unsigned char)src[i+1]; j++)
+ dest[zerolen++] = 0x00;
+
+ i++;
+ }
+ else
+ dest[zerolen++] = src[i];
+ }
+ }
+ else
+ {
+ memcpy(dest, src, srclen);
+ zerolen = srclen;
+ }
+
+ return zerolen;
+}
+
+int ZeroEncode(char *src, int srclen, char *dest, int destlen)
+{
+ int zerolen = 0;
+ unsigned char zerocount = 0;
+
+ if (src[0] & MSG_ZEROCODED)
+ {
+ memcpy(dest, src, 4);
+ zerolen += 4;
+
+ for (int i = zerolen; i < srclen; i++)
+ {
+ if ((unsigned char)src[i] == 0x00)
+ {
+ zerocount++;
+
+ if (zerocount == 0)
+ {
+ dest[zerolen++] = 0x00;
+ dest[zerolen++] = 0xff;
+ zerocount++;
+ }
+ }
+ else
+ {
+ if (zerocount)
+ {
+ dest[zerolen++] = 0x00;
+ dest[zerolen++] = zerocount;
+ zerocount = 0;
+ }
+
+ dest[zerolen++] = src[i];
+ }
+ }
+
+ if (zerocount)
+ {
+ dest[zerolen++] = 0x00;
+ dest[zerolen++] = zerocount;
+ }
+ }
+ else
+ {
+ memcpy(dest, src, srclen);
+ zerolen = srclen;
+ }
+
+ return zerolen;
+}
+
+// Convert a "hex string" to an integer by Anders Molin
+int httoi(const TCHAR *value)
+{
+ struct HEXMAP
+ {
+ TCHAR c;
+ int value;
+ };
+
+ const int nHexMap = 16;
+
+ HEXMAP hmLookup[nHexMap] =
+ {
+ {'0', 0}, {'1', 1},
+ {'2', 2}, {'3', 3},
+ {'4', 4}, {'5', 5},
+ {'6', 6}, {'7', 7},
+ {'8', 8}, {'9', 9},
+ {'A', 10}, {'B', 11},
+ {'C', 12}, {'D', 13},
+ {'E', 14}, {'F', 15}
+ };
+
+ TCHAR *mstr = _tcsupr(_tcsdup(value));
+ TCHAR *s = mstr;
+ int result = 0;
+
+ if (*s == '0' && *(s + 1) == 'X')
+ s += 2;
+
+ bool firsttime = true;
+
+ while (*s != '\0')
+ {
+ bool found = false;
+
+ for (int i = 0; i < nHexMap; i++)
+ {
+ if (*s == hmLookup[i].c)
+ {
+ if (!firsttime)
+ result <<= 4;
+
+ result |= hmLookup[i].value;
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ break;
+
+ s++;
+ firsttime = false;
+ }
+
+ free(mstr);
+
+ return result;
+}
+
+// Trim beginning, ending, and excess embedded whitespace from a string
+char *trim(char *szStr)
+{
+ char *iBuf, *oBuf;
+
+ if (szStr)
+ {
+ for (iBuf = oBuf = szStr; *iBuf;)
+ {
+ while (*iBuf && (isspace(*iBuf)))
+ iBuf++;
+
+ if (*iBuf && (oBuf != szStr))
+ *(oBuf++) = ' ';
+
+ while (*iBuf && (!isspace(*iBuf)))
+ *(oBuf++) = *(iBuf++);
+ }
+
+ *oBuf = NULL;
+ }
+
+ return(szStr);
+}
+
+int get_var_type(TCHAR *lptszType)
+{
+ int i = 0;
+
+ while (LLTYPES[i])
+ {
+ if (!_tcscmp(lptszType, LLTYPES[i]))
+ {
+ //printf("Type: %s\n", LLTYPES[i]);
+ return i;
+ }
+
+ i++;
+ }
+
+ return -1;
+}
+
+int get_keyword_pos(TCHAR *lptszKeyword)
+{
+ int i = 0;
+
+ while (LLKEYWORDS[i])
+ {
+ if (!_tcscmp(lptszKeyword, LLKEYWORDS[i]))
+ {
+ //printf("Keyword: %s\n", LLKEYWORDS[i]);
+ return i;
+ }
+
+ i++;
+ }
+
+ dprintf("Unhandled keyword: %s\n", lptszKeyword);
+ return -1;
+}
+
+// Get message template block deliminator positions
+bool get_block_markers(LPBYTE lpBuffer, DWORD &dwStart, DWORD &dwEnd, DWORD &dwChildren)
+{
+ DWORD dwStartBlock = 0;
+ DWORD dwEndBlock = 0;
+ DWORD dwDepth = 0;
+
+ dwChildren = 0;
+
+ for (DWORD dwPos = dwStart; dwPos <= dwEnd; dwPos++)
+ {
+ if (lpBuffer[dwPos] == '{')
+ {
+ dwDepth++;
+
+ if (dwDepth == 1)
+ dwStartBlock = dwPos;
+ else if (dwDepth == 2 && !dwChildren)
+ dwChildren = dwPos;
+ }
+
+ else if (lpBuffer[dwPos] == '}')
+ {
+ dwDepth--;
+
+ if (dwDepth == 0 && dwStartBlock)
+ {
+ dwEndBlock = dwPos;
+ dwStart = dwStartBlock;
+ dwEnd = dwEndBlock;
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+// Parse the variables message template block of a struct
+bool get_var_blocks(LPCOMMANDSTRUCT lpStruct, LPBYTE lpBuffer, DWORD dwStart, DWORD dwEnd)
+{
+ DWORD dwVarStart = dwStart;
+ DWORD dwVarEnd = dwEnd;
+ DWORD dwVarChildren = 0;
+
+ while (get_block_markers(lpBuffer, dwVarStart, dwVarEnd, dwVarChildren))
+ {
+ char szVarLine[256];
+ DWORD dwVarLen = (dwVarChildren ? dwVarChildren - 1 : dwVarEnd - 1) - dwVarStart;
+
+ memcpy(&szVarLine, &lpBuffer[dwVarStart+1], dwVarLen);
+ szVarLine[dwVarLen] = '\0';
+ trim(szVarLine);
+
+ //printf("\t\t%s\n", szVarLine);
+
+ char *lpszVar = strtok(szVarLine, " ");
+ char *lpszType = strtok(NULL, " ");
+ char *lpszTypeLen = NULL;
+ int nKeywordPos = get_keyword_pos(lpszVar);
+ int nVarType = get_var_type(lpszType);
+
+ LPCOMMANDVAR lpVar = lpStruct->vars;
+
+ if (lpVar)
+ {
+ // Insert after an item
+ if (nKeywordPos > lpVar->nKeywordPos)
+ {
+ while (lpVar->lpNext && nKeywordPos > lpVar->lpNext->nKeywordPos)
+ lpVar = lpVar->lpNext;
+
+ LPCOMMANDVAR lpBelow = lpVar->lpNext;
+
+ lpVar->lpNext = (LPCOMMANDVAR)malloc(sizeof(COMMANDVAR));
+
+ if (!lpVar->lpNext)
+ return false;
+
+ ZeroMemory(lpVar->lpNext, sizeof(COMMANDVAR));
+ lpVar->lpNext->lpPrev = lpVar;
+ lpVar->lpNext->lpNext = lpBelow;
+ lpVar = lpVar->lpNext;
+ }
+ // Insert before all items
+ else
+ {
+ lpVar->lpPrev = (LPCOMMANDVAR)malloc(sizeof(COMMANDVAR));
+
+ if (!lpVar->lpPrev)
+ return false;
+
+ ZeroMemory(lpVar->lpPrev, sizeof(COMMANDVAR));
+
+ lpVar->lpPrev->lpNext = lpVar;
+ lpVar->lpPrev->lpPrev = NULL;
+ lpVar = lpVar->lpPrev;
+ lpStruct->vars = lpVar;
+ }
+ }
+ // No existing list, create a new list with our entry
+ else
+ {
+ lpVar = (LPCOMMANDVAR)malloc(sizeof(COMMANDVAR));
+
+ if (!lpVar)
+ return false;
+
+ ZeroMemory(lpVar, sizeof(COMMANDVAR));
+ lpStruct->vars = lpVar;
+ }
+
+ lpVar->lpszVar = strdup(lpszVar);
+ lpVar->nType = nVarType;
+ lpVar->nKeywordPos = nKeywordPos;
+
+ if (nVarType == LLTYPE_VARIABLE || nVarType == LLTYPE_FIXED)
+ {
+ lpszTypeLen = strtok(NULL, " ");
+ lpVar->nTypeLen = atoi(lpszTypeLen);
+ }
+
+ dwVarStart = dwVarEnd + 1;
+ dwVarEnd = dwEnd;
+ }
+
+ return true;
+}
+
+// Parse the struct message template block of a command
+bool get_struct_blocks(LPCOMMAND lpCmd, LPBYTE lpBuffer, DWORD dwStart, DWORD dwEnd)
+{
+ DWORD dwStructStart = dwStart;
+ DWORD dwStructEnd = dwEnd;
+ DWORD dwStructChildren = 0;
+
+ while (get_block_markers(lpBuffer, dwStructStart, dwStructEnd, dwStructChildren))
+ {
+ char szStructLine[256];
+ DWORD dwStructLen = (dwStructChildren ? dwStructChildren - 1 : dwStructEnd - 1) - dwStructStart;
+
+ memcpy(&szStructLine, &lpBuffer[dwStructStart+1], dwStructLen);
+ szStructLine[dwStructLen] = '\0';
+ trim(szStructLine);
+
+ //printf("\t%s\n", szStructLine);
+
+ char *lpszStruct = strtok(szStructLine, " ");
+ char *lpszType = strtok(NULL, " ");
+ int nKeywordPos = get_keyword_pos(lpszStruct);
+ int nVarType = get_var_type(lpszType);
+
+ LPCOMMANDSTRUCT lpStruct = lpCmd->structs;
+
+ if (lpStruct)
+ {
+ // Insert after an item
+ if (nKeywordPos > lpStruct->nKeywordPos)
+ {
+ while (lpStruct->lpNext && nKeywordPos > lpStruct->lpNext->nKeywordPos)
+ lpStruct = lpStruct->lpNext;
+
+ LPCOMMANDSTRUCT lpBelow = lpStruct->lpNext;
+
+ lpStruct->lpNext = (LPCOMMANDSTRUCT)malloc(sizeof(COMMANDSTRUCT));
+
+ if (!lpStruct->lpNext)
+ return false;
+
+ ZeroMemory(lpStruct->lpNext, sizeof(COMMANDSTRUCT));
+ lpStruct->lpNext->lpPrev = lpStruct;
+ lpStruct->lpNext->lpNext = lpBelow;
+ lpStruct = lpStruct->lpNext;
+ }
+ // Insert before all items
+ else
+ {
+ lpStruct->lpPrev = (LPCOMMANDSTRUCT)malloc(sizeof(COMMANDSTRUCT));
+
+ if (!lpStruct->lpPrev)
+ return false;
+
+ ZeroMemory(lpStruct->lpPrev, sizeof(COMMANDSTRUCT));
+
+ lpStruct->lpPrev->lpNext = lpStruct;
+ lpStruct->lpPrev->lpPrev = NULL;
+ lpStruct = lpStruct->lpPrev;
+ lpCmd->structs = lpStruct;
+ }
+ }
+ // No existing list, create a new list with our entry
+ else
+ {
+ lpCmd->structs = (LPCOMMANDSTRUCT)malloc(sizeof(COMMANDSTRUCT));
+
+ if (!lpCmd->structs)
+ return false;
+
+ ZeroMemory(lpCmd->structs, sizeof(COMMANDSTRUCT));
+ lpStruct = lpCmd->structs;
+ }
+
+ lpStruct->lpszStruct = strdup(lpszStruct);
+ lpStruct->nKeywordPos = nKeywordPos;
+ lpStruct->nType = nVarType;
+
+ if (nVarType == LLTYPE_VARIABLE)
+ {
+ lpStruct->cItems = 1;
+ }
+ else if (nVarType == LLTYPE_MULTIPLE)
+ {
+ char *lpszTypeLen = strtok(NULL, " ");
+ lpStruct->cItems = atoi(lpszTypeLen);
+ }
+
+ get_var_blocks(lpStruct, lpBuffer, dwStructStart + 1, dwStructEnd - 1);
+
+ dwStructStart = dwStructEnd + 1;
+ dwStructEnd = dwEnd;
+ }
+
+ return true;
+}
+
+// Parse the command message template blocks
+bool get_command_blocks(LPBYTE lpBuffer, DWORD dwStart, DWORD dwEnd)
+{
+ DWORD dwCmdStart = dwStart;
+ DWORD dwCmdEnd = dwEnd;
+ DWORD dwCmdChildren = 0;
+
+ while (get_block_markers(lpBuffer, dwCmdStart, dwCmdEnd, dwCmdChildren))
+ {
+ char szCmdLine[256];
+ DWORD dwCmdLen = (dwCmdChildren ? dwCmdChildren - 1 : dwCmdEnd - 1) - dwCmdStart;
+
+ memcpy(&szCmdLine, &lpBuffer[dwCmdStart+1], dwCmdLen);
+ szCmdLine[dwCmdLen] = '\0';
+ trim(szCmdLine);
+
+ //printf("%s\n", szCmdLine);
+
+ char *lpszCmd = strtok(szCmdLine, " ");
+ char *lpszFreq = strtok(NULL, " ");
+ char *lpszFixed = NULL;
+ char *lpszTrust = NULL;
+ char *lpszCoding = NULL;
+ static DWORD dwLow = 1;
+ static DWORD dwMed = 1;
+ static DWORD dwHigh = 1;
+ COMMAND *lpCmd = NULL;
+
+ // Get the commands frequency
+ if (!strnicmp(lpszFreq, "Fixed", 6))
+ {
+ lpszFixed = strtok(NULL, " ");
+ DWORD dwFixed = (DWORD)httoi(lpszFixed) ^ 0xffff0000;
+ lpCmd = &cmds_low[dwFixed];
+ }
+ else if (!strnicmp(lpszFreq, "Low", 4))
+ {
+ lpCmd = &cmds_low[dwLow++];
+ }
+ else if (!strnicmp(lpszFreq, "Medium", 7))
+ {
+ lpCmd = &cmds_med[dwMed++];
+ }
+ else if (!strnicmp(lpszFreq, "High", 5))
+ {
+ lpCmd = &cmds_high[dwHigh++];
+ }
+
+ lpszTrust = strtok(NULL, " ");
+ lpszCoding = strtok(NULL, " ");
+
+ lpCmd->lpszCmd = strdup(lpszCmd);
+
+ // Is the command zero encoded?
+ if (!strnicmp(lpszCoding, "Zerocoded", 10))
+ {
+ lpCmd->bZerocoded = true;
+ }
+
+ // Is the command trusted?
+ if (!strnicmp(lpszTrust, "Trusted", 8))
+ {
+ lpCmd->bTrusted = true;
+ }
+
+ get_struct_blocks(lpCmd, lpBuffer, dwCmdStart + 1, dwCmdEnd - 1);
+
+ //printf("----------------------\n");
+
+ dwCmdStart = dwCmdEnd + 1;
+ dwCmdEnd = dwEnd;
+ }
+
+ return true;
+}
+
+void dump_structs(LPCOMMANDSTRUCT lpStruct)
+{
+ while (lpStruct)
+ {
+ //dprintf("\t%04d %s (%s / %hu)\n", lpStruct->nKeywordPos, lpStruct->lpszStruct, LLTYPES[lpStruct->nType], lpStruct->cItems);
+
+ LPCOMMANDVAR lpVar = lpStruct->vars;
+
+ while (lpVar)
+ {
+ //dprintf("\t\t%04d %s (%s / %d)\n", lpVar->nKeywordPos, lpVar->lpszVar, LLTYPES[lpVar->nType], lpVar->nTypeLen);
+ lpVar = lpVar->lpNext;
+ }
+
+// if (lpStruct->lpNext)
+// {
+ lpStruct = lpStruct->lpNext;
+// SAFE_FREE(lpStruct->lpPrev->lpszStruct);
+// SAFE_FREE(lpStruct->lpPrev);
+// }
+// else
+// {
+// SAFE_FREE(lpStruct->lpszStruct);
+// SAFE_FREE(lpStruct);
+// }
+ }
+}
+
+void WINAPI parse_command(LPCOMMAND lpCommand, CServer *server, char *zerobuf, int *len, int pos)
+{
+ //dprintf("--- %s ---\n", lpCommand->lpszCmd);
+
+ LPCOMMANDSTRUCT lpStruct = lpCommand->structs;
+
+ while (lpStruct)
+ {
+ //dprintf("\t%04d %s (%s / %hu)\n", lpStruct->nKeywordPos, lpStruct->lpszStruct, LLTYPES[lpStruct->nType], lpStruct->cItems);
+ BYTE cItems = 1;
+
+ if (lpStruct->nType == LLTYPE_VARIABLE)
+ {
+ memcpy(&cItems, &zerobuf[pos], sizeof(cItems));
+ pos += sizeof(cItems);
+ }
+ else if (lpStruct->nType == LLTYPE_MULTIPLE)
+ {
+ cItems = lpStruct->cItems;
+ }
+
+ for (BYTE c = 0; c < cItems; c++)
+ {
+ //dprintf("--- %s ----\n", lpStruct->lpszStruct);
+
+ LPCOMMANDVAR lpVar = lpStruct->vars;
+
+ while (lpVar)
+ {
+ //dprintf("\t\t%04d %s (%s / %d)\n", lpVar->nKeywordPos, lpVar->lpszVar, LLTYPES[lpVar->nType], lpVar->nTypeLen);
+
+ switch (lpVar->nType)
+ {
+ case LLTYPE_U8:
+ {
+ unsigned char ubData;
+ memcpy(&ubData, &zerobuf[pos], sizeof(ubData));
+ pos += sizeof(ubData);
+ //dprintf("%s: %hu\n", lpVar->lpszVar, ubData);
+ }
+ break;
+
+ case LLTYPE_U16:
+ {
+ WORD wData;
+ memcpy(&wData, &zerobuf[pos], sizeof(wData));
+ pos += sizeof(wData);
+ //dprintf("%s: %u\n", lpVar->lpszVar, wData);
+ }
+ break;
+
+ case LLTYPE_U32:
+ {
+ DWORD dwData;
+ memcpy(&dwData, &zerobuf[pos], sizeof(dwData));
+ pos += sizeof(dwData);
+ //dprintf("%s: %lu\n", lpVar->lpszVar, dwData);
+ }
+ break;
+
+ case LLTYPE_U64:
+ {
+ ULONGLONG ullData;
+ memcpy(&ullData, &zerobuf[pos], sizeof(ullData));
+ pos += sizeof(ullData);
+ //dprintf("%s: %I64u\n", lpVar->lpszVar, ullData);
+ }
+ break;
+
+ case LLTYPE_S8:
+ {
+ BYTE bData;
+ memcpy(&bData, &zerobuf[pos], sizeof(bData));
+ pos += sizeof(bData);
+ //dprintf("%s: %hd\n", lpVar->lpszVar, bData);
+ }
+ break;
+
+ case LLTYPE_S16:
+ {
+ SHORT sData;
+ memcpy(&sData, &zerobuf[pos], sizeof(sData));
+ pos += sizeof(sData);
+ //dprintf("%s: %d\n", lpVar->lpszVar, sData);
+ }
+ break;
+
+ case LLTYPE_S32:
+ {
+ LONG nData;
+ memcpy(&nData, &zerobuf[pos], sizeof(nData));
+ pos += sizeof(nData);
+ //dprintf("%s: %ld\n", lpVar->lpszVar, nData);
+ }
+ break;
+
+ case LLTYPE_S64:
+ break;
+
+ case LLTYPE_F8:
+ break;
+
+ case LLTYPE_F16:
+ break;
+
+ case LLTYPE_F32:
+ {
+ FLOAT fData;
+ memcpy(&fData, &zerobuf[pos], sizeof(fData));
+ pos += sizeof(fData);
+ //dprintf("%s: %f\n", lpVar->lpszVar, fData);
+ }
+ break;
+
+ case LLTYPE_F64:
+ {
+ double dData;
+ memcpy(&dData, &zerobuf[pos], sizeof(dData));
+ pos += sizeof(dData);
+ //dprintf("%s: %f\n", lpVar->lpszVar, dData);
+ }
+ break;
+
+ case LLTYPE_LLUUID:
+ {
+ BYTE bData[16];
+ memcpy(&bData, &zerobuf[pos], sizeof(bData));
+ pos += sizeof(bData);
+ //dprintf("%s: ", lpVar->lpszVar);
+ //for (int u = 0; u < sizeof(bData); u++)
+ //dprintf("%02x", bData[u]);
+ //dprintf("\n");
+ }
+ break;
+
+ case LLTYPE_BOOL:
+ {
+ BYTE bData;
+ memcpy(&bData, &zerobuf[pos], sizeof(bData));
+ pos += sizeof(bData);
+ //dprintf("%s: %s\n", lpVar->lpszVar, (bData) ? "True" : "False");
+ }
+ break;
+
+ case LLTYPE_LLVECTOR3:
+ {
+ FLOAT fData[3];
+ memcpy(&fData, &zerobuf[pos], sizeof(fData));
+ pos += sizeof(fData);
+ //dprintf("%s: %f, %f, %f\n", lpVar->lpszVar, fData[0], fData[1], fData[2]);
+ }
+ break;
+
+ case LLTYPE_LLVECTOR3D:
+ {
+ double dData[3];
+ memcpy(&dData, &zerobuf[pos], sizeof(dData));
+ pos += sizeof(dData);
+ //dprintf("%s: %f, %f, %f\n", lpVar->lpszVar, dData[0], dData[1], dData[2]);
+ }
+ break;
+
+ /*case LLTYPE_VECTOR4:
+ {
+ FLOAT fData[4];
+ memcpy(&fData, &zerobuf[pos], sizeof(fData));
+ pos += sizeof(fData);
+ dprintf("%s: %f, %f, %f, %f\n", lpVar->lpszVar, fData[0], fData[1], fData[2], fData[3]);
+ }
+ break;*/
+
+ case LLTYPE_QUATERNION:
+ {
+ FLOAT fData[4];
+ memcpy(&fData, &zerobuf[pos], sizeof(fData));
+ pos += sizeof(fData);
+ //dprintf("%s: %f, %f, %f, %f\n", lpVar->lpszVar, fData[0], fData[1], fData[2], fData[3]);
+ }
+ break;
+
+ case LLTYPE_IPADDR:
+ {
+ BYTE ipData[4];
+ memcpy(&ipData, &zerobuf[pos], sizeof(ipData));
+ pos += sizeof(ipData);
+ //dprintf("%s: %hu.%hu.%hu.%hu\n", lpVar->lpszVar, ipData[0], ipData[1], ipData[2], ipData[3]);
+ }
+ break;
+
+ case LLTYPE_IPPORT:
+ {
+ WORD wData;
+ memcpy(&wData, &zerobuf[pos], sizeof(wData));
+ pos += sizeof(wData);
+ //dprintf("%s: %hu\n", lpVar->lpszVar, htons(wData));
+ }
+ break;
+
+ case LLTYPE_VARIABLE:
+ {
+ if (lpVar->nTypeLen == 1)
+ {
+ BYTE cDataLen;
+ LPBYTE lpData = NULL;
+
+ memcpy(&cDataLen, &zerobuf[pos], sizeof(cDataLen));
+ pos += sizeof(cDataLen);
+
+ if (cDataLen > 0)
+ lpData = (LPBYTE)malloc(cDataLen);
+
+ if (lpData)
+ memcpy(lpData, &zerobuf[pos], cDataLen);
+
+ pos += cDataLen;
+
+ if (lpData)
+ {
+ bool bPrintable = true;
+
+ for (int j = 0; j < cDataLen - 1; j++)
+ {
+ if (((unsigned char)lpData[j] < 0x20 || (unsigned char)lpData[j] > 0x7E) && (unsigned char)lpData[j] != 0x09 && (unsigned char)lpData[j] != 0x0D)
+ bPrintable = false;
+ }
+
+ if (bPrintable && lpData[cDataLen - 1] == '\0')
+ {
+ //dprintf("%s: %s\n", lpVar->lpszVar, lpData);
+ }
+ else
+ {
+ for (int j = 0; j < cDataLen; j += 16)
+ {
+ //dprintf("%s: ", lpVar->lpszVar);
+
+ for (int k = 0; k < 16; k++)
+ {
+ if ((j + k) < cDataLen)
+ {
+ //dprintf("%02x ", (unsigned char)lpData[j+k]);
+ }
+ else
+ {
+ //dprintf(" ");
+ }
+ }
+
+ for (int k = 0; k < 16 && (j + k) < cDataLen; k++)
+ {
+ //dprintf("%c", ((unsigned char)lpData[j+k] >= 0x20 && (unsigned char)lpData[j+k] <= 0x7E) ? (unsigned char)lpData[j+k] : '.');
+ }
+
+ //dprintf("\n");
+ }
+ }
+ }
+
+ SAFE_FREE(lpData);
+ }
+ else if (lpVar->nTypeLen == 2)
+ {
+ WORD cDataLen;
+ LPBYTE lpData = NULL;
+
+ memcpy(&cDataLen, &zerobuf[pos], sizeof(cDataLen));
+ pos += sizeof(cDataLen);
+
+ if (cDataLen > 0)
+ lpData = (LPBYTE)malloc(cDataLen);
+
+ if (lpData)
+ memcpy(lpData, &zerobuf[pos], cDataLen);
+
+ pos += cDataLen;
+
+ if (lpData)
+ {
+ bool bPrintable = true;
+
+ for (int j = 0; j < cDataLen - 1; j++)
+ {
+ if (((unsigned char)lpData[j] < 0x20 || (unsigned char)lpData[j] > 0x7E) && (unsigned char)lpData[j] != 0x09 && (unsigned char)lpData[j] != 0x0D)
+ bPrintable = false;
+ }
+
+ if (bPrintable && lpData[cDataLen - 1] == '\0')
+ {
+ //dprintf("%s: %s\n", lpVar->lpszVar, lpData);
+ }
+ else
+ {
+ for (int j = 0; j < cDataLen; j += 16)
+ {
+ //dprintf("%s: ", lpVar->lpszVar);
+
+ for (int k = 0; k < 16; k++)
+ {
+ if ((j + k) < cDataLen)
+ {
+ //dprintf("%02x ", (unsigned char)lpData[j+k]);
+ }
+ else
+ {
+ //dprintf(" ");
+ }
+ }
+
+ for (int k = 0; k < 16 && (j + k) < cDataLen; k++)
+ {
+ //dprintf("%c", ((unsigned char)lpData[j+k] >= 0x20 && (unsigned char)lpData[j+k] <= 0x7E) ? (unsigned char)lpData[j+k] : '.');
+ }
+
+ //dprintf("\n");
+ }
+ }
+ }
+
+ SAFE_FREE(lpData);
+ }
+ }
+ break;
+
+ case LLTYPE_FIXED:
+ {
+ LPBYTE lpData = NULL;
+
+ if (lpVar->nTypeLen > 0)
+ lpData = (LPBYTE)malloc(lpVar->nTypeLen);
+
+ if (lpData)
+ memcpy(lpData, &zerobuf[pos], lpVar->nTypeLen);
+
+ pos += lpVar->nTypeLen;
+
+ if (lpData)
+ {
+ bool bPrintable = true;
+
+ for (int j = 0; j < lpVar->nTypeLen - 1; j++)
+ {
+ if (((unsigned char)lpData[j] < 0x20 || (unsigned char)lpData[j] > 0x7E) && (unsigned char)lpData[j] != 0x09 && (unsigned char)lpData[j] != 0x0D)
+ bPrintable = false;
+ }
+
+ if (bPrintable && lpData[lpVar->nTypeLen - 1] == '\0')
+ {
+ //dprintf("%s: %s\n", lpVar->lpszVar, lpData);
+ }
+ else
+ {
+ for (int j = 0; j < lpVar->nTypeLen; j += 16)
+ {
+ //dprintf("%s: ", lpVar->lpszVar);
+
+ for (int k = 0; k < 16; k++)
+ {
+ if ((j + k) < lpVar->nTypeLen)
+ {
+ //dprintf("%02x ", (unsigned char)lpData[j+k]);
+ }
+ else
+ {
+ //dprintf(" ");
+ }
+ }
+
+ for (int k = 0; k < 16 && (j + k) < lpVar->nTypeLen; k++)
+ {
+ //dprintf("%c", ((unsigned char)lpData[j+k] >= 0x20 && (unsigned char)lpData[j+k] <= 0x7E) ? (unsigned char)lpData[j+k] : '.');
+ }
+
+ //dprintf("\n");
+ }
+ }
+ }
+
+ SAFE_FREE(lpData);
+ }
+ break;
+
+ case LLTYPE_SINGLE:
+ case LLTYPE_MULTIPLE:
+ case LLTYPE_NULL:
+ default:
+ break;
+ }
+
+ lpVar = lpVar->lpNext;
+ }
+ }
+
+ lpStruct = lpStruct->lpNext;
+ }
+}
+
+CMessage * WINAPI map_command(LPCOMMAND lpCommand, CServer *server, char *zerobuf, int *len, int pos)
+{
+// dprintf("--- %s ---\n", lpCommand->lpszCmd);
+
+ int oldPos = pos;
+
+ CMessage *msg = new CMessage;
+
+ if (!msg)
+ return NULL;
+
+ msg->SetCommand(lpCommand->lpszCmd);
+
+ LPCOMMANDSTRUCT lpStruct = lpCommand->structs;
+
+ while (lpStruct)
+ {
+ //dprintf("\t%04d %s (%s / %hu)\n", lpStruct->nKeywordPos, lpStruct->lpszStruct, LLTYPES[lpStruct->nType], lpStruct->cItems);
+ BYTE cItems = 1;
+
+ if (lpStruct->nType == LLTYPE_VARIABLE)
+ {
+ memcpy(&cItems, &zerobuf[pos], sizeof(cItems));
+ pos += sizeof(cItems);
+ }
+ else if (lpStruct->nType == LLTYPE_MULTIPLE)
+ {
+ cItems = lpStruct->cItems;
+ }
+
+ for (BYTE c = 0; c < cItems; c++)
+ {
+ //dprintf("--- %s ----\n", lpStruct->lpszStruct);
+ CBlock *block = new CBlock;
+ msg->AddBlock(lpStruct->lpszStruct, lpStruct->nType, block);
+
+ LPCOMMANDVAR lpVar = lpStruct->vars;
+
+ while (lpVar)
+ {
+ //dprintf("\t\t%04d %s (%s / %d)\n", lpVar->nKeywordPos, lpVar->lpszVar, LLTYPES[lpVar->nType], lpVar->nTypeLen);
+ CVar *var = new CVar;
+ var->SetVar(lpVar->lpszVar);
+ var->SetType(lpVar->nType, lpVar->nTypeLen);
+ pos += var->SetData((LPBYTE)&zerobuf[pos]);
+ block->AddVar(var);
+ lpVar = lpVar->lpNext;
+ }
+ }
+
+ lpStruct = lpStruct->lpNext;
+ }
+
+ BYTE bPack[4096];
+ int nPackedSize = msg->Pack(bPack);
+ int diff = memcmp(bPack, &zerobuf[oldPos], nPackedSize);
+
+ if (diff)
+ {
+ msg->Dump();
+ dprintf("PACKED: %d / %d (%d) ===> %d\n", nPackedSize, *len, oldPos, diff);
+ }
+
+ return msg;
+}
+
+void WINAPI cmd_Silent(LPCOMMAND lpCommand, CServer *server, char *zerobuf, int *len, int pos)
+{
+}
+
+void WINAPI cmd_Default(LPCOMMAND lpCommand, CServer *server, char *zerobuf, int *len, int pos)
+{
+ //dprintf("Flags: %u\n", zerobuf[0]);
+ CMessage *msg = map_command(lpCommand, server, zerobuf, len, pos);
+ msg->Dump();
+ SAFE_DELETE(msg);
+}
+
+void WINAPI cmd_LoginReply(LPCOMMAND lpCommand, CServer *server, char *zerobuf, int *len, int pos)
+{
+ parse_command(lpCommand, server, zerobuf, len, pos);
+}
+
+CMDHOOK pCMDHooks[] = {
+ { _T("Default"), (PROC)cmd_Default },
+ { _T("DirLandReply"), (PROC)cmd_Silent }, // Silence the most common
+ { _T("AvatarAnimation"), (PROC)cmd_Silent }, // packets
+ { _T("CoarseLocationUpdate"), (PROC)cmd_Silent },
+ { _T("CompletePingCheck"), (PROC)cmd_Silent },
+ { _T("LayerData"), (PROC)cmd_Silent },
+ { _T("PacketAck"), (PROC)cmd_Silent },
+ { _T("StartPingCheck"), (PROC)cmd_Silent },
+ { _T("SimulatorViewerTimeMessage"), (PROC)cmd_Silent },
+ { _T("ImagePacket"), (PROC)cmd_Silent },
+ { _T("TransferPacket"), (PROC)cmd_Silent },
+ { _T("ObjectUpdate"), (PROC)cmd_Silent },
+ { _T("ObjectUpdateCompressed"), (PROC)cmd_Silent },
+ { _T("AgentThrottle"), (PROC)cmd_Silent },
+ { _T("CoarseLocationUpdate"), (PROC)cmd_Silent },
+ { _T("UUIDNameReply"), (PROC)cmd_Silent },
+ { _T("RequestImage"), (PROC)cmd_Silent },
+ { _T("ImageData"), (PROC)cmd_Silent },
+ { _T("SimStats"), (PROC)cmd_Silent },
+ { _T("ViewerEffect"), (PROC)cmd_Silent },
+ { _T("TransferRequest"), (PROC)cmd_Silent },
+ { _T("DirClassifiedReply"), (PROC)cmd_Silent },
+ { _T("DirEventsReply"), (PROC)cmd_Silent },
+ { _T("DirPopularReply"), (PROC)cmd_Silent },
+ { _T("DirLandReply"), (PROC)cmd_Silent },
+ { _T("AgentUpdate"), (PROC)cmd_Silent },
+ { _T("ObjectUpdateCached"), (PROC)cmd_Silent },
+ { _T("ImprovedTerseObjectUpdate"), (PROC)cmd_Silent },
+ { _T("RequestMultipleObjects"), (PROC)cmd_Silent },
+ { _T("AttachedSound"), (PROC)cmd_Silent },
+ { _T("ViewerStats"), (PROC)cmd_Silent },
+ { _T("TransferInfo"), (PROC)cmd_Silent },
+ { _T("ParcelOverlay"), (PROC)cmd_Silent },
+ { _T("SendXferPacket"), (PROC)cmd_Silent },
+ { _T("DirPlacesReply"), (PROC)cmd_Silent },
+ { NULL, NULL }
+};
+
+int decomm()
+{
+ FILE *fpComm;
+ FILE *fpMsg;
+
+ fpComm = fopen(g_pConfig->m_pCommDatPath, "rb");
+
+ if (!fpComm)
+ {
+ printf("Couldn't open %s for reading, aborting...\n", g_pConfig->m_pCommDatPath);
+ return -1;
+ }
+
+ fpMsg = fopen(g_pConfig->m_pMessageTemplatePath, "wb");
+
+ if (!fpMsg)
+ {
+ printf("Couldn't open %s for writing, aborting...\n", g_pConfig->m_pMessageTemplatePath);
+ return -1;
+ }
+
+ printf("Decrypting %s to %s\n", g_pConfig->m_pCommDatPath, g_pConfig->m_pMessageTemplatePath);
+ static unsigned char ucMagicKey = 0;
+ long lTemplateSize = 0;
+
+ fseek(fpComm, 0, SEEK_END);
+ lTemplateSize = ftell(fpComm);
+ fseek(fpComm, 0, SEEK_SET);
+
+ BYTE buffer[2048];
+ BYTE stripped[2048];
+ LPBYTE lpTemplate = (LPBYTE)malloc(lTemplateSize);
+ DWORD dwTemplateWrote = 0;
+
+ if (!lpTemplate)
+ return -1;
+
+ bool bComment = false;
+
+ while (!feof(fpComm))
+ {
+ size_t stRead = fread(&buffer, 1, sizeof(buffer), fpComm);
+ size_t stStripped = 0;
+
+ for (size_t stCount = 0; stCount < stRead; stCount++)
+ {
+ buffer[stCount] ^= ucMagicKey;
+
+ if (!bComment && buffer[stCount] != '/')
+ stripped[stStripped++] = buffer[stCount];
+
+ if (bComment && buffer[stCount] == '\n')
+ bComment = false;
+
+ if (!bComment && buffer[stCount] == '/')
+ bComment = true;
+
+ ucMagicKey += 43;
+ }
+
+ memcpy(lpTemplate + dwTemplateWrote, &stripped, stStripped);
+ dwTemplateWrote += (DWORD)stStripped;
+
+ size_t stWrote = fwrite(&stripped, 1, stStripped, fpMsg);
+
+ printf(".");
+ fflush(stdout);
+ }
+
+ printf("\nDone.\n");
+
+ printf("template size: %ld\n", lTemplateSize);
+
+ ZeroMemory(&cmds_low, sizeof(cmds_low));
+ ZeroMemory(&cmds_med, sizeof(cmds_med));
+ ZeroMemory(&cmds_high, sizeof(cmds_high));
+
+ get_command_blocks(lpTemplate, 0, lTemplateSize);
+
+ fclose(fpComm);
+ fclose(fpMsg);
+
+ for (int i = 1; i < MAX_COMMANDS_LOW; i++)
+ {
+ if (cmds_low[i].lpszCmd)
+ {
+ //dprintf("LOW %05d - %s - %s - %s\n", i, cmds_low[i].lpszCmd, cmds_low[i].bTrusted ? "Trusted" : "Untrusted", cmds_low[i].bZerocoded ? "Zerocoded" : "Unencoded");
+ dump_structs(cmds_low[i].structs);
+ //SAFE_FREE(cmds_low[i].lpszCmd);
+ }
+ }
+
+ for (int i = 1; i < MAX_COMMANDS_MEDIUM; i++)
+ {
+ if (cmds_med[i].lpszCmd)
+ {
+ //dprintf("Medium %05d - %s\n", i, cmds_med[i].lpszCmd);
+ dump_structs(cmds_med[i].structs);
+ //SAFE_FREE(cmds_med[i].lpszCmd);
+ }
+ }
+
+ for (int i = 1; i < MAX_COMMANDS_HIGH; i++)
+ {
+ if (cmds_high[i].lpszCmd)
+ {
+ //dprintf("High %05d - %s\n", i, cmds_high[i].lpszCmd);
+ dump_structs(cmds_high[i].structs);
+ //SAFE_FREE(cmds_high[i].lpszCmd);
+ }
+ }
+
+ return 0;
+}
+
+HMODULE WINAPI new_LoadLibraryA(
+ LPCSTR lpLibFileName
+ )
+{
+ if (g_hOpenGL != NULL && !_tcsicmp(lpLibFileName, "OPENGL32"))
+ return g_hOpenGL;
+
+// dprintf("[LoadLibraryA] Filename(%s)\n", lpLibFileName);
+
+ HMODULE hModule = NULL;
+ PROC pOldProc = pAPIHooks[APIHOOK_LOADLIBRARYA].pOldProc;
+
+ if (pOldProc != NULL && !IsBadCodePtr((PROC)pOldProc))
+ {
+ hModule = ((HMODULE (WINAPI *)(LPCSTR))pOldProc)(lpLibFileName);
+ if (hModule != NULL)
+ {
+ SaveImportHooks();
+ InstallImportHooks();
+ }
+ }
+
+ if (!_tcsicmp(lpLibFileName, "OPENGL32"))
+ g_hOpenGL = hModule;
+
+ return hModule;
+}
+
+BOOL WINAPI new_FreeLibraryA(
+ HMODULE hLibModule
+ )
+{
+ if (hLibModule == g_hOpenGL)
+ {
+ return TRUE;
+ }
+
+ return ((BOOL (WINAPI *)(HMODULE))pAPIHooks[APIHOOK_FREELIBRARYA].pOldProc)(hLibModule);
+}
+
+HMODULE WINAPI new_LoadLibraryW(
+ LPCWSTR lpLibFileName
+ )
+{
+// dprintf("[LoadLibraryW] Filename(%S)\n", lpLibFileName);
+
+ HMODULE hModule = NULL;
+ PROC pOldProc = pAPIHooks[APIHOOK_LOADLIBRARYW].pOldProc;
+
+ if (pOldProc != NULL && !IsBadCodePtr((PROC)pOldProc))
+ {
+ hModule = ((HMODULE (WINAPI *)(LPCWSTR))pOldProc)(lpLibFileName);
+ if (hModule != NULL)
+ {
+ SaveImportHooks();
+ InstallImportHooks();
+ }
+ }
+
+ return hModule;
+}
+
+HMODULE WINAPI new_LoadLibraryExA(
+ LPCSTR lpLibFileName,
+ HANDLE hFile,
+ DWORD dwFlags
+ )
+{
+// dprintf("[LoadLibraryExA] Filename(%s)\n", lpLibFileName);
+
+ HMODULE hModule = NULL;
+ PROC pOldProc = pAPIHooks[APIHOOK_LOADLIBRARYEXA].pOldProc;
+
+ if (pOldProc != NULL && !IsBadCodePtr((PROC)pOldProc))
+ {
+ hModule = ((HMODULE (WINAPI *)(LPCSTR, HANDLE, DWORD))pOldProc)(lpLibFileName, hFile, dwFlags);
+ if (hModule != NULL)
+ {
+ SaveImportHooks();
+ InstallImportHooks();
+ }
+ }
+
+ return hModule;
+}
+
+HMODULE WINAPI new_LoadLibraryExW(
+ LPCWSTR lpLibFileName,
+ HANDLE hFile,
+ DWORD dwFlags)
+{
+// dprintf("[LoadLibraryExW] Filename(%S)\n", lpLibFileName);
+
+ HMODULE hModule = NULL;
+ PROC pOldProc = pAPIHooks[APIHOOK_LOADLIBRARYEXW].pOldProc;
+
+ if (pOldProc != NULL && !IsBadCodePtr((PROC)pOldProc))
+ {
+ hModule = ((HMODULE (WINAPI *)(LPCWSTR, HANDLE, DWORD))pOldProc)(lpLibFileName, hFile, dwFlags);
+ if (hModule != NULL)
+ {
+ SaveImportHooks();
+ InstallImportHooks();
+ }
+ }
+
+ return hModule;
+}
+
+FARPROC WINAPI new_GetProcAddress(HMODULE hModule, LPCSTR lpProcName)
+{
+ TCHAR szMod[MAX_PATH];
+
+ GetModuleFileName(hModule, szMod, sizeof(szMod));
+
+ if (HIWORD((DWORD)lpProcName) == 0)
+ {
+ WORD wOrdinal = LOWORD((DWORD)lpProcName);
+// dprintf(_T("[GetProcAddress] [%s][@%d]\n"), szMod, wOrdinal);
+ }
+ else
+ {
+ if (lpProcName != NULL && !IsBadCodePtr((PROC)lpProcName))
+ {
+ if (!stricmp(lpProcName, "wglSwapBuffers"))
+ {
+
+ }
+ else if (!stricmp(lpProcName, "InternetReadFile"))
+ {
+ dprintf(_T("[***GetProcAddress] [%s][%s]\n"), szMod, lpProcName);
+ return pAPIHooks[(int)APIHOOK_INTERNETREADFILE].pNewProc;
+ }
+ else if (!stricmp(lpProcName, "InternetOpenUrlA"))
+ {
+ dprintf(_T("[***GetProcAddress] [%s][%s]\n"), szMod, lpProcName);
+ return pAPIHooks[(int)APIHOOK_INTERNETOPENURLA].pNewProc;
+ }
+ else if (!stricmp(lpProcName, "CPEncrypt"))
+ {
+ dprintf(_T("[***CPEncrypt] [%s][%s]\n"), szMod, lpProcName);
+ return pAPIHooks[(int)APIHOOK_CPENCRYPT].pNewProc;
+ }
+ //else
+ //dprintf(_T("[GetProcAddress] [%s][%s]\n"), szMod, lpProcName);
+ }
+ //else
+ //dprintf(_T("[GetProcAddress] [%s][]\n"), szMod);
+ }
+
+ return ((FARPROC (WINAPI *)(HMODULE, LPCSTR))pAPIHooks[(int)APIHOOK_GETPROCADDRESS].pOldProc)(hModule, lpProcName);
+}
+
+struct hostent FAR * WINAPI new_gethostbyname(
+ const char FAR *name
+ )
+{
+ dprintf("[new_gethostbyname] name(%s)\n", name);
+
+ struct hostent FAR * hp = ((struct hostent FAR * (WINAPI *)(const char FAR *))pAPIHooks[(int)APIHOOK_GETHOSTBYNAME].pOldProc)(name);
+
+ return hp;
+}
+
+int WINAPI new_connect(
+ SOCKET s,
+ const struct sockaddr FAR *name,
+ int namelen
+ )
+{
+ dprintf("[connect] socket(0x%08X) host(%s) port(%d)\n", s, inet_ntoa(((struct sockaddr_in *)name)->sin_addr), ntohs(((struct sockaddr_in *)name)->sin_port));
+
+ return ((int (WINAPI *)(SOCKET, const struct sockaddr FAR *, int))pAPIHooks[(int)APIHOOK_CONNECT].pOldProc)(s, name, namelen);
+}
+
+int WINAPI new_recv(
+ SOCKET s,
+ char *buf,
+ int len,
+ int flags
+ )
+{
+ //dprintf("[recv] socket(0x%08X)\n", s);
+
+ int nRes = 0;
+ {
+ nRes = ((int (WINAPI *)(SOCKET, char *, int, int))pAPIHooks[APIHOOK_RECV].pOldProc)(s, buf, len, flags);
+ }
+/*
+ for (int j = 0; j < nRes; j += 16)
+ {
+ for (int k = 0; k < 16; k++)
+ {
+ if ((j + k) < nRes)
+ {
+ dprintf("%02x ", (unsigned char)buf[j+k]);
+ }
+ else
+ {
+ dprintf(" ");
+ }
+ }
+
+ for (int k = 0; k < 16 && (j + k) < nRes; k++)
+ {
+ dprintf("%c", ((unsigned char)buf[j+k] >= 0x20 && (unsigned char)buf[j+k] <= 0x7E) ? (unsigned char)buf[j+k] : '.');
+ }
+
+ dprintf("\n");
+ }
+*/
+ return nRes;
+}
+
+int WINAPI new_recvfrom(
+ SOCKET s,
+ char *buf,
+ int len,
+ int flags,
+ struct sockaddr *from,
+ int *fromlen
+ )
+{
+ int nRes = 0;
+ WORD wSeq = 0;
+ int zerolen = 0;
+ static char zerobuf[8192];
+ bool bZerocoded = false;
+ CServer *server = NULL;
+ CSequence *sequence = NULL;
+
+ nRes = ((int (WINAPI *)(SOCKET, char *, int, int, struct sockaddr *, int *))pAPIHooks[APIHOOK_RECVFROM].pOldProc)(s, buf, len, flags, from, fromlen);
+
+ // !!!
+ //return nRes;
+
+ if (nRes > 0)
+ {
+ //dprintf("Receiving %u bytes\n", nRes);
+
+ // Get packet sequence number
+ memcpy(&wSeq, &buf[2], sizeof(wSeq));
+ wSeq = htons(wSeq);
+
+ // Get current server
+ server = servers.FindServer((struct sockaddr_in *)from);
+
+ // If server isn't in our list add it as new
+ if (!server)
+ {
+ server = new CServer((struct sockaddr_in *)from);
+ servers.AddServer(server);
+ }
+
+ // Handle packet acks
+ BYTE bAppended[4096];
+ int nAppendedLen = 0;
+
+ if (buf[0] & MSG_APPENDED_ACKS)
+ {
+ //dprintf("APPENDED ACKS\n");
+
+ BYTE cPacketsItems = buf[nRes - 1];
+
+ int nOldRes = nRes;
+
+ nRes = nOldRes - 1 - (cPacketsItems * sizeof(DWORD));
+ //dprintf("NEW AND OLD: %d / %d\n", nRes, nOldRes);
+ nAppendedLen = nOldRes - nRes;
+ memcpy(bAppended, &buf[nRes], nAppendedLen);
+ }
+ zerolen = ZeroDecode(buf, nRes, zerobuf, sizeof(zerobuf));
+
+ if ((unsigned char)buf[4] != 0xff)
+ {
+ // High
+ //dprintf("parse high: %hu\n", zerobuf[4]);
+
+ bool bCmdFound = false;
+
+ for (int j = 0; pCMDHooks[j].szCommand; j++)
+ {
+ if (_tcsicmp(cmds_high[zerobuf[4]].lpszCmd, pCMDHooks[j].szCommand) == 0 && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
+ {
+ bCmdFound = true;
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_high[zerobuf[4]], server, zerobuf, &zerolen, 5);
+ break;
+ }
+ }
+
+ if (!bCmdFound)
+ {
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_high[zerobuf[4]], server, zerobuf, &zerolen, 5);
+ }
+ }
+
+ else if ((unsigned char)buf[5] != 0xff)
+ {
+ // Medium
+ //dprintf("parse med: %hu\n", zerobuf[5]);
+
+ bool bCmdFound = false;
+
+ for (int j = 0; pCMDHooks[j].szCommand; j++)
+ {
+ if (!_tcsicmp(cmds_med[zerobuf[5]].lpszCmd, pCMDHooks[j].szCommand) && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
+ {
+ bCmdFound = true;
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_med[zerobuf[5]], server, zerobuf, &zerolen, 6);
+ break;
+ }
+ }
+
+ if (!bCmdFound)
+ {
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_med[zerobuf[5]], server, zerobuf, &zerolen, 6);
+ }
+ }
+
+ else if ((unsigned char)buf[4] == 0xff && (unsigned char)buf[5] == 0xff)
+ {
+ // Fixed
+ // Low
+
+ //dprintf("parse low: %hu\n", htons(wFreq));
+
+ bool bCmdFound = false;
+ WORD wFreq;
+ memcpy(&wFreq, &zerobuf[6], sizeof(wFreq));
+
+ for (int j = 0; pCMDHooks[j].szCommand; j++)
+ {
+ if (!_tcsicmp(cmds_low[htons(wFreq)].lpszCmd, pCMDHooks[j].szCommand) && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
+ {
+ bCmdFound = true;
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_low[htons(wFreq)], server, zerobuf, &zerolen, 8);
+ break;
+ }
+ }
+
+ if (!bCmdFound)
+ {
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_low[htons(wFreq)], server, zerobuf, &zerolen, 8);
+ }
+ }
+
+ nRes = ZeroEncode(zerobuf, zerolen, buf, len);
+
+ if (nAppendedLen > 0)
+ {
+ memcpy(&buf[nRes], bAppended, nAppendedLen);
+ nRes += nAppendedLen;
+ }
+ }
+ else
+ {
+ // We can use this area to synthesize incoming packets
+ }
+
+ return nRes;
+}
+
+int WINAPI new_send(
+ SOCKET s,
+ const char *buf,
+ int len,
+ int flags
+ )
+{
+// dprintf("[send] socket(0x%08X)\n", s);
+
+ int nRes = 0;
+ {
+ nRes = ((int (WINAPI *)(SOCKET, const char *, int, int))pAPIHooks[APIHOOK_SEND].pOldProc)(s, buf, len, flags);
+ }
+
+ return nRes;
+}
+
+int WINAPI new_sendto(
+ SOCKET s,
+ char *buf,
+ int len,
+ int flags,
+ struct sockaddr *to,
+ int tolen
+ )
+{
+ int nRes = 0;
+ WORD wSeq = 0;
+ int zerolen = 0;
+ char *zerobuf = NULL;
+ bool bZerocoded = false;
+ CServer *server = NULL;
+ CSequence *sequence = NULL;
+
+ // Get packet sequence number
+ memcpy(&wSeq, &buf[2], sizeof(wSeq));
+ wSeq = htons(wSeq);
+
+ // Get current server
+ server = servers.FindServer((struct sockaddr_in *)to);
+
+ // If server isn't in our list add it as new
+ if (!server)
+ {
+ server = new CServer((struct sockaddr_in *)to);
+ servers.AddServer(server);
+ }
+
+ static int nDropPacket = 0;
+
+ if (buf[0] & MSG_ZEROCODED)
+ {
+ bZerocoded = true;
+ zerolen = 4;
+
+ for (int i = 4; i < len; i++)
+ {
+ if ((unsigned char)buf[i] == 0x00)
+ zerolen += (unsigned char)buf[++i];
+ else
+ zerolen++;
+ }
+
+ zerobuf = (char *)malloc(zerolen);
+
+ if (!zerobuf)
+ {
+ dprintf("Couldn't allocate memory for zerocoded buffer\n");
+ return -1;
+ }
+
+ int j = 4;
+ memcpy(zerobuf, buf, 4);
+
+ for (int i = 4; i < len; i++)
+ {
+ if ((unsigned char)buf[i] == 0x00)
+ {
+ for (int z = 0; z < (unsigned char)buf[i+1]; z++)
+ zerobuf[j++] = 0x00;
+
+ i++;
+ }
+ else
+ zerobuf[j++] = buf[i];
+ }
+ }
+ else
+ {
+ zerolen = len;
+ zerobuf = buf;
+ }
+
+ nRes = ((int (WINAPI *)(SOCKET, char *, int, int, struct sockaddr *, int))pAPIHooks[APIHOOK_SENDTO].pOldProc)(s, buf, len, flags, to, tolen);
+
+ // !!!
+ //return nRes;
+
+ //dprintf("Sending %u bytes\n", nRes);
+
+ if ((unsigned char)buf[4] != 0xff)
+ {
+ // High
+ //dprintf("parse high: %hu\n", zerobuf[4]);
+
+ bool bCmdFound = false;
+
+ for (int j = 0; pCMDHooks[j].szCommand; j++)
+ {
+ if (_tcsicmp(cmds_high[zerobuf[4]].lpszCmd, pCMDHooks[j].szCommand) == 0 && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
+ {
+ bCmdFound = true;
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_high[zerobuf[4]], server, zerobuf, &zerolen, 5);
+ break;
+ }
+ }
+
+ if (!bCmdFound)
+ {
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_high[zerobuf[4]], server, zerobuf, &zerolen, 5);
+ }
+ }
+
+ else if ((unsigned char)buf[5] != 0xff)
+ {
+ // Medium
+ //dprintf("parse med: %hu\n", zerobuf[5]);
+
+ bool bCmdFound = false;
+
+ for (int j = 0; pCMDHooks[j].szCommand; j++)
+ {
+ if (!_tcsicmp(cmds_med[zerobuf[5]].lpszCmd, pCMDHooks[j].szCommand) && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
+ {
+ bCmdFound = true;
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_med[zerobuf[5]], server, zerobuf, &zerolen, 6);
+ break;
+ }
+ }
+
+ if (!bCmdFound)
+ {
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_med[zerobuf[5]], server, zerobuf, &zerolen, 6);
+ }
+ }
+
+ else if ((unsigned char)buf[4] == 0xff && (unsigned char)buf[5] == 0xff)
+ {
+ // Fixed
+ // Low
+
+ //dprintf("parse low: %hu\n", htons(wFreq));
+
+ bool bCmdFound = false;
+ WORD wFreq;
+ memcpy(&wFreq, &zerobuf[6], sizeof(wFreq));
+
+ for (int j = 0; pCMDHooks[j].szCommand; j++)
+ {
+ if (!_tcsicmp(cmds_low[htons(wFreq)].lpszCmd, pCMDHooks[j].szCommand) && pCMDHooks[j].pProc != NULL && !IsBadCodePtr(pCMDHooks[j].pProc))
+ {
+ bCmdFound = true;
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[j].pProc)(&cmds_low[htons(wFreq)], server, zerobuf, &zerolen, 8);
+ break;
+ }
+ }
+
+ if (!bCmdFound)
+ {
+ ((void (WINAPI *)(LPCOMMAND, CServer *, char *, int *, int))pCMDHooks[0].pProc)(&cmds_low[htons(wFreq)], server, zerobuf, &zerolen, 8);
+ }
+ }
+ else
+ {
+ dprintf("[sendto] *** UNKNOWN FREQUENCY TYPE ***\n", s);
+ int i, j;
+
+ for (i = 0; i < len + 16; i += 16)
+ {
+ for (j = 0; j < 16; j++)
+ {
+ if ((i + j) < len)
+ {
+ dprintf("%02x ", (unsigned char)buf[i+j]);
+ }
+ else
+ {
+ dprintf(" ");
+ }
+ }
+
+ for (j = 0; j < 16 && (i + j) < len; j++)
+ {
+ dprintf("%c", isprint(buf[i+j]) ? (unsigned char)buf[i+j] : '.');
+ }
+
+ dprintf("\n");
+ }
+
+ dprintf("\n");
+ }
+
+ if (bZerocoded && zerobuf)
+ free(zerobuf);
+
+ return nRes;
+}
+
+/*
+LONG WINAPI new_SetWindowLongA(
+ HWND hWnd,
+ int nIndex,
+ LONG dwNewLong
+)
+{
+ LONG nRes = 0;
+
+ if (nIndex == GWL_WNDPROC && g_pMainFrm && hWnd == g_pMainFrm->m_hWnd)
+ {
+ dprintf(_T("[SetWindowLongA] %08x [%x] = "), hWnd, dwNewLong);
+
+ nRes = ((LONG (WINAPI *)(HWND, int, LONG))pAPIHooks[APIHOOK_SETWINDOWLONGA].pOldProc)(hWnd, nIndex, dwNewLong);
+
+ dprintf(_T("[%x]\n"), nRes);
+ }
+ else
+ {
+ if (nIndex == GWL_WNDPROC)
+ dprintf(_T("[SetWindowLongA] %08x [%x]\n"), hWnd, dwNewLong);
+
+ nRes = ((LONG (WINAPI *)(HWND, int, LONG))pAPIHooks[APIHOOK_SETWINDOWLONGA].pOldProc)(hWnd, nIndex, dwNewLong);
+ }
+
+ return nRes;
+}
+
+LONG WINAPI new_SetWindowLongW(
+ HWND hWnd,
+ int nIndex,
+ LONG dwNewLong
+)
+{
+ LONG nRes = 0;
+
+ if (nIndex == GWL_WNDPROC)
+ {
+ dprintf(_T("[SetWindowLongW] %08x\n"), hWnd);
+
+ nRes = ((LONG (WINAPI *)(HWND, int, LONG))pAPIHooks[APIHOOK_SETWINDOWLONGW].pOldProc)(hWnd, nIndex, dwNewLong);
+ }
+ else
+ {
+ nRes = ((LONG (WINAPI *)(HWND, int, LONG))pAPIHooks[APIHOOK_SETWINDOWLONGW].pOldProc)(hWnd, nIndex, dwNewLong);
+ }
+
+ return nRes;
+}
+*/
+BOOL WINAPI new_InternetReadFile(
+ IN HINTERNET hFile,
+ IN LPVOID lpBuffer,
+ IN DWORD dwNumberOfBytesToRead,
+ OUT LPDWORD lpNumberOfBytesRead
+)
+{
+ BOOL bRes = FALSE;
+
+ bRes = ((BOOL (WINAPI *)(HINTERNET, LPVOID, DWORD, LPDWORD))pAPIHooks[APIHOOK_INTERNETREADFILE].pOldProc)(hFile, lpBuffer, dwNumberOfBytesToRead, lpNumberOfBytesRead);
+
+ dprintf(_T("[InternetReadFile] [%s] %d\n"), lpBuffer, *lpNumberOfBytesRead);
+
+ return bRes;
+}
+
+HINTERNET WINAPI new_InternetOpenUrlA(
+ HINTERNET hInternet,
+ LPCTSTR lpszUrl,
+ LPCTSTR lpszHeaders,
+ DWORD dwHeadersLength,
+ DWORD dwFlags,
+ DWORD_PTR dwContext
+)
+{
+ HINTERNET hNet = 0;
+
+ dprintf(_T("[InternetOpenUrlA] [%s][%s]\n"), lpszUrl, lpszHeaders);
+
+ hNet = ((HINTERNET (WINAPI *)(HINTERNET, LPCTSTR, LPCTSTR, DWORD, DWORD, DWORD_PTR))pAPIHooks[APIHOOK_INTERNETOPENURLA].pOldProc)(hInternet, lpszUrl, lpszHeaders, dwHeadersLength, dwFlags, dwContext);
+
+ return hNet;
+}
+
+BOOL WINAPI new_CPEncrypt(
+ HCRYPTPROV hProv,
+ HCRYPTKEY hKey,
+ HCRYPTHASH hHash,
+ BOOL Final,
+ DWORD dwFlags,
+ BYTE* pbData,
+ DWORD* pdwDataLen,
+ DWORD dwBufLen
+)
+{
+ BOOL bRes = FALSE;
+
+ bRes = ((BOOL (WINAPI *)(HCRYPTPROV, HCRYPTKEY, HCRYPTHASH, BOOL, DWORD, BYTE *, DWORD *, DWORD))pAPIHooks[APIHOOK_CPENCRYPT].pOldProc)(hProv, hKey, hHash, Final, dwFlags, pbData, pdwDataLen, dwBufLen);
+
+ TCHAR szStr[2048];
+ ZeroMemory(szStr, sizeof(szStr));
+ memcpy(szStr, pbData, sizeof(szStr));
+
+ dprintf(_T("[CPEncrypt] [%s] %d\n"), szStr, 0);
+
+ return bRes;
+}
+
+BOOL WINAPI new_PeekMessageA(
+ LPMSG lpMsg, // pointer to structure for message
+ HWND hWnd, // handle to window
+ UINT wMsgFilterMin, // first message
+ UINT wMsgFilterMax, // last message
+ UINT wRemoveMsg // removal flags
+)
+{
+ //dprintf(_T("[PeekMessageA] [%x]\n"), hWnd);
+
+ BOOL bRes = FALSE;
+ static UINT uiAntiIdle = 0;
+
+ bRes = ((BOOL (WINAPI *)(LPMSG, HWND, UINT, UINT, UINT))pAPIHooks[APIHOOK_PEEKMESSAGEA].pOldProc)(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
+
+ if (!bRes && GetFocus() == NULL)
+ {
+ // Wait for any message sent or posted to this queue
+ DWORD dwResult = MsgWaitForMultipleObjects(0, NULL, FALSE, 1000, QS_ALLINPUT);
+
+ uiAntiIdle++;
+
+ if (uiAntiIdle > 4)
+ {
+ //dprintf(_T("idle.. %d\n"), uiAntiIdle);
+ if (g_pMainFrm)
+ {
+ //dprintf(_T("sending anti.. idle...\n"));
+ PostMessage(g_pMainFrm->m_hWnd, WM_MOUSEMOVE, 0, MAKEWORD(10, 10));
+ }
+
+ uiAntiIdle = 0;
+ }
+ }
+
+ static UINT uiAutoPilot = 0;
+
+ if (g_pMainFrm)
+ {
+ //uiAutoPilot++;
+
+ if (uiAutoPilot > 200)
+ {
+ WORD wRepeatCount = 1;
+ LPARAM lParam = MAKELPARAM(wRepeatCount, 0);
+
+ lParam |= 1 << 24;
+ lParam |= 0 << 29;
+ lParam |= 1 << 30;
+ lParam |= 0 << 31;
+
+ //PostMessage(g_pMainFrm->m_hWnd, WM_KEYDOWN, VK_UP, lParam);
+
+ lParam |= 0 << 24;
+ //PostMessage(g_pMainFrm->m_hWnd, WM_KEYDOWN, 'E', 0);
+
+ char sc = 0;
+ sc = MapVirtualKey('E', 0);
+
+ for (int k = 0; k < 90; k++)
+ PostMessage(g_pMainFrm->m_hWnd, WM_KEYDOWN, 'E', 1 | (1 << 30) | (sc << 16));
+
+ //PostMessage(g_pMainFrm->m_hWnd, WM_KEYUP, 'E', 1 | (3 << 30) | (sc << 16));
+
+ uiAutoPilot = 0;
+ }
+ }
+
+ return bRes;
+}
+
+VOID WINAPI new_glEnable(
+ GLenum cap
+)
+{
+ dprintf(_T("[glEnable] [0x%08x]\n"), cap);
+
+// if (cap != GL_TEXTURE_2D)
+ ((VOID (WINAPI *)(GLenum))pAPIHooks[APIHOOK_GLENABLE].pOldProc)(cap);
+// else
+// glDisable(GL_TEXTURE_2D);
+}
+
+GLboolean WINAPI new_glIsEnabled(
+ GLenum cap
+)
+{
+// if (cap == GL_TEXTURE_2D)
+// return GL_TRUE;
+
+ return ((GLboolean (WINAPI *)(GLenum))pAPIHooks[APIHOOK_GLISENABLED].pOldProc)(cap);
+}
+
+VOID WINAPI new_glTranslatef(
+ GLfloat x,
+ GLfloat y,
+ GLfloat z
+)
+{
+ dprintf(_T("[glTranslatef]\n"));
+ ((VOID (WINAPI *)(GLfloat, GLfloat, GLfloat))pAPIHooks[APIHOOK_GLTRANSLATEF].pOldProc)(x, y, z);
+}
+
+VOID WINAPI new_glTranslated(
+ GLdouble x,
+ GLdouble y,
+ GLdouble z
+)
+{
+ dprintf(_T("[glTranslated]\n"));
+ ((VOID (WINAPI *)(GLdouble, GLdouble, GLdouble))pAPIHooks[APIHOOK_GLTRANSLATED].pOldProc)(x, y, z);
+}
+
+VOID WINAPI new_glTexCoord2f(
+ GLfloat s,
+ GLfloat t
+)
+{
+ ((VOID (WINAPI *)(GLfloat, GLfloat))pAPIHooks[APIHOOK_GLTEXCOORD2F].pOldProc)(s, t);
+}
+
+VOID WINAPI new_glVertex2f(
+ GLfloat x,
+ GLfloat y
+)
+{
+ dprintf("[glVertex2f]\n");
+ ((VOID (WINAPI *)(GLfloat, GLfloat))pAPIHooks[APIHOOK_GLVERTEX2F].pOldProc)(x, y);
+}
+
+VOID WINAPI new_glVertex3f(
+ GLfloat x,
+ GLfloat y,
+ GLfloat z
+)
+{
+ dprintf("[glVertex3f]\n");
+ ((VOID (WINAPI *)(GLfloat, GLfloat, GLfloat))pAPIHooks[APIHOOK_GLVERTEX3F].pOldProc)(x, y, z);
+}
+
+// Moves floating name tags
+VOID WINAPI new_glVertex3fv(
+ GLfloat *v
+)
+{
+ dprintf("[glVertex3fv]\n");
+ ((VOID (WINAPI *)(const GLfloat *v))pAPIHooks[APIHOOK_GLVERTEX3FV].pOldProc)(v);
+}
+
+VOID WINAPI new_glVertex4f(
+ GLfloat x,
+ GLfloat y,
+ GLfloat z,
+ GLfloat w
+)
+{
+ dprintf("[glVertex4f]\n");
+ ((VOID (WINAPI *)(GLfloat, GLfloat, GLfloat, GLfloat))pAPIHooks[APIHOOK_GLVERTEX4F].pOldProc)(x, y, z, w);
+}
+
+VOID WINAPI new_glVertex4fv(
+ GLfloat *v
+)
+{
+ dprintf("[glVertex4v]\n");
+ ((VOID (WINAPI *)(const GLfloat *v))pAPIHooks[APIHOOK_GLVERTEX4FV].pOldProc)(v);
+}
+
+VOID WINAPI new_glTexCoord2fv(
+ GLfloat *v
+)
+{
+ ((VOID (WINAPI *)(GLfloat *))pAPIHooks[APIHOOK_GLTEXCOORD2FV].pOldProc)(v);
+}
+
+VOID WINAPI new_glColor4f(
+ GLfloat red,
+ GLfloat green,
+ GLfloat blue,
+ GLfloat alpha
+)
+{
+ ((VOID (WINAPI *)(GLfloat, GLfloat, GLfloat, GLfloat))pAPIHooks[APIHOOK_GLCOLOR4F].pOldProc)(red, green, blue, alpha);
+}
+
+VOID WINAPI new_glColor3f(
+ GLfloat red,
+ GLfloat green,
+ GLfloat blue
+)
+{
+ GLfloat alpha;
+ alpha = 1.0f;
+
+ ((VOID (WINAPI *)(GLfloat, GLfloat, GLfloat, GLfloat))pAPIHooks[APIHOOK_GLCOLOR4F].pOldProc)(red, green, blue, alpha);
+}
+
+VOID WINAPI new_glColor4fv(
+ GLfloat *v
+)
+{
+ ((VOID (WINAPI *)(const GLfloat *))pAPIHooks[APIHOOK_GLCOLOR4FV].pOldProc)(v);
+}
+
+VOID WINAPI new_glColor4ubv(
+ GLubyte *v
+)
+{
+ ((VOID (WINAPI *)(const GLubyte *))pAPIHooks[APIHOOK_GLCOLOR4UBV].pOldProc)(v);
+}
+
+VOID WINAPI new_glColor3fv(
+ GLfloat *v
+)
+{
+ GLfloat n[4];
+ n[0] = v[0];
+ n[1] = v[1];
+ n[2] = v[2];
+ n[3] = 1.0;
+
+ ((VOID (WINAPI *)(const GLfloat *))pAPIHooks[APIHOOK_GLCOLOR4FV].pOldProc)(n);
+}
+
+GLenum WINAPI new_glGetError(
+ void
+)
+{
+ dprintf("[glGetError] ");
+ GLenum error = ((GLenum (WINAPI *)(void))pAPIHooks[APIHOOK_GLGETERROR].pOldProc)();
+
+ dprintf("0x%x\n", error);
+ if (error == GL_INVALID_OPERATION)
+ return GL_NO_ERROR;
+ else return error;
+}
+
+VOID WINAPI new_glColorPointer(
+ GLint size,
+ GLenum type,
+ GLsizei stride,
+ const GLvoid *pointer
+)
+{
+ dprintf("[glColorPointer]\n");
+ ((VOID (WINAPI *)(GLint, GLenum, GLsizei, const GLvoid *))pAPIHooks[APIHOOK_GLCOLORPOINTER].pOldProc)(size, type, stride, pointer);
+}
+
+// Used to render avatars and trees
+VOID WINAPI new_glDrawElements(
+ GLenum mode,
+ GLsizei count,
+ GLenum type,
+ const GLvoid *indices
+)
+{
+ //glColor4f(1.0, 1.0, 1.0, 0.2);
+ /*glBegin(GL_QUADS);
+ for (int i = 0; i < 10; i++)
+ {
+ GLfloat fPosX;
+ GLfloat fPosY;
+ GLfloat fPosZ;
+
+ fPosX = (float)(rand() % 300) - 150.0f;
+ fPosY = -10;//(float)(rand() % 200) - 10.0f;
+ fPosZ = (float)(rand() % 300) - 150.0f;
+
+ glTexCoord2f(0.0, 1.0);
+ glVertex3f(fPosX - 4.0f, fPosY + 1.0f, fPosZ - 4.0f);
+
+ glTexCoord2f(0.0, 0.0);
+ glVertex3f(fPosX - 4.0f, fPosY + 1.0f, fPosZ + 4.0f);
+
+ glTexCoord2f(1.0, 0.0);
+ glVertex3f(fPosX + 4.0f, fPosY + 1.0f, fPosZ + 4.0f);
+
+ glTexCoord2f(1.0, 1.0);
+ glVertex3f(fPosX + 4.0f, fPosY + 1.0f, fPosZ - 4.0f);
+
+ }
+ glEnd();*/
+
+ dprintf("[glDrawElements] %d\n", count);
+ ((VOID (WINAPI *)(GLenum, GLsizei, GLenum, const GLvoid *))pAPIHooks[APIHOOK_GLDRAWELEMENTS].pOldProc)(mode, count, type, indices);
+}
+
+VOID WINAPI new_glDrawArrays(
+ GLenum mode,
+ GLint first,
+ GLsizei count
+)
+{
+ dprintf("[glDrawArrays] %d\n", count);
+ ((VOID (WINAPI *)(GLenum, GLint, GLsizei))pAPIHooks[APIHOOK_GLDRAWARRAYS].pOldProc)(mode, first, count);
+}
+
+VOID WINAPI new_glDrawPixels(
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ const GLvoid *pixels
+)
+{
+ dprintf("[glDrawPixels]\n");
+ ((VOID (WINAPI *)(GLsizei, GLsizei, GLenum, GLenum, const GLvoid))pAPIHooks[APIHOOK_GLDRAWPIXELS].pOldProc)(width, height, format, type, pixels);
+}
+
+VOID WINAPI new_glVertexPointer(
+ GLint size,
+ GLenum type,
+ GLsizei stride,
+ const GLvoid *pointer
+)
+{
+ ((VOID (WINAPI *)(GLint, GLenum, GLsizei, const GLvoid *))pAPIHooks[APIHOOK_GLVERTEXPOINTER].pOldProc)(size, type, stride, pointer);
+}
+
+VOID WINAPI new_glNormalPointer(
+ GLenum type,
+ GLsizei stride,
+ const GLvoid *pointer
+)
+{
+ dprintf("[glNormalPointer]\n");
+ ((VOID (WINAPI *)(GLenum, GLsizei, const GLvoid *))pAPIHooks[APIHOOK_GLNORMALPOINTER].pOldProc)(type, stride, pointer);
+}
+
+VOID WINAPI new_glTexCoordPointer(
+ GLint size,
+ GLenum type,
+ GLsizei stride,
+ const GLvoid *pointer
+)
+{
+ ((VOID (WINAPI *)(GLint, GLenum, GLsizei, const GLvoid *))pAPIHooks[APIHOOK_GLTEXCOORDPOINTER].pOldProc)(size, type, stride, pointer);
+}
+
+VOID WINAPI new_glViewport(
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height
+)
+{
+ ((VOID (WINAPI *)(GLint, GLint, GLsizei, GLsizei))pAPIHooks[APIHOOK_GLVIEWPORT].pOldProc)(x, y, width, height);
+}
+
+VOID WINAPI new_glTexImage2D(
+ GLenum target,
+ GLint level,
+ GLint components,
+ GLsizei width,
+ GLsizei height,
+ GLint border,
+ GLenum format,
+ GLenum type,
+ const GLvoid *pixels
+)
+{
+ ((VOID (WINAPI *)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *))pAPIHooks[APIHOOK_GLTEXIMAGE2D].pOldProc)(target, level, components, width, height, border, format, type, pixels);
+}
+
+VOID WINAPI new_gluPerspective(
+ GLdouble fovy,
+ GLdouble aspect,
+ GLdouble zNear,
+ GLdouble zFar
+)
+{
+ ((VOID (WINAPI *)(GLdouble, GLdouble, GLdouble, GLdouble))pAPIHooks[APIHOOK_GLUPERSPECTIVE].pOldProc)(fovy, aspect, zNear, zFar);
+}
+
+VOID WINAPI new_glBegin(
+ GLenum mode
+)
+{
+ ((VOID (WINAPI *)(GLenum))pAPIHooks[APIHOOK_GLBEGIN].pOldProc)(mode);
+}
+
+VOID WINAPI new_glFlush(
+ void
+)
+{
+ ((VOID (WINAPI *)(void))pAPIHooks[APIHOOK_GLFLUSH].pOldProc)();
+}
+
+VOID WINAPI new_gluQuadricDrawStyle(
+ GLUquadricObj * qobj,
+ GLenum drawStyle
+ )
+{
+ ((VOID (WINAPI *)(GLUquadricObj *, GLenum))pAPIHooks[APIHOOK_GLUQUADRICDRAWSTYLE].pOldProc)(qobj, drawStyle);
+}
+
+VOID WINAPI new_gluTessVertex(
+ GLUtesselator * tess,
+ GLdouble coords[3],
+ void * data
+)
+{
+ dprintf("[gluTessVertex]\n");
+ ((VOID (WINAPI *)(GLUtesselator *, GLdouble[3], void *))pAPIHooks[APIHOOK_GLUTESSVERTEX].pOldProc)(tess, coords, data);
+}
+
+BOOL WINAPI new_WriteFileA(
+ HANDLE hFile, // handle to file to write to
+ LPCVOID lpBuffer, // pointer to data to write to file
+ DWORD nNumberOfBytesToWrite, // number of bytes to write
+ LPDWORD lpNumberOfBytesWritten, // pointer to number of bytes written
+ LPOVERLAPPED lpOverlapped // pointer to structure for overlapped I/O
+)
+{
+ return ((BOOL (WINAPI *)(HANDLE, LPCVOID, DWORD, LPDWORD, LPOVERLAPPED))pAPIHooks[APIHOOK_WRITEFILEA].pOldProc)(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped);
+}
+
+BOOL WINAPI new_DeleteFileA(
+ LPCTSTR lpFileName // pointer to name of file to delete
+)
+{
+ dprintf("[DeleteFileA] %s\n", lpFileName);
+
+ //return TRUE;
+ return ((BOOL (WINAPI *)(LPCTSTR))pAPIHooks[APIHOOK_DELETEFILEA].pOldProc)(lpFileName);
+}
+
+int WINAPI new_lstrcmpiA(
+ LPCTSTR lpString1, // pointer to first string
+ LPCTSTR lpString2 // pointer to second string
+)
+{
+ //dprintf("[lstrcmpiA] %s <> %s\n", lpString1, lpString2);
+ return ((int (WINAPI *)(LPCTSTR, LPCTSTR))pAPIHooks[APIHOOK_LSTRCMPIA].pOldProc)(lpString1, lpString2);
+}
+
+APIHOOK pAPIHooks[] = {
+ { NULL, _T("KERNEL32.DLL"), "GetProcAddress", FALSE, NULL, (PROC)new_GetProcAddress },
+ { NULL, _T("KERNEL32.DLL"), "LoadLibraryA", FALSE, NULL, (PROC)new_LoadLibraryA },
+ { NULL, _T("KERNEL32.DLL"), "LoadLibraryW", FALSE, NULL, (PROC)new_LoadLibraryW },
+ { NULL, _T("KERNEL32.DLL"), "LoadLibraryExA", FALSE, NULL, (PROC)new_LoadLibraryExA },
+ { NULL, _T("KERNEL32.DLL"), "LoadLibraryExW", FALSE, NULL, (PROC)new_LoadLibraryExW },
+ { NULL, _T("KERNEL32.DLL"), "FreeLibraryA", FALSE, NULL, (PROC)new_FreeLibraryA },
+ { NULL, _T("KERNEL32.DLL"), "DeleteFileA", FALSE, NULL, (PROC)new_DeleteFileA },
+ { NULL, _T("XKERNEL32.DLL"), "WriteFileA", FALSE, NULL, (PROC)new_WriteFileA },
+ { NULL, _T("XKERNEL32.DLL"), "lstrcmpiA", FALSE, NULL, (PROC)new_lstrcmpiA },
+ { NULL, _T("WS2_32.DLL"), (LPCSTR)4, TRUE, NULL, (PROC)new_connect },
+ { NULL, _T("WS2_32.DLL"), (LPCSTR)16, TRUE, NULL, (PROC)new_recv },
+ { NULL, _T("WS2_32.DLL"), (LPCSTR)17, TRUE, NULL, (PROC)new_recvfrom },
+ { NULL, _T("WS2_32.DLL"), (LPCSTR)19, TRUE, NULL, (PROC)new_send },
+ { NULL, _T("WS2_32.DLL"), (LPCSTR)20, TRUE, NULL, (PROC)new_sendto },
+ { NULL, _T("WS2_32.DLL"), (LPCSTR)52, TRUE, NULL, (PROC)new_gethostbyname },
+// { NULL, _T("USER32.DLL"), "SetWindowLongA", FALSE, NULL, (PROC)new_SetWindowLongA },
+// { NULL, _T("USER32.DLL"), "SetWindowLongW", FALSE, NULL, (PROC)new_SetWindowLongW },
+ { NULL, _T("WININET.DLL"), "InternetReadFile", FALSE, NULL, (PROC)new_InternetReadFile },
+ { NULL, _T("WININET.DLL"), "InternetOpenUrlA", FALSE, NULL, (PROC)new_InternetOpenUrlA },
+ { NULL, _T("RSAENH.DLL"), "CPEncrypt", FALSE, NULL, (PROC)new_CPEncrypt },
+ { NULL, _T("USER32.DLL"), "PeekMessageA", FALSE, NULL, (PROC)new_PeekMessageA },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glGetError", FALSE, NULL, (PROC)new_glGetError },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glBegin", FALSE, NULL, (PROC)new_glBegin },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glEnable", FALSE, NULL, (PROC)new_glEnable },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glIsEnabled", FALSE, NULL, (PROC)new_glIsEnabled },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTranslated", FALSE, NULL, (PROC)new_glTranslated },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTranslatef", FALSE, NULL, (PROC)new_glTranslatef },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTexCoord2f", FALSE, NULL, (PROC)new_glTexCoord2f },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTexCoord2fv", FALSE, NULL, (PROC)new_glTexCoord2fv },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertex2f", FALSE, NULL, (PROC)new_glVertex2f },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertex3f", FALSE, NULL, (PROC)new_glVertex3f },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertex3fv", FALSE, NULL, (PROC)new_glVertex3fv },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertex4f", FALSE, NULL, (PROC)new_glVertex4f },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertex4fv", FALSE, NULL, (PROC)new_glVertex4fv },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glVertexPointer", FALSE, NULL, (PROC)new_glVertexPointer },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTexCoordPointer", FALSE, NULL, (PROC)new_glTexCoordPointer },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glNormalPointer", FALSE, NULL, (PROC)new_glNormalPointer },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glDrawElements", FALSE, NULL, (PROC)new_glDrawElements },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glDrawArrays", FALSE, NULL, (PROC)new_glDrawArrays },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glDrawPixels", FALSE, NULL, (PROC)new_glDrawPixels },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glTexImage2D", FALSE, NULL, (PROC)new_glTexImage2D },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColor3f", FALSE, NULL, (PROC)new_glColor3f },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColor3fv", FALSE, NULL, (PROC)new_glColor3fv },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColor4f", FALSE, NULL, (PROC)new_glColor4f },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColor4fv", FALSE, NULL, (PROC)new_glColor4fv },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColor4ubv", FALSE, NULL, (PROC)new_glColor4ubv },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glColorPointer", FALSE, NULL, (PROC)new_glColorPointer },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glViewport", FALSE, NULL, (PROC)new_glViewport },
+// { NULL, _T("UNCOMMENT"/*"OPENGL32.DLL"*/), "glFlush", FALSE, NULL, (PROC)new_glFlush },
+// { NULL, _T("UNCOMMENT"/*"GLU32.DLL"*/), "gluPerspective", FALSE, NULL, (PROC)new_gluPerspective },
+// { NULL, _T("UNCOMMENT"/*"GLU32.DLL"*/), "gluQuadricDrawStyle", FALSE, NULL, (PROC)new_gluQuadricDrawStyle },
+// { NULL, _T("UNCOMMENT"/*"GLU32.DLL"*/), "gluTessVertex", FALSE, NULL, (PROC)new_gluTessVertex },
+ { NULL, NULL, NULL, FALSE, NULL, NULL }
+};
+
+PROC HookModuleImport(HMODULE hModule, LPCTSTR szModule, LPCSTR szImport, PROC pNewProc, BOOL bOrdinal)
+{
+ PIMAGE_DOS_HEADER pDOSHeader = (PIMAGE_DOS_HEADER)hModule;
+
+ if (IsBadReadPtr(pDOSHeader, sizeof(IMAGE_DOS_HEADER)) || pDOSHeader->e_magic != IMAGE_DOS_SIGNATURE)
+ {
+ SetLastErrorEx(ERROR_INVALID_PARAMETER, SLE_ERROR);
+ return NULL;
+ }
+
+ PIMAGE_NT_HEADERS pNTHeader = MAKEPTR (PIMAGE_NT_HEADERS, pDOSHeader, pDOSHeader->e_lfanew);
+ if (IsBadReadPtr(pNTHeader, sizeof(IMAGE_NT_HEADERS)) || pNTHeader->Signature != IMAGE_NT_SIGNATURE)
+ {
+ SetLastErrorEx(ERROR_INVALID_PARAMETER, SLE_ERROR);
+ return NULL;
+ }
+
+ if (pNTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size != 0)
+ {
+ PIMAGE_IMPORT_DESCRIPTOR pImportDesc = MAKEPTR(PIMAGE_IMPORT_DESCRIPTOR, pDOSHeader, pNTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
+ while (pImportDesc && pImportDesc->Name != NULL)
+ {
+ PTSTR szImportModule = MAKEPTR(PTSTR, pDOSHeader, pImportDesc->Name);
+ if (szImportModule != NULL && _tcsicmp(szImportModule, szModule) == 0)
+ {
+ PIMAGE_THUNK_DATA pOrigThunk = MAKEPTR(PIMAGE_THUNK_DATA, hModule, pImportDesc->OriginalFirstThunk);
+ PIMAGE_THUNK_DATA pRealThunk = MAKEPTR(PIMAGE_THUNK_DATA, hModule, pImportDesc->FirstThunk);
+ while (pOrigThunk != NULL && pRealThunk != NULL && pOrigThunk->u1.Function != NULL && pRealThunk->u1.Function)
+ {
+ PIMAGE_IMPORT_BY_NAME pByName = MAKEPTR(PIMAGE_IMPORT_BY_NAME, hModule, pOrigThunk->u1.AddressOfData);
+
+ if ((!bOrdinal && IMAGE_ORDINAL_FLAG != (pOrigThunk->u1.Ordinal & IMAGE_ORDINAL_FLAG) && pByName->Name[0] != 0 && stricmp((char*)pByName->Name, szImport) == 0) || (bOrdinal && IMAGE_ORDINAL(pOrigThunk->u1.Ordinal) == (DWORD)szImport))
+ {
+ PROC pOldProc;
+
+ /*
+ Retrieve memory information
+ */
+ MEMORY_BASIC_INFORMATION mbi;
+ if (VirtualQuery(pRealThunk, &mbi, sizeof(MEMORY_BASIC_INFORMATION)))
+ {
+ /*
+ Give ourselves write access
+ */
+ if (VirtualProtect(mbi.BaseAddress, mbi.RegionSize, PAGE_READWRITE, &mbi.Protect))
+ {
+ /*
+ Store old function pointer for return value
+ */
+ pOldProc = (PROC)pRealThunk->u1.Function;
+ /*
+ Only patch import table if the new function is different than the old one
+ */
+ if (pNewProc != NULL && pOldProc != pNewProc) pRealThunk->u1.Function = (DWORD)pNewProc;
+
+ /*
+ Restore old protection value
+ */
+ DWORD dwOldProtect;
+ VirtualProtect(mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &dwOldProtect);
+ }
+
+// TCHAR szModuleFileName[MAX_PATH];
+// GetModuleFileName(hModule, szModuleFileName, sizeof(szModuleFileName));
+// dprintf(_T("HOOKED [%s => %s]\n"), szImport, szModuleFileName);
+// return pOldProc;
+ }
+ }
+ pOrigThunk++;
+ pRealThunk++;
+ }
+ }
+ pImportDesc++;
+ }
+ }
+
+ return NULL;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////
+//
+// Retrieve the loaded modules for the specified process
+//
+// dwProccessID Process ID of the process whose loaded module list you wish to retrive.
+// Specify 0 for the current process.
+//
+// pModules Pointer to an array of MODULEINFO structures to store the module list.
+// Can be NULL.
+//
+// puiCount Specify 0 to retrieve the module count otherwise the maximum number of
+// entries in the pModule array to return.
+//
+// Return Value
+//
+// Returns FALSE if failed
+//
+///////////////////////////////////////////////////////////////////////////////////////////
+BOOL GetModuleList(DWORD dwProcessID, PMODULEENTRY32 pModules, LPUINT puiCount)
+{
+// dprintf(_T("[GetModuleList]\n"));
+
+ HANDLE hSnapshot;
+ MODULEENTRY32 cME32;
+ UINT uiCount = 0;
+
+ if (puiCount == NULL)
+ {
+ SetLastErrorEx(ERROR_INVALID_PARAMETER, SLE_ERROR);
+ return FALSE;
+ }
+
+ hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessID);
+ if (hSnapshot == INVALID_HANDLE_VALUE)
+ {
+ return FALSE;
+ }
+
+ ZeroMemory(&cME32, sizeof(cME32));
+ cME32.dwSize = sizeof(MODULEENTRY32);
+ if (Module32First(hSnapshot, &cME32) == TRUE)
+ {
+ do
+ {
+ if (pModules != NULL && *puiCount)
+ {
+ _tcsncpy(pModules[uiCount].szModule, cME32.szModule, MAX_PATH);
+ pModules[uiCount].hModule = cME32.hModule;
+ }
+ uiCount++;
+ } while (Module32Next(hSnapshot, &cME32) == TRUE && (*puiCount == 0 || uiCount < *puiCount));
+ }
+
+ CloseHandle(hSnapshot);
+
+ *puiCount = uiCount;
+
+ return TRUE;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////
+//
+// Save pointers to old functions
+//
+///////////////////////////////////////////////////////////////////////////////////////////
+void SaveImportHooks()
+{
+// dprintf(_T("[SaveImportHooks]\n"));
+
+ INT i;
+
+ for (i = 0; pAPIHooks[i].szModule; i++)
+ {
+ /*
+ Only store pointers for any functions we haven't taken care of yet so this may be called multiple times
+ */
+ if (pAPIHooks[i].pOldProc == NULL)
+ {
+ pAPIHooks[i].pOldProc = GetProcAddress(GetModuleHandle(pAPIHooks[i].szModule), (LPCSTR)pAPIHooks[i].szImport);
+// dprintf(_T("Saved import for %s(%s) at 0x%08X\n"), pAPIHooks[i].szModule, pAPIHooks[i].szImport, pAPIHooks[i].pOldProc);
+ }
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////
+//
+// Patch import table of all loaded modules
+//
+///////////////////////////////////////////////////////////////////////////////////////////
+void InstallImportHooks()
+{
+// dprintf(_T("[InstallImportHooks]\n"));
+
+ /*
+ Retrieve number of loaded modules
+ */
+ UINT uiCount = 0;
+ INT i, j;
+ if (GetModuleList(0, NULL, &uiCount))
+ {
+ /*
+ Allocate temporary table of loaded modules
+ */
+ PMODULEENTRY32 pModules = (PMODULEENTRY32)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, uiCount*sizeof(MODULEENTRY32));
+ if (pModules != NULL)
+ {
+ /*
+ Retrieve table of loaded modules
+ */
+ if (GetModuleList(0, pModules, &uiCount))
+ {
+ /*
+ Loop through each module and patch its import table
+ */
+ for (i = 0; i < (INT)uiCount; i++)
+ {
+ /*
+ Loop through each API hook and patch import table for this module
+ HookModuleImport() takes care of dupe checking
+ */
+ for (j = 0; pAPIHooks[j].szModule; j++)
+ {
+ if (_tcsicmp(pModules[i].szModule, _T("SNOWFLAKE.DLL")) && _tcsicmp(pModules[i].szModule, _T("FMOD.DLL")) && /*_tcsicmp(pModules[i].szModule, _T("NEWVIEW.EXE")) &&*/ _tcsicmp(pModules[i].szModule, pAPIHooks[j].szModule) && pAPIHooks[j].pNewProc != NULL && !IsBadCodePtr(pAPIHooks[j].pNewProc))
+ {
+ HookModuleImport(pModules[i].hModule, pAPIHooks[j].szModule, pAPIHooks[j].szImport, pAPIHooks[j].pNewProc, pAPIHooks[j].bOrdinal);
+ }
+ }
+ }
+ }
+ GlobalFree(pModules);
+ }
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////
+//
+// Removes the import table for all loaded modules back to the original saved functions
+//
+///////////////////////////////////////////////////////////////////////////////////////////
+void RemoveImportHooks()
+{
+ dprintf(_T("[RemoveImportHooks]\n"));
+
+ /*
+ Retrieve number of loaded modules
+ */
+ UINT uiCount = 0;
+ INT i, j;
+ if (GetModuleList(0, NULL, &uiCount))
+ {
+ /*
+ Allocate temporary table of loaded modules
+ */
+ PMODULEENTRY32 pModules = (PMODULEENTRY32)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, uiCount*sizeof(MODULEENTRY32));
+ if (pModules != NULL)
+ {
+ /*
+ Retrieve table of loaded modules
+ */
+ if (GetModuleList(0, pModules, &uiCount))
+ {
+ /*
+ Loop through each module and patch its import table
+ */
+ for (i = 0; i < (INT)uiCount; i++)
+ {
+ /*
+ Loop through each API hook and restore import table for this module
+ */
+// dprintf("RESTORE [%s]\n", pModules[i].szModule);
+ for (j = 0; pAPIHooks[j].szModule; j++)
+ {
+ if (_tcsicmp(pModules[i].szModule, _T("SNOWFLAKE.DLL")) && /*_tcsicmp(pModules[i].szModule, _T("NEWVIEW.EXE")) &&*/ _tcsicmp(pModules[i].szModule, pAPIHooks[j].szModule) && pAPIHooks[j].pOldProc != NULL && !IsBadCodePtr(pAPIHooks[j].pOldProc))
+ {
+// dprintf(_T("REMOVE [%s => %s]\n"), pAPIHooks[j].szImport, pModules[i].szModule);
+ HookModuleImport(pModules[i].hModule, pAPIHooks[j].szModule, pAPIHooks[j].szImport, pAPIHooks[j].pOldProc, pAPIHooks[j].bOrdinal);
+ }
+ }
+ }
+
+ for (j = 0; pAPIHooks[j].szModule; j++)
+ {
+ pAPIHooks[j].pOldProc = NULL;
+ }
+ }
+ GlobalFree(pModules);
+ }
+ }
+}
+
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ if (ul_reason_for_call == DLL_PROCESS_ATTACH)
+ {
+ TCHAR szPath[MAX_PATH];
+
+ g_hinstDLL = (HINSTANCE)hModule;
+ _Module.Init(NULL, g_hinstDLL);
+ DisableThreadLibraryCalls(g_hinstDLL);
+
+ if (GetModuleFileName(GetModuleHandle(0), szPath, MAX_PATH))
+ {
+ _tcsupr(szPath);
+
+ if (_tcsstr(szPath, _T("\\SECONDLIFE.EXE")))
+ {
+ if (!g_pConfig)
+ g_pConfig = new CConfig();
+
+#ifdef ECHO
+ AllocConsole();
+
+ if (!fpLog)
+ fpLog = fopen(g_pConfig->m_pSnowcrashTxtPath, "w");
+#endif
+ dprintf(_T("[snowflake] %s\n"), szPath);
+
+ decomm();
+
+ SaveImportHooks();
+ InstallImportHooks();
+ }
+ }
+ } else if (ul_reason_for_call == DLL_PROCESS_DETACH)
+ {
+ RemoveSLHooks();
+ RemoveImportHooks();
+#ifdef ECHO
+ FreeConsole();
+
+ if (fpLog)
+ {
+ fclose(fpLog);
+ fpLog = NULL;
+ }
+#endif
+ _Module.Term();
+ }
+
+ return TRUE;
+}
+
+LRESULT CALLBACK CBTHookProc(int nCode, WPARAM wParam, LPARAM lParam)
+{
+ switch(nCode)
+ {
+ case HCBT_ACTIVATE:
+ {
+ if (!g_pMainFrm)
+ {
+ TCHAR szClass[128];
+ HWND hwnd = (HWND)wParam;
+
+ if (GetClassName(hwnd, szClass, sizeof(szClass)))
+ {
+ if (_tcsicmp(szClass, _T("Second Life")) == 0)
+ {
+ TCHAR szTitle[256];
+ GetWindowText(hwnd, szTitle, sizeof(szTitle));
+
+ if (_tcsstr(szTitle, "Second Life"))
+ {
+ dprintf(_T(">>> [%s][%s]\n"), szClass, szTitle);
+ InstallSLHooks(hwnd);
+ }
+ }
+ else
+ dprintf(_T(">>> [%s]\n"), szClass);
+ }
+ }
+ }
+ break;
+
+ case HCBT_CREATEWND:
+ {
+ TCHAR szClass[128];
+ HWND hwnd = (HWND)wParam;
+ LPCBT_CREATEWND lpcbt = (LPCBT_CREATEWND)lParam;
+
+ if (GetClassName(hwnd, szClass, sizeof(szClass)))
+ {
+ //dprintf(_T(">>> [%s]\n"), szClass);
+ //if (_tcsicmp(szClass, _T("OpenGL")) == 0)
+ //{
+ //dprintf(_T("[snowflake] SL window created\n"));
+ //InstallSLHooks(hwnd);
+ //}
+ }
+ }
+ break;
+
+ case HCBT_DESTROYWND:
+ {
+ TCHAR szClass[128];
+ HWND hwnd = (HWND)wParam;
+
+ if (GetClassName(hwnd, szClass, sizeof(szClass)))
+ {
+ if (g_pMainFrm && g_pMainFrm->m_hWnd == hwnd)
+ {
+ dprintf(_T("[snowflake] SL window destroyed\n"));
+ RemoveSLHooks();
+ }
+ }
+ }
+ break;
+ }
+ return ::CallNextHookEx(h_hCBTHook, nCode, wParam, lParam);
+}
+
+SNOWFLAKE_API bool InstallSystemHook(void)
+{
+// dprintf(_T("[InstallSystemHook]\n"));
+
+ if (h_hCBTHook == NULL)
+ {
+ h_hCBTHook = ::SetWindowsHookEx(WH_CBT, CBTHookProc, g_hinstDLL, 0);
+ }
+
+ return (h_hCBTHook != NULL);
+}
+
+SNOWFLAKE_API BOOL RemoveSystemHook()
+{
+ dprintf(_T("[RemoveSystemHook]\n"));
+
+ if (h_hCBTHook != NULL)
+ {
+ if (UnhookWindowsHookEx(h_hCBTHook))
+ {
+ h_hCBTHook = NULL;
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+bool InstallSLHooks(HWND hwnd)
+{
+ _Module.AddMessageLoop(&g_msgLoop);
+
+ if (g_pMainFrm == NULL)
+ {
+ g_pMainFrm = new CMainFrame();
+
+ if (g_pMainFrm->SubclassWindow(hwnd))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool RemoveSLHooks()
+{
+ if (g_pMainFrm != NULL)
+ {
+ dprintf(_T("RemoveSLHooks MainFrm\n"));
+ if (g_pMainFrm->m_hWnd != NULL && ::IsWindow(*g_pMainFrm))
+ {
+ dprintf(_T("RemoveSLHooks MainFrm Unsub\n"));
+ g_pMainFrm->UnsubclassWindow(TRUE);
+ g_pMainFrm->m_hWnd = NULL;
+ } else
+ g_pMainFrm->m_hWnd = NULL;
+ delete(g_pMainFrm);
+ g_pMainFrm = NULL;
+
+ return true;
+ }
+
+ return false;
+}
diff --git a/applications/snowcrash/snowflake/snowflake.h b/applications/snowcrash/snowflake/snowflake.h
index 6923cdc9..021276f2 100644
--- a/applications/snowcrash/snowflake/snowflake.h
+++ b/applications/snowcrash/snowflake/snowflake.h
@@ -1,14 +1,14 @@
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the SNOWFLAKE_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// SNOWFLAKE_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef SNOWFLAKE_EXPORTS
-#define SNOWFLAKE_API __declspec(dllexport)
-#else
-#define SNOWFLAKE_API __declspec(dllimport)
-#endif
-
-SNOWFLAKE_API bool InstallSystemHook(void);
-SNOWFLAKE_API BOOL RemoveSystemHook();
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the SNOWFLAKE_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// SNOWFLAKE_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef SNOWFLAKE_EXPORTS
+#define SNOWFLAKE_API __declspec(dllexport)
+#else
+#define SNOWFLAKE_API __declspec(dllimport)
+#endif
+
+SNOWFLAKE_API bool InstallSystemHook(void);
+SNOWFLAKE_API BOOL RemoveSystemHook();
diff --git a/applications/snowcrash/snowflake/snowflake.vcproj b/applications/snowcrash/snowflake/snowflake.vcproj
index bc98088f..b942c4dc 100644
--- a/applications/snowcrash/snowflake/snowflake.vcproj
+++ b/applications/snowcrash/snowflake/snowflake.vcproj
@@ -1,219 +1,219 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/snowcrash/snowflake/stdafx.cpp b/applications/snowcrash/snowflake/stdafx.cpp
index bc93367e..a061f93b 100644
--- a/applications/snowcrash/snowflake/stdafx.cpp
+++ b/applications/snowcrash/snowflake/stdafx.cpp
@@ -1,67 +1,67 @@
-// stdafx.cpp : source file that includes just the standard includes
-// snowflake.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-#ifdef ECHO
-FILE *fpLog = NULL;
-#endif
-
-#ifdef ECHODEBUG
-void dprintf(TCHAR *format, ...)
-{
- LPTSTR pBuffer = new TCHAR[8192];
-
- if (pBuffer != NULL)
- {
- va_list args;
- DWORD dwWrote;
-
- va_start(args, format);
- _vsntprintf(pBuffer, 8192, format, args);
- va_end(args);
-
- WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), pBuffer, (DWORD)_tcslen(pBuffer), &dwWrote, NULL);
-
- if (fpLog)
- {
- fwrite(pBuffer, 1, _tcslen(pBuffer), fpLog);
- fflush(fpLog);
- }
-
- delete [] pBuffer;
- }
-}
-#else
-#define dprintf
-#endif
-
-#ifdef ECHONORMAL
-void myprintf(TCHAR *format, ...)
-{
- LPTSTR pBuffer = new TCHAR[8192];
-
- if (pBuffer != NULL)
- {
- va_list args;
- DWORD dwWrote;
-
- va_start(args, format);
- _vsntprintf(pBuffer, 8192, format, args);
- va_end(args);
-
- WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), pBuffer, (DWORD)_tcslen(pBuffer), &dwWrote, NULL);
-
- if (fpLog)
- {
- fwrite(pBuffer, 1, _tcslen(pBuffer), fpLog);
- fflush(fpLog);
- }
-
- delete [] pBuffer;
- }
-}
-#else
-#define myprintf
-#endif
+// stdafx.cpp : source file that includes just the standard includes
+// snowflake.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+#ifdef ECHO
+FILE *fpLog = NULL;
+#endif
+
+#ifdef ECHODEBUG
+void dprintf(TCHAR *format, ...)
+{
+ LPTSTR pBuffer = new TCHAR[8192];
+
+ if (pBuffer != NULL)
+ {
+ va_list args;
+ DWORD dwWrote;
+
+ va_start(args, format);
+ _vsntprintf(pBuffer, 8192, format, args);
+ va_end(args);
+
+ WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), pBuffer, (DWORD)_tcslen(pBuffer), &dwWrote, NULL);
+
+ if (fpLog)
+ {
+ fwrite(pBuffer, 1, _tcslen(pBuffer), fpLog);
+ fflush(fpLog);
+ }
+
+ delete [] pBuffer;
+ }
+}
+#else
+#define dprintf
+#endif
+
+#ifdef ECHONORMAL
+void myprintf(TCHAR *format, ...)
+{
+ LPTSTR pBuffer = new TCHAR[8192];
+
+ if (pBuffer != NULL)
+ {
+ va_list args;
+ DWORD dwWrote;
+
+ va_start(args, format);
+ _vsntprintf(pBuffer, 8192, format, args);
+ va_end(args);
+
+ WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), pBuffer, (DWORD)_tcslen(pBuffer), &dwWrote, NULL);
+
+ if (fpLog)
+ {
+ fwrite(pBuffer, 1, _tcslen(pBuffer), fpLog);
+ fflush(fpLog);
+ }
+
+ delete [] pBuffer;
+ }
+}
+#else
+#define myprintf
+#endif
diff --git a/applications/snowcrash/snowflake/stdafx.h b/applications/snowcrash/snowflake/stdafx.h
index cb9977e3..70dfe3a9 100644
--- a/applications/snowcrash/snowflake/stdafx.h
+++ b/applications/snowcrash/snowflake/stdafx.h
@@ -1,106 +1,106 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include
-#include
-#include
-#include
-#include
-#include
-
-extern CAppModule _Module;
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "resource.h"
-
-//-----------------------------------------------------------------------------
-// Miscellaneous helper functions
-//-----------------------------------------------------------------------------
-#define SAFE_FREE(p) { if(p) { free (p); (p)=NULL; } }
-#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
-#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
-#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
-
-#ifdef _DEBUG
-#define ECHODEBUG
-#define ECHONORMAL
-#define ECHO
-#else
-#undef ECHODEBUG
-#undef ECHONORMAL
-#undef ECHO
-#endif
-
-#ifdef ECHODEBUG
-void dprintf(TCHAR *format, ...);
-#else
-#define dprintf
-#endif
-
-#ifdef ECHONORMAL
-void myprintf(TCHAR *format, ...);
-#else
-#define myprintf
-#endif
-
-extern FILE *fpLog;
-
-// Bitmasks
-#define BM_FLAG1 0x00000001
-#define BM_FLAG2 0x00000002
-#define BM_FLAG3 0x00000004
-#define BM_FLAG4 0x00000008
-#define BM_FLAG5 0x00000010
-#define BM_FLAG6 0x00000020
-#define BM_FLAG7 0x00000040
-#define BM_FLAG8 0x00000080
-#define BM_FLAG9 0x00000100
-#define BM_FLAG10 0x00000200
-#define BM_FLAG11 0x00000400
-#define BM_FLAG12 0x00000800
-#define BM_FLAG13 0x00001000
-#define BM_FLAG14 0x00002000
-#define BM_FLAG15 0x00004000
-#define BM_FLAG16 0x00008000
-#define BM_FLAG18 0x00010000
-#define BM_FLAG19 0x00020000
-#define BM_FLAG20 0x00040000
-#define BM_FLAG21 0x00080000
-#define BM_FLAGALL 0x000fffff
-
-#define MAP_NOT_SAFE 0x00000001
-#define MAP_UNKNOWN1 0x00000002
-#define MAP_UNKNOWN2 0x00000004
-#define MAP_UNKNOWN3 0x00000020
-#define MAP_UNKNOWN4 0x00000040
-#define MAP_UNKNOWN5 0x00000080
-#define MAP_SANDBOX 0x00000100
-#define MAP_UNKNOWN6 0x00008000
-#define MAP_UNKNOWN7 0x00010000
-
-#define MSG_APPENDED_ACKS 0x10
-#define MSG_RESENT 0x20
-#define MSG_RELIABLE 0x40
-#define MSG_ZEROCODED 0x80
-
-#define MSG_FREQ_HIGH 0x0000
-#define MSG_FREQ_MED 0xFF00
-#define MSG_FREQ_LOW 0xFFFF
-
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include
+#include
+#include
+#include
+#include
+#include
+
+extern CAppModule _Module;
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "resource.h"
+
+//-----------------------------------------------------------------------------
+// Miscellaneous helper functions
+//-----------------------------------------------------------------------------
+#define SAFE_FREE(p) { if(p) { free (p); (p)=NULL; } }
+#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
+#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
+#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
+
+#ifdef _DEBUG
+#define ECHODEBUG
+#define ECHONORMAL
+#define ECHO
+#else
+#undef ECHODEBUG
+#undef ECHONORMAL
+#undef ECHO
+#endif
+
+#ifdef ECHODEBUG
+void dprintf(TCHAR *format, ...);
+#else
+#define dprintf
+#endif
+
+#ifdef ECHONORMAL
+void myprintf(TCHAR *format, ...);
+#else
+#define myprintf
+#endif
+
+extern FILE *fpLog;
+
+// Bitmasks
+#define BM_FLAG1 0x00000001
+#define BM_FLAG2 0x00000002
+#define BM_FLAG3 0x00000004
+#define BM_FLAG4 0x00000008
+#define BM_FLAG5 0x00000010
+#define BM_FLAG6 0x00000020
+#define BM_FLAG7 0x00000040
+#define BM_FLAG8 0x00000080
+#define BM_FLAG9 0x00000100
+#define BM_FLAG10 0x00000200
+#define BM_FLAG11 0x00000400
+#define BM_FLAG12 0x00000800
+#define BM_FLAG13 0x00001000
+#define BM_FLAG14 0x00002000
+#define BM_FLAG15 0x00004000
+#define BM_FLAG16 0x00008000
+#define BM_FLAG18 0x00010000
+#define BM_FLAG19 0x00020000
+#define BM_FLAG20 0x00040000
+#define BM_FLAG21 0x00080000
+#define BM_FLAGALL 0x000fffff
+
+#define MAP_NOT_SAFE 0x00000001
+#define MAP_UNKNOWN1 0x00000002
+#define MAP_UNKNOWN2 0x00000004
+#define MAP_UNKNOWN3 0x00000020
+#define MAP_UNKNOWN4 0x00000040
+#define MAP_UNKNOWN5 0x00000080
+#define MAP_SANDBOX 0x00000100
+#define MAP_UNKNOWN6 0x00008000
+#define MAP_UNKNOWN7 0x00010000
+
+#define MSG_APPENDED_ACKS 0x10
+#define MSG_RESENT 0x20
+#define MSG_RELIABLE 0x40
+#define MSG_ZEROCODED 0x80
+
+#define MSG_FREQ_HIGH 0x0000
+#define MSG_FREQ_MED 0xFF00
+#define MSG_FREQ_LOW 0xFFFF
+
#define REGION_MULTIPLIER 4294967296
\ No newline at end of file
diff --git a/builds/libsl_office.prims b/builds/libsl_office.prims
index e1516c7a..73b2d350 100644
--- a/builds/libsl_office.prims
+++ b/builds/libsl_office.prims
@@ -1,9560 +1,9560 @@
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-FALSE
-FALSE
-FALSE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+FALSE
+FALSE
+FALSE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/libsecondlife-cs/AssemblyInfo.cs b/libsecondlife-cs/AssemblyInfo.cs
index 9a6f924c..53f2eb42 100644
--- a/libsecondlife-cs/AssemblyInfo.cs
+++ b/libsecondlife-cs/AssemblyInfo.cs
@@ -1,58 +1,58 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-//
-// 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("libsecondlife")]
-[assembly: AssemblyDescription("Networking layer for the Second Life world")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Second Life Reverse Engineering Team")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("(c) 2006 Second Life Reverse Engineering Team")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly: AssemblyVersion("0.0.5.0")]
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project output directory which is
-// %Project Directory%\obj\. For example, if your KeyFile is
-// located in the project directory, you would specify the AssemblyKeyFile
-// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("")]
-[assembly: AssemblyKeyName("")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// 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("libsecondlife")]
+[assembly: AssemblyDescription("Networking layer for the Second Life world")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Second Life Reverse Engineering Team")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("(c) 2006 Second Life Reverse Engineering Team")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("0.0.5.0")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/libsecondlife-cs/AssetSystem/Asset.cs b/libsecondlife-cs/AssetSystem/Asset.cs
index 694f23c0..36ef9862 100644
--- a/libsecondlife-cs/AssetSystem/Asset.cs
+++ b/libsecondlife-cs/AssetSystem/Asset.cs
@@ -1,93 +1,93 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-using libsecondlife;
-
-namespace libsecondlife.AssetSystem
-{
- ///
- /// Summary description for Asset.
- ///
- public class Asset
- {
- public const sbyte ASSET_TYPE_NOTECARD = 7;
- public const sbyte ASSET_TYPE_IMAGE = 0;
-
- public LLUUID AssetID;
-
- public sbyte Type;
- public bool Tempfile;
-
-
- private byte[] assetdata;
- public byte[] AssetData
- {
- get { return assetdata; }
- set
- {
- assetdata = value;
- }
- }
-
-
- ///
- ///
- ///
- ///
- ///
- ///
- public Asset(LLUUID assetID, sbyte type, bool tempfile, byte[] assetData)
- {
- AssetID = assetID;
- Type = (sbyte)type;
- Tempfile = tempfile;
- AssetData = assetData;
- }
-
- ///
- ///
- ///
- ///
- ///
- public Asset(LLUUID assetID, sbyte type, byte[] assetData)
- {
- AssetID = assetID;
- Type = (sbyte)type;
- Tempfile = false;
- AssetData = assetData;
- }
-
- ///
- /// Return this asset's data as a pretty printable string.
- ///
- public string AssetDataToString()
- {
- return Helpers.FieldToString((byte[])AssetData);
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+
+using libsecondlife;
+
+namespace libsecondlife.AssetSystem
+{
+ ///
+ /// Summary description for Asset.
+ ///
+ public class Asset
+ {
+ public const sbyte ASSET_TYPE_NOTECARD = 7;
+ public const sbyte ASSET_TYPE_IMAGE = 0;
+
+ public LLUUID AssetID;
+
+ public sbyte Type;
+ public bool Tempfile;
+
+
+ private byte[] assetdata;
+ public byte[] AssetData
+ {
+ get { return assetdata; }
+ set
+ {
+ assetdata = value;
+ }
+ }
+
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public Asset(LLUUID assetID, sbyte type, bool tempfile, byte[] assetData)
+ {
+ AssetID = assetID;
+ Type = (sbyte)type;
+ Tempfile = tempfile;
+ AssetData = assetData;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public Asset(LLUUID assetID, sbyte type, byte[] assetData)
+ {
+ AssetID = assetID;
+ Type = (sbyte)type;
+ Tempfile = false;
+ AssetData = assetData;
+ }
+
+ ///
+ /// Return this asset's data as a pretty printable string.
+ ///
+ public string AssetDataToString()
+ {
+ return Helpers.FieldToString((byte[])AssetData);
+ }
+ }
+}
diff --git a/libsecondlife-cs/AssetSystem/AssetImage.cs b/libsecondlife-cs/AssetSystem/AssetImage.cs
index 2f39c990..2adbc3a4 100644
--- a/libsecondlife-cs/AssetSystem/AssetImage.cs
+++ b/libsecondlife-cs/AssetSystem/AssetImage.cs
@@ -1,58 +1,58 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-using libsecondlife;
-
-namespace libsecondlife.AssetSystem
-{
- ///
- /// Summary description for AssetNotecard.
- ///
- public class AssetImage : Asset
- {
- public byte[] J2CData
- {
- get
- {
- return base.AssetData;
- }
- }
-
- ///
- ///
- ///
- ///
- public AssetImage(LLUUID assetID, byte[] assetData)
- : base(assetID, Asset.ASSET_TYPE_IMAGE, false, assetData)
- {
- }
-
-
-
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+
+using libsecondlife;
+
+namespace libsecondlife.AssetSystem
+{
+ ///
+ /// Summary description for AssetNotecard.
+ ///
+ public class AssetImage : Asset
+ {
+ public byte[] J2CData
+ {
+ get
+ {
+ return base.AssetData;
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public AssetImage(LLUUID assetID, byte[] assetData)
+ : base(assetID, Asset.ASSET_TYPE_IMAGE, false, assetData)
+ {
+ }
+
+
+
+ }
+}
diff --git a/libsecondlife-cs/AssetSystem/AssetManager.cs b/libsecondlife-cs/AssetSystem/AssetManager.cs
index f2446df9..98db53fd 100644
--- a/libsecondlife-cs/AssetSystem/AssetManager.cs
+++ b/libsecondlife-cs/AssetSystem/AssetManager.cs
@@ -1,338 +1,338 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections;
-
-using libsecondlife;
-
-using libsecondlife.InventorySystem;
-
-using libsecondlife.Packets;
-
-namespace libsecondlife.AssetSystem
-{
- ///
- /// Summary description for AssetManager.
- ///
- public class AssetManager
- {
- private const bool DEBUG_PACKETS = true;
-
-
- public const int SINK_FEE_IMAGE = 1;
-
- private SecondLife slClient;
-
- private TransferRequest curUploadRequest = null;
- private Hashtable htDownloadRequests = new Hashtable();
-
- private class TransferRequest
- {
- public bool Completed;
- public bool Status;
- public string StatusMsg;
-
- public int Size;
- public int Received;
- public uint LastPacketTime;
- public uint LastPacketNumSent;
- public byte[] AssetData;
-
- public LLUUID TransactionID;
- public LLUUID AssetID;
- }
-
- ///
- ///
- ///
- internal AssetManager(SecondLife client)
- {
- slClient = client;
-
- // Used to upload small assets, or as an initial start packet for large transfers
- PacketCallback AssetUploadCompleteCallback = new PacketCallback(AssetUploadCompleteCallbackHandler);
- slClient.Network.RegisterCallback(PacketType.AssetUploadComplete, AssetUploadCompleteCallback);
-
- // Transfer Packets for downloading large assets
- PacketCallback TransferInfoCallback = new PacketCallback(TransferInfoCallbackHandler);
- slClient.Network.RegisterCallback(PacketType.TransferInfo, TransferInfoCallback);
-
- PacketCallback TransferPacketCallback = new PacketCallback(TransferPacketCallbackHandler);
- slClient.Network.RegisterCallback(PacketType.TransferPacket, TransferPacketCallback);
-
- // XFer packets for uploading large assets
- PacketCallback ConfirmXferPacketCallback = new PacketCallback(ConfirmXferPacketCallbackHandler);
- slClient.Network.RegisterCallback(PacketType.ConfirmXferPacket, ConfirmXferPacketCallback);
-
- PacketCallback RequestXferCallback = new PacketCallback(RequestXferCallbackHandler);
- slClient.Network.RegisterCallback(PacketType.RequestXfer, RequestXferCallback);
-
- }
-
-
- ///
- /// Handle the appropriate sink fee assoiacted with an asset upload
- ///
- ///
- public void SinkFee(int sinkType)
- {
- switch( sinkType )
- {
- case SINK_FEE_IMAGE:
- slClient.Avatar.GiveMoney( new LLUUID(), 10, "Image Upload" );
- break;
- default:
- throw new Exception("AssetManager: Unknown sinktype (" + sinkType + ")");
- }
- }
-
- ///
- /// Upload an asset to Second Life
- ///
- /// The asset to be uploaded
- /// The Asset ID of the completed upload
- public LLUUID UploadAsset(Asset asset)
- {
- if (curUploadRequest != null)
- {
- throw new Exception("An existing asset upload is currently in-progress.");
- }
-
- Packet packet;
- curUploadRequest = new TransferRequest();
- curUploadRequest.Completed = false;
- curUploadRequest.TransactionID = LLUUID.GenerateUUID();
-
- if( asset.AssetData.Length > 500 )
- {
- packet = AssetPacketHelpers.AssetUploadRequestHeaderOnly(asset, curUploadRequest.TransactionID);
- slClient.Network.SendPacket(packet);
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
- curUploadRequest.AssetData = asset.AssetData;
- }
- else
- {
- packet = AssetPacketHelpers.AssetUploadRequest(asset, curUploadRequest.TransactionID);
- slClient.Network.SendPacket(packet);
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
- }
-
- while( curUploadRequest.Completed == false )
- {
- slClient.Tick();
- }
-
- if (curUploadRequest.Status == false)
- {
- throw new Exception(curUploadRequest.StatusMsg);
- } else {
- if( asset.Type == Asset.ASSET_TYPE_IMAGE )
- {
- SinkFee( SINK_FEE_IMAGE );
- }
-
- asset.AssetID = curUploadRequest.AssetID;
-
- return asset.AssetID;
- }
- }
-
- ///
- /// Get the Asset data for an item
- ///
- ///
- public void GetInventoryAsset( InventoryItem item )
- {
- LLUUID TransferID = LLUUID.GenerateUUID();
-
- TransferRequest tr = new TransferRequest();
- tr.Completed = false;
- tr.Size = int.MaxValue; // Number of bytes expected
- tr.Received = 0; // Number of bytes received
- tr.LastPacketTime = Helpers.GetUnixTime(); // last time we recevied a packet for this request
-
- htDownloadRequests[TransferID] = tr;
-
- Packet packet = AssetPacketHelpers.TransferRequest(slClient.Network.SessionID, slClient.Network.AgentID, TransferID, item );
- slClient.Network.SendPacket(packet);
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
-
- while( tr.Completed == false )
- {
- slClient.Tick();
- }
-
- item.SetAssetData( tr.AssetData );
- }
-
- private void AssetUploadCompleteCallbackHandler(Packet packet, Simulator simulator)
- {
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
- Packets.AssetUploadCompletePacket reply = (AssetUploadCompletePacket)packet;
-
- curUploadRequest.AssetID = reply.AssetBlock.UUID;
- bool Success = reply.AssetBlock.Success;
-
- if( Success )
- {
- curUploadRequest.Completed = true;
- curUploadRequest.Status = true;
- curUploadRequest.StatusMsg = "Success";
- }
- else
- {
- curUploadRequest.Completed = true;
- curUploadRequest.Status = false;
- curUploadRequest.StatusMsg = "Server returned failed";
- }
- }
-
- private void RequestXferCallbackHandler(Packet packet, Simulator simulator)
- {
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
- RequestXferPacket reply = (RequestXferPacket)packet;
-
- ulong XferID = reply.XferID.ID;
- LLUUID AssetID = reply.XferID.VFileID;
-
- // Setup to send the first packet
- curUploadRequest.LastPacketNumSent = 0;
-
- byte[] packetData = new byte[1004];
-
- // Prefix the first Xfer packet with the data length
- // FIXME: Apply endianness patch
- Array.Copy(BitConverter.GetBytes((int)curUploadRequest.AssetData.Length), 0, packetData, 0, 4);
- Array.Copy(curUploadRequest.AssetData, 0, packetData, 4, 1000);
-
- packet = AssetPacketHelpers.SendXferPacket(XferID, packetData, 0);
- slClient.Network.SendPacket(packet);
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
- }
-
- private void ConfirmXferPacketCallbackHandler(Packet packet, Simulator simulator)
- {
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
- ConfirmXferPacketPacket reply = (ConfirmXferPacketPacket)packet;
-
- ulong XferID = reply.XferID.ID;
- uint PacketNumConfirmed = reply.XferID.Packet;
-
- if (PacketNumConfirmed == curUploadRequest.LastPacketNumSent)
- {
- curUploadRequest.LastPacketNumSent += 1;
-
- uint i = curUploadRequest.LastPacketNumSent;
- int numPackets = curUploadRequest.AssetData.Length / 1000;
-
- if (i < numPackets)
- {
- byte[] packetData = new byte[1000];
- Array.Copy(curUploadRequest.AssetData, i * 1000, packetData, 0, 1000);
-
- packet = AssetPacketHelpers.SendXferPacket(XferID, packetData, i);
- slClient.Network.SendPacket(packet);
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
- }
- else
- {
- // The last packet has to be handled slightly differently
- int lastLen = curUploadRequest.AssetData.Length - (numPackets * 1000);
- byte[] packetData = new byte[lastLen];
- Array.Copy(curUploadRequest.AssetData, numPackets * 1000, packetData, 0, lastLen);
-
- uint lastPacket = (uint)int.MaxValue + (uint)numPackets + (uint)1;
- packet = AssetPacketHelpers.SendXferPacket(XferID, packetData, lastPacket);
- slClient.Network.SendPacket(packet);
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
- }
- } else {
- throw new Exception("Something is wrong with uploading assets, a confirmation came in for a packet we didn't send.");
- }
- }
-
- private void TransferInfoCallbackHandler(Packet packet, Simulator simulator)
- {
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
- TransferInfoPacket reply = (TransferInfoPacket)packet;
-
- LLUUID TransferID = reply.TransferInfo.TransferID;
- int Size = reply.TransferInfo.Size;
- int Status = reply.TransferInfo.Status;
-
- // Lookup the request for this packet
- TransferRequest tr = (TransferRequest)htDownloadRequests[TransferID];
- if (tr == null)
- {
- return;
- }
-
- // Mark it as either not found or update the request information
- if (Status == -2)
- {
- tr.Completed = true;
- tr.Status = false;
- tr.StatusMsg = "Asset Status -2 :: Likely Status Not Found";
-
- tr.Size = 1;
- tr.AssetData = new byte[1];
-
- }
- else
- {
- tr.Size = Size;
- tr.AssetData = new byte[Size];
- }
- }
-
- private void TransferPacketCallbackHandler(Packet packet, Simulator simulator)
- {
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
- TransferPacketPacket reply = (TransferPacketPacket)packet;
-
- LLUUID TransferID = reply.TransferData.TransferID;
- byte[] Data = reply.TransferData.Data;
-
-
- // Append data to data received.
- TransferRequest tr = (TransferRequest)htDownloadRequests[TransferID];
- if (tr == null)
- {
- return;
- }
-
- Array.Copy(Data, 0, tr.AssetData, tr.Received, Data.Length);
- tr.Received += Data.Length;
-
- // If we've gotten all the data, mark it completed.
- if (tr.Received >= tr.Size)
- {
- tr.Completed = true;
- }
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections;
+
+using libsecondlife;
+
+using libsecondlife.InventorySystem;
+
+using libsecondlife.Packets;
+
+namespace libsecondlife.AssetSystem
+{
+ ///
+ /// Summary description for AssetManager.
+ ///
+ public class AssetManager
+ {
+ private const bool DEBUG_PACKETS = true;
+
+
+ public const int SINK_FEE_IMAGE = 1;
+
+ private SecondLife slClient;
+
+ private TransferRequest curUploadRequest = null;
+ private Hashtable htDownloadRequests = new Hashtable();
+
+ private class TransferRequest
+ {
+ public bool Completed;
+ public bool Status;
+ public string StatusMsg;
+
+ public int Size;
+ public int Received;
+ public uint LastPacketTime;
+ public uint LastPacketNumSent;
+ public byte[] AssetData;
+
+ public LLUUID TransactionID;
+ public LLUUID AssetID;
+ }
+
+ ///
+ ///
+ ///
+ internal AssetManager(SecondLife client)
+ {
+ slClient = client;
+
+ // Used to upload small assets, or as an initial start packet for large transfers
+ PacketCallback AssetUploadCompleteCallback = new PacketCallback(AssetUploadCompleteCallbackHandler);
+ slClient.Network.RegisterCallback(PacketType.AssetUploadComplete, AssetUploadCompleteCallback);
+
+ // Transfer Packets for downloading large assets
+ PacketCallback TransferInfoCallback = new PacketCallback(TransferInfoCallbackHandler);
+ slClient.Network.RegisterCallback(PacketType.TransferInfo, TransferInfoCallback);
+
+ PacketCallback TransferPacketCallback = new PacketCallback(TransferPacketCallbackHandler);
+ slClient.Network.RegisterCallback(PacketType.TransferPacket, TransferPacketCallback);
+
+ // XFer packets for uploading large assets
+ PacketCallback ConfirmXferPacketCallback = new PacketCallback(ConfirmXferPacketCallbackHandler);
+ slClient.Network.RegisterCallback(PacketType.ConfirmXferPacket, ConfirmXferPacketCallback);
+
+ PacketCallback RequestXferCallback = new PacketCallback(RequestXferCallbackHandler);
+ slClient.Network.RegisterCallback(PacketType.RequestXfer, RequestXferCallback);
+
+ }
+
+
+ ///
+ /// Handle the appropriate sink fee assoiacted with an asset upload
+ ///
+ ///
+ public void SinkFee(int sinkType)
+ {
+ switch( sinkType )
+ {
+ case SINK_FEE_IMAGE:
+ slClient.Avatar.GiveMoney( new LLUUID(), 10, "Image Upload" );
+ break;
+ default:
+ throw new Exception("AssetManager: Unknown sinktype (" + sinkType + ")");
+ }
+ }
+
+ ///
+ /// Upload an asset to Second Life
+ ///
+ /// The asset to be uploaded
+ /// The Asset ID of the completed upload
+ public LLUUID UploadAsset(Asset asset)
+ {
+ if (curUploadRequest != null)
+ {
+ throw new Exception("An existing asset upload is currently in-progress.");
+ }
+
+ Packet packet;
+ curUploadRequest = new TransferRequest();
+ curUploadRequest.Completed = false;
+ curUploadRequest.TransactionID = LLUUID.GenerateUUID();
+
+ if( asset.AssetData.Length > 500 )
+ {
+ packet = AssetPacketHelpers.AssetUploadRequestHeaderOnly(asset, curUploadRequest.TransactionID);
+ slClient.Network.SendPacket(packet);
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+ curUploadRequest.AssetData = asset.AssetData;
+ }
+ else
+ {
+ packet = AssetPacketHelpers.AssetUploadRequest(asset, curUploadRequest.TransactionID);
+ slClient.Network.SendPacket(packet);
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+ }
+
+ while( curUploadRequest.Completed == false )
+ {
+ slClient.Tick();
+ }
+
+ if (curUploadRequest.Status == false)
+ {
+ throw new Exception(curUploadRequest.StatusMsg);
+ } else {
+ if( asset.Type == Asset.ASSET_TYPE_IMAGE )
+ {
+ SinkFee( SINK_FEE_IMAGE );
+ }
+
+ asset.AssetID = curUploadRequest.AssetID;
+
+ return asset.AssetID;
+ }
+ }
+
+ ///
+ /// Get the Asset data for an item
+ ///
+ ///
+ public void GetInventoryAsset( InventoryItem item )
+ {
+ LLUUID TransferID = LLUUID.GenerateUUID();
+
+ TransferRequest tr = new TransferRequest();
+ tr.Completed = false;
+ tr.Size = int.MaxValue; // Number of bytes expected
+ tr.Received = 0; // Number of bytes received
+ tr.LastPacketTime = Helpers.GetUnixTime(); // last time we recevied a packet for this request
+
+ htDownloadRequests[TransferID] = tr;
+
+ Packet packet = AssetPacketHelpers.TransferRequest(slClient.Network.SessionID, slClient.Network.AgentID, TransferID, item );
+ slClient.Network.SendPacket(packet);
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+
+ while( tr.Completed == false )
+ {
+ slClient.Tick();
+ }
+
+ item.SetAssetData( tr.AssetData );
+ }
+
+ private void AssetUploadCompleteCallbackHandler(Packet packet, Simulator simulator)
+ {
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+ Packets.AssetUploadCompletePacket reply = (AssetUploadCompletePacket)packet;
+
+ curUploadRequest.AssetID = reply.AssetBlock.UUID;
+ bool Success = reply.AssetBlock.Success;
+
+ if( Success )
+ {
+ curUploadRequest.Completed = true;
+ curUploadRequest.Status = true;
+ curUploadRequest.StatusMsg = "Success";
+ }
+ else
+ {
+ curUploadRequest.Completed = true;
+ curUploadRequest.Status = false;
+ curUploadRequest.StatusMsg = "Server returned failed";
+ }
+ }
+
+ private void RequestXferCallbackHandler(Packet packet, Simulator simulator)
+ {
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+ RequestXferPacket reply = (RequestXferPacket)packet;
+
+ ulong XferID = reply.XferID.ID;
+ LLUUID AssetID = reply.XferID.VFileID;
+
+ // Setup to send the first packet
+ curUploadRequest.LastPacketNumSent = 0;
+
+ byte[] packetData = new byte[1004];
+
+ // Prefix the first Xfer packet with the data length
+ // FIXME: Apply endianness patch
+ Array.Copy(BitConverter.GetBytes((int)curUploadRequest.AssetData.Length), 0, packetData, 0, 4);
+ Array.Copy(curUploadRequest.AssetData, 0, packetData, 4, 1000);
+
+ packet = AssetPacketHelpers.SendXferPacket(XferID, packetData, 0);
+ slClient.Network.SendPacket(packet);
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+ }
+
+ private void ConfirmXferPacketCallbackHandler(Packet packet, Simulator simulator)
+ {
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+ ConfirmXferPacketPacket reply = (ConfirmXferPacketPacket)packet;
+
+ ulong XferID = reply.XferID.ID;
+ uint PacketNumConfirmed = reply.XferID.Packet;
+
+ if (PacketNumConfirmed == curUploadRequest.LastPacketNumSent)
+ {
+ curUploadRequest.LastPacketNumSent += 1;
+
+ uint i = curUploadRequest.LastPacketNumSent;
+ int numPackets = curUploadRequest.AssetData.Length / 1000;
+
+ if (i < numPackets)
+ {
+ byte[] packetData = new byte[1000];
+ Array.Copy(curUploadRequest.AssetData, i * 1000, packetData, 0, 1000);
+
+ packet = AssetPacketHelpers.SendXferPacket(XferID, packetData, i);
+ slClient.Network.SendPacket(packet);
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+ }
+ else
+ {
+ // The last packet has to be handled slightly differently
+ int lastLen = curUploadRequest.AssetData.Length - (numPackets * 1000);
+ byte[] packetData = new byte[lastLen];
+ Array.Copy(curUploadRequest.AssetData, numPackets * 1000, packetData, 0, lastLen);
+
+ uint lastPacket = (uint)int.MaxValue + (uint)numPackets + (uint)1;
+ packet = AssetPacketHelpers.SendXferPacket(XferID, packetData, lastPacket);
+ slClient.Network.SendPacket(packet);
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+ }
+ } else {
+ throw new Exception("Something is wrong with uploading assets, a confirmation came in for a packet we didn't send.");
+ }
+ }
+
+ private void TransferInfoCallbackHandler(Packet packet, Simulator simulator)
+ {
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+ TransferInfoPacket reply = (TransferInfoPacket)packet;
+
+ LLUUID TransferID = reply.TransferInfo.TransferID;
+ int Size = reply.TransferInfo.Size;
+ int Status = reply.TransferInfo.Status;
+
+ // Lookup the request for this packet
+ TransferRequest tr = (TransferRequest)htDownloadRequests[TransferID];
+ if (tr == null)
+ {
+ return;
+ }
+
+ // Mark it as either not found or update the request information
+ if (Status == -2)
+ {
+ tr.Completed = true;
+ tr.Status = false;
+ tr.StatusMsg = "Asset Status -2 :: Likely Status Not Found";
+
+ tr.Size = 1;
+ tr.AssetData = new byte[1];
+
+ }
+ else
+ {
+ tr.Size = Size;
+ tr.AssetData = new byte[Size];
+ }
+ }
+
+ private void TransferPacketCallbackHandler(Packet packet, Simulator simulator)
+ {
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+ TransferPacketPacket reply = (TransferPacketPacket)packet;
+
+ LLUUID TransferID = reply.TransferData.TransferID;
+ byte[] Data = reply.TransferData.Data;
+
+
+ // Append data to data received.
+ TransferRequest tr = (TransferRequest)htDownloadRequests[TransferID];
+ if (tr == null)
+ {
+ return;
+ }
+
+ Array.Copy(Data, 0, tr.AssetData, tr.Received, Data.Length);
+ tr.Received += Data.Length;
+
+ // If we've gotten all the data, mark it completed.
+ if (tr.Received >= tr.Size)
+ {
+ tr.Completed = true;
+ }
+ }
+ }
+}
diff --git a/libsecondlife-cs/AssetSystem/AssetNotecard.cs b/libsecondlife-cs/AssetSystem/AssetNotecard.cs
index bf4ca286..bd1a2a5b 100644
--- a/libsecondlife-cs/AssetSystem/AssetNotecard.cs
+++ b/libsecondlife-cs/AssetSystem/AssetNotecard.cs
@@ -1,114 +1,114 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-
-using libsecondlife;
-
-namespace libsecondlife.AssetSystem
-{
- ///
- /// Summary description for AssetNotecard.
- ///
- public class AssetNotecard : Asset
- {
- private string _Body = "";
- public string Body
- {
- get { return _Body; }
- set
- {
- _Body = value.Replace("\r", "");
- setAsset( _Body );
- }
- }
-
- ///
- ///
- ///
- ///
- public AssetNotecard(LLUUID assetID, string body)
- : base(assetID, Asset.ASSET_TYPE_NOTECARD, false, null)
- {
- _Body = body;
- setAsset( body );
- }
-
- ///
- ///
- ///
- ///
- public AssetNotecard(LLUUID assetID, byte[] assetData)
- : base(assetID, Asset.ASSET_TYPE_NOTECARD, false, null)
- {
- base.AssetData = assetData;
-
- string temp = System.Text.Encoding.UTF8.GetString(assetData).Trim();
-
- // TODO: Calculate the correct header size to look for
- // it's usually around 80 or so...
- if( temp.Length > 50 )
- {
- // Trim trailing null terminator
- temp = temp.Substring(0,temp.Length-1);
-
- // Remove the header
- temp = temp.Substring(temp.IndexOf("}") + 2);
- temp = temp.Substring(temp.IndexOf('\n') + 1);
-
- // Remove trailing close brace
- temp = temp.Substring(0,temp.Length-2);
- }
- _Body = temp;
- }
-
- ///
- ///
- ///
- private void setAsset(string body)
- {
- // Format the string body into Linden text
- string lindenText = "Linden text version 1\n";
- lindenText += "{\n";
- lindenText += "LLEmbeddedItems version 1\n";
- lindenText += "{\n";
- lindenText += "count 0\n";
- lindenText += "}\n";
- lindenText += "Text length " + body.Length + "\n";
- lindenText += body;
- lindenText += "}\n";
-
-
-
- // Assume this is a string, add 1 for the null terminator
- byte[] stringBytes = System.Text.Encoding.UTF8.GetBytes((string)lindenText);
- byte[] assetData = new byte[stringBytes.Length + 1];
- Array.Copy(stringBytes, 0, assetData, 0, stringBytes.Length);
-
- base.AssetData = assetData;
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+
+using libsecondlife;
+
+namespace libsecondlife.AssetSystem
+{
+ ///
+ /// Summary description for AssetNotecard.
+ ///
+ public class AssetNotecard : Asset
+ {
+ private string _Body = "";
+ public string Body
+ {
+ get { return _Body; }
+ set
+ {
+ _Body = value.Replace("\r", "");
+ setAsset( _Body );
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public AssetNotecard(LLUUID assetID, string body)
+ : base(assetID, Asset.ASSET_TYPE_NOTECARD, false, null)
+ {
+ _Body = body;
+ setAsset( body );
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public AssetNotecard(LLUUID assetID, byte[] assetData)
+ : base(assetID, Asset.ASSET_TYPE_NOTECARD, false, null)
+ {
+ base.AssetData = assetData;
+
+ string temp = System.Text.Encoding.UTF8.GetString(assetData).Trim();
+
+ // TODO: Calculate the correct header size to look for
+ // it's usually around 80 or so...
+ if( temp.Length > 50 )
+ {
+ // Trim trailing null terminator
+ temp = temp.Substring(0,temp.Length-1);
+
+ // Remove the header
+ temp = temp.Substring(temp.IndexOf("}") + 2);
+ temp = temp.Substring(temp.IndexOf('\n') + 1);
+
+ // Remove trailing close brace
+ temp = temp.Substring(0,temp.Length-2);
+ }
+ _Body = temp;
+ }
+
+ ///
+ ///
+ ///
+ private void setAsset(string body)
+ {
+ // Format the string body into Linden text
+ string lindenText = "Linden text version 1\n";
+ lindenText += "{\n";
+ lindenText += "LLEmbeddedItems version 1\n";
+ lindenText += "{\n";
+ lindenText += "count 0\n";
+ lindenText += "}\n";
+ lindenText += "Text length " + body.Length + "\n";
+ lindenText += body;
+ lindenText += "}\n";
+
+
+
+ // Assume this is a string, add 1 for the null terminator
+ byte[] stringBytes = System.Text.Encoding.UTF8.GetBytes((string)lindenText);
+ byte[] assetData = new byte[stringBytes.Length + 1];
+ Array.Copy(stringBytes, 0, assetData, 0, stringBytes.Length);
+
+ base.AssetData = assetData;
+ }
+ }
+}
diff --git a/libsecondlife-cs/AssetSystem/AssetPacketHelpers.cs b/libsecondlife-cs/AssetSystem/AssetPacketHelpers.cs
index 5d4fc2dc..d9337bb3 100644
--- a/libsecondlife-cs/AssetSystem/AssetPacketHelpers.cs
+++ b/libsecondlife-cs/AssetSystem/AssetPacketHelpers.cs
@@ -1,149 +1,149 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections;
-
-using libsecondlife;
-using libsecondlife.InventorySystem;
-using libsecondlife.Packets;
-
-namespace libsecondlife.AssetSystem
-{
- ///
- ///
- public class AssetPacketHelpers
- {
- ///
- /// Upload a small asset where the entire asset will fit in a single packet (less then 500 bytes)
- ///
- ///
- public static Packet AssetUploadRequest(Asset asset, LLUUID TransactionID)
- {
- if (asset.AssetData.Length > 500)
- {
- throw new Exception("Asset too large to use AssetUploadRequest, use AssetUploadRequestHaderOnly() instead.");
- }
-
- AssetUploadRequestPacket p = new AssetUploadRequestPacket();
- p.AssetBlock.TransactionID = TransactionID;
- p.AssetBlock.Type = asset.Type;
- p.AssetBlock.Tempfile = asset.Tempfile;
- p.AssetBlock.AssetData = asset.AssetData;
- p.AssetBlock.StoreLocal = false;
-
- return p;
- }
-
- ///
- /// Send header to SL to let it know that a large asset upload is about to proceed.
- ///
- ///
- public static Packet AssetUploadRequestHeaderOnly(Asset asset, LLUUID TransactionID)
- {
- AssetUploadRequestPacket p = new AssetUploadRequestPacket();
- p.AssetBlock.TransactionID = TransactionID;
- p.AssetBlock.Type = asset.Type;
- p.AssetBlock.Tempfile = asset.Tempfile;
- p.AssetBlock.AssetData = new byte[0];
- p.AssetBlock.StoreLocal = false;
-
- return p;
- }
-
-
- ///
- /// Sends a packet of data to SL
- ///
- ///
- /// First xferpacket data must include a prefixed S32 for the length of the asset.
- ///
- public static Packet SendXferPacket(ulong id, byte[] data, uint packetNum)
- {
- SendXferPacketPacket p = new SendXferPacketPacket();
- p.DataPacket.Data = data;
-
- p.XferID.ID = id;
- p.XferID.Packet = (uint)packetNum;
-
- return p;
-
- }
-
- ///
- /// Request the download of an asset
- /// The params field consists of a number of individual data components:
- /// Params: 1: OwnerID / *AgentID
- /// Params: 2: SessionID
- /// Params: 3: *OwnerID / AgentID
- /// Params: 4: Unknown (Maybe Group ID)
- /// Params: 5: ItemID
- /// Params: 6: AssetID
- /// Params: 7: Type
- /// Params: 8: Last Three Bytes Unknown
- ///
- ///
- ///
- ///
- ///
- public static Packet TransferRequest(LLUUID SessionID, LLUUID AgentID, LLUUID TransferID, InventoryItem item)
- {
- byte[] param = new byte[100];
- int pos = 0;
-
- Array.Copy(AgentID.Data, 0, param, pos, 16);
- pos += 16;
-
- Array.Copy(SessionID.Data, 0, param, pos, 16);
- pos += 16;
-
- Array.Copy(item.OwnerID.Data, 0, param, pos, 16);
- pos += 16;
-
- Array.Copy(item.GroupID.Data, 0, param, pos, 16);
- pos += 16;
-
- Array.Copy(item.ItemID.Data, 0, param, pos, 16);
- pos += 16;
-
- Array.Copy(item.AssetID.Data, 0, param, pos, 16);
- pos += 16;
-
- param[pos] = (byte)item.Type;
- pos += 1;
-
-
- TransferRequestPacket p = new TransferRequestPacket();
- p.TransferInfo.TransferID = TransferID;
- p.TransferInfo.Params = param;
- p.TransferInfo.ChannelType = 2;
- p.TransferInfo.SourceType = 3;
- p.TransferInfo.Priority = (float)101.0;
- return p;
- }
-
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections;
+
+using libsecondlife;
+using libsecondlife.InventorySystem;
+using libsecondlife.Packets;
+
+namespace libsecondlife.AssetSystem
+{
+ ///
+ ///
+ public class AssetPacketHelpers
+ {
+ ///
+ /// Upload a small asset where the entire asset will fit in a single packet (less then 500 bytes)
+ ///
+ ///
+ public static Packet AssetUploadRequest(Asset asset, LLUUID TransactionID)
+ {
+ if (asset.AssetData.Length > 500)
+ {
+ throw new Exception("Asset too large to use AssetUploadRequest, use AssetUploadRequestHaderOnly() instead.");
+ }
+
+ AssetUploadRequestPacket p = new AssetUploadRequestPacket();
+ p.AssetBlock.TransactionID = TransactionID;
+ p.AssetBlock.Type = asset.Type;
+ p.AssetBlock.Tempfile = asset.Tempfile;
+ p.AssetBlock.AssetData = asset.AssetData;
+ p.AssetBlock.StoreLocal = false;
+
+ return p;
+ }
+
+ ///
+ /// Send header to SL to let it know that a large asset upload is about to proceed.
+ ///
+ ///
+ public static Packet AssetUploadRequestHeaderOnly(Asset asset, LLUUID TransactionID)
+ {
+ AssetUploadRequestPacket p = new AssetUploadRequestPacket();
+ p.AssetBlock.TransactionID = TransactionID;
+ p.AssetBlock.Type = asset.Type;
+ p.AssetBlock.Tempfile = asset.Tempfile;
+ p.AssetBlock.AssetData = new byte[0];
+ p.AssetBlock.StoreLocal = false;
+
+ return p;
+ }
+
+
+ ///
+ /// Sends a packet of data to SL
+ ///
+ ///
+ /// First xferpacket data must include a prefixed S32 for the length of the asset.
+ ///
+ public static Packet SendXferPacket(ulong id, byte[] data, uint packetNum)
+ {
+ SendXferPacketPacket p = new SendXferPacketPacket();
+ p.DataPacket.Data = data;
+
+ p.XferID.ID = id;
+ p.XferID.Packet = (uint)packetNum;
+
+ return p;
+
+ }
+
+ ///
+ /// Request the download of an asset
+ /// The params field consists of a number of individual data components:
+ /// Params: 1: OwnerID / *AgentID
+ /// Params: 2: SessionID
+ /// Params: 3: *OwnerID / AgentID
+ /// Params: 4: Unknown (Maybe Group ID)
+ /// Params: 5: ItemID
+ /// Params: 6: AssetID
+ /// Params: 7: Type
+ /// Params: 8: Last Three Bytes Unknown
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static Packet TransferRequest(LLUUID SessionID, LLUUID AgentID, LLUUID TransferID, InventoryItem item)
+ {
+ byte[] param = new byte[100];
+ int pos = 0;
+
+ Array.Copy(AgentID.Data, 0, param, pos, 16);
+ pos += 16;
+
+ Array.Copy(SessionID.Data, 0, param, pos, 16);
+ pos += 16;
+
+ Array.Copy(item.OwnerID.Data, 0, param, pos, 16);
+ pos += 16;
+
+ Array.Copy(item.GroupID.Data, 0, param, pos, 16);
+ pos += 16;
+
+ Array.Copy(item.ItemID.Data, 0, param, pos, 16);
+ pos += 16;
+
+ Array.Copy(item.AssetID.Data, 0, param, pos, 16);
+ pos += 16;
+
+ param[pos] = (byte)item.Type;
+ pos += 1;
+
+
+ TransferRequestPacket p = new TransferRequestPacket();
+ p.TransferInfo.TransferID = TransferID;
+ p.TransferInfo.Params = param;
+ p.TransferInfo.ChannelType = 2;
+ p.TransferInfo.SourceType = 3;
+ p.TransferInfo.Priority = (float)101.0;
+ return p;
+ }
+
+ }
+}
diff --git a/libsecondlife-cs/AssetSystem/ImageManager.cs b/libsecondlife-cs/AssetSystem/ImageManager.cs
index d42edacb..92eb318e 100644
--- a/libsecondlife-cs/AssetSystem/ImageManager.cs
+++ b/libsecondlife-cs/AssetSystem/ImageManager.cs
@@ -1,214 +1,214 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections;
-
-using libsecondlife;
-using libsecondlife.Packets;
-
-using libsecondlife.InventorySystem;
-
-namespace libsecondlife.AssetSystem
-{
- ///
- /// Manages the uploading and downloading of Images from SecondLife
- ///
- public class ImageManager
- {
- private SecondLife slClient;
-
- private ImagePacketHelpers ImagePacketHelper;
-
- private Hashtable htDownloadRequests = new Hashtable();
-
- private class TransferRequest
- {
- public bool Completed;
- public bool Status;
- public string StatusMsg;
-
- public uint Size;
- public uint Received;
- public uint LastPacket;
- public byte[] AssetData;
-
- public int BaseDataReceived;
-
- public TransferRequest()
- {
- Completed = false;
-
- Status = false;
- StatusMsg = "";
-
- AssetData = null;
- BaseDataReceived = 0;
- }
- }
-
- ///
- ///
- ///
- public ImageManager(SecondLife client)
- {
- slClient = client;
-
- ImagePacketHelper = new ImagePacketHelpers(client.Network.AgentID, client.Network.SessionID);
-
- PacketCallback ImageDataCallback = new PacketCallback(ImageDataCallbackHandler);
- slClient.Network.RegisterCallback(PacketType.ImageData, ImageDataCallback);
-
- PacketCallback ImagePacketCallback = new PacketCallback(ImagePacketCallbackHandler);
- slClient.Network.RegisterCallback(PacketType.ImagePacket, ImagePacketCallback);
-
- PacketCallback ImageNotInDatabaseCallback = new PacketCallback(ImageNotInDatabaseCallbackHandler);
- slClient.Network.RegisterCallback(PacketType.ImageNotInDatabase, ImageNotInDatabaseCallback);
- }
-
- ///
- /// Requests an image from SecondLife and blocks until it's received.
- ///
- /// The Image's AssetID
- public byte[] RequestImage(LLUUID ImageID)
- {
- TransferRequest tr = new TransferRequest();
- tr.Completed = false;
- tr.Size = int.MaxValue; // Number of bytes expected
- tr.Received = 0; // Number of bytes received
- tr.LastPacket = Helpers.GetUnixTime(); // last time we recevied a packet for this request
-
- htDownloadRequests[ImageID] = tr;
-
- Packet packet = ImagePacketHelper.RequestImage(ImageID);
- slClient.Network.SendPacket(packet);
- Console.WriteLine(packet);
-
- while( tr.Completed == false )
- {
- slClient.Tick();
- }
-
- if( tr.Status == true )
- {
- return tr.AssetData;
- }
- else
- {
- throw new Exception( "RequestImage: " + tr.StatusMsg );
- }
-
- }
-
-
- ///
- /// Handles the Image Data packet, which includes the ID, and Size of the image,
- /// along with the first block of data for the image. If the image is small enough
- /// there will be no additional packets.
- ///
- ///
- ///
- public void ImageDataCallbackHandler(Packet packet, Simulator simulator)
- {
- Console.WriteLine(packet);
- ImageDataPacket reply = (ImageDataPacket)packet;
-
- LLUUID ImageID = reply.ImageID.ID;
- ushort Packets = reply.ImageID.Packets;
- uint Size = reply.ImageID.Size;
- byte[] Data = reply.ImageData.Data;
-
- // Lookup the request that this packet is for
- TransferRequest tr = (TransferRequest)htDownloadRequests[ImageID];
- if( tr == null )
- {
- // Received a packet for an image we didn't request...
- return;
- }
-
- // Initialize the request so that it's data buffer is the right size for the image
- tr.Size = Size;
- tr.AssetData = new byte[tr.Size];
- tr.BaseDataReceived = Data.Length;
-
- // Copy the first block of image data into the request.
- Array.Copy(Data, 0, tr.AssetData, tr.Received, Data.Length);
- tr.Received += (uint)Data.Length;
-
- // If we've gotten all the data, mark it completed.
- if( tr.Received >= tr.Size )
- {
- tr.Completed = true;
- tr.Status = true;
- }
- }
-
- ///
- /// Handles the remaining Image data that did not fit in the initial ImageData packet
- ///
- ///
- ///
- public void ImagePacketCallbackHandler(Packet packet, Simulator simulator)
- {
- Console.WriteLine(packet);
- ImagePacketPacket reply = (ImagePacketPacket)packet;
-
-
- // Lookup the request for this packet
- TransferRequest tr = (TransferRequest)htDownloadRequests[reply.ImageID.ID];
- if( tr == null )
- {
- // Received a packet that doesn't belong to any requests in our queue, strange...
- return;
- }
-
-
- // TODO: Received data should probably be put into a temporary collection that's indected by ImageID.Packet
- // then once we've received all data packets, it should be re-assembled into a complete array and marked
- // completed.
-
-
- // Add this packet's data to the request.
- Array.Copy(reply.ImageData.Data, 0, tr.AssetData, tr.BaseDataReceived + (1000 * (reply.ImageID.Packet - 1)), reply.ImageData.Data.Length);
- tr.Received += (uint)reply.ImageData.Data.Length;
-
- // If we've gotten all the data, mark it completed.
- if( tr.Received >= tr.Size )
- {
- tr.Completed = true;
- tr.Status = true;
- }
- }
-
- ///
- ///
- ///
- public void ImageNotInDatabaseCallbackHandler(Packet packet, Simulator simulator)
- {
- Console.WriteLine(packet);
- }
- }
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections;
+
+using libsecondlife;
+using libsecondlife.Packets;
+
+using libsecondlife.InventorySystem;
+
+namespace libsecondlife.AssetSystem
+{
+ ///
+ /// Manages the uploading and downloading of Images from SecondLife
+ ///
+ public class ImageManager
+ {
+ private SecondLife slClient;
+
+ private ImagePacketHelpers ImagePacketHelper;
+
+ private Hashtable htDownloadRequests = new Hashtable();
+
+ private class TransferRequest
+ {
+ public bool Completed;
+ public bool Status;
+ public string StatusMsg;
+
+ public uint Size;
+ public uint Received;
+ public uint LastPacket;
+ public byte[] AssetData;
+
+ public int BaseDataReceived;
+
+ public TransferRequest()
+ {
+ Completed = false;
+
+ Status = false;
+ StatusMsg = "";
+
+ AssetData = null;
+ BaseDataReceived = 0;
+ }
+ }
+
+ ///
+ ///
+ ///
+ public ImageManager(SecondLife client)
+ {
+ slClient = client;
+
+ ImagePacketHelper = new ImagePacketHelpers(client.Network.AgentID, client.Network.SessionID);
+
+ PacketCallback ImageDataCallback = new PacketCallback(ImageDataCallbackHandler);
+ slClient.Network.RegisterCallback(PacketType.ImageData, ImageDataCallback);
+
+ PacketCallback ImagePacketCallback = new PacketCallback(ImagePacketCallbackHandler);
+ slClient.Network.RegisterCallback(PacketType.ImagePacket, ImagePacketCallback);
+
+ PacketCallback ImageNotInDatabaseCallback = new PacketCallback(ImageNotInDatabaseCallbackHandler);
+ slClient.Network.RegisterCallback(PacketType.ImageNotInDatabase, ImageNotInDatabaseCallback);
+ }
+
+ ///
+ /// Requests an image from SecondLife and blocks until it's received.
+ ///
+ /// The Image's AssetID
+ public byte[] RequestImage(LLUUID ImageID)
+ {
+ TransferRequest tr = new TransferRequest();
+ tr.Completed = false;
+ tr.Size = int.MaxValue; // Number of bytes expected
+ tr.Received = 0; // Number of bytes received
+ tr.LastPacket = Helpers.GetUnixTime(); // last time we recevied a packet for this request
+
+ htDownloadRequests[ImageID] = tr;
+
+ Packet packet = ImagePacketHelper.RequestImage(ImageID);
+ slClient.Network.SendPacket(packet);
+ Console.WriteLine(packet);
+
+ while( tr.Completed == false )
+ {
+ slClient.Tick();
+ }
+
+ if( tr.Status == true )
+ {
+ return tr.AssetData;
+ }
+ else
+ {
+ throw new Exception( "RequestImage: " + tr.StatusMsg );
+ }
+
+ }
+
+
+ ///
+ /// Handles the Image Data packet, which includes the ID, and Size of the image,
+ /// along with the first block of data for the image. If the image is small enough
+ /// there will be no additional packets.
+ ///
+ ///
+ ///
+ public void ImageDataCallbackHandler(Packet packet, Simulator simulator)
+ {
+ Console.WriteLine(packet);
+ ImageDataPacket reply = (ImageDataPacket)packet;
+
+ LLUUID ImageID = reply.ImageID.ID;
+ ushort Packets = reply.ImageID.Packets;
+ uint Size = reply.ImageID.Size;
+ byte[] Data = reply.ImageData.Data;
+
+ // Lookup the request that this packet is for
+ TransferRequest tr = (TransferRequest)htDownloadRequests[ImageID];
+ if( tr == null )
+ {
+ // Received a packet for an image we didn't request...
+ return;
+ }
+
+ // Initialize the request so that it's data buffer is the right size for the image
+ tr.Size = Size;
+ tr.AssetData = new byte[tr.Size];
+ tr.BaseDataReceived = Data.Length;
+
+ // Copy the first block of image data into the request.
+ Array.Copy(Data, 0, tr.AssetData, tr.Received, Data.Length);
+ tr.Received += (uint)Data.Length;
+
+ // If we've gotten all the data, mark it completed.
+ if( tr.Received >= tr.Size )
+ {
+ tr.Completed = true;
+ tr.Status = true;
+ }
+ }
+
+ ///
+ /// Handles the remaining Image data that did not fit in the initial ImageData packet
+ ///
+ ///
+ ///
+ public void ImagePacketCallbackHandler(Packet packet, Simulator simulator)
+ {
+ Console.WriteLine(packet);
+ ImagePacketPacket reply = (ImagePacketPacket)packet;
+
+
+ // Lookup the request for this packet
+ TransferRequest tr = (TransferRequest)htDownloadRequests[reply.ImageID.ID];
+ if( tr == null )
+ {
+ // Received a packet that doesn't belong to any requests in our queue, strange...
+ return;
+ }
+
+
+ // TODO: Received data should probably be put into a temporary collection that's indected by ImageID.Packet
+ // then once we've received all data packets, it should be re-assembled into a complete array and marked
+ // completed.
+
+
+ // Add this packet's data to the request.
+ Array.Copy(reply.ImageData.Data, 0, tr.AssetData, tr.BaseDataReceived + (1000 * (reply.ImageID.Packet - 1)), reply.ImageData.Data.Length);
+ tr.Received += (uint)reply.ImageData.Data.Length;
+
+ // If we've gotten all the data, mark it completed.
+ if( tr.Received >= tr.Size )
+ {
+ tr.Completed = true;
+ tr.Status = true;
+ }
+ }
+
+ ///
+ ///
+ ///
+ public void ImageNotInDatabaseCallbackHandler(Packet packet, Simulator simulator)
+ {
+ Console.WriteLine(packet);
+ }
+ }
}
\ No newline at end of file
diff --git a/libsecondlife-cs/AssetSystem/ImagePacketHelpers.cs b/libsecondlife-cs/AssetSystem/ImagePacketHelpers.cs
index 856a8cd5..d67d770b 100644
--- a/libsecondlife-cs/AssetSystem/ImagePacketHelpers.cs
+++ b/libsecondlife-cs/AssetSystem/ImagePacketHelpers.cs
@@ -1,76 +1,76 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections;
-
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.AssetSystem
-{
- ///
- /// Helper functions for packets relating to images.
- ///
- public class ImagePacketHelpers
- {
- private LLUUID AgentID;
- private LLUUID SessionID;
-
- public ImagePacketHelpers(LLUUID AgentID, LLUUID SessionID)
- {
- this.AgentID = AgentID;
- this.SessionID = SessionID;
- }
-
-
- ///
- /// Send a packet requesting an image. This will either fail silently, or result in
- /// one ImageData packet, along with zero or more ImagePacket packets.
- ///
- /// LLUUID of the AssetID of an image.
- public Packet RequestImage(LLUUID imageID)
- {
- RequestImagePacket p = new RequestImagePacket();
- p.RequestImage = new RequestImagePacket.RequestImageBlock[1];
- p.RequestImage[0] = new RequestImagePacket.RequestImageBlock();
- p.RequestImage[0].DownloadPriority = (float)1215000.0;
- p.RequestImage[0].DiscardLevel = (int)0;
- p.RequestImage[0].Packet = (uint)0;
- p.RequestImage[0].Image = imageID;
-
- //FIXME: Find out what the appropriate values are here.
- Console.WriteLine("Don't know what the valid value should be for Type in RequestImage");
- p.RequestImage[0].Type = 0;
-
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- return p;
- }
-
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections;
+
+using libsecondlife;
+using libsecondlife.Packets;
+
+namespace libsecondlife.AssetSystem
+{
+ ///
+ /// Helper functions for packets relating to images.
+ ///
+ public class ImagePacketHelpers
+ {
+ private LLUUID AgentID;
+ private LLUUID SessionID;
+
+ public ImagePacketHelpers(LLUUID AgentID, LLUUID SessionID)
+ {
+ this.AgentID = AgentID;
+ this.SessionID = SessionID;
+ }
+
+
+ ///
+ /// Send a packet requesting an image. This will either fail silently, or result in
+ /// one ImageData packet, along with zero or more ImagePacket packets.
+ ///
+ /// LLUUID of the AssetID of an image.
+ public Packet RequestImage(LLUUID imageID)
+ {
+ RequestImagePacket p = new RequestImagePacket();
+ p.RequestImage = new RequestImagePacket.RequestImageBlock[1];
+ p.RequestImage[0] = new RequestImagePacket.RequestImageBlock();
+ p.RequestImage[0].DownloadPriority = (float)1215000.0;
+ p.RequestImage[0].DiscardLevel = (int)0;
+ p.RequestImage[0].Packet = (uint)0;
+ p.RequestImage[0].Image = imageID;
+
+ //FIXME: Find out what the appropriate values are here.
+ Console.WriteLine("Don't know what the valid value should be for Type in RequestImage");
+ p.RequestImage[0].Type = 0;
+
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ return p;
+ }
+
+ }
+}
diff --git a/libsecondlife-cs/Avatar.cs b/libsecondlife-cs/Avatar.cs
index c03baea7..ac4a5d63 100644
--- a/libsecondlife-cs/Avatar.cs
+++ b/libsecondlife-cs/Avatar.cs
@@ -1,713 +1,713 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Timers;
-using System.Net;
-using System.Collections;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public delegate void ChatCallback(string message, byte audible, byte type, byte sourcetype,
- string fromName, LLUUID id);
-
- ///
- /// Event is triggered when the L$ account balance for this avatar changes.
- ///
- /// The new account balance
- public delegate void BalanceCallback(int balance);
-
- ///
- /// Triggered whenever an instant message is received.
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public delegate void InstantMessageCallback(LLUUID fromAgentID, string fromAgentName,
- LLUUID toAgentID, uint parentEstateID, LLUUID regionID, LLVector3 position,
- bool dialog, bool groupIM, LLUUID imSessionID, DateTime timestamp, string message,
- byte offline, byte[] binaryBucket);
-
- ///
- /// Triggered after friend request packet is sent out.
- ///
- ///
- ///
- public delegate void FriendNotificationCallback(LLUUID agentID, bool online);
-
- ///
- ///
- ///
- ///
- public delegate void TeleportCallback(string message);
-
- ///
- /// Basic class to hold other Avatar's data.
- ///
- public class Avatar
- {
- /// The Avatar's UUID, asset server
- public LLUUID ID;
- /// Avatar ID in Region (sim) it is in
- public uint LocalID;
- /// Full Name of Avatar
- public string Name;
- /// Active Group of Avatar
- public string GroupName;
- /// Online Status of Avatar
- public bool Online;
- /// Location of Avatar (x,y,z probably)
- public LLVector3 Position;
- /// Rotational Position of Avatar
- public LLQuaternion Rotation;
- /// Region (aka sim) the Avatar is in
- public Region CurrentRegion;
- }
-
- ///
- /// Class to hold Client Avatar's data
- ///
- public class MainAvatar
- {
- ///
- public event ChatCallback OnChat;
- ///
- public event InstantMessageCallback OnInstantMessage;
- ///
- public event FriendNotificationCallback OnFriendNotification;
- ///
- public event TeleportCallback OnTeleport;
- ///
- public event BalanceCallback OnBalanceUpdated;
-
- /// Your (client) Avatar UUID, asset server
- public LLUUID ID;
- /// Your (client) Avatar ID, local to Region/sim
- public uint LocalID;
- /// Avatar First Name (i.e. Philip)
- public string FirstName;
- /// Avatar Last Name (i.e. Linden)
- public string LastName;
- ///
- public string TeleportMessage;
- /// Current position of avatar
- public LLVector3 Position;
- /// Current rotation of avatar
- public LLQuaternion Rotation;
- /// The point the avatar is currently looking at
- /// (may not stay updated)
- public LLVector3 LookAt;
- /// Position avatar client will goto when login to 'home' or during
- /// teleport request to 'home' region.
- public LLVector3 HomePosition;
- /// LookAt point saved/restored with HomePosition
- public LLVector3 HomeLookAt;
- /// Gets the health of the agent
- protected float health;
- public float Health
- {
- get { return health; }
- }
- /// Gets the current balance of the agent
- protected int balance;
- public int Balance
- {
- get { return balance; }
- }
-
- private SecondLife Client;
- private int TeleportStatus;
- private Timer TeleportTimer;
- private bool TeleportTimeout;
- private uint HeightWidthGenCounter;
-
- ///
- /// 'CallBack Central' - Setup callbacks for most of the incoming packets.
- ///
- ///
- public MainAvatar(SecondLife client)
- {
- PacketCallback callback;
- Client = client;
- TeleportMessage = "";
-
- // Create emtpy vectors for now
- HomeLookAt = HomePosition = Position = LookAt = new LLVector3();
- Rotation = new LLQuaternion();
-
- // Coarse location callback
- Client.Network.RegisterCallback(PacketType.CoarseLocationUpdate, new PacketCallback(CoarseLocationHandler));
-
- // Teleport callbacks
- callback = new PacketCallback(TeleportHandler);
- Client.Network.RegisterCallback(PacketType.TeleportStart, callback);
- Client.Network.RegisterCallback(PacketType.TeleportProgress, callback);
- Client.Network.RegisterCallback(PacketType.TeleportFailed, callback);
- Client.Network.RegisterCallback(PacketType.TeleportFinish, callback);
-
- // Instant Message callback
- Client.Network.RegisterCallback(PacketType.ImprovedInstantMessage, new PacketCallback(InstantMessageHandler));
-
- // Chat callback
- Client.Network.RegisterCallback(PacketType.ChatFromSimulator, new PacketCallback(ChatHandler));
-
- // Friend notification callback
- callback = new PacketCallback(FriendNotificationHandler);
- Client.Network.RegisterCallback(PacketType.OnlineNotification, callback);
- Client.Network.RegisterCallback(PacketType.OfflineNotification, callback);
-
- TeleportTimer = new Timer(18000);
- TeleportTimer.Elapsed += new ElapsedEventHandler(TeleportTimerEvent);
- TeleportTimeout = false;
-
- // Movement complete callback
- Client.Network.RegisterCallback(PacketType.AgentMovementComplete, new PacketCallback(MovementCompleteHandler));
-
- // Health callback
- Client.Network.RegisterCallback(PacketType.HealthMessage, new PacketCallback(HealthHandler));
-
- // Money callbacks
- callback = new PacketCallback(BalanceHandler);
- Client.Network.RegisterCallback(PacketType.MoneyBalanceReply, callback);
- Client.Network.RegisterCallback(PacketType.MoneySummaryReply, callback);
- Client.Network.RegisterCallback(PacketType.AdjustBalance, callback);
- }
-
- ///
- ///
- ///
- ///
- ///
- public void InstantMessage(LLUUID target, string message)
- {
- InstantMessage(FirstName + " " + LastName, LLUUID.GenerateUUID(), target, message, null, LLUUID.GenerateUUID());
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void InstantMessage(LLUUID target, string message, LLUUID IMSessionID)
- {
- InstantMessage(FirstName + " " + LastName, LLUUID.GenerateUUID(), target, message, null, IMSessionID);
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public void InstantMessage(string fromName, LLUUID sessionID, LLUUID target, string message, LLUUID[] conferenceIDs)
- {
- InstantMessage(fromName, sessionID, target, message, conferenceIDs, LLUUID.GenerateUUID());
- }
-
- ///
- ///
- ///
- /// Client's Avatar
- ///
- /// UUID of target Av.
- /// Text Message being sent.
- ///
- ///
- ///
- /// TODO: Have fromName grabbed from elsewhere and remove argument, to prevent inadvertant spoofing.
- ///
- public void InstantMessage(string fromName, LLUUID sessionID, LLUUID target, string message,
- LLUUID[] conferenceIDs, LLUUID IMSessionID)
- {
- ImprovedInstantMessagePacket im = new ImprovedInstantMessagePacket();
- im.AgentData.AgentID = this.ID;
- im.AgentData.SessionID = Client.Network.SessionID;
- im.MessageBlock.Dialog = 0;
- im.MessageBlock.FromAgentName = Helpers.StringToField(fromName);
- im.MessageBlock.FromGroup = false;
- im.MessageBlock.ID = IMSessionID;
- im.MessageBlock.Message = Helpers.StringToField(message);
- im.MessageBlock.Offline = 1;
- im.MessageBlock.ToAgentID = target;
- if (conferenceIDs != null && conferenceIDs.Length > 0)
- {
- im.MessageBlock.BinaryBucket = new byte[16 * conferenceIDs.Length];
-
- for (int i = 0; i < conferenceIDs.Length; ++i)
- {
- Array.Copy(conferenceIDs[i].Data, 0, im.MessageBlock.BinaryBucket, i * 16, 16);
- }
- }
- else
- {
- im.MessageBlock.BinaryBucket = new byte[0];
- }
-
- // These fields are mandatory, even if we don't have valid values for them
- im.MessageBlock.Position = new LLVector3();
- //TODO: Allow region id to be correctly set by caller or fetched from Client.*
- im.MessageBlock.RegionID = new LLUUID();
-
-
- // Send the message
- Client.Network.SendPacket((Packet)im);
- }
-
- ///
- /// Conversion type to denote Chat Packet types in an easier-to-understand format
- ///
- public enum ChatType
- {
- /// Whispers (5m radius)
- Whisper = 0,
- /// Normal chat (10/20m radius) - Why is this here twice?
- Normal = 1,
- /// Shouting! (100m radius)
- Shout = 2,
- /// Normal chat (10/20m radius) - Why is this here twice?
- Say = 3,
- /// Event message when an Avatar has begun to type
- StartTyping = 4,
- /// Event message when an Avatar has stopped typing
- StopTyping = 5
- }
-
- ///
- /// Send a Chat message.
- ///
- /// The Message you're sending out.
- /// Channel number (0 would be default 'Say' message, other numbers
- /// denote the equivalent of /# in normal client).
- /// Chat Type, see above.
- public void Chat(string message, int channel, ChatType type)
- {
- ChatFromViewerPacket chat = new ChatFromViewerPacket();
- chat.AgentData.AgentID = this.ID;
- chat.AgentData.SessionID = Client.Network.SessionID;
- chat.ChatData.Channel = channel;
- chat.ChatData.Message = Helpers.StringToField(message);
- chat.ChatData.Type = (byte)type;
-
- Client.Network.SendPacket((Packet)chat);
- }
-
- ///
- /// Set the height and the width of your avatar. This is used to scale
- /// the avatar mesh.
- ///
- /// New height of the avatar
- /// New width of the avatar
- public void SetHeightWidth(ushort height, ushort width)
- {
- AgentHeightWidthPacket heightwidth = new AgentHeightWidthPacket();
- heightwidth.AgentData.AgentID = Client.Network.AgentID;
- heightwidth.AgentData.SessionID = Client.Network.SessionID;
- heightwidth.AgentData.CircuitCode = Client.Network.CurrentSim.CircuitCode;
- heightwidth.HeightWidthBlock.Height = height;
- heightwidth.HeightWidthBlock.Width = width;
- heightwidth.HeightWidthBlock.GenCounter = HeightWidthGenCounter++;
-
- Client.Network.SendPacket((Packet)heightwidth);
- }
-
- ///
- /// Give Money to destination Avatar
- ///
- /// UUID of the Target Avatar
- /// Amount in L$
- /// Reason (optional normally)
- public void GiveMoney(LLUUID target, int amount, string description)
- {
- // 5001 - transaction type for av to av money transfers
- GiveMoney(target, amount, description, 5001);
- }
-
- ///
- /// Give Money to destionation Object or Avatar
- ///
- /// UUID of the Target Object/Avatar
- /// Amount in L$
- /// Reason (Optional normally)
- /// The type of transaction. Currently only 5001 is
- /// documented for Av->Av money transfers.
- public void GiveMoney(LLUUID target, int amount, string description, int transactiontype)
- {
- MoneyTransferRequestPacket money = new MoneyTransferRequestPacket();
- money.AgentData.AgentID = this.ID;
- money.AgentData.SessionID = Client.Network.SessionID;
- money.MoneyData.Description = Helpers.StringToField(description);
- money.MoneyData.DestID = target;
- money.MoneyData.SourceID = this.ID;
- money.MoneyData.TransactionType = transactiontype;
-
- Client.Network.SendPacket((Packet)money);
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public bool Teleport(ulong regionHandle, LLVector3 position)
- {
- return Teleport(regionHandle, position, new LLVector3(position.X + 1.0F, position.Y, position.Z));
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public bool Teleport(ulong regionHandle, LLVector3 position, LLVector3 lookAt)
- {
- TeleportStatus = 0;
-
- TeleportLocationRequestPacket teleport = new TeleportLocationRequestPacket();
- teleport.AgentData.AgentID = Client.Network.AgentID;
- teleport.AgentData.SessionID = Client.Network.SessionID;
- teleport.Info.LookAt = lookAt;
- teleport.Info.Position = position;
-
- teleport.Info.RegionHandle = regionHandle;
- teleport.Header.Reliable = true;
-
- Client.Log("Teleporting to region " + regionHandle.ToString(), Helpers.LogLevel.Info);
-
- // Start the timeout check
- TeleportTimeout = false;
- TeleportTimer.Start();
-
- Client.Network.SendPacket((Packet)teleport);
-
- while (TeleportStatus == 0 && !TeleportTimeout)
- {
- Client.Tick();
- }
-
- TeleportTimer.Stop();
-
- if (TeleportTimeout)
- {
- if (OnTeleport != null) { OnTeleport("Teleport timed out."); }
- }
- else
- {
- if (OnTeleport != null) { OnTeleport(TeleportMessage); }
- }
-
- return (TeleportStatus == 1);
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public bool Teleport(string simName, LLVector3 position)
- {
- position.Z = 0;
- return Teleport(simName, position, new LLVector3(0, 1.0F, 0));
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- public bool Teleport(string simName, LLVector3 position, LLVector3 lookAt)
- {
- Client.Grid.AddSim(simName);
- int attempts = 0;
-
- while (attempts++ < 5)
- {
- if (Client.Grid.Regions.ContainsKey(simName.ToLower()))
- {
- return Teleport(((GridRegion)Client.Grid.Regions[simName.ToLower()]).RegionHandle, position, lookAt);
- }
- else
- {
- System.Threading.Thread.Sleep(1000);
- Client.Grid.AddSim(simName);
- Client.Tick();
- }
- }
- if (OnTeleport != null)
- {
- OnTeleport("Unable to resolve name: " + simName);
- }
- return false;
- }
-
- ///
- ///
- ///
- ///
- public void CompleteAgentMovement(Simulator simulator)
- {
- CompleteAgentMovementPacket move = new CompleteAgentMovementPacket();
- move.AgentData.AgentID = Client.Network.AgentID;
- move.AgentData.SessionID = Client.Network.SessionID;
- move.AgentData.CircuitCode = simulator.CircuitCode;
-
- Client.Network.SendPacket(move, simulator);
- }
-
- public void UpdateCamera(bool reliable)
- {
- AgentUpdatePacket update = new AgentUpdatePacket();
- update.AgentData.AgentID = Client.Network.AgentID;
- update.AgentData.SessionID = Client.Network.SessionID;
- update.AgentData.State = 0;
- update.AgentData.BodyRotation = new LLQuaternion(0, 0.6519076f, 0, 0);
- update.AgentData.HeadRotation = new LLQuaternion();
- // Semi-sane default values
- update.AgentData.CameraCenter = new LLVector3(9.549901f, 7.033957f, 11.75f);
- update.AgentData.CameraAtAxis = new LLVector3(0.7f, 0.7f, 0);
- update.AgentData.CameraLeftAxis = new LLVector3(-0.7f, 0.7f, 0);
- update.AgentData.CameraUpAxis = new LLVector3(0.1822026f, 0.9828722f, 0);
- update.AgentData.Far = 384;
- update.AgentData.ControlFlags = 0; // TODO: What is this?
- update.AgentData.Flags = 0;
- update.Header.Reliable = reliable;
-
- Client.Network.SendPacket(update);
-
- // Send an AgentFOV packet widening our field of vision
- /*AgentFOVPacket fovPacket = new AgentFOVPacket();
- fovPacket.AgentData.AgentID = this.ID;
- fovPacket.AgentData.SessionID = Client.Network.SessionID;
- fovPacket.AgentData.CircuitCode = simulator.CircuitCode;
- fovPacket.FOVBlock.GenCounter = 0;
- fovPacket.FOVBlock.VerticalAngle = 6.28318531f;
- fovPacket.Header.Reliable = true;
- Client.Network.SendPacket((Packet)fovPacket);*/
- }
-
- private void FriendNotificationHandler(Packet packet, Simulator simulator)
- {
- // If the agent is online...
- if (packet.Type == PacketType.OnlineNotification)
- {
- foreach (OnlineNotificationPacket.AgentBlockBlock block in ((OnlineNotificationPacket)packet).AgentBlock)
- {
- Client.AddAvatar(block.AgentID);
- #region AvatarsMutex
- Client.AvatarsMutex.WaitOne();
- ((Avatar)Client.Avatars[block.AgentID]).Online = true;
- Client.AvatarsMutex.ReleaseMutex();
- #endregion AvatarsMutex
-
- if (OnFriendNotification != null)
- {
- OnFriendNotification(block.AgentID, true);
- }
- }
- }
-
- // If the agent is Offline...
- if (packet.Type == PacketType.OfflineNotification)
- {
- foreach (OfflineNotificationPacket.AgentBlockBlock block in ((OfflineNotificationPacket)packet).AgentBlock)
- {
- Client.AddAvatar(block.AgentID);
- #region AvatarsMutex
- Client.AvatarsMutex.WaitOne();
- ((Avatar)Client.Avatars[block.AgentID]).Online = false;
- Client.AvatarsMutex.ReleaseMutex();
- #endregion AvatarsMutex
-
- if (OnFriendNotification != null)
- {
- OnFriendNotification(block.AgentID, true);
- }
- }
- }
- }
-
- private void CoarseLocationHandler(Packet packet, Simulator simulator)
- {
- // TODO: This will be useful one day
- }
-
- private void InstantMessageHandler(Packet packet, Simulator simulator)
- {
- if (packet.Type == PacketType.ImprovedInstantMessage)
- {
- ImprovedInstantMessagePacket im = (ImprovedInstantMessagePacket)packet;
-
- if (OnInstantMessage != null)
- {
- OnInstantMessage(
- im.AgentData.AgentID
- , Helpers.FieldToString(im.MessageBlock.FromAgentName),
- im.MessageBlock.ToAgentID
- , im.MessageBlock.ParentEstateID
- , im.MessageBlock.RegionID
- , im.MessageBlock.Position
- , Convert.ToBoolean(im.MessageBlock.Dialog)
- , im.MessageBlock.FromGroup
- , im.MessageBlock.ID
- , new DateTime(im.MessageBlock.Timestamp)
- , Helpers.FieldToString(im.MessageBlock.Message)
- , im.MessageBlock.Offline
- , im.MessageBlock.BinaryBucket
- );
- }
- }
- }
-
- private void ChatHandler(Packet packet, Simulator simulator)
- {
- if (packet.Type == PacketType.ChatFromSimulator)
- {
- ChatFromSimulatorPacket chat = (ChatFromSimulatorPacket)packet;
-
- if (OnChat != null)
- {
- OnChat(Helpers.FieldToString(chat.ChatData.Message), chat.ChatData.Audible, chat.ChatData.ChatType,
- chat.ChatData.SourceType, Helpers.FieldToString(chat.ChatData.FromName), chat.ChatData.SourceID);
- }
- }
- }
-
- private void MovementCompleteHandler(Packet packet, Simulator simulator)
- {
- AgentMovementCompletePacket movement = (AgentMovementCompletePacket)packet;
-
- this.Position = movement.Data.Position;
- this.LookAt = movement.Data.LookAt;
- }
-
- private void HealthHandler(Packet packet, Simulator simulator)
- {
- health = ((HealthMessagePacket)packet).HealthData.Health;
- }
-
- private void BalanceHandler(Packet packet, Simulator simulator)
- {
- if (packet.Type == PacketType.MoneyBalanceReply)
- {
- balance = ((MoneyBalanceReplyPacket)packet).MoneyData.MoneyBalance;
- }
- else if (packet.Type == PacketType.MoneySummaryReply)
- {
- balance = ((MoneySummaryReplyPacket)packet).MoneyData.Balance;
- }
- else if (packet.Type == PacketType.AdjustBalance)
- {
- balance += ((AdjustBalancePacket)packet).AgentData.Delta;
- }
-
- if (OnBalanceUpdated != null)
- {
- OnBalanceUpdated(balance);
- }
- }
-
- private void TeleportHandler(Packet packet, Simulator simulator)
- {
- if (packet.Type == PacketType.TeleportStart)
- {
- TeleportMessage = "Teleport started";
- }
- else if (packet.Type == PacketType.TeleportProgress)
- {
- TeleportMessage = Helpers.FieldToString(((TeleportProgressPacket)packet).Info.Message);
- }
- else if (packet.Type == PacketType.TeleportFailed)
- {
- TeleportMessage = Helpers.FieldToString(((TeleportFailedPacket)packet).Info.Reason);
- TeleportStatus = -1;
- }
- else if (packet.Type == PacketType.TeleportFinish)
- {
- TeleportFinishPacket finish = (TeleportFinishPacket)packet;
- TeleportMessage = "Teleport finished";
-
- Simulator sim = Client.Network.Connect(new IPAddress((long)finish.Info.SimIP), finish.Info.SimPort,
- simulator.CircuitCode, true);
-
- if ( sim != null)
- {
- // Move the avatar in to this sim
- CompleteAgentMovementPacket move = new CompleteAgentMovementPacket();
- move.AgentData.AgentID = this.ID;
- move.AgentData.SessionID = Client.Network.SessionID;
- move.AgentData.CircuitCode = simulator.CircuitCode;
- Client.Network.SendPacket((Packet)move);
-
- Console.WriteLine(move);
-
- Client.Log("Moved to new sim " + Client.Network.CurrentSim.Region.Name + "(" +
- Client.Network.CurrentSim.IPEndPoint.ToString() + ")",
- Helpers.LogLevel.Info);
-
- // Sleep a little while so we can collect parcel information
- System.Threading.Thread.Sleep(1000);
-
- TeleportStatus = 1;
- }
- else
- {
- TeleportStatus = -1;
- }
- }
- }
-
- private void TeleportTimerEvent(object source, System.Timers.ElapsedEventArgs ea)
- {
- TeleportTimeout = true;
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Timers;
+using System.Net;
+using System.Collections;
+using libsecondlife.Packets;
+
+namespace libsecondlife
+{
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public delegate void ChatCallback(string message, byte audible, byte type, byte sourcetype,
+ string fromName, LLUUID id);
+
+ ///
+ /// Event is triggered when the L$ account balance for this avatar changes.
+ ///
+ /// The new account balance
+ public delegate void BalanceCallback(int balance);
+
+ ///
+ /// Triggered whenever an instant message is received.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public delegate void InstantMessageCallback(LLUUID fromAgentID, string fromAgentName,
+ LLUUID toAgentID, uint parentEstateID, LLUUID regionID, LLVector3 position,
+ bool dialog, bool groupIM, LLUUID imSessionID, DateTime timestamp, string message,
+ byte offline, byte[] binaryBucket);
+
+ ///
+ /// Triggered after friend request packet is sent out.
+ ///
+ ///
+ ///
+ public delegate void FriendNotificationCallback(LLUUID agentID, bool online);
+
+ ///
+ ///
+ ///
+ ///
+ public delegate void TeleportCallback(string message);
+
+ ///
+ /// Basic class to hold other Avatar's data.
+ ///
+ public class Avatar
+ {
+ /// The Avatar's UUID, asset server
+ public LLUUID ID;
+ /// Avatar ID in Region (sim) it is in
+ public uint LocalID;
+ /// Full Name of Avatar
+ public string Name;
+ /// Active Group of Avatar
+ public string GroupName;
+ /// Online Status of Avatar
+ public bool Online;
+ /// Location of Avatar (x,y,z probably)
+ public LLVector3 Position;
+ /// Rotational Position of Avatar
+ public LLQuaternion Rotation;
+ /// Region (aka sim) the Avatar is in
+ public Region CurrentRegion;
+ }
+
+ ///
+ /// Class to hold Client Avatar's data
+ ///
+ public class MainAvatar
+ {
+ ///
+ public event ChatCallback OnChat;
+ ///
+ public event InstantMessageCallback OnInstantMessage;
+ ///
+ public event FriendNotificationCallback OnFriendNotification;
+ ///
+ public event TeleportCallback OnTeleport;
+ ///
+ public event BalanceCallback OnBalanceUpdated;
+
+ /// Your (client) Avatar UUID, asset server
+ public LLUUID ID;
+ /// Your (client) Avatar ID, local to Region/sim
+ public uint LocalID;
+ /// Avatar First Name (i.e. Philip)
+ public string FirstName;
+ /// Avatar Last Name (i.e. Linden)
+ public string LastName;
+ ///
+ public string TeleportMessage;
+ /// Current position of avatar
+ public LLVector3 Position;
+ /// Current rotation of avatar
+ public LLQuaternion Rotation;
+ /// The point the avatar is currently looking at
+ /// (may not stay updated)
+ public LLVector3 LookAt;
+ /// Position avatar client will goto when login to 'home' or during
+ /// teleport request to 'home' region.
+ public LLVector3 HomePosition;
+ /// LookAt point saved/restored with HomePosition
+ public LLVector3 HomeLookAt;
+ /// Gets the health of the agent
+ protected float health;
+ public float Health
+ {
+ get { return health; }
+ }
+ /// Gets the current balance of the agent
+ protected int balance;
+ public int Balance
+ {
+ get { return balance; }
+ }
+
+ private SecondLife Client;
+ private int TeleportStatus;
+ private Timer TeleportTimer;
+ private bool TeleportTimeout;
+ private uint HeightWidthGenCounter;
+
+ ///
+ /// 'CallBack Central' - Setup callbacks for most of the incoming packets.
+ ///
+ ///
+ public MainAvatar(SecondLife client)
+ {
+ PacketCallback callback;
+ Client = client;
+ TeleportMessage = "";
+
+ // Create emtpy vectors for now
+ HomeLookAt = HomePosition = Position = LookAt = new LLVector3();
+ Rotation = new LLQuaternion();
+
+ // Coarse location callback
+ Client.Network.RegisterCallback(PacketType.CoarseLocationUpdate, new PacketCallback(CoarseLocationHandler));
+
+ // Teleport callbacks
+ callback = new PacketCallback(TeleportHandler);
+ Client.Network.RegisterCallback(PacketType.TeleportStart, callback);
+ Client.Network.RegisterCallback(PacketType.TeleportProgress, callback);
+ Client.Network.RegisterCallback(PacketType.TeleportFailed, callback);
+ Client.Network.RegisterCallback(PacketType.TeleportFinish, callback);
+
+ // Instant Message callback
+ Client.Network.RegisterCallback(PacketType.ImprovedInstantMessage, new PacketCallback(InstantMessageHandler));
+
+ // Chat callback
+ Client.Network.RegisterCallback(PacketType.ChatFromSimulator, new PacketCallback(ChatHandler));
+
+ // Friend notification callback
+ callback = new PacketCallback(FriendNotificationHandler);
+ Client.Network.RegisterCallback(PacketType.OnlineNotification, callback);
+ Client.Network.RegisterCallback(PacketType.OfflineNotification, callback);
+
+ TeleportTimer = new Timer(18000);
+ TeleportTimer.Elapsed += new ElapsedEventHandler(TeleportTimerEvent);
+ TeleportTimeout = false;
+
+ // Movement complete callback
+ Client.Network.RegisterCallback(PacketType.AgentMovementComplete, new PacketCallback(MovementCompleteHandler));
+
+ // Health callback
+ Client.Network.RegisterCallback(PacketType.HealthMessage, new PacketCallback(HealthHandler));
+
+ // Money callbacks
+ callback = new PacketCallback(BalanceHandler);
+ Client.Network.RegisterCallback(PacketType.MoneyBalanceReply, callback);
+ Client.Network.RegisterCallback(PacketType.MoneySummaryReply, callback);
+ Client.Network.RegisterCallback(PacketType.AdjustBalance, callback);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void InstantMessage(LLUUID target, string message)
+ {
+ InstantMessage(FirstName + " " + LastName, LLUUID.GenerateUUID(), target, message, null, LLUUID.GenerateUUID());
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void InstantMessage(LLUUID target, string message, LLUUID IMSessionID)
+ {
+ InstantMessage(FirstName + " " + LastName, LLUUID.GenerateUUID(), target, message, null, IMSessionID);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void InstantMessage(string fromName, LLUUID sessionID, LLUUID target, string message, LLUUID[] conferenceIDs)
+ {
+ InstantMessage(fromName, sessionID, target, message, conferenceIDs, LLUUID.GenerateUUID());
+ }
+
+ ///
+ ///
+ ///
+ /// Client's Avatar
+ ///
+ /// UUID of target Av.
+ /// Text Message being sent.
+ ///
+ ///
+ ///
+ /// TODO: Have fromName grabbed from elsewhere and remove argument, to prevent inadvertant spoofing.
+ ///
+ public void InstantMessage(string fromName, LLUUID sessionID, LLUUID target, string message,
+ LLUUID[] conferenceIDs, LLUUID IMSessionID)
+ {
+ ImprovedInstantMessagePacket im = new ImprovedInstantMessagePacket();
+ im.AgentData.AgentID = this.ID;
+ im.AgentData.SessionID = Client.Network.SessionID;
+ im.MessageBlock.Dialog = 0;
+ im.MessageBlock.FromAgentName = Helpers.StringToField(fromName);
+ im.MessageBlock.FromGroup = false;
+ im.MessageBlock.ID = IMSessionID;
+ im.MessageBlock.Message = Helpers.StringToField(message);
+ im.MessageBlock.Offline = 1;
+ im.MessageBlock.ToAgentID = target;
+ if (conferenceIDs != null && conferenceIDs.Length > 0)
+ {
+ im.MessageBlock.BinaryBucket = new byte[16 * conferenceIDs.Length];
+
+ for (int i = 0; i < conferenceIDs.Length; ++i)
+ {
+ Array.Copy(conferenceIDs[i].Data, 0, im.MessageBlock.BinaryBucket, i * 16, 16);
+ }
+ }
+ else
+ {
+ im.MessageBlock.BinaryBucket = new byte[0];
+ }
+
+ // These fields are mandatory, even if we don't have valid values for them
+ im.MessageBlock.Position = new LLVector3();
+ //TODO: Allow region id to be correctly set by caller or fetched from Client.*
+ im.MessageBlock.RegionID = new LLUUID();
+
+
+ // Send the message
+ Client.Network.SendPacket((Packet)im);
+ }
+
+ ///
+ /// Conversion type to denote Chat Packet types in an easier-to-understand format
+ ///
+ public enum ChatType
+ {
+ /// Whispers (5m radius)
+ Whisper = 0,
+ /// Normal chat (10/20m radius) - Why is this here twice?
+ Normal = 1,
+ /// Shouting! (100m radius)
+ Shout = 2,
+ /// Normal chat (10/20m radius) - Why is this here twice?
+ Say = 3,
+ /// Event message when an Avatar has begun to type
+ StartTyping = 4,
+ /// Event message when an Avatar has stopped typing
+ StopTyping = 5
+ }
+
+ ///
+ /// Send a Chat message.
+ ///
+ /// The Message you're sending out.
+ /// Channel number (0 would be default 'Say' message, other numbers
+ /// denote the equivalent of /# in normal client).
+ /// Chat Type, see above.
+ public void Chat(string message, int channel, ChatType type)
+ {
+ ChatFromViewerPacket chat = new ChatFromViewerPacket();
+ chat.AgentData.AgentID = this.ID;
+ chat.AgentData.SessionID = Client.Network.SessionID;
+ chat.ChatData.Channel = channel;
+ chat.ChatData.Message = Helpers.StringToField(message);
+ chat.ChatData.Type = (byte)type;
+
+ Client.Network.SendPacket((Packet)chat);
+ }
+
+ ///
+ /// Set the height and the width of your avatar. This is used to scale
+ /// the avatar mesh.
+ ///
+ /// New height of the avatar
+ /// New width of the avatar
+ public void SetHeightWidth(ushort height, ushort width)
+ {
+ AgentHeightWidthPacket heightwidth = new AgentHeightWidthPacket();
+ heightwidth.AgentData.AgentID = Client.Network.AgentID;
+ heightwidth.AgentData.SessionID = Client.Network.SessionID;
+ heightwidth.AgentData.CircuitCode = Client.Network.CurrentSim.CircuitCode;
+ heightwidth.HeightWidthBlock.Height = height;
+ heightwidth.HeightWidthBlock.Width = width;
+ heightwidth.HeightWidthBlock.GenCounter = HeightWidthGenCounter++;
+
+ Client.Network.SendPacket((Packet)heightwidth);
+ }
+
+ ///
+ /// Give Money to destination Avatar
+ ///
+ /// UUID of the Target Avatar
+ /// Amount in L$
+ /// Reason (optional normally)
+ public void GiveMoney(LLUUID target, int amount, string description)
+ {
+ // 5001 - transaction type for av to av money transfers
+ GiveMoney(target, amount, description, 5001);
+ }
+
+ ///
+ /// Give Money to destionation Object or Avatar
+ ///
+ /// UUID of the Target Object/Avatar
+ /// Amount in L$
+ /// Reason (Optional normally)
+ /// The type of transaction. Currently only 5001 is
+ /// documented for Av->Av money transfers.
+ public void GiveMoney(LLUUID target, int amount, string description, int transactiontype)
+ {
+ MoneyTransferRequestPacket money = new MoneyTransferRequestPacket();
+ money.AgentData.AgentID = this.ID;
+ money.AgentData.SessionID = Client.Network.SessionID;
+ money.MoneyData.Description = Helpers.StringToField(description);
+ money.MoneyData.DestID = target;
+ money.MoneyData.SourceID = this.ID;
+ money.MoneyData.TransactionType = transactiontype;
+
+ Client.Network.SendPacket((Packet)money);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public bool Teleport(ulong regionHandle, LLVector3 position)
+ {
+ return Teleport(regionHandle, position, new LLVector3(position.X + 1.0F, position.Y, position.Z));
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public bool Teleport(ulong regionHandle, LLVector3 position, LLVector3 lookAt)
+ {
+ TeleportStatus = 0;
+
+ TeleportLocationRequestPacket teleport = new TeleportLocationRequestPacket();
+ teleport.AgentData.AgentID = Client.Network.AgentID;
+ teleport.AgentData.SessionID = Client.Network.SessionID;
+ teleport.Info.LookAt = lookAt;
+ teleport.Info.Position = position;
+
+ teleport.Info.RegionHandle = regionHandle;
+ teleport.Header.Reliable = true;
+
+ Client.Log("Teleporting to region " + regionHandle.ToString(), Helpers.LogLevel.Info);
+
+ // Start the timeout check
+ TeleportTimeout = false;
+ TeleportTimer.Start();
+
+ Client.Network.SendPacket((Packet)teleport);
+
+ while (TeleportStatus == 0 && !TeleportTimeout)
+ {
+ Client.Tick();
+ }
+
+ TeleportTimer.Stop();
+
+ if (TeleportTimeout)
+ {
+ if (OnTeleport != null) { OnTeleport("Teleport timed out."); }
+ }
+ else
+ {
+ if (OnTeleport != null) { OnTeleport(TeleportMessage); }
+ }
+
+ return (TeleportStatus == 1);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public bool Teleport(string simName, LLVector3 position)
+ {
+ position.Z = 0;
+ return Teleport(simName, position, new LLVector3(0, 1.0F, 0));
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public bool Teleport(string simName, LLVector3 position, LLVector3 lookAt)
+ {
+ Client.Grid.AddSim(simName);
+ int attempts = 0;
+
+ while (attempts++ < 5)
+ {
+ if (Client.Grid.Regions.ContainsKey(simName.ToLower()))
+ {
+ return Teleport(((GridRegion)Client.Grid.Regions[simName.ToLower()]).RegionHandle, position, lookAt);
+ }
+ else
+ {
+ System.Threading.Thread.Sleep(1000);
+ Client.Grid.AddSim(simName);
+ Client.Tick();
+ }
+ }
+ if (OnTeleport != null)
+ {
+ OnTeleport("Unable to resolve name: " + simName);
+ }
+ return false;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public void CompleteAgentMovement(Simulator simulator)
+ {
+ CompleteAgentMovementPacket move = new CompleteAgentMovementPacket();
+ move.AgentData.AgentID = Client.Network.AgentID;
+ move.AgentData.SessionID = Client.Network.SessionID;
+ move.AgentData.CircuitCode = simulator.CircuitCode;
+
+ Client.Network.SendPacket(move, simulator);
+ }
+
+ public void UpdateCamera(bool reliable)
+ {
+ AgentUpdatePacket update = new AgentUpdatePacket();
+ update.AgentData.AgentID = Client.Network.AgentID;
+ update.AgentData.SessionID = Client.Network.SessionID;
+ update.AgentData.State = 0;
+ update.AgentData.BodyRotation = new LLQuaternion(0, 0.6519076f, 0, 0);
+ update.AgentData.HeadRotation = new LLQuaternion();
+ // Semi-sane default values
+ update.AgentData.CameraCenter = new LLVector3(9.549901f, 7.033957f, 11.75f);
+ update.AgentData.CameraAtAxis = new LLVector3(0.7f, 0.7f, 0);
+ update.AgentData.CameraLeftAxis = new LLVector3(-0.7f, 0.7f, 0);
+ update.AgentData.CameraUpAxis = new LLVector3(0.1822026f, 0.9828722f, 0);
+ update.AgentData.Far = 384;
+ update.AgentData.ControlFlags = 0; // TODO: What is this?
+ update.AgentData.Flags = 0;
+ update.Header.Reliable = reliable;
+
+ Client.Network.SendPacket(update);
+
+ // Send an AgentFOV packet widening our field of vision
+ /*AgentFOVPacket fovPacket = new AgentFOVPacket();
+ fovPacket.AgentData.AgentID = this.ID;
+ fovPacket.AgentData.SessionID = Client.Network.SessionID;
+ fovPacket.AgentData.CircuitCode = simulator.CircuitCode;
+ fovPacket.FOVBlock.GenCounter = 0;
+ fovPacket.FOVBlock.VerticalAngle = 6.28318531f;
+ fovPacket.Header.Reliable = true;
+ Client.Network.SendPacket((Packet)fovPacket);*/
+ }
+
+ private void FriendNotificationHandler(Packet packet, Simulator simulator)
+ {
+ // If the agent is online...
+ if (packet.Type == PacketType.OnlineNotification)
+ {
+ foreach (OnlineNotificationPacket.AgentBlockBlock block in ((OnlineNotificationPacket)packet).AgentBlock)
+ {
+ Client.AddAvatar(block.AgentID);
+ #region AvatarsMutex
+ Client.AvatarsMutex.WaitOne();
+ ((Avatar)Client.Avatars[block.AgentID]).Online = true;
+ Client.AvatarsMutex.ReleaseMutex();
+ #endregion AvatarsMutex
+
+ if (OnFriendNotification != null)
+ {
+ OnFriendNotification(block.AgentID, true);
+ }
+ }
+ }
+
+ // If the agent is Offline...
+ if (packet.Type == PacketType.OfflineNotification)
+ {
+ foreach (OfflineNotificationPacket.AgentBlockBlock block in ((OfflineNotificationPacket)packet).AgentBlock)
+ {
+ Client.AddAvatar(block.AgentID);
+ #region AvatarsMutex
+ Client.AvatarsMutex.WaitOne();
+ ((Avatar)Client.Avatars[block.AgentID]).Online = false;
+ Client.AvatarsMutex.ReleaseMutex();
+ #endregion AvatarsMutex
+
+ if (OnFriendNotification != null)
+ {
+ OnFriendNotification(block.AgentID, true);
+ }
+ }
+ }
+ }
+
+ private void CoarseLocationHandler(Packet packet, Simulator simulator)
+ {
+ // TODO: This will be useful one day
+ }
+
+ private void InstantMessageHandler(Packet packet, Simulator simulator)
+ {
+ if (packet.Type == PacketType.ImprovedInstantMessage)
+ {
+ ImprovedInstantMessagePacket im = (ImprovedInstantMessagePacket)packet;
+
+ if (OnInstantMessage != null)
+ {
+ OnInstantMessage(
+ im.AgentData.AgentID
+ , Helpers.FieldToString(im.MessageBlock.FromAgentName),
+ im.MessageBlock.ToAgentID
+ , im.MessageBlock.ParentEstateID
+ , im.MessageBlock.RegionID
+ , im.MessageBlock.Position
+ , Convert.ToBoolean(im.MessageBlock.Dialog)
+ , im.MessageBlock.FromGroup
+ , im.MessageBlock.ID
+ , new DateTime(im.MessageBlock.Timestamp)
+ , Helpers.FieldToString(im.MessageBlock.Message)
+ , im.MessageBlock.Offline
+ , im.MessageBlock.BinaryBucket
+ );
+ }
+ }
+ }
+
+ private void ChatHandler(Packet packet, Simulator simulator)
+ {
+ if (packet.Type == PacketType.ChatFromSimulator)
+ {
+ ChatFromSimulatorPacket chat = (ChatFromSimulatorPacket)packet;
+
+ if (OnChat != null)
+ {
+ OnChat(Helpers.FieldToString(chat.ChatData.Message), chat.ChatData.Audible, chat.ChatData.ChatType,
+ chat.ChatData.SourceType, Helpers.FieldToString(chat.ChatData.FromName), chat.ChatData.SourceID);
+ }
+ }
+ }
+
+ private void MovementCompleteHandler(Packet packet, Simulator simulator)
+ {
+ AgentMovementCompletePacket movement = (AgentMovementCompletePacket)packet;
+
+ this.Position = movement.Data.Position;
+ this.LookAt = movement.Data.LookAt;
+ }
+
+ private void HealthHandler(Packet packet, Simulator simulator)
+ {
+ health = ((HealthMessagePacket)packet).HealthData.Health;
+ }
+
+ private void BalanceHandler(Packet packet, Simulator simulator)
+ {
+ if (packet.Type == PacketType.MoneyBalanceReply)
+ {
+ balance = ((MoneyBalanceReplyPacket)packet).MoneyData.MoneyBalance;
+ }
+ else if (packet.Type == PacketType.MoneySummaryReply)
+ {
+ balance = ((MoneySummaryReplyPacket)packet).MoneyData.Balance;
+ }
+ else if (packet.Type == PacketType.AdjustBalance)
+ {
+ balance += ((AdjustBalancePacket)packet).AgentData.Delta;
+ }
+
+ if (OnBalanceUpdated != null)
+ {
+ OnBalanceUpdated(balance);
+ }
+ }
+
+ private void TeleportHandler(Packet packet, Simulator simulator)
+ {
+ if (packet.Type == PacketType.TeleportStart)
+ {
+ TeleportMessage = "Teleport started";
+ }
+ else if (packet.Type == PacketType.TeleportProgress)
+ {
+ TeleportMessage = Helpers.FieldToString(((TeleportProgressPacket)packet).Info.Message);
+ }
+ else if (packet.Type == PacketType.TeleportFailed)
+ {
+ TeleportMessage = Helpers.FieldToString(((TeleportFailedPacket)packet).Info.Reason);
+ TeleportStatus = -1;
+ }
+ else if (packet.Type == PacketType.TeleportFinish)
+ {
+ TeleportFinishPacket finish = (TeleportFinishPacket)packet;
+ TeleportMessage = "Teleport finished";
+
+ Simulator sim = Client.Network.Connect(new IPAddress((long)finish.Info.SimIP), finish.Info.SimPort,
+ simulator.CircuitCode, true);
+
+ if ( sim != null)
+ {
+ // Move the avatar in to this sim
+ CompleteAgentMovementPacket move = new CompleteAgentMovementPacket();
+ move.AgentData.AgentID = this.ID;
+ move.AgentData.SessionID = Client.Network.SessionID;
+ move.AgentData.CircuitCode = simulator.CircuitCode;
+ Client.Network.SendPacket((Packet)move);
+
+ Console.WriteLine(move);
+
+ Client.Log("Moved to new sim " + Client.Network.CurrentSim.Region.Name + "(" +
+ Client.Network.CurrentSim.IPEndPoint.ToString() + ")",
+ Helpers.LogLevel.Info);
+
+ // Sleep a little while so we can collect parcel information
+ System.Threading.Thread.Sleep(1000);
+
+ TeleportStatus = 1;
+ }
+ else
+ {
+ TeleportStatus = -1;
+ }
+ }
+ }
+
+ private void TeleportTimerEvent(object source, System.Timers.ElapsedEventArgs ea)
+ {
+ TeleportTimeout = true;
+ }
+ }
+}
diff --git a/libsecondlife-cs/EstateTools.cs b/libsecondlife-cs/EstateTools.cs
index e449fa4d..82e3c6cd 100644
--- a/libsecondlife-cs/EstateTools.cs
+++ b/libsecondlife-cs/EstateTools.cs
@@ -1,95 +1,95 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-using System;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
- ///
- /// Summary description for EstateTools.
- ///
- public class EstateTools
- {
- private SecondLife Client;
-
- ///
- ///
- ///
- ///
- public EstateTools(SecondLife client)
- {
- Client = client;
- }
-
- ///
- ///
- ///
- ///
- public void KickUser(LLUUID prey)
- {
- EstateOwnerMessagePacket estate = new EstateOwnerMessagePacket();
- estate.AgentData.AgentID = Client.Network.AgentID;
- estate.AgentData.SessionID = Client.Network.SessionID;
- estate.MethodData.Invoice = LLUUID.GenerateUUID();
- estate.MethodData.Method = Helpers.StringToField("kick");
- estate.ParamList = new EstateOwnerMessagePacket.ParamListBlock[2];
- estate.ParamList[0].Parameter = Helpers.StringToField(Client.Network.AgentID.ToStringHyphenated());
- estate.ParamList[1].Parameter = Helpers.StringToField(prey.ToStringHyphenated());
-
- Client.Network.SendPacket((Packet)estate);
- }
-
- ///
- ///
- ///
- ///
- public void BanUser(LLUUID prey)
- {
- // FIXME:
- //Client.Network.SendPacket(Packets.Estate.EstateBan(Client.Protocol,Client.Avatar.ID,Client.Network.SessionID,prey));
- }
-
- ///
- ///
- ///
- ///
- public void UnBanUser(LLUUID prey)
- {
- // FIXME:
- //Client.Network.SendPacket(Packets.Estate.EstateUnBan(Client.Protocol,Client.Avatar.ID,Client.Network.SessionID,prey));
- }
-
- ///
- ///
- ///
- ///
- public void TeleportHomeUser(LLUUID prey)
- {
- // FIXME:
- //Client.Network.SendPacket(Packets.Estate.EstateTeleportUser(Client.Protocol,Client.Avatar.ID,Client.Network.SessionID,prey));
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+using System;
+using libsecondlife.Packets;
+
+namespace libsecondlife
+{
+ ///
+ /// Summary description for EstateTools.
+ ///
+ public class EstateTools
+ {
+ private SecondLife Client;
+
+ ///
+ ///
+ ///
+ ///
+ public EstateTools(SecondLife client)
+ {
+ Client = client;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public void KickUser(LLUUID prey)
+ {
+ EstateOwnerMessagePacket estate = new EstateOwnerMessagePacket();
+ estate.AgentData.AgentID = Client.Network.AgentID;
+ estate.AgentData.SessionID = Client.Network.SessionID;
+ estate.MethodData.Invoice = LLUUID.GenerateUUID();
+ estate.MethodData.Method = Helpers.StringToField("kick");
+ estate.ParamList = new EstateOwnerMessagePacket.ParamListBlock[2];
+ estate.ParamList[0].Parameter = Helpers.StringToField(Client.Network.AgentID.ToStringHyphenated());
+ estate.ParamList[1].Parameter = Helpers.StringToField(prey.ToStringHyphenated());
+
+ Client.Network.SendPacket((Packet)estate);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public void BanUser(LLUUID prey)
+ {
+ // FIXME:
+ //Client.Network.SendPacket(Packets.Estate.EstateBan(Client.Protocol,Client.Avatar.ID,Client.Network.SessionID,prey));
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public void UnBanUser(LLUUID prey)
+ {
+ // FIXME:
+ //Client.Network.SendPacket(Packets.Estate.EstateUnBan(Client.Protocol,Client.Avatar.ID,Client.Network.SessionID,prey));
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public void TeleportHomeUser(LLUUID prey)
+ {
+ // FIXME:
+ //Client.Network.SendPacket(Packets.Estate.EstateTeleportUser(Client.Protocol,Client.Avatar.ID,Client.Network.SessionID,prey));
+ }
+ }
+}
diff --git a/libsecondlife-cs/GridManager.cs b/libsecondlife-cs/GridManager.cs
index 411e0e8f..1f38bb2b 100644
--- a/libsecondlife-cs/GridManager.cs
+++ b/libsecondlife-cs/GridManager.cs
@@ -1,208 +1,208 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
- public delegate void AddRegionCallback(GridRegion region);
-
- ///
- /// Class for regions on the world map
- ///
- public class GridRegion
- {
- ///
- public int X;
- ///
- public int Y;
- ///
- public string Name;
- ///
- public byte Access;
- ///
- public uint RegionFlags;
- ///
- public byte WaterHeight;
- ///
- public byte Agents;
- ///
- public LLUUID MapImageID;
- /// Used for teleporting
- public ulong RegionHandle;
-
- ///
- ///
- ///
- public GridRegion()
- {
- }
- }
-
- ///
- /// Manages grid-wide tasks such as the world map
- ///
- public class GridManager
- {
- public event AddRegionCallback OnRegionAdd;
-
- /// A hashtable of all the regions, indexed by region ID
- public Hashtable Regions;
- /// Current direction of the sun
- public LLVector3 SunDirection;
-
- private SecondLife Client;
-
- ///
- ///
- ///
- ///
- public GridManager(SecondLife client)
- {
- Client = client;
- Regions = new Hashtable();
- SunDirection = new LLVector3();
-
- Client.Network.RegisterCallback(PacketType.MapBlockReply, new PacketCallback(MapBlockReplyHandler));
- Client.Network.RegisterCallback(PacketType.SimulatorViewerTimeMessage, new PacketCallback(TimeMessageHandler));
- }
-
- ///
- ///
- ///
- ///
- public void AddSim(string name)
- {
- if(!Regions.ContainsKey(name))
- {
- MapNameRequestPacket map = new MapNameRequestPacket();
- map.AgentData.AgentID = Client.Network.AgentID;
- map.AgentData.SessionID = Client.Network.SessionID;
-
- map.NameData.Name = Helpers.StringToField(name.ToLower());
-
- Client.Network.SendPacket((Packet)map);
- }
- }
-
- public void AddEstateSims()
- {
- MapLayerRequestPacket request = new MapLayerRequestPacket();
- request.AgentData.AgentID = Client.Network.AgentID;
- request.AgentData.SessionID = Client.Network.SessionID;
- request.AgentData.Godlike = true;
- request.AgentData.Flags = 0;
- request.AgentData.EstateID = 0; // TODO get a better value here.
-
- Client.Network.SendPacket((Packet)request);
- }
-
- public void AddLindenSims()
- {
- MapBlockRequestPacket request = new MapBlockRequestPacket();
- request.AgentData.AgentID = Client.Network.AgentID;
- request.AgentData.SessionID = Client.Network.SessionID;
- request.AgentData.EstateID = 0;
- request.AgentData.Flags = 0;
- request.PositionData.MaxX = 65535;
- request.PositionData.MaxY = 65535;
- request.PositionData.MinX = 0;
- request.PositionData.MinY = 0;
-
- Client.Network.SendPacket((Packet)request);
- }
-
- ///
- ///
- ///
- public void AddAllSims()
- {
- AddLindenSims();
- AddEstateSims();
- }
-
- ///
- ///
- ///
- ///
- ///
- public GridRegion GetSim(string name)
- {
- if(Regions.ContainsKey(name))
- return (GridRegion)Regions[name];
-
- AddSim(name);
- System.Threading.Thread.Sleep(1000);
-
- if(Regions.ContainsKey(name))
- return (GridRegion)Regions[name];
- else
- {
- //TODO: Put some better handling inplace here with some retry code
- Client.Log("GetSim(): Returned a sim that we aren't tracking",Helpers.LogLevel.Warning);
- return new GridRegion();
- }
- }
-
- private void MapBlockReplyHandler(Packet packet, Simulator simulator)
- {
- GridRegion region;
- MapBlockReplyPacket map = (MapBlockReplyPacket)packet;
-
- foreach (MapBlockReplyPacket.DataBlock block in map.Data)
- {
- region = new GridRegion();
-
- region.X = block.X;
- region.Y = block.Y;
- region.Name = Helpers.FieldToString(block.Name);
- region.RegionFlags = block.RegionFlags;
- region.WaterHeight = block.WaterHeight;
- region.Agents = block.Agents;
- region.Access = block.Access;
- region.MapImageID = block.MapImageID;
- region.RegionHandle = Helpers.UIntsToLong((uint)region.X * (uint)256, (uint)region.Y * (uint)256);
-
- if (region.Name != "" && region.X != 0 && region.Y != 0)
- {
- Regions[region.Name.ToLower()] = region;
- }
-
- if (OnRegionAdd != null)
- {
- OnRegionAdd(region);
- }
- }
- }
-
- private void TimeMessageHandler(Packet packet, Simulator simulator)
- {
- SunDirection = ((SimulatorViewerTimeMessagePacket)packet).TimeInfo.SunDirection;
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections;
+using libsecondlife.Packets;
+
+namespace libsecondlife
+{
+ public delegate void AddRegionCallback(GridRegion region);
+
+ ///
+ /// Class for regions on the world map
+ ///
+ public class GridRegion
+ {
+ ///
+ public int X;
+ ///
+ public int Y;
+ ///
+ public string Name;
+ ///
+ public byte Access;
+ ///
+ public uint RegionFlags;
+ ///
+ public byte WaterHeight;
+ ///
+ public byte Agents;
+ ///
+ public LLUUID MapImageID;
+ /// Used for teleporting
+ public ulong RegionHandle;
+
+ ///
+ ///
+ ///
+ public GridRegion()
+ {
+ }
+ }
+
+ ///
+ /// Manages grid-wide tasks such as the world map
+ ///
+ public class GridManager
+ {
+ public event AddRegionCallback OnRegionAdd;
+
+ /// A hashtable of all the regions, indexed by region ID
+ public Hashtable Regions;
+ /// Current direction of the sun
+ public LLVector3 SunDirection;
+
+ private SecondLife Client;
+
+ ///
+ ///
+ ///
+ ///
+ public GridManager(SecondLife client)
+ {
+ Client = client;
+ Regions = new Hashtable();
+ SunDirection = new LLVector3();
+
+ Client.Network.RegisterCallback(PacketType.MapBlockReply, new PacketCallback(MapBlockReplyHandler));
+ Client.Network.RegisterCallback(PacketType.SimulatorViewerTimeMessage, new PacketCallback(TimeMessageHandler));
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public void AddSim(string name)
+ {
+ if(!Regions.ContainsKey(name))
+ {
+ MapNameRequestPacket map = new MapNameRequestPacket();
+ map.AgentData.AgentID = Client.Network.AgentID;
+ map.AgentData.SessionID = Client.Network.SessionID;
+
+ map.NameData.Name = Helpers.StringToField(name.ToLower());
+
+ Client.Network.SendPacket((Packet)map);
+ }
+ }
+
+ public void AddEstateSims()
+ {
+ MapLayerRequestPacket request = new MapLayerRequestPacket();
+ request.AgentData.AgentID = Client.Network.AgentID;
+ request.AgentData.SessionID = Client.Network.SessionID;
+ request.AgentData.Godlike = true;
+ request.AgentData.Flags = 0;
+ request.AgentData.EstateID = 0; // TODO get a better value here.
+
+ Client.Network.SendPacket((Packet)request);
+ }
+
+ public void AddLindenSims()
+ {
+ MapBlockRequestPacket request = new MapBlockRequestPacket();
+ request.AgentData.AgentID = Client.Network.AgentID;
+ request.AgentData.SessionID = Client.Network.SessionID;
+ request.AgentData.EstateID = 0;
+ request.AgentData.Flags = 0;
+ request.PositionData.MaxX = 65535;
+ request.PositionData.MaxY = 65535;
+ request.PositionData.MinX = 0;
+ request.PositionData.MinY = 0;
+
+ Client.Network.SendPacket((Packet)request);
+ }
+
+ ///
+ ///
+ ///
+ public void AddAllSims()
+ {
+ AddLindenSims();
+ AddEstateSims();
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public GridRegion GetSim(string name)
+ {
+ if(Regions.ContainsKey(name))
+ return (GridRegion)Regions[name];
+
+ AddSim(name);
+ System.Threading.Thread.Sleep(1000);
+
+ if(Regions.ContainsKey(name))
+ return (GridRegion)Regions[name];
+ else
+ {
+ //TODO: Put some better handling inplace here with some retry code
+ Client.Log("GetSim(): Returned a sim that we aren't tracking",Helpers.LogLevel.Warning);
+ return new GridRegion();
+ }
+ }
+
+ private void MapBlockReplyHandler(Packet packet, Simulator simulator)
+ {
+ GridRegion region;
+ MapBlockReplyPacket map = (MapBlockReplyPacket)packet;
+
+ foreach (MapBlockReplyPacket.DataBlock block in map.Data)
+ {
+ region = new GridRegion();
+
+ region.X = block.X;
+ region.Y = block.Y;
+ region.Name = Helpers.FieldToString(block.Name);
+ region.RegionFlags = block.RegionFlags;
+ region.WaterHeight = block.WaterHeight;
+ region.Agents = block.Agents;
+ region.Access = block.Access;
+ region.MapImageID = block.MapImageID;
+ region.RegionHandle = Helpers.UIntsToLong((uint)region.X * (uint)256, (uint)region.Y * (uint)256);
+
+ if (region.Name != "" && region.X != 0 && region.Y != 0)
+ {
+ Regions[region.Name.ToLower()] = region;
+ }
+
+ if (OnRegionAdd != null)
+ {
+ OnRegionAdd(region);
+ }
+ }
+ }
+
+ private void TimeMessageHandler(Packet packet, Simulator simulator)
+ {
+ SunDirection = ((SimulatorViewerTimeMessagePacket)packet).TimeInfo.SunDirection;
+ }
+ }
+}
diff --git a/libsecondlife-cs/GroupManager.cs b/libsecondlife-cs/GroupManager.cs
index f328d76c..d7e508ab 100644
--- a/libsecondlife-cs/GroupManager.cs
+++ b/libsecondlife-cs/GroupManager.cs
@@ -1,425 +1,425 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections;
-using System.Threading;
-using libsecondlife.Packets;
-
-namespace libsecondlife
-{
- public class GroupMember
- {
- public LLUUID ID;
- public int Contribution;
- public string OnlineStatus;
- public ulong Powers;
- public string Title;
- public bool IsOwner;
-
- public GroupMember(LLUUID id)
- {
- ID = id;
- }
- }
-
- public class GroupRole
- {
- public LLUUID ID;
- public string Name;
- public string Title;
- public string Description;
- public ulong Powers;
- /// (LLUUID,GroupMember) Contains all the group members
- /// belonging to this role
- public Hashtable Members;
-
- public GroupRole(LLUUID id)
- {
- ID = id;
- Members = new Hashtable();
- }
- }
-
- ///
- /// Represents a group in Second Life
- ///
- public class Group
- {
- public LLUUID ID;
- public LLUUID InsigniaID;
- public LLUUID FounderID;
- public LLUUID OwnerRole;
- public string Name;
- public string Charter;
- public string MemberTitle;
- public bool OpenEnrollment;
- public bool ShowInList;
- public ulong Powers;
- public bool AcceptNotices;
- public bool AllowPublish;
- public bool MaturePublish;
- public int MembershipFee;
- public int Money;
- public int Contribution;
- public int GroupMembershipCount;
- public int GroupRolesCount;
- /// (LLUUID,?)
- public Hashtable Titles;
- /// (LLUUID,GroupRole) List of all the roles in this group
- public Hashtable Roles;
- /// (LLUUID,GroupMember) List of all the members in this group
- public Hashtable Members;
- /// Used for internal state tracking
- public LLUUID TitlesRequestID;
- /// Used for internal state tracking
- public LLUUID RolesRequestID;
- /// Used for internal state tracking
- public LLUUID MembersRequestID;
-
- public Group(LLUUID id)
- {
- ID = id;
- InsigniaID = new LLUUID();
-
- Titles = new Hashtable();
- Roles = new Hashtable();
- Members = new Hashtable();
-
- TitlesRequestID = new LLUUID();
- RolesRequestID = new LLUUID();
- MembersRequestID = new LLUUID();
- }
-
- public override string ToString()
- {
- return Name;
- }
- }
-
- public class GroupManager
- {
- ///
- /// Called whenever the group membership list is updated
- ///
- ///
- public delegate void GroupsUpdatedCallback();
-
- ///
- public Hashtable Groups;
- private Mutex GroupsMutex;
-
- /// Called whenever the group membership list is updated
- public event GroupsUpdatedCallback OnGroupsUpdated;
-
- private SecondLife Client;
-
- public GroupManager(SecondLife client)
- {
- Groups = new Hashtable();
- GroupsMutex = new Mutex(false, "GroupsMutex");
- Client = client;
-
- Client.Network.RegisterCallback(PacketType.AgentGroupDataUpdate, new PacketCallback(GroupDataHandler));
- Client.Network.RegisterCallback(PacketType.GroupTitlesReply, new PacketCallback(GroupTitlesHandler));
- Client.Network.RegisterCallback(PacketType.GroupProfileReply, new PacketCallback(GroupProfileHandler));
- Client.Network.RegisterCallback(PacketType.GroupMembersReply, new PacketCallback(GroupMembersHandler));
- Client.Network.RegisterCallback(PacketType.GroupRoleDataReply, new PacketCallback(GroupRoleDataHandler));
- Client.Network.RegisterCallback(PacketType.GroupRoleMembersReply, new PacketCallback(GroupRoleMembersHandler));
- Client.Network.RegisterCallback(PacketType.GroupActiveProposalItemReply, new PacketCallback(GroupActiveProposalItemHandler));
- Client.Network.RegisterCallback(PacketType.GroupVoteHistoryItemReply, new PacketCallback(GroupVoteHistoryItemHandler));
- Client.Network.RegisterCallback(PacketType.GroupAccountSummaryReply, new PacketCallback(GroupAccountSummaryHandler));
- Client.Network.RegisterCallback(PacketType.GroupAccountDetailsReply, new PacketCallback(GroupAccountDetailsHandler));
- Client.Network.RegisterCallback(PacketType.GroupAccountTransactionsReply, new PacketCallback(GroupAccountTransactionsHandler));
- }
-
- private void GroupDataHandler(Packet packet, Simulator simulator)
- {
- // FIXME: Add an additional list, such as MyGroups that will distinguish the groups we are
- // actually in versus the ones we are just collecting data on. Or should there be a better
- // way to temporarily collect data for transient requests?
- AgentGroupDataUpdatePacket update = (AgentGroupDataUpdatePacket)packet;
-
- #region GroupsMutex
- GroupsMutex.WaitOne();
-
- // Flush out the groups list
- Groups.Clear();
-
- foreach (AgentGroupDataUpdatePacket.GroupDataBlock block in update.GroupData)
- {
- Group group = new Group(block.GroupID);
-
- group.InsigniaID = block.GroupInsigniaID;
- group.Name = Helpers.FieldToString(block.GroupName);
- group.Powers = block.GroupPowers;
- group.Contribution = block.Contribution;
- group.AcceptNotices = block.AcceptNotices;
-
- Groups[group.ID] = group;
- }
-
- GroupsMutex.ReleaseMutex();
- #endregion GroupsMutex
-
- if (OnGroupsUpdated != null)
- {
- OnGroupsUpdated();
- }
- }
-
- private void GroupTitlesHandler(Packet packet, Simulator simulator)
- {
- Group thisGroup;
- GroupTitlesReplyPacket titles = (GroupTitlesReplyPacket)packet;
-
- #region GroupsMutex
- GroupsMutex.WaitOne();
-
- // Attempt to locate the group that these titles belong to
- if (Groups.ContainsKey(titles.AgentData.GroupID))
- {
- thisGroup = (Group)Groups[titles.AgentData.GroupID];
- }
- else
- {
- // Avoid throwing this data away by creating a new group
- thisGroup = new Group(titles.AgentData.GroupID);
- thisGroup.TitlesRequestID = titles.AgentData.RequestID;
- Groups[titles.AgentData.GroupID] = thisGroup;
- }
-
- if (titles.AgentData.RequestID == thisGroup.TitlesRequestID)
- {
- foreach (GroupTitlesReplyPacket.GroupDataBlock block in titles.GroupData)
- {
- thisGroup.Titles[Helpers.FieldToString(block.Title)] = block.RoleID;
- // TODO: Do something with block.Selected
- }
- }
-
- GroupsMutex.ReleaseMutex();
- #endregion
- }
-
- private void GroupProfileHandler(Packet packet, Simulator simulator)
- {
- Group thisGroup;
- GroupProfileReplyPacket profile = (GroupProfileReplyPacket)packet;
-
- #region GroupsMutex
- GroupsMutex.WaitOne();
-
- // Attempt to locate the group that these titles belong to
- if (Groups.ContainsKey(profile.GroupData.GroupID))
- {
- thisGroup = (Group)Groups[profile.GroupData.GroupID];
- }
- else
- {
- thisGroup = new Group(profile.GroupData.GroupID);
- Groups[profile.GroupData.GroupID] = thisGroup;
- }
-
- thisGroup.AllowPublish = profile.GroupData.AllowPublish;
- thisGroup.Charter = Helpers.FieldToString(profile.GroupData.Charter);
- thisGroup.FounderID = profile.GroupData.FounderID;
- thisGroup.GroupMembershipCount = profile.GroupData.GroupMembershipCount;
- thisGroup.GroupRolesCount = profile.GroupData.GroupRolesCount;
- thisGroup.InsigniaID = profile.GroupData.InsigniaID;
- thisGroup.MaturePublish = profile.GroupData.MaturePublish;
- thisGroup.MembershipFee = profile.GroupData.MembershipFee;
- thisGroup.MemberTitle = Helpers.FieldToString(profile.GroupData.MemberTitle);
- thisGroup.Money = profile.GroupData.Money;
- thisGroup.Name = Helpers.FieldToString(profile.GroupData.Name);
- thisGroup.OpenEnrollment = profile.GroupData.OpenEnrollment;
- thisGroup.OwnerRole = profile.GroupData.OwnerRole;
- thisGroup.Powers = profile.GroupData.PowersMask;
- thisGroup.ShowInList = profile.GroupData.ShowInList;
-
- GroupsMutex.ReleaseMutex();
- #endregion
- }
-
- private void GroupMembersHandler(Packet packet, Simulator simulator)
- {
- Group thisGroup;
- GroupMembersReplyPacket members = (GroupMembersReplyPacket)packet;
-
- #region GroupsMutex
- GroupsMutex.WaitOne();
-
- if (Groups.ContainsKey(members.GroupData.GroupID))
- {
- thisGroup = (Group)Groups[members.GroupData.GroupID];
- }
- else
- {
- thisGroup = new Group(members.GroupData.GroupID);
- Groups[members.GroupData.GroupID] = thisGroup;
- }
-
- if (members.GroupData.RequestID == thisGroup.MembersRequestID)
- {
- foreach (GroupMembersReplyPacket.MemberDataBlock block in members.MemberData)
- {
- GroupMember member = new GroupMember(block.AgentID);
-
- member.Contribution = block.Contribution;
- member.ID = block.AgentID;
- member.IsOwner = block.IsOwner;
- member.OnlineStatus = Helpers.FieldToString(block.OnlineStatus);
- member.Powers = block.AgentPowers;
- member.Title = Helpers.FieldToString(block.Title);
-
- thisGroup.Members[member.ID] = member;
- }
- }
-
- GroupsMutex.ReleaseMutex();
- #endregion
- }
-
- private void GroupRoleDataHandler(Packet packet, Simulator simulator)
- {
- Group thisGroup;
- GroupRole thisRole;
- GroupRoleDataReplyPacket roles = (GroupRoleDataReplyPacket)packet;
-
- #region GroupsMutex
- GroupsMutex.WaitOne();
-
- if (Groups.ContainsKey(roles.GroupData.GroupID))
- {
- thisGroup = (Group)Groups[roles.GroupData.GroupID];
- }
- else
- {
- thisGroup = new Group(roles.GroupData.GroupID);
- Groups[roles.GroupData.GroupID] = thisGroup;
- }
-
- foreach (GroupRoleDataReplyPacket.RoleDataBlock block in roles.RoleData)
- {
- if (thisGroup.Roles.ContainsKey(block.RoleID))
- {
- thisRole = (GroupRole)thisGroup.Roles[block.RoleID];
- }
- else
- {
- thisRole = new GroupRole(block.RoleID);
- thisGroup.Roles[block.RoleID] = thisRole;
- }
-
- thisRole.Description = Helpers.FieldToString(block.Description);
- thisRole.Name = Helpers.FieldToString(block.Name);
- thisRole.Powers = block.Powers;
- thisRole.Title = Helpers.FieldToString(block.Title);
- }
-
- GroupsMutex.ReleaseMutex();
- #endregion
- }
-
- private void GroupRoleMembersHandler(Packet packet, Simulator simulator)
- {
- Group thisGroup;
- GroupRole thisRole;
- GroupMember thisMember;
- GroupRoleMembersReplyPacket members = (GroupRoleMembersReplyPacket)packet;
-
- #region GroupsMutex
- GroupsMutex.WaitOne();
-
- if (Groups.ContainsKey(members.AgentData.GroupID))
- {
- thisGroup = (Group)Groups[members.AgentData.GroupID];
- }
- else
- {
- thisGroup = new Group(members.AgentData.GroupID);
- Groups[members.AgentData.GroupID] = thisGroup;
- }
-
- foreach (GroupRoleMembersReplyPacket.MemberDataBlock block in members.MemberData)
- {
- if (thisGroup.Roles.ContainsKey(block.RoleID))
- {
- thisRole = (GroupRole)thisGroup.Roles[block.RoleID];
- }
- else
- {
- thisRole = new GroupRole(block.RoleID);
- thisGroup.Roles[block.RoleID] = thisRole;
- }
-
- if (thisGroup.Members.ContainsKey(block.MemberID))
- {
- thisMember = (GroupMember)thisGroup.Members[block.MemberID];
- }
- else
- {
- thisMember = new GroupMember(block.MemberID);
- thisGroup.Members[block.MemberID] = thisMember;
- }
-
- // Add this member to this block if it doesn't already exist there
- if (!thisRole.Members.ContainsKey(block.MemberID))
- {
- thisRole.Members[block.MemberID] = thisMember;
- }
- }
-
- GroupsMutex.ReleaseMutex();
- #endregion
- }
-
- private void GroupActiveProposalItemHandler(Packet packet, Simulator simulator)
- {
- ;
- }
-
- private void GroupVoteHistoryItemHandler(Packet packet, Simulator simulator)
- {
- ;
- }
-
- private void GroupAccountSummaryHandler(Packet packet, Simulator simulator)
- {
- ;
- }
-
- private void GroupAccountDetailsHandler(Packet packet, Simulator simulator)
- {
- ;
- }
-
- private void GroupAccountTransactionsHandler(Packet packet, Simulator simulator)
- {
- ;
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections;
+using System.Threading;
+using libsecondlife.Packets;
+
+namespace libsecondlife
+{
+ public class GroupMember
+ {
+ public LLUUID ID;
+ public int Contribution;
+ public string OnlineStatus;
+ public ulong Powers;
+ public string Title;
+ public bool IsOwner;
+
+ public GroupMember(LLUUID id)
+ {
+ ID = id;
+ }
+ }
+
+ public class GroupRole
+ {
+ public LLUUID ID;
+ public string Name;
+ public string Title;
+ public string Description;
+ public ulong Powers;
+ /// (LLUUID,GroupMember) Contains all the group members
+ /// belonging to this role
+ public Hashtable Members;
+
+ public GroupRole(LLUUID id)
+ {
+ ID = id;
+ Members = new Hashtable();
+ }
+ }
+
+ ///
+ /// Represents a group in Second Life
+ ///
+ public class Group
+ {
+ public LLUUID ID;
+ public LLUUID InsigniaID;
+ public LLUUID FounderID;
+ public LLUUID OwnerRole;
+ public string Name;
+ public string Charter;
+ public string MemberTitle;
+ public bool OpenEnrollment;
+ public bool ShowInList;
+ public ulong Powers;
+ public bool AcceptNotices;
+ public bool AllowPublish;
+ public bool MaturePublish;
+ public int MembershipFee;
+ public int Money;
+ public int Contribution;
+ public int GroupMembershipCount;
+ public int GroupRolesCount;
+ /// (LLUUID,?)
+ public Hashtable Titles;
+ /// (LLUUID,GroupRole) List of all the roles in this group
+ public Hashtable Roles;
+ /// (LLUUID,GroupMember) List of all the members in this group
+ public Hashtable Members;
+ /// Used for internal state tracking
+ public LLUUID TitlesRequestID;
+ /// Used for internal state tracking
+ public LLUUID RolesRequestID;
+ /// Used for internal state tracking
+ public LLUUID MembersRequestID;
+
+ public Group(LLUUID id)
+ {
+ ID = id;
+ InsigniaID = new LLUUID();
+
+ Titles = new Hashtable();
+ Roles = new Hashtable();
+ Members = new Hashtable();
+
+ TitlesRequestID = new LLUUID();
+ RolesRequestID = new LLUUID();
+ MembersRequestID = new LLUUID();
+ }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+
+ public class GroupManager
+ {
+ ///
+ /// Called whenever the group membership list is updated
+ ///
+ ///
+ public delegate void GroupsUpdatedCallback();
+
+ ///
+ public Hashtable Groups;
+ private Mutex GroupsMutex;
+
+ /// Called whenever the group membership list is updated
+ public event GroupsUpdatedCallback OnGroupsUpdated;
+
+ private SecondLife Client;
+
+ public GroupManager(SecondLife client)
+ {
+ Groups = new Hashtable();
+ GroupsMutex = new Mutex(false, "GroupsMutex");
+ Client = client;
+
+ Client.Network.RegisterCallback(PacketType.AgentGroupDataUpdate, new PacketCallback(GroupDataHandler));
+ Client.Network.RegisterCallback(PacketType.GroupTitlesReply, new PacketCallback(GroupTitlesHandler));
+ Client.Network.RegisterCallback(PacketType.GroupProfileReply, new PacketCallback(GroupProfileHandler));
+ Client.Network.RegisterCallback(PacketType.GroupMembersReply, new PacketCallback(GroupMembersHandler));
+ Client.Network.RegisterCallback(PacketType.GroupRoleDataReply, new PacketCallback(GroupRoleDataHandler));
+ Client.Network.RegisterCallback(PacketType.GroupRoleMembersReply, new PacketCallback(GroupRoleMembersHandler));
+ Client.Network.RegisterCallback(PacketType.GroupActiveProposalItemReply, new PacketCallback(GroupActiveProposalItemHandler));
+ Client.Network.RegisterCallback(PacketType.GroupVoteHistoryItemReply, new PacketCallback(GroupVoteHistoryItemHandler));
+ Client.Network.RegisterCallback(PacketType.GroupAccountSummaryReply, new PacketCallback(GroupAccountSummaryHandler));
+ Client.Network.RegisterCallback(PacketType.GroupAccountDetailsReply, new PacketCallback(GroupAccountDetailsHandler));
+ Client.Network.RegisterCallback(PacketType.GroupAccountTransactionsReply, new PacketCallback(GroupAccountTransactionsHandler));
+ }
+
+ private void GroupDataHandler(Packet packet, Simulator simulator)
+ {
+ // FIXME: Add an additional list, such as MyGroups that will distinguish the groups we are
+ // actually in versus the ones we are just collecting data on. Or should there be a better
+ // way to temporarily collect data for transient requests?
+ AgentGroupDataUpdatePacket update = (AgentGroupDataUpdatePacket)packet;
+
+ #region GroupsMutex
+ GroupsMutex.WaitOne();
+
+ // Flush out the groups list
+ Groups.Clear();
+
+ foreach (AgentGroupDataUpdatePacket.GroupDataBlock block in update.GroupData)
+ {
+ Group group = new Group(block.GroupID);
+
+ group.InsigniaID = block.GroupInsigniaID;
+ group.Name = Helpers.FieldToString(block.GroupName);
+ group.Powers = block.GroupPowers;
+ group.Contribution = block.Contribution;
+ group.AcceptNotices = block.AcceptNotices;
+
+ Groups[group.ID] = group;
+ }
+
+ GroupsMutex.ReleaseMutex();
+ #endregion GroupsMutex
+
+ if (OnGroupsUpdated != null)
+ {
+ OnGroupsUpdated();
+ }
+ }
+
+ private void GroupTitlesHandler(Packet packet, Simulator simulator)
+ {
+ Group thisGroup;
+ GroupTitlesReplyPacket titles = (GroupTitlesReplyPacket)packet;
+
+ #region GroupsMutex
+ GroupsMutex.WaitOne();
+
+ // Attempt to locate the group that these titles belong to
+ if (Groups.ContainsKey(titles.AgentData.GroupID))
+ {
+ thisGroup = (Group)Groups[titles.AgentData.GroupID];
+ }
+ else
+ {
+ // Avoid throwing this data away by creating a new group
+ thisGroup = new Group(titles.AgentData.GroupID);
+ thisGroup.TitlesRequestID = titles.AgentData.RequestID;
+ Groups[titles.AgentData.GroupID] = thisGroup;
+ }
+
+ if (titles.AgentData.RequestID == thisGroup.TitlesRequestID)
+ {
+ foreach (GroupTitlesReplyPacket.GroupDataBlock block in titles.GroupData)
+ {
+ thisGroup.Titles[Helpers.FieldToString(block.Title)] = block.RoleID;
+ // TODO: Do something with block.Selected
+ }
+ }
+
+ GroupsMutex.ReleaseMutex();
+ #endregion
+ }
+
+ private void GroupProfileHandler(Packet packet, Simulator simulator)
+ {
+ Group thisGroup;
+ GroupProfileReplyPacket profile = (GroupProfileReplyPacket)packet;
+
+ #region GroupsMutex
+ GroupsMutex.WaitOne();
+
+ // Attempt to locate the group that these titles belong to
+ if (Groups.ContainsKey(profile.GroupData.GroupID))
+ {
+ thisGroup = (Group)Groups[profile.GroupData.GroupID];
+ }
+ else
+ {
+ thisGroup = new Group(profile.GroupData.GroupID);
+ Groups[profile.GroupData.GroupID] = thisGroup;
+ }
+
+ thisGroup.AllowPublish = profile.GroupData.AllowPublish;
+ thisGroup.Charter = Helpers.FieldToString(profile.GroupData.Charter);
+ thisGroup.FounderID = profile.GroupData.FounderID;
+ thisGroup.GroupMembershipCount = profile.GroupData.GroupMembershipCount;
+ thisGroup.GroupRolesCount = profile.GroupData.GroupRolesCount;
+ thisGroup.InsigniaID = profile.GroupData.InsigniaID;
+ thisGroup.MaturePublish = profile.GroupData.MaturePublish;
+ thisGroup.MembershipFee = profile.GroupData.MembershipFee;
+ thisGroup.MemberTitle = Helpers.FieldToString(profile.GroupData.MemberTitle);
+ thisGroup.Money = profile.GroupData.Money;
+ thisGroup.Name = Helpers.FieldToString(profile.GroupData.Name);
+ thisGroup.OpenEnrollment = profile.GroupData.OpenEnrollment;
+ thisGroup.OwnerRole = profile.GroupData.OwnerRole;
+ thisGroup.Powers = profile.GroupData.PowersMask;
+ thisGroup.ShowInList = profile.GroupData.ShowInList;
+
+ GroupsMutex.ReleaseMutex();
+ #endregion
+ }
+
+ private void GroupMembersHandler(Packet packet, Simulator simulator)
+ {
+ Group thisGroup;
+ GroupMembersReplyPacket members = (GroupMembersReplyPacket)packet;
+
+ #region GroupsMutex
+ GroupsMutex.WaitOne();
+
+ if (Groups.ContainsKey(members.GroupData.GroupID))
+ {
+ thisGroup = (Group)Groups[members.GroupData.GroupID];
+ }
+ else
+ {
+ thisGroup = new Group(members.GroupData.GroupID);
+ Groups[members.GroupData.GroupID] = thisGroup;
+ }
+
+ if (members.GroupData.RequestID == thisGroup.MembersRequestID)
+ {
+ foreach (GroupMembersReplyPacket.MemberDataBlock block in members.MemberData)
+ {
+ GroupMember member = new GroupMember(block.AgentID);
+
+ member.Contribution = block.Contribution;
+ member.ID = block.AgentID;
+ member.IsOwner = block.IsOwner;
+ member.OnlineStatus = Helpers.FieldToString(block.OnlineStatus);
+ member.Powers = block.AgentPowers;
+ member.Title = Helpers.FieldToString(block.Title);
+
+ thisGroup.Members[member.ID] = member;
+ }
+ }
+
+ GroupsMutex.ReleaseMutex();
+ #endregion
+ }
+
+ private void GroupRoleDataHandler(Packet packet, Simulator simulator)
+ {
+ Group thisGroup;
+ GroupRole thisRole;
+ GroupRoleDataReplyPacket roles = (GroupRoleDataReplyPacket)packet;
+
+ #region GroupsMutex
+ GroupsMutex.WaitOne();
+
+ if (Groups.ContainsKey(roles.GroupData.GroupID))
+ {
+ thisGroup = (Group)Groups[roles.GroupData.GroupID];
+ }
+ else
+ {
+ thisGroup = new Group(roles.GroupData.GroupID);
+ Groups[roles.GroupData.GroupID] = thisGroup;
+ }
+
+ foreach (GroupRoleDataReplyPacket.RoleDataBlock block in roles.RoleData)
+ {
+ if (thisGroup.Roles.ContainsKey(block.RoleID))
+ {
+ thisRole = (GroupRole)thisGroup.Roles[block.RoleID];
+ }
+ else
+ {
+ thisRole = new GroupRole(block.RoleID);
+ thisGroup.Roles[block.RoleID] = thisRole;
+ }
+
+ thisRole.Description = Helpers.FieldToString(block.Description);
+ thisRole.Name = Helpers.FieldToString(block.Name);
+ thisRole.Powers = block.Powers;
+ thisRole.Title = Helpers.FieldToString(block.Title);
+ }
+
+ GroupsMutex.ReleaseMutex();
+ #endregion
+ }
+
+ private void GroupRoleMembersHandler(Packet packet, Simulator simulator)
+ {
+ Group thisGroup;
+ GroupRole thisRole;
+ GroupMember thisMember;
+ GroupRoleMembersReplyPacket members = (GroupRoleMembersReplyPacket)packet;
+
+ #region GroupsMutex
+ GroupsMutex.WaitOne();
+
+ if (Groups.ContainsKey(members.AgentData.GroupID))
+ {
+ thisGroup = (Group)Groups[members.AgentData.GroupID];
+ }
+ else
+ {
+ thisGroup = new Group(members.AgentData.GroupID);
+ Groups[members.AgentData.GroupID] = thisGroup;
+ }
+
+ foreach (GroupRoleMembersReplyPacket.MemberDataBlock block in members.MemberData)
+ {
+ if (thisGroup.Roles.ContainsKey(block.RoleID))
+ {
+ thisRole = (GroupRole)thisGroup.Roles[block.RoleID];
+ }
+ else
+ {
+ thisRole = new GroupRole(block.RoleID);
+ thisGroup.Roles[block.RoleID] = thisRole;
+ }
+
+ if (thisGroup.Members.ContainsKey(block.MemberID))
+ {
+ thisMember = (GroupMember)thisGroup.Members[block.MemberID];
+ }
+ else
+ {
+ thisMember = new GroupMember(block.MemberID);
+ thisGroup.Members[block.MemberID] = thisMember;
+ }
+
+ // Add this member to this block if it doesn't already exist there
+ if (!thisRole.Members.ContainsKey(block.MemberID))
+ {
+ thisRole.Members[block.MemberID] = thisMember;
+ }
+ }
+
+ GroupsMutex.ReleaseMutex();
+ #endregion
+ }
+
+ private void GroupActiveProposalItemHandler(Packet packet, Simulator simulator)
+ {
+ ;
+ }
+
+ private void GroupVoteHistoryItemHandler(Packet packet, Simulator simulator)
+ {
+ ;
+ }
+
+ private void GroupAccountSummaryHandler(Packet packet, Simulator simulator)
+ {
+ ;
+ }
+
+ private void GroupAccountDetailsHandler(Packet packet, Simulator simulator)
+ {
+ ;
+ }
+
+ private void GroupAccountTransactionsHandler(Packet packet, Simulator simulator)
+ {
+ ;
+ }
+ }
+}
diff --git a/libsecondlife-cs/InventorySystem/InventoryBase.cs b/libsecondlife-cs/InventorySystem/InventoryBase.cs
index f69f8c78..2c627c93 100644
--- a/libsecondlife-cs/InventorySystem/InventoryBase.cs
+++ b/libsecondlife-cs/InventorySystem/InventoryBase.cs
@@ -1,57 +1,57 @@
-using System;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-
-namespace libsecondlife.InventorySystem
-{
- ///
- /// Base class for Inventory items
- ///
- abstract public class InventoryBase
- {
- protected InventoryManager iManager;
-
- internal string _Name;
-
- ///
- ///
- ///
- internal InventoryBase(InventoryManager manager)
- {
- if( manager == null )
- {
- throw new Exception( "Inventory Manager cannot be null" );
- }
- iManager = manager;
- }
-
- ///
- /// Output this item as XML
- ///
- /// Include an asset data as well, TRUE/FALSE
- abstract public string toXML(bool outputAssets);
-
- ///
- /// Utility function to simply making text XML safe
- ///
- ///
- protected string xmlSafe(string str)
- {
- if( str != null )
- {
- string clean = str.Replace("&","&");
- clean = clean.Replace("<","<");
- clean = clean.Replace(">",">");
- clean = clean.Replace("'","'");
- clean = clean.Replace("\"",""");
- return clean;
- }
- else
- {
- return "";
- }
- }
-
- }
-}
+using System;
+
+using libsecondlife;
+using libsecondlife.AssetSystem;
+
+namespace libsecondlife.InventorySystem
+{
+ ///
+ /// Base class for Inventory items
+ ///
+ abstract public class InventoryBase
+ {
+ protected InventoryManager iManager;
+
+ internal string _Name;
+
+ ///
+ ///
+ ///
+ internal InventoryBase(InventoryManager manager)
+ {
+ if( manager == null )
+ {
+ throw new Exception( "Inventory Manager cannot be null" );
+ }
+ iManager = manager;
+ }
+
+ ///
+ /// Output this item as XML
+ ///
+ /// Include an asset data as well, TRUE/FALSE
+ abstract public string toXML(bool outputAssets);
+
+ ///
+ /// Utility function to simply making text XML safe
+ ///
+ ///
+ protected string xmlSafe(string str)
+ {
+ if( str != null )
+ {
+ string clean = str.Replace("&","&");
+ clean = clean.Replace("<","<");
+ clean = clean.Replace(">",">");
+ clean = clean.Replace("'","'");
+ clean = clean.Replace("\"",""");
+ return clean;
+ }
+ else
+ {
+ return "";
+ }
+ }
+
+ }
+}
diff --git a/libsecondlife-cs/InventorySystem/InventoryFolder.cs b/libsecondlife-cs/InventorySystem/InventoryFolder.cs
index 152a0b4f..cedddbcb 100644
--- a/libsecondlife-cs/InventorySystem/InventoryFolder.cs
+++ b/libsecondlife-cs/InventorySystem/InventoryFolder.cs
@@ -1,163 +1,163 @@
-using System.Collections;
-using System;
-using libsecondlife;
-
-namespace libsecondlife.InventorySystem
-{
- ///
- /// Summary description for InventoryFolder.
- ///
- public class InventoryFolder : InventoryBase
- {
- public string Name
- {
- get { return _Name; }
- set
- {
- _Name = value;
- base.iManager.FolderRename( this );
- }
- }
-
-
- private LLUUID _FolderID;
- public LLUUID FolderID
- {
- get { return _FolderID; }
- }
-
- private LLUUID _ParentID;
- public LLUUID ParentID
- {
- get { return _ParentID; }
- set
- {
- InventoryFolder ifParent = iManager.getFolder( this.ParentID );
- ifParent.alContents.Remove( this );
-
- ifParent = iManager.getFolder( value );
- ifParent.alContents.Add( this );
-
- this._ParentID = value;
-
- base.iManager.FolderMove( this, value );
- }
- }
-
- internal sbyte _Type;
- public sbyte Type
- {
- get { return _Type; }
- }
-
- public ArrayList alContents = new ArrayList();
-
- internal InventoryFolder( InventoryManager manager ) : base(manager)
- {
- _Name = "";
- _FolderID = new LLUUID();
- _ParentID = new LLUUID();
- _Type = -1;
- }
-
- internal InventoryFolder( InventoryManager manager, String name, LLUUID folderID, LLUUID parentID ) : base(manager)
- {
- this._Name = name;
- this._FolderID = folderID;
- this._ParentID = parentID;
- this._Type = 0;
- }
-
- internal InventoryFolder( InventoryManager manager, String name, LLUUID folderID, LLUUID parentID, sbyte Type ) : base(manager)
- {
- this._Name = name;
- this._FolderID = folderID;
- this._ParentID = parentID;
- this._Type = Type;
- }
-
- internal InventoryFolder( InventoryManager manager, Hashtable htData ) : base(manager)
- {
- this._Name = (string)htData["name"];
- this._FolderID = new LLUUID( (string)htData["folder_id"] );
- this._ParentID = new LLUUID( (string)htData["parent_id"] );
- this._Type = sbyte.Parse( htData["type_default"].ToString() );
- }
-
-
- public InventoryFolder CreateFolder( string name )
- {
- return base.iManager.FolderCreate( name, FolderID );
- }
-
- public void Delete()
- {
- iManager.getFolder( this.ParentID ).alContents.Remove(this);
- iManager.FolderRemove(this);
- }
-
- public void MoveTo( InventoryFolder newParent )
- {
- MoveTo( newParent.FolderID );
- }
-
- public void MoveTo( LLUUID newParentID )
- {
- this.ParentID = newParentID;
- }
-
- public InventoryNotecard NewNotecard( string name, string description, string body )
- {
- return base.iManager.NewNotecard( name, description, body, this.FolderID );
- }
-
- public InventoryImage NewImage( string name, string description, byte[] j2cdata )
- {
- return base.iManager.NewImage( name, description, j2cdata, this.FolderID );
- }
-
- public ArrayList GetItemByName( string name )
- {
- ArrayList items = new ArrayList();
- foreach( InventoryBase ib in alContents )
- {
- if( ib is InventoryFolder )
- {
- items.AddRange( ((InventoryFolder)ib).GetItemByName(name) );
- } else if ( ib is InventoryItem ) {
- if( ((InventoryItem)ib).Name.Equals( name ) )
- {
- items.Add( ib );
- }
- }
- }
-
- return items;
- }
-
- ///
- /// Output this folder as XML
- ///
- /// Include an asset data as well, TRUE/FALSE
- override public string toXML(bool outputAssets)
- {
- string output = "\n";
-
- foreach( Object oContent in alContents )
- {
- output += ((InventoryBase)oContent).toXML( outputAssets );
- }
-
- output += "\n";
-
- return output;
- }
-
- }
-}
+using System.Collections;
+using System;
+using libsecondlife;
+
+namespace libsecondlife.InventorySystem
+{
+ ///
+ /// Summary description for InventoryFolder.
+ ///
+ public class InventoryFolder : InventoryBase
+ {
+ public string Name
+ {
+ get { return _Name; }
+ set
+ {
+ _Name = value;
+ base.iManager.FolderRename( this );
+ }
+ }
+
+
+ private LLUUID _FolderID;
+ public LLUUID FolderID
+ {
+ get { return _FolderID; }
+ }
+
+ private LLUUID _ParentID;
+ public LLUUID ParentID
+ {
+ get { return _ParentID; }
+ set
+ {
+ InventoryFolder ifParent = iManager.getFolder( this.ParentID );
+ ifParent.alContents.Remove( this );
+
+ ifParent = iManager.getFolder( value );
+ ifParent.alContents.Add( this );
+
+ this._ParentID = value;
+
+ base.iManager.FolderMove( this, value );
+ }
+ }
+
+ internal sbyte _Type;
+ public sbyte Type
+ {
+ get { return _Type; }
+ }
+
+ public ArrayList alContents = new ArrayList();
+
+ internal InventoryFolder( InventoryManager manager ) : base(manager)
+ {
+ _Name = "";
+ _FolderID = new LLUUID();
+ _ParentID = new LLUUID();
+ _Type = -1;
+ }
+
+ internal InventoryFolder( InventoryManager manager, String name, LLUUID folderID, LLUUID parentID ) : base(manager)
+ {
+ this._Name = name;
+ this._FolderID = folderID;
+ this._ParentID = parentID;
+ this._Type = 0;
+ }
+
+ internal InventoryFolder( InventoryManager manager, String name, LLUUID folderID, LLUUID parentID, sbyte Type ) : base(manager)
+ {
+ this._Name = name;
+ this._FolderID = folderID;
+ this._ParentID = parentID;
+ this._Type = Type;
+ }
+
+ internal InventoryFolder( InventoryManager manager, Hashtable htData ) : base(manager)
+ {
+ this._Name = (string)htData["name"];
+ this._FolderID = new LLUUID( (string)htData["folder_id"] );
+ this._ParentID = new LLUUID( (string)htData["parent_id"] );
+ this._Type = sbyte.Parse( htData["type_default"].ToString() );
+ }
+
+
+ public InventoryFolder CreateFolder( string name )
+ {
+ return base.iManager.FolderCreate( name, FolderID );
+ }
+
+ public void Delete()
+ {
+ iManager.getFolder( this.ParentID ).alContents.Remove(this);
+ iManager.FolderRemove(this);
+ }
+
+ public void MoveTo( InventoryFolder newParent )
+ {
+ MoveTo( newParent.FolderID );
+ }
+
+ public void MoveTo( LLUUID newParentID )
+ {
+ this.ParentID = newParentID;
+ }
+
+ public InventoryNotecard NewNotecard( string name, string description, string body )
+ {
+ return base.iManager.NewNotecard( name, description, body, this.FolderID );
+ }
+
+ public InventoryImage NewImage( string name, string description, byte[] j2cdata )
+ {
+ return base.iManager.NewImage( name, description, j2cdata, this.FolderID );
+ }
+
+ public ArrayList GetItemByName( string name )
+ {
+ ArrayList items = new ArrayList();
+ foreach( InventoryBase ib in alContents )
+ {
+ if( ib is InventoryFolder )
+ {
+ items.AddRange( ((InventoryFolder)ib).GetItemByName(name) );
+ } else if ( ib is InventoryItem ) {
+ if( ((InventoryItem)ib).Name.Equals( name ) )
+ {
+ items.Add( ib );
+ }
+ }
+ }
+
+ return items;
+ }
+
+ ///
+ /// Output this folder as XML
+ ///
+ /// Include an asset data as well, TRUE/FALSE
+ override public string toXML(bool outputAssets)
+ {
+ string output = "\n";
+
+ foreach( Object oContent in alContents )
+ {
+ output += ((InventoryBase)oContent).toXML( outputAssets );
+ }
+
+ output += "\n";
+
+ return output;
+ }
+
+ }
+}
diff --git a/libsecondlife-cs/InventorySystem/InventoryImage.cs b/libsecondlife-cs/InventorySystem/InventoryImage.cs
index da89320a..6cfa958b 100644
--- a/libsecondlife-cs/InventorySystem/InventoryImage.cs
+++ b/libsecondlife-cs/InventorySystem/InventoryImage.cs
@@ -1,149 +1,149 @@
-using System;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-
-namespace libsecondlife.InventorySystem
-{
- ///
- /// Summary description for InventoryNotecard.
- ///
- public class InventoryImage : InventoryItem
- {
-
- public byte[] J2CData
- {
- get
- {
- if( Asset != null )
- {
- return ((AssetImage)Asset).J2CData;
- }
- else
- {
- if( (AssetID != null) && (AssetID != new LLUUID()) )
- {
- base.iManager.AssetManager.GetInventoryAsset( this );
- return ((AssetImage)Asset).J2CData;
- }
- }
-
- return null;
- }
-
- set
- {
- base._Asset = new AssetImage( LLUUID.GenerateUUID(), value );
- LLUUID TransactionID = base.iManager.AssetManager.UploadAsset( Asset );
- base.SetAssetTransactionIDs( Asset.AssetID, TransactionID );
- }
-
- }
-
- internal InventoryImage( InventoryManager manager, string name, string description, LLUUID folderID, LLUUID uuidOwnerCreater )
- : base(manager, name, description, folderID, 0, 0, uuidOwnerCreater)
- {
-
- }
-
- internal InventoryImage( InventoryManager manager, InventoryItem ii )
- : base( manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID)
- {
- if( (ii.InvType != 0) || (ii.Type != Asset.ASSET_TYPE_IMAGE) )
- {
- throw new Exception("The InventoryItem cannot be converted to a Image/Texture, wrong InvType/Type.");
- }
-
- this.iManager = manager;
- this._Asset = ii._Asset;
- this._AssetID = ii._AssetID;
- this._BaseMask = ii._BaseMask;
- this._CRC = ii._CRC;
- this._CreationDate = ii._CreationDate;
- this._EveryoneMask = ii._EveryoneMask;
- this._Flags = ii._Flags;
- this._GroupID = ii._GroupID;
- this._GroupMask = ii._GroupMask;
- this._GroupOwned = ii._GroupOwned;
- this._InvType = ii._InvType;
- this._NextOwnerMask = ii._NextOwnerMask;
- this._OwnerID = ii._OwnerID;
- this._OwnerMask = ii._OwnerMask;
- this._SalePrice = ii._SalePrice;
- this._SaleType = ii._SaleType;
- this._Type = ii._Type;
- }
-
-
- override internal void SetAssetData( byte[] assetData )
- {
- if( Asset == null )
- {
- if( AssetID != null )
- {
- _Asset = new AssetImage( AssetID, assetData );
- }
- else
- {
- _Asset = new AssetImage( LLUUID.GenerateUUID(), assetData );
- _AssetID = _Asset.AssetID;
- }
- }
- else
- {
- Asset.AssetData = assetData;
- }
-
- }
-
- ///
- /// Output this image as XML
- ///
- /// Include an asset data as well, TRUE/FALSE
- override public string toXML(bool outputAssets)
- {
- string output = "\n";
-
- if( outputAssets )
- {
- output += xmlSafe(base.Asset.AssetDataToString());
- }
-
- output += "";
-
-
- return output;
- }
-
- }
-}
+using System;
+
+using libsecondlife;
+using libsecondlife.AssetSystem;
+
+namespace libsecondlife.InventorySystem
+{
+ ///
+ /// Summary description for InventoryNotecard.
+ ///
+ public class InventoryImage : InventoryItem
+ {
+
+ public byte[] J2CData
+ {
+ get
+ {
+ if( Asset != null )
+ {
+ return ((AssetImage)Asset).J2CData;
+ }
+ else
+ {
+ if( (AssetID != null) && (AssetID != new LLUUID()) )
+ {
+ base.iManager.AssetManager.GetInventoryAsset( this );
+ return ((AssetImage)Asset).J2CData;
+ }
+ }
+
+ return null;
+ }
+
+ set
+ {
+ base._Asset = new AssetImage( LLUUID.GenerateUUID(), value );
+ LLUUID TransactionID = base.iManager.AssetManager.UploadAsset( Asset );
+ base.SetAssetTransactionIDs( Asset.AssetID, TransactionID );
+ }
+
+ }
+
+ internal InventoryImage( InventoryManager manager, string name, string description, LLUUID folderID, LLUUID uuidOwnerCreater )
+ : base(manager, name, description, folderID, 0, 0, uuidOwnerCreater)
+ {
+
+ }
+
+ internal InventoryImage( InventoryManager manager, InventoryItem ii )
+ : base( manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID)
+ {
+ if( (ii.InvType != 0) || (ii.Type != Asset.ASSET_TYPE_IMAGE) )
+ {
+ throw new Exception("The InventoryItem cannot be converted to a Image/Texture, wrong InvType/Type.");
+ }
+
+ this.iManager = manager;
+ this._Asset = ii._Asset;
+ this._AssetID = ii._AssetID;
+ this._BaseMask = ii._BaseMask;
+ this._CRC = ii._CRC;
+ this._CreationDate = ii._CreationDate;
+ this._EveryoneMask = ii._EveryoneMask;
+ this._Flags = ii._Flags;
+ this._GroupID = ii._GroupID;
+ this._GroupMask = ii._GroupMask;
+ this._GroupOwned = ii._GroupOwned;
+ this._InvType = ii._InvType;
+ this._NextOwnerMask = ii._NextOwnerMask;
+ this._OwnerID = ii._OwnerID;
+ this._OwnerMask = ii._OwnerMask;
+ this._SalePrice = ii._SalePrice;
+ this._SaleType = ii._SaleType;
+ this._Type = ii._Type;
+ }
+
+
+ override internal void SetAssetData( byte[] assetData )
+ {
+ if( Asset == null )
+ {
+ if( AssetID != null )
+ {
+ _Asset = new AssetImage( AssetID, assetData );
+ }
+ else
+ {
+ _Asset = new AssetImage( LLUUID.GenerateUUID(), assetData );
+ _AssetID = _Asset.AssetID;
+ }
+ }
+ else
+ {
+ Asset.AssetData = assetData;
+ }
+
+ }
+
+ ///
+ /// Output this image as XML
+ ///
+ /// Include an asset data as well, TRUE/FALSE
+ override public string toXML(bool outputAssets)
+ {
+ string output = "\n";
+
+ if( outputAssets )
+ {
+ output += xmlSafe(base.Asset.AssetDataToString());
+ }
+
+ output += "";
+
+
+ return output;
+ }
+
+ }
+}
diff --git a/libsecondlife-cs/InventorySystem/InventoryItem.cs b/libsecondlife-cs/InventorySystem/InventoryItem.cs
index 7cf5b0cf..4eef489e 100644
--- a/libsecondlife-cs/InventorySystem/InventoryItem.cs
+++ b/libsecondlife-cs/InventorySystem/InventoryItem.cs
@@ -1,504 +1,504 @@
-using System.Collections;
-using System;
-using System.Xml;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-using libsecondlife.Packets;
-
-namespace libsecondlife.InventorySystem
-{
- ///
- /// Base class for most inventory items, providing a lot of general inventory management functions.
- ///
- public class InventoryItem : InventoryBase
- {
- private const uint FULL_MASK_PERMISSIONS = 2147483647;
-
- public string Name
- {
- get{ return base._Name; }
- set
- {
- _Name = value;
- UpdateItem();
- }
- }
-
- internal LLUUID _FolderID = new LLUUID();
- public LLUUID FolderID
- {
- get{ return _FolderID; }
- set
- {
- InventoryFolder iTargetFolder = base.iManager.getFolder( value );
- if( iTargetFolder == null )
- {
- throw new Exception("Target Folder [" + value + "] does not exist.");
- }
-
- base.iManager.getFolder( this.FolderID ).alContents.Remove( this );
- iTargetFolder.alContents.Add( this );
-
- _FolderID = value;
- UpdateItem();
- }
- }
-
- internal LLUUID _ItemID = null;
- public LLUUID ItemID
- {
- set {
- if (_ItemID == null)
- {
- _ItemID = value;
- }
- else
- {
- throw new Exception("You can not change an item's ID once it's been set.");
- }
- }
- get { return _ItemID; }
- }
-
- internal sbyte _InvType = 0;
- public sbyte InvType
- {
- get{ return _InvType; }
- }
-
- internal sbyte _Type = 0;
- public sbyte Type
- {
- get{ return _Type; }
- set
- {
- _Type = value;
- UpdateItem();
- }
- }
-
-
- internal string _Description = "";
- public string Description
- {
- get{ return _Description; }
- set
- {
- _Description = value;
- UpdateItem();
- }
- }
-
- internal uint _CRC = 0;
- public uint CRC
- {
- get { return _CRC; }
- set
- {
- _CRC = value;
- }
- }
-
-
- internal LLUUID _OwnerID = new LLUUID();
- public LLUUID OwnerID
- {
- get { return _OwnerID; }
- }
-
- internal LLUUID _CreatorID = new LLUUID();
- public LLUUID CreatorID
- {
- get { return _CreatorID; }
- }
-
- internal Asset _Asset;
- public Asset Asset
- {
- get {
- if( _Asset != null )
- {
- return _Asset;
- }
- else
- {
- if( (AssetID != null) && (AssetID != new LLUUID()) )
- {
- base.iManager.AssetManager.GetInventoryAsset( this );
- return Asset;
- }
- }
- return null;
- }
- }
-
- internal LLUUID _TransactionID = new LLUUID();
- public LLUUID TransactionID
- {
- get { return _TransactionID; }
- }
-
- internal LLUUID _AssetID = new LLUUID();
- public LLUUID AssetID
- {
- get { return _AssetID; }
- }
-
-
- internal LLUUID _GroupID = new LLUUID();
- public LLUUID GroupID
- {
- get { return _GroupID; }
- set
- {
- _GroupID = value;
- UpdateItem();
- }
- }
-
- internal bool _GroupOwned = false;
- public bool GroupOwned
- {
- get { return _GroupOwned; }
- set
- {
- _GroupOwned = value;
- UpdateItem();
- }
- }
-
- internal int _CreationDate = (int)((TimeSpan)(DateTime.UtcNow - new DateTime(1970, 1, 1))).TotalSeconds;
- public int CreationDate
- {
- get { return _CreationDate; }
- }
-
- internal byte _SaleType = 0;
- public byte SaleType
- {
- get { return _SaleType; }
- set
- {
- _SaleType = value;
- UpdateItem();
- }
- }
-
- internal uint _BaseMask = FULL_MASK_PERMISSIONS;
- public uint BaseMask
- {
- get { return _BaseMask; }
- }
-
- internal int _SalePrice = 0;
- public int SalePrice
- {
- get { return _SalePrice; }
- set
- {
- _SalePrice = value;
- UpdateItem();
- }
- }
-
- internal uint _EveryoneMask = 0;
- public uint EveryoneMask
- {
- get { return _EveryoneMask; }
- set
- {
- _EveryoneMask = value;
- UpdateItem();
- }
- }
-
- internal uint _Flags = 0;
- public uint Flags
- {
- get { return _Flags; }
- set
- {
- _Flags = value;
- UpdateItem();
- }
- }
-
- internal uint _NextOwnerMask = FULL_MASK_PERMISSIONS;
- public uint NextOwnerMask
- {
- get { return _NextOwnerMask; }
- set
- {
- _NextOwnerMask = value;
- UpdateItem();
- }
- }
-
- internal uint _GroupMask = 0;
- public uint GroupMask
- {
- get { return _GroupMask; }
- set
- {
- _GroupMask = value;
- UpdateItem();
- }
- }
-
- internal uint _OwnerMask = FULL_MASK_PERMISSIONS;
- public uint OwnerMask
- {
- get { return _OwnerMask; }
- }
-
-
-
- internal InventoryItem(InventoryManager manager) : base(manager)
- {
- }
-
- internal InventoryItem(InventoryManager manager, InventoryDescendentsPacket.ItemDataBlock itemData)
- : base(manager)
- {
- _Name = System.Text.Encoding.UTF8.GetString(itemData.Name).Trim().Replace("\0", "");
- _Description = System.Text.Encoding.UTF8.GetString(itemData.Description).Trim().Replace("\0", "");
- _CreationDate = itemData.CreationDate;
-
- _InvType = itemData.InvType;
- _Type = itemData.Type;
-
- _AssetID = itemData.AssetID;
- _FolderID = itemData.FolderID;
-
- _GroupOwned = itemData.GroupOwned;
- _GroupID = itemData.GroupID;
- _GroupMask = itemData.GroupMask;
-
- _CreatorID = itemData.CreatorID;
- _OwnerID = itemData.OwnerID;
- _OwnerMask = itemData.OwnerMask;
-
-
- _Flags = itemData.Flags;
- _BaseMask = itemData.BaseMask;
- _EveryoneMask = itemData.EveryoneMask;
- _NextOwnerMask = itemData.NextOwnerMask;
-
- _SaleType = itemData.SaleType;
- _SalePrice = itemData.SalePrice;
-
- _CRC = itemData.CRC;
- }
-
- internal InventoryItem( InventoryManager manager, string name, LLUUID folderID, sbyte invType, sbyte type, LLUUID uuidOwnerCreater ) : base(manager)
- {
- _Name = name;
- _FolderID = folderID;
- _InvType = invType;
- _Type = type;
- _OwnerID = uuidOwnerCreater;
- _CreatorID = uuidOwnerCreater;
-
- UpdateCRC();
- }
-
- internal InventoryItem( InventoryManager manager, string name, string description, LLUUID folderID, sbyte invType, sbyte type, LLUUID uuidOwnerCreater ) : base(manager)
- {
- _Name = name;
- _Description = description;
- _FolderID = folderID;
- _InvType = invType;
- _Type = type;
- _OwnerID = uuidOwnerCreater;
- _CreatorID = uuidOwnerCreater;
-
- UpdateCRC();
- }
-
- ///
- ///
- protected void SetAssetTransactionIDs(LLUUID assetID, LLUUID transactionID)
- {
- _AssetID = assetID;
- _TransactionID = transactionID;
- UpdateItem();
- }
-
- ///
- ///
- ///
- public override bool Equals(object o)
- {
- if( (o is InventoryItem) == false )
- {
- return false;
- }
-
- return this._ItemID == ((InventoryItem)o)._ItemID;
- }
-
- ///
- ///
- public override int GetHashCode()
- {
- return this._ItemID.GetHashCode();
- }
-
- ///
- /// CompareTo provided so that items can be sorted by name
- ///
- ///
- public int CompareTo(object obj)
- {
- if(obj is InventoryBase)
- {
- InventoryBase temp = (InventoryBase) obj;
- return this._Name.CompareTo(temp._Name);
- }
- throw new ArgumentException("object is not an InventoryItem");
- }
-
- private void UpdateItem()
- {
- UpdateCRC();
- base.iManager.ItemUpdate( this );
- }
-
- private void UpdateCRC()
- {
- _CRC = InventoryPacketHelper.InventoryUpdateCRC(this);
- }
-
- ///
- /// Move this item to the target folder
- ///
- ///
- public void MoveTo(InventoryFolder targetFolder)
- {
- this.FolderID = targetFolder.FolderID;
- }
-
- ///
- /// Move this item to the target folder
- ///
- ///
- public void MoveTo(LLUUID targetFolderID)
- {
- this.FolderID = targetFolderID;
- }
-
- ///
- /// If you have Copy permission, a copy is placed in the target folder
- ///
- ///
- public void CopyTo(LLUUID targetFolder)
- {
- base.iManager.ItemCopy( this.ItemID, targetFolder );
- }
-
- ///
- /// Give this item to another agent. If you have Copy permission, a copy will be given
- ///
- ///
- public void GiveTo(LLUUID ToAgentID)
- {
- base.iManager.ItemGiveTo( this, ToAgentID );
- }
-
- ///
- /// Delete this item from Second Life
- ///
- public void Delete()
- {
- base.iManager.getFolder( this.FolderID ).alContents.Remove( this );
- base.iManager.ItemRemove( this );
-
- }
-
- ///
- ///
- ///
- virtual internal void SetAssetData(byte[] assetData)
- {
- if( _Asset == null )
- {
- if( AssetID != null )
- {
- _Asset = new Asset( AssetID, Type, assetData );
- } else {
- _Asset = new Asset( LLUUID.GenerateUUID(), Type, assetData );
- _AssetID = _Asset.AssetID;
- }
- } else {
- _Asset.AssetData = assetData;
- }
- }
-
- ///
- /// Output this item as XML
- ///
- /// Include an asset data as well, TRUE/FALSE
- override public string toXML(bool outputAssets)
- {
- string output = " \n";
-
- return output;
- }
- }
-}
-
-/*
- 1044 ItemData (Variable)
- 0047 GroupOwned (BOOL / 1)
- 0149 CRC (U32 / 1)
- 0159 CreationDate (S32 / 1)
- 0345 SaleType (U8 / 1)
- 0395 BaseMask (U32 / 1)
- 0506 Name (Variable / 1)
- 0562 InvType (S8 / 1)
- 0630 Type (S8 / 1)
- 0680 AssetID (LLUUID / 1)
- 0699 GroupID (LLUUID / 1)
- 0716 SalePrice (S32 / 1)
- 0719 OwnerID (LLUUID / 1)
- 0736 CreatorID (LLUUID / 1)
- 0968 ItemID (LLUUID / 1)
- 1025 FolderID (LLUUID / 1)
- 1084 EveryoneMask (U32 / 1)
- 1101 Description (Variable / 1)
- 1189 Flags (U32 / 1)
- 1348 NextOwnerMask (U32 / 1)
- 1452 GroupMask (U32 / 1)
- 1505 OwnerMask (U32 / 1)
+using System.Collections;
+using System;
+using System.Xml;
+
+using libsecondlife;
+using libsecondlife.AssetSystem;
+using libsecondlife.Packets;
+
+namespace libsecondlife.InventorySystem
+{
+ ///
+ /// Base class for most inventory items, providing a lot of general inventory management functions.
+ ///
+ public class InventoryItem : InventoryBase
+ {
+ private const uint FULL_MASK_PERMISSIONS = 2147483647;
+
+ public string Name
+ {
+ get{ return base._Name; }
+ set
+ {
+ _Name = value;
+ UpdateItem();
+ }
+ }
+
+ internal LLUUID _FolderID = new LLUUID();
+ public LLUUID FolderID
+ {
+ get{ return _FolderID; }
+ set
+ {
+ InventoryFolder iTargetFolder = base.iManager.getFolder( value );
+ if( iTargetFolder == null )
+ {
+ throw new Exception("Target Folder [" + value + "] does not exist.");
+ }
+
+ base.iManager.getFolder( this.FolderID ).alContents.Remove( this );
+ iTargetFolder.alContents.Add( this );
+
+ _FolderID = value;
+ UpdateItem();
+ }
+ }
+
+ internal LLUUID _ItemID = null;
+ public LLUUID ItemID
+ {
+ set {
+ if (_ItemID == null)
+ {
+ _ItemID = value;
+ }
+ else
+ {
+ throw new Exception("You can not change an item's ID once it's been set.");
+ }
+ }
+ get { return _ItemID; }
+ }
+
+ internal sbyte _InvType = 0;
+ public sbyte InvType
+ {
+ get{ return _InvType; }
+ }
+
+ internal sbyte _Type = 0;
+ public sbyte Type
+ {
+ get{ return _Type; }
+ set
+ {
+ _Type = value;
+ UpdateItem();
+ }
+ }
+
+
+ internal string _Description = "";
+ public string Description
+ {
+ get{ return _Description; }
+ set
+ {
+ _Description = value;
+ UpdateItem();
+ }
+ }
+
+ internal uint _CRC = 0;
+ public uint CRC
+ {
+ get { return _CRC; }
+ set
+ {
+ _CRC = value;
+ }
+ }
+
+
+ internal LLUUID _OwnerID = new LLUUID();
+ public LLUUID OwnerID
+ {
+ get { return _OwnerID; }
+ }
+
+ internal LLUUID _CreatorID = new LLUUID();
+ public LLUUID CreatorID
+ {
+ get { return _CreatorID; }
+ }
+
+ internal Asset _Asset;
+ public Asset Asset
+ {
+ get {
+ if( _Asset != null )
+ {
+ return _Asset;
+ }
+ else
+ {
+ if( (AssetID != null) && (AssetID != new LLUUID()) )
+ {
+ base.iManager.AssetManager.GetInventoryAsset( this );
+ return Asset;
+ }
+ }
+ return null;
+ }
+ }
+
+ internal LLUUID _TransactionID = new LLUUID();
+ public LLUUID TransactionID
+ {
+ get { return _TransactionID; }
+ }
+
+ internal LLUUID _AssetID = new LLUUID();
+ public LLUUID AssetID
+ {
+ get { return _AssetID; }
+ }
+
+
+ internal LLUUID _GroupID = new LLUUID();
+ public LLUUID GroupID
+ {
+ get { return _GroupID; }
+ set
+ {
+ _GroupID = value;
+ UpdateItem();
+ }
+ }
+
+ internal bool _GroupOwned = false;
+ public bool GroupOwned
+ {
+ get { return _GroupOwned; }
+ set
+ {
+ _GroupOwned = value;
+ UpdateItem();
+ }
+ }
+
+ internal int _CreationDate = (int)((TimeSpan)(DateTime.UtcNow - new DateTime(1970, 1, 1))).TotalSeconds;
+ public int CreationDate
+ {
+ get { return _CreationDate; }
+ }
+
+ internal byte _SaleType = 0;
+ public byte SaleType
+ {
+ get { return _SaleType; }
+ set
+ {
+ _SaleType = value;
+ UpdateItem();
+ }
+ }
+
+ internal uint _BaseMask = FULL_MASK_PERMISSIONS;
+ public uint BaseMask
+ {
+ get { return _BaseMask; }
+ }
+
+ internal int _SalePrice = 0;
+ public int SalePrice
+ {
+ get { return _SalePrice; }
+ set
+ {
+ _SalePrice = value;
+ UpdateItem();
+ }
+ }
+
+ internal uint _EveryoneMask = 0;
+ public uint EveryoneMask
+ {
+ get { return _EveryoneMask; }
+ set
+ {
+ _EveryoneMask = value;
+ UpdateItem();
+ }
+ }
+
+ internal uint _Flags = 0;
+ public uint Flags
+ {
+ get { return _Flags; }
+ set
+ {
+ _Flags = value;
+ UpdateItem();
+ }
+ }
+
+ internal uint _NextOwnerMask = FULL_MASK_PERMISSIONS;
+ public uint NextOwnerMask
+ {
+ get { return _NextOwnerMask; }
+ set
+ {
+ _NextOwnerMask = value;
+ UpdateItem();
+ }
+ }
+
+ internal uint _GroupMask = 0;
+ public uint GroupMask
+ {
+ get { return _GroupMask; }
+ set
+ {
+ _GroupMask = value;
+ UpdateItem();
+ }
+ }
+
+ internal uint _OwnerMask = FULL_MASK_PERMISSIONS;
+ public uint OwnerMask
+ {
+ get { return _OwnerMask; }
+ }
+
+
+
+ internal InventoryItem(InventoryManager manager) : base(manager)
+ {
+ }
+
+ internal InventoryItem(InventoryManager manager, InventoryDescendentsPacket.ItemDataBlock itemData)
+ : base(manager)
+ {
+ _Name = System.Text.Encoding.UTF8.GetString(itemData.Name).Trim().Replace("\0", "");
+ _Description = System.Text.Encoding.UTF8.GetString(itemData.Description).Trim().Replace("\0", "");
+ _CreationDate = itemData.CreationDate;
+
+ _InvType = itemData.InvType;
+ _Type = itemData.Type;
+
+ _AssetID = itemData.AssetID;
+ _FolderID = itemData.FolderID;
+
+ _GroupOwned = itemData.GroupOwned;
+ _GroupID = itemData.GroupID;
+ _GroupMask = itemData.GroupMask;
+
+ _CreatorID = itemData.CreatorID;
+ _OwnerID = itemData.OwnerID;
+ _OwnerMask = itemData.OwnerMask;
+
+
+ _Flags = itemData.Flags;
+ _BaseMask = itemData.BaseMask;
+ _EveryoneMask = itemData.EveryoneMask;
+ _NextOwnerMask = itemData.NextOwnerMask;
+
+ _SaleType = itemData.SaleType;
+ _SalePrice = itemData.SalePrice;
+
+ _CRC = itemData.CRC;
+ }
+
+ internal InventoryItem( InventoryManager manager, string name, LLUUID folderID, sbyte invType, sbyte type, LLUUID uuidOwnerCreater ) : base(manager)
+ {
+ _Name = name;
+ _FolderID = folderID;
+ _InvType = invType;
+ _Type = type;
+ _OwnerID = uuidOwnerCreater;
+ _CreatorID = uuidOwnerCreater;
+
+ UpdateCRC();
+ }
+
+ internal InventoryItem( InventoryManager manager, string name, string description, LLUUID folderID, sbyte invType, sbyte type, LLUUID uuidOwnerCreater ) : base(manager)
+ {
+ _Name = name;
+ _Description = description;
+ _FolderID = folderID;
+ _InvType = invType;
+ _Type = type;
+ _OwnerID = uuidOwnerCreater;
+ _CreatorID = uuidOwnerCreater;
+
+ UpdateCRC();
+ }
+
+ ///
+ ///
+ protected void SetAssetTransactionIDs(LLUUID assetID, LLUUID transactionID)
+ {
+ _AssetID = assetID;
+ _TransactionID = transactionID;
+ UpdateItem();
+ }
+
+ ///
+ ///
+ ///
+ public override bool Equals(object o)
+ {
+ if( (o is InventoryItem) == false )
+ {
+ return false;
+ }
+
+ return this._ItemID == ((InventoryItem)o)._ItemID;
+ }
+
+ ///
+ ///
+ public override int GetHashCode()
+ {
+ return this._ItemID.GetHashCode();
+ }
+
+ ///
+ /// CompareTo provided so that items can be sorted by name
+ ///
+ ///
+ public int CompareTo(object obj)
+ {
+ if(obj is InventoryBase)
+ {
+ InventoryBase temp = (InventoryBase) obj;
+ return this._Name.CompareTo(temp._Name);
+ }
+ throw new ArgumentException("object is not an InventoryItem");
+ }
+
+ private void UpdateItem()
+ {
+ UpdateCRC();
+ base.iManager.ItemUpdate( this );
+ }
+
+ private void UpdateCRC()
+ {
+ _CRC = InventoryPacketHelper.InventoryUpdateCRC(this);
+ }
+
+ ///
+ /// Move this item to the target folder
+ ///
+ ///
+ public void MoveTo(InventoryFolder targetFolder)
+ {
+ this.FolderID = targetFolder.FolderID;
+ }
+
+ ///
+ /// Move this item to the target folder
+ ///
+ ///
+ public void MoveTo(LLUUID targetFolderID)
+ {
+ this.FolderID = targetFolderID;
+ }
+
+ ///
+ /// If you have Copy permission, a copy is placed in the target folder
+ ///
+ ///
+ public void CopyTo(LLUUID targetFolder)
+ {
+ base.iManager.ItemCopy( this.ItemID, targetFolder );
+ }
+
+ ///
+ /// Give this item to another agent. If you have Copy permission, a copy will be given
+ ///
+ ///
+ public void GiveTo(LLUUID ToAgentID)
+ {
+ base.iManager.ItemGiveTo( this, ToAgentID );
+ }
+
+ ///
+ /// Delete this item from Second Life
+ ///
+ public void Delete()
+ {
+ base.iManager.getFolder( this.FolderID ).alContents.Remove( this );
+ base.iManager.ItemRemove( this );
+
+ }
+
+ ///
+ ///
+ ///
+ virtual internal void SetAssetData(byte[] assetData)
+ {
+ if( _Asset == null )
+ {
+ if( AssetID != null )
+ {
+ _Asset = new Asset( AssetID, Type, assetData );
+ } else {
+ _Asset = new Asset( LLUUID.GenerateUUID(), Type, assetData );
+ _AssetID = _Asset.AssetID;
+ }
+ } else {
+ _Asset.AssetData = assetData;
+ }
+ }
+
+ ///
+ /// Output this item as XML
+ ///
+ /// Include an asset data as well, TRUE/FALSE
+ override public string toXML(bool outputAssets)
+ {
+ string output = " \n";
+
+ return output;
+ }
+ }
+}
+
+/*
+ 1044 ItemData (Variable)
+ 0047 GroupOwned (BOOL / 1)
+ 0149 CRC (U32 / 1)
+ 0159 CreationDate (S32 / 1)
+ 0345 SaleType (U8 / 1)
+ 0395 BaseMask (U32 / 1)
+ 0506 Name (Variable / 1)
+ 0562 InvType (S8 / 1)
+ 0630 Type (S8 / 1)
+ 0680 AssetID (LLUUID / 1)
+ 0699 GroupID (LLUUID / 1)
+ 0716 SalePrice (S32 / 1)
+ 0719 OwnerID (LLUUID / 1)
+ 0736 CreatorID (LLUUID / 1)
+ 0968 ItemID (LLUUID / 1)
+ 1025 FolderID (LLUUID / 1)
+ 1084 EveryoneMask (U32 / 1)
+ 1101 Description (Variable / 1)
+ 1189 Flags (U32 / 1)
+ 1348 NextOwnerMask (U32 / 1)
+ 1452 GroupMask (U32 / 1)
+ 1505 OwnerMask (U32 / 1)
*/
\ No newline at end of file
diff --git a/libsecondlife-cs/InventorySystem/InventoryManager.cs b/libsecondlife-cs/InventorySystem/InventoryManager.cs
index ec21c2b5..6d3f0321 100644
--- a/libsecondlife-cs/InventorySystem/InventoryManager.cs
+++ b/libsecondlife-cs/InventorySystem/InventoryManager.cs
@@ -1,609 +1,609 @@
-/*
- * Copyright (c) 2006, Second Life Reverse Engineering Team
- * All rights reserved.
- *
- * - Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Neither the name of the Second Life Reverse Engineering Team nor the names
- * of its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-using libsecondlife.Packets;
-
-
-namespace libsecondlife.InventorySystem
-{
-
- ///
- /// Summary description for Inventory.
- ///
- public class InventoryManager
- {
- private const bool DEBUG_PACKETS = true;
-
-
- // Reference to the SLClient Library
- private SecondLife slClient;
-
- // Reference to the Asset Manager
- private static AssetManager slAssetManager;
- internal AssetManager AssetManager
- {
- get{ return slAssetManager; }
- }
-
- public InventoryPacketHelper InvPacketHelper = null;
-
- // UUID of Root Inventory Folder
- private LLUUID uuidRootFolder;
-
- // Setup a hashtable to easily lookup folders by UUID
- private Hashtable htFoldersByUUID = new Hashtable();
-
- // Setup a Hashtable to track download progress
- private Hashtable htFolderDownloadStatus;
- private ArrayList alFolderRequestQueue;
-
- // Used to track current item being created
- private InventoryItem iiCreationInProgress;
- private bool ItemCreationInProgress;
-
- private uint LastPacketRecieved;
-
- // Each InventorySystem needs to be initialized with a client and root folder.
- public InventoryManager( SecondLife client, LLUUID rootFolder )
- {
- slClient = client;
- if( slAssetManager == null )
- {
- slAssetManager = new AssetManager( slClient );
- }
-
- InvPacketHelper = new InventoryPacketHelper(slClient.Network.AgentID, slClient.Network.SessionID);
-
- uuidRootFolder = rootFolder;
-
- resetFoldersByUUID();
-
- // Setup the callback for Inventory Downloads
- PacketCallback InventoryDescendentsCallback = new PacketCallback(InventoryDescendentsHandler);
- slClient.Network.RegisterCallback(PacketType.InventoryDescendents, InventoryDescendentsCallback);
-
- // Setup the callback for Inventory Creation Update
- PacketCallback UpdateCreateInventoryItemCallback = new PacketCallback(UpdateCreateInventoryItemHandler);
- slClient.Network.RegisterCallback(PacketType.UpdateCreateInventoryItem, UpdateCreateInventoryItemCallback);
-
- }
-
- // Used primarily for debugging and testing
- public AssetManager getAssetManager()
- {
- Console.WriteLine("It is not recommended that you access the asset manager directly");
- return AssetManager;
- }
-
- private void resetFoldersByUUID()
- {
- // Init folder structure with root
- htFoldersByUUID = new Hashtable();
-
- InventoryFolder ifRootFolder = new InventoryFolder(this, "My Inventory", uuidRootFolder, null);
- htFoldersByUUID[uuidRootFolder] = ifRootFolder;
- }
-
- public InventoryFolder getRootFolder()
- {
- return (InventoryFolder)htFoldersByUUID[uuidRootFolder];
- }
-
- public InventoryFolder getFolder( LLUUID folderID )
- {
- return (InventoryFolder)htFoldersByUUID[folderID];
- }
-
- public InventoryFolder getFolder( String sFolderPath )
- {
- string sSecretConst = "+@#%$#$%^%^%$^$%SV$#%FR$G";
- sFolderPath = sFolderPath.Replace("//",sSecretConst);
-
- if (sFolderPath.StartsWith("/"))
- {
- sFolderPath = sFolderPath.Remove(0, 1);
- }
-
- if (sFolderPath.Length == 0)
- {
- return getRootFolder();
- }
-
- char[] seperators = { '/' };
- string[] sFolderPathParts = sFolderPath.Split(seperators);
-
- for( int i = 0; i 0) || (alFolderRequestQueue.Count > 0) )
- {
- if( htFolderDownloadStatus.Count == 0 )
- {
- DescendentRequest dr = (DescendentRequest)alFolderRequestQueue[0];
- alFolderRequestQueue.RemoveAt(0);
- RequestFolder( dr );
- }
-
- if ((Helpers.GetUnixTime() - LastPacketRecieved) > 10)
- {
- Console.WriteLine("Time-out while waiting for packets (" + (Helpers.GetUnixTime() - LastPacketRecieved) + " seconds since last packet)");
- Console.WriteLine("Current Status:");
-
- // have to make a seperate list otherwise we run into modifying the original array
- // while still enumerating it.
- ArrayList alRestartList = new ArrayList();
-
- if (htFolderDownloadStatus[0] != null)
- {
- Console.WriteLine(htFolderDownloadStatus[0].GetType());
- }
-
- foreach( DescendentRequest dr in htFolderDownloadStatus.Values )
- {
- Console.WriteLine( dr.FolderID + " " + dr.Expected + " / " + dr.Received + " / " + dr.LastReceived );
-
- alRestartList.Add( dr );
- }
-
- LastPacketRecieved = Helpers.GetUnixTime();
- foreach( DescendentRequest dr in alRestartList )
- {
- RequestFolder( dr );
- }
-
- }
- slClient.Tick();
-
- }
- }
-
-
-
- public void UpdateCreateInventoryItemHandler(Packet packet, Simulator simulator)
- {
- if (DEBUG_PACKETS) { Console.WriteLine(packet); }
-
- if (ItemCreationInProgress)
- {
- UpdateCreateInventoryItemPacket reply = (UpdateCreateInventoryItemPacket)packet;
-
- // User internal variable references, so we don't fire off any update code by using the public accessors
-
- iiCreationInProgress._ItemID = reply.InventoryData[0].ItemID;
-
- iiCreationInProgress._GroupOwned = reply.InventoryData[0].GroupOwned;
- iiCreationInProgress._SaleType = reply.InventoryData[0].SaleType;
- iiCreationInProgress._CreationDate = reply.InventoryData[0].CreationDate;
- iiCreationInProgress._BaseMask = reply.InventoryData[0].BaseMask;
-
- iiCreationInProgress._Name = Helpers.FieldToString(reply.InventoryData[0].Name);
- iiCreationInProgress._InvType = reply.InventoryData[0].InvType;
- iiCreationInProgress._Type = reply.InventoryData[0].Type;
- iiCreationInProgress._AssetID = reply.InventoryData[0].AssetID;
- iiCreationInProgress._GroupID = reply.InventoryData[0].GroupID;
- iiCreationInProgress._SalePrice = reply.InventoryData[0].SalePrice;
- iiCreationInProgress._OwnerID = reply.InventoryData[0].OwnerID;
- iiCreationInProgress._CreatorID = reply.InventoryData[0].CreatorID;
- iiCreationInProgress._ItemID = reply.InventoryData[0].ItemID;
- iiCreationInProgress._FolderID = reply.InventoryData[0].FolderID;
- iiCreationInProgress._EveryoneMask = reply.InventoryData[0].EveryoneMask;
- iiCreationInProgress._Description = Helpers.FieldToString(reply.InventoryData[0].Description);
- iiCreationInProgress._NextOwnerMask = reply.InventoryData[0].NextOwnerMask;
- iiCreationInProgress._GroupMask = reply.InventoryData[0].GroupMask;
- iiCreationInProgress._OwnerMask = reply.InventoryData[0].OwnerMask;
-
- // NOT USED YET: iiCreationInProgress._CallbackID = reply.InventoryData[0].CallbackID;
-
- ItemCreationInProgress = false;
- }
- else
- {
- Console.WriteLine(packet);
- throw new Exception("Received a packet for item creation, but no such response was expected. This is probably a bad thing...");
- }
- }
-
-
- public void InventoryDescendentsHandler(Packet packet, Simulator simulator)
- {
- InventoryDescendentsPacket reply = (InventoryDescendentsPacket)packet;
-
- LastPacketRecieved = Helpers.GetUnixTime();
-
- InventoryItem invItem;
- InventoryFolder invFolder;
-
- LLUUID uuidFolderID = new LLUUID();
-
- int iDescendentsExpected = int.MaxValue;
- int iDescendentsReceivedThisBlock = 0;
-
- foreach (InventoryDescendentsPacket.ItemDataBlock itemBlock in reply.ItemData)
- {
- // There is always an item block, even if there isn't any items
- // the "filler" block will not have a name
- if (itemBlock.Name.Length != 0)
- {
- iDescendentsReceivedThisBlock++;
-
- invItem = new InventoryItem(this, itemBlock);
-
- InventoryFolder ifolder = (InventoryFolder)htFoldersByUUID[invItem.FolderID];
-
- if (ifolder.alContents.Contains(invItem) == false)
- {
- if ((invItem.InvType == 7) && (invItem.Type == Asset.ASSET_TYPE_NOTECARD))
- {
- InventoryItem temp = new InventoryNotecard(this, invItem);
- invItem = temp;
- }
-
- if ((invItem.InvType == 0) && (invItem.Type == Asset.ASSET_TYPE_IMAGE))
- {
- InventoryItem temp = new InventoryImage(this, invItem);
- invItem = temp;
- }
-
- ifolder.alContents.Add(invItem);
- }
-
- }
- }
-
-
- foreach (InventoryDescendentsPacket.FolderDataBlock folderBlock in reply.FolderData)
- {
- String name = System.Text.Encoding.UTF8.GetString(folderBlock.Name).Trim().Replace("\0", "");
- LLUUID folderid = folderBlock.FolderID;
- LLUUID parentid = folderBlock.ParentID;
- sbyte type = folderBlock.Type;
-
- // There is always an folder block, even if there isn't any folders
- // the "filler" block will not have a name
- if (folderBlock.Name.Length != 0)
- {
- invFolder = new InventoryFolder(this, name, folderid, parentid);
-
- iDescendentsReceivedThisBlock++;
-
- // Add folder to Parent
- InventoryFolder ifolder = (InventoryFolder)htFoldersByUUID[invFolder.ParentID];
- if( ifolder.alContents.Contains(invFolder) == false )
- {
- ifolder.alContents.Add(invFolder);
- }
-
-
- // Add folder to UUID Lookup
- htFoldersByUUID[invFolder.FolderID] = invFolder;
-
-
- // It's not the root, should be safe to "recurse"
- if( !invFolder.FolderID.Equals( uuidRootFolder ) )
- {
- bool alreadyQueued = false;
- foreach( DescendentRequest dr in alFolderRequestQueue )
- {
- if( dr.FolderID == invFolder.FolderID )
- {
- alreadyQueued = true;
- break;
- }
- }
-
- if( !alreadyQueued )
- {
- alFolderRequestQueue.Add( new DescendentRequest( invFolder.FolderID ) );
- }
- }
- }
- }
-
-
- // Check how many descendents we're actually supposed to receive
- iDescendentsExpected = reply.AgentData.Descendents;
- uuidFolderID = reply.AgentData.FolderID;
-
- // Update download status for this folder
- if( iDescendentsReceivedThisBlock >= iDescendentsExpected )
- {
- // We received all the descendents we're expecting for this folder
- // in this packet, so go ahead and remove folder from status list.
- htFolderDownloadStatus.Remove(uuidFolderID);
- }
- else
- {
-
- // This one packet didn't have all the descendents we're expecting
- // so update the total we're expecting, and update the total downloaded
-
- DescendentRequest dr = (DescendentRequest)htFolderDownloadStatus[uuidFolderID];
- dr.Expected = iDescendentsExpected;
- dr.Received += iDescendentsReceivedThisBlock;
- dr.LastReceived = Helpers.GetUnixTime();
-
- if( dr.Received >= dr.Expected )
- {
- // Looks like after updating, we have all the descendents,
- // remove from folder status.
- htFolderDownloadStatus.Remove(uuidFolderID);
- }
- else
- {
- htFolderDownloadStatus[uuidFolderID] = dr;
-// Console.WriteLine( uuidFolderID + " is expecting " + (iDescendentsExpected - iStatus[1]) + " more packets." );
- }
- }
- }
-
- private class DescendentRequest
- {
- public LLUUID FolderID;
-
- public int Expected = int.MaxValue;
- public int Received = 0;
- public uint LastReceived = 0;
-
- public bool FetchFolders = true;
- public bool FetchItems = true;
-
- public DescendentRequest(LLUUID folderID)
- {
- FolderID = folderID;
- LastReceived = Helpers.GetUnixTime();
- }
-
- public DescendentRequest(LLUUID folderID, bool fetchFolders, bool fetchItems)
- {
- FolderID = folderID;
- FetchFolders = fetchFolders;
- FetchItems = fetchItems;
- LastReceived = Helpers.GetUnixTime();
- }
-
- }
- }
-}
+/*
+ * Copyright (c) 2006, Second Life Reverse Engineering Team
+ * All rights reserved.
+ *
+ * - Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * - Neither the name of the Second Life Reverse Engineering Team nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
+using System.Collections;
+
+using libsecondlife;
+using libsecondlife.AssetSystem;
+using libsecondlife.Packets;
+
+
+namespace libsecondlife.InventorySystem
+{
+
+ ///
+ /// Summary description for Inventory.
+ ///
+ public class InventoryManager
+ {
+ private const bool DEBUG_PACKETS = true;
+
+
+ // Reference to the SLClient Library
+ private SecondLife slClient;
+
+ // Reference to the Asset Manager
+ private static AssetManager slAssetManager;
+ internal AssetManager AssetManager
+ {
+ get{ return slAssetManager; }
+ }
+
+ public InventoryPacketHelper InvPacketHelper = null;
+
+ // UUID of Root Inventory Folder
+ private LLUUID uuidRootFolder;
+
+ // Setup a hashtable to easily lookup folders by UUID
+ private Hashtable htFoldersByUUID = new Hashtable();
+
+ // Setup a Hashtable to track download progress
+ private Hashtable htFolderDownloadStatus;
+ private ArrayList alFolderRequestQueue;
+
+ // Used to track current item being created
+ private InventoryItem iiCreationInProgress;
+ private bool ItemCreationInProgress;
+
+ private uint LastPacketRecieved;
+
+ // Each InventorySystem needs to be initialized with a client and root folder.
+ public InventoryManager( SecondLife client, LLUUID rootFolder )
+ {
+ slClient = client;
+ if( slAssetManager == null )
+ {
+ slAssetManager = new AssetManager( slClient );
+ }
+
+ InvPacketHelper = new InventoryPacketHelper(slClient.Network.AgentID, slClient.Network.SessionID);
+
+ uuidRootFolder = rootFolder;
+
+ resetFoldersByUUID();
+
+ // Setup the callback for Inventory Downloads
+ PacketCallback InventoryDescendentsCallback = new PacketCallback(InventoryDescendentsHandler);
+ slClient.Network.RegisterCallback(PacketType.InventoryDescendents, InventoryDescendentsCallback);
+
+ // Setup the callback for Inventory Creation Update
+ PacketCallback UpdateCreateInventoryItemCallback = new PacketCallback(UpdateCreateInventoryItemHandler);
+ slClient.Network.RegisterCallback(PacketType.UpdateCreateInventoryItem, UpdateCreateInventoryItemCallback);
+
+ }
+
+ // Used primarily for debugging and testing
+ public AssetManager getAssetManager()
+ {
+ Console.WriteLine("It is not recommended that you access the asset manager directly");
+ return AssetManager;
+ }
+
+ private void resetFoldersByUUID()
+ {
+ // Init folder structure with root
+ htFoldersByUUID = new Hashtable();
+
+ InventoryFolder ifRootFolder = new InventoryFolder(this, "My Inventory", uuidRootFolder, null);
+ htFoldersByUUID[uuidRootFolder] = ifRootFolder;
+ }
+
+ public InventoryFolder getRootFolder()
+ {
+ return (InventoryFolder)htFoldersByUUID[uuidRootFolder];
+ }
+
+ public InventoryFolder getFolder( LLUUID folderID )
+ {
+ return (InventoryFolder)htFoldersByUUID[folderID];
+ }
+
+ public InventoryFolder getFolder( String sFolderPath )
+ {
+ string sSecretConst = "+@#%$#$%^%^%$^$%SV$#%FR$G";
+ sFolderPath = sFolderPath.Replace("//",sSecretConst);
+
+ if (sFolderPath.StartsWith("/"))
+ {
+ sFolderPath = sFolderPath.Remove(0, 1);
+ }
+
+ if (sFolderPath.Length == 0)
+ {
+ return getRootFolder();
+ }
+
+ char[] seperators = { '/' };
+ string[] sFolderPathParts = sFolderPath.Split(seperators);
+
+ for( int i = 0; i 0) || (alFolderRequestQueue.Count > 0) )
+ {
+ if( htFolderDownloadStatus.Count == 0 )
+ {
+ DescendentRequest dr = (DescendentRequest)alFolderRequestQueue[0];
+ alFolderRequestQueue.RemoveAt(0);
+ RequestFolder( dr );
+ }
+
+ if ((Helpers.GetUnixTime() - LastPacketRecieved) > 10)
+ {
+ Console.WriteLine("Time-out while waiting for packets (" + (Helpers.GetUnixTime() - LastPacketRecieved) + " seconds since last packet)");
+ Console.WriteLine("Current Status:");
+
+ // have to make a seperate list otherwise we run into modifying the original array
+ // while still enumerating it.
+ ArrayList alRestartList = new ArrayList();
+
+ if (htFolderDownloadStatus[0] != null)
+ {
+ Console.WriteLine(htFolderDownloadStatus[0].GetType());
+ }
+
+ foreach( DescendentRequest dr in htFolderDownloadStatus.Values )
+ {
+ Console.WriteLine( dr.FolderID + " " + dr.Expected + " / " + dr.Received + " / " + dr.LastReceived );
+
+ alRestartList.Add( dr );
+ }
+
+ LastPacketRecieved = Helpers.GetUnixTime();
+ foreach( DescendentRequest dr in alRestartList )
+ {
+ RequestFolder( dr );
+ }
+
+ }
+ slClient.Tick();
+
+ }
+ }
+
+
+
+ public void UpdateCreateInventoryItemHandler(Packet packet, Simulator simulator)
+ {
+ if (DEBUG_PACKETS) { Console.WriteLine(packet); }
+
+ if (ItemCreationInProgress)
+ {
+ UpdateCreateInventoryItemPacket reply = (UpdateCreateInventoryItemPacket)packet;
+
+ // User internal variable references, so we don't fire off any update code by using the public accessors
+
+ iiCreationInProgress._ItemID = reply.InventoryData[0].ItemID;
+
+ iiCreationInProgress._GroupOwned = reply.InventoryData[0].GroupOwned;
+ iiCreationInProgress._SaleType = reply.InventoryData[0].SaleType;
+ iiCreationInProgress._CreationDate = reply.InventoryData[0].CreationDate;
+ iiCreationInProgress._BaseMask = reply.InventoryData[0].BaseMask;
+
+ iiCreationInProgress._Name = Helpers.FieldToString(reply.InventoryData[0].Name);
+ iiCreationInProgress._InvType = reply.InventoryData[0].InvType;
+ iiCreationInProgress._Type = reply.InventoryData[0].Type;
+ iiCreationInProgress._AssetID = reply.InventoryData[0].AssetID;
+ iiCreationInProgress._GroupID = reply.InventoryData[0].GroupID;
+ iiCreationInProgress._SalePrice = reply.InventoryData[0].SalePrice;
+ iiCreationInProgress._OwnerID = reply.InventoryData[0].OwnerID;
+ iiCreationInProgress._CreatorID = reply.InventoryData[0].CreatorID;
+ iiCreationInProgress._ItemID = reply.InventoryData[0].ItemID;
+ iiCreationInProgress._FolderID = reply.InventoryData[0].FolderID;
+ iiCreationInProgress._EveryoneMask = reply.InventoryData[0].EveryoneMask;
+ iiCreationInProgress._Description = Helpers.FieldToString(reply.InventoryData[0].Description);
+ iiCreationInProgress._NextOwnerMask = reply.InventoryData[0].NextOwnerMask;
+ iiCreationInProgress._GroupMask = reply.InventoryData[0].GroupMask;
+ iiCreationInProgress._OwnerMask = reply.InventoryData[0].OwnerMask;
+
+ // NOT USED YET: iiCreationInProgress._CallbackID = reply.InventoryData[0].CallbackID;
+
+ ItemCreationInProgress = false;
+ }
+ else
+ {
+ Console.WriteLine(packet);
+ throw new Exception("Received a packet for item creation, but no such response was expected. This is probably a bad thing...");
+ }
+ }
+
+
+ public void InventoryDescendentsHandler(Packet packet, Simulator simulator)
+ {
+ InventoryDescendentsPacket reply = (InventoryDescendentsPacket)packet;
+
+ LastPacketRecieved = Helpers.GetUnixTime();
+
+ InventoryItem invItem;
+ InventoryFolder invFolder;
+
+ LLUUID uuidFolderID = new LLUUID();
+
+ int iDescendentsExpected = int.MaxValue;
+ int iDescendentsReceivedThisBlock = 0;
+
+ foreach (InventoryDescendentsPacket.ItemDataBlock itemBlock in reply.ItemData)
+ {
+ // There is always an item block, even if there isn't any items
+ // the "filler" block will not have a name
+ if (itemBlock.Name.Length != 0)
+ {
+ iDescendentsReceivedThisBlock++;
+
+ invItem = new InventoryItem(this, itemBlock);
+
+ InventoryFolder ifolder = (InventoryFolder)htFoldersByUUID[invItem.FolderID];
+
+ if (ifolder.alContents.Contains(invItem) == false)
+ {
+ if ((invItem.InvType == 7) && (invItem.Type == Asset.ASSET_TYPE_NOTECARD))
+ {
+ InventoryItem temp = new InventoryNotecard(this, invItem);
+ invItem = temp;
+ }
+
+ if ((invItem.InvType == 0) && (invItem.Type == Asset.ASSET_TYPE_IMAGE))
+ {
+ InventoryItem temp = new InventoryImage(this, invItem);
+ invItem = temp;
+ }
+
+ ifolder.alContents.Add(invItem);
+ }
+
+ }
+ }
+
+
+ foreach (InventoryDescendentsPacket.FolderDataBlock folderBlock in reply.FolderData)
+ {
+ String name = System.Text.Encoding.UTF8.GetString(folderBlock.Name).Trim().Replace("\0", "");
+ LLUUID folderid = folderBlock.FolderID;
+ LLUUID parentid = folderBlock.ParentID;
+ sbyte type = folderBlock.Type;
+
+ // There is always an folder block, even if there isn't any folders
+ // the "filler" block will not have a name
+ if (folderBlock.Name.Length != 0)
+ {
+ invFolder = new InventoryFolder(this, name, folderid, parentid);
+
+ iDescendentsReceivedThisBlock++;
+
+ // Add folder to Parent
+ InventoryFolder ifolder = (InventoryFolder)htFoldersByUUID[invFolder.ParentID];
+ if( ifolder.alContents.Contains(invFolder) == false )
+ {
+ ifolder.alContents.Add(invFolder);
+ }
+
+
+ // Add folder to UUID Lookup
+ htFoldersByUUID[invFolder.FolderID] = invFolder;
+
+
+ // It's not the root, should be safe to "recurse"
+ if( !invFolder.FolderID.Equals( uuidRootFolder ) )
+ {
+ bool alreadyQueued = false;
+ foreach( DescendentRequest dr in alFolderRequestQueue )
+ {
+ if( dr.FolderID == invFolder.FolderID )
+ {
+ alreadyQueued = true;
+ break;
+ }
+ }
+
+ if( !alreadyQueued )
+ {
+ alFolderRequestQueue.Add( new DescendentRequest( invFolder.FolderID ) );
+ }
+ }
+ }
+ }
+
+
+ // Check how many descendents we're actually supposed to receive
+ iDescendentsExpected = reply.AgentData.Descendents;
+ uuidFolderID = reply.AgentData.FolderID;
+
+ // Update download status for this folder
+ if( iDescendentsReceivedThisBlock >= iDescendentsExpected )
+ {
+ // We received all the descendents we're expecting for this folder
+ // in this packet, so go ahead and remove folder from status list.
+ htFolderDownloadStatus.Remove(uuidFolderID);
+ }
+ else
+ {
+
+ // This one packet didn't have all the descendents we're expecting
+ // so update the total we're expecting, and update the total downloaded
+
+ DescendentRequest dr = (DescendentRequest)htFolderDownloadStatus[uuidFolderID];
+ dr.Expected = iDescendentsExpected;
+ dr.Received += iDescendentsReceivedThisBlock;
+ dr.LastReceived = Helpers.GetUnixTime();
+
+ if( dr.Received >= dr.Expected )
+ {
+ // Looks like after updating, we have all the descendents,
+ // remove from folder status.
+ htFolderDownloadStatus.Remove(uuidFolderID);
+ }
+ else
+ {
+ htFolderDownloadStatus[uuidFolderID] = dr;
+// Console.WriteLine( uuidFolderID + " is expecting " + (iDescendentsExpected - iStatus[1]) + " more packets." );
+ }
+ }
+ }
+
+ private class DescendentRequest
+ {
+ public LLUUID FolderID;
+
+ public int Expected = int.MaxValue;
+ public int Received = 0;
+ public uint LastReceived = 0;
+
+ public bool FetchFolders = true;
+ public bool FetchItems = true;
+
+ public DescendentRequest(LLUUID folderID)
+ {
+ FolderID = folderID;
+ LastReceived = Helpers.GetUnixTime();
+ }
+
+ public DescendentRequest(LLUUID folderID, bool fetchFolders, bool fetchItems)
+ {
+ FolderID = folderID;
+ FetchFolders = fetchFolders;
+ FetchItems = fetchItems;
+ LastReceived = Helpers.GetUnixTime();
+ }
+
+ }
+ }
+}
diff --git a/libsecondlife-cs/InventorySystem/InventoryNotecard.cs b/libsecondlife-cs/InventorySystem/InventoryNotecard.cs
index 92367a30..2435d491 100644
--- a/libsecondlife-cs/InventorySystem/InventoryNotecard.cs
+++ b/libsecondlife-cs/InventorySystem/InventoryNotecard.cs
@@ -1,160 +1,160 @@
-using System;
-
-using libsecondlife;
-using libsecondlife.AssetSystem;
-
-namespace libsecondlife.InventorySystem
-{
- ///
- /// Summary description for InventoryNotecard.
- ///
- public class InventoryNotecard : InventoryItem
- {
- public string Body
- {
- get
- {
- if( Asset != null )
- {
- return ((AssetNotecard)Asset).Body;
- } else {
- if( (AssetID != null) && (AssetID != new LLUUID()) )
- {
- base.iManager.AssetManager.GetInventoryAsset( this );
- return ((AssetNotecard)Asset).Body;
- }
- }
-
- return null;
- }
-
- set
- {
- base._Asset = new AssetNotecard( LLUUID.GenerateUUID(), value );
- LLUUID TransactionID = base.iManager.AssetManager.UploadAsset( Asset );
- base.SetAssetTransactionIDs(Asset.AssetID, TransactionID);
- }
- }
-
-
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- internal InventoryNotecard(InventoryManager manager, string name, string description, LLUUID folderID, LLUUID uuidOwnerCreater)
- : base(manager, name, description, folderID, 7, 7, uuidOwnerCreater)
- {
-
- }
-
- ///
- ///
- ///
- ///
- internal InventoryNotecard(InventoryManager manager, InventoryItem ii)
- : base( manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID)
- {
- if( (ii.InvType != 7) || (ii.Type != Asset.ASSET_TYPE_NOTECARD) )
- {
- throw new Exception("The InventoryItem cannot be converted to a Notecard, wrong InvType/Type.");
- }
-
- this.iManager = manager;
- this._Asset = ii._Asset;
- this._AssetID = ii._AssetID;
- this._BaseMask = ii._BaseMask;
- this._CRC = ii._CRC;
- this._CreationDate = ii._CreationDate;
- this._EveryoneMask = ii._EveryoneMask;
- this._Flags = ii._Flags;
- this._GroupID = ii._GroupID;
- this._GroupMask = ii._GroupMask;
- this._GroupOwned = ii._GroupOwned;
- this._InvType = ii._InvType;
- this._NextOwnerMask = ii._NextOwnerMask;
- this._OwnerID = ii._OwnerID;
- this._OwnerMask = ii._OwnerMask;
- this._SalePrice = ii._SalePrice;
- this._SaleType = ii._SaleType;
- this._Type = ii._Type;
- }
-
- ///
- ///
- ///
- override internal void SetAssetData(byte[] assetData)
- {
- if( _Asset == null )
- {
- if( AssetID != null )
- {
- _Asset = new AssetNotecard( AssetID, assetData );
- }
- else
- {
- _Asset = new AssetNotecard( LLUUID.GenerateUUID(), assetData );
- _AssetID = _Asset.AssetID;
- }
- }
- else
- {
- _Asset.AssetData = assetData;
- }
-
- }
-
- ///
- /// Output this item as XML
- ///
- /// Include an asset data as well, TRUE/FALSE
- override public string toXML(bool outputAssets)
- {
- string output = "";
-
- if( outputAssets )
- {
- output += xmlSafe(Body);
- }
-
- output += "";
-
-
- return output;
- }
-
- }
-}
+using System;
+
+using libsecondlife;
+using libsecondlife.AssetSystem;
+
+namespace libsecondlife.InventorySystem
+{
+ ///
+ /// Summary description for InventoryNotecard.
+ ///
+ public class InventoryNotecard : InventoryItem
+ {
+ public string Body
+ {
+ get
+ {
+ if( Asset != null )
+ {
+ return ((AssetNotecard)Asset).Body;
+ } else {
+ if( (AssetID != null) && (AssetID != new LLUUID()) )
+ {
+ base.iManager.AssetManager.GetInventoryAsset( this );
+ return ((AssetNotecard)Asset).Body;
+ }
+ }
+
+ return null;
+ }
+
+ set
+ {
+ base._Asset = new AssetNotecard( LLUUID.GenerateUUID(), value );
+ LLUUID TransactionID = base.iManager.AssetManager.UploadAsset( Asset );
+ base.SetAssetTransactionIDs(Asset.AssetID, TransactionID);
+ }
+ }
+
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ internal InventoryNotecard(InventoryManager manager, string name, string description, LLUUID folderID, LLUUID uuidOwnerCreater)
+ : base(manager, name, description, folderID, 7, 7, uuidOwnerCreater)
+ {
+
+ }
+
+ ///
+ ///
+ ///
+ ///
+ internal InventoryNotecard(InventoryManager manager, InventoryItem ii)
+ : base( manager, ii._Name, ii._Description, ii._FolderID, ii._InvType, ii._Type, ii._CreatorID)
+ {
+ if( (ii.InvType != 7) || (ii.Type != Asset.ASSET_TYPE_NOTECARD) )
+ {
+ throw new Exception("The InventoryItem cannot be converted to a Notecard, wrong InvType/Type.");
+ }
+
+ this.iManager = manager;
+ this._Asset = ii._Asset;
+ this._AssetID = ii._AssetID;
+ this._BaseMask = ii._BaseMask;
+ this._CRC = ii._CRC;
+ this._CreationDate = ii._CreationDate;
+ this._EveryoneMask = ii._EveryoneMask;
+ this._Flags = ii._Flags;
+ this._GroupID = ii._GroupID;
+ this._GroupMask = ii._GroupMask;
+ this._GroupOwned = ii._GroupOwned;
+ this._InvType = ii._InvType;
+ this._NextOwnerMask = ii._NextOwnerMask;
+ this._OwnerID = ii._OwnerID;
+ this._OwnerMask = ii._OwnerMask;
+ this._SalePrice = ii._SalePrice;
+ this._SaleType = ii._SaleType;
+ this._Type = ii._Type;
+ }
+
+ ///
+ ///
+ ///
+ override internal void SetAssetData(byte[] assetData)
+ {
+ if( _Asset == null )
+ {
+ if( AssetID != null )
+ {
+ _Asset = new AssetNotecard( AssetID, assetData );
+ }
+ else
+ {
+ _Asset = new AssetNotecard( LLUUID.GenerateUUID(), assetData );
+ _AssetID = _Asset.AssetID;
+ }
+ }
+ else
+ {
+ _Asset.AssetData = assetData;
+ }
+
+ }
+
+ ///
+ /// Output this item as XML
+ ///
+ /// Include an asset data as well, TRUE/FALSE
+ override public string toXML(bool outputAssets)
+ {
+ string output = "";
+
+ if( outputAssets )
+ {
+ output += xmlSafe(Body);
+ }
+
+ output += "";
+
+
+ return output;
+ }
+
+ }
+}
diff --git a/libsecondlife-cs/InventorySystem/InventoryPacketHelper.cs b/libsecondlife-cs/InventorySystem/InventoryPacketHelper.cs
index d7e3ec5b..b344fd34 100644
--- a/libsecondlife-cs/InventorySystem/InventoryPacketHelper.cs
+++ b/libsecondlife-cs/InventorySystem/InventoryPacketHelper.cs
@@ -1,359 +1,359 @@
-using System;
-using System.Collections;
-
-using libsecondlife;
-using libsecondlife.Packets;
-
-namespace libsecondlife.InventorySystem
-{
- ///
- /// Summary description for Other.
- ///
- public class InventoryPacketHelper
- {
- private LLUUID AgentID;
- private LLUUID SessionID;
-
- public InventoryPacketHelper(LLUUID AgentID, LLUUID SessionID)
- {
- this.AgentID = AgentID;
- this.SessionID = SessionID;
- }
-
- public const int FETCH_INVENTORY_SORT_NAME = 0;
- public const int FETCH_INVENTORY_SORT_TIME = 1;
-
-
- public Packet FetchInventoryDescendents( LLUUID folderID )
- {
- return FetchInventoryDescendents( folderID, true, true );
- }
-
- public Packet FetchInventoryDescendents( LLUUID folderID, bool fetchFolders, bool fetchItems )
- {
- FetchInventoryDescendentsPacket p = new FetchInventoryDescendentsPacket();
- p.InventoryData.OwnerID = AgentID;
- p.InventoryData.FolderID = folderID;
- p.InventoryData.SortOrder = FETCH_INVENTORY_SORT_NAME;
- p.InventoryData.FetchFolders = fetchFolders;
- p.InventoryData.FetchItems = fetchItems;
-
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- return p;
- }
-
- public Packet FetchInventory(LLUUID OwnerID, LLUUID ItemID)
- {
- FetchInventoryPacket p = new FetchInventoryPacket();
- p.InventoryData = new FetchInventoryPacket.InventoryDataBlock[1];
- p.InventoryData[0] = new FetchInventoryPacket.InventoryDataBlock();
- p.InventoryData[0].OwnerID = OwnerID;
- p.InventoryData[0].ItemID = ItemID;
-
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- return p;
- }
-
- public Packet CreateInventoryFolder(
- string name
- , LLUUID parentID
- , sbyte type
- , LLUUID folderID
- )
- {
- CreateInventoryFolderPacket p = new CreateInventoryFolderPacket();
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- p.FolderData.Name = Helpers.StringToField(name);
- p.FolderData.ParentID = parentID;
- p.FolderData.Type = type;
- p.FolderData.FolderID = folderID;
-
- return p;
- }
-
-
-
- public Packet MoveInventoryFolder(
- LLUUID parentID
- , LLUUID folderID
- )
- {
- MoveInventoryFolderPacket p = new MoveInventoryFolderPacket();
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
- p.AgentData.Stamp = false;
-
- p.InventoryData = new MoveInventoryFolderPacket.InventoryDataBlock[1];
- p.InventoryData[0] = new MoveInventoryFolderPacket.InventoryDataBlock();
-
- p.InventoryData[0].ParentID = parentID;
- p.InventoryData[0].FolderID = folderID;
-
- return p;
-
- }
-
-
- public Packet RemoveInventoryFolder(
- LLUUID folderID
- )
- {
- RemoveInventoryFolderPacket p = new RemoveInventoryFolderPacket();
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- p.FolderData = new RemoveInventoryFolderPacket.FolderDataBlock[1];
- p.FolderData[0] = new RemoveInventoryFolderPacket.FolderDataBlock();
-
- p.FolderData[0].FolderID = folderID;
-
- return p;
-
- }
-
-
- public Packet UpdateInventoryFolder(
- string name
- , LLUUID parentID
- , sbyte type
- , LLUUID folderID
- )
- {
- UpdateInventoryFolderPacket p = new UpdateInventoryFolderPacket();
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- p.FolderData = new UpdateInventoryFolderPacket.FolderDataBlock[1];
- p.FolderData[0] = new UpdateInventoryFolderPacket.FolderDataBlock();
-
-
- p.FolderData[0].Name = Helpers.StringToField(name);
- p.FolderData[0].ParentID = parentID;
- p.FolderData[0].Type = type;
- p.FolderData[0].FolderID = folderID;
-
- return p;
-
- }
-
- public Packet MoveInventoryItem(
- LLUUID itemID
- , LLUUID folderID
- )
- {
- MoveInventoryItemPacket p = new MoveInventoryItemPacket();
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
- p.AgentData.Stamp = true;
-
- p.InventoryData = new MoveInventoryItemPacket.InventoryDataBlock[1];
- p.InventoryData[0] = new MoveInventoryItemPacket.InventoryDataBlock();
-
- p.InventoryData[0].ItemID = itemID;
- p.InventoryData[0].FolderID = folderID;
-
- return p;
-
- }
-
- public Packet CopyInventoryItem(
- LLUUID itemID
- , LLUUID folderID
- )
- {
- CopyInventoryItemPacket p = new CopyInventoryItemPacket();
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- p.InventoryData = new CopyInventoryItemPacket.InventoryDataBlock[1];
- p.InventoryData[0] = new CopyInventoryItemPacket.InventoryDataBlock();
-
- p.InventoryData[0].CallbackID = 0;
- p.InventoryData[0].OldAgentID = AgentID; //TODO: Find out what this is supposed to be. Added field 10/11/06, no docs in Message Template
-
- p.InventoryData[0].OldItemID = itemID;
- p.InventoryData[0].NewFolderID = folderID;
-
- return p;
- }
-
- public Packet RemoveInventoryItem(
- LLUUID itemID
- )
- {
- RemoveInventoryItemPacket p = new RemoveInventoryItemPacket();
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- p.InventoryData = new RemoveInventoryItemPacket.InventoryDataBlock[1];
- p.InventoryData[0] = new RemoveInventoryItemPacket.InventoryDataBlock();
-
- p.InventoryData[0].ItemID = itemID;
-
- return p;
-
- }
-
- public Packet ImprovedInstantMessage(
- LLUUID ID
- , LLUUID ToAgentID
- , String FromAgentName
- , LLVector3 FromAgentLoc
- , InventoryItem Item
- )
- {
- byte[] BinaryBucket = new byte[17];
- BinaryBucket[0] = (byte)Item.Type;
- Array.Copy(Item.ItemID.Data, 0, BinaryBucket, 1, 16);
-
- ImprovedInstantMessagePacket p = new ImprovedInstantMessagePacket();
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- p.MessageBlock.ID = ID;
- p.MessageBlock.ToAgentID = ToAgentID;
- p.MessageBlock.Offline = (byte)0;
- p.MessageBlock.Timestamp = Helpers.GetUnixTime();
- p.MessageBlock.Message = Helpers.StringToField(Item.Name);
- p.MessageBlock.Dialog = (byte)4;
- p.MessageBlock.BinaryBucket = BinaryBucket;
- p.MessageBlock.FromAgentName = Helpers.StringToField(FromAgentName);
- p.MessageBlock.Position = FromAgentLoc;
-
- // TODO: Either overload this method to allow inclusion of region info or
- // overload the ImprovedInstantMessage in the avatar class to allow item payloads
- p.MessageBlock.RegionID = new LLUUID();
- p.MessageBlock.ParentEstateID = (uint)0;
-
- return p;
- }
-
-
-
- public Packet CreateInventoryItem(InventoryItem iitem)
- {
- CreateInventoryItemPacket p = new CreateInventoryItemPacket();
-
- p.InventoryBlock.CallbackID = 0;
- p.InventoryBlock.TransactionID = new LLUUID();
-
- p.InventoryBlock.WearableType = 0; //TODO: Specify the current type here
- p.InventoryBlock.Type = iitem.Type;
- p.InventoryBlock.InvType = iitem.InvType;
-
- p.InventoryBlock.Name = Helpers.StringToField(iitem.Name);
- p.InventoryBlock.FolderID = iitem.FolderID;
- p.InventoryBlock.Description = Helpers.StringToField(iitem.Description);
-
- p.InventoryBlock.NextOwnerMask = iitem.NextOwnerMask;
-
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- return p;
-
- }
-
- public Packet UpdateInventoryItem(InventoryItem iitem)
- {
- UpdateInventoryItemPacket p = new UpdateInventoryItemPacket();
- p.InventoryData = new UpdateInventoryItemPacket.InventoryDataBlock[1];
- p.InventoryData[0] = new UpdateInventoryItemPacket.InventoryDataBlock();
-
- p.InventoryData[0].TransactionID = iitem.TransactionID;
-
- p.InventoryData[0].GroupOwned = iitem.GroupOwned;
- p.InventoryData[0].CRC = iitem.CRC;
- p.InventoryData[0].CreationDate = iitem.CreationDate;
- p.InventoryData[0].SaleType = iitem.SaleType;
- p.InventoryData[0].BaseMask = iitem.BaseMask;
- p.InventoryData[0].Name = Helpers.StringToField(iitem.Name);
- p.InventoryData[0].InvType = iitem.InvType;
- p.InventoryData[0].Type = iitem.Type;
- p.InventoryData[0].GroupID = iitem.GroupID;
- p.InventoryData[0].SalePrice = iitem.SalePrice;
- p.InventoryData[0].OwnerID = iitem.OwnerID;
- p.InventoryData[0].CreatorID = iitem.CreatorID;
- p.InventoryData[0].ItemID = iitem.ItemID;
- p.InventoryData[0].FolderID = iitem.FolderID;
- p.InventoryData[0].EveryoneMask = iitem.EveryoneMask;
- p.InventoryData[0].Description = Helpers.StringToField(iitem.Description);
- p.InventoryData[0].Flags = iitem.Flags;
- p.InventoryData[0].NextOwnerMask= iitem.NextOwnerMask;
- p.InventoryData[0].GroupMask = iitem.GroupMask;
- p.InventoryData[0].OwnerMask = iitem.OwnerMask;
-
-
- p.AgentData.AgentID = AgentID;
- p.AgentData.SessionID = SessionID;
-
- return p;
- }
-
-/*
- // Confirm InventoryUpdate CRC
- uint test = libsecondlife.Packets.InventoryPackets.InventoryUpdateCRC
- (
- (int)1159214416
- , (byte)0
- , (sbyte)7
- , (sbyte)7
- , (LLUUID)"00000000000000000000000000000000"
- , (LLUUID)"00000000000000000000000000000000"
- , (int)10
- , (LLUUID)"25472683cb324516904a6cd0ecabf128"
- , (LLUUID)"25472683cb324516904a6cd0ecabf128"
- , (LLUUID)"77364021f09f13dfb692f036be53b9e2"
- , (LLUUID)"a4947fc066c247518d9854aaf90097f4"
- , (uint)0
- , (uint)0
- , (uint)2147483647
- , (uint)0
- , (uint)2147483647
- );
-
- if( test != (uint)895206313 )
- {
- Console.WriteLine("CRC Generation is no longer correct.");
- return;
- }
-*/
-
- public static uint InventoryUpdateCRC(InventoryItem iitem)
- {
- uint CRC = 0;
-
- /* IDs */
- CRC += iitem.AssetID.CRC(); // AssetID
- CRC += iitem.FolderID.CRC(); // FolderID
- CRC += iitem.ItemID==null?new LLUUID().CRC():iitem.ItemID.CRC(); // ItemID
-
- /* Permission stuff */
- CRC += iitem.CreatorID.CRC(); // CreatorID
- CRC += iitem.OwnerID.CRC(); // OwnerID
- CRC += iitem.GroupID.CRC(); // GroupID
-
- /* CRC += another 4 words which always seem to be zero -- unclear if this is a LLUUID or what */
- CRC += iitem.OwnerMask; //owner_mask; // Either owner_mask or next_owner_mask may need to be
- CRC += iitem.NextOwnerMask; //next_owner_mask; // switched with base_mask -- 2 values go here and in my
- CRC += iitem.EveryoneMask; //everyone_mask; // study item, the three were identical.
- CRC += iitem.GroupMask; //group_mask;
-
- /* The rest of the CRC fields */
- CRC += iitem.Flags; // Flags
- CRC += (uint)iitem.InvType; // InvType
- CRC += (uint)iitem.Type; // Type
- CRC += (uint)iitem.CreationDate; // CreationDate
- CRC += (uint)iitem.SalePrice; // SalePrice
- CRC += (uint)((uint)iitem.SaleType * 0x07073096); // SaleType
-
- return CRC;
- }
- }
-}
+using System;
+using System.Collections;
+
+using libsecondlife;
+using libsecondlife.Packets;
+
+namespace libsecondlife.InventorySystem
+{
+ ///
+ /// Summary description for Other.
+ ///
+ public class InventoryPacketHelper
+ {
+ private LLUUID AgentID;
+ private LLUUID SessionID;
+
+ public InventoryPacketHelper(LLUUID AgentID, LLUUID SessionID)
+ {
+ this.AgentID = AgentID;
+ this.SessionID = SessionID;
+ }
+
+ public const int FETCH_INVENTORY_SORT_NAME = 0;
+ public const int FETCH_INVENTORY_SORT_TIME = 1;
+
+
+ public Packet FetchInventoryDescendents( LLUUID folderID )
+ {
+ return FetchInventoryDescendents( folderID, true, true );
+ }
+
+ public Packet FetchInventoryDescendents( LLUUID folderID, bool fetchFolders, bool fetchItems )
+ {
+ FetchInventoryDescendentsPacket p = new FetchInventoryDescendentsPacket();
+ p.InventoryData.OwnerID = AgentID;
+ p.InventoryData.FolderID = folderID;
+ p.InventoryData.SortOrder = FETCH_INVENTORY_SORT_NAME;
+ p.InventoryData.FetchFolders = fetchFolders;
+ p.InventoryData.FetchItems = fetchItems;
+
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ return p;
+ }
+
+ public Packet FetchInventory(LLUUID OwnerID, LLUUID ItemID)
+ {
+ FetchInventoryPacket p = new FetchInventoryPacket();
+ p.InventoryData = new FetchInventoryPacket.InventoryDataBlock[1];
+ p.InventoryData[0] = new FetchInventoryPacket.InventoryDataBlock();
+ p.InventoryData[0].OwnerID = OwnerID;
+ p.InventoryData[0].ItemID = ItemID;
+
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ return p;
+ }
+
+ public Packet CreateInventoryFolder(
+ string name
+ , LLUUID parentID
+ , sbyte type
+ , LLUUID folderID
+ )
+ {
+ CreateInventoryFolderPacket p = new CreateInventoryFolderPacket();
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ p.FolderData.Name = Helpers.StringToField(name);
+ p.FolderData.ParentID = parentID;
+ p.FolderData.Type = type;
+ p.FolderData.FolderID = folderID;
+
+ return p;
+ }
+
+
+
+ public Packet MoveInventoryFolder(
+ LLUUID parentID
+ , LLUUID folderID
+ )
+ {
+ MoveInventoryFolderPacket p = new MoveInventoryFolderPacket();
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+ p.AgentData.Stamp = false;
+
+ p.InventoryData = new MoveInventoryFolderPacket.InventoryDataBlock[1];
+ p.InventoryData[0] = new MoveInventoryFolderPacket.InventoryDataBlock();
+
+ p.InventoryData[0].ParentID = parentID;
+ p.InventoryData[0].FolderID = folderID;
+
+ return p;
+
+ }
+
+
+ public Packet RemoveInventoryFolder(
+ LLUUID folderID
+ )
+ {
+ RemoveInventoryFolderPacket p = new RemoveInventoryFolderPacket();
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ p.FolderData = new RemoveInventoryFolderPacket.FolderDataBlock[1];
+ p.FolderData[0] = new RemoveInventoryFolderPacket.FolderDataBlock();
+
+ p.FolderData[0].FolderID = folderID;
+
+ return p;
+
+ }
+
+
+ public Packet UpdateInventoryFolder(
+ string name
+ , LLUUID parentID
+ , sbyte type
+ , LLUUID folderID
+ )
+ {
+ UpdateInventoryFolderPacket p = new UpdateInventoryFolderPacket();
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ p.FolderData = new UpdateInventoryFolderPacket.FolderDataBlock[1];
+ p.FolderData[0] = new UpdateInventoryFolderPacket.FolderDataBlock();
+
+
+ p.FolderData[0].Name = Helpers.StringToField(name);
+ p.FolderData[0].ParentID = parentID;
+ p.FolderData[0].Type = type;
+ p.FolderData[0].FolderID = folderID;
+
+ return p;
+
+ }
+
+ public Packet MoveInventoryItem(
+ LLUUID itemID
+ , LLUUID folderID
+ )
+ {
+ MoveInventoryItemPacket p = new MoveInventoryItemPacket();
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+ p.AgentData.Stamp = true;
+
+ p.InventoryData = new MoveInventoryItemPacket.InventoryDataBlock[1];
+ p.InventoryData[0] = new MoveInventoryItemPacket.InventoryDataBlock();
+
+ p.InventoryData[0].ItemID = itemID;
+ p.InventoryData[0].FolderID = folderID;
+
+ return p;
+
+ }
+
+ public Packet CopyInventoryItem(
+ LLUUID itemID
+ , LLUUID folderID
+ )
+ {
+ CopyInventoryItemPacket p = new CopyInventoryItemPacket();
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ p.InventoryData = new CopyInventoryItemPacket.InventoryDataBlock[1];
+ p.InventoryData[0] = new CopyInventoryItemPacket.InventoryDataBlock();
+
+ p.InventoryData[0].CallbackID = 0;
+ p.InventoryData[0].OldAgentID = AgentID; //TODO: Find out what this is supposed to be. Added field 10/11/06, no docs in Message Template
+
+ p.InventoryData[0].OldItemID = itemID;
+ p.InventoryData[0].NewFolderID = folderID;
+
+ return p;
+ }
+
+ public Packet RemoveInventoryItem(
+ LLUUID itemID
+ )
+ {
+ RemoveInventoryItemPacket p = new RemoveInventoryItemPacket();
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ p.InventoryData = new RemoveInventoryItemPacket.InventoryDataBlock[1];
+ p.InventoryData[0] = new RemoveInventoryItemPacket.InventoryDataBlock();
+
+ p.InventoryData[0].ItemID = itemID;
+
+ return p;
+
+ }
+
+ public Packet ImprovedInstantMessage(
+ LLUUID ID
+ , LLUUID ToAgentID
+ , String FromAgentName
+ , LLVector3 FromAgentLoc
+ , InventoryItem Item
+ )
+ {
+ byte[] BinaryBucket = new byte[17];
+ BinaryBucket[0] = (byte)Item.Type;
+ Array.Copy(Item.ItemID.Data, 0, BinaryBucket, 1, 16);
+
+ ImprovedInstantMessagePacket p = new ImprovedInstantMessagePacket();
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ p.MessageBlock.ID = ID;
+ p.MessageBlock.ToAgentID = ToAgentID;
+ p.MessageBlock.Offline = (byte)0;
+ p.MessageBlock.Timestamp = Helpers.GetUnixTime();
+ p.MessageBlock.Message = Helpers.StringToField(Item.Name);
+ p.MessageBlock.Dialog = (byte)4;
+ p.MessageBlock.BinaryBucket = BinaryBucket;
+ p.MessageBlock.FromAgentName = Helpers.StringToField(FromAgentName);
+ p.MessageBlock.Position = FromAgentLoc;
+
+ // TODO: Either overload this method to allow inclusion of region info or
+ // overload the ImprovedInstantMessage in the avatar class to allow item payloads
+ p.MessageBlock.RegionID = new LLUUID();
+ p.MessageBlock.ParentEstateID = (uint)0;
+
+ return p;
+ }
+
+
+
+ public Packet CreateInventoryItem(InventoryItem iitem)
+ {
+ CreateInventoryItemPacket p = new CreateInventoryItemPacket();
+
+ p.InventoryBlock.CallbackID = 0;
+ p.InventoryBlock.TransactionID = new LLUUID();
+
+ p.InventoryBlock.WearableType = 0; //TODO: Specify the current type here
+ p.InventoryBlock.Type = iitem.Type;
+ p.InventoryBlock.InvType = iitem.InvType;
+
+ p.InventoryBlock.Name = Helpers.StringToField(iitem.Name);
+ p.InventoryBlock.FolderID = iitem.FolderID;
+ p.InventoryBlock.Description = Helpers.StringToField(iitem.Description);
+
+ p.InventoryBlock.NextOwnerMask = iitem.NextOwnerMask;
+
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ return p;
+
+ }
+
+ public Packet UpdateInventoryItem(InventoryItem iitem)
+ {
+ UpdateInventoryItemPacket p = new UpdateInventoryItemPacket();
+ p.InventoryData = new UpdateInventoryItemPacket.InventoryDataBlock[1];
+ p.InventoryData[0] = new UpdateInventoryItemPacket.InventoryDataBlock();
+
+ p.InventoryData[0].TransactionID = iitem.TransactionID;
+
+ p.InventoryData[0].GroupOwned = iitem.GroupOwned;
+ p.InventoryData[0].CRC = iitem.CRC;
+ p.InventoryData[0].CreationDate = iitem.CreationDate;
+ p.InventoryData[0].SaleType = iitem.SaleType;
+ p.InventoryData[0].BaseMask = iitem.BaseMask;
+ p.InventoryData[0].Name = Helpers.StringToField(iitem.Name);
+ p.InventoryData[0].InvType = iitem.InvType;
+ p.InventoryData[0].Type = iitem.Type;
+ p.InventoryData[0].GroupID = iitem.GroupID;
+ p.InventoryData[0].SalePrice = iitem.SalePrice;
+ p.InventoryData[0].OwnerID = iitem.OwnerID;
+ p.InventoryData[0].CreatorID = iitem.CreatorID;
+ p.InventoryData[0].ItemID = iitem.ItemID;
+ p.InventoryData[0].FolderID = iitem.FolderID;
+ p.InventoryData[0].EveryoneMask = iitem.EveryoneMask;
+ p.InventoryData[0].Description = Helpers.StringToField(iitem.Description);
+ p.InventoryData[0].Flags = iitem.Flags;
+ p.InventoryData[0].NextOwnerMask= iitem.NextOwnerMask;
+ p.InventoryData[0].GroupMask = iitem.GroupMask;
+ p.InventoryData[0].OwnerMask = iitem.OwnerMask;
+
+
+ p.AgentData.AgentID = AgentID;
+ p.AgentData.SessionID = SessionID;
+
+ return p;
+ }
+
+/*
+ // Confirm InventoryUpdate CRC
+ uint test = libsecondlife.Packets.InventoryPackets.InventoryUpdateCRC
+ (
+ (int)1159214416
+ , (byte)0
+ , (sbyte)7
+ , (sbyte)7
+ , (LLUUID)"00000000000000000000000000000000"
+ , (LLUUID)"00000000000000000000000000000000"
+ , (int)10
+ , (LLUUID)"25472683cb324516904a6cd0ecabf128"
+ , (LLUUID)"25472683cb324516904a6cd0ecabf128"
+ , (LLUUID)"77364021f09f13dfb692f036be53b9e2"
+ , (LLUUID)"a4947fc066c247518d9854aaf90097f4"
+ , (uint)0
+ , (uint)0
+ , (uint)2147483647
+ , (uint)0
+ , (uint)2147483647
+ );
+
+ if( test != (uint)895206313 )
+ {
+ Console.WriteLine("CRC Generation is no longer correct.");
+ return;
+ }
+*/
+
+ public static uint InventoryUpdateCRC(InventoryItem iitem)
+ {
+ uint CRC = 0;
+
+ /* IDs */
+ CRC += iitem.AssetID.CRC(); // AssetID
+ CRC += iitem.FolderID.CRC(); // FolderID
+ CRC += iitem.ItemID==null?new LLUUID().CRC():iitem.ItemID.CRC(); // ItemID
+
+ /* Permission stuff */
+ CRC += iitem.CreatorID.CRC(); // CreatorID
+ CRC += iitem.OwnerID.CRC(); // OwnerID
+ CRC += iitem.GroupID.CRC(); // GroupID
+
+ /* CRC += another 4 words which always seem to be zero -- unclear if this is a LLUUID or what */
+ CRC += iitem.OwnerMask; //owner_mask; // Either owner_mask or next_owner_mask may need to be
+ CRC += iitem.NextOwnerMask; //next_owner_mask; // switched with base_mask -- 2 values go here and in my
+ CRC += iitem.EveryoneMask; //everyone_mask; // study item, the three were identical.
+ CRC += iitem.GroupMask; //group_mask;
+
+ /* The rest of the CRC fields */
+ CRC += iitem.Flags; // Flags
+ CRC += (uint)iitem.InvType; // InvType
+ CRC += (uint)iitem.Type; // Type
+ CRC += (uint)iitem.CreationDate; // CreationDate
+ CRC += (uint)iitem.SalePrice; // SalePrice
+ CRC += (uint)((uint)iitem.SaleType * 0x07073096); // SaleType
+
+ return CRC;
+ }
+ }
+}
diff --git a/libsecondlife-cs/JSON/JSONArray.cs b/libsecondlife-cs/JSON/JSONArray.cs
index 9ce043f4..893d9df3 100644
--- a/libsecondlife-cs/JSON/JSONArray.cs
+++ b/libsecondlife-cs/JSON/JSONArray.cs
@@ -1,172 +1,172 @@
-using System;
-using System.Collections;
-using System.Text;
-
-namespace Nii.JSON
-{
- ///
- ///
- /// A JSONArray is an ordered sequence of values. Its external form is a string
- /// wrapped in square brackets with commas between the values. The internal form
- /// is an object having get() and opt() methods for accessing the values by
- /// index, and put() methods for adding or replacing values. The values can be
- /// any of these types: Boolean, JSONArray, JSONObject, Number, String, or the
- /// JSONObject.NULL object.
- ///
- ///
- /// The constructor can convert a JSON external form string into an
- /// internal form Java object. The toString() method creates an external
- /// form string.
- ///
- ///
- /// A get() method returns a value if one can be found, and throws an exception
- /// if one cannot be found. An opt() method returns a default value instead of
- /// throwing an exception, and so is useful for obtaining optional values.
- ///
- ///
- /// The generic get() and opt() methods return an object which you can cast or
- /// query for type. There are also typed get() and opt() methods that do typing
- /// checking and type coersion for you.
- ///
- ///
- /// The texts produced by the toString() methods are very strict.
- /// The constructors are more forgiving in the texts they will accept.
- ///
- ///
- ///
- ///