Compare commits

..

1 Commits

Author SHA1 Message Date
mingchen f51970909b made a copy 2007-06-08 14:21:48 +00:00
2675 changed files with 55147 additions and 696686 deletions

116
.gitignore vendored
View File

@ -1,116 +0,0 @@
.project
.settings
.gitignore
*.csproj
*.csproj.user
*.build
*.mdb
*.mdp
*.mds
*.pdb
*.pidb
*.dll.build
*.dll
*.log
# Ignore .user and .suo files as these are user preference specific
# http://stackoverflow.com/questions/72298/should-i-add-the-visual-studio-suo-and-user-files-to-source-control
*.suo
*.user
*.VisualState.xml
*/*/obj
*/*/*/obj
*/*/*/*/obj
*/*/*/*/*/obj
*/*/*/*/*/*/obj
*/*/*/*/*/*/*/obj
*/*/bin
*/*/*/bin
*/*/*/*/bin
*/*/*/*/*/bin
*/*/*/*/*/*/bin
*/*/*/*/*/*/*/bin
.vs/
addon-modules/
bin/Debug/*.dll
bin/*.dll.mdb
bin/*.db
bin/*.db-journal
bin/addin-db-*
bin/*.dll
bin/OpenSim.vshost.exe.config
bin/OpenSim.32BitLaunch.vshost.exe.config
bin/OpenSim.32BitLaunch.log
UpgradeLog.XML
_UpgradeReport_Files/
bin/ScriptEngines/*-*-*-*-*
bin/ScriptEngines/*.dll
bin/ScriptEngines/*/*.dll
bin/ScriptEngines/*/*.state
bin/*.maddin
bin/*.exe
bin/*.ini
bin/j2kDecodeCache
bin/Physics*
bin/Terrain*
bin/Regions/*
bin/UserAssets
bin/assetcache
bin/maptiles
bin/bakes
bin/estate_settings.xml
bin/config-include/CenomeCache.ini
bin/config-include/FlotsamCache.ini
bin/config-include/GridCommon.ini
bin/config-include/StandaloneCommon.ini
bin/OpenSim.Grid.AssetInventoryServer.log
bin/OpenSim.Grid.AssetServer.log
bin/OpenSim.Grid.GridServer.log
bin/OpenSim.Grid.InventoryServer.log
bin/OpenSim.Grid.MessagingServer.log
bin/OpenSim.Grid.UserServer.log
bin/OpenSim.log
bin/OpenSimStats.log
bin/Robust.log
bin/RobustStats.log
bin/OpenSimConsoleHistory.txt
bin/RobustConsoleHistory.txt
bin/*.Tests.log
bin/*.manifest
bin/crashes/
Examples/*.dll
OpenSim.build
OpenSim.sln
OpenSim.userprefs
Prebuild/Prebuild.build
Prebuild/Prebuild.sln
TestResult.xml
cov/*
OpenSim/OpenSim.userprefs
OpenSim/OpenSim.usertasks
TAGS
*~
Makefile.local
bin/.version
compile.bat
OpenSim/Data/Tests/test-results/
OpenSim/Framework/Serialization/Tests/test-results/
OpenSim/Framework/Servers/Tests/test-results/
OpenSim/Framework/Tests/test-results/
OpenSim/Region/ClientStack/Linden/Caps/test-results/
OpenSim/Region/ClientStack/Linden/UDP/Tests/test-results/
OpenSim/Region/CoreModules/test-results/
OpenSim/Region/Framework/test-results/
OpenSim/Region/OptionalModules/test-results/
OpenSim/Region/Physics/BulletDotNETPlugin/
OpenSim/Region/Physics/Manager/test-results/
OpenSim/Region/Physics/OdePlugin/Tests/test-results/
OpenSim/Region/ScriptEngine/test-results/
OpenSim/Tests/Common/test-results/
OpenSim/Tests/test-results/
test-results/
doc/html
doc/doxygen.error.log
*.patch

View File

@ -1,23 +0,0 @@
^tailor.state.old$
^tailor.state.journal$
\.csproj$
\.csproj\.user$
\.mdp$
\.mds$
\.dll\.build$
^bin/Debug/.+\.dll$
^bin/.+\.db$
^bin/OpenSim\.ini$
^bin/OpenSim\.log$
^bin/estate_settings\.xml$
^bin/Regions
bin/.+\.dll.mdb$
bin/addin-db-
bin/.+\.dll$
bin/.+\.maddin$
Examples/.+\.dll$
^bin/.+\.exe
^(OpenSim|Prebuild)/.+\.(exe|exe\.build|exe\.mdb)$
^OpenSim\.(build|sln)$
^Prebuild/Prebuild\.(build|sln)$
.+~$

View File

@ -1,289 +0,0 @@
<!-- -*- xml -*- -->
<!-- please leave the top comment for us emacs folks -->
<property name="nunitcmd" value="nunit-console" />
<!-- This target produces a source distribution of OpenSimulator -->
<!-- TODO: A few parameters still need to be tweaked after running this - need to do this automatically with sed or similar -->
<target name="distsrc">
<copy file="bin/OpenSim.ini.example" tofile="bin/OpenSim.ini"/>
<copy file="bin/config-include/StandaloneCommon.ini.example" tofile="bin/config-include/StandaloneCommon.ini"/>
<copy file="bin/config-include/FlotsamCache.ini.example" tofile="bin/config-include/FlotsamCache.ini"/>
<!-- delete files generated by runprebuild.sh which had to be run in order to generate the build file for this target-->
<delete>
<fileset basedir="OpenSim">
<include name="**/*.build"/>
<include name="**/*.csproj*"/>
<include name="**/*.dll.build"/>
<include name="**/*.pidb"/>
<exclude name="Tools/OpenSim.32BitLaunch/**"/>
<exclude name="Tools/Robust.32BitLaunch/**"/>
<exclude name="Tools/LaunchSLClient/**"/>
</fileset>
</delete>
<delete>
<fileset>
<include name="OpenSim.build"/>
<include name="OpenSim.sln"/>
</fileset>
</delete>
</target>
<property name="distbindir" value="distbin" />
<!-- This target produces a binary directory called distbin/ in OpenSim/bin which contains everything needed for binary distribution -->
<!-- For safety/laziness sake, we're going to take the approach of deleting known extraneous files here rather than
trying to copy across only the essential ones -->
<target name="distbin">
<delete dir="${distbindir}"/>
<copy todir="${distbindir}">
<fileset>
<include name="**"/>
</fileset>
</copy>
<delete dir="${distbindir}/OpenSim"/>
<delete dir="${distbindir}/Prebuild"/>
<delete dir="${distbindir}/%temp%"/>
<delete dir="${distbindir}/.nant"/>
<delete dir="${distbindir}/ThirdParty"/>
<delete>
<fileset basedir="${distbindir}">
<include name="compile.bat"/>
<include name="BUILDING.md"/>
<include name="Makefile"/>
<include name="nant-color"/>
<include name="OpenSim.*"/>
<include name="prebuild.xml"/>
<include name="runprebuild*"/>
<include name="TESTING.txt"/>
<include name="TestResult.xml"/>
<include name="bin/OpenSim.Server.ini"/>
<include name="bin/Regions/Regions.ini"/>
<include name="bin/*.db"/>
<include name="**/.git/**"/>
<include name=".gitignore"/>
<include name=".hgignore"/>
</fileset>
</delete>
</target>
<target name="test" depends="build, find-nunit">
<setenv name="MONO_THREADS_PER_CPU" value="100" />
<!-- Unit Test Assembly -->
<!-- if you want to add more unit tests it's important that you add
the assembly here as an exec, and you add the fail clause later.
This lets all the unit tests run and tells you if they fail at the
end, instead of stopping short -->
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.tests">
<arg value="./bin/OpenSim.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.framework.tests">
<arg value="./bin/OpenSim.Framework.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.framework.servers.tests">
<arg value="./bin/OpenSim.Framework.Servers.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.servers.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.framework.serialization.tests">
<arg value="./bin/OpenSim.Framework.Serialization.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.serialization.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.clientstack.lindencaps.tests">
<arg value="./bin/OpenSim.Region.ClientStack.LindenCaps.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.clientstack.lindencaps.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.clientstack.lindenudp.tests">
<arg value="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.clientstack.lindenudp.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.scriptengine.tests">
<arg value="./bin/OpenSim.Region.ScriptEngine.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.scriptengine.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.coremodules.tests">
<arg value="./bin/OpenSim.Region.CoreModules.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.coremodules.tests)==0}" />
<!--
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.optionalmodules.tests">
<arg value="./bin/OpenSim.Region.OptionalModules.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.optionalmodules.tests)==0}" />
-->
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.framework.tests">
<arg value="./bin/OpenSim.Region.Framework.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.framework.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.data.tests">
<arg value="./bin/OpenSim.Data.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.capabilities.handlers.tests">
<arg value="./bin/OpenSim.Capabilities.Handlers.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.capabilities.handlers.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.server.handlers.tests">
<arg value="./bin/OpenSim.Server.Handlers.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.server.handlers.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.services.inventoryservice.tests">
<arg value="./bin/OpenSim.Services.InventoryService.Tests.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.services.inventoryservice.tests)==0}" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.tests.permissions">
<arg value="./bin/OpenSim.Tests.Permissions.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests.permissions)==0}" />
<delete dir="%temp%"/>
</target>
<target name="test-stress" depends="build, find-nunit">
<setenv name="MONO_THREADS_PER_CPU" value="100" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.tests.stress">
<arg value="./bin/OpenSim.Tests.Stress.dll" />
</exec>
<fail message="Failures reported in stress tests." unless="${int::parse(testresult.opensim.tests.stress)==0}" />
<delete dir="%temp%"/>
</target>
<target name="test-perf" depends="build, find-nunit">
<setenv name="MONO_THREADS_PER_CPU" value="100" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.tests.performance">
<arg value="./bin/OpenSim.Tests.Performance.dll" />
</exec>
<fail message="Failures reported in performance tests." unless="${int::parse(testresult.opensim.tests.performance)==0}" />
<delete dir="%temp%"/>
</target>
<target name="find-nunit">
<exec program="which" failonerror="false"
resultproperty="hasnunit2">
<arg value="nunit-console2" />
</exec>
<property name="nunitcmd" value="nunit-console2"
if="${int::parse(hasnunit2)==0}" />
<property name="nunitcmd" value="nunit-console"
if="${int::parse(hasnunit2)==1}" />
</target>
<!-- this is used for panda test execution -->
<!-- work in progress -->
<target name="test-xml" depends="build, find-nunit">
<mkdir dir="test-results" failonerror="false" />
<!-- Unit Test Assembly -->
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.tests">
<arg value="./bin/OpenSim.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.framework.tests">
<arg value="./bin/OpenSim.Framework.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Framework.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.framework.serialization.tests">
<arg value="./bin/OpenSim.Framework.Serialization.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Framework.Serialization.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.framework.servers.tests">
<arg value="./bin/OpenSim.Framework.Servers.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Framework.Servers.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.clientstack.lindencaps.tests">
<arg value="./bin/OpenSim.Region.ClientStack.LindenCaps.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Region.ClientStack.LindenCaps.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.clientstack.lindenudp.tests">
<arg value="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Region.ClientStack.LindenUDP.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.scriptengine.tests">
<arg value="./bin/OpenSim.Region.ScriptEngine.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Region.ScriptEngine.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.coremodules.tests">
<arg value="./bin/OpenSim.Region.CoreModules.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Region.CoreModules.Tests.dll-Results.xml" />
</exec>
<!--
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.optionalmodules.tests">
<arg value="./bin/OpenSim.Region.OptionalModules.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Region.OptionalModules.Tests.dll-Results.xml" />
</exec>
-->
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.framework.tests">
<arg value="./bin/OpenSim.Region.Framework.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Region.Framework.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.data.tests">
<arg value="./bin/OpenSim.Data.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Data.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.capabilities.handlers.tests">
<arg value="./bin/OpenSim.Capabilities.Handlers.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Capabilities.Handlers.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.server.handlers.tests">
<arg value="./bin/OpenSim.Server.Handlers.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Server.Handlers.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.services.inventoryservice.tests">
<arg value="./bin/OpenSim.Services.InventoryService.Tests.dll" />
<arg value="-xml=test-results/OpenSim.Services.InventoryService.Tests.dll-Results.xml" />
</exec>
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.tests.permissions">
<arg value="./bin/OpenSim.Tests.Permissions.dll" />
<arg value="-xml=test-results/OpenSim.Tests.Permissions.dll-Results.xml" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.servers.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.clientstack.lindenudp.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.scriptengine.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.coremodules.tests)==0}" />
<!-- <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.optionalmodules.tests)==0}" /> -->
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.framework.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.capabilities.handlers.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.services.inventoryservice.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests.permissions)==0}" />
</target>
<target name="doxygen">
<exec program="doxygen" workingdir="doc" commandline="doxygen.conf" />
</target>

View File

@ -1,37 +0,0 @@
# Building on Windows
Steps:
* runprebuild.bat
* Load OpenSim.sln into Visual Studio .NET and build the solution.
* chdir bin
* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include
* run OpenSim.exe
# Building on Linux / Mac
Prereqs:
* Mono > 5.0
* On some Linux distributions you may need to install additional packages.
* msbuild or xbuild if still supported by the mono version
* See http://opensimulator.org/wiki/Dependencies for more information.
From the distribution type:
* ./runprebuild.sh
* type msbuild or xbuild
* cd bin
* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include
* review and change those ini files according to your needs
* windows: execute opensim.exe or opensim32.exe for small regions
* linux: run ./opensim.sh
* msbuild (xbuild) option switches
* clean: msbuild /target:clean
* debug: (default) msbuild /property:Configuration=Debug
* release: msbuild /property:Configuration=Release
# References
Helpful resources:
* http://opensimulator.org/wiki/Build_Instructions

View File

@ -1,254 +0,0 @@
The following people have contributed to OpenSim (Thank you for your effort!)
= Current OpenSim Developers (in very rough order of appearance) =
These folks represent the current core team for OpenSim, and are the
people that make the day to day of OpenSim happen.
* Melanie Thielker
* Diva (Crista Lopes, University of California, Irvine)
* Robert Adams (MisterBlue)
* Kevin Cozens
* Leal Duarte (Ubit Umarov)
= Core Developers Following the White Rabbit =
Core developers who have temporarily (we hope) gone chasing the white rabbit.
They are in all similar to the active core developers, except that they haven't
been that active lately, so their voting rights are awaiting their come back.
* Nebadon Izumi (Michael Cerquoni, OSgrid)
* Alicia Raven
= Past Open Sim Developers =
These folks are alumns of the OpenSim core group, but are now
currently not active. Their great contributions helped get us to
where we are today.
* Gareth
* Andy-
* MorphW
* CW
* Babblefrog
* Danx0r
* Dalien
* Darok
* Alondria
* Sean Dague / sdague (IBM)
* Tedd
* MingChen (DeepThink Pty Ltd)
* adjohn (Genkii)
* idb (Ian Brown)
* Johan Berntsson (3Di)
* MW (Tribal Media AB)
* Adam Frisby (DeepThink Pty Ltd)
* lbsa71 (Tribal Media AB)
* Ckrinke (Charles Krinke)
* Dr Scofield aka Dirk Husemann (IBM Research - Zurich)
* mikem (3Di)
* Homer_Horwitz
* nlin (3Di)
* John Hurliman
* chi11ken (Genkii)
* dahlia
* justincc (OSVW Consulting, justincc.org)
* Arthur Rodrigo S Valadares (IBM)
* BlueWall (James Hughes)
* Dan Lake
* Marck
* Mic Bowman
* Oren Hurvitz (Kitely)
* Snoopy Pfeffer
* Teravus (w3z)
= Additional OpenSim Contributors =
These folks have contributed code patches or content to OpenSimulator to help make it
what it is today.
* A_Biondi
* aduffy70
* Ai Austin
* alex_carnell
* Alan Webb (IBM)
* Aleric
* Allen Kerensky
* BigFootAg
* Bill Blight
* BlueWall Slade
* bobshaffer2
* brianw/Sir_Ahzz
* CharlieO
* ChrisDown
* Chris Yeoh (IBM)
* cinderblocks
* controlbreak
* coyled
* ctrlaltdavid (David Rowe)
* Daedius
* daTwitch
* Dev Random
* devalnor-#708
* dmiles (Daxtron Labs)
* Dong Jun Lan (IBM)
* DoranZemlja
* Drake Arconis
* dr0b3rts
* dslake
* eeyore
* FredoChaplin
* FreakyTech
* Garmin Kawaguichi
* Gavin Hird
* Gerhard
* Godfrey
* Greg C.
* Grumly57
* GuduleLapointe
* Ewe Loon
* Fernando Oliveira
* Fly-Man
* Flyte Xevious
* Freaky Tech
* Garmin Kawaguichi
* Geir Noklebye
* Glenn Martin (MOSES)
* Gryc Ueusp
* H-H-H (ginge264)
* Hiro Lecker
* Iain Oliver
* Imaze Rhiano
* Intimidated
* Jak Daniels
* Jeff Kelly
* Jeremy Bongio (IBM)
* jhurliman
* John R Sohn (XenReborn)
* jonc
* Jon Cundill
* Junta Kohime
* Kayne
* kinoc (Daxtron Labs)
* Kira
* Kitto Flora
* KittyLiu
* Kurt Taylor (IBM)
* Lani Global
* lickx
* lillith_xue
* lkalif
* LuciusSirnah
* lulurun
* M.Igarashi
* Magnuz Binder
* maimedleech
* Mana Janus
* Mandarinka Tasty
* MarcelEdward
* Matt Lehmann
* mewtwo0641
* Mic Bowman
* Michelle Argus
* Michael Cortez (The Flotsam Project, http://osflotsam.org/)
* Michael Heilmann (MOSES)
* Micheil Merlin
* Mike Osias (IBM)
* Mike Pitman (IBM)
* Mike Rieker (Dreamnation)
* mikemig
* mikkopa/_someone - RealXtend
* Misterblue
* Mircea Kitsune
* mpallari
* MrMonkE
* Nebadon Izumi (Michael Cerquoni - http://OSgrid.org)
* Neil Canham
* nornalbion
* Omar Vera Ustariz (IBM)
* openlifegrid.com
* otakup0pe
* Pixel Tomsen
* Quill Littlefeather
* ralphos
* RemedyTomm
* Revolution
* Richard Alimi (IBM)
* Rick Alther (IBM)
* Rob Smart (IBM)
* Robert Louden (MOSES)
* Roger Kirkman (zadark)
* rtomita
* Ruud Lathorp
* SachaMagne
* Salahzar Stenvaag
* satguru p srivastava
* sempuki
* Shy Robbiani
* SignpostMarv
* SpotOn3D
* Stefan_Boom / stoehr
* Steven Zielinski (MOSES)
* Stolen Ruby
* Strawberry Fride
* Talun
* TechplexEngineer (Blake Bourque)
* TBG Renfold
* Terry Ford
* tglion
* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud)
* TomDataWorks
* TomTheDragon (muckwaddle)
* tyre
* uriesk
* Vegaslon <vegaslon@gmail.com>
* Vincent Sylvester
* VikingErik
* Vytek
* webmage (IBM)
* Xantor
* Y. Nitta
* YoshikoFazuku
* YZh
* Zackary Geers aka Kunnis Basiat
* Zha Ewry
* ziah
= LSL Devs =
* Alondria
* CharlieO
* Tedd
* Melanie Thielker
= Testers =
* Ai Austin
* CharlieO (LSL)
* Ckrinke
* openlifegrid.com
This software uses components from the following developers:
* Sleepycat Software (Berkeley DB)
* Aurora-Sim (http://aurora-sim.org)
* SQLite (Public Domain)
* XmlRpcCS (http://xmlrpccs.sf.net/)
* MySQL, Inc. (MySQL Connector/NET)
* NUnit (http://www.nunit.org)
* AGEIA Inc. (PhysX)
* Russel L. Smith (ODE)
* Erwin Coumans (Bullet)
* Prebuild (http://sourceforge.net/projects/dnpb/)
* LibOpenMetaverse (http://lib.openmetaverse.org/)
* DotNetOpenMail v0.5.8b (http://dotnetopenmail.sourceforge.net)
* Prototype JavaScript Framework ajax (http://www.prototypejs.org/)
* C5 GENERIC COLLECTION LIBRARY FOR C#/CLI
* Nini (http://nini.sourceforge.net/)
* log4net (http://logging.apache.org/log4net/)
* GlynnTucker.Cache (http://gtcache.sourceforge.net/)
* NDesk.Options 0.2.1 (http://www.ndesk.org/Options)
* Json.NET 3.5 Release 6. The binary used is actually Newtonsoft.Json.Net20.dll for Mono 2.4 compatability (http://james.newtonking.com/projects/json-net.aspx)
* zlib.net for C# 1.0.4 (http://www.componentace.com/zlib_.NET.htm)
Some plugins are based on Cable Beach
Cable Beach is Copyright (c) 2008 Intel Corporation
see http://forge.opensimulator.org/gf/project/assetserver/
In addition, we would like to thank:
* The Mono Project
* The NANT Developers
* Microsoft (.NET, MSSQL-Adapters)

View File

@ -0,0 +1,58 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C9702041-922C-452A-A1B4-7880AF53149A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenGrid.Framework.Communications</RootNamespace>
<AssemblyName>OpenGrid.Framework.Communications</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="libsecondlife, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="RegionServerCommsManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestLocalCommsManager.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
<Name>OpenSim.Framework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +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("OpenGrid.Framework.Communications")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenGrid.Framework.Communications")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("13e7c396-78a9-4a5c-baf2-6f980ea75d95")]
// 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")]

View File

@ -0,0 +1,76 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
using libsecondlife;
namespace OpenGrid.Framework.Communications
{
public class RegionServerCommsManager
{
public RegionServerCommsManager()
{
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public virtual RegionInfo LoadRegionConfigFromGridServer(LLUUID regionID)
{
return null;
}
/// <summary>
///
/// </summary>
/// <param name="regionInfo"></param>
/// <returns></returns>
public virtual RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
{
return null;
}
/// <summary>
///
/// </summary>
/// <param name="regionInfo"></param>
/// <returns></returns>
public virtual List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
{
return null;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public virtual bool InformNeighbourOfChildAgent( ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
{
return false;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public virtual bool AvatarCrossingToRegion()
{
return false;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public virtual IList RequestMapBlocks()
{
return null;
}
}
}

View File

@ -0,0 +1,122 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using OpenSim.Framework;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
namespace OpenGrid.Framework.Communications
{
public class TestLocalCommsManager : RegionServerCommsManager
{
protected Dictionary<ulong, RegionInfo> regions = new Dictionary<ulong,RegionInfo>();
protected Dictionary<ulong, RegionCommsHostBase> regionHosts = new Dictionary<ulong, RegionCommsHostBase>();
public TestLocalCommsManager()
{
}
/// <summary>
///
/// </summary>
/// <param name="regionInfo"></param>
/// <returns></returns>
public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
{
//Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering");
if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
{
//Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle );
this.regions.Add(regionInfo.RegionHandle, regionInfo);
RegionCommsHostBase regionHost = new RegionCommsHostBase();
this.regionHosts.Add(regionInfo.RegionHandle, regionHost);
return regionHost;
}
//already in our list of regions so for now lets return null
return null;
}
/// <summary>
///
/// </summary>
/// <param name="regionInfo"></param>
/// <returns></returns>
public override List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
{
// Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle);
List<RegionInfo> neighbours = new List<RegionInfo>();
foreach (RegionInfo reg in this.regions.Values)
{
// Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY);
if (reg.RegionHandle != regionInfo.RegionHandle)
{
//Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location");
if ((reg.RegionLocX > (regionInfo.RegionLocX - 2)) && (reg.RegionLocX < (regionInfo.RegionLocX + 2)))
{
if ((reg.RegionLocY > (regionInfo.RegionLocY - 2)) && (reg.RegionLocY < (regionInfo.RegionLocY + 2)))
{
neighbours.Add(reg);
}
}
}
}
return neighbours;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public override bool InformNeighbourOfChildAgent(ulong regionHandle, AgentCircuitData agentData) //should change from agentCircuitData
{
//Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
if (this.regionHosts.ContainsKey(regionHandle))
{
// Console.WriteLine("CommsManager- Informing a region to expect child agent");
this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agentData);
return true;
}
return false;
}
/// <summary>
/// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="loginData"></param>
/// <returns></returns>
public bool AddNewSession(ulong regionHandle, Login loginData)
{
//Console.WriteLine(" comms manager been told to expect new user");
AgentCircuitData agent = new AgentCircuitData();
agent.AgentID = loginData.Agent;
agent.firstname = loginData.First;
agent.lastname = loginData.Last;
agent.SessionID = loginData.Session;
agent.SecureSessionID = loginData.SecureSession;
agent.circuitcode = loginData.CircuitCode;
agent.BaseFolder = loginData.BaseFolder;
agent.InventoryFolder = loginData.InventoryFolder;
agent.startpos = new LLVector3(128, 128, 70);
if (this.regionHosts.ContainsKey(regionHandle))
{
this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent);
return true;
}
// region not found
return false;
}
}
}

View File

@ -0,0 +1,31 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("ServerConsole")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ServerConsole")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]

View File

@ -0,0 +1,166 @@
using System;
using System.IO;
namespace OpenSim.Framework.Console
{
public enum LogPriority : int
{
CRITICAL,
HIGH,
MEDIUM,
NORMAL,
LOW,
VERBOSE,
EXTRAVERBOSE
}
public class ConsoleBase
{
StreamWriter Log;
public conscmd_callback cmdparser;
public string componentname;
private bool m_silent;
public ConsoleBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent )
{
this.componentname = componentname;
this.cmdparser = cmdparser;
this.m_silent = silent;
System.Console.WriteLine("ServerConsole.cs - creating new local console");
System.Console.WriteLine("Logs will be saved to current directory in " + LogFile);
Log = File.AppendText(LogFile);
Log.WriteLine("========================================================================");
Log.WriteLine(componentname + " Started at " + DateTime.Now.ToString());
}
public void Close()
{
Log.WriteLine("Shutdown at " + DateTime.Now.ToString());
Log.Close();
}
public void Write(string format, params object[] args)
{
WriteLine(LogPriority.NORMAL,format,args);
return;
}
[Obsolete("WriteLine(msg,args) has been depreciated, use WriteLine(priority,msg,args) instead.")]
public void WriteLine(string format, params object[] args)
{
Log.WriteLine(format, args);
Log.Flush();
if(!m_silent)
{
System.Console.WriteLine(format, args);
}
return;
}
public void WriteLine(LogPriority importance, string format, params object[] args)
{
Log.WriteLine(format, args);
Log.Flush();
if (!m_silent)
{
System.Console.WriteLine(format, args);
}
return;
}
public string ReadLine()
{
string TempStr = System.Console.ReadLine();
Log.WriteLine(TempStr);
return TempStr;
}
public int Read()
{
int TempInt = System.Console.Read();
Log.Write((char)TempInt);
return TempInt;
}
// Displays a prompt and waits for the user to enter a string, then returns that string
// Done with no echo and suitable for passwords
public string PasswdPrompt(string prompt)
{
// FIXME: Needs to be better abstracted
Log.WriteLine(prompt);
this.Write(prompt);
ConsoleColor oldfg = System.Console.ForegroundColor;
System.Console.ForegroundColor = System.Console.BackgroundColor;
string temp = System.Console.ReadLine();
System.Console.ForegroundColor = oldfg;
return temp;
}
// Displays a command prompt and waits for the user to enter a string, then returns that string
public string CmdPrompt(string prompt)
{
this.Write(String.Format("{0}: ", prompt));
return this.ReadLine();
}
// Displays a command prompt and returns a default value if the user simply presses enter
public string CmdPrompt(string prompt, string defaultresponse)
{
string temp = CmdPrompt(String.Format( "{0} [{1}]", prompt, defaultresponse ));
if (temp == "")
{
return defaultresponse;
}
else
{
return temp;
}
}
// Displays a command prompt and returns a default value, user may only enter 1 of 2 options
public string CmdPrompt(string prompt, string defaultresponse, string OptionA, string OptionB)
{
bool itisdone = false;
string temp = CmdPrompt(prompt, defaultresponse);
while (itisdone == false)
{
if ((temp == OptionA) || (temp == OptionB))
{
itisdone = true;
}
else
{
this.WriteLine(LogPriority.MEDIUM,"Valid options are " + OptionA + " or " + OptionB);
temp = CmdPrompt(prompt, defaultresponse);
}
}
return temp;
}
// Runs a command with a number of parameters
public Object RunCmd(string Cmd, string[] cmdparams)
{
cmdparser.RunCmd(Cmd, cmdparams);
return null;
}
// Shows data about something
public void ShowCommands(string ShowWhat)
{
cmdparser.Show(ShowWhat);
}
public void MainConsolePrompt()
{
string[] tempstrarray;
string tempstr = this.CmdPrompt(this.componentname + "# ");
tempstrarray = tempstr.Split(' ');
string cmd = tempstrarray[0];
Array.Reverse(tempstrarray);
Array.Resize<string>(ref tempstrarray, tempstrarray.Length - 1);
Array.Reverse(tempstrarray);
string[] cmdparams = (string[])tempstrarray;
RunCmd(cmd, cmdparams);
}
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Console
{
public interface conscmd_callback
{
void RunCmd(string cmd, string[] cmdparams);
void Show(string ShowWhat);
}
}

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
*
* 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.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> 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 <copyright holder> ``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 <copyright holder> 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;
namespace OpenSim.Framework.Console
{
public class MainConsole {
private static ConsoleBase instance;
public static ConsoleBase Instance
{
get
{
return instance;
}
set
{
instance = value;
}
}
}
}

View File

@ -0,0 +1,89 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A7CD0630-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenSim.Framework.Console</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenSim.Framework.Console</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ConsoleBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ConsoleCallbacksBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="MainConsole.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,12 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" ?>
<project name="OpenSim.Framework.Console" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenSim.Framework.Console" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="AssemblyInfo.cs" />
<include name="ConsoleBase.cs" />
<include name="ConsoleCallbacksBase.cs" />
<include name="MainConsole.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -0,0 +1,240 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities;
namespace OpenSim.Framework.Inventory
{
public class AgentInventory
{
//Holds the local copy of Inventory info for a agent
public Dictionary<LLUUID, InventoryFolder> InventoryFolders;
public Dictionary<LLUUID, InventoryItem> InventoryItems;
public InventoryFolder InventoryRoot;
public int LastCached; //maybe used by opensim app, time this was last stored/compared to user server
public LLUUID AgentID;
public AvatarWearable[] Wearables;
public AgentInventory()
{
InventoryFolders = new Dictionary<LLUUID, InventoryFolder>();
InventoryItems = new Dictionary<LLUUID, InventoryItem>();
this.Initialise();
}
public virtual void Initialise()
{
Wearables = new AvatarWearable[13]; //should be 12 of these
for (int i = 0; i < 13; i++)
{
Wearables[i] = new AvatarWearable();
}
}
public bool CreateNewFolder(LLUUID folderID, ushort type)
{
InventoryFolder Folder = new InventoryFolder();
Folder.FolderID = folderID;
Folder.OwnerID = this.AgentID;
Folder.DefaultType = type;
this.InventoryFolders.Add(Folder.FolderID, Folder);
return (true);
}
public void CreateRootFolder(LLUUID newAgentID, bool createTextures)
{
this.AgentID = newAgentID;
InventoryRoot = new InventoryFolder();
InventoryRoot.FolderID = LLUUID.Random();
InventoryRoot.ParentID = new LLUUID();
InventoryRoot.Version = 1;
InventoryRoot.DefaultType = 8;
InventoryRoot.OwnerID = this.AgentID;
InventoryRoot.FolderName = "My Inventory";
InventoryFolders.Add(InventoryRoot.FolderID, InventoryRoot);
InventoryRoot.OwnerID = this.AgentID;
if (createTextures)
{
this.CreateNewFolder(LLUUID.Random(), 0, "Textures", InventoryRoot.FolderID);
}
}
public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName)
{
InventoryFolder Folder = new InventoryFolder();
Folder.FolderID = folderID;
Folder.OwnerID = this.AgentID;
Folder.DefaultType = type;
Folder.FolderName = folderName;
this.InventoryFolders.Add(Folder.FolderID, Folder);
return (true);
}
public bool CreateNewFolder(LLUUID folderID, ushort type, string folderName, LLUUID parent)
{
if (!this.InventoryFolders.ContainsKey(folderID))
{
System.Console.WriteLine("creating new folder called " + folderName + " in agents inventory");
InventoryFolder Folder = new InventoryFolder();
Folder.FolderID = folderID;
Folder.OwnerID = this.AgentID;
Folder.DefaultType = type;
Folder.FolderName = folderName;
Folder.ParentID = parent;
this.InventoryFolders.Add(Folder.FolderID, Folder);
}
return (true);
}
public bool HasFolder(LLUUID folderID)
{
if (this.InventoryFolders.ContainsKey(folderID))
{
return true;
}
return false;
}
public LLUUID GetFolderID(string folderName)
{
foreach (InventoryFolder inv in this.InventoryFolders.Values)
{
if (inv.FolderName == folderName)
{
return inv.FolderID;
}
}
return LLUUID.Zero;
}
public bool UpdateItemAsset(LLUUID itemID, AssetBase asset)
{
if(this.InventoryItems.ContainsKey(itemID))
{
InventoryItem Item = this.InventoryItems[itemID];
Item.AssetID = asset.FullID;
System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated());
//TODO need to update the rest of the info
}
return true;
}
public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet)
{
System.Console.WriteLine("updating inventory item details");
if (this.InventoryItems.ContainsKey(itemID))
{
System.Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name));
InventoryItem Item = this.InventoryItems[itemID];
Item.Name = Util.FieldToString(packet.Name);
System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated());
//TODO need to update the rest of the info
}
return true;
}
public LLUUID AddToInventory(LLUUID folderID, AssetBase asset)
{
if (this.InventoryFolders.ContainsKey(folderID))
{
LLUUID NewItemID = LLUUID.Random();
InventoryItem Item = new InventoryItem();
Item.FolderID = folderID;
Item.OwnerID = AgentID;
Item.AssetID = asset.FullID;
Item.ItemID = NewItemID;
Item.Type = asset.Type;
Item.Name = asset.Name;
Item.Description = asset.Description;
Item.InvType = asset.InvType;
this.InventoryItems.Add(Item.ItemID, Item);
InventoryFolder Folder = InventoryFolders[Item.FolderID];
Folder.Items.Add(Item);
return (Item.ItemID);
}
else
{
return (null);
}
}
public bool DeleteFromInventory(LLUUID itemID)
{
bool res = false;
if (this.InventoryItems.ContainsKey(itemID))
{
InventoryItem item = this.InventoryItems[itemID];
this.InventoryItems.Remove(itemID);
foreach (InventoryFolder fold in InventoryFolders.Values)
{
if (fold.Items.Contains(item))
{
fold.Items.Remove(item);
break;
}
}
res = true;
}
return res;
}
}
public class InventoryFolder
{
public List<InventoryItem> Items;
//public List<InventoryFolder> Subfolders;
public LLUUID FolderID;
public LLUUID OwnerID;
public LLUUID ParentID = LLUUID.Zero;
public string FolderName;
public ushort DefaultType;
public ushort Version;
public InventoryFolder()
{
Items = new List<InventoryItem>();
//Subfolders = new List<InventoryFolder>();
}
}
public class InventoryItem
{
public LLUUID FolderID;
public LLUUID OwnerID;
public LLUUID ItemID;
public LLUUID AssetID;
public LLUUID CreatorID;
public sbyte InvType;
public sbyte Type;
public string Name ="";
public string Description;
public InventoryItem()
{
this.CreatorID = LLUUID.Zero;
}
public string ExportString()
{
string typ = "notecard";
string result = "";
result += "\tinv_object\t0\n\t{\n";
result += "\t\tobj_id\t%s\n";
result += "\t\tparent_id\t"+ ItemID.ToString() +"\n";
result += "\t\ttype\t"+ typ +"\n";
result += "\t\tname\t" + Name+"|\n";
result += "\t}\n";
return result;
}
}
}

View File

@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
namespace OpenSim.Framework
{
public class AuthenticateSessionsBase
{
public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
public AuthenticateSessionsBase()
{
}
public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
{
AgentCircuitData validcircuit = null;
if (this.AgentCircuits.ContainsKey(circuitcode))
{
validcircuit = this.AgentCircuits[circuitcode];
}
AuthenticateResponse user = new AuthenticateResponse();
if (validcircuit == null)
{
//don't have this circuit code in our list
user.Authorised = false;
return (user);
}
if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
{
user.Authorised = true;
user.LoginInfo = new Login();
user.LoginInfo.Agent = agentID;
user.LoginInfo.Session = sessionID;
user.LoginInfo.SecureSession = validcircuit.SecureSessionID;
user.LoginInfo.First = validcircuit.firstname;
user.LoginInfo.Last = validcircuit.lastname;
user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder;
user.LoginInfo.BaseFolder = validcircuit.BaseFolder;
}
else
{
// Invalid
user.Authorised = false;
}
return (user);
}
public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
{
if (this.AgentCircuits.ContainsKey(circuitCode))
{
this.AgentCircuits[circuitCode] = agentData;
}
else
{
this.AgentCircuits.Add(circuitCode, agentData);
}
}
public LLVector3 GetPosition(uint circuitCode)
{
LLVector3 vec = new LLVector3();
if (this.AgentCircuits.ContainsKey(circuitCode))
{
vec = this.AgentCircuits[circuitCode].startpos;
}
return vec;
}
public void UpdateAgentData(AgentCircuitData agentData)
{
if (this.AgentCircuits.ContainsKey((uint)agentData.circuitcode))
{
this.AgentCircuits[(uint)agentData.circuitcode].firstname = agentData.firstname;
this.AgentCircuits[(uint)agentData.circuitcode].lastname = agentData.lastname;
this.AgentCircuits[(uint)agentData.circuitcode].startpos = agentData.startpos;
// Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z);
}
}
public void UpdateAgentChildStatus(uint circuitcode, bool childstatus)
{
if (this.AgentCircuits.ContainsKey(circuitcode))
{
this.AgentCircuits[circuitcode].child = childstatus;
}
}
public bool GetAgentChildStatus(uint circuitcode)
{
if (this.AgentCircuits.ContainsKey(circuitcode))
{
return this.AgentCircuits[circuitcode].child;
}
return false;
}
}
}

View File

@ -0,0 +1,33 @@
using System;
using System.Threading;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Utilities
{
public class BlockingQueue<T>
{
private Queue<T> _queue = new Queue<T>();
private object _queueSync = new object();
public void Enqueue(T value)
{
lock (_queueSync)
{
_queue.Enqueue(value);
Monitor.Pulse(_queueSync);
}
}
public T Dequeue()
{
lock (_queueSync)
{
if (_queue.Count < 1)
Monitor.Wait(_queueSync);
return _queue.Dequeue();
}
}
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
namespace OpenSim.Framework
{
public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent);
public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
public interface IRegionCommsHost
{
event ExpectUserDelegate OnExpectUser;
event GenericCall2 OnExpectChildAgent;
event GenericCall2 OnAvatarCrossingIntoRegion;
event UpdateNeighbours OnNeighboursUpdate;
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Interfaces
{
public interface IGenericConfig
{
void LoadData();
string GetAttribute(string attributeName);
bool SetAttribute(string attributeName, string attributeValue);
void Commit();
void Close();
}
}

View File

@ -0,0 +1,64 @@
/*
Copyright (c) OpenSim project, http://osgrid.org/
* Copyright (c) <year>, <copyright holder>
* 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.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> 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 <copyright holder> ``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 <copyright holder> 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.Generic;
using System.IO;
using libsecondlife;
//using OpenSim.world;
namespace OpenSim.Framework.Interfaces
{
/// <summary>
/// </summary>
public abstract class GridConfig
{
public string GridOwner;
public string DefaultStartupMsg;
public string DefaultAssetServer;
public string AssetSendKey;
public string AssetRecvKey;
public string DefaultUserServer;
public string UserSendKey;
public string UserRecvKey;
public string SimSendKey;
public string SimRecvKey;
public abstract void InitConfig();
}
public interface IGridConfig
{
GridConfig GetConfigObject();
}
}

View File

@ -0,0 +1,58 @@
/*
Copyright (c) OpenSim project, http://osgrid.org/
* Copyright (c) <year>, <copyright holder>
* 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.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> 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 <copyright holder> ``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 <copyright holder> 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.Generic;
using System.IO;
using libsecondlife;
//using OpenSim.world;
namespace OpenSim.Framework.Interfaces
{
/// <summary>
/// </summary>
public abstract class UserConfig
{
public string DefaultStartupMsg;
public string GridServerURL;
public string GridSendKey;
public string GridRecvKey;
public abstract void InitConfig();
}
public interface IUserConfig
{
UserConfig GetConfigObject();
}
}

View File

@ -0,0 +1,68 @@
/*
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
*
* 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.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> 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 <copyright holder> ``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 <copyright holder> 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.Net;
using System.Net.Sockets;
using System.IO;
using System.Threading;
using libsecondlife;
using OpenSim.Framework.Types;
namespace OpenSim.Framework.Interfaces
{
/// <summary>
/// Description of IAssetServer.
/// </summary>
public interface IAssetServer
{
void SetReceiver(IAssetReceiver receiver);
void RequestAsset(LLUUID assetID, bool isTexture);
void UpdateAsset(AssetBase asset);
void UploadNewAsset(AssetBase asset);
void SetServerInfo(string ServerUrl, string ServerKey);
void Close();
}
// could change to delegate?
public interface IAssetReceiver
{
void AssetReceived(AssetBase asset, bool IsTexture);
void AssetNotFound(AssetBase asset);
}
public interface IAssetPlugin
{
IAssetServer GetAssetServer();
}
public struct ARequest
{
public LLUUID AssetID;
public bool IsTexture;
}
}

View File

@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Inventory;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.Framework.Types;
namespace OpenSim.Framework.Interfaces
{
public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
public delegate void RezObject(AssetBase primAsset, LLVector3 pos);
public delegate void ModifyTerrain(byte action, float north, float west);
public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam);
public delegate void StartAnim(LLUUID animID, int seq);
public delegate void LinkObjects(uint parent, List<uint> children);
public delegate void GenericCall(IClientAPI remoteClient);
public delegate void GenericCall2();
public delegate void GenericCall3(Packet packet); // really don't want to be passing packets in these events, so this is very temporary.
public delegate void GenericCall4(Packet packet, IClientAPI remoteClient);
public delegate void GenericCall5(IClientAPI remoteClient, bool status);
public delegate void GenericCall6(LLUUID uid);
public delegate void UpdateShape(uint localID, ObjectShapePacket.ObjectDataBlock shapeBlock);
public delegate void ObjectSelect(uint localID, IClientAPI remoteClient);
public delegate void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient);
public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient);
public delegate void UpdatePrimVector(uint localID, LLVector3 pos, IClientAPI remoteClient);
public delegate void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient);
public delegate void StatusChange(bool status);
public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status);
public interface IClientAPI
{
event ChatFromViewer OnChatFromViewer;
event RezObject OnRezObject;
event ModifyTerrain OnModifyTerrain;
event SetAppearance OnSetAppearance;
event StartAnim OnStartAnim;
event LinkObjects OnLinkObjects;
event GenericCall4 OnDeRezObject;
event GenericCall OnRegionHandShakeReply;
event GenericCall OnRequestWearables;
event GenericCall2 OnCompleteMovementToRegion;
event GenericCall3 OnAgentUpdate;
event GenericCall OnRequestAvatarsData;
event GenericCall4 OnAddPrim;
event UpdateShape OnUpdatePrimShape;
event ObjectSelect OnObjectSelect;
event UpdatePrimFlags OnUpdatePrimFlags;
event UpdatePrimTexture OnUpdatePrimTexture;
event UpdatePrimVector OnUpdatePrimPosition;
event UpdatePrimRotation OnUpdatePrimRotation;
event UpdatePrimVector OnUpdatePrimScale;
event StatusChange OnChildAgentStatus;
event GenericCall2 OnStopMovement;
event NewAvatar OnNewAvatar;
event GenericCall6 OnRemoveAvatar;
LLVector3 StartPos
{
get;
set;
}
LLUUID AgentId
{
get;
}
string FirstName
{
get;
}
string LastName
{
get;
}
void OutPacket(Packet newPack);
void SendWearables(AvatarWearable[] wearables);
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
void SendLayerData(float[] map);
void SendRegionHandshake(RegionInfo regionInfo);
void MoveAgentIntoRegion(RegionInfo regInfo);
void SendAvatarData(RegionInfo regionInfo, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos);
void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort);
AgentCircuitData RequestClientInfo();
}
}

View File

@ -0,0 +1,81 @@
/*
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
*
* 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.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> 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 <copyright holder> ``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 <copyright holder> 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.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.IO;
using libsecondlife;
using OpenSim;
using OpenSim.Framework.Types;
namespace OpenSim.Framework.Interfaces
{
/// <summary>
/// Handles connection to Grid Servers.
/// also Sim to Sim connections?
/// </summary>
public interface IGridServer
{
UUIDBlock RequestUUIDBlock();
NeighbourInfo[] RequestNeighbours(); //should return a array of neighbouring regions
AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
string GetName();
bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port);
void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
IList RequestMapBlocks(int minX, int minY, int maxX, int maxY);
void Close();
}
public struct UUIDBlock
{
public LLUUID BlockStart;
public LLUUID BlockEnd;
}
public class AuthenticateResponse
{
public bool Authorised;
public Login LoginInfo;
public AuthenticateResponse()
{
}
}
public interface IGridPlugin
{
IGridServer GetGridServer();
}
}

View File

@ -0,0 +1,54 @@
/*
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
*
* 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.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> 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 <copyright holder> ``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 <copyright holder> 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 OpenSim.Framework.Types;
namespace OpenSim.Framework.Interfaces
{
/// <summary>
/// ILocalStorage. Really hacked together right now needs cleaning up
/// </summary>
public interface ILocalStorage
{
void Initialise(string datastore);
void StorePrim(PrimData prim);
void RemovePrim(LLUUID primID);
void LoadPrimitives(ILocalStorageReceiver receiver);
float[] LoadWorld();
void SaveMap(float[] heightmap);
void ShutDown();
}
public interface ILocalStorageReceiver
{
void PrimFromStorage(PrimData prim);
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Inventory;
using libsecondlife;
namespace OpenSim.Framework.Interfaces
{
public interface IUserServer
{
AgentInventory RequestAgentsInventory(LLUUID agentID);
void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory);
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using OpenSim.Framework.Types;
namespace OpenSim.Framework.Interfaces
{
public interface IWorld
{
void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child);
void RemoveAvatar(LLUUID agentID);
RegionInfo GetRegionInfo();
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using OpenSim.Framework.Types;
using System.Collections;
namespace OpenSim.Framework.Interfaces
{
public abstract class LocalGridBase : IGridServer
{
public abstract UUIDBlock RequestUUIDBlock();
public abstract NeighbourInfo[] RequestNeighbours();
public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract string GetName();
public abstract bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port);
public abstract void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
public abstract void AddNewSession(Login session);
public abstract IList RequestMapBlocks(int minX, int minY, int maxX, int maxY);
public abstract void Close();
}
}

View File

@ -0,0 +1,37 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using OpenSim.Framework.Types;
namespace OpenSim.Framework.Interfaces
{
public abstract class RemoteGridBase : IGridServer
{
public abstract Dictionary<uint, AgentCircuitData> agentcircuits
{
get;
set;
}
public abstract UUIDBlock RequestUUIDBlock();
public abstract NeighbourInfo[] RequestNeighbours();
public abstract AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
public abstract string GetName();
public abstract bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port);
public abstract void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
public abstract IList RequestMapBlocks(int minX, int minY, int maxX, int maxY);
public abstract void Close();
public abstract Hashtable GridData {
get;
set;
}
public abstract ArrayList neighbours {
get;
set;
}
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Interfaces
{
public interface IGridServerHost
{
void ConnectSim(string name);
string RequestSimURL(uint regionHandle);
}
}

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Interfaces
{
public interface IProxyServerClient
{
}
}

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Interfaces
{
public interface IProxyServerHost
{
}
}

View File

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Interfaces
{
public interface IRegionGridClient
{
bool ExpectUser(string toRegionID, string name);
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Interfaces
{
public interface IRegionSimHost
{
bool ExpectUser(string name);
bool AgentCrossing(string name);
}
}

View File

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Interfaces
{
public abstract class RegionGridClientBase :IRegionGridClient
{
public abstract bool ExpectUser(string toRegionID, string name);
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Types;
namespace OpenSim.Framework.Interfaces
{
public interface IScriptAPI
{
OSVector3 GetEntityPosition(uint localID);
void SetEntityPosition(uint localID, float x, float y, float z);
uint GetRandomAvatarID();
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Interfaces
{
public interface IScriptEngine
{
bool Init(IScriptAPI api);
string GetName();
void LoadScript(string script, string scriptName, uint entityID);
void OnFrame();
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Nwc.XmlRpc;
using libsecondlife;
namespace OpenSim.Framework.Grid
{
public abstract class LoginService
{
}
}

View File

@ -0,0 +1,225 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8ACA2445-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenSim.Framework</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenSim.Framework</RootNamespace>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn>
</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn>
</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml">
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll">
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Db4objects.Db4o.dll">
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
<Name>OpenSim.Framework.Console</Name>
</ProjectReference>
<ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
<Name>XMLRPC</Name>
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="AgentInventory.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="AuthenticateSessionBase.cs" />
<Compile Include="BlockingQueue.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="IRegionCommsHost.cs" />
<Compile Include="LoginService.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="RegionCommsHostBase.cs" />
<Compile Include="Remoting.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="SimProfile.cs" />
<Compile Include="SimProfileBase.cs" />
<Compile Include="Types\AgentWearable.cs" />
<Compile Include="Types\NetworkServersInfo.cs" />
<Compile Include="UserProfile.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="UserProfileManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="UserProfileManagerBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Util.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\IAssetServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\IClientAPI.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\IGridServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\ILocalStorage.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\IUserServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\IWorld.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\LocalGridBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\RemoteGridBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Config\IGenericConfig.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Config\IGridConfig.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Config\IUserConfig.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Remoting\IGridServerHost.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Remoting\IProxyServerClient.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Remoting\IProxyServerHost.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Remoting\IRegionGridClient.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Remoting\IRegionSimHost.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Remoting\RegionGridClientBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Scripting\IScriptAPI.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\Scripting\IScriptEngine.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Types\AgentCiruitData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Types\AssetBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Types\AssetLandmark.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Types\AssetStorage.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Types\Login.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Types\NeighbourInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Types\OSVector3.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Types\PrimData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Types\RegionInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,12 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -0,0 +1,75 @@
<?xml version="1.0" ?>
<project name="OpenSim.Framework" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenSim.Framework" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="AgentInventory.cs" />
<include name="BlockingQueue.cs" />
<include name="HeightMapGenHills.cs" />
<include name="LoginService.cs" />
<include name="Remoting.cs" />
<include name="SimProfile.cs" />
<include name="SimProfileBase.cs" />
<include name="UserProfile.cs" />
<include name="UserProfileManager.cs" />
<include name="UserProfileManagerBase.cs" />
<include name="Util.cs" />
<include name="Interfaces/IAssetServer.cs" />
<include name="Interfaces/IClientAPI.cs" />
<include name="Interfaces/IConfig.cs" />
<include name="Interfaces/IGenericConfig.cs" />
<include name="Interfaces/IGridConfig.cs" />
<include name="Interfaces/IGridServer.cs" />
<include name="Interfaces/ILocalStorage.cs" />
<include name="Interfaces/IScriptAPI.cs" />
<include name="Interfaces/IScriptEngine.cs" />
<include name="Interfaces/IUserConfig.cs" />
<include name="Interfaces/IUserServer.cs" />
<include name="Interfaces/LocalGridBase.cs" />
<include name="Interfaces/RemoteGridBase.cs" />
<include name="Properties/AssemblyInfo.cs" />
<include name="Types/AgentCiruitData.cs" />
<include name="Types/AssetBase.cs" />
<include name="Types/AssetLandmark.cs" />
<include name="Types/AssetStorage.cs" />
<include name="Types/Login.cs" />
<include name="Types/NeighbourInfo.cs" />
<include name="Types/OSVector3.cs" />
<include name="Types/PrimData.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Xml.dll" />
<include name="../../bin/libsecondlife.dll" />
<include name="../../bin/Db4objects.Db4o.dll" />
<include name="../../bin/XMLRPC.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -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("OpenSim.Capabilities")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("http://opensimulator.org")]
[assembly: AssemblyProduct("OpenSim")]
[assembly: AssemblyCopyright("OpenSimulator developers")]
[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("7d1a55b1-8fab-42ff-9c83-066a9cc34d76")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.7.6.*")]
[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("OpenSim.FrameWork")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenSim.FrameWork")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a08e20c7-f191-4137-b1f0-9291408fa521")]
// 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")]

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
namespace OpenSim.Framework
{
public class RegionCommsHostBase :IRegionCommsHost
{
public event ExpectUserDelegate OnExpectUser;
public event GenericCall2 OnExpectChildAgent;
public event GenericCall2 OnAvatarCrossingIntoRegion;
public event UpdateNeighbours OnNeighboursUpdate;
/// <summary>
///
/// </summary>
/// <param name="agent"></param>
/// <returns></returns>
public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
{
if(OnExpectUser != null)
{
OnExpectUser(regionHandle, agent);
return true;
}
return false;
}
}
}

View File

@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
namespace OpenSim.Framework
{
/// <summary>
/// NEEDS AUDIT.
/// </summary>
/// <remarks>
/// Suggested implementation
/// <para>Store two digests for each foreign host. A local copy of the local hash using the local challenge (when issued), and a local copy of the remote hash using the remote challenge.</para>
/// <para>When sending data to the foreign host - run 'Sign' on the data and affix the returned byte[] to the message.</para>
/// <para>When recieving data from the foreign host - run 'Authenticate' against the data and the attached byte[].</para>
/// <para>Both hosts should be performing these operations for this to be effective.</para>
/// </remarks>
class RemoteDigest
{
private byte[] currentHash;
private byte[] secret;
private SHA512Managed SHA512;
/// <summary>
/// Initialises a new RemoteDigest authentication mechanism
/// </summary>
/// <remarks>Needs an audit by a cryptographic professional - was not "roll your own"'d by choice but rather a serious lack of decent authentication mechanisms in .NET remoting</remarks>
/// <param name="sharedSecret">The shared secret between systems (for inter-sim, this is provided in encrypted form during connection, for grid this is input manually in setup)</param>
/// <param name="salt">Binary salt - some common value - to be decided what</param>
/// <param name="challenge">The challenge key provided by the third party</param>
public RemoteDigest(string sharedSecret, byte[] salt, string challenge)
{
SHA512 = new SHA512Managed();
Rfc2898DeriveBytes RFC2898 = new Rfc2898DeriveBytes(sharedSecret,salt);
secret = RFC2898.GetBytes(512);
ASCIIEncoding ASCII = new ASCIIEncoding();
currentHash = SHA512.ComputeHash(AppendArrays(secret, ASCII.GetBytes(challenge)));
}
/// <summary>
/// Authenticates a piece of incoming data against the local digest. Upon successful authentication, digest string is incremented.
/// </summary>
/// <param name="data">The incoming data</param>
/// <param name="digest">The remote digest</param>
/// <returns></returns>
public bool Authenticate(byte[] data, byte[] digest)
{
byte[] newHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data));
if (digest == newHash)
{
currentHash = newHash;
return true;
}
else
{
throw new Exception("Hash comparison failed. Key resync required.");
}
}
/// <summary>
/// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message.
/// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the
/// hashes will get out of sync and throw an exception when validation is attempted.
/// </summary>
/// <param name="data">The outgoing data</param>
/// <returns>The local digest</returns>
public byte[] Sign(byte[] data)
{
currentHash = SHA512.ComputeHash(AppendArrays(AppendArrays(currentHash, secret), data));
return currentHash;
}
/// <summary>
/// Generates a new challenge string to be issued to a foreign host. Challenges are 1024-bit (effective strength of less than 512-bits) messages generated using the Crytographic Random Number Generator.
/// </summary>
/// <returns>A 128-character hexadecimal string containing the challenge.</returns>
public static string GenerateChallenge()
{
RNGCryptoServiceProvider RNG = new RNGCryptoServiceProvider();
byte[] bytes = new byte[64];
RNG.GetBytes(bytes);
StringBuilder sb = new StringBuilder(bytes.Length * 2);
foreach (byte b in bytes)
{
sb.AppendFormat("{0:x2}", b);
}
return sb.ToString();
}
/// <summary>
/// Helper function, merges two byte arrays
/// </summary>
/// <remarks>Sourced from MSDN Forum</remarks>
/// <param name="a">A</param>
/// <param name="b">B</param>
/// <returns>C</returns>
private byte[] AppendArrays(byte[] a, byte[] b)
{
byte[] c = new byte[a.Length + b.Length];
Buffer.BlockCopy(a, 0, c, 0, a.Length);
Buffer.BlockCopy(b, 0, c, a.Length, b.Length);
return c;
}
}
}

View File

@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Xml;
using System.Text;
using libsecondlife;
using Nwc.XmlRpc;
namespace OpenSim.Framework.Sims
{
public class SimProfile : SimProfileBase
{
public SimProfile LoadFromGrid(ulong region_handle, string GridURL, string SendKey, string RecvKey)
{
try
{
Hashtable GridReqParams = new Hashtable();
GridReqParams["region_handle"] = region_handle.ToString();
GridReqParams["authkey"] = SendKey;
ArrayList SendParams = new ArrayList();
SendParams.Add(GridReqParams);
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
Hashtable RespData = (Hashtable)GridResp.Value;
this.UUID = new LLUUID((string)RespData["UUID"]);
this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256));
this.regionname = (string)RespData["regionname"];
this.sim_ip = (string)RespData["sim_ip"];
this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
this.sendkey = SendKey;
this.recvkey = RecvKey;
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
return this;
}
public SimProfile LoadFromGrid(LLUUID UUID, string GridURL, string SendKey, string RecvKey)
{
try
{
Hashtable GridReqParams = new Hashtable();
GridReqParams["UUID"] = UUID.ToString();
GridReqParams["authkey"] = SendKey;
ArrayList SendParams = new ArrayList();
SendParams.Add(GridReqParams);
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
XmlRpcResponse GridResp = GridReq.Send(GridURL, 3000);
Hashtable RespData = (Hashtable)GridResp.Value;
this.UUID = new LLUUID((string)RespData["UUID"]);
this.regionhandle = Helpers.UIntsToLong(((uint)Convert.ToUInt32(RespData["region_locx"]) * 256), ((uint)Convert.ToUInt32(RespData["region_locy"]) * 256));
this.regionname = (string)RespData["regionname"];
this.sim_ip = (string)RespData["sim_ip"];
this.sim_port = (uint)Convert.ToUInt16(RespData["sim_port"]);
this.caps_url = "http://" + ((string)RespData["sim_ip"]) + ":" + (string)RespData["sim_port"] + "/";
this.RegionLocX = (uint)Convert.ToUInt32(RespData["region_locx"]);
this.RegionLocY = (uint)Convert.ToUInt32(RespData["region_locy"]);
this.sendkey = SendKey;
this.recvkey = RecvKey;
}
catch (Exception e)
{
System.Console.WriteLine(e.ToString());
}
return this;
}
public SimProfile()
{
}
}
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Sims
{
[System.Obsolete("Depreciated, use SimProfileData instead")]
public class SimProfileBase
{
public LLUUID UUID;
public ulong regionhandle;
public string regionname;
public string sim_ip;
public uint sim_port;
public string caps_url;
public uint RegionLocX;
public uint RegionLocY;
public string sendkey;
public string recvkey;
public bool online;
public SimProfileBase()
{
}
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Types
{
public class AgentCircuitData
{
public AgentCircuitData() { }
public LLUUID AgentID;
public LLUUID SessionID;
public LLUUID SecureSessionID;
public LLVector3 startpos;
public string firstname;
public string lastname;
public uint circuitcode;
public bool child;
public LLUUID InventoryFolder;
public LLUUID BaseFolder;
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Types
{
public class AvatarWearable
{
public LLUUID AssetID = new LLUUID("00000000-0000-0000-0000-000000000000");
public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000");
public AvatarWearable()
{
}
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Types
{
public class AssetBase
{
public byte[] Data;
public LLUUID FullID;
public sbyte Type;
public sbyte InvType;
public string Name;
public string Description;
public AssetBase()
{
}
}
}

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Types
{
public class AssetLandmark : AssetBase
{
public int Version;
public LLVector3 Position;
public LLUUID RegionID;
public AssetLandmark(AssetBase a)
{
this.Data = a.Data;
this.FullID = a.FullID;
this.Type = a.Type;
this.InvType = a.InvType;
this.Name = a.Name;
this.Description = a.Description;
InternData();
}
private void InternData()
{
string temp = System.Text.Encoding.UTF8.GetString(Data).Trim();
string[] parts = temp.Split('\n');
int.TryParse(parts[0].Substring(17, 1), out Version);
LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID);
LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position);
}
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Types
{
public class AssetStorage
{
public AssetStorage() {
}
public AssetStorage(LLUUID assetUUID) {
UUID=assetUUID;
}
public byte[] Data;
public sbyte Type;
public string Name;
public LLUUID UUID;
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Types
{
public class Login
{
public string First = "Test";
public string Last = "User";
public LLUUID Agent;
public LLUUID Session;
public LLUUID SecureSession = LLUUID.Zero;
public LLUUID InventoryFolder;
public LLUUID BaseFolder;
public uint CircuitCode;
public Login()
{
}
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Console;
using libsecondlife;
namespace OpenSim.Framework.Types
{
public class NeighbourInfo
{
public NeighbourInfo()
{
}
public ulong regionhandle;
public uint RegionLocX;
public uint RegionLocY;
public string sim_ip;
public uint sim_port;
}
}

View File

@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Interfaces;
namespace OpenSim.Framework.Types
{
public class NetworkServersInfo
{
public string AssetURL = "http://127.0.0.1:8003/";
public string AssetSendKey = "";
public string GridURL = "";
public string GridSendKey = "";
public string GridRecvKey = "";
public string UserURL = "";
public string UserSendKey = "";
public string UserRecvKey = "";
public bool isSandbox;
public void InitConfig(bool sandboxMode, IGenericConfig configData)
{
this.isSandbox = sandboxMode;
try
{
if (!isSandbox)
{
string attri = "";
//Grid Server URL
attri = "";
attri = configData.GetAttribute("GridServerURL");
if (attri == "")
{
this.GridURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/");
configData.SetAttribute("GridServerURL", this.GridURL);
}
else
{
this.GridURL = attri;
}
//Grid Send Key
attri = "";
attri = configData.GetAttribute("GridSendKey");
if (attri == "")
{
this.GridSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to grid server", "null");
configData.SetAttribute("GridSendKey", this.GridSendKey);
}
else
{
this.GridSendKey = attri;
}
//Grid Receive Key
attri = "";
attri = configData.GetAttribute("GridRecvKey");
if (attri == "")
{
this.GridRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from grid server", "null");
configData.SetAttribute("GridRecvKey", this.GridRecvKey);
}
else
{
this.GridRecvKey = attri;
}
attri = "";
attri = configData.GetAttribute("AssetServerURL");
if (attri == "")
{
this.AssetURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/");
configData.SetAttribute("AssetServerURL", this.GridURL);
}
else
{
this.AssetURL = attri;
}
}
configData.Commit();
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Config.cs:InitConfig() - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, e.ToString());
}
}
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework.Types
{
public class OSVector3
{
public float X;
public float Y;
public float Z;
public OSVector3()
{
}
}
}

View File

@ -0,0 +1,173 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenSim.Framework.Types
{
public class PrimData
{
private const uint FULL_MASK_PERMISSIONS = 2147483647;
public LLUUID OwnerID;
public byte PCode;
public ushort PathBegin;
public ushort PathEnd;
public byte PathScaleX;
public byte PathScaleY;
public byte PathShearX;
public byte PathShearY;
public sbyte PathSkew;
public ushort ProfileBegin;
public ushort ProfileEnd;
public LLVector3 Scale;
public byte PathCurve;
public byte ProfileCurve;
public uint ParentID = 0;
public ushort ProfileHollow;
public sbyte PathRadiusOffset;
public byte PathRevolutions;
public sbyte PathTaperX;
public sbyte PathTaperY;
public sbyte PathTwist;
public sbyte PathTwistBegin;
public byte[] Texture;
public Int32 CreationDate;
public uint OwnerMask = FULL_MASK_PERMISSIONS;
public uint NextOwnerMask = FULL_MASK_PERMISSIONS;
public uint GroupMask = FULL_MASK_PERMISSIONS;
public uint EveryoneMask = FULL_MASK_PERMISSIONS;
public uint BaseMask = FULL_MASK_PERMISSIONS;
//following only used during prim storage
public LLVector3 Position;
public LLQuaternion Rotation = new LLQuaternion(0,1,0,0);
public uint LocalID;
public LLUUID FullID;
public PrimData()
{
}
public PrimData(byte[] data)
{
int i =0;
this.OwnerID = new LLUUID(data, i); i += 16;
this.PCode = data[i++];
this.PathBegin = (ushort)(data[i++] + (data[i++] << 8));
this.PathEnd = (ushort)(data[i++] + (data[i++] << 8));
this.PathScaleX = data[i++];
this.PathScaleY = data[i++];
this.PathShearX = data[i++];
this.PathShearY = data[i++];
this.PathSkew = (sbyte)data[i++];
this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8));
this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8));
this.Scale = new LLVector3(data, i); i += 12;
this.PathCurve = data[i++];
this.ProfileCurve = data[i++];
this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8));
this.PathRadiusOffset = (sbyte)data[i++];
this.PathRevolutions = data[i++];
this.PathTaperX = (sbyte)data[i++];
this.PathTaperY =(sbyte) data[i++];
this.PathTwist = (sbyte) data[i++];
this.PathTwistBegin = (sbyte) data[i++];
ushort length = (ushort)(data[i++] + (data[i++] << 8));
this.Texture = new byte[length];
Array.Copy(data, i, Texture, 0, length); i += length;
this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
this.Position = new LLVector3(data, i); i += 12;
this.Rotation = new LLQuaternion(data,i, true); i += 12;
this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
this.FullID = new LLUUID(data, i); i += 16;
}
public byte[] ToBytes()
{
int i = 0;
byte[] bytes = new byte[126 + Texture.Length];
Array.Copy(OwnerID.GetBytes(), 0, bytes, i, 16); i += 16;
bytes[i++] = this.PCode;
bytes[i++] = (byte)(this.PathBegin % 256);
bytes[i++] = (byte)((this.PathBegin >> 8) % 256);
bytes[i++] = (byte)(this.PathEnd % 256);
bytes[i++] = (byte)((this.PathEnd >> 8) % 256);
bytes[i++] = this.PathScaleX;
bytes[i++] = this.PathScaleY;
bytes[i++] = this.PathShearX;
bytes[i++] = this.PathShearY;
bytes[i++] = (byte)this.PathSkew;
bytes[i++] = (byte)(this.ProfileBegin % 256);
bytes[i++] = (byte)((this.ProfileBegin >> 8) % 256);
bytes[i++] = (byte)(this.ProfileEnd % 256);
bytes[i++] = (byte)((this.ProfileEnd >> 8) % 256);
Array.Copy(Scale.GetBytes(), 0, bytes, i, 12); i += 12;
bytes[i++] = this.PathCurve;
bytes[i++] = this.ProfileCurve;
bytes[i++] = (byte)(ParentID % 256);
bytes[i++] = (byte)((ParentID >> 8) % 256);
bytes[i++] = (byte)((ParentID >> 16) % 256);
bytes[i++] = (byte)((ParentID >> 24) % 256);
bytes[i++] = (byte)(this.ProfileHollow %256);
bytes[i++] = (byte)((this.ProfileHollow >> 8)% 256);
bytes[i++] = ((byte)this.PathRadiusOffset);
bytes[i++] = this.PathRevolutions;
bytes[i++] = ((byte) this.PathTaperX);
bytes[i++] = ((byte) this.PathTaperY);
bytes[i++] = ((byte) this.PathTwist);
bytes[i++] = ((byte) this.PathTwistBegin);
bytes[i++] = (byte)(Texture.Length % 256);
bytes[i++] = (byte)((Texture.Length >> 8) % 256);
Array.Copy(Texture, 0, bytes, i, Texture.Length); i += Texture.Length;
bytes[i++] = (byte)(this.CreationDate % 256);
bytes[i++] = (byte)((this.CreationDate >> 8) % 256);
bytes[i++] = (byte)((this.CreationDate >> 16) % 256);
bytes[i++] = (byte)((this.CreationDate >> 24) % 256);
bytes[i++] = (byte)(this.OwnerMask % 256);
bytes[i++] = (byte)((this.OwnerMask >> 8) % 256);
bytes[i++] = (byte)((this.OwnerMask >> 16) % 256);
bytes[i++] = (byte)((this.OwnerMask >> 24) % 256);
bytes[i++] = (byte)(this.NextOwnerMask % 256);
bytes[i++] = (byte)((this.NextOwnerMask >> 8) % 256);
bytes[i++] = (byte)((this.NextOwnerMask >> 16) % 256);
bytes[i++] = (byte)((this.NextOwnerMask >> 24) % 256);
bytes[i++] = (byte)(this.GroupMask % 256);
bytes[i++] = (byte)((this.GroupMask >> 8) % 256);
bytes[i++] = (byte)((this.GroupMask >> 16) % 256);
bytes[i++] = (byte)((this.GroupMask >> 24) % 256);
bytes[i++] = (byte)(this.EveryoneMask % 256);
bytes[i++] = (byte)((this.EveryoneMask >> 8) % 256);
bytes[i++] = (byte)((this.EveryoneMask >> 16) % 256);
bytes[i++] = (byte)((this.EveryoneMask >> 24) % 256);
bytes[i++] = (byte)(this.BaseMask % 256);
bytes[i++] = (byte)((this.BaseMask >> 8) % 256);
bytes[i++] = (byte)((this.BaseMask >> 16) % 256);
bytes[i++] = (byte)((this.BaseMask >> 24) % 256);
Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12;
if (this.Rotation == new LLQuaternion(0,0,0,0))
{
this.Rotation = new LLQuaternion(0, 1, 0, 0);
}
Array.Copy(this.Rotation.GetBytes(), 0, bytes, i, 12); i += 12;
bytes[i++] = (byte)(this.LocalID % 256);
bytes[i++] = (byte)((this.LocalID >> 8) % 256);
bytes[i++] = (byte)((this.LocalID >> 16) % 256);
bytes[i++] = (byte)((this.LocalID >> 24) % 256);
Array.Copy(FullID.GetBytes(), 0, bytes, i, 16); i += 16;
return bytes;
}
}
}

View File

@ -0,0 +1,198 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Console;
using libsecondlife;
namespace OpenSim.Framework.Types
{
public class RegionInfo
{
public LLUUID SimUUID;
public string RegionName;
public uint RegionLocX;
public uint RegionLocY;
public ulong RegionHandle;
public ushort RegionWaterHeight = 20;
public bool RegionTerraform = true;
public int IPListenPort;
public string IPListenAddr;
private bool isSandbox;
public string DataStore;
// Region Information
// Low resolution 'base' textures. No longer used.
public LLUUID TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); // Default
public LLUUID TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); // Default
public LLUUID TerrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); // Default
public LLUUID TerrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); // Default
// Higher resolution terrain textures
public LLUUID TerrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000");
public LLUUID TerrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000");
public LLUUID TerrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000");
public LLUUID TerrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000");
// First quad - each point is bilinearly interpolated at each meter of terrain
public float TerrainStartHeight00 = 10.0f; // NW Corner ( I think )
public float TerrainStartHeight01 = 10.0f; // NE Corner ( I think )
public float TerrainStartHeight10 = 10.0f; // SW Corner ( I think )
public float TerrainStartHeight11 = 10.0f; // SE Corner ( I think )
// Second quad - also bilinearly interpolated.
// Terrain texturing is done that:
// 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y]
public float TerrainHeightRange00 = 60.0f;
public float TerrainHeightRange01 = 60.0f;
public float TerrainHeightRange10 = 60.0f;
public float TerrainHeightRange11 = 60.0f;
// Terrain Default (Must be in F32 Format!)
public string TerrainFile = "default.r32";
public double TerrainMultiplier = 60.0;
public RegionInfo()
{
}
public void InitConfig(bool sandboxMode, IGenericConfig configData)
{
this.isSandbox = sandboxMode;
try
{
// Sim UUID
string attri = "";
attri = configData.GetAttribute("SimUUID");
if (attri == "")
{
this.SimUUID = LLUUID.Random();
configData.SetAttribute("SimUUID", this.SimUUID.ToString());
}
else
{
this.SimUUID = new LLUUID(attri);
}
// Sim name
attri = "";
attri = configData.GetAttribute("SimName");
if (attri == "")
{
this.RegionName = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Name", "OpenSim test");
configData.SetAttribute("SimName", this.RegionName);
}
else
{
this.RegionName = attri;
}
// Sim/Grid location X
attri = "";
attri = configData.GetAttribute("SimLocationX");
if (attri == "")
{
string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location X", "997");
configData.SetAttribute("SimLocationX", location);
this.RegionLocX = (uint)Convert.ToUInt32(location);
}
else
{
this.RegionLocX = (uint)Convert.ToUInt32(attri);
}
// Sim/Grid location Y
attri = "";
attri = configData.GetAttribute("SimLocationY");
if (attri == "")
{
string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location Y", "996");
configData.SetAttribute("SimLocationY", location);
this.RegionLocY = (uint)Convert.ToUInt32(location);
}
else
{
this.RegionLocY = (uint)Convert.ToUInt32(attri);
}
// Local storage datastore
attri = "";
attri = configData.GetAttribute("Datastore");
if (attri == "")
{
string datastore = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Filename for local storage", "localworld.yap");
configData.SetAttribute("Datastore", datastore);
this.DataStore = datastore;
}
else
{
this.DataStore = attri;
}
//Sim Listen Port
attri = "";
attri = configData.GetAttribute("SimListenPort");
if (attri == "")
{
string port = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("UDP port for client connections", "9000");
configData.SetAttribute("SimListenPort", port);
this.IPListenPort = Convert.ToInt32(port);
}
else
{
this.IPListenPort = Convert.ToInt32(attri);
}
//Sim Listen Address
attri = "";
attri = configData.GetAttribute("SimListenAddress");
if (attri == "")
{
this.IPListenAddr = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("IP Address to listen on for client connections", "127.0.0.1");
configData.SetAttribute("SimListenAddress", this.IPListenAddr);
}
else
{
// Probably belongs elsewhere, but oh well.
if (attri.Trim().StartsWith("SYSTEMIP"))
{
string localhostname = System.Net.Dns.GetHostName();
System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname);
try
{
this.IPListenAddr = ips[0].ToString();
}
catch (Exception e)
{
e.ToString();
this.IPListenAddr = "127.0.0.1"; // Use the default if we fail
}
}
else
{
this.IPListenAddr = attri;
}
}
this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
configData.Commit();
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Config.cs:InitConfig() - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString());
}
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Sim settings loaded:");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "UUID: " + this.SimUUID.ToStringHyphenated());
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Name: " + this.RegionName);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Region Handle: " + this.RegionHandle.ToString());
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Sandbox Mode? " + isSandbox.ToString());
}
}
}

View File

@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using OpenSim.Framework.Inventory;
using System.Security.Cryptography;
namespace OpenSim.Framework.User
{
public class UserProfile
{
public string firstname;
public string lastname;
public ulong homeregionhandle;
public LLVector3 homepos;
public LLVector3 homelookat;
public bool IsGridGod = false;
public bool IsLocal = true; // will be used in future for visitors from foreign grids
public string AssetURL;
public string MD5passwd;
public LLUUID CurrentSessionID;
public LLUUID CurrentSecureSessionID;
public LLUUID UUID;
public Dictionary<LLUUID, uint> Circuits = new Dictionary<LLUUID, uint>(); // tracks circuit codes
public AgentInventory Inventory;
public UserProfile()
{
Circuits = new Dictionary<LLUUID, uint>();
Inventory = new AgentInventory();
homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
homepos = new LLVector3();
homelookat = new LLVector3();
}
public void InitSessionData()
{
RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
byte[] randDataS = new byte[16];
byte[] randDataSS = new byte[16];
rand.GetBytes(randDataS);
rand.GetBytes(randDataSS);
CurrentSecureSessionID = new LLUUID(randDataSS,0);
CurrentSessionID = new LLUUID(randDataS,0);
}
public void AddSimCircuit(uint circuitCode, LLUUID regionUUID)
{
if (this.Circuits.ContainsKey(regionUUID) == false)
this.Circuits.Add(regionUUID, circuitCode);
}
}
}

View File

@ -0,0 +1,272 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using libsecondlife;
using Nwc.XmlRpc;
using OpenSim.Framework.Sims;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.Utilities;
namespace OpenSim.Framework.User
{
public class UserProfileManager : UserProfileManagerBase
{
public string GridURL;
public string GridSendKey;
public string GridRecvKey;
public string DefaultStartupMsg;
public UserProfileManager()
{
}
public void SetKeys(string sendKey, string recvKey, string url, string message)
{
GridRecvKey = recvKey;
GridSendKey = sendKey;
GridURL = url;
DefaultStartupMsg = message;
}
public virtual string ParseXMLRPC(string requestBody)
{
XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
switch (request.MethodName)
{
case "login_to_simulator":
XmlRpcResponse response = XmlRpcLoginMethod(request);
return (Regex.Replace(XmlRpcResponseSerializer.Singleton.Serialize(response), "utf-16", "utf-8"));
}
return "";
}
public string RestDeleteUserSessionMethod( string request, string path, string param )
{
LLUUID sessionid = new LLUUID(param); // get usersessions/sessionid
foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys)
{
if ( UserProfiles[UUID].CurrentSessionID == sessionid)
{
UserProfiles[UUID].CurrentSessionID = null;
UserProfiles[UUID].CurrentSecureSessionID = null;
UserProfiles[UUID].Circuits.Clear();
}
}
return "OK";
}
public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable)request.Params[0];
bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
bool GoodLogin = false;
string firstname = "";
string lastname = "";
string passwd = "";
if (GoodXML)
{
firstname = (string)requestData["first"];
lastname = (string)requestData["last"];
passwd = (string)requestData["passwd"];
GoodLogin = AuthenticateUser(firstname, lastname, passwd);
}
if (!(GoodXML && GoodLogin))
{
response = CreateErrorConnectingToGridResponse();
}
else
{
UserProfile TheUser = GetProfileByName(firstname, lastname);
//we need to sort out how sessions are logged out , currently the sim tells the gridserver
//but if as this suggests the userserver handles it then please have the sim telling the userserver instead
//as it really makes things messy for sandbox mode
//if (!((TheUser.CurrentSessionID == null) && (TheUser.CurrentSecureSessionID == null)))
// {
// response = CreateAlreadyLoggedInResponse();
// }
//else
//{
try
{
Hashtable responseData = new Hashtable();
LLUUID AgentID = TheUser.UUID;
TheUser.InitSessionData();
//for loading data from a grid server, make any changes in CustomiseResponse() (or create a sub class of this and override that method)
//SimProfile SimInfo = new SimProfile();
//SimInfo = SimInfo.LoadFromGrid(TheUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey);
Hashtable GlobalT = new Hashtable();
GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271";
GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
ArrayList GlobalTextures = new ArrayList();
GlobalTextures.Add(GlobalT);
Hashtable LoginFlagsHash = new Hashtable();
LoginFlagsHash["daylight_savings"] = "N";
LoginFlagsHash["stipend_since_login"] = "N";
LoginFlagsHash["gendered"] = "Y";
LoginFlagsHash["ever_logged_in"] = "Y";
ArrayList LoginFlags = new ArrayList();
LoginFlags.Add(LoginFlagsHash);
Hashtable uiconfig = new Hashtable();
uiconfig["allow_first_life"] = "Y";
ArrayList ui_config = new ArrayList();
ui_config.Add(uiconfig);
Hashtable ClassifiedCategoriesHash = new Hashtable();
ClassifiedCategoriesHash["category_name"] = "bla bla";
ClassifiedCategoriesHash["category_id"] = (Int32)1;
ArrayList ClassifiedCategories = new ArrayList();
ClassifiedCategories.Add(ClassifiedCategoriesHash);
ArrayList AgentInventory = new ArrayList();
System.Console.WriteLine("adding inventory to response");
Hashtable TempHash;
foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values)
{
TempHash = new Hashtable();
System.Console.WriteLine("adding folder " + InvFolder.FolderName + ", ID: " + InvFolder.FolderID.ToStringHyphenated() + " with parent: " + InvFolder.ParentID.ToStringHyphenated());
TempHash["name"] = InvFolder.FolderName;
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
TempHash["version"] = (Int32)InvFolder.Version;
TempHash["type_default"] = (Int32)InvFolder.DefaultType;
TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
AgentInventory.Add(TempHash);
}
Hashtable InventoryRootHash = new Hashtable();
InventoryRootHash["folder_id"] = TheUser.Inventory.InventoryRoot.FolderID.ToStringHyphenated();
ArrayList InventoryRoot = new ArrayList();
InventoryRoot.Add(InventoryRootHash);
Hashtable InitialOutfitHash = new Hashtable();
InitialOutfitHash["folder_name"] = "Nightclub Female";
InitialOutfitHash["gender"] = "female";
ArrayList InitialOutfit = new ArrayList();
InitialOutfit.Add(InitialOutfitHash);
uint circode = (uint)(Util.RandomClass.Next());
//TheUser.AddSimCircuit(circode, SimInfo.UUID);
responseData["last_name"] = TheUser.lastname;
responseData["ui-config"] = ui_config;
responseData["sim_ip"] = "127.0.0.1"; //SimInfo.sim_ip.ToString();
responseData["login-flags"] = LoginFlags;
responseData["global-textures"] = GlobalTextures;
responseData["classified_categories"] = ClassifiedCategories;
responseData["event_categories"] = new ArrayList();
responseData["inventory-skeleton"] = AgentInventory;
responseData["inventory-skel-lib"] = new ArrayList();
responseData["inventory-root"] = InventoryRoot;
responseData["event_notifications"] = new ArrayList();
responseData["gestures"] = new ArrayList();
responseData["inventory-lib-owner"] = new ArrayList();
responseData["initial-outfit"] = InitialOutfit;
responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
responseData["start_location"] = "last";
responseData["home"] = "{'region_handle':[r" + (0 * 256).ToString() + ",r" + (0 * 256).ToString() + "], 'position':[r" + TheUser.homepos.X.ToString() + ",r" + TheUser.homepos.Y.ToString() + ",r" + TheUser.homepos.Z.ToString() + "], 'look_at':[r" + TheUser.homelookat.X.ToString() + ",r" + TheUser.homelookat.Y.ToString() + ",r" + TheUser.homelookat.Z.ToString() + "]}";
responseData["message"] = DefaultStartupMsg;
responseData["first_name"] = TheUser.firstname;
responseData["circuit_code"] = (Int32)circode;
responseData["sim_port"] = 0; //(Int32)SimInfo.sim_port;
responseData["secure_session_id"] = TheUser.CurrentSecureSessionID.ToStringHyphenated();
responseData["look_at"] = "\n[r" + TheUser.homelookat.X.ToString() + ",r" + TheUser.homelookat.Y.ToString() + ",r" + TheUser.homelookat.Z.ToString() + "]\n";
responseData["agent_id"] = AgentID.ToStringHyphenated();
responseData["region_y"] = (Int32)0 * 256; // (Int32)SimInfo.RegionLocY * 256;
responseData["region_x"] = (Int32)0 * 256; //SimInfo.RegionLocX * 256;
responseData["seed_capability"] = "";
responseData["agent_access"] = "M";
responseData["session_id"] = TheUser.CurrentSessionID.ToStringHyphenated();
responseData["login"] = "true";
this.CustomiseResponse(ref responseData, TheUser);
response.Value = responseData;
// TheUser.SendDataToSim(SimInfo);
return response;
}
catch (Exception E)
{
System.Console.WriteLine(E.ToString());
}
//}
}
return response;
}
private static XmlRpcResponse CreateErrorConnectingToGridResponse()
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable ErrorRespData = new Hashtable();
ErrorRespData["reason"] = "key";
ErrorRespData["message"] = "Error connecting to grid. Please double check your login details and check with the grid owner if you are sure these are correct";
ErrorRespData["login"] = "false";
response.Value = ErrorRespData;
return response;
}
private static XmlRpcResponse CreateAlreadyLoggedInResponse()
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable PresenceErrorRespData = new Hashtable();
PresenceErrorRespData["reason"] = "presence";
PresenceErrorRespData["message"] = "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner";
PresenceErrorRespData["login"] = "false";
response.Value = PresenceErrorRespData;
return response;
}
public virtual void CustomiseResponse(ref Hashtable response, UserProfile theUser)
{
//default method set up to act as ogs user server
SimProfile SimInfo= new SimProfile();
//get siminfo from grid server
SimInfo = SimInfo.LoadFromGrid(theUser.homeregionhandle, GridURL, GridSendKey, GridRecvKey);
Int32 circode = (Int32)Convert.ToUInt32(response["circuit_code"]);
theUser.AddSimCircuit((uint)circode, SimInfo.UUID);
response["home"] = "{'region_handle':[r" + (SimInfo.RegionLocX * 256).ToString() + ",r" + (SimInfo.RegionLocY * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}";
response["sim_ip"] = SimInfo.sim_ip;
response["sim_port"] = (Int32)SimInfo.sim_port;
response["region_y"] = (Int32)SimInfo.RegionLocY * 256;
response["region_x"] = (Int32)SimInfo.RegionLocX * 256;
//default is ogs user server, so let the sim know about the user via a XmlRpcRequest
System.Console.WriteLine(SimInfo.caps_url);
Hashtable SimParams = new Hashtable();
SimParams["session_id"] = theUser.CurrentSessionID.ToString();
SimParams["secure_session_id"] = theUser.CurrentSecureSessionID.ToString();
SimParams["firstname"] = theUser.firstname;
SimParams["lastname"] = theUser.lastname;
SimParams["agent_id"] = theUser.UUID.ToString();
SimParams["circuit_code"] = (Int32)circode;
SimParams["startpos_x"] = theUser.homepos.X.ToString();
SimParams["startpos_y"] = theUser.homepos.Y.ToString();
SimParams["startpos_z"] = theUser.homepos.Z.ToString();
ArrayList SendParams = new ArrayList();
SendParams.Add(SimParams);
XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000);
}
}
}

View File

@ -0,0 +1,124 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Inventory;
using Db4objects.Db4o;
namespace OpenSim.Framework.User
{
public class UserProfileManagerBase
{
public Dictionary<LLUUID, UserProfile> UserProfiles = new Dictionary<LLUUID, UserProfile>();
public UserProfileManagerBase()
{
}
public virtual void InitUserProfiles()
{
IObjectContainer db;
db = Db4oFactory.OpenFile("userprofiles.yap");
IObjectSet result = db.Get(typeof(UserProfile));
foreach (UserProfile userprof in result)
{
UserProfiles.Add(userprof.UUID, userprof);
}
System.Console.WriteLine("UserProfiles.Cs:InitUserProfiles() - Successfully loaded " + result.Count.ToString() + " from database");
db.Close();
}
public virtual void SaveUserProfiles() // ZOMG! INEFFICIENT!
{
IObjectContainer db;
db = Db4oFactory.OpenFile("userprofiles.yap");
IObjectSet result = db.Get(typeof(UserProfile));
foreach (UserProfile userprof in result)
{
db.Delete(userprof);
db.Commit();
}
foreach (UserProfile userprof in UserProfiles.Values)
{
db.Set(userprof);
db.Commit();
}
db.Close();
}
public UserProfile GetProfileByName(string firstname, string lastname)
{
foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys)
{
if (UserProfiles[UUID].firstname.Equals(firstname)) if (UserProfiles[UUID].lastname.Equals(lastname))
{
return UserProfiles[UUID];
}
}
return null;
}
public UserProfile GetProfileByLLUUID(LLUUID ProfileLLUUID)
{
return UserProfiles[ProfileLLUUID];
}
public virtual bool AuthenticateUser(string firstname, string lastname, string passwd)
{
UserProfile TheUser = GetProfileByName(firstname, lastname);
passwd = passwd.Remove(0, 3); //remove $1$
if (TheUser != null)
{
if (TheUser.MD5passwd == passwd)
{
System.Console.WriteLine("UserProfile - authorised " + firstname + " " + lastname);
return true;
}
else
{
System.Console.WriteLine("UserProfile - not authorised, password not match " + TheUser.MD5passwd + " and " + passwd);
return false;
}
}
else
{
System.Console.WriteLine("UserProfile - not authorised , unkown: " + firstname + " , " + lastname);
return false;
}
}
public void SetGod(LLUUID GodID)
{
this.UserProfiles[GodID].IsGridGod = true;
}
public virtual UserProfile CreateNewProfile(string firstname, string lastname, string MD5passwd)
{
System.Console.WriteLine("creating new profile for : " + firstname + " , " + lastname);
UserProfile newprofile = new UserProfile();
newprofile.homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
newprofile.firstname = firstname;
newprofile.lastname = lastname;
newprofile.MD5passwd = MD5passwd;
newprofile.UUID = LLUUID.Random();
newprofile.Inventory.CreateRootFolder(newprofile.UUID, true);
this.UserProfiles.Add(newprofile.UUID, newprofile);
return newprofile;
}
public virtual AgentInventory GetUsersInventory(LLUUID agentID)
{
UserProfile user = this.GetProfileByLLUUID(agentID);
if (user != null)
{
return user.Inventory;
}
return null;
}
}
}

View File

@ -0,0 +1,151 @@
using System;
using System.Security.Cryptography;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
namespace OpenSim.Framework.Utilities
{
public class Util
{
private static Random randomClass = new Random();
private static uint nextXferID = 5000;
private static object XferLock = new object();
public static ulong UIntsToLong(uint X, uint Y)
{
return Helpers.UIntsToLong(X, Y);
}
public static Random RandomClass
{
get
{
return randomClass;
}
}
public static uint GetNextXferID()
{
uint id = 0;
lock(XferLock)
{
id = nextXferID;
nextXferID++;
}
return id;
}
public static int UnixTimeSinceEpoch()
{
TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1));
int timestamp = (int)t.TotalSeconds;
return timestamp;
}
public static string Md5Hash(string pass)
{
MD5 md5 = MD5CryptoServiceProvider.Create();
byte[] dataMd5 = md5.ComputeHash(Encoding.Default.GetBytes(pass));
StringBuilder sb = new StringBuilder();
for (int i = 0; i < dataMd5.Length; i++)
sb.AppendFormat("{0:x2}", dataMd5[i]);
return sb.ToString();
}
//public static int fast_distance2d(int x, int y)
//{
// x = System.Math.Abs(x);
// y = System.Math.Abs(y);
// int min = System.Math.Min(x, y);
// return (x + y - (min >> 1) - (min >> 2) + (min >> 4));
//}
public static string FieldToString(byte[] bytes)
{
return FieldToString(bytes, String.Empty);
}
/// <summary>
/// Convert a variable length field (byte array) to a string, with a
/// field name prepended to each line of the output
/// </summary>
/// <remarks>If the byte array has unprintable characters in it, a
/// hex dump will be put in the string instead</remarks>
/// <param name="bytes">The byte array to convert to a string</param>
/// <param name="fieldName">A field name to prepend to each line of output</param>
/// <returns>An ASCII string or a string containing a hex dump, minus
/// the null terminator</returns>
public static string FieldToString(byte[] bytes, string fieldName)
{
// Check for a common case
if (bytes.Length == 0) return String.Empty;
StringBuilder output = new StringBuilder();
bool printable = true;
for (int i = 0; i < bytes.Length; ++i)
{
// Check if there are any unprintable characters in the array
if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09
&& bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00)
{
printable = false;
break;
}
}
if (printable)
{
if (fieldName.Length > 0)
{
output.Append(fieldName);
output.Append(": ");
}
if (bytes[bytes.Length - 1] == 0x00)
output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1));
else
output.Append(UTF8Encoding.UTF8.GetString(bytes));
}
else
{
for (int i = 0; i < bytes.Length; i += 16)
{
if (i != 0)
output.Append(Environment.NewLine);
if (fieldName.Length > 0)
{
output.Append(fieldName);
output.Append(": ");
}
for (int j = 0; j < 16; j++)
{
if ((i + j) < bytes.Length)
output.Append(String.Format("{0:X2} ", bytes[i + j]));
else
output.Append(" ");
}
for (int j = 0; j < 16 && (i + j) < bytes.Length; j++)
{
if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E)
output.Append((char)bytes[i + j]);
else
output.Append(".");
}
}
}
return output.ToString();
}
public Util()
{
}
}
}

View File

@ -0,0 +1,93 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E88EF749-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenSim.GenericConfig.Xml</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenSim.GenericConfig.Xml</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\OpenSim.Framework\OpenSim.Framework.csproj">
<Name>OpenSim.Framework</Name>
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="XmlConfig.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,12 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" ?>
<project name="OpenSim.GenericConfig.Xml" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenSim.GenericConfig.Xml" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="XmlConfig.cs" />
<include name="Properties/AssemblyInfo.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Xml.dll" />
<include name="../../../bin/OpenSim.Framework.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../../bin/"/>
<copy todir="${project::get-base-directory()}/../../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -0,0 +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("OpenSim.GenericConfig")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenSim.GenericConfig")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("285a3047-f165-46c8-8767-b51428738a09")]
// 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")]

View File

@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using OpenSim.Framework.Interfaces;
namespace OpenSim.GenericConfig
{
public class XmlConfig : IGenericConfig
{
private XmlDocument doc;
private XmlNode rootNode;
private XmlNode configNode;
private string fileName;
private bool createdFile = false;
public XmlConfig(string filename)
{
fileName = filename;
}
public void LoadData()
{
doc = new XmlDocument();
try
{
if (System.IO.File.Exists(fileName))
{
XmlTextReader reader = new XmlTextReader(fileName);
reader.WhitespaceHandling = WhitespaceHandling.None;
doc.Load(reader);
reader.Close();
}
else
{
createdFile = true;
rootNode = doc.CreateNode(XmlNodeType.Element, "Root", "");
doc.AppendChild(rootNode);
configNode = doc.CreateNode(XmlNodeType.Element, "Config", "");
rootNode.AppendChild(configNode);
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return;
}
try
{
rootNode = doc.FirstChild;
if (rootNode.Name != "Root")
throw new Exception("Error: Invalid .xml File. Missing <Root>");
configNode = rootNode.FirstChild;
if (configNode.Name != "Config")
throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
if (createdFile)
{
this.Commit();
}
}
public string GetAttribute(string attributeName)
{
string result = "";
if (configNode.Attributes[attributeName] != null)
{
result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value;
}
return result;
}
public bool SetAttribute(string attributeName, string attributeValue)
{
if (configNode.Attributes[attributeName] != null)
{
((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue;
}
else
{
XmlAttribute attri;
attri = doc.CreateAttribute(attributeName);
attri.Value = attributeValue;
configNode.Attributes.Append(attri);
}
return true;
}
public void Commit()
{
doc.Save(fileName);
}
public void Close()
{
configNode = null;
rootNode = null;
doc = null;
}
}
}

View File

@ -0,0 +1,256 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
//using OpenSim.CAPS;
using Nwc.XmlRpc;
using System.Collections;
using OpenSim.Framework.Console;
namespace OpenSim.Servers
{
public class BaseHttpServer
{
protected class RestMethodEntry
{
private string m_path;
public string Path
{
get { return m_path; }
}
private RestMethod m_restMethod;
public RestMethod RestMethod
{
get { return m_restMethod; }
}
public RestMethodEntry(string path, RestMethod restMethod)
{
m_path = path;
m_restMethod = restMethod;
}
}
protected Thread m_workerThread;
protected HttpListener m_httpListener;
protected Dictionary<string, RestMethodEntry> m_restHandlers = new Dictionary<string, RestMethodEntry>();
protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>();
protected int m_port;
public BaseHttpServer(int port)
{
m_port = port;
}
public bool AddRestHandler(string method, string path, RestMethod handler)
{
string methodKey = String.Format("{0}: {1}", method, path);
if (!this.m_restHandlers.ContainsKey(methodKey))
{
this.m_restHandlers.Add(methodKey, new RestMethodEntry(path, handler));
return true;
}
//must already have a handler for that path so return false
return false;
}
public bool AddXmlRPCHandler(string method, XmlRpcMethod handler)
{
if (!this.m_rpcHandlers.ContainsKey(method))
{
this.m_rpcHandlers.Add(method, handler);
return true;
}
//must already have a handler for that path so return false
return false;
}
protected virtual string ProcessXMLRPCMethod(string methodName, XmlRpcRequest request)
{
XmlRpcResponse response;
XmlRpcMethod method;
if (this.m_rpcHandlers.TryGetValue(methodName, out method))
{
response = method(request);
}
else
{
response = new XmlRpcResponse();
Hashtable unknownMethodError = new Hashtable();
unknownMethodError["reason"] = "XmlRequest"; ;
unknownMethodError["message"] = "Unknown Rpc request";
unknownMethodError["login"] = "false";
response.Value = unknownMethodError;
}
return XmlRpcResponseSerializer.Singleton.Serialize(response);
}
protected virtual string ParseREST(string request, string path, string method)
{
string response;
string requestKey = String.Format("{0}: {1}", method, path);
string bestMatch = String.Empty;
foreach (string currentKey in m_restHandlers.Keys)
{
if (requestKey.StartsWith(currentKey))
{
if (currentKey.Length > bestMatch.Length)
{
bestMatch = currentKey;
}
}
}
RestMethodEntry restMethodEntry;
if (m_restHandlers.TryGetValue(bestMatch, out restMethodEntry))
{
RestMethod restMethod = restMethodEntry.RestMethod;
string param = path.Substring(restMethodEntry.Path.Length);
response = restMethod(request, path, param);
}
else
{
response = String.Empty;
}
return response;
}
protected virtual string ParseLLSDXML(string requestBody)
{
// dummy function for now - IMPLEMENT ME!
return "";
}
protected virtual string ParseXMLRPC(string requestBody)
{
string responseString = String.Empty;
try
{
XmlRpcRequest request = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody);
string methodName = request.MethodName;
responseString = ProcessXMLRPCMethod(methodName, request);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
return responseString;
}
public virtual void HandleRequest(Object stateinfo)
{
try
{
HttpListenerContext context = (HttpListenerContext)stateinfo;
HttpListenerRequest request = context.Request;
HttpListenerResponse response = context.Response;
response.KeepAlive = false;
response.SendChunked = false;
System.IO.Stream body = request.InputStream;
System.Text.Encoding encoding = System.Text.Encoding.UTF8;
System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding);
string requestBody = reader.ReadToEnd();
body.Close();
reader.Close();
//Console.WriteLine(request.HttpMethod + " " + request.RawUrl + " Http/" + request.ProtocolVersion.ToString() + " content type: " + request.ContentType);
//Console.WriteLine(requestBody);
string responseString = "";
switch (request.ContentType)
{
case "text/xml":
// must be XML-RPC, so pass to the XML-RPC parser
responseString = ParseXMLRPC(requestBody);
responseString = Regex.Replace(responseString, "utf-16", "utf-8");
response.AddHeader("Content-type", "text/xml");
break;
case "application/xml":
// probably LLSD we hope, otherwise it should be ignored by the parser
responseString = ParseLLSDXML(requestBody);
response.AddHeader("Content-type", "application/xml");
break;
case "application/x-www-form-urlencoded":
// a form data POST so send to the REST parser
responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
response.AddHeader("Content-type", "text/html");
break;
case null:
// must be REST or invalid crap, so pass to the REST parser
responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
response.AddHeader("Content-type", "text/html");
break;
}
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
System.IO.Stream output = response.OutputStream;
response.SendChunked = false;
response.ContentLength64 = buffer.Length;
output.Write(buffer, 0, buffer.Length);
output.Close();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
public void Start()
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server");
m_workerThread = new Thread(new ThreadStart(StartHTTP));
m_workerThread.IsBackground = true;
m_workerThread.Start();
}
private void StartHTTP()
{
try
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK");
m_httpListener = new HttpListener();
m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
m_httpListener.Start();
HttpListenerContext context;
while (true)
{
context = m_httpListener.GetContext();
ThreadPool.QueueUserWorkItem(new WaitCallback(HandleRequest), context);
}
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM, e.Message);
}
}
}
}

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Servers
{
public class BaseServer
{
}
}

View File

@ -0,0 +1,113 @@
using System;
using System.Text;
using System.IO;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.Timers;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.Framework.Console;
namespace OpenSim.Servers
{
public class CheckSumServer : UDPServerBase
{
//protected ConsoleBase m_console;
public CheckSumServer(int port)
: base(port)
{
}
protected override void OnReceivedData(IAsyncResult result)
{
ipeSender = new IPEndPoint(IPAddress.Any, 0);
epSender = (EndPoint)ipeSender;
Packet packet = null;
int numBytes = Server.EndReceiveFrom(result, ref epSender);
int packetEnd = numBytes - 1;
packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
if (packet.Type == PacketType.SecuredTemplateChecksumRequest)
{
SecuredTemplateChecksumRequestPacket checksum = (SecuredTemplateChecksumRequestPacket)packet;
TemplateChecksumReplyPacket checkreply = new TemplateChecksumReplyPacket();
checkreply.DataBlock.Checksum = 3220703154;//180572585;
checkreply.DataBlock.Flags = 0;
checkreply.DataBlock.MajorVersion = 1;
checkreply.DataBlock.MinorVersion = 15;
checkreply.DataBlock.PatchVersion = 0;
checkreply.DataBlock.ServerVersion = 0;
checkreply.TokenBlock.Token = checksum.TokenBlock.Token;
this.SendPacket(checkreply, epSender);
/*
//if we wanted to echo the the checksum/ version from the client (so that any client worked)
SecuredTemplateChecksumRequestPacket checkrequest = new SecuredTemplateChecksumRequestPacket();
checkrequest.TokenBlock.Token = checksum.TokenBlock.Token;
this.SendPacket(checkrequest, epSender);
*/
}
else if (packet.Type == PacketType.TemplateChecksumReply)
{
//echo back the client checksum reply (Hegemon's method)
TemplateChecksumReplyPacket checksum2 = (TemplateChecksumReplyPacket)packet;
TemplateChecksumReplyPacket checkreply2 = new TemplateChecksumReplyPacket();
checkreply2.DataBlock.Checksum = checksum2.DataBlock.Checksum;
checkreply2.DataBlock.Flags = checksum2.DataBlock.Flags;
checkreply2.DataBlock.MajorVersion = checksum2.DataBlock.MajorVersion;
checkreply2.DataBlock.MinorVersion = checksum2.DataBlock.MinorVersion;
checkreply2.DataBlock.PatchVersion = checksum2.DataBlock.PatchVersion;
checkreply2.DataBlock.ServerVersion = checksum2.DataBlock.ServerVersion;
checkreply2.TokenBlock.Token = checksum2.TokenBlock.Token;
this.SendPacket(checkreply2, epSender);
}
else
{
}
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
}
private void SendPacket(Packet Pack, EndPoint endp)
{
if (!Pack.Header.Resent)
{
Pack.Header.Sequence = 1;
}
byte[] ZeroOutBuffer = new byte[4096];
byte[] sendbuffer;
sendbuffer = Pack.ToBytes();
try
{
if (Pack.Header.Zerocoded)
{
int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
this.SendPackTo(ZeroOutBuffer, packetsize, SocketFlags.None, endp);
}
else
{
this.SendPackTo(sendbuffer, sendbuffer.Length, SocketFlags.None, endp);
}
}
catch (Exception)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection ");
}
}
private void SendPackTo(byte[] buffer, int size, SocketFlags flags, EndPoint endp)
{
this.Server.SendTo(buffer, size, flags, endp);
}
}
}

View File

@ -0,0 +1,8 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Servers
{
public delegate string RestMethod( string request, string path, string param );
}

View File

@ -0,0 +1,123 @@
/*
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
*
* 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.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> 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 <copyright holder> ``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 <copyright holder> 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.Generic;
using System.Collections;
using System.Text;
using OpenSim.Framework.User;
using OpenSim.Framework.Grid;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
using libsecondlife;
namespace OpenSim.UserServer
{
public class LocalUserProfileManager : UserProfileManager
{
private IGridServer m_gridServer;
private int m_port;
private string m_ipAddr;
private uint regionX;
private uint regionY;
private AddNewSessionHandler AddSession;
public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY)
{
m_gridServer = gridServer;
m_port = simPort;
m_ipAddr = ipAddr;
regionX = regX;
regionY = regY;
}
public void SetSessionHandler(AddNewSessionHandler sessionHandler)
{
this.AddSession = sessionHandler;
}
public override void InitUserProfiles()
{
// TODO: need to load from database
}
public override void CustomiseResponse(ref System.Collections.Hashtable response, UserProfile theUser)
{
Int32 circode = (Int32)response["circuit_code"];
theUser.AddSimCircuit((uint)circode, LLUUID.Random());
response["home"] = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + theUser.homepos.X.ToString() + ",r" + theUser.homepos.Y.ToString() + ",r" + theUser.homepos.Z.ToString() + "], 'look_at':[r" + theUser.homelookat.X.ToString() + ",r" + theUser.homelookat.Y.ToString() + ",r" + theUser.homelookat.Z.ToString() + "]}";
response["sim_port"] = m_port;
response["sim_ip"] = m_ipAddr;
response["region_y"] = (Int32)regionY* 256;
response["region_x"] = (Int32)regionX* 256;
string first;
string last;
if (response.Contains("first_name"))
{
first = (string)response["first_name"];
}
else
{
first = "test";
}
if (response.Contains("last_name"))
{
last = (string)response["last_name"];
}
else
{
last = "User";
}
ArrayList InventoryList = (ArrayList)response["inventory-skeleton"];
Hashtable Inventory1 = (Hashtable)InventoryList[0];
Login _login = new Login();
//copy data to login object
_login.First = first;
_login.Last = last;
_login.Agent = new LLUUID((string)response["agent_id"]) ;
_login.Session = new LLUUID((string)response["session_id"]);
_login.SecureSession = new LLUUID((string)response["secure_session_id"]);
_login.CircuitCode =(uint) circode;
_login.BaseFolder = null;
_login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]);
//working on local computer if so lets add to the gridserver's list of sessions?
/*if (m_gridServer.GetName() == "Local")
{
Console.WriteLine("adding login data to gridserver");
((LocalGridBase)this.m_gridServer).AddNewSession(_login);
}*/
ulong reghand = Helpers.UIntsToLong((regionX * 256), (regionY * 256));
this.AddSession(reghand, _login);
}
}
}

View File

@ -0,0 +1,670 @@
/*
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
*
* 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.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> 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 <copyright holder> ``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 <copyright holder> 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 Nwc.XmlRpc;
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Collections;
using System.Security.Cryptography;
using System.Xml;
using libsecondlife;
using OpenSim;
using OpenSim.Framework.User;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Interfaces;
// ?
using OpenSim.Framework.Grid;
namespace OpenSim.UserServer
{
/// <summary>
/// A temp class to handle login response.
/// Should make use of UserProfileManager where possible.
/// </summary>
public class LoginResponse
{
private Hashtable loginFlagsHash;
private Hashtable globalTexturesHash;
private Hashtable loginError;
private Hashtable eventCategoriesHash;
private Hashtable uiConfigHash;
private Hashtable classifiedCategoriesHash;
private ArrayList loginFlags;
private ArrayList globalTextures;
private ArrayList eventCategories;
private ArrayList uiConfig;
private ArrayList classifiedCategories;
private ArrayList inventoryRoot;
private ArrayList initialOutfit;
private ArrayList agentInventory;
private UserProfile userProfile;
private LLUUID agentID;
private LLUUID sessionID;
private LLUUID secureSessionID;
private LLUUID baseFolderID;
private LLUUID inventoryFolderID;
// Login Flags
private string dst;
private string stipendSinceLogin;
private string gendered;
private string everLoggedIn;
private string login;
private string simPort;
private string simAddress;
private string agentAccess;
private Int32 circuitCode;
private uint regionX;
private uint regionY;
// Login
private string firstname;
private string lastname;
// Global Textures
private string sunTexture;
private string cloudTexture;
private string moonTexture;
// Error Flags
private string errorReason;
private string errorMessage;
// Response
private XmlRpcResponse xmlRpcResponse;
private XmlRpcResponse defaultXmlRpcResponse;
private string welcomeMessage;
private string startLocation;
private string allowFirstLife;
private string home;
private string seedCapability;
private string lookAt;
public LoginResponse()
{
this.loginFlags = new ArrayList();
this.globalTextures = new ArrayList();
this.eventCategories = new ArrayList();
this.uiConfig = new ArrayList();
this.classifiedCategories = new ArrayList();
this.loginError = new Hashtable();
this.eventCategoriesHash = new Hashtable();
this.classifiedCategoriesHash = new Hashtable();
this.uiConfigHash = new Hashtable();
this.defaultXmlRpcResponse = new XmlRpcResponse();
this.userProfile = new UserProfile();
this.inventoryRoot = new ArrayList();
this.initialOutfit = new ArrayList();
this.agentInventory = new ArrayList();
this.xmlRpcResponse = new XmlRpcResponse();
this.defaultXmlRpcResponse = new XmlRpcResponse();
this.SetDefaultValues();
} // LoginServer
public void SetDefaultValues()
{
try
{
this.DST = "N";
this.StipendSinceLogin = "N";
this.Gendered = "Y";
this.EverLoggedIn = "Y";
this.login = "false";
this.firstname = "Test";
this.lastname = "User";
this.agentAccess = "M";
this.startLocation = "last";
this.allowFirstLife = "Y";
this.SunTexture = "cce0f112-878f-4586-a2e2-a8f104bba271";
this.CloudTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
this.MoonTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
this.ErrorMessage = "You have entered an invalid name/password combination. Check Caps/lock.";
this.ErrorReason = "key";
this.welcomeMessage = "Welcome to OpenSim!";
this.seedCapability = "";
this.home = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + this.userProfile.homepos.X.ToString() + ",r" + this.userProfile.homepos.Y.ToString() + ",r" + this.userProfile.homepos.Z.ToString() + "], 'look_at':[r" + this.userProfile.homelookat.X.ToString() + ",r" + this.userProfile.homelookat.Y.ToString() + ",r" + this.userProfile.homelookat.Z.ToString() + "]}";
this.lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]";
this.RegionX = (uint)255232;
this.RegionY = (uint)254976;
// Classifieds;
this.AddClassifiedCategory((Int32)1, "Shopping");
this.AddClassifiedCategory((Int32)2, "Land Rental");
this.AddClassifiedCategory((Int32)3, "Property Rental");
this.AddClassifiedCategory((Int32)4, "Special Attraction");
this.AddClassifiedCategory((Int32)5, "New Products");
this.AddClassifiedCategory((Int32)6, "Employment");
this.AddClassifiedCategory((Int32)7, "Wanted");
this.AddClassifiedCategory((Int32)8, "Service");
this.AddClassifiedCategory((Int32)9, "Personal");
int SessionRand = Util.RandomClass.Next(1, 999);
this.SessionID = new LLUUID("aaaabbbb-0200-" + SessionRand.ToString("0000") + "-8664-58f53e442797");
this.SecureSessionID = LLUUID.Random();
this.userProfile.Inventory.CreateRootFolder(this.userProfile.UUID, true);
this.baseFolderID = this.userProfile.Inventory.GetFolderID("Textures");
this.inventoryFolderID = this.userProfile.Inventory.GetFolderID("My Inventory-");
Hashtable InventoryRootHash = new Hashtable();
InventoryRootHash["folder_id"] = this.userProfile.Inventory.InventoryRoot.FolderID.ToStringHyphenated();
this.inventoryRoot.Add(InventoryRootHash);
Hashtable TempHash;
foreach (InventoryFolder InvFolder in this.userProfile.Inventory.InventoryFolders.Values)
{
TempHash = new Hashtable();
TempHash["name"] = InvFolder.FolderName;
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
TempHash["version"] = (Int32)InvFolder.Version;
TempHash["type_default"] = (Int32)InvFolder.DefaultType;
TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
this.agentInventory.Add(TempHash);
}
Hashtable InitialOutfitHash = new Hashtable();
InitialOutfitHash["folder_name"] = "Nightclub Female";
InitialOutfitHash["gender"] = "female";
this.initialOutfit.Add(InitialOutfitHash);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(
OpenSim.Framework.Console.LogPriority.LOW,
"LoginResponse: Unable to set default values: " + e.Message
);
}
} // SetDefaultValues
protected virtual LLUUID GetAgentId()
{
// todo
LLUUID Agent;
int AgentRand = Util.RandomClass.Next(1, 9999);
Agent = new LLUUID("99998888-0100-" + AgentRand.ToString("0000") + "-8ec1-0b1d5cd6aead");
return Agent;
} // GetAgentId
private XmlRpcResponse GenerateFailureResponse(string reason, string message, string login)
{
// Overwrite any default values;
this.xmlRpcResponse = new XmlRpcResponse();
// Ensure Login Failed message/reason;
this.ErrorMessage = message;
this.ErrorReason = reason;
this.loginError["reason"] = this.ErrorReason;
this.loginError["message"] = this.ErrorMessage;
this.loginError["login"] = login;
this.xmlRpcResponse.Value = this.loginError;
return (this.xmlRpcResponse);
} // GenerateResponse
public XmlRpcResponse LoginFailedResponse()
{
return (this.GenerateFailureResponse("key", "You have entered an invalid name/password combination. Check Caps/lock.", "false"));
} // LoginFailedResponse
public XmlRpcResponse ConnectionFailedResponse()
{
return (this.LoginFailedResponse());
} // CreateErrorConnectingToGridResponse()
public XmlRpcResponse CreateAlreadyLoggedInResponse()
{
return (this.GenerateFailureResponse("presence", "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner", "false"));
} // CreateAlreadyLoggedInResponse()
public XmlRpcResponse ToXmlRpcResponse()
{
try
{
Hashtable responseData = new Hashtable();
this.loginFlagsHash = new Hashtable();
this.loginFlagsHash["daylight_savings"] = this.DST;
this.loginFlagsHash["stipend_since_login"] = this.StipendSinceLogin;
this.loginFlagsHash["gendered"] = this.Gendered;
this.loginFlagsHash["ever_logged_in"] = this.EverLoggedIn;
this.loginFlags.Add(this.loginFlagsHash);
responseData["first_name"] = this.Firstname;
responseData["last_name"] = this.Lastname;
responseData["agent_access"] = this.agentAccess;
this.globalTexturesHash = new Hashtable();
this.globalTexturesHash["sun_texture_id"] = this.SunTexture;
this.globalTexturesHash["cloud_texture_id"] = this.CloudTexture;
this.globalTexturesHash["moon_texture_id"] = this.MoonTexture;
this.globalTextures.Add(this.globalTexturesHash);
this.eventCategories.Add(this.eventCategoriesHash);
this.AddToUIConfig("allow_first_life", this.allowFirstLife);
this.uiConfig.Add(this.uiConfigHash);
// Create a agent and session LLUUID
this.agentID = this.GetAgentId();
responseData["sim_port"] = this.SimPort;
responseData["sim_ip"] = this.SimAddress;
responseData["agent_id"] = this.AgentID.ToStringHyphenated();
responseData["session_id"] = this.SessionID.ToStringHyphenated();
responseData["secure_session_id"] = this.SecureSessionID.ToStringHyphenated();
responseData["circuit_code"] = this.CircuitCode;
responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
responseData["login-flags"] = this.loginFlags;
responseData["global-textures"] = this.globalTextures;
responseData["seed_capability"] = this.seedCapability;
responseData["event_categories"] = this.eventCategories;
responseData["event_notifications"] = new ArrayList(); // todo
responseData["classified_categories"] = this.classifiedCategories;
responseData["ui-config"] = this.uiConfig;
responseData["inventory-skeleton"] = this.agentInventory;
responseData["inventory-skel-lib"] = new ArrayList(); // todo
responseData["inventory-root"] = this.inventoryRoot;
responseData["gestures"] = new ArrayList(); // todo
responseData["inventory-lib-owner"] = new ArrayList(); // todo
responseData["initial-outfit"] = this.initialOutfit;
responseData["start_location"] = this.startLocation;
responseData["seed_capability"] = this.seedCapability;
responseData["home"] = this.home;
responseData["look_at"] = this.lookAt;
responseData["message"] = this.welcomeMessage;
responseData["region_x"] = (Int32)this.RegionX * 256;
responseData["region_y"] = (Int32)this.RegionY * 256;
responseData["login"] = "true";
this.xmlRpcResponse.Value = responseData;
return (this.xmlRpcResponse);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(
OpenSim.Framework.Console.LogPriority.LOW,
"LoginResponse: Error creating XML-RPC Response: " + e.Message
);
return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false"));
}
} // ToXmlRpcResponse
public void SetEventCategories(string category, string value)
{
this.eventCategoriesHash[category] = value;
} // SetEventCategories
public void AddToUIConfig(string itemName, string item)
{
this.uiConfigHash[itemName] = item;
} // SetUIConfig
public void AddClassifiedCategory(Int32 ID, string categoryName)
{
this.classifiedCategoriesHash["category_name"] = categoryName;
this.classifiedCategoriesHash["category_id"] = ID;
this.classifiedCategories.Add(this.classifiedCategoriesHash);
// this.classifiedCategoriesHash.Clear();
} // SetClassifiedCategory
public string Login
{
get
{
return this.login;
}
set
{
this.login = value;
}
} // Login
public string DST
{
get
{
return this.dst;
}
set
{
this.dst = value;
}
} // DST
public string StipendSinceLogin
{
get
{
return this.stipendSinceLogin;
}
set
{
this.stipendSinceLogin = value;
}
} // StipendSinceLogin
public string Gendered
{
get
{
return this.gendered;
}
set
{
this.gendered = value;
}
} // Gendered
public string EverLoggedIn
{
get
{
return this.everLoggedIn;
}
set
{
this.everLoggedIn = value;
}
} // EverLoggedIn
public string SimPort
{
get
{
return this.simPort;
}
set
{
this.simPort = value;
}
} // SimPort
public string SimAddress
{
get
{
return this.simAddress;
}
set
{
this.simAddress = value;
}
} // SimAddress
public LLUUID AgentID
{
get
{
return this.agentID;
}
set
{
this.agentID = value;
}
} // AgentID
public LLUUID SessionID
{
get
{
return this.sessionID;
}
set
{
this.sessionID = value;
}
} // SessionID
public LLUUID SecureSessionID
{
get
{
return this.secureSessionID;
}
set
{
this.secureSessionID = value;
}
} // SecureSessionID
public LLUUID BaseFolderID
{
get
{
return this.baseFolderID;
}
set
{
this.baseFolderID = value;
}
} // BaseFolderID
public LLUUID InventoryFolderID
{
get
{
return this.inventoryFolderID;
}
set
{
this.inventoryFolderID = value;
}
} // InventoryFolderID
public Int32 CircuitCode
{
get
{
return this.circuitCode;
}
set
{
this.circuitCode = value;
}
} // CircuitCode
public uint RegionX
{
get
{
return this.regionX;
}
set
{
this.regionX = value;
}
} // RegionX
public uint RegionY
{
get
{
return this.regionY;
}
set
{
this.regionY = value;
}
} // RegionY
public string SunTexture
{
get
{
return this.sunTexture;
}
set
{
this.sunTexture = value;
}
} // SunTexture
public string CloudTexture
{
get
{
return this.cloudTexture;
}
set
{
this.cloudTexture = value;
}
} // CloudTexture
public string MoonTexture
{
get
{
return this.moonTexture;
}
set
{
this.moonTexture = value;
}
} // MoonTexture
public string Firstname
{
get
{
return this.firstname;
}
set
{
this.firstname = value;
}
} // Firstname
public string Lastname
{
get
{
return this.lastname;
}
set
{
this.lastname = value;
}
} // Lastname
public string AgentAccess
{
get
{
return this.agentAccess;
}
set
{
this.agentAccess = value;
}
}
public string StartLocation
{
get
{
return this.startLocation;
}
set
{
this.startLocation = value;
}
} // StartLocation
public string LookAt
{
get
{
return this.lookAt;
}
set
{
this.lookAt = value;
}
}
public string SeedCapability
{
get
{
return this.seedCapability;
}
set
{
this.seedCapability = value;
}
} // SeedCapability
public string ErrorReason
{
get
{
return this.errorReason;
}
set
{
this.errorReason = value;
}
} // ErrorReason
public string ErrorMessage
{
get
{
return this.errorMessage;
}
set
{
this.errorMessage = value;
}
} // ErrorMessage
} // LoginResponse
} // namespace OpenSim.UserServer

View File

@ -0,0 +1,285 @@
/*
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
*
* 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.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> 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 <copyright holder> ``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 <copyright holder> 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 Nwc.XmlRpc;
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Collections;
using System.Security.Cryptography;
using System.Xml;
using libsecondlife;
using OpenSim;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Grid;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.User;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Types;
namespace OpenSim.UserServer
{
public delegate bool AddNewSessionHandler(ulong regionHandle, Login loginData);
/// <summary>
/// When running in local (default) mode , handles client logins.
/// </summary>
public class LoginServer : LoginService, IUserServer
{
private IGridServer m_gridServer;
public IPAddress clientAddress = IPAddress.Loopback;
public IPAddress remoteAddress = IPAddress.Any;
private int NumClients;
private bool userAccounts = false;
private string _mpasswd;
private bool _needPasswd = false;
private LocalUserProfileManager userManager;
private int m_simPort;
private string m_simAddr;
private uint regionX;
private uint regionY;
private AddNewSessionHandler AddSession;
public LocalUserProfileManager LocalUserManager
{
get
{
return userManager;
}
}
public LoginServer( string simAddr, int simPort, uint regX, uint regY, bool useAccounts)
{
m_simPort = simPort;
m_simAddr = simAddr;
regionX = regX;
regionY = regY;
this.userAccounts = useAccounts;
}
public void SetSessionHandler(AddNewSessionHandler sessionHandler)
{
this.AddSession = sessionHandler;
this.userManager.SetSessionHandler(sessionHandler);
}
public void Startup()
{
this._needPasswd = false;
this._mpasswd = EncodePassword("testpass");
userManager = new LocalUserProfileManager(this.m_gridServer, m_simPort, m_simAddr, regionX, regionY);
//userManager.InitUserProfiles();
userManager.SetKeys("", "", "", "Welcome to OpenSim");
}
public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
{
Console.WriteLine("login attempt");
Hashtable requestData = (Hashtable)request.Params[0];
string first;
string last;
string passwd;
LoginResponse loginResponse = new LoginResponse();
loginResponse.RegionX = regionX;
loginResponse.RegionY = regionY;
//get login name
if (requestData.Contains("first"))
{
first = (string)requestData["first"];
}
else
{
first = "test";
}
if (requestData.Contains("last"))
{
last = (string)requestData["last"];
}
else
{
last = "User" + NumClients.ToString();
}
if (requestData.Contains("passwd"))
{
passwd = (string)requestData["passwd"];
}
else
{
passwd = "notfound";
}
if (!Authenticate(first, last, passwd))
{
return loginResponse.LoginFailedResponse();
}
NumClients++;
// Create a agent and session LLUUID
// Agent = GetAgentId(first, last);
// int SessionRand = Util.RandomClass.Next(1, 999);
// Session = new LLUUID("aaaabbbb-0200-" + SessionRand.ToString("0000") + "-8664-58f53e442797");
// LLUUID secureSess = LLUUID.Random();
loginResponse.SimPort = m_simPort.ToString();
loginResponse.SimAddress = m_simAddr.ToString();
// loginResponse.AgentID = Agent.ToStringHyphenated();
// loginResponse.SessionID = Session.ToStringHyphenated();
// loginResponse.SecureSessionID = secureSess.ToStringHyphenated();
loginResponse.CircuitCode = (Int32)(Util.RandomClass.Next());
XmlRpcResponse response = loginResponse.ToXmlRpcResponse();
Hashtable responseData = (Hashtable)response.Value;
//inventory
/* ArrayList InventoryList = (ArrayList)responseData["inventory-skeleton"];
Hashtable Inventory1 = (Hashtable)InventoryList[0];
Hashtable Inventory2 = (Hashtable)InventoryList[1];
LLUUID BaseFolderID = LLUUID.Random();
LLUUID InventoryFolderID = LLUUID.Random();
Inventory2["name"] = "Textures";
Inventory2["folder_id"] = BaseFolderID.ToStringHyphenated();
Inventory2["type_default"] = 0;
Inventory1["folder_id"] = InventoryFolderID.ToStringHyphenated();
ArrayList InventoryRoot = (ArrayList)responseData["inventory-root"];
Hashtable Inventoryroot = (Hashtable)InventoryRoot[0];
Inventoryroot["folder_id"] = InventoryFolderID.ToStringHyphenated();
*/
CustomiseLoginResponse(responseData, first, last);
Login _login = new Login();
//copy data to login object
_login.First = first;
_login.Last = last;
_login.Agent = loginResponse.AgentID;
_login.Session = loginResponse.SessionID;
_login.SecureSession = loginResponse.SecureSessionID;
_login.CircuitCode = (uint) loginResponse.CircuitCode;
_login.BaseFolder = loginResponse.BaseFolderID;
_login.InventoryFolder = loginResponse.InventoryFolderID;
//working on local computer if so lets add to the gridserver's list of sessions?
/* if (m_gridServer.GetName() == "Local")
{
((LocalGridBase)m_gridServer).AddNewSession(_login);
}*/
ulong reghand = Helpers.UIntsToLong((regionX * 256), (regionY * 256));
AddSession(reghand,_login);
return response;
}
protected virtual void CustomiseLoginResponse(Hashtable responseData, string first, string last)
{
}
protected virtual LLUUID GetAgentId(string firstName, string lastName)
{
LLUUID Agent;
int AgentRand = Util.RandomClass.Next(1, 9999);
Agent = new LLUUID("99998888-0100-" + AgentRand.ToString("0000") + "-8ec1-0b1d5cd6aead");
return Agent;
}
protected virtual bool Authenticate(string first, string last, string passwd)
{
if (this._needPasswd)
{
//every user needs the password to login
string encodedPass = passwd.Remove(0, 3); //remove $1$
if (encodedPass == this._mpasswd)
{
return true;
}
else
{
return false;
}
}
else
{
//do not need password to login
return true;
}
}
private static string EncodePassword(string passwd)
{
Byte[] originalBytes;
Byte[] encodedBytes;
MD5 md5;
md5 = new MD5CryptoServiceProvider();
originalBytes = ASCIIEncoding.Default.GetBytes(passwd);
encodedBytes = md5.ComputeHash(originalBytes);
return Regex.Replace(BitConverter.ToString(encodedBytes), "-", "").ToLower();
}
public bool CreateUserAccount(string firstName, string lastName, string password)
{
Console.WriteLine("creating new user account");
string mdPassword = EncodePassword(password);
Console.WriteLine("with password: " + mdPassword);
this.userManager.CreateNewProfile(firstName, lastName, mdPassword);
return true;
}
//IUserServer implementation
public AgentInventory RequestAgentsInventory(LLUUID agentID)
{
AgentInventory aInventory = null;
if (this.userAccounts)
{
aInventory = this.userManager.GetUsersInventory(agentID);
}
return aInventory;
}
public bool UpdateAgentsInventory(LLUUID agentID, AgentInventory inventory)
{
return true;
}
public void SetServerInfo(string ServerUrl, string SendKey, string RecvKey)
{
}
}
}

View File

@ -0,0 +1,130 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8BB20F0A-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenSim.Servers</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenSim.Servers</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
<Name>OpenSim.Framework</Name>
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
<Name>OpenSim.Framework.Console</Name>
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
<Name>XMLRPC</Name>
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="BaseHttpServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="BaseServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="CheckSumServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="IRestHandler.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="LocalUserProfileManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="LoginResponse.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="LoginServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="UDPServerBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcMethod.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,12 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -0,0 +1,52 @@
<?xml version="1.0" ?>
<project name="OpenSim.Servers" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenSim.Servers" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="BaseHttpServer.cs" />
<include name="BaseServer.cs" />
<include name="CheckSumServer.cs" />
<include name="IRestHandler.cs" />
<include name="LocalUserProfileManager.cs" />
<include name="LoginResponse.cs" />
<include name="LoginServer.cs" />
<include name="UDPServerBase.cs" />
<include name="XmlRpcMethod.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Xml.dll" />
<include name="../../bin/OpenSim.Framework.dll" />
<include name="../../bin/OpenSim.Framework.Console.dll" />
<include name="../../bin/libsecondlife.dll" />
<include name="../../bin/XMLRPC.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -0,0 +1,68 @@
using System;
using System.Text;
using System.IO;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.Timers;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using libsecondlife;
using libsecondlife.Packets;
namespace OpenSim.Servers
{
public class UDPServerBase
{
public Socket Server;
protected IPEndPoint ServerIncoming;
protected byte[] RecvBuffer = new byte[4096];
protected byte[] ZeroBuffer = new byte[8192];
protected IPEndPoint ipeSender;
protected EndPoint epSender;
protected AsyncCallback ReceivedData;
protected int listenPort;
public UDPServerBase(int port)
{
listenPort = port;
}
protected virtual void OnReceivedData(IAsyncResult result)
{
ipeSender = new IPEndPoint(IPAddress.Any, 0);
epSender = (EndPoint)ipeSender;
Packet packet = null;
int numBytes = Server.EndReceiveFrom(result, ref epSender);
int packetEnd = numBytes - 1;
packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
}
protected virtual void AddNewClient(Packet packet)
{
}
public virtual void ServerListener()
{
ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
Server.Bind(ServerIncoming);
ipeSender = new IPEndPoint(IPAddress.Any, 0);
epSender = (EndPoint)ipeSender;
ReceivedData = new AsyncCallback(this.OnReceivedData);
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
}
public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
{
}
}
}

View File

@ -0,0 +1,7 @@
using System;
using Nwc.XmlRpc;
namespace OpenSim.Servers
{
public delegate XmlRpcResponse XmlRpcMethod( XmlRpcRequest request );
}

46
Common/XmlRpcCS/Logger.cs Normal file
View File

@ -0,0 +1,46 @@
namespace Nwc.XmlRpc
{
using System;
/// <summary>Define levels of logging.</summary><remarks> This duplicates
/// similar enumerations in System.Diagnostics.EventLogEntryType. The
/// duplication was merited because .NET Compact Framework lacked the EventLogEntryType enum.</remarks>
public enum LogLevel
{
/// <summary>Information level, log entry for informational reasons only.</summary>
Information,
/// <summary>Warning level, indicates a possible problem.</summary>
Warning,
/// <summary>Error level, implies a significant problem.</summary>
Error
}
///<summary>
///Logging singleton with swappable output delegate.
///</summary>
///<remarks>
///This singleton provides a centralized log. The actual WriteEntry calls are passed
///off to a delegate however. Having a delegate do the actual logginh allows you to
///implement different logging mechanism and have them take effect throughout the system.
///</remarks>
public class Logger
{
///<summary>Delegate definition for logging.</summary>
///<param name="message">The message <c>String</c> to log.</param>
///<param name="level">The <c>LogLevel</c> of your message.</param>
public delegate void LoggerDelegate(String message, LogLevel level);
///<summary>The LoggerDelegate that will recieve WriteEntry requests.</summary>
static public LoggerDelegate Delegate = null;
///<summary>
///Method logging events are sent to.
///</summary>
///<param name="message">The message <c>String</c> to log.</param>
///<param name="level">The <c>LogLevel</c> of your message.</param>
static public void WriteEntry(String message, LogLevel level)
{
if (Delegate != null)
Delegate(message, level);
}
}
}

View File

@ -0,0 +1,204 @@
namespace Nwc.XmlRpc
{
using System;
using System.IO;
using System.Net.Sockets;
using System.Collections;
///<summary>Very basic HTTP request handler.</summary>
///<remarks>This class is designed to accept a TcpClient and treat it as an HTTP request.
/// It will do some basic header parsing and manage the input and output streams associated
/// with the request.</remarks>
public class SimpleHttpRequest
{
private String _httpMethod = null;
private String _protocol;
private String _filePathFile = null;
private String _filePathDir = null;
private String __filePath;
private TcpClient _client;
private StreamReader _input;
private StreamWriter _output;
private Hashtable _headers;
/// <summary>A constructor which accepts the TcpClient.</summary>
/// <remarks>It creates the associated input and output streams, determines the request type,
/// and parses the remaining HTTP header.</remarks>
/// <param name="client">The <c>TcpClient</c> associated with the HTTP connection.</param>
public SimpleHttpRequest(TcpClient client)
{
_client = client;
_output = new StreamWriter(client.GetStream());
_input = new StreamReader(client.GetStream());
GetRequestMethod();
GetRequestHeaders();
}
/// <summary>The output <c>StreamWriter</c> associated with the request.</summary>
public StreamWriter Output
{
get { return _output; }
}
/// <summary>The input <c>StreamReader</c> associated with the request.</summary>
public StreamReader Input
{
get { return _input; }
}
/// <summary>The <c>TcpClient</c> with the request.</summary>
public TcpClient Client
{
get { return _client; }
}
private String _filePath
{
get { return __filePath; }
set
{
__filePath = value;
_filePathDir = null;
_filePathFile = null;
}
}
/// <summary>The type of HTTP request (i.e. PUT, GET, etc.).</summary>
public String HttpMethod
{
get { return _httpMethod; }
}
/// <summary>The level of the HTTP protocol.</summary>
public String Protocol
{
get { return _protocol; }
}
/// <summary>The "path" which is part of any HTTP request.</summary>
public String FilePath
{
get { return _filePath; }
}
/// <summary>The file portion of the "path" which is part of any HTTP request.</summary>
public String FilePathFile
{
get
{
if (_filePathFile != null)
return _filePathFile;
int i = FilePath.LastIndexOf("/");
if (i == -1)
return "";
i++;
_filePathFile = FilePath.Substring(i, FilePath.Length - i);
return _filePathFile;
}
}
/// <summary>The directory portion of the "path" which is part of any HTTP request.</summary>
public String FilePathDir
{
get
{
if (_filePathDir != null)
return _filePathDir;
int i = FilePath.LastIndexOf("/");
if (i == -1)
return "";
i++;
_filePathDir = FilePath.Substring(0, i);
return _filePathDir;
}
}
private void GetRequestMethod()
{
string req = _input.ReadLine();
if (req == null)
throw new ApplicationException("Void request.");
if (0 == String.Compare("GET ", req.Substring(0, 4), true))
_httpMethod = "GET";
else if (0 == String.Compare("POST ", req.Substring(0, 5), true))
_httpMethod = "POST";
else
throw new InvalidOperationException("Unrecognized method in query: " + req);
req = req.TrimEnd();
int idx = req.IndexOf(' ') + 1;
if (idx >= req.Length)
throw new ApplicationException("What do you want?");
string page_protocol = req.Substring(idx);
int idx2 = page_protocol.IndexOf(' ');
if (idx2 == -1)
idx2 = page_protocol.Length;
_filePath = page_protocol.Substring(0, idx2).Trim();
_protocol = page_protocol.Substring(idx2).Trim();
}
private void GetRequestHeaders()
{
String line;
int idx;
_headers = new Hashtable();
while ((line = _input.ReadLine()) != "")
{
if (line == null)
{
break;
}
idx = line.IndexOf(':');
if (idx == -1 || idx == line.Length - 1)
{
Logger.WriteEntry("Malformed header line: " + line, LogLevel.Information);
continue;
}
String key = line.Substring(0, idx);
String value = line.Substring(idx + 1);
try
{
_headers.Add(key, value);
}
catch (Exception)
{
Logger.WriteEntry("Duplicate header key in line: " + line, LogLevel.Information);
}
}
}
/// <summary>
/// Format the object contents into a useful string representation.
/// </summary>
///<returns><c>String</c> representation of the <c>SimpleHttpRequest</c> as the <i>HttpMethod FilePath Protocol</i>.</returns>
override public String ToString()
{
return HttpMethod + " " + FilePath + " " + Protocol;
}
/// <summary>
/// Close the <c>SimpleHttpRequest</c>. This flushes and closes all associated io streams.
/// </summary>
public void Close()
{
_output.Flush();
_output.Close();
_input.Close();
_client.Close();
}
}
}

View File

@ -0,0 +1,138 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8E81D43C-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>XMLRPC</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>XMLRPC</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="Logger.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="SimpleHttpRequest.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcBoxcarRequest.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcClientProxy.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcDeserializer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcErrorCodes.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcException.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcExposedAttribute.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcRequest.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcRequestDeserializer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcRequestSerializer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcResponder.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcResponse.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcResponseDeserializer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcResponseSerializer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcSerializer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcSystemObject.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlRpcXmlTokens.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,12 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" ?>
<project name="XMLRPC" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="XMLRPC" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="Logger.cs" />
<include name="SimpleHttpRequest.cs" />
<include name="XmlRpcBoxcarRequest.cs" />
<include name="XmlRpcClientProxy.cs" />
<include name="XmlRpcDeserializer.cs" />
<include name="XmlRpcErrorCodes.cs" />
<include name="XmlRpcException.cs" />
<include name="XmlRpcExposedAttribute.cs" />
<include name="XmlRpcRequest.cs" />
<include name="XmlRpcRequestDeserializer.cs" />
<include name="XmlRpcRequestSerializer.cs" />
<include name="XmlRpcResponder.cs" />
<include name="XmlRpcResponse.cs" />
<include name="XmlRpcResponseDeserializer.cs" />
<include name="XmlRpcResponseSerializer.cs" />
<include name="XmlRpcSerializer.cs" />
<include name="XmlRpcServer.cs" />
<include name="XmlRpcSystemObject.cs" />
<include name="XmlRpcXmlTokens.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Xml.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -0,0 +1,51 @@
namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Net;
using System.Text;
using System.Reflection;
/// <summary>Class that collects individual <c>XmlRpcRequest</c> objects and submits them as a <i>boxcarred</i> request.</summary>
/// <remarks>A boxcared request is when a number of request are collected before being sent via XML-RPC, and then are sent via
/// a single HTTP connection. This results in a speed up from reduced connection time. The results are then retuned collectively
/// as well.
///</remarks>
/// <seealso cref="XmlRpcRequest"/>
public class XmlRpcBoxcarRequest : XmlRpcRequest
{
/// <summary>ArrayList to collect the requests to boxcar.</summary>
public IList Requests = new ArrayList();
/// <summary>Basic constructor.</summary>
public XmlRpcBoxcarRequest()
{
}
/// <summary>Returns the <c>String</c> "system.multiCall" which is the server method that handles boxcars.</summary>
public override String MethodName
{
get { return "system.multiCall"; }
}
/// <summary>The <c>ArrayList</c> of boxcarred <paramref>Requests</paramref> as properly formed parameters.</summary>
public override IList Params
{
get {
_params.Clear();
ArrayList reqArray = new ArrayList();
foreach (XmlRpcRequest request in Requests)
{
Hashtable requestEntry = new Hashtable();
requestEntry.Add(XmlRpcXmlTokens.METHOD_NAME, request.MethodName);
requestEntry.Add(XmlRpcXmlTokens.PARAMS, request.Params);
reqArray.Add(requestEntry);
}
_params.Add(reqArray);
return _params;
}
}
}
}

View File

@ -0,0 +1,61 @@
namespace Nwc.XmlRpc
{
using System;
using System.Runtime.Remoting.Proxies;
using System.Runtime.Remoting.Messaging;
/// <summary>This class provides support for creating local proxies of XML-RPC remote objects</summary>
/// <remarks>
/// To create a local proxy you need to create a local C# interface and then, via <i>createProxy</i>
/// associate that interface with a remote object at a given URL.
/// </remarks>
public class XmlRpcClientProxy : RealProxy
{
private String _remoteObjectName;
private String _url;
private XmlRpcRequest _client = new XmlRpcRequest();
/// <summary>Factory method to create proxies.</summary>
/// <remarks>
/// To create a local proxy you need to create a local C# interface with methods that mirror those of the server object.
/// Next, pass that interface into <c>createProxy</c> along with the object name and URL of the remote object and
/// cast the resulting object to the specifice interface.
/// </remarks>
/// <param name="remoteObjectName"><c>String</c> The name of the remote object.</param>
/// <param name="url"><c>String</c> The URL of the remote object.</param>
/// <param name="anInterface"><c>Type</c> The typeof() of a C# interface.</param>
/// <returns><c>Object</c> A proxy for your specified interface. Cast to appropriate type.</returns>
public static Object createProxy(String remoteObjectName, String url, Type anInterface)
{
return new XmlRpcClientProxy(remoteObjectName, url, anInterface).GetTransparentProxy();
}
private XmlRpcClientProxy(String remoteObjectName, String url, Type t) : base(t)
{
_remoteObjectName = remoteObjectName;
_url = url;
}
/// <summary>The local method dispatcher - do not invoke.</summary>
override public IMessage Invoke(IMessage msg)
{
IMethodCallMessage methodMessage = (IMethodCallMessage)msg;
_client.MethodName = _remoteObjectName + "." + methodMessage.MethodName;
_client.Params.Clear();
foreach (Object o in methodMessage.Args)
_client.Params.Add(o);
try
{
Object ret = _client.Invoke(_url);
return new ReturnMessage(ret,null,0,
methodMessage.LogicalCallContext, methodMessage);
}
catch (Exception e)
{
return new ReturnMessage(e, methodMessage);
}
}
}
}

View File

@ -0,0 +1,195 @@
namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Globalization;
/// <summary>Parser context, we maintain contexts in a stack to avoiding recursion. </summary>
struct Context
{
public String Name;
public Object Container;
}
/// <summary>Basic XML-RPC data deserializer.</summary>
/// <remarks>Uses <c>XmlTextReader</c> to parse the XML data. This level of the class
/// only handles the tokens common to both Requests and Responses. This class is not useful in and of itself
/// but is designed to be subclassed.</remarks>
public class XmlRpcDeserializer : XmlRpcXmlTokens
{
private static DateTimeFormatInfo _dateFormat = new DateTimeFormatInfo();
private Object _container;
private Stack _containerStack;
/// <summary>Protected reference to last text.</summary>
protected String _text;
/// <summary>Protected reference to last deserialized value.</summary>
protected Object _value;
/// <summary>Protected reference to last name field.</summary>
protected String _name;
/// <summary>Basic constructor.</summary>
public XmlRpcDeserializer()
{
Reset();
_dateFormat.FullDateTimePattern = ISO_DATETIME;
}
/// <summary>Static method that parses XML data into a response using the Singleton.</summary>
/// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC response.</param>
/// <returns><c>Object</c> object resulting from the deserialization.</returns>
virtual public Object Deserialize(TextReader xmlData)
{
return null;
}
/// <summary>Protected method to parse a node in an XML-RPC XML stream.</summary>
/// <remarks>Method deals with elements common to all XML-RPC data, subclasses of
/// this object deal with request/response spefic elements.</remarks>
/// <param name="reader"><c>XmlTextReader</c> of the in progress parsing data stream.</param>
protected void DeserializeNode(XmlTextReader reader)
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
if (Logger.Delegate != null)
Logger.WriteEntry("START " + reader.Name, LogLevel.Information);
switch (reader.Name)
{
case VALUE:
_value = null;
_text = null;
break;
case STRUCT:
PushContext();
_container = new Hashtable();
break;
case ARRAY:
PushContext();
_container = new ArrayList();
break;
}
break;
case XmlNodeType.EndElement:
if (Logger.Delegate != null)
Logger.WriteEntry("END " + reader.Name, LogLevel.Information);
switch (reader.Name)
{
case BASE64:
_value = Convert.FromBase64String(_text);
break;
case BOOLEAN:
int val = Int16.Parse(_text);
if (val == 0)
_value = false;
else if (val == 1)
_value = true;
break;
case STRING:
_value = _text;
break;
case DOUBLE:
_value = Double.Parse(_text);
break;
case INT:
case ALT_INT:
_value = Int32.Parse(_text);
break;
case DATETIME:
#if __MONO__
_value = DateParse(_text);
#else
_value = DateTime.ParseExact(_text, "F", _dateFormat);
#endif
break;
case NAME:
_name = _text;
break;
case VALUE:
if (_value == null)
_value = _text; // some kits don't use <string> tag, they just do <value>
if ((_container != null) && (_container is IList)) // in an array? If so add value to it.
((IList)_container).Add(_value);
break;
case MEMBER:
if ((_container != null) && (_container is IDictionary)) // in an struct? If so add value to it.
((IDictionary)_container).Add(_name, _value);
break;
case ARRAY:
case STRUCT:
_value = _container;
PopContext();
break;
}
break;
case XmlNodeType.Text:
if (Logger.Delegate != null)
Logger.WriteEntry("Text " + reader.Value, LogLevel.Information);
_text = reader.Value;
break;
default:
break;
}
}
/// <summary>Static method that parses XML in a <c>String</c> into a
/// request using the Singleton.</summary>
/// <param name="xmlData"><c>String</c> containing an XML-RPC request.</param>
/// <returns><c>XmlRpcRequest</c> object resulting from the parse.</returns>
public Object Deserialize(String xmlData)
{
StringReader sr = new StringReader(xmlData);
return Deserialize(sr);
}
/// <summary>Pop a Context of the stack, an Array or Struct has closed.</summary>
private void PopContext()
{
Context c = (Context)_containerStack.Pop();
_container = c.Container;
_name = c.Name;
}
/// <summary>Push a Context on the stack, an Array or Struct has opened.</summary>
private void PushContext()
{
Context context;
context.Container = _container;
context.Name = _name;
_containerStack.Push(context);
}
/// <summary>Reset the internal state of the deserializer.</summary>
protected void Reset()
{
_text = null;
_value = null;
_name = null;
_container = null;
_containerStack = new Stack();
}
#if __MONO__
private DateTime DateParse(String str)
{
int year = Int32.Parse(str.Substring(0,4));
int month = Int32.Parse(str.Substring(4,2));
int day = Int32.Parse(str.Substring(6,2));
int hour = Int32.Parse(str.Substring(9,2));
int min = Int32.Parse(str.Substring(12,2));
int sec = Int32.Parse(str.Substring(15,2));
return new DateTime(year,month,day,hour,min,sec);
}
#endif
}
}

View File

@ -0,0 +1,51 @@
namespace Nwc.XmlRpc
{
using System;
/// <summary>Standard XML-RPC error codes.</summary>
public class XmlRpcErrorCodes
{
/// <summary></summary>
public const int PARSE_ERROR_MALFORMED = -32700;
/// <summary></summary>
public const String PARSE_ERROR_MALFORMED_MSG = "Parse Error, not well formed";
/// <summary></summary>
public const int PARSE_ERROR_ENCODING = -32701;
/// <summary></summary>
public const String PARSE_ERROR_ENCODING_MSG = "Parse Error, unsupported encoding";
//
// -32702 ---> parse error. invalid character for encoding
// -32600 ---> server error. invalid xml-rpc. not conforming to spec.
//
/// <summary></summary>
public const int SERVER_ERROR_METHOD = -32601;
/// <summary></summary>
public const String SERVER_ERROR_METHOD_MSG = "Server Error, requested method not found";
/// <summary></summary>
public const int SERVER_ERROR_PARAMS = -32602;
/// <summary></summary>
public const String SERVER_ERROR_PARAMS_MSG = "Server Error, invalid method parameters";
//
// -32603 ---> server error. internal xml-rpc error
//
/// <summary></summary>
public const int APPLICATION_ERROR = -32500;
/// <summary></summary>
public const String APPLICATION_ERROR_MSG = "Application Error";
//
// -32400 ---> system error
//
/// <summary></summary>
public const int TRANSPORT_ERROR = -32300;
/// <summary></summary>
public const String TRANSPORT_ERROR_MSG = "Transport Layer Error";
}
}

View File

@ -0,0 +1,39 @@
namespace Nwc.XmlRpc
{
using System;
/// <summary>An XML-RPC Exception.</summary>
/// <remarks>Maps a C# exception to an XML-RPC fault. Normal exceptions
/// include a message so this adds the code needed by XML-RPC.</remarks>
public class XmlRpcException : Exception
{
private int _code;
/// <summary>Instantiate an <c>XmlRpcException</c> with a code and message.</summary>
/// <param name="code"><c>Int</c> faultCode associated with this exception.</param>
/// <param name="message"><c>String</c> faultMessage associated with this exception.</param>
public XmlRpcException(int code, String message)
: base(message)
{
_code = code;
}
/// <summary>The value of the faults message, i.e. the faultString.</summary>
public String FaultString
{
get { return Message; }
}
/// <summary>The value of the faults code, i.e. the faultCode.</summary>
public int FaultCode
{
get { return _code; }
}
/// <summary>Format the message to include the code.</summary>
override public String ToString()
{
return "Code: " + FaultCode + " Message: " + base.ToString();
}
}
}

View File

@ -0,0 +1,60 @@
namespace Nwc.XmlRpc
{
using System;
using System.Reflection;
/// <summary>
/// Simple tagging attribute to indicate participation is XML-RPC exposure.
/// </summary>
/// <remarks>
/// If present at the class level it indicates that this class does explicitly
/// expose methods. If present at the method level it denotes that the method
/// is exposed.
/// </remarks>
[AttributeUsage(
AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = false,
Inherited = true
)]
public class XmlRpcExposedAttribute : Attribute
{
/// <summary>Check if <paramref>obj</paramref> is an object utilizing the XML-RPC exposed Attribute.</summary>
/// <param name="obj"><c>Object</c> of a class or method to check for attribute.</param>
/// <returns><c>Boolean</c> true if attribute present.</returns>
public static Boolean ExposedObject(Object obj)
{
return IsExposed(obj.GetType());
}
/// <summary>Check if <paramref>obj</paramref>.<paramref>methodName</paramref> is an XML-RPC exposed method.</summary>
/// <remarks>A method is considered to be exposed if it exists and, either, the object does not use the XmlRpcExposed attribute,
/// or the object does use the XmlRpcExposed attribute and the method has the XmlRpcExposed attribute as well.</remarks>
/// <returns><c>Boolean</c> true if the method is exposed.</returns>
public static Boolean ExposedMethod(Object obj, String methodName)
{
Type type = obj.GetType();
MethodInfo method = type.GetMethod(methodName);
if (method == null)
throw new MissingMethodException("Method " + methodName + " not found.");
if (!IsExposed(type))
return true;
return IsExposed(method);
}
/// <summary>Check if <paramref>mi</paramref> is XML-RPC exposed.</summary>
/// <param name="mi"><c>MemberInfo</c> of a class or method to check for attribute.</param>
/// <returns><c>Boolean</c> true if attribute present.</returns>
public static Boolean IsExposed(MemberInfo mi)
{
foreach (Attribute attr in mi.GetCustomAttributes(true))
{
if (attr is XmlRpcExposedAttribute)
return true;
}
return false;
}
}
}

View File

@ -0,0 +1,150 @@
namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Net;
using System.Text;
using System.Reflection;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
internal class AcceptAllCertificatePolicy : ICertificatePolicy
{
public AcceptAllCertificatePolicy()
{
}
public bool CheckValidationResult(ServicePoint sPoint,
System.Security.Cryptography.X509Certificates.X509Certificate cert,
WebRequest wRequest, int certProb)
{
// Always accept
return true;
}
}
/// <summary>Class supporting the request side of an XML-RPC transaction.</summary>
public class XmlRpcRequest
{
private String _methodName = null;
private Encoding _encoding = new ASCIIEncoding();
private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer();
private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer();
/// <summary><c>ArrayList</c> containing the parameters.</summary>
protected IList _params = null;
/// <summary>Instantiate an <c>XmlRpcRequest</c></summary>
public XmlRpcRequest()
{
_params = new ArrayList();
}
/// <summary>Instantiate an <c>XmlRpcRequest</c> for a specified method and parameters.</summary>
/// <param name="methodName"><c>String</c> designating the <i>object.method</i> on the server the request
/// should be directed to.</param>
/// <param name="parameters"><c>ArrayList</c> of XML-RPC type parameters to invoke the request with.</param>
public XmlRpcRequest(String methodName, IList parameters)
{
MethodName = methodName;
_params = parameters;
}
/// <summary><c>ArrayList</c> conntaining the parameters for the request.</summary>
public virtual IList Params
{
get { return _params; }
}
/// <summary><c>String</c> conntaining the method name, both object and method, that the request will be sent to.</summary>
public virtual String MethodName
{
get { return _methodName; }
set { _methodName = value; }
}
/// <summary><c>String</c> object name portion of the method name.</summary>
public String MethodNameObject
{
get
{
int index = MethodName.IndexOf(".");
if (index == -1)
return MethodName;
return MethodName.Substring(0, index);
}
}
/// <summary><c>String</c> method name portion of the object.method name.</summary>
public String MethodNameMethod
{
get
{
int index = MethodName.IndexOf(".");
if (index == -1)
return MethodName;
return MethodName.Substring(index + 1, MethodName.Length - index - 1);
}
}
/// <summary>Invoke this request on the server.</summary>
/// <param name="url"><c>String</c> The url of the XML-RPC server.</param>
/// <returns><c>Object</c> The value returned from the method invocation on the server.</returns>
/// <exception cref="XmlRpcException">If an exception generated on the server side.</exception>
public Object Invoke(String url)
{
XmlRpcResponse res = Send(url, 10000);
if (res.IsFault)
throw new XmlRpcException(res.FaultCode, res.FaultString);
return res.Value;
}
/// <summary>Send the request to the server.</summary>
/// <param name="url"><c>String</c> The url of the XML-RPC server.</param>
/// <param name="timeout">Milliseconds before the connection times out.</param>
/// <returns><c>XmlRpcResponse</c> The response generated.</returns>
public XmlRpcResponse Send(String url, int timeout)
{
// Override SSL authentication mechanisms
ServicePointManager.CertificatePolicy = new AcceptAllCertificatePolicy();
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
if (request == null)
throw new XmlRpcException(XmlRpcErrorCodes.TRANSPORT_ERROR,
XmlRpcErrorCodes.TRANSPORT_ERROR_MSG + ": Could not create request with " + url);
request.Method = "POST";
request.ContentType = "text/xml";
request.AllowWriteStreamBuffering = true;
request.Timeout = timeout;
Stream stream = request.GetRequestStream();
XmlTextWriter xml = new XmlTextWriter(stream, _encoding);
_serializer.Serialize(xml, this);
xml.Flush();
xml.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader input = new StreamReader(response.GetResponseStream());
XmlRpcResponse resp = (XmlRpcResponse)_deserializer.Deserialize(input);
input.Close();
response.Close();
return resp;
}
/// <summary>Produce <c>String</c> representation of the object.</summary>
/// <returns><c>String</c> representation of the object.</returns>
override public String ToString()
{
return _serializer.Serialize(this);
}
}
}

View File

@ -0,0 +1,64 @@
namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Xml;
/// <summary>Class to deserialize XML data representing a request.</summary>
public class XmlRpcRequestDeserializer : XmlRpcDeserializer
{
static private XmlRpcRequestDeserializer _singleton;
/// <summary>A static singleton instance of this deserializer.</summary>
[Obsolete("This object is now thread safe, just use an instance.", false)]
static public XmlRpcRequestDeserializer Singleton
{
get
{
if (_singleton == null)
_singleton = new XmlRpcRequestDeserializer();
return _singleton;
}
}
/// <summary>Static method that parses XML data into a request using the Singleton.</summary>
/// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC request.</param>
/// <returns><c>XmlRpcRequest</c> object resulting from the parse.</returns>
override public Object Deserialize(TextReader xmlData)
{
XmlTextReader reader = new XmlTextReader(xmlData);
XmlRpcRequest request = new XmlRpcRequest();
bool done = false;
lock (this)
{
Reset();
while (!done && reader.Read())
{
DeserializeNode(reader); // Parent parse...
switch (reader.NodeType)
{
case XmlNodeType.EndElement:
switch (reader.Name)
{
case METHOD_NAME:
request.MethodName = _text;
break;
case METHOD_CALL:
done = true;
break;
case PARAM:
request.Params.Add(_value);
_text = null;
break;
}
break;
}
}
}
return request;
}
}
}

View File

@ -0,0 +1,51 @@
namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.Xml;
using System.IO;
/// <summary>Class responsible for serializing an XML-RPC request.</summary>
/// <remarks>This class handles the request envelope, depending on <c>XmlRpcSerializer</c>
/// to serialize the payload.</remarks>
/// <seealso cref="XmlRpcSerializer"/>
public class XmlRpcRequestSerializer : XmlRpcSerializer
{
static private XmlRpcRequestSerializer _singleton;
/// <summary>A static singleton instance of this deserializer.</summary>
static public XmlRpcRequestSerializer Singleton
{
get
{
if (_singleton == null)
_singleton = new XmlRpcRequestSerializer();
return _singleton;
}
}
/// <summary>Serialize the <c>XmlRpcRequest</c> to the output stream.</summary>
/// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
/// <param name="obj">An <c>XmlRpcRequest</c> to serialize.</param>
/// <seealso cref="XmlRpcRequest"/>
override public void Serialize(XmlTextWriter output, Object obj)
{
XmlRpcRequest request = (XmlRpcRequest)obj;
output.WriteStartDocument();
output.WriteStartElement(METHOD_CALL);
output.WriteElementString(METHOD_NAME, request.MethodName);
output.WriteStartElement(PARAMS);
foreach (Object param in request.Params)
{
output.WriteStartElement(PARAM);
output.WriteStartElement(VALUE);
SerializeObject(output, param);
output.WriteEndElement();
output.WriteEndElement();
}
output.WriteEndElement();
output.WriteEndElement();
}
}
}

View File

@ -0,0 +1,98 @@
namespace Nwc.XmlRpc
{
using System;
using System.Xml;
using System.Net.Sockets;
/// <summary>The class is a container of the context of an XML-RPC dialog on the server side.</summary>
/// <remarks>Instances of this class maintain the context for an individual XML-RPC server
/// side dialog. Namely they manage an inbound deserializer and an outbound serializer. </remarks>
public class XmlRpcResponder
{
private XmlRpcRequestDeserializer _deserializer = new XmlRpcRequestDeserializer();
private XmlRpcResponseSerializer _serializer = new XmlRpcResponseSerializer();
private XmlRpcServer _server;
private TcpClient _client;
private SimpleHttpRequest _httpReq;
/// <summary>The SimpleHttpRequest based on the TcpClient.</summary>
public SimpleHttpRequest HttpReq
{
get { return _httpReq; }
}
/// <summary>Basic constructor.</summary>
/// <param name="server">XmlRpcServer that this XmlRpcResponder services.</param>
/// <param name="client">TcpClient with the connection.</param>
public XmlRpcResponder(XmlRpcServer server, TcpClient client)
{
_server = server;
_client = client;
_httpReq = new SimpleHttpRequest(_client);
}
/// <summary>Call close to insure proper shutdown.</summary>
~XmlRpcResponder()
{
Close();
}
///<summary>Respond using this responders HttpReq.</summary>
public void Respond()
{
Respond(HttpReq);
}
/// <summary>Handle an HTTP request containing an XML-RPC request.</summary>
/// <remarks>This method deserializes the XML-RPC request, invokes the
/// described method, serializes the response (or fault) and sends the XML-RPC response
/// back as a valid HTTP page.
/// </remarks>
/// <param name="httpReq"><c>SimpleHttpRequest</c> containing the request.</param>
public void Respond(SimpleHttpRequest httpReq)
{
XmlRpcRequest xmlRpcReq = (XmlRpcRequest)_deserializer.Deserialize(httpReq.Input);
XmlRpcResponse xmlRpcResp = new XmlRpcResponse();
try
{
xmlRpcResp.Value = _server.Invoke(xmlRpcReq);
}
catch (XmlRpcException e)
{
xmlRpcResp.SetFault(e.FaultCode, e.FaultString);
}
catch (Exception e2)
{
xmlRpcResp.SetFault(XmlRpcErrorCodes.APPLICATION_ERROR,
XmlRpcErrorCodes.APPLICATION_ERROR_MSG + ": " + e2.Message);
}
if (Logger.Delegate != null)
Logger.WriteEntry(xmlRpcResp.ToString(), LogLevel.Information);
XmlRpcServer.HttpHeader(httpReq.Protocol, "text/xml", 0, " 200 OK", httpReq.Output);
httpReq.Output.Flush();
XmlTextWriter xml = new XmlTextWriter(httpReq.Output);
_serializer.Serialize(xml, xmlRpcResp);
xml.Flush();
httpReq.Output.Flush();
}
///<summary>Close all contained resources, both the HttpReq and client.</summary>
public void Close()
{
if (_httpReq != null)
{
_httpReq.Close();
_httpReq = null;
}
if (_client != null)
{
_client.Close();
_client = null;
}
}
}
}

View File

@ -0,0 +1,85 @@
namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.IO;
using System.Xml;
/// <summary>Class designed to represent an XML-RPC response.</summary>
public class XmlRpcResponse
{
private Object _value;
/// <summary><c>bool</c> indicating if this response represents a fault.</summary>
public bool IsFault;
/// <summary>Basic constructor</summary>
public XmlRpcResponse()
{
Value = null;
IsFault = false;
}
/// <summary>Constructor for a fault.</summary>
/// <param name="code"><c>int</c> the numeric faultCode value.</param>
/// <param name="message"><c>String</c> the faultString value.</param>
public XmlRpcResponse(int code, String message)
: this()
{
SetFault(code, message);
}
/// <summary>The data value of the response, may be fault data.</summary>
public Object Value
{
get { return _value; }
set
{
IsFault = false;
_value = value;
}
}
/// <summary>The faultCode if this is a fault.</summary>
public int FaultCode
{
get
{
if (!IsFault)
return 0;
else
return (int)((Hashtable)_value)[XmlRpcXmlTokens.FAULT_CODE];
}
}
/// <summary>The faultString if this is a fault.</summary>
public String FaultString
{
get
{
if (!IsFault)
return "";
else
return (String)((Hashtable)_value)[XmlRpcXmlTokens.FAULT_STRING];
}
}
/// <summary>Set this response to be a fault.</summary>
/// <param name="code"><c>int</c> the numeric faultCode value.</param>
/// <param name="message"><c>String</c> the faultString value.</param>
public void SetFault(int code, String message)
{
Hashtable fault = new Hashtable();
fault.Add("faultCode", code);
fault.Add("faultString", message);
Value = fault;
IsFault = true;
}
/// <summary>Form a useful string representation of the object, in this case the XML response.</summary>
/// <returns><c>String</c> The XML serialized XML-RPC response.</returns>
override public String ToString()
{
return XmlRpcResponseSerializer.Singleton.Serialize(this);
}
}
}

View File

@ -0,0 +1,65 @@
namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.IO;
using System.Xml;
/// <summary>Class to deserialize XML data representing a response.</summary>
public class XmlRpcResponseDeserializer : XmlRpcDeserializer
{
static private XmlRpcResponseDeserializer _singleton;
/// <summary>A static singleton instance of this deserializer.</summary>
[Obsolete("This object is now thread safe, just use an instance.", false)]
static public XmlRpcResponseDeserializer Singleton
{
get
{
if (_singleton == null)
_singleton = new XmlRpcResponseDeserializer();
return _singleton;
}
}
/// <summary>Static method that parses XML data into a response using the Singleton.</summary>
/// <param name="xmlData"><c>StreamReader</c> containing an XML-RPC response.</param>
/// <returns><c>XmlRpcResponse</c> object resulting from the parse.</returns>
override public Object Deserialize(TextReader xmlData)
{
XmlTextReader reader = new XmlTextReader(xmlData);
XmlRpcResponse response = new XmlRpcResponse();
bool done = false;
lock (this)
{
Reset();
while (!done && reader.Read())
{
DeserializeNode(reader); // Parent parse...
switch (reader.NodeType)
{
case XmlNodeType.EndElement:
switch (reader.Name)
{
case FAULT:
response.Value = _value;
response.IsFault = true;
break;
case PARAM:
response.Value = _value;
_value = null;
_text = null;
break;
}
break;
default:
break;
}
}
}
return response;
}
}
}

View File

@ -0,0 +1,57 @@
namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.Xml;
/// <summary>Class responsible for serializing an XML-RPC response.</summary>
/// <remarks>This class handles the response envelope, depending on XmlRpcSerializer
/// to serialize the payload.</remarks>
/// <seealso cref="XmlRpcSerializer"/>
public class XmlRpcResponseSerializer : XmlRpcSerializer
{
static private XmlRpcResponseSerializer _singleton;
/// <summary>A static singleton instance of this deserializer.</summary>
static public XmlRpcResponseSerializer Singleton
{
get
{
if (_singleton == null)
_singleton = new XmlRpcResponseSerializer();
return _singleton;
}
}
/// <summary>Serialize the <c>XmlRpcResponse</c> to the output stream.</summary>
/// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
/// <param name="obj">An <c>Object</c> to serialize.</param>
/// <seealso cref="XmlRpcResponse"/>
override public void Serialize(XmlTextWriter output, Object obj)
{
XmlRpcResponse response = (XmlRpcResponse)obj;
output.WriteStartDocument();
output.WriteStartElement(METHOD_RESPONSE);
if (response.IsFault)
output.WriteStartElement(FAULT);
else
{
output.WriteStartElement(PARAMS);
output.WriteStartElement(PARAM);
}
output.WriteStartElement(VALUE);
SerializeObject(output, response.Value);
output.WriteEndElement();
output.WriteEndElement();
if (!response.IsFault)
output.WriteEndElement();
output.WriteEndElement();
}
}
}

View File

@ -0,0 +1,109 @@
namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.IO;
using System.Xml;
/// <summary>Base class of classes serializing data to XML-RPC's XML format.</summary>
/// <remarks>This class handles the basic type conversions like Integer to &lt;i4&gt;. </remarks>
/// <seealso cref="XmlRpcXmlTokens"/>
public class XmlRpcSerializer : XmlRpcXmlTokens
{
/// <summary>Serialize the <c>XmlRpcRequest</c> to the output stream.</summary>
/// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
/// <param name="obj">An <c>Object</c> to serialize.</param>
/// <seealso cref="XmlRpcRequest"/>
virtual public void Serialize(XmlTextWriter output, Object obj)
{
}
/// <summary>Serialize the <c>XmlRpcRequest</c> to a String.</summary>
/// <remarks>Note this may represent a real memory hog for a large request.</remarks>
/// <param name="obj">An <c>Object</c> to serialize.</param>
/// <returns><c>String</c> containing XML-RPC representation of the request.</returns>
/// <seealso cref="XmlRpcRequest"/>
public String Serialize(Object obj)
{
StringWriter strBuf = new StringWriter();
XmlTextWriter xml = new XmlTextWriter(strBuf);
xml.Formatting = Formatting.Indented;
xml.Indentation = 4;
Serialize(xml, obj);
xml.Flush();
String returns = strBuf.ToString();
xml.Close();
return returns;
}
/// <remarks>Serialize the object to the output stream.</remarks>
/// <param name="output">An <c>XmlTextWriter</c> stream to write data to.</param>
/// <param name="obj">An <c>Object</c> to serialize.</param>
public void SerializeObject(XmlTextWriter output, Object obj)
{
if (obj == null)
return;
if (obj is byte[])
{
byte[] ba = (byte[])obj;
output.WriteStartElement(BASE64);
output.WriteBase64(ba, 0, ba.Length);
output.WriteEndElement();
}
else if (obj is String)
{
output.WriteElementString(STRING, obj.ToString());
}
else if (obj is Int32)
{
output.WriteElementString(INT, obj.ToString());
}
else if (obj is DateTime)
{
output.WriteElementString(DATETIME, ((DateTime)obj).ToString(ISO_DATETIME));
}
else if (obj is Double)
{
output.WriteElementString(DOUBLE, obj.ToString());
}
else if (obj is Boolean)
{
output.WriteElementString(BOOLEAN, ((((Boolean)obj) == true) ? "1" : "0"));
}
else if (obj is IList)
{
output.WriteStartElement(ARRAY);
output.WriteStartElement(DATA);
if (((ArrayList)obj).Count > 0)
{
foreach (Object member in ((IList)obj))
{
output.WriteStartElement(VALUE);
SerializeObject(output, member);
output.WriteEndElement();
}
}
output.WriteEndElement();
output.WriteEndElement();
}
else if (obj is IDictionary)
{
IDictionary h = (IDictionary)obj;
output.WriteStartElement(STRUCT);
foreach (String key in h.Keys)
{
output.WriteStartElement(MEMBER);
output.WriteElementString(NAME, key);
output.WriteStartElement(VALUE);
SerializeObject(output, h[key]);
output.WriteEndElement();
output.WriteEndElement();
}
output.WriteEndElement();
}
}
}
}

View File

@ -0,0 +1,239 @@
namespace Nwc.XmlRpc
{
using System;
using System.Collections;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Xml;
/// <summary>A restricted HTTP server for use with XML-RPC.</summary>
/// <remarks>It only handles POST requests, and only POSTs representing XML-RPC calls.
/// In addition to dispatching requests it also provides a registry for request handlers.
/// </remarks>
public class XmlRpcServer : IEnumerable
{
#pragma warning disable 0414 // disable "private field assigned but not used"
const int RESPONDER_COUNT = 10;
private TcpListener _myListener;
private int _port;
private IPAddress _address;
private IDictionary _handlers;
private XmlRpcSystemObject _system;
private WaitCallback _wc;
#pragma warning restore 0414
///<summary>Constructor with port and address.</summary>
///<remarks>This constructor sets up a TcpListener listening on the
///given port and address. It also calls a Thread on the method StartListen().</remarks>
///<param name="address"><c>IPAddress</c> value of the address to listen on.</param>
///<param name="port"><c>Int</c> value of the port to listen on.</param>
public XmlRpcServer(IPAddress address, int port)
{
_port = port;
_address = address;
_handlers = new Hashtable();
_system = new XmlRpcSystemObject(this);
_wc = new WaitCallback(WaitCallback);
}
///<summary>Basic constructor.</summary>
///<remarks>This constructor sets up a TcpListener listening on the
///given port. It also calls a Thread on the method StartListen(). IPAddress.Any
///is assumed as the address here.</remarks>
///<param name="port"><c>Int</c> value of the port to listen on.</param>
public XmlRpcServer(int port) : this(IPAddress.Any, port) { }
/// <summary>Start the server.</summary>
public void Start()
{
try
{
Stop();
//start listing on the given port
// IPAddress addr = IPAddress.Parse("127.0.0.1");
lock (this)
{
_myListener = new TcpListener(IPAddress.Any, _port);
_myListener.Start();
//start the thread which calls the method 'StartListen'
Thread th = new Thread(new ThreadStart(StartListen));
th.Start();
}
}
catch (Exception e)
{
Logger.WriteEntry("An Exception Occurred while Listening :" + e.ToString(), LogLevel.Error);
}
}
/// <summary>Stop the server.</summary>
public void Stop()
{
try
{
if (_myListener != null)
{
lock (this)
{
_myListener.Stop();
_myListener = null;
}
}
}
catch (Exception e)
{
Logger.WriteEntry("An Exception Occurred while stopping :" +
e.ToString(), LogLevel.Error);
}
}
/// <summary>Get an enumeration of my XML-RPC handlers.</summary>
/// <returns><c>IEnumerable</c> the handler enumeration.</returns>
public IEnumerator GetEnumerator()
{
return _handlers.GetEnumerator();
}
/// <summary>Retrieve a handler by name.</summary>
/// <param name="name"><c>String</c> naming a handler</param>
/// <returns><c>Object</c> that is the handler.</returns>
public Object this[String name]
{
get { return _handlers[name]; }
}
///<summary>
///This method Accepts new connections and dispatches them when appropriate.
///</summary>
public void StartListen()
{
while (true && _myListener != null)
{
//Accept a new connection
XmlRpcResponder responder = new XmlRpcResponder(this, _myListener.AcceptTcpClient());
ThreadPool.QueueUserWorkItem(_wc, responder);
}
}
///<summary>
///Add an XML-RPC handler object by name.
///</summary>
///<param name="name"><c>String</c> XML-RPC dispatch name of this object.</param>
///<param name="obj"><c>Object</c> The object that is the XML-RPC handler.</param>
public void Add(String name, Object obj)
{
_handlers.Add(name, obj);
}
///<summary>Return a C# object.method name for and XML-RPC object.method name pair.</summary>
///<param name="methodName">The XML-RPC object.method.</param>
///<returns><c>String</c> of form object.method for the underlying C# method.</returns>
public String MethodName(String methodName)
{
int dotAt = methodName.LastIndexOf('.');
if (dotAt == -1)
{
throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Bad method name " + methodName);
}
String objectName = methodName.Substring(0, dotAt);
Object target = _handlers[objectName];
if (target == null)
{
throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found");
}
return target.GetType().FullName + "." + methodName.Substring(dotAt + 1);
}
///<summary>Invoke a method described in a request.</summary>
///<param name="req"><c>XmlRpcRequest</c> containing a method descriptions.</param>
/// <seealso cref="XmlRpcSystemObject.Invoke"/>
/// <seealso cref="XmlRpcServer.Invoke(String,String,IList)"/>
public Object Invoke(XmlRpcRequest req)
{
return Invoke(req.MethodNameObject, req.MethodNameMethod, req.Params);
}
///<summary>Invoke a method on a named handler.</summary>
///<param name="objectName"><c>String</c> The name of the handler.</param>
///<param name="methodName"><c>String</c> The name of the method to invoke on the handler.</param>
///<param name="parameters"><c>IList</c> The parameters to invoke the method with.</param>
/// <seealso cref="XmlRpcSystemObject.Invoke"/>
public Object Invoke(String objectName, String methodName, IList parameters)
{
Object target = _handlers[objectName];
if (target == null)
{
throw new XmlRpcException(XmlRpcErrorCodes.SERVER_ERROR_METHOD,
XmlRpcErrorCodes.SERVER_ERROR_METHOD_MSG + ": Object " + objectName + " not found");
}
return XmlRpcSystemObject.Invoke(target, methodName, parameters);
}
/// <summary>The method the thread pool invokes when a thread is available to handle an HTTP request.</summary>
/// <param name="responder">TcpClient from the socket accept.</param>
public void WaitCallback(object responder)
{
XmlRpcResponder resp = (XmlRpcResponder)responder;
if (resp.HttpReq.HttpMethod == "POST")
{
try
{
resp.Respond();
}
catch (Exception e)
{
Logger.WriteEntry("Failed on post: " + e, LogLevel.Error);
}
}
else
{
Logger.WriteEntry("Only POST methods are supported: " + resp.HttpReq.HttpMethod +
" ignored", LogLevel.Error);
}
resp.Close();
}
/// <summary>
/// This function send the Header Information to the client (Browser)
/// </summary>
/// <param name="sHttpVersion">HTTP Version</param>
/// <param name="sMIMEHeader">Mime Type</param>
/// <param name="iTotBytes">Total Bytes to be sent in the body</param>
/// <param name="sStatusCode"></param>
/// <param name="output">Socket reference</param>
static public void HttpHeader(string sHttpVersion, string sMIMEHeader, long iTotBytes, string sStatusCode, TextWriter output)
{
String sBuffer = "";
// if Mime type is not provided set default to text/html
if (sMIMEHeader.Length == 0)
{
sMIMEHeader = "text/html"; // Default Mime Type is text/html
}
sBuffer += sHttpVersion + sStatusCode + "\r\n";
sBuffer += "Connection: close\r\n";
if (iTotBytes > 0)
sBuffer += "Content-Length: " + iTotBytes + "\r\n";
sBuffer += "Server: XmlRpcServer \r\n";
sBuffer += "Content-Type: " + sMIMEHeader + "\r\n";
sBuffer += "\r\n";
output.Write(sBuffer);
}
}
}

Some files were not shown because too many files have changed in this diff Show More